@rocket.chat/fuselage-forms 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/Field/Field.d.ts +1 -1
  3. package/dist/cjs/Field/Field.d.ts.map +1 -1
  4. package/dist/cjs/Field/Field.js +5 -31
  5. package/dist/cjs/Field/Field.js.map +1 -1
  6. package/dist/cjs/Field/FieldContext.d.ts +5 -1
  7. package/dist/cjs/Field/FieldContext.d.ts.map +1 -1
  8. package/dist/cjs/Field/FieldContext.js +78 -59
  9. package/dist/cjs/Field/FieldContext.js.map +1 -1
  10. package/dist/cjs/Field/FieldDescription.js +6 -29
  11. package/dist/cjs/Field/FieldDescription.js.map +1 -1
  12. package/dist/cjs/Field/FieldError.js +6 -29
  13. package/dist/cjs/Field/FieldError.js.map +1 -1
  14. package/dist/cjs/Field/FieldHint.js +6 -29
  15. package/dist/cjs/Field/FieldHint.js.map +1 -1
  16. package/dist/cjs/Field/FieldProvider.d.ts +1 -1
  17. package/dist/cjs/Field/FieldProvider.d.ts.map +1 -1
  18. package/dist/cjs/Field/FieldProvider.js +29 -20
  19. package/dist/cjs/Field/FieldProvider.js.map +1 -1
  20. package/dist/cjs/Field/Label/FieldLabel.d.ts +1 -1
  21. package/dist/cjs/Field/Label/FieldLabel.d.ts.map +1 -1
  22. package/dist/cjs/Field/Label/FieldLabel.js +10 -25
  23. package/dist/cjs/Field/Label/FieldLabel.js.map +1 -1
  24. package/dist/cjs/Field/Label/HiddenLabel.js +6 -29
  25. package/dist/cjs/Field/Label/HiddenLabel.js.map +1 -1
  26. package/dist/cjs/Field/Label/LabelFor.js +6 -29
  27. package/dist/cjs/Field/Label/LabelFor.js.map +1 -1
  28. package/dist/cjs/Field/Label/ReferencedLabel.js +6 -29
  29. package/dist/cjs/Field/Label/ReferencedLabel.js.map +1 -1
  30. package/dist/cjs/Field/Label/index.js +4 -7
  31. package/dist/cjs/Field/Label/index.js.map +1 -1
  32. package/dist/cjs/Field/index.js +5 -8
  33. package/dist/cjs/Field/index.js.map +1 -1
  34. package/dist/cjs/Inputs/WrappedInputComponents.d.ts +21 -2234
  35. package/dist/cjs/Inputs/WrappedInputComponents.d.ts.map +1 -1
  36. package/dist/cjs/Inputs/WrappedInputComponents.js +2 -6
  37. package/dist/cjs/Inputs/WrappedInputComponents.js.map +1 -1
  38. package/dist/cjs/Inputs/withLabelHelpers.d.ts.map +1 -1
  39. package/dist/cjs/Inputs/withLabelHelpers.js +15 -29
  40. package/dist/cjs/Inputs/withLabelHelpers.js.map +1 -1
  41. package/dist/esm/Field/Field.d.ts +1 -1
  42. package/dist/esm/Field/Field.d.ts.map +1 -1
  43. package/dist/esm/Field/Field.js +10 -28
  44. package/dist/esm/Field/Field.js.map +1 -1
  45. package/dist/esm/Field/FieldContext.d.ts +5 -1
  46. package/dist/esm/Field/FieldContext.d.ts.map +1 -1
  47. package/dist/esm/Field/FieldContext.js +88 -60
  48. package/dist/esm/Field/FieldContext.js.map +1 -1
  49. package/dist/esm/Field/FieldDescription.js +9 -30
  50. package/dist/esm/Field/FieldDescription.js.map +1 -1
  51. package/dist/esm/Field/FieldError.js +9 -30
  52. package/dist/esm/Field/FieldError.js.map +1 -1
  53. package/dist/esm/Field/FieldHint.js +9 -30
  54. package/dist/esm/Field/FieldHint.js.map +1 -1
  55. package/dist/esm/Field/FieldProvider.d.ts +1 -1
  56. package/dist/esm/Field/FieldProvider.d.ts.map +1 -1
  57. package/dist/esm/Field/FieldProvider.js +33 -22
  58. package/dist/esm/Field/FieldProvider.js.map +1 -1
  59. package/dist/esm/Field/Label/FieldLabel.d.ts +1 -1
  60. package/dist/esm/Field/Label/FieldLabel.d.ts.map +1 -1
  61. package/dist/esm/Field/Label/FieldLabel.js +15 -22
  62. package/dist/esm/Field/Label/FieldLabel.js.map +1 -1
  63. package/dist/esm/Field/Label/HiddenLabel.js +9 -30
  64. package/dist/esm/Field/Label/HiddenLabel.js.map +1 -1
  65. package/dist/esm/Field/Label/LabelFor.js +9 -30
  66. package/dist/esm/Field/Label/LabelFor.js.map +1 -1
  67. package/dist/esm/Field/Label/ReferencedLabel.js +9 -30
  68. package/dist/esm/Field/Label/ReferencedLabel.js.map +1 -1
  69. package/dist/esm/Field/Label/index.js +14 -4
  70. package/dist/esm/Field/Label/index.js.map +1 -1
  71. package/dist/esm/Field/index.js +37 -8
  72. package/dist/esm/Field/index.js.map +1 -1
  73. package/dist/esm/Inputs/WrappedInputComponents.d.ts +21 -2234
  74. package/dist/esm/Inputs/WrappedInputComponents.d.ts.map +1 -1
  75. package/dist/esm/Inputs/WrappedInputComponents.js +17 -18
  76. package/dist/esm/Inputs/WrappedInputComponents.js.map +1 -1
  77. package/dist/esm/Inputs/index.js +17 -1
  78. package/dist/esm/Inputs/index.js.map +1 -1
  79. package/dist/esm/Inputs/withLabelHelpers.d.ts.map +1 -1
  80. package/dist/esm/Inputs/withLabelHelpers.js +20 -30
  81. package/dist/esm/Inputs/withLabelHelpers.js.map +1 -1
  82. package/dist/esm/index.js +18 -2
  83. package/dist/esm/index.js.map +1 -1
  84. package/package.json +21 -19
