@simplybusiness/mobius 3.9.3 → 3.9.4

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 (218) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  3. package/package.json +1 -1
  4. package/src/components/NumberField/NumberField.mdx +17 -0
  5. package/dist/esm/components/Accordion/Accordion.stories.js +0 -45
  6. package/dist/esm/components/Accordion/Accordion.stories.js.map +0 -1
  7. package/dist/esm/components/Accordion/Accordion.test.js +0 -65
  8. package/dist/esm/components/Accordion/Accordion.test.js.map +0 -1
  9. package/dist/esm/components/Alert/Alert.stories.js +0 -32
  10. package/dist/esm/components/Alert/Alert.stories.js.map +0 -1
  11. package/dist/esm/components/Alert/Alert.test.js +0 -48
  12. package/dist/esm/components/Alert/Alert.test.js.map +0 -1
  13. package/dist/esm/components/Box/Box.stories.js +0 -20
  14. package/dist/esm/components/Box/Box.stories.js.map +0 -1
  15. package/dist/esm/components/Box/Box.test.js +0 -31
  16. package/dist/esm/components/Box/Box.test.js.map +0 -1
  17. package/dist/esm/components/Breadcrumbs/Breadcrumbs.stories.js +0 -17
  18. package/dist/esm/components/Breadcrumbs/Breadcrumbs.stories.js.map +0 -1
  19. package/dist/esm/components/Breadcrumbs/Breadcrumbs.test.js +0 -33
  20. package/dist/esm/components/Breadcrumbs/Breadcrumbs.test.js.map +0 -1
  21. package/dist/esm/components/Button/Button.stories.js +0 -213
  22. package/dist/esm/components/Button/Button.stories.js.map +0 -1
  23. package/dist/esm/components/Button/Button.test.js +0 -81
  24. package/dist/esm/components/Button/Button.test.js.map +0 -1
  25. package/dist/esm/components/Checkbox/Checkbox.stories.js +0 -98
  26. package/dist/esm/components/Checkbox/Checkbox.stories.js.map +0 -1
  27. package/dist/esm/components/Checkbox/Checkbox.test.js +0 -108
  28. package/dist/esm/components/Checkbox/Checkbox.test.js.map +0 -1
  29. package/dist/esm/components/Checkbox/CheckboxGroup.stories.js +0 -71
  30. package/dist/esm/components/Checkbox/CheckboxGroup.stories.js.map +0 -1
  31. package/dist/esm/components/Checkbox/CheckboxGroup.test.js +0 -44
  32. package/dist/esm/components/Checkbox/CheckboxGroup.test.js.map +0 -1
  33. package/dist/esm/components/Chopin/Actions/Actions.stories.js +0 -56
  34. package/dist/esm/components/Chopin/Actions/Actions.stories.js.map +0 -1
  35. package/dist/esm/components/Chopin/Actions/Actions.test.js +0 -95
  36. package/dist/esm/components/Chopin/Actions/Actions.test.js.map +0 -1
  37. package/dist/esm/components/Chopin/Actions/LinkOrButton.test.js +0 -33
  38. package/dist/esm/components/Chopin/Actions/LinkOrButton.test.js.map +0 -1
  39. package/dist/esm/components/Chopin/Footer/Footer.stories.js +0 -166
  40. package/dist/esm/components/Chopin/Footer/Footer.stories.js.map +0 -1
  41. package/dist/esm/components/Chopin/Footer/Footer.test.js +0 -90
  42. package/dist/esm/components/Chopin/Footer/Footer.test.js.map +0 -1
  43. package/dist/esm/components/Chopin/Header/Header.stories.js +0 -38
  44. package/dist/esm/components/Chopin/Header/Header.stories.js.map +0 -1
  45. package/dist/esm/components/Chopin/Header/Header.test.js +0 -86
  46. package/dist/esm/components/Chopin/Header/Header.test.js.map +0 -1
  47. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.stories.js +0 -43
  48. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.stories.js.map +0 -1
  49. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.test.js +0 -108
  50. package/dist/esm/components/Chopin/PercentageTotalsQuestion/PercentageTotalsQuestion.test.js.map +0 -1
  51. package/dist/esm/components/Chopin/Question/Question.stories.js +0 -136
  52. package/dist/esm/components/Chopin/Question/Question.stories.js.map +0 -1
  53. package/dist/esm/components/Chopin/Question/Question.test.js +0 -116
  54. package/dist/esm/components/Chopin/Question/Question.test.js.map +0 -1
  55. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.stories.js +0 -40
  56. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.stories.js.map +0 -1
  57. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.test.js +0 -62
  58. package/dist/esm/components/Chopin/QuestionGroup/QuestionGroup.test.js.map +0 -1
  59. package/dist/esm/components/Chopin/QuestionHelp/QuestionHelp.test.js +0 -41
  60. package/dist/esm/components/Chopin/QuestionHelp/QuestionHelp.test.js.map +0 -1
  61. package/dist/esm/components/Chopin/Section/Section.stories.js +0 -16
  62. package/dist/esm/components/Chopin/Section/Section.stories.js.map +0 -1
  63. package/dist/esm/components/Chopin/Section/Section.test.js +0 -35
  64. package/dist/esm/components/Chopin/Section/Section.test.js.map +0 -1
  65. package/dist/esm/components/Chopin/Steps/Steps.stories.js +0 -12
  66. package/dist/esm/components/Chopin/Steps/Steps.stories.js.map +0 -1
  67. package/dist/esm/components/Chopin/Steps/Steps.test.js +0 -93
  68. package/dist/esm/components/Chopin/Steps/Steps.test.js.map +0 -1
  69. package/dist/esm/components/Chopin/Testimonial/Testimonial.stories.js +0 -15
  70. package/dist/esm/components/Chopin/Testimonial/Testimonial.stories.js.map +0 -1
  71. package/dist/esm/components/Chopin/Testimonial/Testimonial.test.js +0 -35
  72. package/dist/esm/components/Chopin/Testimonial/Testimonial.test.js.map +0 -1
  73. package/dist/esm/components/Chopin/TradeSelector/Listing/Listing.test.js +0 -26
  74. package/dist/esm/components/Chopin/TradeSelector/Listing/Listing.test.js.map +0 -1
  75. package/dist/esm/components/Chopin/TradeSelector/Listing/ListingItem.test.js +0 -37
  76. package/dist/esm/components/Chopin/TradeSelector/Listing/ListingItem.test.js.map +0 -1
  77. package/dist/esm/components/Chopin/TradeSelector/SearchResults/SearchResults.test.js +0 -86
  78. package/dist/esm/components/Chopin/TradeSelector/SearchResults/SearchResults.test.js.map +0 -1
  79. package/dist/esm/components/Chopin/TradeSelector/TradeInput/TradeInput.test.js +0 -52
  80. package/dist/esm/components/Chopin/TradeSelector/TradeInput/TradeInput.test.js.map +0 -1
  81. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.stories.js +0 -52
  82. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.stories.js.map +0 -1
  83. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.test.js +0 -226
  84. package/dist/esm/components/Chopin/TradeSelector/TradeSelector.test.js.map +0 -1
  85. package/dist/esm/components/Container/Container.stories.js +0 -12
  86. package/dist/esm/components/Container/Container.stories.js.map +0 -1
  87. package/dist/esm/components/Container/Container.test.js +0 -37
  88. package/dist/esm/components/Container/Container.test.js.map +0 -1
  89. package/dist/esm/components/DataTable/DataTable.stories.js +0 -174
  90. package/dist/esm/components/DataTable/DataTable.stories.js.map +0 -1
  91. package/dist/esm/components/DataTable/DataTable.test.js +0 -119
  92. package/dist/esm/components/DataTable/DataTable.test.js.map +0 -1
  93. package/dist/esm/components/DatePicker/DatePicker.stories.js +0 -25
  94. package/dist/esm/components/DatePicker/DatePicker.stories.js.map +0 -1
  95. package/dist/esm/components/Divider/Divider.stories.js +0 -12
  96. package/dist/esm/components/Divider/Divider.stories.js.map +0 -1
  97. package/dist/esm/components/DropdownMenu/DropdownMenu.stories.js +0 -58
  98. package/dist/esm/components/DropdownMenu/DropdownMenu.stories.js.map +0 -1
  99. package/dist/esm/components/DropdownMenu/DropdownMenu.test.js +0 -95
  100. package/dist/esm/components/DropdownMenu/DropdownMenu.test.js.map +0 -1
  101. package/dist/esm/components/ErrorMessage/ErrorMessage.stories.js +0 -21
  102. package/dist/esm/components/ErrorMessage/ErrorMessage.stories.js.map +0 -1
  103. package/dist/esm/components/ErrorMessage/ErrorMessage.test.js +0 -30
  104. package/dist/esm/components/ErrorMessage/ErrorMessage.test.js.map +0 -1
  105. package/dist/esm/components/Fieldset/Fieldset.stories.js +0 -22
  106. package/dist/esm/components/Fieldset/Fieldset.stories.js.map +0 -1
  107. package/dist/esm/components/Fieldset/Fieldset.test.js +0 -10
  108. package/dist/esm/components/Fieldset/Fieldset.test.js.map +0 -1
  109. package/dist/esm/components/Flex/Flex.stories.js +0 -148
  110. package/dist/esm/components/Flex/Flex.stories.js.map +0 -1
  111. package/dist/esm/components/Flex/Flex.test.js +0 -31
  112. package/dist/esm/components/Flex/Flex.test.js.map +0 -1
  113. package/dist/esm/components/Grid/Grid.stories.js +0 -227
  114. package/dist/esm/components/Grid/Grid.stories.js.map +0 -1
  115. package/dist/esm/components/Grid/Grid.test.js +0 -95
  116. package/dist/esm/components/Grid/Grid.test.js.map +0 -1
  117. package/dist/esm/components/Icon/Icon.stories.js +0 -43
  118. package/dist/esm/components/Icon/Icon.stories.js.map +0 -1
  119. package/dist/esm/components/Icon/Icon.test.js +0 -52
  120. package/dist/esm/components/Icon/Icon.test.js.map +0 -1
  121. package/dist/esm/components/Image/Image.stories.js +0 -17
  122. package/dist/esm/components/Image/Image.stories.js.map +0 -1
  123. package/dist/esm/components/Image/Image.test.js +0 -37
  124. package/dist/esm/components/Image/Image.test.js.map +0 -1
  125. package/dist/esm/components/Label/Label.stories.js +0 -15
  126. package/dist/esm/components/Label/Label.stories.js.map +0 -1
  127. package/dist/esm/components/Label/Label.test.js +0 -35
  128. package/dist/esm/components/Label/Label.test.js.map +0 -1
  129. package/dist/esm/components/Link/Link.stories.js +0 -41
  130. package/dist/esm/components/Link/Link.stories.js.map +0 -1
  131. package/dist/esm/components/Link/Link.test.js +0 -65
  132. package/dist/esm/components/Link/Link.test.js.map +0 -1
  133. package/dist/esm/components/LinkButton/LinkButton.stories.js +0 -42
  134. package/dist/esm/components/LinkButton/LinkButton.stories.js.map +0 -1
  135. package/dist/esm/components/LinkButton/LinkButton.test.js +0 -62
  136. package/dist/esm/components/LinkButton/LinkButton.test.js.map +0 -1
  137. package/dist/esm/components/List/List.stories.js +0 -77
  138. package/dist/esm/components/List/List.stories.js.map +0 -1
  139. package/dist/esm/components/List/List.test.js +0 -93
  140. package/dist/esm/components/List/List.test.js.map +0 -1
  141. package/dist/esm/components/LoadingIndicator/LoadingIndicator.stories.js +0 -50
  142. package/dist/esm/components/LoadingIndicator/LoadingIndicator.stories.js.map +0 -1
  143. package/dist/esm/components/LoadingIndicator/LoadingIndicator.test.js +0 -27
  144. package/dist/esm/components/LoadingIndicator/LoadingIndicator.test.js.map +0 -1
  145. package/dist/esm/components/MaskedField/MaskedField.stories.js +0 -22
  146. package/dist/esm/components/MaskedField/MaskedField.stories.js.map +0 -1
  147. package/dist/esm/components/MaskedField/MaskedField.test.js +0 -64
  148. package/dist/esm/components/MaskedField/MaskedField.test.js.map +0 -1
  149. package/dist/esm/components/Modal/Modal.stories.js +0 -79
  150. package/dist/esm/components/Modal/Modal.stories.js.map +0 -1
  151. package/dist/esm/components/Modal/Modal.test.js +0 -135
  152. package/dist/esm/components/Modal/Modal.test.js.map +0 -1
  153. package/dist/esm/components/NumberField/NumberField.stories.js +0 -103
  154. package/dist/esm/components/NumberField/NumberField.stories.js.map +0 -1
  155. package/dist/esm/components/NumberField/NumberField.test.js +0 -81
  156. package/dist/esm/components/NumberField/NumberField.test.js.map +0 -1
  157. package/dist/esm/components/PasswordField/PasswordField.stories.js +0 -31
  158. package/dist/esm/components/PasswordField/PasswordField.stories.js.map +0 -1
  159. package/dist/esm/components/PasswordField/PasswordField.test.js +0 -29
  160. package/dist/esm/components/PasswordField/PasswordField.test.js.map +0 -1
  161. package/dist/esm/components/Progress/Progress.stories.js +0 -89
  162. package/dist/esm/components/Progress/Progress.stories.js.map +0 -1
  163. package/dist/esm/components/Progress/Progress.test.js +0 -32
  164. package/dist/esm/components/Progress/Progress.test.js.map +0 -1
  165. package/dist/esm/components/Radio/Radio.stories.js +0 -118
  166. package/dist/esm/components/Radio/Radio.stories.js.map +0 -1
  167. package/dist/esm/components/Radio/Radio.test.js +0 -139
  168. package/dist/esm/components/Radio/Radio.test.js.map +0 -1
  169. package/dist/esm/components/Radio/RadioButton.stories.js +0 -88
  170. package/dist/esm/components/Radio/RadioButton.stories.js.map +0 -1
  171. package/dist/esm/components/Radio/RadioButton.test.js +0 -118
  172. package/dist/esm/components/Radio/RadioButton.test.js.map +0 -1
  173. package/dist/esm/components/SVG/SVG.stories.js +0 -19
  174. package/dist/esm/components/SVG/SVG.stories.js.map +0 -1
  175. package/dist/esm/components/SVG/SVG.test.js +0 -26
  176. package/dist/esm/components/SVG/SVG.test.js.map +0 -1
  177. package/dist/esm/components/Segment/Segment.stories.js +0 -112
  178. package/dist/esm/components/Segment/Segment.stories.js.map +0 -1
  179. package/dist/esm/components/Select/Select.stories.js +0 -79
  180. package/dist/esm/components/Select/Select.stories.js.map +0 -1
  181. package/dist/esm/components/Select/Select.test.js +0 -94
  182. package/dist/esm/components/Select/Select.test.js.map +0 -1
  183. package/dist/esm/components/Slider/Slider.stories.js +0 -63
  184. package/dist/esm/components/Slider/Slider.stories.js.map +0 -1
  185. package/dist/esm/components/Slider/Slider.test.js +0 -58
  186. package/dist/esm/components/Slider/Slider.test.js.map +0 -1
  187. package/dist/esm/components/Table/Table.stories.js +0 -15
  188. package/dist/esm/components/Table/Table.stories.js.map +0 -1
  189. package/dist/esm/components/Table/Table.test.js +0 -73
  190. package/dist/esm/components/Table/Table.test.js.map +0 -1
  191. package/dist/esm/components/Text/Text.stories.js +0 -31
  192. package/dist/esm/components/Text/Text.stories.js.map +0 -1
  193. package/dist/esm/components/Text/Text.test.js +0 -31
  194. package/dist/esm/components/Text/Text.test.js.map +0 -1
  195. package/dist/esm/components/TextArea/TextArea.stories.js +0 -80
  196. package/dist/esm/components/TextArea/TextArea.stories.js.map +0 -1
  197. package/dist/esm/components/TextArea/TextArea.test.js +0 -84
  198. package/dist/esm/components/TextArea/TextArea.test.js.map +0 -1
  199. package/dist/esm/components/TextAreaInput/TextAreaInput.test.js +0 -42
  200. package/dist/esm/components/TextAreaInput/TextAreaInput.test.js.map +0 -1
  201. package/dist/esm/components/TextField/TextField.stories.js +0 -103
  202. package/dist/esm/components/TextField/TextField.stories.js.map +0 -1
  203. package/dist/esm/components/TextField/TextField.test.js +0 -123
  204. package/dist/esm/components/TextField/TextField.test.js.map +0 -1
  205. package/dist/esm/components/Title/Title.stories.js +0 -16
  206. package/dist/esm/components/Title/Title.stories.js.map +0 -1
  207. package/dist/esm/components/Title/Title.test.js +0 -20
  208. package/dist/esm/components/Title/Title.test.js.map +0 -1
  209. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +0 -12
  210. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js.map +0 -1
  211. package/dist/esm/contexts/ThemeContext/ThemeContext.test.js +0 -10
  212. package/dist/esm/contexts/ThemeContext/ThemeContext.test.js.map +0 -1
  213. package/dist/esm/hooks/useBreakpoint/useBreakpoint.stories.js +0 -40
  214. package/dist/esm/hooks/useBreakpoint/useBreakpoint.stories.js.map +0 -1
  215. package/dist/esm/hooks/useBreakpoint/useBreakpoint.test.js +0 -242
  216. package/dist/esm/hooks/useBreakpoint/useBreakpoint.test.js.map +0 -1
  217. package/dist/esm/hooks/useButton/useButton.test.js +0 -141
  218. package/dist/esm/hooks/useButton/useButton.test.js.map +0 -1
