@rocket.chat/fuselage-forms 1.1.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.
@@ -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,4CAQ1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
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;IAEzC,OAAO,CACL,uBAAC,qBAAmB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,YACnC,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,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,99 +1,60 @@
1
1
  import { Slider as SliderComponent } from '@rocket.chat/fuselage';
2
- export declare const TextInput: {
3
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
4
- addon?: import("react").ReactNode;
5
- error?: string;
6
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
7
- displayName: string;
8
- };
9
- export declare const EmailInput: {
10
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
11
- addon?: import("react").ReactNode;
12
- error?: string;
13
- } & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
14
- displayName: string;
15
- };
16
- export declare const PasswordInput: {
17
- (props: import("@rocket.chat/fuselage").PasswordInputProps & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
18
- displayName: string;
19
- };
20
- export declare const SearchInput: {
21
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
22
- addon?: import("react").ReactNode;
23
- error?: string;
24
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
25
- displayName: string;
26
- };
27
- export declare const TextAreaInput: {
28
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
29
- addon?: import("react").ReactNode;
30
- error?: string;
31
- } & import("react").RefAttributes<HTMLTextAreaElement>): import("react/jsx-runtime").JSX.Element;
32
- displayName: string;
33
- };
34
- export declare const TelephoneInput: {
35
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
36
- addon?: import("react").ReactNode;
37
- input?: import("react").ReactNode;
38
- error?: string;
39
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
40
- displayName: string;
41
- };
42
- export declare const NumberInput: {
43
- (props: import("@rocket.chat/fuselage").NumberInputProps & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
44
- displayName: string;
45
- };
46
- export declare const UrlInput: {
47
- (props: import("@rocket.chat/fuselage").UrlInputProps & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
48
- displayName: string;
49
- };
50
- export declare const Select: {
51
- (props: Omit<import("react-aria").AriaSelectProps<object>, "value" | "children" | "onChange"> & {
52
- error?: string;
53
- placeholder?: string;
54
- value?: import("react").Key | null | undefined;
55
- onChange?: ((key: import("react").Key) => any) | undefined;
56
- options: (readonly [value: string, label: string, selected?: boolean | undefined])[];
57
- small?: boolean;
58
- } & Omit<import("react").AllHTMLAttributes<HTMLElement>, "value" | "onChange"> & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
59
- displayName: string;
60
- };
61
- export declare const MultiSelect: {
62
- (props: Omit<import("@rocket.chat/fuselage").BoxProps, "value" | "onChange"> & {
63
- value?: import("@rocket.chat/fuselage").SelectOption[0][];
64
- error?: string;
65
- options: import("@rocket.chat/fuselage").SelectOption[];
66
- onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
67
- getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
68
- getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
69
- customEmpty?: string;
70
- 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);
71
- renderOptions?: import("react").ElementType;
72
- renderItem?: import("react").ElementType;
73
- renderSelected?: import("react").ElementType;
74
- addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
75
- setFilter?: (filter: string) => void;
76
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
77
- displayName: string;
78
- };
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>>;
79
49
  export declare const Slider: typeof SliderComponent;
80
- export declare const CheckBox: {
81
- (props: import("@rocket.chat/fuselage").BoxProps & {
82
- indeterminate?: boolean;
83
- labelChildren?: import("react").ReactNode;
84
- } & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
85
- displayName: string;
86
- };
87
- export declare const ToggleSwitch: {
88
- (props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
89
- labelChildren?: import("react").ReactNode;
90
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
91
- displayName: string;
92
- };
93
- export declare const RadioButton: {
94
- (props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
95
- labelChildren?: import("react").ReactNode;
96
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
97
- displayName: string;
98
- };
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>>;
99
60
  //# sourceMappingURL=WrappedInputComponents.d.ts.map
@@ -1 +1 @@
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;;;;;;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,cAAc;;;;;;;CAAuC,CAAC;AACnE,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ;;;CAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;;;;CAAsC,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAA2C,CAAC;AACpE,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
+ {"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,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
- (props: TProps): import("react/jsx-runtime").JSX.Element;
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 & WithLablledBy>): {
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":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC;AASlE,KAAK,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,iBA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M,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
- return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: labelRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
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":";;AA+DS,kCAAW;AAAE,gDAAkB;AAAE,0DAAuB;;AA5DjE,2CAA4C;AAE5C,wDAI+B;AAI/B,SAAS,WAAW,CAClB,SAA0D;IAE1D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,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,SAA4D;IAE5D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,sBAAs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QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC7D,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,4CAQ1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
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;IAEzC,OAAO,CACL,uBAAC,qBAAmB,OAAK,KAAK,EAAE,EAAE,EAAE,EAAE,YACnC,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,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,99 +1,60 @@
1
1
  import { Slider as SliderComponent } from '@rocket.chat/fuselage';
2
- export declare const TextInput: {
3
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
4
- addon?: import("react").ReactNode;
5
- error?: string;
6
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
7
- displayName: string;
8
- };
9
- export declare const EmailInput: {
10
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
11
- addon?: import("react").ReactNode;
12
- error?: string;
13
- } & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
14
- displayName: string;
15
- };
16
- export declare const PasswordInput: {
17
- (props: import("@rocket.chat/fuselage").PasswordInputProps & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
18
- displayName: string;
19
- };
20
- export declare const SearchInput: {
21
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
22
- addon?: import("react").ReactNode;
23
- error?: string;
24
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
25
- displayName: string;
26
- };
27
- export declare const TextAreaInput: {
28
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
29
- addon?: import("react").ReactNode;
30
- error?: string;
31
- } & import("react").RefAttributes<HTMLTextAreaElement>): import("react/jsx-runtime").JSX.Element;
32
- displayName: string;
33
- };
34
- export declare const TelephoneInput: {
35
- (props: Omit<import("@rocket.chat/fuselage").InputBoxProps, "type"> & {
36
- addon?: import("react").ReactNode;
37
- input?: import("react").ReactNode;
38
- error?: string;
39
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
40
- displayName: string;
41
- };
42
- export declare const NumberInput: {
43
- (props: import("@rocket.chat/fuselage").NumberInputProps & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
44
- displayName: string;
45
- };
46
- export declare const UrlInput: {
47
- (props: import("@rocket.chat/fuselage").UrlInputProps & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
48
- displayName: string;
49
- };
50
- export declare const Select: {
51
- (props: Omit<import("react-aria").AriaSelectProps<object>, "value" | "children" | "onChange"> & {
52
- error?: string;
53
- placeholder?: string;
54
- value?: import("react").Key | null | undefined;
55
- onChange?: ((key: import("react").Key) => any) | undefined;
56
- options: (readonly [value: string, label: string, selected?: boolean | undefined])[];
57
- small?: boolean;
58
- } & Omit<import("react").AllHTMLAttributes<HTMLElement>, "value" | "onChange"> & import("react").RefAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
59
- displayName: string;
60
- };
61
- export declare const MultiSelect: {
62
- (props: Omit<import("@rocket.chat/fuselage").BoxProps, "value" | "onChange"> & {
63
- value?: import("@rocket.chat/fuselage").SelectOption[0][];
64
- error?: string;
65
- options: import("@rocket.chat/fuselage").SelectOption[];
66
- onChange: (params: import("@rocket.chat/fuselage").SelectOption[0][]) => void;
67
- getLabel?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[1];
68
- getValue?: (params: import("@rocket.chat/fuselage").SelectOption) => import("@rocket.chat/fuselage").SelectOption[0];
69
- customEmpty?: string;
70
- 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);
71
- renderOptions?: import("react").ElementType;
72
- renderItem?: import("react").ElementType;
73
- renderSelected?: import("react").ElementType;
74
- addonIcon?: import("@rocket.chat/fuselage").IconProps["name"];
75
- setFilter?: (filter: string) => void;
76
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
77
- displayName: string;
78
- };
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>>;
79
49
  export declare const Slider: typeof SliderComponent;
80
- export declare const CheckBox: {
81
- (props: import("@rocket.chat/fuselage").BoxProps & {
82
- indeterminate?: boolean;
83
- labelChildren?: import("react").ReactNode;
84
- } & import("react").AllHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
85
- displayName: string;
86
- };
87
- export declare const ToggleSwitch: {
88
- (props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
89
- labelChildren?: import("react").ReactNode;
90
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
91
- displayName: string;
92
- };
93
- export declare const RadioButton: {
94
- (props: import("@rocket.chat/fuselage").BoxProps & import("react").AllHTMLAttributes<HTMLInputElement> & {
95
- labelChildren?: import("react").ReactNode;
96
- } & import("react").RefAttributes<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
97
- displayName: string;
98
- };
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>>;
99
60
  //# sourceMappingURL=WrappedInputComponents.d.ts.map
@@ -1 +1 @@
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;;;;;;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,cAAc;;;;;;;CAAuC,CAAC;AACnE,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAC7D,eAAO,MAAM,QAAQ;;;CAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;;;;CAAsC,CAAC;AAC1D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAA2C,CAAC;AACpE,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
+ {"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,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
- (props: TProps): import("react/jsx-runtime").JSX.Element;
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 & WithLablledBy>): {
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":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC;AASlE,KAAK,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,iBAAS,WAAW,CAAC,MAAM,EACzB,SAAS,EAAE,yBAAyB,CAAC,MAAM,GAAG,WAAW,CAAC;YAEhB,MAAM;;EAQjD;AAED,KAAK,aAAa,GAAG;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,iBAAS,kBAAkB,CAAC,MAAM,EAChC,SAAS,EAAE,yBAAyB,CAAC,MAAM,GAAG,aAAa,CAAC;YAElB,MAAM;;EAQjD;AAED,KAAK,iBAAiB,GAAG;IAAE,aAAa,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,iBAAS,uBAAuB,CAAC,MAAM,EACrC,SAAS,EAAE,yBAAyB,CAAC,MAAM,GAAG,iBAAiB,CAAC;YAEtB,MAAM;;EAejD;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
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
- return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: labelRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
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":";;AA+DS,kCAAW;AAAE,gDAAkB;AAAE,0DAAuB;;AA5DjE,2CAA4C;AAE5C,wDAI+B;AAI/B,SAAS,WAAW,CAClB,SAA0D;IAE1D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,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,SAA4D;IAE5D,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,UAAU,GAAG,IAAA,wCAAyB,GAAE,CAAC;QAC/C,OAAO,uBAAC,SAAS,OAAK,KAAK,KAAM,UAAU,GAAI,CAAC;IAClD,CAAC,CAAC;IAEF,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,SAAgE;IAEhE,MAAM,gBAAgB,GAAG,UAAU,KAAa;QAC9C,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAA2B,GAAE,CAAC;QACpE,OAAO,CACL,uBAAC,SAAS,OACJ,KAAK,KACL,UAAU,EACd,GAAG,EAAE,QAAQ,EACb,aAAa,EAAE,uBAAC,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;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.1.0",
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,12 +35,12 @@
35
35
  "test": "jest --runInBand"
36
36
  },
37
37
  "devDependencies": {
38
- "@rocket.chat/fuselage": "^0.74.0",
38
+ "@rocket.chat/fuselage": "^0.75.0",
39
39
  "@rocket.chat/fuselage-hooks": "^0.41.0",
40
40
  "@rocket.chat/fuselage-tokens": "^0.33.2",
41
41
  "@rocket.chat/storybook-dark-mode": "^4.1.0",
42
42
  "@storybook/addon-docs": "~9.1.17",
43
- "@storybook/addon-webpack5-compiler-swc": "~4.0.2",
43
+ "@storybook/addon-webpack5-compiler-swc": "~4.0.3",
44
44
  "@storybook/react-webpack5": "~9.1.17",
45
45
  "@testing-library/jest-dom": "~6.9.1",
46
46
  "@testing-library/react": "~16.3.2",
@@ -51,9 +51,9 @@
51
51
  "@types/react-dom": "~18.3.7",
52
52
  "cross-env": "^10.1.0",
53
53
  "eslint": "~9.39.2",
54
- "jest": "~30.2.0",
54
+ "jest": "~30.3.0",
55
55
  "jest-axe": "~10.0.0",
56
- "jest-environment-jsdom": "~30.2.0",
56
+ "jest-environment-jsdom": "~30.3.0",
57
57
  "lint-all": "^0.31.25",
58
58
  "prettier": "~3.6.2",
59
59
  "react": "~18.3.1",
@@ -62,7 +62,7 @@
62
62
  "storybook": "~9.1.19",
63
63
  "ts-jest": "~29.4.6",
64
64
  "typescript": "~5.9.3",
65
- "webpack": "~5.102.1"
65
+ "webpack": "~5.105.4"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@rocket.chat/fuselage": "*",