@@ -1 +1 @@
1
- {"version":3,"file":"WrappedInputComponents.d.ts","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS;;;CAAkC,CAAC;AACzD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAiC,CAAC;AAGvD,eAAO,MAAM,MAAM;;;;;;;;;;CAAsC,CAAC;AAG1D,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":"AAwBA,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;AAG1D,eAAO,MAAM,QAAQ;;;;;;CAA6C,CAAC;AACnE,eAAO,MAAM,YAAY;;;;;CAAiD,CAAC;AAC3E,eAAO,MAAM,WAAW;;;;;CAAgD,CAAC"}
@@ -1,19 +1,18 @@
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, TelephoneInput as TelephoneInputComponent, UrlInput as UrlInputComponent, } from '@rocket.chat/fuselage';
2
- import { withLabelId, withAriaLabelledBy, withVisuallyHiddenLabel, } from './withLabelHelpers';
3
- // TODO: Some inputs are still not supported due to requiring a different a11y approach
4
- // with id
5
- export var TextInput = withLabelId(TextInputComponent);
6
- export var EmailInput = withLabelId(EmailInputComponent);
7
- export var PasswordInput = withLabelId(PasswordInputComponent);
8
- export var SearchInput = withLabelId(SearchInputComponent);
9
- export var TextAreaInput = withLabelId(TextAreaComponent);
10
- export var TelephoneInput = withLabelId(TelephoneInputComponent);
11
- export var NumberInput = withLabelId(NumberInputComponent);
12
- export var UrlInput = withLabelId(UrlInputComponent);
13
- // with aria-labelledby
14
- export var Select = withAriaLabelledBy(SelectComponent);
15
- // with visually hidden label
16
- export var CheckBox = withVisuallyHiddenLabel(CheckBoxComponent);
17
- export var ToggleSwitch = withVisuallyHiddenLabel(ToggleSwitchComponent);
18
- export var RadioButton = withVisuallyHiddenLabel(RadioButtonComponent);
1
+ "use strict";
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;
4
+ const fuselage_1 = require("@rocket.chat/fuselage");
5
+ const withLabelHelpers_1 = require("./withLabelHelpers");
6
+ exports.TextInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextInput);
7
+ exports.EmailInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.EmailInput);
8
+ exports.PasswordInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.PasswordInput);
9
+ exports.SearchInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.SearchInput);
10
+ exports.TextAreaInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TextAreaInput);
11
+ exports.TelephoneInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.TelephoneInput);
12
+ exports.NumberInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.NumberInput);
13
+ exports.UrlInput = (0, withLabelHelpers_1.withLabelId)(fuselage_1.UrlInput);
14
+ exports.Select = (0, withLabelHelpers_1.withAriaLabelledBy)(fuselage_1.Select);
15
+ exports.CheckBox = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.CheckBox);
16
+ exports.ToggleSwitch = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.ToggleSwitch);
17
+ exports.RadioButton = (0, withLabelHelpers_1.withVisuallyHiddenLabel)(fuselage_1.RadioButton);
19
18
  //# sourceMappingURL=WrappedInputComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WrappedInputComponents.js","sourceRoot":"","sources":["../../../src/Inputs/WrappedInputComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,MAAM,IAAI,eAAe,EACzB,QAAQ,IAAI,iBAAiB,EAC7B,YAAY,IAAI,qBAAqB,EACrC,WAAW,IAAI,oBAAoB,EACnC,UAAU,IAAI,mBAAmB,EACjC,aAAa,IAAI,sBAAsB,EACvC,WAAW,IAAI,oBAAoB,EACnC,aAAa,IAAI,iBAAiB,EAClC,WAAW,IAAI,oBAAoB,EACnC,cAAc,IAAI,uBAAuB,EACzC,QAAQ,IAAI,iBAAiB,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,uFAAuF;AAEvF,UAAU;AACV,MAAM,CAAC,IAAM,SAAS,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;AACzD,MAAM,CAAC,IAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAC3D,MAAM,CAAC,IAAM,aAAa,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;AACjE,MAAM,CAAC,IAAM,WAAW,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAM,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G,IAAA,qCAAkB,EAAC,iBAAe,CAAC,CAAC;AAG7C,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,2 +1,18 @@
