@rocket.chat/fuselage-forms 1.5.1 → 2.0.0-rc.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.
Files changed (116) hide show
  1. package/README.md +126 -57
  2. package/dist/cjs/Field/Field.js +18 -3
  3. package/dist/cjs/Field/Field.js.map +1 -1
  4. package/dist/cjs/Field/FieldContext.js +35 -30
  5. package/dist/cjs/Field/FieldContext.js.map +1 -1
  6. package/dist/cjs/Field/FieldDescription.js +14 -2
  7. package/dist/cjs/Field/FieldDescription.js.map +1 -1
  8. package/dist/cjs/Field/FieldError.js +14 -2
  9. package/dist/cjs/Field/FieldError.js.map +1 -1
  10. package/dist/cjs/Field/FieldHint.js +14 -2
  11. package/dist/cjs/Field/FieldHint.js.map +1 -1
  12. package/dist/cjs/Field/FieldProvider.js.map +1 -1
  13. package/dist/cjs/Field/Label/FieldLabel.js +9 -6
  14. package/dist/cjs/Field/Label/FieldLabel.js.map +1 -1
  15. package/dist/cjs/Field/Label/HiddenLabel.js +16 -2
  16. package/dist/cjs/Field/Label/HiddenLabel.js.map +1 -1
  17. package/dist/cjs/Field/Label/LabelFor.js +16 -2
  18. package/dist/cjs/Field/Label/LabelFor.js.map +1 -1
  19. package/dist/cjs/Field/Label/ReferencedLabel.js +16 -2
  20. package/dist/cjs/Field/Label/ReferencedLabel.js.map +1 -1
  21. package/dist/cjs/Field/Label/index.js +7 -4
  22. package/dist/cjs/Field/Label/index.js.map +1 -1
  23. package/dist/cjs/Field/index.js +8 -5
  24. package/dist/cjs/Field/index.js.map +1 -1
  25. package/dist/cjs/Inputs/WrappedInputComponents.js +1 -1
  26. package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
  27. package/dist/cjs/Inputs/withLabelHelpers.js +13 -9
  28. package/dist/cjs/Inputs/withLabelHelpers.js.map +1 -1
  29. package/dist/esm/Field/Field.d.ts.map +1 -1
  30. package/dist/esm/Field/Field.js +17 -10
  31. package/dist/esm/Field/Field.js.map +1 -1
  32. package/dist/esm/Field/FieldContext.d.ts +7 -20
  33. package/dist/esm/Field/FieldContext.d.ts.map +1 -1
  34. package/dist/esm/Field/FieldContext.js +60 -65
  35. package/dist/esm/Field/FieldContext.js.map +1 -1
  36. package/dist/esm/Field/FieldDescription.d.ts.map +1 -1
  37. package/dist/esm/Field/FieldDescription.js +19 -9
  38. package/dist/esm/Field/FieldDescription.js.map +1 -1
  39. package/dist/esm/Field/FieldError.d.ts.map +1 -1
  40. package/dist/esm/Field/FieldError.js +19 -9
  41. package/dist/esm/Field/FieldError.js.map +1 -1
  42. package/dist/esm/Field/FieldHint.d.ts.map +1 -1
  43. package/dist/esm/Field/FieldHint.js +19 -9
  44. package/dist/esm/Field/FieldHint.js.map +1 -1
  45. package/dist/esm/Field/FieldProvider.d.ts.map +1 -1
  46. package/dist/esm/Field/FieldProvider.js +15 -17
  47. package/dist/esm/Field/FieldProvider.js.map +1 -1
  48. package/dist/esm/Field/Label/FieldLabel.d.ts.map +1 -1
  49. package/dist/esm/Field/Label/FieldLabel.js +10 -15
  50. package/dist/esm/Field/Label/FieldLabel.js.map +1 -1
  51. package/dist/esm/Field/Label/HiddenLabel.d.ts +1 -1
  52. package/dist/esm/Field/Label/HiddenLabel.d.ts.map +1 -1
  53. package/dist/esm/Field/Label/HiddenLabel.js +21 -9
  54. package/dist/esm/Field/Label/HiddenLabel.js.map +1 -1
  55. package/dist/esm/Field/Label/LabelFor.d.ts +1 -1
  56. package/dist/esm/Field/Label/LabelFor.d.ts.map +1 -1
  57. package/dist/esm/Field/Label/LabelFor.js +21 -9
  58. package/dist/esm/Field/Label/LabelFor.js.map +1 -1
  59. package/dist/esm/Field/Label/ReferencedLabel.d.ts +1 -1
  60. package/dist/esm/Field/Label/ReferencedLabel.d.ts.map +1 -1
  61. package/dist/esm/Field/Label/ReferencedLabel.js +21 -9
  62. package/dist/esm/Field/Label/ReferencedLabel.js.map +1 -1
  63. package/dist/esm/Field/Label/index.d.ts +1 -1
  64. package/dist/esm/Field/Label/index.d.ts.map +1 -1
  65. package/dist/esm/Field/Label/index.js +4 -14
  66. package/dist/esm/Field/Label/index.js.map +1 -1
  67. package/dist/esm/Field/index.d.ts +3 -3
  68. package/dist/esm/Field/index.d.ts.map +1 -1
  69. package/dist/esm/Field/index.js +8 -37
  70. package/dist/esm/Field/index.js.map +1 -1
  71. package/dist/esm/Inputs/WrappedInputComponents.d.ts +25 -14
  72. package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
  73. package/dist/esm/Inputs/WrappedInputComponents.js +17 -20
  74. package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
  75. package/dist/esm/Inputs/index.js +1 -17
  76. package/dist/esm/Inputs/index.js.map +1 -1
  77. package/dist/esm/Inputs/withLabelHelpers.d.ts +1 -1
  78. package/dist/esm/Inputs/withLabelHelpers.d.ts.map +1 -1
  79. package/dist/esm/Inputs/withLabelHelpers.js +23 -24
  80. package/dist/esm/Inputs/withLabelHelpers.js.map +1 -1
  81. package/dist/esm/index.js +2 -18
  82. package/dist/esm/index.js.map +1 -1
  83. package/package.json +39 -46
  84. package/dist/cjs/Field/Field.d.ts +0 -8
  85. package/dist/cjs/Field/Field.d.ts.map +0 -1
  86. package/dist/cjs/Field/FieldContext.d.ts +0 -40
  87. package/dist/cjs/Field/FieldContext.d.ts.map +0 -1
  88. package/dist/cjs/Field/FieldDescription.d.ts +0 -8
  89. package/dist/cjs/Field/FieldDescription.d.ts.map +0 -1
  90. package/dist/cjs/Field/FieldError.d.ts +0 -8
  91. package/dist/cjs/Field/FieldError.d.ts.map +0 -1
  92. package/dist/cjs/Field/FieldHint.d.ts +0 -8
  93. package/dist/cjs/Field/FieldHint.d.ts.map +0 -1
  94. package/dist/cjs/Field/FieldProvider.d.ts +0 -7
  95. package/dist/cjs/Field/FieldProvider.d.ts.map +0 -1
  96. package/dist/cjs/Field/Label/FieldLabel.d.ts +0 -6
  97. package/dist/cjs/Field/Label/FieldLabel.d.ts.map +0 -1
  98. package/dist/cjs/Field/Label/HiddenLabel.d.ts +0 -6
  99. package/dist/cjs/Field/Label/HiddenLabel.d.ts.map +0 -1
  100. package/dist/cjs/Field/Label/LabelFor.d.ts +0 -6
  101. package/dist/cjs/Field/Label/LabelFor.d.ts.map +0 -1
  102. package/dist/cjs/Field/Label/ReferencedLabel.d.ts +0 -6
  103. package/dist/cjs/Field/Label/ReferencedLabel.d.ts.map +0 -1
  104. package/dist/cjs/Field/Label/index.d.ts +0 -5
  105. package/dist/cjs/Field/Label/index.d.ts.map +0 -1
  106. package/dist/cjs/Field/index.d.ts +0 -9
  107. package/dist/cjs/Field/index.d.ts.map +0 -1
  108. package/dist/cjs/Inputs/WrappedInputComponents.d.ts +0 -116
  109. package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +0 -1
  110. package/dist/cjs/Inputs/index.d.ts +0 -2
  111. package/dist/cjs/Inputs/index.d.ts.map +0 -1
  112. package/dist/cjs/Inputs/withLabelHelpers.d.ts +0 -32
  113. package/dist/cjs/Inputs/withLabelHelpers.d.ts.map +0 -1
  114. package/dist/cjs/index.d.ts +0 -3
  115. package/dist/cjs/index.d.ts.map +0 -1
  116. package/dist/esm/tsdoc-metadata.json +0 -11
