@rocket.chat/fuselage-forms 1.0.0 → 1.1.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/FieldError.d.ts.map +1 -1
- package/dist/cjs/Field/FieldError.js +1 -1
- package/dist/cjs/Field/FieldError.js.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts +59 -78
- package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/cjs/Inputs/WrappedInputComponents.js +3 -1
- package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.d.ts +5 -14
- package/dist/cjs/Inputs/withLabelHelpers.d.ts.map +1 -1
- package/dist/cjs/Inputs/withLabelHelpers.js +12 -9
- package/dist/cjs/Inputs/withLabelHelpers.js.map +1 -1
- package/dist/esm/Field/FieldError.d.ts.map +1 -1
- package/dist/esm/Field/FieldError.js +1 -1
- package/dist/esm/Field/FieldError.js.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.d.ts +59 -78
- package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
- package/dist/esm/Inputs/WrappedInputComponents.js +3 -1
- package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.d.ts +5 -14
- package/dist/esm/Inputs/withLabelHelpers.d.ts.map +1 -1
- package/dist/esm/Inputs/withLabelHelpers.js +12 -9
- package/dist/esm/Inputs/withLabelHelpers.js.map +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,KAAK,eAAe,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC7D,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,
|
|
1
|
+
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,KAAK,eAAe,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC7D,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,4CAO1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -5,7 +5,7 @@ const fuselage_1 = require("@rocket.chat/fuselage");
|
|
|
5
5
|
const FieldContext_1 = require("./FieldContext");
|
|
6
6
|
const FieldError = ({ children, ...props }) => {
|
|
7
7
|
const id = (0, FieldContext_1.useFieldDescriptorId)('error');
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldError, { ...props, id: id, children: children }));
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldError, { ...props, id: id, role: 'alert', children: children }));
|
|
9
9
|
};
|
|
10
10
|
exports.default = FieldError;
|
|
11
11
|
//# sourceMappingURL=FieldError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":";;;AAAA,oDAA0E;AAG1E,iDAAsD;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":";;;AAAA,oDAA0E;AAG1E,iDAAsD;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;IACzC,OAAO,CACL,uBAAC,qBAAmB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,OAAO,YACjD,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,79 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export declare const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
export declare const CheckBox: {
|
|
61
|
-
(props: import("@rocket.chat/fuselage").BoxProps & {
|
|
62
|
-
indeterminate?: boolean;
|
|
63
|
-
labelChildren?: import("react").ReactNode;
|
|
64
|
-
} & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
65
|
-
displayName: string;
|
|
66
|
-
};
|
|
67
|
-
export declare const ToggleSwitch: {
|
|
68
|
-
(props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
69
|
-
labelChildren?: import("react").ReactNode;
|
|
70
|
-
} & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
71
|
-
displayName: string;
|
|
72
|
-
};
|
|
73
|
-
export declare const RadioButton: {
|
|
74
|
-
(props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
75
|
-
labelChildren?: import("react").ReactNode;
|
|
76
|
-
} & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
-
displayName: string;
|
|
78
|
-
};
|
|
1
|
+
import { Slider as SliderComponent } from '@rocket.chat/fuselage';
|
|
2
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
3
|
+
addon?: import("react").ReactNode;
|
|
4
|
+
error?: string;
|
|
5
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export declare const EmailInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
7
|
+
addon?: import("react").ReactNode;
|
|
8
|
+
error?: string;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
10
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").PasswordInputProps & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
12
|
+
addon?: import("react").ReactNode;
|
|
13
|
+
error?: string;
|
|
14
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export declare const TextAreaInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
16
|
+
addon?: import("react").ReactNode;
|
|
17
|
+
error?: string;
|
|
18
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
19
|
+
export declare const TelephoneInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
20
|
+
addon?: import("react").ReactNode;
|
|
21
|
+
input?: import("react").ReactNode;
|
|
22
|
+
error?: string;
|
|
23
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
24
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").NumberInputProps & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export declare const UrlInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").UrlInputProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
26
|
+
export declare const Select: import("react").ForwardRefExoticComponent<Omit<Omit<import("react-aria").AriaSelectProps<object>, "value" | "children" | "onChange"> & {
|
|
27
|
+
error?: string;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
value?: import("react").Key | null | undefined;
|
|
30
|
+
onChange?: ((key: import("react").Key) => any) | undefined;
|
|
31
|
+
options: (readonly [value: string, label: string, selected?: boolean | undefined])[];
|
|
32
|
+
small?: boolean;
|
|
33
|
+
} & Omit<import("react").AllHTMLAttributes<HTMLElement>, "value" | "onChange"> & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
34
|
+
export declare const MultiSelect: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").BoxProps, "value" | "onChange"> & {
|
|
35
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
36
|
+
error?: string;
|
|
37
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
38
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
39
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
40
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
41
|
+
customEmpty?: string;
|
|
42
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage/dist/components/MultiSelect/MultiSelectAnchorParams").MultiSelectAnchorParams> | ((params: import("@rocket.chat/fuselage/dist/components/MultiSelect/MultiSelectAnchorParams").MultiSelectAnchorParams) => import("react").ReactNode);
|
|
43
|
+
renderOptions?: import("react").ElementType;
|
|
44
|
+
renderItem?: import("react").ElementType;
|
|
45
|
+
renderSelected?: import("react").ElementType;
|
|
46
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
47
|
+
setFilter?: (filter: string) => void;
|
|
48
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
49
|
+
export declare const Slider: typeof SliderComponent;
|
|
50
|
+
export declare const CheckBox: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & {
|
|
51
|
+
indeterminate?: boolean;
|
|
52
|
+
labelChildren?: import("react").ReactNode;
|
|
53
|
+
} & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
54
|
+
export declare const ToggleSwitch: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
55
|
+
labelChildren?: import("react").ReactNode;
|
|
56
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
57
|
+
export declare const RadioButton: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
58
|
+
labelChildren?: import("react").ReactNode;
|
|
59
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
79
60
|
//# sourceMappingURL=WrappedInputComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,MAAM,IAAI,eAAe,EAC1B,MAAM,uBAAuB,CAAC;AAW/B,eAAO,MAAM,SAAS;;;8GAAkC,CAAC;AACzD,eAAO,MAAM,UAAU;;;oGAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa,gNAAsC,CAAC;AACjE,eAAO,MAAM,WAAW;;;8GAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa;;;oHAAiC,CAAC;AAC5D,eAAO,MAAM,cAAc;;;;8GAAuC,CAAC;AACnE,eAAO,MAAM,WAAW,8MAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ,iMAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;iLAAsC,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;8GAA2C,CAAC;AACpE,eAAO,MAAM,MAAM,EAEd,OAAO,eAAe,CAAC;AAG5B,eAAO,MAAM,QAAQ;;;oKAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;8GAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;8GAAgD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = exports.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
|
|
3
|
+
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Slider = exports.MultiSelect = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = 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
6
|
exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
|
|
@@ -12,6 +12,8 @@ exports.TelephoneInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.Telephon
|
|
|
12
12
|
exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
|
|
13
13
|
exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
|
|
14
14
|
exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
|
|
15
|
+
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.MultiSelect);
|
|
16
|
+
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
15
17
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
16
18
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
17
19
|
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,oDAe+B;AAE/B,yDAI4B;AAKf,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,cAAc,GAAG,IAAA,8BAAW,EAAC,yBAAuB,CAAC,CAAC;AACtD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC,mBAAiB,CAAC,CAAC;AAG1C,QAAA,MAAM,GAAG,IAAA,qCAAkB,EAAC,iBAAe,CAAC,CAAC;AAC7C,QAAA,WAAW,GAAG,IAAA,qCAAkB,EAAC,sBAAoB,CAAC,CAAC;AACvD,QAAA,MAAM,GAAG,IAAA,qCAAkB,EACtC,iBAAe,CACU,CAAC;AAGf,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,24 +1,15 @@
|
|
|
1
|
-
import type { ReactNode, ForwardRefExoticComponent } from 'react';
|
|
1
|
+
import type { ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
type WithLabelId = {
|
|
3
3
|
id?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function withLabelId<TProps>(Component: ForwardRefExoticComponent<TProps & WithLabelId
|
|
6
|
-
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
9
|
-
type WithLablledBy = {
|
|
5
|
+
declare function withLabelId<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithLabelId & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
6
|
+
type WithLabelledBy = {
|
|
10
7
|
'aria-labelledby'?: string;
|
|
11
8
|
};
|
|
12
|
-
declare function withAriaLabelledBy<TProps>(Component: ForwardRefExoticComponent<TProps &
|
|
13
|
-
(props: TProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
9
|
+
declare function withAriaLabelledBy<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithLabelledBy & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
16
10
|
type WithChildrenLabel = {
|
|
17
11
|
labelChildren: ReactNode;
|
|
18
12
|
};
|
|
19
|
-
declare function withVisuallyHiddenLabel<TProps>(Component: ForwardRefExoticComponent<TProps & WithChildrenLabel
|
|
20
|
-
(props: TProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
13
|
+
declare function withVisuallyHiddenLabel<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithChildrenLabel & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
23
14
|
export { withLabelId, withAriaLabelledBy, withVisuallyHiddenLabel };
|
|
24
15
|
//# sourceMappingURL=withLabelHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,yBAAyB,EAEzB,aAAa,EACd,MAAM,OAAO,CAAC;AAUf,KAAK,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,iBAAS,WAAW,CAAC,MAAM,EAAE,IAAI,EAC/B,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAC3C,4FAgBF;AAED,KAAK,cAAc,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,IAAI,EACtC,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAC9C,4FAgBF;AAED,KAAK,iBAAiB,GAAG;IAAE,aAAa,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAC3C,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CACjD,4FAkBF;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -4,29 +4,32 @@ exports.withLabelId = withLabelId;
|
|
|
4
4
|
exports.withAriaLabelledBy = withAriaLabelledBy;
|
|
5
5
|
exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks");
|
|
8
|
+
const react_1 = require("react");
|
|
7
9
|
const react_aria_1 = require("react-aria");
|
|
8
10
|
const FieldContext_1 = require("../Field/FieldContext");
|
|
9
11
|
function withLabelId(Component) {
|
|
10
|
-
const WrappedComponent = function (props) {
|
|
12
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
11
13
|
const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
13
|
-
};
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: ref }));
|
|
15
|
+
});
|
|
14
16
|
WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
15
17
|
return WrappedComponent;
|
|
16
18
|
}
|
|
17
19
|
function withAriaLabelledBy(Component) {
|
|
18
|
-
const WrappedComponent = function (props) {
|
|
20
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
19
21
|
const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
|
|
20
|
-
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
21
|
-
};
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: ref }));
|
|
23
|
+
});
|
|
22
24
|
WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
23
25
|
return WrappedComponent;
|
|
24
26
|
}
|
|
25
27
|
function withVisuallyHiddenLabel(Component) {
|
|
26
|
-
const WrappedComponent = function (props) {
|
|
28
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
27
29
|
const [label, labelProps, labelRef] = (0, FieldContext_1.useFieldWrappedByInputLabel)();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(ref, labelRef);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: mergedRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
|
|
32
|
+
});
|
|
30
33
|
WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
31
34
|
return WrappedComponent;
|
|
32
35
|
}
|
|
@@ -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":";;AAyFS,kCAAW;AAAE,gDAAkB;AAAE,0DAAuB;;AAvFjE,gEAA4D;AAO5D,iCAAmC;AACnC,2CAA4C;AAE5C,wDAI+B;AAI/B,SAAS,WAAW,CAClB,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,CACL,uBAAC,SAAS,OACH,KAA8B,KAC/B,UAAU,EACd,GAAG,EAAE,GAAG,GACR,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,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,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,CACL,uBAAC,SAAS,OACH,KAAiC,KAClC,UAAU,EACd,GAAG,EAAE,GAAG,GACR,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,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,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAA2B,GAAE,CAAC;QACpE,MAAM,SAAS,GAAG,IAAA,8BAAa,EAAC,GAAG,EAAE,QAAqB,CAAC,CAAC;QAC5D,OAAO,CACL,uBAAC,SAAS,OACH,KAAoC,KACrC,UAAU,EACd,GAAG,EAAE,SAAS,EACd,aAAa,EAAE,uBAAC,2BAAc,cAAE,KAAK,GAAkB,GACvD,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,KAAK,eAAe,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC7D,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,
|
|
1
|
+
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,KAAK,eAAe,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC7D,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,4CAO1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -5,7 +5,7 @@ const fuselage_1 = require("@rocket.chat/fuselage");
|
|
|
5
5
|
const FieldContext_1 = require("./FieldContext");
|
|
6
6
|
const FieldError = ({ children, ...props }) => {
|
|
7
7
|
const id = (0, FieldContext_1.useFieldDescriptorId)('error');
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldError, { ...props, id: id, children: children }));
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(fuselage_1.FieldError, { ...props, id: id, role: 'alert', children: children }));
|
|
9
9
|
};
|
|
10
10
|
exports.default = FieldError;
|
|
11
11
|
//# sourceMappingURL=FieldError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":";;;AAAA,oDAA0E;AAG1E,iDAAsD;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldError.js","sourceRoot":"","sources":["../../../src/Field/FieldError.tsx"],"names":[],"mappings":";;;AAAA,oDAA0E;AAG1E,iDAAsD;AAMtD,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,GAAG,IAAA,mCAAoB,EAAC,OAAO,CAAC,CAAC;IACzC,OAAO,CACL,uBAAC,qBAAmB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,OAAO,YACjD,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -1,79 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export declare const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
export declare const CheckBox: {
|
|
61
|
-
(props: import("@rocket.chat/fuselage").BoxProps & {
|
|
62
|
-
indeterminate?: boolean;
|
|
63
|
-
labelChildren?: import("react").ReactNode;
|
|
64
|
-
} & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
65
|
-
displayName: string;
|
|
66
|
-
};
|
|
67
|
-
export declare const ToggleSwitch: {
|
|
68
|
-
(props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
69
|
-
labelChildren?: import("react").ReactNode;
|
|
70
|
-
} & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
71
|
-
displayName: string;
|
|
72
|
-
};
|
|
73
|
-
export declare const RadioButton: {
|
|
74
|
-
(props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
75
|
-
labelChildren?: import("react").ReactNode;
|
|
76
|
-
} & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
-
displayName: string;
|
|
78
|
-
};
|
|
1
|
+
import { Slider as SliderComponent } from '@rocket.chat/fuselage';
|
|
2
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
3
|
+
addon?: import("react").ReactNode;
|
|
4
|
+
error?: string;
|
|
5
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export declare const EmailInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
7
|
+
addon?: import("react").ReactNode;
|
|
8
|
+
error?: string;
|
|
9
|
+
} & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
10
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").PasswordInputProps & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
12
|
+
addon?: import("react").ReactNode;
|
|
13
|
+
error?: string;
|
|
14
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export declare const TextAreaInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
16
|
+
addon?: import("react").ReactNode;
|
|
17
|
+
error?: string;
|
|
18
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
19
|
+
export declare const TelephoneInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
|
|
20
|
+
addon?: import("react").ReactNode;
|
|
21
|
+
input?: import("react").ReactNode;
|
|
22
|
+
error?: string;
|
|
23
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
24
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").NumberInputProps & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export declare const UrlInput: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").UrlInputProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
26
|
+
export declare const Select: import("react").ForwardRefExoticComponent<Omit<Omit<import("react-aria").AriaSelectProps<object>, "value" | "children" | "onChange"> & {
|
|
27
|
+
error?: string;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
value?: import("react").Key | null | undefined;
|
|
30
|
+
onChange?: ((key: import("react").Key) => any) | undefined;
|
|
31
|
+
options: (readonly [value: string, label: string, selected?: boolean | undefined])[];
|
|
32
|
+
small?: boolean;
|
|
33
|
+
} & Omit<import("react").AllHTMLAttributes<HTMLElement>, "value" | "onChange"> & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
34
|
+
export declare const MultiSelect: import("react").ForwardRefExoticComponent<Omit<Omit<import("@rocket.chat/fuselage").BoxProps, "value" | "onChange"> & {
|
|
35
|
+
value?: import("@rocket.chat/fuselage").SelectOption[0][];
|
|
36
|
+
error?: string;
|
|
37
|
+
options: import("@rocket.chat/fuselage").SelectOption[];
|
|
38
|
+
onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
|
|
39
|
+
getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
|
|
40
|
+
getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
|
|
41
|
+
customEmpty?: string;
|
|
42
|
+
anchor?: import("react").ElementType<import("@rocket.chat/fuselage/dist/components/MultiSelect/MultiSelectAnchorParams").MultiSelectAnchorParams> | ((params: import("@rocket.chat/fuselage/dist/components/MultiSelect/MultiSelectAnchorParams").MultiSelectAnchorParams) => import("react").ReactNode);
|
|
43
|
+
renderOptions?: import("react").ElementType;
|
|
44
|
+
renderItem?: import("react").ElementType;
|
|
45
|
+
renderSelected?: import("react").ElementType;
|
|
46
|
+
addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
|
|
47
|
+
setFilter?: (filter: string) => void;
|
|
48
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
49
|
+
export declare const Slider: typeof SliderComponent;
|
|
50
|
+
export declare const CheckBox: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & {
|
|
51
|
+
indeterminate?: boolean;
|
|
52
|
+
labelChildren?: import("react").ReactNode;
|
|
53
|
+
} & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
54
|
+
export declare const ToggleSwitch: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
55
|
+
labelChildren?: import("react").ReactNode;
|
|
56
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
57
|
+
export declare const RadioButton: import("react").ForwardRefExoticComponent<Omit<import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
|
|
58
|
+
labelChildren?: import("react").ReactNode;
|
|
59
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
79
60
|
//# sourceMappingURL=WrappedInputComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,MAAM,IAAI,eAAe,EAC1B,MAAM,uBAAuB,CAAC;AAW/B,eAAO,MAAM,SAAS;;;8GAAkC,CAAC;AACzD,eAAO,MAAM,UAAU;;;oGAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa,gNAAsC,CAAC;AACjE,eAAO,MAAM,WAAW;;;8GAAoC,CAAC;AAC7D,eAAO,MAAM,aAAa;;;oHAAiC,CAAC;AAC5D,eAAO,MAAM,cAAc;;;;8GAAuC,CAAC;AACnE,eAAO,MAAM,WAAW,8MAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ,iMAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;iLAAsC,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;8GAA2C,CAAC;AACpE,eAAO,MAAM,MAAM,EAEd,OAAO,eAAe,CAAC;AAG5B,eAAO,MAAM,QAAQ;;;oKAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;8GAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;8GAAgD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = exports.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
|
|
3
|
+
exports.RadioButton = exports.ToggleSwitch = exports.CheckBox = exports.Slider = exports.MultiSelect = exports.Select = exports.UrlInput = exports.NumberInput = exports.TelephoneInput = 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
6
|
exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
|
|
@@ -12,6 +12,8 @@ exports.TelephoneInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.Telephon
|
|
|
12
12
|
exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
|
|
13
13
|
exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
|
|
14
14
|
exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
|
|
15
|
+
exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.MultiSelect);
|
|
16
|
+
exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
|
|
15
17
|
exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
|
|
16
18
|
exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
|
|
17
19
|
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,oDAe+B;AAE/B,yDAI4B;AAKf,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,cAAc,GAAG,IAAA,8BAAW,EAAC,yBAAuB,CAAC,CAAC;AACtD,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC,sBAAoB,CAAC,CAAC;AAChD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC,mBAAiB,CAAC,CAAC;AAG1C,QAAA,MAAM,GAAG,IAAA,qCAAkB,EAAC,iBAAe,CAAC,CAAC;AAC7C,QAAA,WAAW,GAAG,IAAA,qCAAkB,EAAC,sBAAoB,CAAC,CAAC;AACvD,QAAA,MAAM,GAAG,IAAA,qCAAkB,EACtC,iBAAe,CACU,CAAC;AAGf,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,24 +1,15 @@
|
|
|
1
|
-
import type { ReactNode, ForwardRefExoticComponent } from 'react';
|
|
1
|
+
import type { ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
type WithLabelId = {
|
|
3
3
|
id?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function withLabelId<TProps>(Component: ForwardRefExoticComponent<TProps & WithLabelId
|
|
6
|
-
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
9
|
-
type WithLablledBy = {
|
|
5
|
+
declare function withLabelId<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithLabelId & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
6
|
+
type WithLabelledBy = {
|
|
10
7
|
'aria-labelledby'?: string;
|
|
11
8
|
};
|
|
12
|
-
declare function withAriaLabelledBy<TProps>(Component: ForwardRefExoticComponent<TProps &
|
|
13
|
-
(props: TProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
9
|
+
declare function withAriaLabelledBy<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithLabelledBy & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
16
10
|
type WithChildrenLabel = {
|
|
17
11
|
labelChildren: ReactNode;
|
|
18
12
|
};
|
|
19
|
-
declare function withVisuallyHiddenLabel<TProps>(Component: ForwardRefExoticComponent<TProps & WithChildrenLabel
|
|
20
|
-
(props: TProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
};
|
|
13
|
+
declare function withVisuallyHiddenLabel<TProps, TRef>(Component: ForwardRefExoticComponent<TProps & WithChildrenLabel & RefAttributes<TRef>>): ForwardRefExoticComponent<import("react").PropsWithoutRef<TProps> & RefAttributes<TRef>>;
|
|
23
14
|
export { withLabelId, withAriaLabelledBy, withVisuallyHiddenLabel };
|
|
24
15
|
//# sourceMappingURL=withLabelHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withLabelHelpers.d.ts","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,yBAAyB,EAEzB,aAAa,EACd,MAAM,OAAO,CAAC;AAUf,KAAK,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,iBAAS,WAAW,CAAC,MAAM,EAAE,IAAI,EAC/B,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAC3C,4FAgBF;AAED,KAAK,cAAc,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,IAAI,EACtC,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAC9C,4FAgBF;AAED,KAAK,iBAAiB,GAAG;IAAE,aAAa,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAC3C,SAAS,EAAE,yBAAyB,CAClC,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CACjD,4FAkBF;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -4,29 +4,32 @@ exports.withLabelId = withLabelId;
|
|
|
4
4
|
exports.withAriaLabelledBy = withAriaLabelledBy;
|
|
5
5
|
exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks");
|
|
8
|
+
const react_1 = require("react");
|
|
7
9
|
const react_aria_1 = require("react-aria");
|
|
8
10
|
const FieldContext_1 = require("../Field/FieldContext");
|
|
9
11
|
function withLabelId(Component) {
|
|
10
|
-
const WrappedComponent = function (props) {
|
|
12
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
11
13
|
const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
13
|
-
};
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: ref }));
|
|
15
|
+
});
|
|
14
16
|
WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
15
17
|
return WrappedComponent;
|
|
16
18
|
}
|
|
17
19
|
function withAriaLabelledBy(Component) {
|
|
18
|
-
const WrappedComponent = function (props) {
|
|
20
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
19
21
|
const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
|
|
20
|
-
return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
|
|
21
|
-
};
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: ref }));
|
|
23
|
+
});
|
|
22
24
|
WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
23
25
|
return WrappedComponent;
|
|
24
26
|
}
|
|
25
27
|
function withVisuallyHiddenLabel(Component) {
|
|
26
|
-
const WrappedComponent = function (props) {
|
|
28
|
+
const WrappedComponent = (0, react_1.forwardRef)(function (props, ref) {
|
|
27
29
|
const [label, labelProps, labelRef] = (0, FieldContext_1.useFieldWrappedByInputLabel)();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(ref, labelRef);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: mergedRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
|
|
32
|
+
});
|
|
30
33
|
WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
|
|
31
34
|
return WrappedComponent;
|
|
32
35
|
}
|
|
@@ -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":";;AAyFS,kCAAW;AAAE,gDAAkB;AAAE,0DAAuB;;AAvFjE,gEAA4D;AAO5D,iCAAmC;AACnC,2CAA4C;AAE5C,wDAI+B;AAI/B,SAAS,WAAW,CAClB,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,CACL,uBAAC,SAAS,OACH,KAA8B,KAC/B,UAAU,EACd,GAAG,EAAE,GAAG,GACR,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,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,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,CACL,uBAAC,SAAS,OACH,KAAiC,KAClC,UAAU,EACd,GAAG,EAAE,GAAG,GACR,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,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,SAEC;IAED,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EAAe,UAAU,KAAK,EAAE,GAAG;QACpE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAA2B,GAAE,CAAC;QACpE,MAAM,SAAS,GAAG,IAAA,8BAAa,EAAC,GAAG,EAAE,QAAqB,CAAC,CAAC;QAC5D,OAAO,CACL,uBAAC,SAAS,OACH,KAAoC,KACrC,UAAU,EACd,GAAG,EAAE,SAAS,EACd,aAAa,EAAE,uBAAC,2BAAc,cAAE,KAAK,GAAkB,GACvD,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,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.1.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": {
|
|
@@ -35,11 +35,12 @@
|
|
|
35
35
|
"test": "jest --runInBand"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@rocket.chat/fuselage": "
|
|
38
|
+
"@rocket.chat/fuselage": "^0.75.0",
|
|
39
|
+
"@rocket.chat/fuselage-hooks": "^0.41.0",
|
|
39
40
|
"@rocket.chat/fuselage-tokens": "^0.33.2",
|
|
40
41
|
"@rocket.chat/storybook-dark-mode": "^4.1.0",
|
|
41
42
|
"@storybook/addon-docs": "~9.1.17",
|
|
42
|
-
"@storybook/addon-webpack5-compiler-swc": "~4.0.
|
|
43
|
+
"@storybook/addon-webpack5-compiler-swc": "~4.0.3",
|
|
43
44
|
"@storybook/react-webpack5": "~9.1.17",
|
|
44
45
|
"@testing-library/jest-dom": "~6.9.1",
|
|
45
46
|
"@testing-library/react": "~16.3.2",
|
|
@@ -50,22 +51,22 @@
|
|
|
50
51
|
"@types/react-dom": "~18.3.7",
|
|
51
52
|
"cross-env": "^10.1.0",
|
|
52
53
|
"eslint": "~9.39.2",
|
|
53
|
-
"jest": "~30.
|
|
54
|
+
"jest": "~30.3.0",
|
|
54
55
|
"jest-axe": "~10.0.0",
|
|
55
|
-
"jest-environment-jsdom": "~30.
|
|
56
|
+
"jest-environment-jsdom": "~30.3.0",
|
|
56
57
|
"lint-all": "^0.31.25",
|
|
57
58
|
"prettier": "~3.6.2",
|
|
58
59
|
"react": "~18.3.1",
|
|
59
60
|
"react-dom": "~18.3.1",
|
|
60
61
|
"rimraf": "~6.0.1",
|
|
61
|
-
"storybook": "~9.1.
|
|
62
|
+
"storybook": "~9.1.19",
|
|
62
63
|
"ts-jest": "~29.4.6",
|
|
63
64
|
"typescript": "~5.9.3",
|
|
64
|
-
"webpack": "~5.
|
|
65
|
+
"webpack": "~5.105.4"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
68
|
"@rocket.chat/fuselage": "*",
|
|
68
|
-
"@rocket.chat/fuselage-hooks": "
|
|
69
|
+
"@rocket.chat/fuselage-hooks": "*",
|
|
69
70
|
"react": "*",
|
|
70
71
|
"react-dom": "*"
|
|
71
72
|
},
|