1
- export * from './WrappedInputComponents';
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);
2
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
@@ -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;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AS,EAAE,yBAAyB,CAAC,MAAM,GAAG,iBAAiB,CAAC;YAEtB,MAAM;;EAejD;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,43 +1,33 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { VisuallyHidden } from 'react-aria';
14
- import { useFieldReferencedByInput, useFieldReferencedByLabel, useFieldWrappedByInputLabel, } from '../Field/FieldContext';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withLabelId = withLabelId;
4
+ exports.withAriaLabelledBy = withAriaLabelledBy;
5
+ exports.withVisuallyHiddenLabel = withVisuallyHiddenLabel;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_aria_1 = require("react-aria");
8
+ const FieldContext_1 = require("../Field/FieldContext");
15
9
  function withLabelId(Component) {
16
- var _a, _b;
17
- var WrappedComponent = function (props) {
18
- var labelProps = useFieldReferencedByInput();
19
- return _jsx(Component, __assign({}, props, labelProps));
10
+ const WrappedComponent = function (props) {
11
+ const labelProps = (0, FieldContext_1.useFieldReferencedByInput)();
12
+ return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
20
13
  };
21
- WrappedComponent.displayName = "withLabelId(".concat((_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent', ")");
14
+ WrappedComponent.displayName = `withLabelId(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
22
15
  return WrappedComponent;
23
16
  }
24
17
  function withAriaLabelledBy(Component) {
25
- var _a, _b;
26
- var WrappedComponent = function (props) {
27
- var labelProps = useFieldReferencedByLabel();
28
- return _jsx(Component, __assign({}, props, labelProps));
18
+ const WrappedComponent = function (props) {
19
+ const labelProps = (0, FieldContext_1.useFieldReferencedByLabel)();
20
+ return (0, jsx_runtime_1.jsx)(Component, { ...props, ...labelProps });
29
21
  };
30
- WrappedComponent.displayName = "withAriaLabelledBy(".concat((_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent', ")");
22
+ WrappedComponent.displayName = `withAriaLabelledBy(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
31
23
  return WrappedComponent;
32
24
  }
33
25
  function withVisuallyHiddenLabel(Component) {
34
- var _a, _b;
35
- var WrappedComponent = function (props) {
36
- var _a = useFieldWrappedByInputLabel(), label = _a[0], labelProps = _a[1];
37
- return (_jsx(Component, __assign({}, props, labelProps, { labelChildren: _jsx(VisuallyHidden, { children: label }) })));
26
+ const WrappedComponent = function (props) {
27
+ 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 }) }));
38
29
  };
39
- WrappedComponent.displayName = "withVisuallyHiddenLabel(".concat((_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : 'InputComponent', ")");
30
+ WrappedComponent.displayName = `withVisuallyHiddenLabel(${Component.displayName ?? Component.name ?? 'InputComponent'})`;
40
31
  return WrappedComponent;
41
32
  }
42
- export { withLabelId, withAriaLabelledBy, withVisuallyHiddenLabel };
43
33
  //# sourceMappingURL=withLabelHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withLabelHelpers.js","sourceRoot":"","sources":["../../../src/Inputs/withLabelHelpers.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;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,2BAAc,cAAE,KAAK,GAAkB,GACvD,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,gBAAgB,CAAC,WAAW,GAAG,2BAA2B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAEzH,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,19 @@
1
- export * from './Inputs';
2
- export * from './Field';
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);
3
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocket.chat/fuselage-forms",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "A set of component wrappers to provide ease of use and accessibility out-of-box.",
5
5
  "homepage": "https://github.com/RocketChat/fuselage#readme",