@@ -1 +1 @@
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,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QAAQ;;;;;;CAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;;;;CAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;;;;CAAgD,CAAC"}
@@ -1,30 +1,27 @@
1
- "use strict";
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.TextAreaInput = exports.SearchInput = exports.PasswordInput = exports.EmailInput = exports.TextInput = void 0;
4
- const fuselage_1 = require("@rocket.chat/fuselage");
5
- const withLabelHelpers_1 = require("./withLabelHelpers");
1
+ import { TextInput as TextInputComponent, Select as SelectComponent, CheckBox as CheckBoxComponent, ToggleSwitch as ToggleSwitchComponent, RadioButton as RadioButtonComponent, EmailInput as EmailInputComponent, PasswordInput as PasswordInputComponent, SearchInput as SearchInputComponent, TextAreaInput as TextAreaComponent, NumberInput as NumberInputComponent, UrlInput as UrlInputComponent, AutoComplete as AutoCompleteComponent, MultiSelect as MultiSelectComponent, MultiSelectFiltered as MultiSelectFilteredComponent, Slider as SliderComponent, } from '@rocket.chat/fuselage';
2
+ import { withLabelId, withAriaLabelledBy, withAriaLabelledByAndId, withVisuallyHiddenLabel } from './withLabelHelpers';
6
3
  // TODO: Some inputs are still not supported due to requiring a different a11y approach
