@rocket.chat/fuselage-forms 1.3.0 → 1.5.0
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/cjs/Field/Field.d.ts +2 -2
- package/dist/cjs/Field/Field.d.ts.map +1 -1
- package/dist/cjs/Field/FieldContext.d.ts +1 -2
- package/dist/cjs/Field/FieldContext.d.ts.map +1 -1
- package/dist/cjs/Field/FieldContext.js +4 -0
- package/dist/cjs/Field/FieldContext.js.map +1 -1
- package/dist/cjs/Field/FieldDescription.d.ts +2 -2
- package/dist/cjs/Field/FieldDescription.d.ts.map +1 -1
- package/dist/cjs/Field/FieldError.d.ts +2 -2
- package/dist/cjs/Field/FieldError.d.ts.map +1 -1
- package/dist/cjs/Field/FieldHint.d.ts +2 -2
- package/dist/cjs/Field/FieldHint.d.ts.map +1 -1
- package/dist/cjs/Field/FieldProvider.d.ts +2 -2
- package/dist/cjs/Field/FieldProvider.d.ts.map +1 -1
- package/dist/cjs/Field/Label/FieldLabel.d.ts +2 -2
- package/dist/cjs/Field/Label/FieldLabel.d.ts.map +1 -1
- package/dist/cjs/Field/Label/FieldLabel.js +1 -0
- package/dist/cjs/Field/Label/FieldLabel.js.map +1 -1
- package/dist/cjs/Field/Label/HiddenLabel.d.ts +2 -2
- package/dist/cjs/Field/Label/HiddenLabel.d.ts.map +1 -1
- package/dist/cjs/Field/Label/LabelFor.d.ts +2 -2
- package/dist/cjs/Field/Label/LabelFor.d.ts.map +1 -1
- package/dist/cjs/Field/Label/ReferencedLabel.d.ts +2 -2
- package/dist/cjs/Field/Label/ReferencedLabel.d.ts.map +1 -1
- package/dist/cjs/Field/Label/index.d.ts +4 -4
- package/dist/cjs/Field/Label/index.d.ts.map +1 -1
- package/dist/cjs/Field/Label/index.js.map +1 -1
- package/dist/cjs/Field/index.d.ts +5 -5
- package/dist/cjs/Field/index.d.ts.map +1 -1
- package/dist/cjs/Field/index.js.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts +108 -76
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.js +7 -3
- package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.d.ts +17 -5
- package/dist/cjs/Inputs/withLabelHelpers.d.ts.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.js +14 -13
- package/dist/cjs/Inputs/withLabelHelpers.js.map +1 -1
- package/dist/esm/Field/Field.d.ts +2 -2
- package/dist/esm/Field/Field.d.ts.map +1 -1
- package/dist/esm/Field/FieldContext.d.ts +1 -2
- package/dist/esm/Field/FieldContext.d.ts.map +1 -1
- package/dist/esm/Field/FieldContext.js +4 -0
- package/dist/esm/Field/FieldContext.js.map +1 -1
- package/dist/esm/Field/FieldDescription.d.ts +2 -2
- package/dist/esm/Field/FieldDescription.d.ts.map +1 -1
- package/dist/esm/Field/FieldError.d.ts +2 -2
- package/dist/esm/Field/FieldError.d.ts.map +1 -1
- package/dist/esm/Field/FieldHint.d.ts +2 -2
- package/dist/esm/Field/FieldHint.d.ts.map +1 -1
- package/dist/esm/Field/FieldProvider.d.ts +2 -2
- package/dist/esm/Field/FieldProvider.d.ts.map +1 -1
- package/dist/esm/Field/Label/FieldLabel.d.ts +2 -2
- package/dist/esm/Field/Label/FieldLabel.d.ts.map +1 -1
- package/dist/esm/Field/Label/FieldLabel.js +1 -0
- package/dist/esm/Field/Label/FieldLabel.js.map +1 -1
- package/dist/esm/Field/Label/HiddenLabel.d.ts +2 -2
- package/dist/esm/Field/Label/HiddenLabel.d.ts.map +1 -1
- package/dist/esm/Field/Label/LabelFor.d.ts +2 -2
- package/dist/esm/Field/Label/LabelFor.d.ts.map +1 -1
- package/dist/esm/Field/Label/ReferencedLabel.d.ts +2 -2
- package/dist/esm/Field/Label/ReferencedLabel.d.ts.map +1 -1
- package/dist/esm/Field/Label/index.d.ts +4 -4
- package/dist/esm/Field/Label/index.d.ts.map +1 -1
- package/dist/esm/Field/Label/index.js.map +1 -1
- package/dist/esm/Field/index.d.ts +5 -5
- package/dist/esm/Field/index.d.ts.map +1 -1
- package/dist/esm/Field/index.js.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.d.ts +108 -76
- package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.js +7 -3
- package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.d.ts +17 -5
- package/dist/esm/Inputs/withLabelHelpers.d.ts.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.js +14 -13
- package/dist/esm/Inputs/withLabelHelpers.js.map +1 -1
- package/dist/esm/tsdoc-metadata.json +11 -0
- package/package.json +22 -20
|
@@ -1,80 +1,112 @@
|
|
|
1
1
|
import { AutoComplete as AutoCompleteComponent, Slider as SliderComponent } from '@rocket.chat/fuselage';
|
|
2
|
-
export declare const TextInput:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare const EmailInput:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export declare const PasswordInput:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
2
|
+
export declare const TextInput: {
|
|
3
|
+
(props: import("@rocket.chat/fuselage").TextInputProps & import("react").RefAttributes<any>): import("react").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const EmailInput: {
|
|
7
|
+
(props: import("@rocket.chat/fuselage").EmailInputProps & import("react").RefAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const PasswordInput: {
|
|
11
|
+
(props: import("@rocket.chat/fuselage").PasswordInputProps & import("react").RefAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const SearchInput: {
|
|
15
|
+
(props: import("@rocket.chat/fuselage").SearchInputProps & import("react").RefAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const TextAreaInput: {
|
|
19
|
+
(props: import("@rocket.chat/fuselage").TextAreaInputProps & import("react").RefAttributes<HTMLTextAreaElement>): import("react").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const NumberInput: {
|
|
23
|
+
(props: import("@rocket.chat/fuselage").NumberInputProps & import("react").RefAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const UrlInput: {
|
|
27
|
+
(props: import("@rocket.chat/fuselage").UrlInputProps & import("react").RefAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const Select: {
|
|
31
|
+
(props: Omit<import("react-aria").AriaSelectProps<unknown>, "children" | "value" | "onChange"> & import("react").RefAttributes<HTMLElement> & {
|
|
32
|
+
error?: string;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
value?: import("react").Key | null | undefined;
|
|
35
|
+
onChange?: ((key: import("react").Key) => any) | undefined;
|
|
36
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
37
|
+
small?: boolean;
|
|
38
|
+
} & Omit<import("react").AllHTMLAttributes<HTMLElement>, "value" | "onChange">): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
34
41
|
export declare const AutoComplete: typeof AutoCompleteComponent;
|
|
35
|
-
export declare const MultiSelect:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
export declare const MultiSelect: {
|
|
43
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
44
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
45
|
+
error?: string;
|
|
46
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
47
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
48
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
49
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
50
|
+
customEmpty?: string;
|
|
51
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
52
|
+
renderOptions?: import("react").ElementType;
|
|
53
|
+
renderItem?: import("react").ElementType;
|
|
54
|
+
renderSelected?: import("react").ElementType<{
|
|
55
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
56
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
57
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
58
|
+
children: import("react").ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
61
|
+
setFilter?: (filter: string) => void;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const MultiSelectFiltered: {
|
|
66
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
67
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
68
|
+
error?: string;
|
|
69
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
70
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
71
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
72
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
73
|
+
customEmpty?: string;
|
|
74
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
75
|
+
renderOptions?: import("react").ElementType;
|
|
76
|
+
renderItem?: import("react").ElementType;
|
|
77
|
+
renderSelected?: import("react").ElementType<{
|
|
78
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
79
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
80
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
81
|
+
children: import("react").ReactNode;
|
|
82
|
+
}>;
|
|
83
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
84
|
+
setFilter?: (filter: string) => void;
|
|
85
|
+
} & {
|
|
86
|
+
filter?: string;
|
|
87
|
+
setFilter?: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
88
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
89
|
+
}): import("react").JSX.Element;
|
|
90
|
+
displayName: string;
|
|
91
|
+
};
|
|
69
92
|
export declare const Slider: typeof SliderComponent;
|
|
70
|
-
export declare const CheckBox:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
export declare const
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
export declare const CheckBox: {
|
|
94
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
95
|
+
indeterminate?: boolean;
|
|
96
|
+
labelChildren?: import("react").ReactNode;
|
|
97
|
+
} & import("react").AllHTMLAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
98
|
+
displayName: string;
|
|
99
|
+
};
|
|
100
|
+
export declare const ToggleSwitch: {
|
|
101
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
102
|
+
labelChildren?: import("react").ReactNode;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
106
|
+
export declare const RadioButton: {
|
|
107
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
108
|
+
labelChildren?: import("react").ReactNode;
|
|
109
|
+
}): import("react").JSX.Element;
|
|
110
|
+
displayName: string;
|
|
111
|
+
};
|
|
80
112
|
//# sourceMappingURL=WrappedInputComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,YAAY,IAAI,qBAAqB,EAGrC,MAAM,IAAI,eAAe,EAC1B,MAAM,uBAAuB,CAAC;AAY/B,eAAO,MAAM,SAAS;;;CAAkC,CAAC;AACzD,eAAO,MAAM,UAAU;;;CAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa;;;CAAsC,CAAC;AACjE,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa;;;CAAiC,CAAC;AAC5D,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ;;;CAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;;;;CAAsC,CAAC;AAG1D,eAAO,MAAM,YAAY,EAEpB,OAAO,qBAAqB,CAAC;AAClC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAAgD,CAAC;AACzE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAE/B,CAAC;AACF,eAAO,MAAM,MAAM,EAEd,OAAO,eAAe,CAAC;AAG5B,eAAO,MAAM,QAAQ;;;;;;CAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;;;;CAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;;;;CAAgD,CAAC"}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Slider = exports.MultiSelectFiltered = exports.MultiSelect = exports.AutoComplete = exports.Select = exports.UrlInput = exports.NumberInput = exports.
|
|
3
|
+
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Slider = exports.MultiSelectFiltered = exports.MultiSelect = exports.AutoComplete = exports.Select = exports.UrlInput = exports.NumberInput = exports.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
|
|
4
4
|
const fuselage_1 = require("@rocket.chat/fuselage");
|
|
5
5
|
const withLabelHelpers_1 = require("./withLabelHelpers");
|
|
6
|
+
// TODO: Some inputs are still not supported due to requiring a different a11y approach
|
|
7
|
+
// with id
|
|
6
8
|
exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
|
|
7
9
|
exports.EmailInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.EmailInput);
|
|
8
10
|
exports.PasswordInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.PasswordInput);
|
|
9
11
|
exports.SearchInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.SearchInput);
|
|
10
12
|
exports.TextAreaInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextAreaInput);
|
|
11
|
-
exports.TelephoneInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TelephoneInput);
|
|
12
13
|
exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
|
|
13
14
|
exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
|
|
15
|
+
// with aria-labelledby
|
|
14
16
|
exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
|
|
15
|
-
|
|
17
|
+
// with aria-labelledby + id for aria-controls
|
|
18
|
+
exports.AutoComplete = (0, withLabelHelpers_1.withAriaLabelledByAndId)((fuselage_1.AutoComplete));
|
|
16
19
|
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelect);
|
|
17
20
|
exports.MultiSelectFiltered = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelectFiltered);
|
|
18
21
|
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
22
|
+
// with visually hidden label
|
|
19
23
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
20
24
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
21
25
|
exports.RadioButton = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.RadioButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.js","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.js","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":";;;AAAA,oDAgB+B;AAE/B,yDAK4B;AAE5B,uFAAuF;AAEvF,UAAU;AACG,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC,oBAAkB,CAAC,CAAC;AAC5C,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC,qBAAmB,CAAC,CAAC;AAC9C,QAAA,aAAa,GAAG,IAAA,8BAAW,EAAC,wBAAsB,CAAC,CAAC;AACpD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,aAAa,GAAG,IAAA,8BAAW,EAAC,wBAAiB,CAAC,CAAC;AAC/C,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC,mBAAiB,CAAC,CAAC;AAEvD,uBAAuB;AACV,QAAA,MAAM,GAAG,IAAA,qCAAkB,EAAC,iBAAe,CAAC,CAAC;AAE1D,8CAA8C;AACjC,QAAA,YAAY,GAAG,IAAA,0CAAuB,EACjD,CAAA,uBAA0B,CAAA,CACK,CAAC;AACrB,QAAA,WAAW,GAAG,IAAA,0CAAuB,EAAC,sBAAoB,CAAC,CAAC;AAC5D,QAAA,mBAAmB,GAAG,IAAA,0CAAuB,EACxD,8BAA4B,CAC7B,CAAC;AACW,QAAA,MAAM,GAAG,IAAA,qCAAkB,EACtC,iBAAe,CACU,CAAC;AAE5B,6BAA6B;AAChB,QAAA,QAAQ,GAAG,IAAA,0CAAuB,EAAC,mBAAiB,CAAC,CAAC;AACtD,QAAA,YAAY,GAAG,IAAA,0CAAuB,EAAC,uBAAqB,CAAC,CAAC;AAC9D,QAAA,WAAW,GAAG,IAAA,0CAAuB,EAAC,sBAAoB,CAAC,CAAC"}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import type { ReactNode,
|
|
1
|
+
import type { ReactNode, ComponentType, RefAttributes } from 'react';
|
|
2
2
|
type WithLabelId = {
|
|
3
3
|
id?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function withLabelId<TProps, TRef>(Component:
|
|
5
|
+
declare function withLabelId<TProps, TRef>(Component: ComponentType<TProps & WithLabelId & RefAttributes<TRef>>): {
|
|
6
|
+
(props: TProps & RefAttributes<TRef>): import("react").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
type WithLabelledBy = {
|
|
7
10
|
'aria-labelledby'?: string;
|
|
8
11
|
};
|
|
9
|
-
declare function withAriaLabelledBy<TProps, TRef>(Component:
|
|
12
|
+
declare function withAriaLabelledBy<TProps, TRef>(Component: ComponentType<TProps & WithLabelledBy & RefAttributes<TRef>>): {
|
|
13
|
+
(props: TProps & RefAttributes<TRef>): import("react").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
10
16
|
type WithLabelledByAndId = {
|
|
11
17
|
'aria-labelledby'?: string;
|
|
12
18
|
'id'?: string;
|
|
13
19
|
};
|
|
14
|
-
declare function withAriaLabelledByAndId<TProps, TRef>(Component:
|
|
20
|
+
declare function withAriaLabelledByAndId<TProps, TRef>(Component: ComponentType<TProps & WithLabelledByAndId & RefAttributes<TRef>>): {
|
|
21
|
+
(props: TProps & RefAttributes<TRef>): import("react").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
15
24
|
type WithChildrenLabel = {
|
|
16
25
|
labelChildren: ReactNode;
|
|
17
26
|
};
|
|
18
|
-
declare function withVisuallyHiddenLabel<TProps, TRef>(Component:
|
|
27
|
+
declare function withVisuallyHiddenLabel<TProps, TRef>(Component: ComponentType<TProps & WithChildrenLabel & RefAttributes<TRef>>): {
|
|
28
|
+
(props: TProps & RefAttributes<TRef>): import("react").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
19
31
|
export { withLabelId, withAriaLabelledBy, withAriaLabelledByAndId, withVisuallyHiddenLabel, };
|
|
20
32
|
//# sourceMappingURL=withLabelHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;AAU1E,KAAK,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,iBAAS,WAAW,CAAC,MAAM,EAAE,IAAI,EAC/B,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YAEnC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAQ9D;AAED,KAAK,cAAc,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,IAAI,EACtC,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YAEtC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAQ9D;AAED,KAAK,mBAAmB,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,iBAAS,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAC3C,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,mBAAmB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YAE3C,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAQ9D;AAED,KAAK,iBAAiB,GAAG;IAAE,aAAa,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAC3C,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YAEzC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAgB9D;AAED,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACxB,CAAC"}
|
|
@@ -5,40 +5,41 @@ exports.withAriaLabelledBy = withAriaLabelledBy;
|
|
|
5
5
|
exports.withAriaLabelledByAndId = withAriaLabelledByAndId;
|
|
6
6
|
exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
// Disabled this flag since we need to wrap multiple components
|
|
9
|
+
/* eslint-disable react/no-multi-comp */
|
|
8
10
|
const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks");
|
|
9
|
-
const react_1 = require("react");
|
|
10
11
|
const react_aria_1 = require("react-aria");
|
|
11
12
|
const FieldContext_1 = require("../Field/FieldContext");
|
|
12
13
|
function withLabelId(Component) {
|
|
13
|
-
|
|
14
|
+
function WrappedComponent(props) {
|
|
14
15
|
const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
|
|
15
|
-
return (
|
|
16
|
-
}
|
|
16
|
+
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
17
|
+
}
|
|
17
18
|
WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
18
19
|
return WrappedComponent;
|
|
19
20
|
}
|
|
20
21
|
function withAriaLabelledBy(Component) {
|
|
21
|
-
|
|
22
|
+
function WrappedComponent(props) {
|
|
22
23
|
const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
|
|
23
|
-
return (
|
|
24
|
-
}
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
25
|
+
}
|
|
25
26
|
WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
26
27
|
return WrappedComponent;
|
|
27
28
|
}
|
|
28
29
|
function withAriaLabelledByAndId(Component) {
|
|
29
|
-
|
|
30
|
+
function WrappedComponent(props) {
|
|
30
31
|
const labelProps = (0, FieldContext_1.useFieldReferencedByLabelWithId)();
|
|
31
|
-
return (
|
|
32
|
-
}
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
33
|
+
}
|
|
33
34
|
WrappedComponent.displayName = `withAriaLabelledByAndId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
34
35
|
return WrappedComponent;
|
|
35
36
|
}
|
|
36
37
|
function withVisuallyHiddenLabel(Component) {
|
|
37
|
-
|
|
38
|
+
function WrappedComponent(props) {
|
|
38
39
|
const [label, labelProps, labelRef] = (0, FieldContext_1.useFieldWrappedByInputLabel)();
|
|
39
|
-
const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(ref, labelRef);
|
|
40
|
+
const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(props.ref, labelRef);
|
|
40
41
|
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: mergedRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
|
|
41
|
-
}
|
|
42
|
+
}
|
|
42
43
|
WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
43
44
|
return WrappedComponent;
|
|
44
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabelHelpers.js","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.js","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":";;AAkFE,kCAAW;AACX,gDAAkB;AAClB,0DAAuB;AACvB,0DAAuB;;AArFzB,+DAA+D;AAC/D,wCAAwC;AACxC,gEAA4D;AAE5D,2CAA4C;AAE5C,wDAK+B;AAI/B,SAAS,WAAW,CAClB,SAAoE;IAEpE,SAAS,gBAAgB,CAAC,KAAmC;QAC3D,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,eAAe,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAE7G,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAID,SAAS,kBAAkB,CACzB,SAAuE;IAEvE,SAAS,gBAAgB,CAAC,KAAmC;QAC3D,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,sBAAsB,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEpH,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAID,SAAS,uBAAuB,CAC9B,SAA4E;IAE5E,SAAS,gBAAgB,CAAC,KAAmC;QAC3D,MAAM,UAAU,GAAG,IAAA,8CAA+B,GAAE,CAAC;QACrD,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAID,SAAS,uBAAuB,CAC9B,SAA0E;IAE1E,SAAS,gBAAgB,CAAC,KAAmC;QAC3D,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAA2B,GAAE,CAAC;QACpE,MAAM,SAAS,GAAG,IAAA,8BAAa,EAAC,KAAK,CAAC,GAAG,EAAE,QAAqB,CAAC,CAAC;QAClE,OAAO,CACL,uBAAC,SAAS,OACJ,KAAK,KACL,UAAU,EACd,GAAG,EAAE,SAAS,EACd,aAAa,EAAE,uBAAC,2BAAc,cAAE,KAAK,GAAkB,GACvD,CACH,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.58.7"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocket.chat/fuselage-forms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A set of component wrappers to provide ease of use and accessibility out-of-box.",
|
|
5
5
|
"homepage": "https://github.com/RocketChat/fuselage#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -26,41 +26,43 @@
|
|
|
26
26
|
".:build:clean": "rimraf dist",
|
|
27
27
|
".:build:cjs": "tsc -p tsconfig.cjs.json",
|
|
28
28
|
".:build:esm": "tsc -p tsconfig.esm.json",
|
|
29
|
+
".:build:api": "api-extractor run --local",
|
|
29
30
|
"storybook": "storybook dev -p 6006 --no-version-updates",
|
|
30
|
-
"build": "run .:build:clean && run .:build:esm && run .:build:cjs",
|
|
31
|
+
"build": "run .:build:clean && run .:build:esm && run .:build:cjs && run .:build:api",
|
|
31
32
|
"clean": "rimraf dist",
|
|
32
|
-
"docs": "
|
|
33
|
+
"docs": "NODE_ENV=production storybook build -o ../../static/fuselage-forms",
|
|
33
34
|
"lint": "lint",
|
|
34
35
|
"lint-and-fix": "lint-and-fix",
|
|
35
36
|
"test": "jest --runInBand"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@rocket.chat/fuselage
|
|
39
|
+
"@microsoft/api-extractor": "~7.58.7",
|
|
40
|
+
"@rocket.chat/fuselage": "^0.82.0",
|
|
41
|
+
"@rocket.chat/fuselage-hooks": "^0.43.0",
|
|
40
42
|
"@rocket.chat/fuselage-tokens": "^0.33.2",
|
|
41
|
-
"@rocket.chat/storybook-dark-mode": "^4.1
|
|
42
|
-
"@storybook/addon-docs": "~9.1.
|
|
43
|
+
"@rocket.chat/storybook-dark-mode": "^4.2.1",
|
|
44
|
+
"@storybook/addon-docs": "~9.1.20",
|
|
43
45
|
"@storybook/addon-webpack5-compiler-swc": "~4.0.3",
|
|
44
|
-
"@storybook/react-webpack5": "~9.1.
|
|
46
|
+
"@storybook/react-webpack5": "~9.1.20",
|
|
47
|
+
"@testing-library/dom": "~10.4.1",
|
|
45
48
|
"@testing-library/jest-dom": "~6.9.1",
|
|
46
49
|
"@testing-library/react": "~16.3.2",
|
|
47
50
|
"@testing-library/user-event": "~14.6.1",
|
|
48
51
|
"@types/jest": "~30.0.0",
|
|
49
52
|
"@types/jest-axe": "~3.5.9",
|
|
50
|
-
"@types/react": "~
|
|
51
|
-
"@types/react-dom": "~
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"jest": "~30.3.0",
|
|
53
|
+
"@types/react": "~19.2.17",
|
|
54
|
+
"@types/react-dom": "~19.2.3",
|
|
55
|
+
"eslint": "~9.39.4",
|
|
56
|
+
"jest": "~30.4.2",
|
|
55
57
|
"jest-axe": "~10.0.0",
|
|
56
|
-
"jest-environment-jsdom": "~30.
|
|
58
|
+
"jest-environment-jsdom": "~30.4.1",
|
|
57
59
|
"lint-all": "^0.31.25",
|
|
58
60
|
"prettier": "~3.6.2",
|
|
59
|
-
"react": "~
|
|
60
|
-
"react-dom": "~
|
|
61
|
-
"rimraf": "~6.
|
|
62
|
-
"storybook": "~9.1.
|
|
63
|
-
"ts-jest": "~29.4.
|
|
61
|
+
"react": "~19.2.7",
|
|
62
|
+
"react-dom": "~19.2.7",
|
|
63
|
+
"rimraf": "~6.1.3",
|
|
64
|
+
"storybook": "~9.1.20",
|
|
65
|
+
"ts-jest": "~29.4.11",
|
|
64
66
|
"typescript": "~5.9.3",
|
|
65
67
|
"webpack": "~5.105.4"
|
|
66
68
|
},
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
"access": "public"
|
|
78
80
|
},
|
|
79
81
|
"dependencies": {
|
|
80
|
-
"@rocket.chat/emitter": "^0.
|
|
82
|
+
"@rocket.chat/emitter": "^0.33.0",
|
|
81
83
|
"react-aria": "~3.37.0"
|
|
82
84
|
}
|
|
83
85
|
}
|