@@ -1,65 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import userEvent from "@testing-library/user-event";
4
- import { Link } from ".";
5
- const CLASS_NAME = "mobius/Link";
6
- describe("Test for Link", () => {
7
- it("should render without errors", () => {
8
- render(_jsx(Link, Object.assign({ href: "#test" }, { children: "Test" })));
9
- });
10
- it("should call the onClick", async () => {
11
- const onClick = jest.fn();
12
- const { getByText } = render(_jsx(Link, Object.assign({ href: "#test", onClick: onClick }, { children: "Click" })));
13
- await userEvent.click(getByText("Click"));
14
- expect(onClick).toHaveBeenCalled();
15
- });
16
- it("uses the elementType prop", () => {
17
- function CustomComponent(props) {
18
- // eslint-disable-next-line jsx-a11y/anchor-has-content
19
- return _jsx("a", Object.assign({ "data-testid": "custom-component" }, props));
20
- }
21
- render(
22
- // eslint-disable-next-line react/jsx-no-bind
23
- _jsx(Link, Object.assign({ href: "#test", elementType: CustomComponent }, { children: "Test" })));
24
- expect(screen.getByTestId("custom-component")).toBeInTheDocument();
25
- });
26
- describe("given elementType", () => {
27
- it("is not applied as element attribute", () => {
28
- const { container } = render(_jsx(Link, Object.assign({ href: "#test", elementType: "ul" }, { children: "Test" })));
29
- expect(container.firstChild).not.toHaveAttribute("elementtype", "ul");
30
- });
31
- });
32
- describe("uses correct class names", () => {
33
- it("uses Mobius class", () => {
34
- render(_jsx(Link, Object.assign({ href: "#test", "data-testid": "test" }, { children: "Sample text" })));
35
- expect(screen.getByTestId("test")).toHaveClass("mobius");
36
- });
37
- it("uses base Mobius class", () => {
38
- render(_jsx(Link, Object.assign({ href: "#test", "data-testid": "test" }, { children: "Sample text" })));
39
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
40
- });
41
- it("includes custom class name", () => {
42
- render(_jsx(Link, Object.assign({ href: "#test", className: "my-class", "data-testid": "test" }, { children: "Sample Text" })));
43
- expect(screen.getByTestId("test")).toHaveClass("my-class");
44
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
45
- });
46
- it("includes the focus-visible class name", async () => {
47
- render(_jsx(Link, Object.assign({ href: "#test", "data-testid": "test" }, { children: "Sample text" })));
48
- await userEvent.tab();
49
- expect(screen.getByTestId("test")).toHaveClass("--is-focus-visible");
50
- });
51
- it("includes the disabled class name", async () => {
52
- render(_jsx(Link, Object.assign({ href: "#test", "data-testid": "test", isDisabled: true }, { children: "Sample text" })));
53
- await userEvent.tab();
54
- expect(screen.getByTestId("test")).toHaveClass("--is-disabled");
55
- });
56
- });
57
- describe("given the the link has disabled prop", () => {
58
- it("does not pass the prop as an attribute", async () => {
59
- render(_jsx(Link, Object.assign({ href: "#test", "data-testid": "test", isDisabled: true }, { children: "Sample text" })));
60
- await userEvent.tab();
61
- expect(screen.getByTestId("test")).not.toHaveAttribute("disabled", "");
62
- });
63
- });
64
- });
65
- //# sourceMappingURL=Link.test.js.map
@@ -1 +0,0 @@
1
- {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AC,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,CACJ,KAAC,IAAI,kBAAC,IAAI,EAAC,OAAO,iBAAa,MAAM,iCAE9B,CACR,CAAC;YACF,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YAChD,MAAM,CACJ,KAAC,IAAI,kBAAC,IAAI,EAAC,OAAO,iBAAa,MAAM,EAAC,UAAU,uCAEzC,CACR,CAAC;YACF,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;QACpD,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;YACtD,MAAM,CACJ,KAAC,IAAI,kBAAC,IAAI,EAAC,OAAO,iBAAa,MAAM,EAAC,UAAU,uCAEzC,CACR,CAAC;YACF,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { LinkButton } from "./LinkButton";
3
- import { excludeControls } from "../../utils/excludeControls";
4
- export default {
5
- title: "Components/LinkButton",
6
- component: LinkButton,
7
- argTypes: Object.assign({ target: {
8
- options: ["_self", "_blank", "_parent", "_top"],
9
- control: { type: "select" },
10
- }, to: {
11
- control: { type: "text" },
12
- }, title: {
13
- control: { type: "text" },
14
- }, download: {
15
- control: { type: "boolean" },
16
- }, rel: {
17
- options: ["noopener noreferrer", "canonical", "nofollow"],
18
- control: { type: "select" },
19
- }, icon: {
20
- options: ["menu", "rightArrow", "leftArrow", "dropdown", "home"],
21
- control: { type: "radio" },
22
- }, iconPosition: {
23
- if: {
24
- arg: "icon",
25
- },
26
- } }, excludeControls("children", "className", "elementType", "style", "onClick", "onPress")),
27
- };
28
- export const Normal = {
29
- render: (args) => (_jsx(LinkButton, Object.assign({}, args, { children: "LinkButton text" }))),
30
- args: {
31
- href: "https://www.google.com",
32
- to: "",
33
- title: "",
34
- size: "medium",
35
- download: false,
36
- isDisabled: false,
37
- isSuccess: false,
38
- isLoading: false,
39
- role: "",
40
- },
41
- };
42
- //# sourceMappingURL=LinkButton.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../../../src/components/LinkButton/LinkButton.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,QAAQ,kBACN,MAAM,EAAE;YACN,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;YAC/C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B,EACD,EAAE,EAAE;YACF,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SAC1B,EACD,KAAK,EAAE;YACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SAC1B,EACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC7B,EACD,GAAG,EAAE;YACH,OAAO,EAAE,CAAC,qBAAqB,EAAE,WAAW,EAAE,UAAU,CAAC;YACzD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B,EACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC;YAChE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B,EACD,YAAY,EAAE;YACZ,EAAE,EAAE;gBACF,GAAG,EAAE,MAAM;aACZ;SACF,IACE,eAAe,CAChB,UAAU,EACV,WAAW,EACX,aAAa,EACb,OAAO,EACP,SAAS,EACT,SAAS,CACV,CACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA4B;IAC7C,MAAM,EAAE,CAAC,IAAqB,EAAE,EAAE,CAAC,CACjC,KAAC,UAAU,oBAAK,IAAI,mCAA8B,CACnD;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,EAAE;QACN,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,EAAE;KACT;CACF,CAAC"}
@@ -1,62 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Component } from "react";
3
- import { render, screen } from "@testing-library/react";
4
- import userEvent from "@testing-library/user-event";
5
- import { LinkButton } from ".";
6
- class ErrorBoundary extends Component {
7
- constructor(props) {
8
- super(props);
9
- this.state = {
10
- hasError: false,
11
- error: null,
12
- };
13
- }
14
- static getDerivedStateFromError(error) {
15
- return { hasError: true, error };
16
- }
17
- render() {
18
- const { hasError, error } = this.state;
19
- const { children } = this.props;
20
- if (hasError && error) {
21
- // You can render any custom fallback UI
22
- return _jsx("div", Object.assign({ "data-testid": "error" }, { children: error.message }));
23
- }
24
- return children;
25
- }
26
- }
27
- describe("Test for LinkButton", () => {
28
- it("renders without error", () => {
29
- const component = render(_jsx(LinkButton, Object.assign({ href: "http://www.example.com/" }, { children: "Link" })));
30
- expect(component).toBeTruthy();
31
- });
32
- it("should call the onClick", async () => {
33
- const onClick = jest.fn();
34
- const { getByText } = render(_jsx(LinkButton, Object.assign({ href: "#", onClick: onClick }, { children: "Link" })));
35
- await userEvent.click(getByText("Link"));
36
- expect(onClick).toHaveBeenCalled();
37
- });
38
- it("throws when href is missing", () => {
39
- const spy = jest.spyOn(console, "error");
40
- spy.mockImplementation(() => { });
41
- render(_jsx(ErrorBoundary, { children: _jsx(LinkButton, { children: "Link" }) }));
42
- expect(screen.getByTestId("error")).toHaveTextContent("LinkButton requires a href prop");
43
- spy.mockRestore();
44
- });
45
- it("uses the elementType prop", () => {
46
- function CustomComponent(props) {
47
- // eslint-disable-next-line jsx-a11y/anchor-has-content
48
- return _jsx("a", Object.assign({ "data-testid": "custom-component" }, props));
49
- }
50
- render(
51
- // eslint-disable-next-line react/jsx-no-bind
52
- _jsx(LinkButton, Object.assign({ href: "#test", elementType: CustomComponent }, { children: "Test" })));
53
- expect(screen.getByTestId("custom-component")).toBeInTheDocument();
54
- });
55
- describe("given elementType", () => {
56
- it("is not applied as element attribute", () => {
57
- const { container } = render(_jsx(LinkButton, Object.assign({ href: "#test", elementType: "ul" }, { children: "Test" })));
58
- expect(container.firstChild).not.toHaveAttribute("elementtype", "ul");
59
- });
60
- });
61
- });
62
- //# sourceMappingURL=LinkButton.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkButton.test.js","sourceRoot":"","sources":["../../../../src/components/LinkButton/LinkButton.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM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Aa,EAAE,IAAI,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,77 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Icon, Text } from "../index";
3
- import { List, ListItem } from ".";
4
- import { excludeControls } from "../../utils/excludeControls";
5
- export default {
6
- title: "Components/List",
7
- component: List,
8
- argTypes: Object.assign({ liststyletype: {
9
- control: { type: "radio" },
10
- if: {
11
- arg: "isOrdered",
12
- truthy: false,
13
- },
14
- }, isReversed: {
15
- if: {
16
- arg: "isOrdered",
17
- },
18
- }, start: {
19
- if: {
20
- arg: "isOrdered",
21
- },
22
- } }, excludeControls("className", "icon")),
23
- };
24
- export const Unordered = {
25
- render: (args) => (_jsxs(List, Object.assign({}, args, { children: [_jsx(ListItem, { children: "Foo" }), _jsx(ListItem, { children: "Bar" }), _jsx(ListItem, { children: "Baz" })] }))),
26
- args: {
27
- isOrdered: false,
28
- isReversed: false,
29
- liststyletype: "disc",
30
- },
31
- };
32
- export const Ordered = {
33
- render: (args) => (_jsxs(List, Object.assign({}, args, { children: [_jsx(ListItem, { children: "Foo" }), _jsx(ListItem, { children: "Bar" }), _jsx(ListItem, { children: "Baz" })] }))),
34
- args: {
35
- isOrdered: true,
36
- isReversed: false,
37
- start: 1,
38
- },
39
- };
40
- export const StartingFromASpecificNumber = {
41
- render: (args) => (_jsxs(List, Object.assign({}, args, { children: [_jsx(ListItem, { children: "Foo" }), _jsx(ListItem, { children: "Bar" }), _jsx(ListItem, { children: "Baz" })] }))),
42
- args: {
43
- isOrdered: true,
44
- start: 12,
45
- isReversed: false,
46
- },
47
- parameters: {
48
- controls: {
49
- exclude: ["liststyletype"],
50
- },
51
- },
52
- };
53
- export const Reversed = {
54
- render: (args) => (_jsxs(List, Object.assign({}, args, { children: [_jsx(ListItem, { children: "Foo" }), _jsx(ListItem, { children: "Bar" }), _jsx(ListItem, { children: "Baz" })] }))),
55
- args: {
56
- isOrdered: true,
57
- isReversed: true,
58
- start: 3,
59
- },
60
- parameters: {
61
- controls: {
62
- exclude: ["liststyletype"],
63
- },
64
- },
65
- };
66
- export const WithCustomIcons = {
67
- render: (args) => (_jsxs(List, Object.assign({}, args, { children: [_jsx(ListItem, { children: _jsx(Text, Object.assign({ variant: "body", spacing: "tight" }, { children: "Morbi eget sapien nulla. Mauris sodales est vel ullamcorper efficitur. Nam lobortis metus et ultricies imperdiet. Phasellus at sapien pharetra, commodo lorem eu, malesuada dui. Curabitur vulputate massa nec massa blandit, auctor elementum dolor ultricies." })) }), _jsx(ListItem, Object.assign({ icon: _jsx(Icon, { name: "cross", color: "red" }) }, { children: "Etiam feugiat neque vel nulla semper ultrices. Phasellus lobortis nisl id mollis malesuada. Suspendisse ut porttitor purus. Praesent ornare felis a mattis pharetra. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec venenatis tristique condimentum." })), _jsx(ListItem, { children: "Nunc at turpis iaculis, finibus tellus eget, tempus mi. Vestibulum eget egestas mauris, non porttitor nisl. Nam a facilisis sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse sit amet neque tempor, vestibulum eros ut, vulputate quam." })] }))),
68
- args: {
69
- icon: _jsx(Icon, { name: "tick", color: "green" }),
70
- },
71
- parameters: {
72
- controls: {
73
- exclude: ["isOrdered", "liststyletype"],
74
- },
75
- },
76
- };
77
- //# sourceMappingURL=List.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.stories.js","sourceRoot":"","sources":["../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAa,MAAM,GAAG,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,E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E,IAAI;QACf,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,KAAK;KAClB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,CAAC;SAC3B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAsB;IACzC,MAAM,EAAE,CAAC,IAAe,EAAE,EAAE,CAAC,CAC3B,MAAC,IAAI,oBAAK,IAAI,eACZ,KAAC,QAAQ,sBAAe,EACxB,KAAC,QAAQ,sBAAe,EACxB,KAAC,QAAQ,sBAAe,KACnB,CACR;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,CAAC;KACT;IACD,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,CAAC;SAC3B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,MAAM,EAAE,CAAC,IAAe,EAAE,EAAE,CAAC,CAC3B,MAAC,IAAI,oBAAK,IAAI,eACZ,KAAC,QAAQ,cACP,KAAC,IAAI,kBAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAC,OAAO,qRAK7B,GACE,EACX,KAAC,QAAQ,kBAAC,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,KAAK,GAAG,+TAMtC,EACX,KAAC,QAAQ,wRAKE,KACN,CACR;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,GAAG;KACzC;IACD,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC;SACxC;KACF;CACF,CAAC"}
@@ -1,93 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { render, screen } from "@testing-library/react";
3
- import { List, ListItem } from ".";
4
- const LIST_CLASS_NAME = "mobius/List";
5
- const ITEM_CLASS_NAME = "mobius/ListItem";
6
- const ICON_CLASS_NAME = "--has-icon";
7
- const ITEM_CONTENT_CLASSNAME = "mobius/ListItemContent";
8
- const LIST_ICON_CLASS_NAME = "mobius/ListIcon";
9
- describe("List", () => {
10
- it("should render without errors", () => {
11
- render(_jsx(List, { children: "Sample text" }));
12
- });
13
- it("renders an unordered list of items", () => {
14
- render(_jsxs(List, Object.assign({ "data-testid": "test" }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
15
- const list = screen.getByTestId("test").closest("ul");
16
- expect(list).toBeTruthy();
17
- expect(list === null || list === void 0 ? void 0 : list.childNodes.length).toEqual(2);
18
- });
19
- it("renders an ordered list of items", () => {
20
- render(_jsxs(List, Object.assign({ isOrdered: true, "data-testid": "test" }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
21
- const unorderedList = screen.getByTestId("test").closest("ul");
22
- const orderedList = screen.getByTestId("test").closest("ol");
23
- expect(unorderedList).not.toBeTruthy();
24
- expect(orderedList).toBeTruthy();
25
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes.length).toEqual(2);
26
- });
27
- it("renders a reversed list of items", () => {
28
- render(_jsxs(List, Object.assign({ isOrdered: true, isReversed: true }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
29
- const list = screen.getByRole("list");
30
- expect(list).toHaveAttribute("reversed", "");
31
- });
32
- it("renders list style", () => {
33
- render(_jsxs(List, Object.assign({ isOrdered: true, liststyletype: "disc", "data-testid": "test" }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
34
- expect(screen.getByTestId("test").closest("ol")).not.toHaveAttribute("liststyletype", "disc");
35
- });
36
- describe("given the liststyletype prop is set", () => {
37
- it.each([
38
- "disc",
39
- "circle",
40
- "square",
41
- "decimal",
42
- "georgian",
43
- "trad-chinese-informal",
44
- "kannada",
45
- ])("it should render with --is-%s class name", liststyletype => {
46
- const { container } = render(_jsxs(List, Object.assign({ isOrdered: true, liststyletype: liststyletype }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
47
- expect(container.firstChild).toHaveClass(`--is-${liststyletype}`);
48
- });
49
- });
50
- it("renders list with custom icons", () => {
51
- render(_jsxs(List, Object.assign({ icon: "\u2705" }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" }), _jsx(ListItem, Object.assign({ icon: "\u26A0\uFE0F" }, { children: "Three" })), _jsx(ListItem, { children: "Four" }), _jsx(ListItem, Object.assign({ icon: "\u274C" }, { children: "Five" })), _jsx(ListItem, { children: "Six" })] })));
52
- expect(screen.queryAllByText("✅")).toHaveLength(4);
53
- expect(screen.queryAllByText("⚠️")).toHaveLength(1);
54
- expect(screen.queryAllByText("❌")).toHaveLength(1);
55
- });
56
- describe("uses correct class names", () => {
57
- it("uses Mobius class", () => {
58
- render(_jsx(List, Object.assign({ "data-testid": "test" }, { children: "Sample text" })));
59
- expect(screen.getByTestId("test")).toHaveClass("mobius");
60
- });
61
- it("uses base Mobius class", () => {
62
- render(_jsx(List, Object.assign({ "data-testid": "test" }, { children: "Sample text" })));
63
- expect(screen.getByTestId("test")).toHaveClass(LIST_CLASS_NAME);
64
- });
65
- it("includes custom class name", () => {
66
- render(_jsx(List, Object.assign({ className: "my-class", "data-testid": "test" }, { children: "Sample Text" })));
67
- expect(screen.getByTestId("test")).toHaveClass("my-class");
68
- expect(screen.getByTestId("test")).toHaveClass(LIST_CLASS_NAME);
69
- });
70
- it("uses base Mobius class for list items", () => {
71
- render(_jsxs(List, Object.assign({ isOrdered: true, "data-testid": "test" }, { children: [_jsx(ListItem, { children: "One" }), _jsx(ListItem, { children: "Two" })] })));
72
- const orderedList = screen.getByTestId("test").closest("ol");
73
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[0]).toHaveClass(ITEM_CLASS_NAME);
74
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[1]).toHaveClass(ITEM_CLASS_NAME);
75
- });
76
- it("includes custom class names for list items", () => {
77
- render(_jsxs(List, Object.assign({ isOrdered: true, "data-testid": "test" }, { children: [_jsx(ListItem, Object.assign({ className: "item-1" }, { children: "One" })), _jsx(ListItem, Object.assign({ className: "item-2" }, { children: "Two" }))] })));
78
- const orderedList = screen.getByTestId("test").closest("ol");
79
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[0]).toHaveClass(ITEM_CLASS_NAME);
80
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[0]).toHaveClass("item-1");
81
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[1]).toHaveClass(ITEM_CLASS_NAME);
82
- expect(orderedList === null || orderedList === void 0 ? void 0 : orderedList.childNodes[1]).toHaveClass("item-2");
83
- });
84
- it("includes custom class name when icon prop is provided", () => {
85
- render(_jsx(List, Object.assign({ icon: "\u2705" }, { children: _jsx(ListItem, { children: "One" }) })));
86
- expect(screen.getByRole("list")).toHaveClass(ICON_CLASS_NAME);
87
- expect(screen.getByRole("listitem")).toHaveClass(ICON_CLASS_NAME);
88
- expect(screen.getByRole("listitem").firstChild).toHaveClass(ITEM_CONTENT_CLASSNAME);
89
- expect(screen.getByText("✅")).toHaveClass(LIST_ICON_CLASS_NAME);
90
- });
91
- });
92
- });
93
- //# sourceMappingURL=List.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.test.js","sourceRoot":"","sources":["../../../../src/components/List/List.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAiB,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAElD,MAAM,eAAe,GAAG,aAAa,CAAC;AACtC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,eAAe,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ls } from "../../utils/excludeControls";
4
- export default {
5
- title: "Components/LoadingIndicator",
6
- component: LoadingIndicator,
7
- argTypes: Object.assign({ icon: {
8
- options: ["loading", "refreshArrow", "home"],
9
- control: { type: "radio" },
10
- }, color: {
11
- options: ["darkcyan", "deeppink", "royalblue", "tomato"],
12
- control: { type: "radio" },
13
- }, fontSize: {
14
- options: ["72px", "48px", "24px"],
15
- control: { type: "radio" },
16
- } }, excludeControls("className")),
17
- };
18
- export const Normal = {
19
- render: (args) => _jsx(LoadingIndicator, Object.assign({}, args)),
20
- args: {
21
- icon: "loading",
22
- fontSize: "24px",
23
- color: "darkcyan",
24
- },
25
- };
26
- export const Large = {
27
- render: (args) => _jsx(LoadingIndicator, Object.assign({}, args)),
28
- args: {
29
- icon: "loading",
30
- fontSize: "72px",
31
- color: "darkcyan",
32
- },
33
- };
34
- export const WithCustomColour = {
35
- render: (args) => _jsx(LoadingIndicator, Object.assign({}, args)),
36
- args: {
37
- icon: "loading",
38
- fontSize: "24px",
39
- color: "darkcyan",
40
- },
41
- };
42
- export const WithCustomIcon = {
43
- render: (args) => _jsx(LoadingIndicator, Object.assign({}, args)),
44
- args: {
45
- icon: "refreshArrow",
46
- fontSize: "24px",
47
- color: "darkcyan",
48
- },
49
- };
50
- //# sourceMappingURL=LoadingIndicator.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingIndicator.stories.js","sourceRoot":"","sources":["../../../../src/components/LoadingIndicator/LoadingIndicator.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,kBACN,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC;YAC5C,OAAO,EAAE,EAAE,IAAI,EAA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AAE,UAAU;KAClB;CACF,CAAC"}
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /* eslint-disable no-restricted-syntax */
3
- import { render, screen } from "@testing-library/react";
4
- import { LoadingIndicator } from ".";
5
- const CLASS_NAME = "mobius/LoadingIndicator";
6
- describe("Test for LoadingIndicator", () => {
7
- it("should render the LoadingIndicator component", () => {
8
- const { container } = render(_jsx(LoadingIndicator, {}));
9
- expect(container).toBeTruthy();
10
- });
11
- describe("uses correct class names", () => {
12
- it("uses Mobius class", () => {
13
- render(_jsx(LoadingIndicator, { "data-testid": "test" }));
14
- expect(screen.getByTestId("test")).toHaveClass("mobius");
15
- });
16
- it("uses base Mobius class", () => {
17
- render(_jsx(LoadingIndicator, { "data-testid": "test" }));
18
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
19
- });
20
- it("includes custom class name", () => {
21
- render(_jsx(LoadingIndicator, { "data-testid": "test", className: "my-class" }));
22
- expect(screen.getByTestId("test")).toHaveClass("my-class");
23
- expect(screen.getByTestId("test")).toHaveClass(CLASS_NAME);
24
- });
25
- });
26
- });
27
- //# sourceMappingURL=LoadingIndicator.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingIndicator.test.js","sourceRoot":"","sources":["../../../../src/components/LoadingIndicator/LoadingIndicator.test.tsx"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAErC,MAAM,UAAU,GAAG,yBAAyB,CAAC;AAE7C,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC;QACnD,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;YAC3B,MAAM,CAAC,KAAC,gBAAgB,mBAAa,MAAM,GAAG,CAAC,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,MAAM,CAAC,KAAC,gBAAgB,mBAAa,MAAM,GAAG,CAAC,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,CAAC,KAAC,gBAAgB,mBAAa,MAAM,EAAC,SAAS,EAAC,UAAU,GAAG,CAAC,CAAC;YACrE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { MaskedField } from "./MaskedField";
3
- import { excludeControls } from "../../utils/excludeControls";
4
- export default {
5
- title: "Components/MaskedField",
6
- component: MaskedField,
7
- argTypes: Object.assign({ type: {
8
- control: { type: "radio" },
9
- options: ["text", "number"],
10
- } }, excludeControls("className")),
11
- };
12
- export const Normal = {
13
- render: (args) => _jsx(MaskedField, Object.assign({}, args)),
14
- args: {
15
- label: "MaskedField",
16
- pattern: "ssn",
17
- isRequired: false,
18
- type: "",
19
- errorMessage: "",
20
- },
21
- };
22
- //# sourceMappingURL=MaskedField.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedField.stories.js","sourceRoot":"","sources":["../../../../src/components/MaskedField/MaskedField.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,WAAW;IACtB,QAAQ,kBACN,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC1B,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;SAC5B,IACE,eAAe,CAAC,WAAW,CAAC,CAChC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA6B;IAC9C,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,KAAC,WAAW,oBAAK,IAAI,EAAI;IAC7D,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,EAAE;QACR,YAAY,EAAE,EAAE;KACjB;CACF,CAAC"}
@@ -1,64 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { render } from "@testing-library/react";
3
- import userEvent from "@testing-library/user-event";
4
- import { MaskedField } from ".";
5
- describe("MaskedField", () => {
6
- const LABEL = "MaskedField";
7
- describe("given Social Security Number (SSN) pattern", () => {
8
- it("should render user input to match the pattern", async () => {
9
- const { getByLabelText } = render(_jsx(MaskedField, { label: LABEL, pattern: "ssn" }));
10
- const inputField = getByLabelText(LABEL);
11
- const inputValue = "1234567890";
12
- const expectedUnformatted = "123456789";
13
- const expectedFormatted = "123-45-6789";
14
- await userEvent.tab();
15
- await userEvent.type(inputField, inputValue);
16
- expect(inputField).toHaveValue(expectedUnformatted);
17
- await userEvent.tab();
18
- expect(inputField).toHaveValue(expectedFormatted);
19
- });
20
- describe("given a numerical and non-numerical input", () => {
21
- it("should only render numerical input", async () => {
22
- const { getByLabelText } = render(_jsx(MaskedField, { label: LABEL, pattern: "ssn" }));
23
- const inputField = getByLabelText(LABEL);
24
- const inputValue = "abc1234567890efg";
25
- const expectedUnformatted = "123456789";
26
- const expectedFormatted = "123-45-6789";
27
- await userEvent.tab();
28
- await userEvent.type(inputField, inputValue);
29
- expect(inputField).toHaveValue(expectedUnformatted);
30
- await userEvent.tab();
31
- expect(inputField).toHaveValue(expectedFormatted);
32
- });
33
- });
34
- });
35
- describe("given Federal Employer Identification Number (FEIN) pattern", () => {
36
- it("should render user input to match the pattern", async () => {
37
- const { getByLabelText } = render(_jsx(MaskedField, { label: LABEL, pattern: "fein" }));
38
- const inputField = getByLabelText(LABEL);
39
- const inputValue = "1234567890";
40
- const expectedUnformatted = "123456789";
41
- const expectedFormatted = "12-3456789";
42
- await userEvent.tab();
43
- await userEvent.type(inputField, inputValue);
44
- expect(inputField).toHaveValue(expectedUnformatted);
45
- await userEvent.tab();
46
- expect(inputField).toHaveValue(expectedFormatted);
47
- });
48
- describe("given a numerical and non-numerical input", () => {
49
- it("should only render numerical input", async () => {
50
- const { getByLabelText } = render(_jsx(MaskedField, { label: LABEL, pattern: "fein" }));
51
- const inputField = getByLabelText(LABEL);
52
- const inputValue = "abc1234567890efg";
53
- const expectedUnformatted = "123456789";
54
- const expectedFormatted = "12-3456789";
55
- await userEvent.tab();
56
- await userEvent.type(inputField, inputValue);
57
- expect(inputField).toHaveValue(expectedUnformatted);
58
- await userEvent.tab();
59
- expect(inputField).toHaveValue(expectedFormatted);
60
- });
61
- });
62
- });
63
- });
64
- //# sourceMappingURL=MaskedField.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MaskedField.test.js","sourceRoot":"","sources":["../../../../src/components/MaskedField/MaskedField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