7
4
  // with id
8
- exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
9
- exports.EmailInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.EmailInput);
10
- exports.PasswordInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.PasswordInput);
11
- exports.SearchInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.SearchInput);
12
- exports.TextAreaInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextAreaInput);
13
- exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
14
- exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
5
+ export const TextInput = withLabelId(TextInputComponent);
6
+ export const EmailInput = withLabelId(EmailInputComponent);
7
+ export const PasswordInput = withLabelId(PasswordInputComponent);
8
+ export const SearchInput = withLabelId(SearchInputComponent);
9
+ export const TextAreaInput = withLabelId(TextAreaComponent);
10
+ export const NumberInput = withLabelId(NumberInputComponent);
11
+ export const UrlInput = withLabelId(UrlInputComponent);
15
12
  // with aria-labelledby
16
- exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
13
+ export const Select = withAriaLabelledBy(SelectComponent);
17
14
  // with aria-labelledby + id for aria-controls
18
15
  /**
19
16
  * @deprecated Use `MultiSelectFiltered` instead, or `SelectFiltered` from
20
17
  * `@rocket.chat/fuselage` for single selection.
21
18
  */
22
- exports.AutoComplete = (0, withLabelHelpers_1.withAriaLabelledByAndId)((fuselage_1.AutoComplete));
23
- exports.MultiSelect = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelect);
24
- exports.MultiSelectFiltered = (0, withLabelHelpers_1.withAriaLabelledByAndId)(fuselage_1.MultiSelectFiltered);
25
- exports.Slider = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Slider);
19
+ export const AutoComplete = withAriaLabelledByAndId(AutoCompleteComponent);
20
+ export const MultiSelect = withAriaLabelledByAndId(MultiSelectComponent);
21
+ export const MultiSelectFiltered = withAriaLabelledByAndId(MultiSelectFilteredComponent);
22
+ export const Slider = withAriaLabelledBy(SliderComponent);
26
23
  // with visually hidden label
27
- exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
28
- exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
29
- exports.RadioButton = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.RadioButton);
24
+ export const CheckBox = withVisuallyHiddenLabel(CheckBoxComponent);
25
+ export const ToggleSwitch = withVisuallyHiddenLabel(ToggleSwitchComponent);
26
+ export const RadioButton = withVisuallyHiddenLabel(RadioButtonComponent);
30
27
  //# sourceMappingURL=WrappedInputComponents.js.map