6
6
  "bugs": {
@@ -37,34 +37,35 @@
37
37
  "devDependencies": {
38
38
  "@rocket.chat/fuselage": "*",
39
39
  "@rocket.chat/fuselage-tokens": "^0.33.2",
40
- "@storybook/addon-docs": "~9.0.9",
41
- "@storybook/addon-webpack5-compiler-swc": "~3.0.0",
42
- "@storybook/react-webpack5": "~9.0.9",
43
- "@storybook/types": "~8.6.14",
44
- "@testing-library/jest-dom": "~6.6.3",
45
- "@testing-library/react": "~16.3.0",
46
- "@types/jest": "~29.5.14",
40
+ "@rocket.chat/storybook-dark-mode": "^4.1.0",
41
+ "@storybook/addon-docs": "~9.1.17",
42
+ "@storybook/addon-webpack5-compiler-swc": "~4.0.2",
43
+ "@storybook/react-webpack5": "~9.1.17",
44
+ "@testing-library/jest-dom": "~6.9.1",
45
+ "@testing-library/react": "~16.3.2",
46
+ "@testing-library/user-event": "~14.6.1",
47
+ "@types/jest": "~30.0.0",
47
48
  "@types/jest-axe": "~3.5.9",
48
- "@types/react": "~18.3.23",
49
+ "@types/react": "~18.3.27",
49
50
  "@types/react-dom": "~18.3.7",
50
- "cross-env": "^7.0.3",
51
- "eslint": "~9.23.0",
52
- "jest": "~29.7.0",
51
+ "cross-env": "^10.1.0",
52
+ "eslint": "~9.39.2",
53
+ "jest": "~30.2.0",
53
54
  "jest-axe": "~10.0.0",
54
- "jest-environment-jsdom": "~30.0.0",
55
+ "jest-environment-jsdom": "~30.2.0",
55
56
  "lint-all": "^0.31.25",
56
- "prettier": "~3.5.3",
57
+ "prettier": "~3.6.2",
57
58
  "react": "~18.3.1",
58
59
  "react-dom": "~18.3.1",
59
60
  "rimraf": "~6.0.1",
60
- "storybook": "~9.0.9",
61
- "storybook-dark-mode": "patch:storybook-dark-mode@npm%3A4.0.2#~/.yarn/patches/storybook-dark-mode-npm-4.0.2-1acb0927fb.patch",
62
- "ts-jest": "~29.4.0",
63
- "typescript": "~5.8.3",
64
- "webpack": "~5.99.9"
61
+ "storybook": "~9.1.17",
62
+ "ts-jest": "~29.4.6",
63
+ "typescript": "~5.9.3",
64
+ "webpack": "~5.102.1"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@rocket.chat/fuselage": "*",
68
+ "@rocket.chat/fuselage-hooks": "^0.39.0",
68
69
  "react": "*",
69
70
  "react-dom": "*"
70
71
  },
@@ -75,6 +76,7 @@
75
76
  "access": "public"
76
77
  },
77
78
  "dependencies": {
79
+ "@rocket.chat/emitter": "^0.32.0",
78
80
  "react-aria": "~3.37.0"
79
81
  }
80
82
  }