@rocket.chat/fuselage-forms 1.4.0 → 1.5.1
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/FieldContext.js +4 -0
- package/dist/cjs/Field/FieldContext.js.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/Inputs/WrappedInputComponents.d.ts +112 -86
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.js +10 -2
- package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.d.ts +16 -4
- 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/FieldContext.js +4 -0
- package/dist/esm/Field/FieldContext.js.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/Inputs/WrappedInputComponents.d.ts +112 -86
- package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.js +10 -2
- package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.d.ts +16 -4
- 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 +1 -1
- package/package.json +13 -13
|
@@ -71,6 +71,7 @@ const getAriaInvalid = (descriptors) => {
|
|
|
71
71
|
}
|
|
72
72
|
return { 'aria-invalid': 'false' };
|
|
73
73
|
};
|
|
74
|
+
// Input has id and label is htmlFor
|
|
74
75
|
const useFieldReferencedByInput = () => {
|
|
75
76
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
76
77
|
(0, react_1.useEffect)(() => {
|
|
@@ -83,6 +84,7 @@ const useFieldReferencedByInput = () => {
|
|
|
83
84
|
}), [descriptors, id]);
|
|
84
85
|
};
|
|
85
86
|
exports.useFieldReferencedByInput = useFieldReferencedByInput;
|
|
87
|
+
// label has id and input is aria-labelledby
|
|
86
88
|
const useFieldReferencedByLabel = () => {
|
|
87
89
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
88
90
|
(0, react_1.useEffect)(() => {
|
|
@@ -95,6 +97,7 @@ const useFieldReferencedByLabel = () => {
|
|
|
95
97
|
}), [descriptors, id]);
|
|
96
98
|
};
|
|
97
99
|
exports.useFieldReferencedByLabel = useFieldReferencedByLabel;
|
|
100
|
+
// label has id and input is aria-labelledby + has id for aria-controls
|
|
98
101
|
const useFieldReferencedByLabelWithId = () => {
|
|
99
102
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
100
103
|
(0, react_1.useEffect)(() => {
|
|
@@ -108,6 +111,7 @@ const useFieldReferencedByLabelWithId = () => {
|
|
|
108
111
|
}), [descriptors, id]);
|
|
109
112
|
};
|
|
110
113
|
exports.useFieldReferencedByLabelWithId = useFieldReferencedByLabelWithId;
|
|
114
|
+
// label is rendered visually hidden inside the inputs wrapper label
|
|
111
115
|
const useFieldWrappedByInputLabel = () => {
|
|
112
116
|
const { id, label, descriptors, setFieldType, onAction } = (0, react_1.useContext)(exports.FieldContext);
|
|
113
117
|
(0, react_1.useEffect)(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldContext.js","sourceRoot":"","sources":["../../../src/Field/FieldContext.ts"],"names":[],"mappings":";;;AAAA,gEAAiE;AAEjE,iCAMe;AAcF,QAAA,YAAY,GAAG,IAAA,qBAAa,EAAoB;IAC3D,aAAa,EAAE,GAAG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;IAEF,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CAAC;QACJ,KAAK;QACL;YACE,kBAAkB,EAAE,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC;YACjC,GAAG,cAAc,CAAC,WAAW,CAAC;SAC/B;QACD,WAAW;KACZ,EACD,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,CAAC,CACtC,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,2BAA2B,+BA4CtC"}
|
|
@@ -13,6 +13,7 @@ const FieldLabel = (props) => {
|
|
|
13
13
|
if (fieldType === 'referencedByInput') {
|
|
14
14
|
return (0, jsx_runtime_1.jsx)(ReferencedLabel_1.default, { ...props });
|
|
15
15
|
}
|
|
16
|
+
// referencedByLabel
|
|
16
17
|
return (0, jsx_runtime_1.jsx)(LabelFor_1.default, { ...props });
|
|
17
18
|
};
|
|
18
19
|
exports.default = FieldLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldLabel.js","sourceRoot":"","sources":["../../../../src/Field/Label/FieldLabel.tsx"],"names":[],"mappings":";;;AAGA,kDAAoD;AAEpD,+CAAwC;AACxC,yCAAkC;AAClC,uDAAgD;AAMhD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAEtC,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,uBAAC,qBAAW,OAAK,KAAK,GAAI,CAAC;IACpC,CAAC;IACD,IAAI,SAAS,KAAK,mBAAmB,EAAE,CAAC;QACtC,OAAO,uBAAC,yBAAe,OAAK,KAAK,GAAI,CAAC;IACxC,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldLabel.js","sourceRoot":"","sources":["../../../../src/Field/Label/FieldLabel.tsx"],"names":[],"mappings":";;;AAGA,kDAAoD;AAEpD,+CAAwC;AACxC,yCAAkC;AAClC,uDAAgD;AAMhD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAEtC,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,uBAAC,qBAAW,OAAK,KAAK,GAAI,CAAC;IACpC,CAAC;IACD,IAAI,SAAS,KAAK,mBAAmB,EAAE,CAAC;QACtC,OAAO,uBAAC,yBAAe,OAAK,KAAK,GAAI,CAAC;IACxC,CAAC;IACD,oBAAoB;IACpB,OAAO,uBAAC,kBAAQ,OAAK,KAAK,GAAI,CAAC;AACjC,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,90 +1,116 @@
|
|
|
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
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use `MultiSelectFiltered` instead, or `SelectFiltered` from
|
|
43
|
+
* `@rocket.chat/fuselage` for single selection.
|
|
44
|
+
*/
|
|
34
45
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} &
|
|
46
|
+
export declare const MultiSelect: {
|
|
47
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
48
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
49
|
+
error?: string;
|
|
50
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
51
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
52
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
53
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
54
|
+
customEmpty?: string;
|
|
55
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
56
|
+
renderOptions?: import("react").ElementType;
|
|
57
|
+
renderItem?: import("react").ElementType;
|
|
58
|
+
renderSelected?: import("react").ElementType<{
|
|
59
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
60
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
61
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
62
|
+
children: import("react").ReactNode;
|
|
63
|
+
}>;
|
|
64
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
65
|
+
setFilter?: (filter: string) => void;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const MultiSelectFiltered: {
|
|
70
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
71
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
72
|
+
error?: string;
|
|
73
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
74
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
75
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
76
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
77
|
+
customEmpty?: string;
|
|
78
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
79
|
+
renderOptions?: import("react").ElementType;
|
|
80
|
+
renderItem?: import("react").ElementType;
|
|
81
|
+
renderSelected?: import("react").ElementType<{
|
|
82
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
83
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
84
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
85
|
+
children: import("react").ReactNode;
|
|
86
|
+
}>;
|
|
87
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
88
|
+
setFilter?: (filter: string) => void;
|
|
89
|
+
} & {
|
|
90
|
+
filter?: string;
|
|
91
|
+
setFilter?: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
92
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
93
|
+
}): import("react").JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
79
96
|
export declare const Slider: typeof SliderComponent;
|
|
80
|
-
export declare const CheckBox:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
export declare const
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
export declare const CheckBox: {
|
|
98
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
99
|
+
indeterminate?: boolean;
|
|
100
|
+
labelChildren?: import("react").ReactNode;
|
|
101
|
+
} & import("react").AllHTMLAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
102
|
+
displayName: string;
|
|
103
|
+
};
|
|
104
|
+
export declare const ToggleSwitch: {
|
|
105
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
106
|
+
labelChildren?: import("react").ReactNode;
|
|
107
|
+
}): import("react").JSX.Element;
|
|
108
|
+
displayName: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const RadioButton: {
|
|
111
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
112
|
+
labelChildren?: import("react").ReactNode;
|
|
113
|
+
}): import("react").JSX.Element;
|
|
114
|
+
displayName: string;
|
|
115
|
+
};
|
|
90
116
|
//# 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;;;GAGG;AACH,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,29 @@
|
|
|
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);
|
|
17
|
+
// with aria-labelledby + id for aria-controls
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `MultiSelectFiltered` instead, or `SelectFiltered` from
|
|
20
|
+
* `@rocket.chat/fuselage` for single selection.
|
|
21
|
+
*/
|
|
15
22
|
exports.AutoComplete = (0, withLabelHelpers_1.withAriaLabelledByAndId)((fuselage_1.AutoComplete));
|
|
16
23
|
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelect);
|
|
17
24
|
exports.MultiSelectFiltered = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelectFiltered);
|
|
18
25
|
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
26
|
+
// with visually hidden label
|
|
19
27
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
20
28
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
21
29
|
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;AAC9C;;;GAGG;AACU,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"}
|
|
@@ -2,19 +2,31 @@ import type { ReactNode, ComponentType, RefAttributes } from 'react';
|
|
|
2
2
|
type WithLabelId = {
|
|
3
3
|
id?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function withLabelId<TProps, TRef>(Component: ComponentType<TProps & WithLabelId & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithLabelledBy & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithLabelledByAndId & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithChildrenLabel & RefAttributes<TRef>>):
|
|
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,EAAE,SAAS,EAAE,aAAa,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
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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 @@ const getAriaInvalid = (descriptors) => {
|
|
|
71
71
|
}
|
|
72
72
|
return { 'aria-invalid': 'false' };
|
|
73
73
|
};
|
|
74
|
+
// Input has id and label is htmlFor
|
|
74
75
|
const useFieldReferencedByInput = () => {
|
|
75
76
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
76
77
|
(0, react_1.useEffect)(() => {
|
|
@@ -83,6 +84,7 @@ const useFieldReferencedByInput = () => {
|
|
|
83
84
|
}), [descriptors, id]);
|
|
84
85
|
};
|
|
85
86
|
exports.useFieldReferencedByInput = useFieldReferencedByInput;
|
|
87
|
+
// label has id and input is aria-labelledby
|
|
86
88
|
const useFieldReferencedByLabel = () => {
|
|
87
89
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
88
90
|
(0, react_1.useEffect)(() => {
|
|
@@ -95,6 +97,7 @@ const useFieldReferencedByLabel = () => {
|
|
|
95
97
|
}), [descriptors, id]);
|
|
96
98
|
};
|
|
97
99
|
exports.useFieldReferencedByLabel = useFieldReferencedByLabel;
|
|
100
|
+
// label has id and input is aria-labelledby + has id for aria-controls
|
|
98
101
|
const useFieldReferencedByLabelWithId = () => {
|
|
99
102
|
const { id, descriptors, setFieldType } = (0, react_1.useContext)(exports.FieldContext);
|
|
100
103
|
(0, react_1.useEffect)(() => {
|
|
@@ -108,6 +111,7 @@ const useFieldReferencedByLabelWithId = () => {
|
|
|
108
111
|
}), [descriptors, id]);
|
|
109
112
|
};
|
|
110
113
|
exports.useFieldReferencedByLabelWithId = useFieldReferencedByLabelWithId;
|
|
114
|
+
// label is rendered visually hidden inside the inputs wrapper label
|
|
111
115
|
const useFieldWrappedByInputLabel = () => {
|
|
112
116
|
const { id, label, descriptors, setFieldType, onAction } = (0, react_1.useContext)(exports.FieldContext);
|
|
113
117
|
(0, react_1.useEffect)(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldContext.js","sourceRoot":"","sources":["../../../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CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CACF,CAAC;IAEF,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CAAC;QACJ,KAAK;QACL;YACE,kBAAkB,EAAE,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,WAAW,CAAC;YACjC,GAAG,cAAc,CAAC,WAAW,CAAC;SAC/B;QACD,WAAW;KACZ,EACD,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,CAAC,CACtC,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,2BAA2B,+BA4CtC"}
|
|
@@ -16,6 +16,7 @@ const FieldLabel = (props) => {
|
|
|
16
16
|
if (fieldType === 'referencedByInput') {
|
|
17
17
|
return (0, jsx_runtime_1.jsx)(ReferencedLabel_1.default, { ...props });
|
|
18
18
|
}
|
|
19
|
+
// referencedByLabel
|
|
19
20
|
return (0, jsx_runtime_1.jsx)(LabelFor_1.default, { ...props });
|
|
20
21
|
};
|
|
21
22
|
exports.default = FieldLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldLabel.js","sourceRoot":"","sources":["../../../../src/Field/Label/FieldLabel.tsx"],"names":[],"mappings":";;;;;;AAGA,kDAAoD;AAEpD,gEAAwC;AACxC,0DAAkC;AAClC,wEAAgD;AAMhD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAEtC,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,uBAAC,qBAAW,OAAK,KAAK,GAAI,CAAC;IACpC,CAAC;IACD,IAAI,SAAS,KAAK,mBAAmB,EAAE,CAAC;QACtC,OAAO,uBAAC,yBAAe,OAAK,KAAK,GAAI,CAAC;IACxC,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldLabel.js","sourceRoot":"","sources":["../../../../src/Field/Label/FieldLabel.tsx"],"names":[],"mappings":";;;;;;AAGA,kDAAoD;AAEpD,gEAAwC;AACxC,0DAAkC;AAClC,wEAAgD;AAMhD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAEtC,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,uBAAC,qBAAW,OAAK,KAAK,GAAI,CAAC;IACpC,CAAC;IACD,IAAI,SAAS,KAAK,mBAAmB,EAAE,CAAC;QACtC,OAAO,uBAAC,yBAAe,OAAK,KAAK,GAAI,CAAC;IACxC,CAAC;IACD,oBAAoB;IACpB,OAAO,uBAAC,kBAAQ,OAAK,KAAK,GAAI,CAAC;AACjC,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,90 +1,116 @@
|
|
|
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
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Use `MultiSelectFiltered` instead, or `SelectFiltered` from
|
|
43
|
+
* `@rocket.chat/fuselage` for single selection.
|
|
44
|
+
*/
|
|
34
45
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} &
|
|
46
|
+
export declare const MultiSelect: {
|
|
47
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
48
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
49
|
+
error?: string;
|
|
50
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
51
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
52
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
53
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
54
|
+
customEmpty?: string;
|
|
55
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
56
|
+
renderOptions?: import("react").ElementType;
|
|
57
|
+
renderItem?: import("react").ElementType;
|
|
58
|
+
renderSelected?: import("react").ElementType<{
|
|
59
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
60
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
61
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
62
|
+
children: import("react").ReactNode;
|
|
63
|
+
}>;
|
|
64
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
65
|
+
setFilter?: (filter: string) => void;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const MultiSelectFiltered: {
|
|
70
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref" | "value" | "onChange"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
71
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
72
|
+
error?: string;
|
|
73
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
74
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
75
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
76
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
77
|
+
customEmpty?: string;
|
|
78
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage").MultiSelectAnchorParams>;
|
|
79
|
+
renderOptions?: import("react").ElementType;
|
|
80
|
+
renderItem?: import("react").ElementType;
|
|
81
|
+
renderSelected?: import("react").ElementType<{
|
|
82
|
+
value: import("@rocket.chat/fuselage").SelectOption[0];
|
|
83
|
+
label: import("@rocket.chat/fuselage").SelectOption[1];
|
|
84
|
+
onMouseDown: import("react").MouseEventHandler;
|
|
85
|
+
children: import("react").ReactNode;
|
|
86
|
+
}>;
|
|
87
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
88
|
+
setFilter?: (filter: string) => void;
|
|
89
|
+
} & {
|
|
90
|
+
filter?: string;
|
|
91
|
+
setFilter?: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
92
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
93
|
+
}): import("react").JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
79
96
|
export declare const Slider: typeof SliderComponent;
|
|
80
|
-
export declare const CheckBox:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
export declare const
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
export declare const CheckBox: {
|
|
98
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & {
|
|
99
|
+
indeterminate?: boolean;
|
|
100
|
+
labelChildren?: import("react").ReactNode;
|
|
101
|
+
} & import("react").AllHTMLAttributes<HTMLInputElement>): import("react").JSX.Element;
|
|
102
|
+
displayName: string;
|
|
103
|
+
};
|
|
104
|
+
export declare const ToggleSwitch: {
|
|
105
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
106
|
+
labelChildren?: import("react").ReactNode;
|
|
107
|
+
}): import("react").JSX.Element;
|
|
108
|
+
displayName: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const RadioButton: {
|
|
111
|
+
(props: Omit<import("@rocket.chat/fuselage").BoxProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
112
|
+
labelChildren?: import("react").ReactNode;
|
|
113
|
+
}): import("react").JSX.Element;
|
|
114
|
+
displayName: string;
|
|
115
|
+
};
|
|
90
116
|
//# 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;;;GAGG;AACH,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,29 @@
|
|
|
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);
|
|
17
|
+
// with aria-labelledby + id for aria-controls
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `MultiSelectFiltered` instead, or `SelectFiltered` from
|
|
20
|
+
* `@rocket.chat/fuselage` for single selection.
|
|
21
|
+
*/
|
|
15
22
|
exports.AutoComplete = (0, withLabelHelpers_1.withAriaLabelledByAndId)((fuselage_1.AutoComplete));
|
|
16
23
|
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelect);
|
|
17
24
|
exports.MultiSelectFiltered = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelectFiltered);
|
|
18
25
|
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
26
|
+
// with visually hidden label
|
|
19
27
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
20
28
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
21
29
|
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;AAC9C;;;GAGG;AACU,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"}
|
|
@@ -2,19 +2,31 @@ import type { ReactNode, ComponentType, RefAttributes } from 'react';
|
|
|
2
2
|
type WithLabelId = {
|
|
3
3
|
id?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function withLabelId<TProps, TRef>(Component: ComponentType<TProps & WithLabelId & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithLabelledBy & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithLabelledByAndId & RefAttributes<TRef>>):
|
|
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: ComponentType<TProps & WithChildrenLabel & RefAttributes<TRef>>):
|
|
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,EAAE,SAAS,EAAE,aAAa,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAO,aAAa,E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
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,e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BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocket.chat/fuselage-forms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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": {
|
|
@@ -36,34 +36,34 @@
|
|
|
36
36
|
"test": "jest --runInBand"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@microsoft/api-extractor": "~7.58.
|
|
40
|
-
"@rocket.chat/fuselage": "^0.
|
|
41
|
-
"@rocket.chat/fuselage-hooks": "^0.
|
|
39
|
+
"@microsoft/api-extractor": "~7.58.12",
|
|
40
|
+
"@rocket.chat/fuselage": "^0.85.0",
|
|
41
|
+
"@rocket.chat/fuselage-hooks": "^0.43.0",
|
|
42
42
|
"@rocket.chat/fuselage-tokens": "^0.33.2",
|
|
43
|
-
"@rocket.chat/storybook-dark-mode": "^4.2.
|
|
43
|
+
"@rocket.chat/storybook-dark-mode": "^4.2.1",
|
|
44
44
|
"@storybook/addon-docs": "~9.1.20",
|
|
45
45
|
"@storybook/addon-webpack5-compiler-swc": "~4.0.3",
|
|
46
46
|
"@storybook/react-webpack5": "~9.1.20",
|
|
47
|
+
"@testing-library/dom": "~10.4.1",
|
|
47
48
|
"@testing-library/jest-dom": "~6.9.1",
|
|
48
49
|
"@testing-library/react": "~16.3.2",
|
|
49
50
|
"@testing-library/user-event": "~14.6.1",
|
|
50
51
|
"@types/jest": "~30.0.0",
|
|
51
52
|
"@types/jest-axe": "~3.5.9",
|
|
52
|
-
"@types/react": "~19.2.
|
|
53
|
+
"@types/react": "~19.2.17",
|
|
53
54
|
"@types/react-dom": "~19.2.3",
|
|
54
|
-
"eslint": "~
|
|
55
|
+
"eslint": "~10.8.0",
|
|
55
56
|
"jest": "~30.4.2",
|
|
56
57
|
"jest-axe": "~10.0.0",
|
|
57
58
|
"jest-environment-jsdom": "~30.4.1",
|
|
58
59
|
"lint-all": "^0.31.25",
|
|
59
60
|
"prettier": "~3.6.2",
|
|
60
|
-
"react": "~19.2.
|
|
61
|
-
"react-dom": "~19.2.
|
|
61
|
+
"react": "~19.2.8",
|
|
62
|
+
"react-dom": "~19.2.8",
|
|
62
63
|
"rimraf": "~6.1.3",
|
|
63
64
|
"storybook": "~9.1.20",
|
|
64
|
-
"ts-jest": "~29.4.
|
|
65
|
-
"typescript": "~5.9.3"
|
|
66
|
-
"webpack": "~5.105.4"
|
|
65
|
+
"ts-jest": "~29.4.12",
|
|
66
|
+
"typescript": "~5.9.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@rocket.chat/fuselage": "*",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@rocket.chat/emitter": "^0.
|
|
81
|
+
"@rocket.chat/emitter": "^0.33.0",
|
|
82
82
|
"react-aria": "~3.37.0"
|
|
83
83
|
}
|
|
84
84
|
}
|