@@ -1 +1 @@
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,0C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AAC;AAEvD,uBAAuB;AACvB,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE1D,8CAA8C;AAC9C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC,qBAA0B,CAAiC,CAAC;AAChH,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,4BAA4B,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,eAAe,CAA2B,CAAC;AAEpF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./WrappedInputComponents"), exports);
1
+ export * from './WrappedInputComponents';
18
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -28,5 +28,5 @@ declare function withVisuallyHiddenLabel<TProps, TRef>(Component: ComponentType<
28
28
  (props: TProps & RefAttributes<TRef>): import("react").JSX.Element;
29
29
  displayName: string;
30
30
  };
31
- export { withLabelId, withAriaLabelledBy, withAriaLabelledByAndId, withVisuallyHiddenLabel, };
31
+ export { withLabelId, withAriaLabelledBy, withAriaLabelledByAndId, withVisuallyHiddenLabel };
32
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;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;IA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AAC;;EAQ7D;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,EAAE,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,mBAAmB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACzF,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAQ7D;AAED,KAAK,iBAAiB,GAAG;IAAE,aAAa,EAAE,SAAS,CAAA;CAAE,CAAC;AAEtD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACvF,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC;;EAS7D;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,46 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withLabelId = withLabelId;
4
- exports.withAriaLabelledBy = withAriaLabelledBy;
5
- exports.withAriaLabelledByAndId = withAriaLabelledByAndId;
6
- exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
8
2
  // Disabled this flag since we need to wrap multiple components
9
- /* eslint-disable react/no-multi-comp */
10
- const fuselage_hooks_1 = require("@rocket.chat/fuselage-hooks");
11
- const react_aria_1 = require("react-aria");
12
- const FieldContext_1 = require("../Field/FieldContext");
3
+ /* oxlint-disable react/no-multi-comp */
4
+ import { useMergedRefs } from '@rocket.chat/fuselage-hooks';
5
+ import { VisuallyHidden } from 'react-aria';
6
+ import { useFieldReferencedByInput, useFieldReferencedByLabel, useFieldReferencedByLabelWithId, useFieldWrappedByInputLabel, } from '../Field/FieldContext';
13
7
  function withLabelId(Component) {
8
+ var _a, _b;
14
9
  function WrappedComponent(props) {
15
- const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
16
- return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
10
+ const labelProps = useFieldReferencedByInput();
11
+ return _jsx(Component, Object.assign({}, props, labelProps));
17
12
  }
18
- WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
13
+ WrappedComponent.displayName = `withLabelId(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent'})`;
19
14
  return WrappedComponent;
20
15
  }
21
16
  function withAriaLabelledBy(Component) {
17
+ var _a, _b;
22
18
  function WrappedComponent(props) {
23
- const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
24
- return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
19
+ const labelProps = useFieldReferencedByLabel();
20
+ return _jsx(Component, Object.assign({}, props, labelProps));
25
21
  }
26
- WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
22
+ WrappedComponent.displayName = `withAriaLabelledBy(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent'})`;
27
23
  return WrappedComponent;
28
24
  }
29
25
  function withAriaLabelledByAndId(Component) {
26
+ var _a, _b;
30
27
  function WrappedComponent(props) {
31
- const labelProps = (0, FieldContext_1.useFieldReferencedByLabelWithId)();
32
- return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
28
+ const labelProps = useFieldReferencedByLabelWithId();
29
+ return _jsx(Component, Object.assign({}, props, labelProps));
33
30
  }
34
- WrappedComponent.displayName = `withAriaLabelledByAndId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
31
+ WrappedComponent.displayName = `withAriaLabelledByAndId(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent'})`;
35
32
  return WrappedComponent;
36
33
  }
37
34
  function withVisuallyHiddenLabel(Component) {
35
+ var _a, _b;
38
36
  function WrappedComponent(props) {
39
- const [label, labelProps, labelRef] = (0, FieldContext_1.useFieldWrappedByInputLabel)();
40
- const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(props.ref, labelRef);
41
- return ((0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps, ref: mergedRef, labelChildren: (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: label }) }));
37
+ const [label, labelProps, labelRef] = useFieldWrappedByInputLabel();
38
+ const mergedRef = useMergedRefs(props.ref, labelRef);
39
+ return _jsx(Component, Object.assign({}, props, labelProps, { ref: mergedRef, labelChildren: _jsx(VisuallyHidden, { children: label }) }));
42
40
  }
43
- WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
41
+ WrappedComponent.displayName = `withVisuallyHiddenLabel(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent'})`;
44
42
  return WrappedComponent;
45
43
  }
44
+ export { withLabelId, withAriaLabelledBy, withAriaLabelledByAndId, withVisuallyHiddenLabel };
46
45
  //# sourceMappingURL=withLabelHelpers.js.map
@@ -1 +1 @@
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,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E;;IAC1H,SAAS,gBAAgB,CAAC,KAAmC;QAC5D,MAAM,UAAU,GAAG,+BAA+B,EAAE,CAAC;QACrD,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAM,UAAU,EAAI,CAAC;IACjD,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,YAAA,SAAS,CAAC,WAAW,mCAAI,SAAS,CAAC,IAAI,mCAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAID,SAAS,uBAAuB,CAAe,SAA0E;;IACxH,SAAS,gBAAgB,CAAC,KAAmC;QAC5D,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,GAAG,2BAA2B,EAAE,CAAC;QACpE,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,QAAqB,CAAC,CAAC;QAClE,OAAO,KAAC,SAAS,oBAAK,KAAK,EAAM,UAAU,IAAE,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,KAAC,cAAc,cAAE,KAAK,GAAkB,IAAI,CAAC;IAC1H,CAAC;IAED,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,YAAA,SAAS,CAAC,WAAW,mCAAI,SAAS,CAAC,IAAI,mCAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Inputs"), exports);
18
- __exportStar(require("./Field"), exports);
1
+ export * from './Inputs';
2
+ export * from './Field';
19
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "name": "@rocket.chat/fuselage-forms",
3
- "version": "1.5.1",
3
+ "version": "2.0.0-rc.1",
4
4
  "description": "A set of component wrappers to provide ease of use and accessibility out-of-box.",
5
- "homepage": "https://github.com/RocketChat/fuselage#readme",
5
+ "keywords": [
6
+ "rocketchat",
7
+ "rocketchat-fuselage",
8
+ "fuselage",
9
+ "forms",
10
+ "fuselage-forms"
11
+ ],
12
+ "homepage": "https://github.com/RocketChat/Rocket.Chat#readme",
6
13
  "bugs": {
7
- "url": "https://github.com/RocketChat/fuselage/issues"
14
+ "url": "https://github.com/RocketChat/Rocket.Chat/issues"
8
15
  },
9
16
  "repository": {
10
17
  "type": "git",
11
- "url": "git+https://github.com/RocketChat/fuselage.git",
18
+ "url": "git+https://github.com/RocketChat/Rocket.Chat.git",
12
19
  "directory": "packages/fuselage-forms"
13
20
  },
14
21
  "license": "MIT",
@@ -23,51 +30,41 @@
23
30
  "/dist"
24
31
  ],
25
32
  "scripts": {
26
- ".:build:clean": "rimraf dist",
27
- ".:build:cjs": "tsc -p tsconfig.cjs.json",
28
- ".:build:esm": "tsc -p tsconfig.esm.json",
29
- ".:build:api": "api-extractor run --local",
30
- "storybook": "storybook dev -p 6006 --no-version-updates",
31
- "build": "run .:build:clean && run .:build:esm && run .:build:cjs && run .:build:api",
32
- "clean": "rimraf dist",
33
- "docs": "NODE_ENV=production storybook build -o ../../static/fuselage-forms",
34
- "lint": "lint",
35
- "lint-and-fix": "lint-and-fix",
36
- "test": "jest --runInBand"
33
+ "build": "rm -rf dist && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json",
34
+ "build-storybook": "storybook build",
35
+ "lint": "yarn run -T oxlint",
36
+ "lint:fix": "yarn run -T oxlint --fix",
37
+ "storybook": "storybook dev -p 6006",
38
+ "test": "jest",
39
+ "testunit": "jest",
40
+ "typecheck": "tsc --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@rocket.chat/emitter": "~0.33.1-rc.0",
44
+ "react-aria": "~3.37.0"
37
45
  },
38
46
  "devDependencies": {
39
- "@microsoft/api-extractor": "~7.58.12",
40
- "@rocket.chat/fuselage": "^0.85.0",
41
- "@rocket.chat/fuselage-hooks": "^0.43.0",
42
- "@rocket.chat/fuselage-tokens": "^0.33.2",
43
- "@rocket.chat/storybook-dark-mode": "^4.2.1",
44
- "@storybook/addon-docs": "~9.1.20",
45
- "@storybook/addon-webpack5-compiler-swc": "~4.0.3",
46
- "@storybook/react-webpack5": "~9.1.20",
47
- "@testing-library/dom": "~10.4.1",
48
- "@testing-library/jest-dom": "~6.9.1",
49
- "@testing-library/react": "~16.3.2",
50
- "@testing-library/user-event": "~14.6.1",
51
- "@types/jest": "~30.0.0",
47
+ "@rocket.chat/fuselage": "~1.0.0-rc.1",
48
+ "@rocket.chat/fuselage-hooks": "^0.44.0-rc.0",
49
+ "@rocket.chat/jest-presets": "~0.0.4-rc.0",
50
+ "@rocket.chat/storybook-config": "~1.0.0-rc.1",
51
+ "@rocket.chat/tsconfig": "~0.0.0",
52
+ "@testing-library/dom": "~10.4.2",
53
+ "@testing-library/react": "~16.3.3",
54
+ "@testing-library/user-event": "~14.6.7",
52
55
  "@types/jest-axe": "~3.5.9",
53
- "@types/react": "~19.2.17",
54
- "@types/react-dom": "~19.2.3",
55
- "eslint": "~10.8.0",
56
- "jest": "~30.4.2",
57
- "jest-axe": "~10.0.0",
58
- "jest-environment-jsdom": "~30.4.1",
59
- "lint-all": "^0.31.25",
60
- "prettier": "~3.6.2",
56
+ "@types/react": "~19.2.18",
57
+ "@types/react-dom": "~19.2.7",
58
+ "jest": "~30.5.2",
59
+ "jest-axe": "~11.0.0",
61
60
  "react": "~19.2.8",
62
61
  "react-dom": "~19.2.8",
63
- "rimraf": "~6.1.3",
64
- "storybook": "~9.1.20",
65
- "ts-jest": "~29.4.12",
66
- "typescript": "~5.9.3"
62
+ "storybook": "~9.1.21",
63
+ "typescript": "~7.0.2"
67
64
  },
68
65
  "peerDependencies": {
69
- "@rocket.chat/fuselage": "*",
70
- "@rocket.chat/fuselage-hooks": "*",
66
+ "@rocket.chat/fuselage": "1.0.0-rc.1",
67
+ "@rocket.chat/fuselage-hooks": "0.44.0-rc.0",
71
68
  "react": "*",
72
69
  "react-dom": "*"
73
70
  },
@@ -76,9 +73,5 @@
76
73
  },
77
74
  "publishConfig": {
78
75
  "access": "public"
79
- },
80
- "dependencies": {
81
- "@rocket.chat/emitter": "^0.33.0",
82
- "react-aria": "~3.37.0"
83
76
  }
84
77
  }
@@ -1,8 +0,0 @@
1
- import { Field as FieldComponent } from '@rocket.chat/fuselage';
2
- import type { ComponentProps, ReactNode } from 'react';
3
- export type FieldProps = {
4
- children: ReactNode;
5
- } & ComponentProps<typeof FieldComponent>;
6
- declare function Field({ children, ...props }: FieldProps): import("react").JSX.Element;
7
- export default Field;
8
- //# sourceMappingURL=Field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC/D,OAAO,cAAc,CACtB,CAAC;AAEF,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAMhD;AAED,eAAe,KAAK,CAAC"}
@@ -1,40 +0,0 @@
1
- import type { ReactNode, RefCallback } from 'react';
2
- export type FieldContextValue = {
3
- setDescriptor: (type: LabelTypes, unregister?: boolean) => void;
4
- setLabel: (label: ReactNode) => void;
5
- descriptors: Set<LabelTypes>;
6
- label: ReactNode | null;
7
- id: string;
8
- fieldType: FieldType;
9
- setFieldType: (fieldType: FieldType) => void;
10
- emitAction: () => void;
11
- onAction: (cb: () => void) => void;
12
- };
13
- export declare const FieldContext: import("react").Context<FieldContextValue>;
14
- export type LabelTypes = 'hint' | 'description' | 'error' | 'placeholder';
15
- export type FieldType = 'wrappedByLabel' | 'referencedByLabel' | 'referencedByInput';
16
- export declare const useFieldLabel: () => [RefCallback<HTMLElement>, string];
17
- export declare const useFieldFieldType: () => FieldType;
18
- export declare const useFieldDescriptorId: (type: LabelTypes) => string;
19
- export declare const useFieldReferencedByInput: () => {
20
- 'aria-invalid': "true" | "false";
21
- id: string;
22
- 'aria-describedby': string;
23
- };
24
- export declare const useFieldReferencedByLabel: () => {
25
- 'aria-invalid': "true" | "false";
26
- 'aria-labelledby': string;
27
- 'aria-describedby': string;
28
- };
29
- export declare const useFieldReferencedByLabelWithId: () => {
30
- 'aria-invalid': "true" | "false";
31
- id: string;
32
- 'aria-labelledby': string;
33
- 'aria-describedby': string;
34
- };
35
- export declare const useFieldWrappedByInputLabel: () => [ReactNode, {
36
- "aria-describedby": string;
37
- "id": string;
38
- "aria-invalid": "true" | "false";
39
- }, RefCallback<HTMLElement>];
40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AO,MAAM,+BAA+B;oBA5CvB,MAAM,GAAG,OAAO;;;;CA4DpC,CAAC;AAGF,eAAO,MAAM,2BAA2B,QAAO,CAC7C,SAAS,EACT;IACE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC,EACD,WAAW,CAAC,WAAW,CAAC,CAqCzB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FieldDescription as FieldDescriptionComponent } from '@rocket.chat/fuselage';
2
- import type { ReactNode, ComponentProps } from 'react';
3
- export type FieldDescriptionProps = {
4
- children: ReactNode;
5
- } & ComponentProps<typeof FieldDescriptionComponent>;
6
- declare const FieldDescription: ({ children, ...props }: FieldDescriptionProps) => import("react").JSX.Element;
7
- export default FieldDescription;
8
- //# sourceMappingURL=FieldDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldDescription.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CAC1E,OAAO,yBAAyB,CACjC,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,wBAAwB,qBAAqB,gCAQtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FieldError as FieldErrorComponent } from '@rocket.chat/fuselage';
2
- import type { ReactNode, ComponentProps } from 'react';
3
- export type FieldErrorProps = {
4
- children: ReactNode;
5
- } & ComponentProps<typeof FieldErrorComponent>;
6
- declare const FieldError: ({ children, ...props }: FieldErrorProps) => import("react").JSX.Element;
7
- export default FieldError;
8
- //# sourceMappingURL=FieldError.d.ts.map
@@ -1 +0,0 @@
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,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CACpE,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,wBAAwB,eAAe,gCAO1D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,8 +0,0 @@
1
- import { FieldHint as FieldHintComponent } from '@rocket.chat/fuselage';
2
- import type { ReactNode, ComponentProps } from 'react';
3
- export type FieldHintProps = {
4
- children: ReactNode;
5
- } & ComponentProps<typeof FieldHintComponent>;
6
- declare const FieldHint: ({ children, ...props }: FieldHintProps) => import("react").JSX.Element;
7
- export default FieldHint;
8
- //# sourceMappingURL=FieldHint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldHint.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldHint.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,cAAc,CACnE,OAAO,kBAAkB,CAC1B,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,wBAAwB,cAAc,gCAQxD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export type FieldProviderProps = {
3
- children: ReactNode;
4
- };
5
- declare function FieldProvider({ children }: FieldProviderProps): import("react").JSX.Element;
6
- export default FieldProvider;
7
- //# sourceMappingURL=FieldProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldProvider.d.ts","sourceRoot":"","sources":["../../../src/Field/FieldProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC;AAEzD,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAoDtD;AAED,eAAe,aAAa,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { FieldLabel as FieldLabelComponent } from '@rocket.chat/fuselage';
2
- import { type ComponentPropsWithoutRef } from 'react';
3
- export type FieldLabelProps = ComponentPropsWithoutRef<typeof FieldLabelComponent>;
4
- declare const FieldLabel: (props: FieldLabelProps) => import("react").JSX.Element;
5
- export default FieldLabel;
6
- //# sourceMappingURL=FieldLabel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../../../src/Field/Label/FieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAQtD,MAAM,MAAM,eAAe,GAAG,wBAAwB,CACpD,OAAO,mBAAmB,CAC3B,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,OAAO,eAAe,gCAWzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- import { FieldLabel as FieldLabelComponent } from '@rocket.chat/fuselage';
2
- import type { ComponentProps } from 'react';
3
- export type HiddenLabelProps = ComponentProps<typeof FieldLabelComponent>;
4
- declare const HiddenLabel: ({ children, ...props }: HiddenLabelProps) => import("react").JSX.Element;
5
- export default HiddenLabel;
6
- //# sourceMappingURL=HiddenLabel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HiddenLabel.d.ts","sourceRoot":"","sources":["../../../../src/Field/Label/HiddenLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE1E,QAAA,MAAM,WAAW,GAAI,wBAAwB,gBAAgB,gCAQ5D,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,6 +0,0 @@
1
- import { FieldLabel as FieldLabelComponent } from '@rocket.chat/fuselage';
2
- import type { ComponentProps } from 'react';
3
- export type LabelForProps = ComponentProps<typeof FieldLabelComponent>;
4
- declare const LabelFor: ({ children, ...props }: LabelForProps) => import("react").JSX.Element;
5
- export default LabelFor;
6
- //# sourceMappingURL=LabelFor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LabelFor.d.ts","sourceRoot":"","sources":["../../../../src/Field/Label/LabelFor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEvE,QAAA,MAAM,QAAQ,GAAI,wBAAwB,aAAa,gCAOtD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,6 +0,0 @@
1
- import { FieldLabel as FieldLabelComponent } from '@rocket.chat/fuselage';
2
- import type { ComponentProps } from 'react';
3
- export type ReferencedLabelProps = ComponentProps<typeof FieldLabelComponent>;
4
- declare const ReferencedLabel: ({ children, ...props }: ReferencedLabelProps) => import("react").JSX.Element;
5
- export default ReferencedLabel;
6
- //# sourceMappingURL=ReferencedLabel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferencedLabel.d.ts","sourceRoot":"","sources":["../../../../src/Field/Label/ReferencedLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9E,QAAA,MAAM,eAAe,GAAI,wBAAwB,oBAAoB,gCAQpE,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,5 +0,0 @@
1
- export { default as LabelFor, type LabelForProps } from './LabelFor';
2
- export { default as HiddenLabel, type HiddenLabelProps } from './HiddenLabel';
3
- export { default as ReferencedLabel, type ReferencedLabelProps, } from './ReferencedLabel';
4
- export { default as FieldLabel, type FieldLabelProps } from './FieldLabel';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Field/Label/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -1,9 +0,0 @@
1
- export { default as Field, type FieldProps } from './Field';
2
- export { default as FieldProvider, type FieldProviderProps, } from './FieldProvider';
3
- export { default as FieldDescription, type FieldDescriptionProps, } from './FieldDescription';
4
- export { default as FieldError, type FieldErrorProps } from './FieldError';
5
- export { default as FieldHint, type FieldHintProps } from './FieldHint';
6
- export * from './FieldContext';
7
- export * from './Label';
8
- export { FieldGroup, FieldRow, FieldLink, FieldLabelInfo, } from '@rocket.chat/fuselage';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EACL,OAAO,IAAI,aAAa,EACxB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAExE,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,cAAc,GACf,MAAM,uBAAuB,CAAC"}