@cruk/cruk-react-components 2.0.0 → 3.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 (254) hide show
  1. package/lib/components/AddressLookup/AddressLookUp.test.cypress.d.ts +1 -1
  2. package/lib/components/AddressLookup/AddressLookup.stories.d.ts +36 -7
  3. package/lib/components/AddressLookup/index.d.ts +61 -61
  4. package/lib/components/AddressLookup/styles.d.ts +14 -14
  5. package/lib/components/Avatar/Avatar.stories.d.ts +33 -20
  6. package/lib/components/Avatar/Avatar.test.cypress.d.ts +1 -1
  7. package/lib/components/Avatar/index.d.ts +15 -15
  8. package/lib/components/Avatar/styles.d.ts +7 -7
  9. package/lib/components/Badge/Badge.stories.d.ts +26 -16
  10. package/lib/components/Badge/Badge.test.cypress.d.ts +1 -1
  11. package/lib/components/Badge/index.d.ts +28 -28
  12. package/lib/components/Badge/styles.d.ts +11 -11
  13. package/lib/components/Box/Box.stories.d.ts +20 -13
  14. package/lib/components/Box/Box.test.cypress.d.ts +1 -1
  15. package/lib/components/Box/index.d.ts +17 -17
  16. package/lib/components/Box/styles.d.ts +8 -8
  17. package/lib/components/Button/Button.stories.d.ts +39 -15
  18. package/lib/components/Button/Button.test.cypress.d.ts +1 -1
  19. package/lib/components/Button/index.d.ts +46 -46
  20. package/lib/components/Button/styles.d.ts +15 -13
  21. package/lib/components/Carousel/Carousel.stories.d.ts +15 -7
  22. package/lib/components/Carousel/Carousel.test.cypress.d.ts +1 -1
  23. package/lib/components/Carousel/Dots.d.ts +12 -12
  24. package/lib/components/Carousel/index.d.ts +20 -20
  25. package/lib/components/Carousel/styles.d.ts +33 -33
  26. package/lib/components/Checkbox/CheckBox.test.cypress.d.ts +1 -1
  27. package/lib/components/Checkbox/Checkbox.stories.d.ts +26 -8
  28. package/lib/components/Checkbox/index.d.ts +23 -23
  29. package/lib/components/Checkbox/styles.d.ts +16 -13
  30. package/lib/components/Collapse/Collapse.stories.d.ts +23 -13
  31. package/lib/components/Collapse/Collapse.test.cypress.d.ts +1 -1
  32. package/lib/components/Collapse/index.d.ts +29 -29
  33. package/lib/components/Collapse/styles.d.ts +26 -26
  34. package/lib/components/DateField/DateField.stories.d.ts +29 -10
  35. package/lib/components/DateField/DateField.test.cypress.d.ts +1 -1
  36. package/lib/components/DateField/index.d.ts +32 -32
  37. package/lib/components/DateField/styles.d.ts +9 -4
  38. package/lib/components/Divider.d.ts +6 -6
  39. package/lib/components/ErrorText/ErrorText.stories.d.ts +16 -7
  40. package/lib/components/ErrorText/ErrorText.test.cypress.d.ts +1 -1
  41. package/lib/components/ErrorText/index.d.ts +13 -13
  42. package/lib/components/ErrorText/styles.d.ts +7 -3
  43. package/lib/components/Flex.d.ts +3 -3
  44. package/lib/components/Fontface.d.ts +2 -2
  45. package/lib/components/Footer/Footer.stories.d.ts +13 -7
  46. package/lib/components/Footer/Footer.test.cypress.d.ts +1 -1
  47. package/lib/components/Footer/index.d.ts +11 -11
  48. package/lib/components/Footer/styles.d.ts +16 -11
  49. package/lib/components/GlobalStyle.d.ts +9 -9
  50. package/lib/components/GlobalStyleNoFontFace.d.ts +9 -9
  51. package/lib/components/Header/Header.stories.d.ts +20 -7
  52. package/lib/components/Header/Header.test.cypress.d.ts +1 -1
  53. package/lib/components/Header/index.d.ts +37 -37
  54. package/lib/components/Header/styles.d.ts +37 -31
  55. package/lib/components/Heading/Heading.stories.d.ts +31 -25
  56. package/lib/components/Heading/Heading.test.cypress.d.ts +1 -1
  57. package/lib/components/Heading/index.d.ts +32 -32
  58. package/lib/components/Heading/styles.d.ts +50 -50
  59. package/lib/components/Icon/Icon.stories.d.ts +15 -6
  60. package/lib/components/Icon/Icon.test.cypress.d.ts +1 -1
  61. package/lib/components/Icon/iconList.d.ts +268 -268
  62. package/lib/components/Icon/index.d.ts +23 -23
  63. package/lib/components/Icon/styles.d.ts +5 -5
  64. package/lib/components/IconFa/IconFa.stories.d.ts +16 -7
  65. package/lib/components/IconFa/IconFa.test.cypress.d.ts +1 -1
  66. package/lib/components/IconFa/index.d.ts +17 -17
  67. package/lib/components/IconFa/styles.d.ts +5 -5
  68. package/lib/components/InfoBox/InfoBox.stories.d.ts +22 -9
  69. package/lib/components/InfoBox/InfoBox.test.cypress.d.ts +1 -1
  70. package/lib/components/InfoBox/index.d.ts +27 -27
  71. package/lib/components/InfoBox/styles.d.ts +14 -14
  72. package/lib/components/LabelWrapper/index.d.ts +19 -19
  73. package/lib/components/LabelWrapper/styles.d.ts +6 -6
  74. package/lib/components/LegendWrapper/LegendWrapper.stories.d.ts +21 -11
  75. package/lib/components/LegendWrapper/LegendWrapper.test.cypress.d.ts +1 -1
  76. package/lib/components/LegendWrapper/index.d.ts +22 -22
  77. package/lib/components/LegendWrapper/styles.d.ts +12 -12
  78. package/lib/components/Link/Link.stories.d.ts +33 -14
  79. package/lib/components/Link/Link.test.cypress.d.ts +1 -1
  80. package/lib/components/Link/index.d.ts +37 -37
  81. package/lib/components/Link/styles.d.ts +22 -18
  82. package/lib/components/Loader/Loader.stories.d.ts +13 -6
  83. package/lib/components/Loader/Loader.test.cypress.d.ts +1 -1
  84. package/lib/components/Loader/index.d.ts +7 -7
  85. package/lib/components/Loader/styles.d.ts +7 -2
  86. package/lib/components/Modal/Modal.stories.d.ts +13 -7
  87. package/lib/components/Modal/Modal.test.cypress.d.ts +1 -1
  88. package/lib/components/Modal/index.d.ts +32 -32
  89. package/lib/components/Modal/styles.d.ts +27 -24
  90. package/lib/components/Pagination/Pagination.stories.d.ts +20 -8
  91. package/lib/components/Pagination/Pagination.test.cypress.d.ts +1 -1
  92. package/lib/components/Pagination/index.d.ts +24 -24
  93. package/lib/components/Pagination/styles.d.ts +14 -10
  94. package/lib/components/PopOver/PopOver.test.cypress.d.ts +1 -1
  95. package/lib/components/PopOver/Popover.stories.d.ts +18 -7
  96. package/lib/components/PopOver/index.d.ts +26 -24
  97. package/lib/components/PopOver/styles.d.ts +11 -10
  98. package/lib/components/ProgressBar/ProgressBar.stories.d.ts +19 -10
  99. package/lib/components/ProgressBar/ProgressBar.test.cypress.d.ts +1 -1
  100. package/lib/components/ProgressBar/index.d.ts +24 -24
  101. package/lib/components/ProgressBar/styles.d.ts +30 -30
  102. package/lib/components/Radio/Radio.stories.d.ts +28 -8
  103. package/lib/components/Radio/Radio.test.cypress.d.ts +1 -1
  104. package/lib/components/Radio/index.d.ts +23 -23
  105. package/lib/components/Radio/styles.d.ts +21 -19
  106. package/lib/components/RadioConsent/Radio.stories.d.ts +21 -7
  107. package/lib/components/RadioConsent/RadioConsent.test.cypress.d.ts +1 -1
  108. package/lib/components/RadioConsent/index.d.ts +24 -24
  109. package/lib/components/RadioConsent/styles.d.ts +16 -16
  110. package/lib/components/Select/Select.test.cypress.d.ts +1 -1
  111. package/lib/components/Select/Selelct.stories.d.ts +24 -10
  112. package/lib/components/Select/index.d.ts +21 -21
  113. package/lib/components/Select/styles.d.ts +9 -9
  114. package/lib/components/Spacing/index.d.ts +19 -19
  115. package/lib/components/Step/Step.stories.d.ts +17 -7
  116. package/lib/components/Step/Step.test.cypress.d.ts +1 -1
  117. package/lib/components/Step/index.d.ts +15 -15
  118. package/lib/components/Step/styles.d.ts +17 -13
  119. package/lib/components/TestWrapper.d.ts +12 -12
  120. package/lib/components/Text/Text.stories.d.ts +17 -7
  121. package/lib/components/Text/Text.test.cypress.d.ts +1 -1
  122. package/lib/components/Text/index.d.ts +26 -26
  123. package/lib/components/Text/styles.d.ts +22 -22
  124. package/lib/components/TextAreaField/TextAreaField.stories.d.ts +29 -10
  125. package/lib/components/TextAreaField/TextAreaField.test.cypress.d.ts +1 -1
  126. package/lib/components/TextAreaField/index.d.ts +22 -22
  127. package/lib/components/TextAreaField/styles.d.ts +10 -10
  128. package/lib/components/TextField/TextField.stories.d.ts +27 -12
  129. package/lib/components/TextField/TextField.test.cypress.d.ts +1 -1
  130. package/lib/components/TextField/index.d.ts +34 -34
  131. package/lib/components/TextField/styles.d.ts +18 -18
  132. package/lib/components/ThemeCheatSheet.d.ts +7 -7
  133. package/lib/components/Totaliser/Totaliser.stories.d.ts +27 -19
  134. package/lib/components/Totaliser/Totaliser.test.cypress.d.ts +1 -1
  135. package/lib/components/Totaliser/index.d.ts +22 -22
  136. package/lib/components/Totaliser/styles.d.ts +20 -16
  137. package/lib/components/UserBlock/UserBlock.stories.d.ts +23 -16
  138. package/lib/components/UserBlock/UserBlock.test.cypress.d.ts +1 -1
  139. package/lib/components/UserBlock/index.d.ts +18 -18
  140. package/lib/components/UserBlock/styles.d.ts +9 -4
  141. package/lib/components/index.d.ts +73 -73
  142. package/lib/docs/Docs.d.ts +2 -2
  143. package/lib/docs/index.d.ts +1 -1
  144. package/lib/es/{node_modules/tslib/tslib.es6.js → _virtual/_tslib.js} +1 -1
  145. package/lib/es/_virtual/_tslib.js.map +1 -0
  146. package/lib/es/node_modules/focus-lock/dist/es2015/index.js +1 -1
  147. package/lib/es/node_modules/focus-lock/dist/es2015/index.js.map +1 -1
  148. package/lib/es/node_modules/focus-lock/dist/es2015/utils/safe.js.map +1 -1
  149. package/lib/es/node_modules/react-focus-lock/dist/es2015/Combination.js +1 -1
  150. package/lib/es/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
  151. package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
  152. package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  153. package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
  154. package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  155. package/lib/es/node_modules/react-focus-lock/dist/es2015/index.js +1 -1
  156. package/lib/es/node_modules/react-focus-lock/dist/es2015/medium.js +1 -1
  157. package/lib/es/node_modules/react-focus-lock/dist/es2015/medium.js.map +1 -1
  158. package/lib/es/node_modules/use-sidecar/dist/es2015/medium.js +1 -1
  159. package/lib/es/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  160. package/lib/es/src/components/AddressLookup/index.js +1 -1
  161. package/lib/es/src/components/AddressLookup/styles.js +1 -1
  162. package/lib/es/src/components/Avatar/index.js +1 -1
  163. package/lib/es/src/components/Avatar/styles.js +1 -1
  164. package/lib/es/src/components/Badge/index.js +1 -1
  165. package/lib/es/src/components/Badge/styles.js +1 -1
  166. package/lib/es/src/components/Box/index.js +1 -1
  167. package/lib/es/src/components/Box/styles.js +1 -1
  168. package/lib/es/src/components/Button/index.js +1 -1
  169. package/lib/es/src/components/Button/styles.js +1 -1
  170. package/lib/es/src/components/Carousel/Dots.js +1 -1
  171. package/lib/es/src/components/Carousel/styles.js +1 -1
  172. package/lib/es/src/components/Checkbox/index.js +1 -1
  173. package/lib/es/src/components/Checkbox/styles.js +1 -1
  174. package/lib/es/src/components/Collapse/index.js +1 -1
  175. package/lib/es/src/components/Collapse/styles.js +1 -1
  176. package/lib/es/src/components/DateField/styles.js +1 -1
  177. package/lib/es/src/components/Divider.js +1 -1
  178. package/lib/es/src/components/ErrorText/index.js +1 -1
  179. package/lib/es/src/components/ErrorText/styles.js +1 -1
  180. package/lib/es/src/components/Flex.js +1 -1
  181. package/lib/es/src/components/Footer/index.js +1 -1
  182. package/lib/es/src/components/Footer/styles.js +1 -1
  183. package/lib/es/src/components/GlobalStyle.js +1 -1
  184. package/lib/es/src/components/GlobalStyleNoFontFace.js +1 -1
  185. package/lib/es/src/components/Header/index.js +1 -1
  186. package/lib/es/src/components/Header/styles.js +1 -1
  187. package/lib/es/src/components/Heading/index.js +1 -1
  188. package/lib/es/src/components/Heading/styles.js +1 -1
  189. package/lib/es/src/components/Icon/index.js +1 -1
  190. package/lib/es/src/components/Icon/styles.js +1 -1
  191. package/lib/es/src/components/IconFa/index.js +1 -1
  192. package/lib/es/src/components/IconFa/styles.js +1 -1
  193. package/lib/es/src/components/InfoBox/index.js +1 -1
  194. package/lib/es/src/components/InfoBox/styles.js +1 -1
  195. package/lib/es/src/components/LabelWrapper/index.js +1 -1
  196. package/lib/es/src/components/LabelWrapper/styles.js +1 -1
  197. package/lib/es/src/components/LegendWrapper/index.js +1 -1
  198. package/lib/es/src/components/LegendWrapper/styles.js +1 -1
  199. package/lib/es/src/components/Link/index.js +1 -1
  200. package/lib/es/src/components/Link/styles.js +1 -1
  201. package/lib/es/src/components/Loader/index.js +1 -1
  202. package/lib/es/src/components/Loader/styles.js +1 -1
  203. package/lib/es/src/components/Modal/index.js +1 -1
  204. package/lib/es/src/components/Modal/styles.js +1 -1
  205. package/lib/es/src/components/Pagination/index.js +1 -1
  206. package/lib/es/src/components/Pagination/styles.js +1 -1
  207. package/lib/es/src/components/PopOver/README.md.js +1 -1
  208. package/lib/es/src/components/PopOver/README.md.js.map +1 -1
  209. package/lib/es/src/components/PopOver/index.js +1 -1
  210. package/lib/es/src/components/PopOver/styles.js +1 -1
  211. package/lib/es/src/components/ProgressBar/index.js +1 -1
  212. package/lib/es/src/components/ProgressBar/styles.js +1 -1
  213. package/lib/es/src/components/Radio/index.js +1 -1
  214. package/lib/es/src/components/Radio/styles.js +1 -1
  215. package/lib/es/src/components/RadioConsent/index.js +1 -1
  216. package/lib/es/src/components/RadioConsent/styles.js +1 -1
  217. package/lib/es/src/components/Select/index.js +1 -1
  218. package/lib/es/src/components/Select/styles.js +1 -1
  219. package/lib/es/src/components/Step/index.js +1 -1
  220. package/lib/es/src/components/Step/styles.js +1 -1
  221. package/lib/es/src/components/Text/index.js +1 -1
  222. package/lib/es/src/components/Text/styles.js +1 -1
  223. package/lib/es/src/components/TextAreaField/index.js +1 -1
  224. package/lib/es/src/components/TextAreaField/styles.js +1 -1
  225. package/lib/es/src/components/TextField/index.js +1 -1
  226. package/lib/es/src/components/TextField/styles.js +1 -1
  227. package/lib/es/src/components/Totaliser/index.js +1 -1
  228. package/lib/es/src/components/Totaliser/styles.js +1 -1
  229. package/lib/es/src/components/UserBlock/index.js +1 -1
  230. package/lib/es/src/components/UserBlock/styles.js +1 -1
  231. package/lib/es/src/themes/bowelbabe.js +1 -1
  232. package/lib/es/src/themes/su2c.js +1 -1
  233. package/lib/hocs/MdxProvider.d.ts +6 -6
  234. package/lib/hooks/useEffectBrowser.d.ts +3 -3
  235. package/lib/hooks/useKey.d.ts +6 -6
  236. package/lib/hooks/useLayoutEffectBrowser.d.ts +4 -4
  237. package/lib/hooks/useScrollPosition.d.ts +13 -13
  238. package/lib/themes/bowelbabe.d.ts +13 -13
  239. package/lib/themes/cruk.d.ts +13 -13
  240. package/lib/themes/su2c.d.ts +13 -13
  241. package/lib/types.d.ts +232 -232
  242. package/lib/utils/Helper.d.ts +6 -6
  243. package/lib/utils/__tests__/testHelpers.jest.d.ts +1 -1
  244. package/lib/utils/debounce.d.ts +2 -2
  245. package/package.json +21 -15
  246. package/lib/es/node_modules/detect-node-es/esm/node.js +0 -2
  247. package/lib/es/node_modules/detect-node-es/esm/node.js.map +0 -1
  248. package/lib/es/node_modules/react-focus-lock/dist/es2015/AutoFocusInside.js +0 -2
  249. package/lib/es/node_modules/react-focus-lock/dist/es2015/AutoFocusInside.js.map +0 -1
  250. package/lib/es/node_modules/react-focus-lock/dist/es2015/FreeFocusInside.js +0 -2
  251. package/lib/es/node_modules/react-focus-lock/dist/es2015/FreeFocusInside.js.map +0 -1
  252. package/lib/es/node_modules/react-focus-lock/dist/es2015/MoveFocusInside.js +0 -2
  253. package/lib/es/node_modules/react-focus-lock/dist/es2015/MoveFocusInside.js.map +0 -1
  254. package/lib/es/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,7 +1,36 @@
1
- import { Story, Meta } from "@storybook/react";
2
- import { AddressLookupProps } from ".";
3
- declare const _default: Meta<AddressLookupProps>;
4
- export default _default;
5
- export declare const AddressLookUp: Story<AddressLookupProps>;
6
- export declare const SU2CAddressLookUp: Story<AddressLookupProps>;
7
- export declare const BowelbabeAddressLookUp: Story<AddressLookupProps>;
1
+ import React from "react";
2
+ import { StoryObj } from "@storybook/react";
3
+ import AddressLookup from ".";
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement> & {
7
+ apiKey: string;
8
+ countries?: string[] | undefined;
9
+ onAddressSelected: (address: import("..").AddressDataType) => void;
10
+ errorMessage?: string | undefined;
11
+ hasError?: boolean | undefined;
12
+ isValid?: boolean | undefined;
13
+ isValidVisible?: boolean | undefined;
14
+ isInvalidVisible?: boolean | undefined;
15
+ label?: string | undefined;
16
+ onAddressError?: ((error: Error) => void) | undefined;
17
+ onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
18
+ ref?: React.Ref<HTMLInputElement> | undefined;
19
+ }, "label" | "apiKey" | "countries" | "errorMessage" | "hasError" | "isValid" | "isValidVisible" | "isInvalidVisible" | "onAddressError" | "onAddressSelected" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
20
+ args: {
21
+ disabled: boolean;
22
+ errorMessage: string;
23
+ hasError: boolean;
24
+ label: string;
25
+ required: boolean;
26
+ isValid: boolean;
27
+ isValidVisible: boolean;
28
+ isInvalidVisible: boolean;
29
+ };
30
+ tags: string[];
31
+ };
32
+ export default _default;
33
+ type Story = StoryObj<typeof AddressLookup>;
34
+ export declare const AddressLookupStory: Story;
35
+ export declare const AddressLookupSU2C: Story;
36
+ export declare const AddressLookupBowelbabe: Story;
@@ -1,61 +1,61 @@
1
- import React, { InputHTMLAttributes, Ref, FocusEvent } from "react";
2
- import { AddressDataType } from "../../types";
3
- export type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {
4
- /** api key for loqate */
5
- apiKey: string;
6
- /** list of countries codes you want the address look up to search within */
7
- countries?: string[];
8
- /** callback function which is passed the selected address data */
9
- onAddressSelected: (address: AddressDataType) => void;
10
- /** error message */
11
- errorMessage?: string;
12
- /** when true a input has a red border */
13
- hasError?: boolean;
14
- /** flag which effects the check or cross icons to the right of the input */
15
- isValid?: boolean;
16
- /** flag to hide or show the check icon when valid */
17
- isValidVisible?: boolean;
18
- /** flag to hide or show the cross icon when invalid */
19
- isInvalidVisible?: boolean;
20
- /** label text */
21
- label?: string;
22
- /** callback function which is passed the error */
23
- onAddressError?: (error: Error) => void;
24
- /** onBlur handler */
25
- onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
26
- /** attach a DOM reference variable to your component */
27
- ref?: Ref<HTMLInputElement>;
28
- };
29
- /**
30
- * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.
31
- * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.
32
- * You will need a Loqate api key, the examples below use "MG17-ZD93-FF33-KF13" our development key.
33
- * This component is generally only used for country codes including "GBR", "GGY", "IMN", "JEY". An example of this behavior is included bellow.
34
- */
35
- declare const AddressLookup: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement> & {
36
- /** api key for loqate */
37
- apiKey: string;
38
- /** list of countries codes you want the address look up to search within */
39
- countries?: string[] | undefined;
40
- /** callback function which is passed the selected address data */
41
- onAddressSelected: (address: AddressDataType) => void;
42
- /** error message */
43
- errorMessage?: string | undefined;
44
- /** when true a input has a red border */
45
- hasError?: boolean | undefined;
46
- /** flag which effects the check or cross icons to the right of the input */
47
- isValid?: boolean | undefined;
48
- /** flag to hide or show the check icon when valid */
49
- isValidVisible?: boolean | undefined;
50
- /** flag to hide or show the cross icon when invalid */
51
- isInvalidVisible?: boolean | undefined;
52
- /** label text */
53
- label?: string | undefined;
54
- /** callback function which is passed the error */
55
- onAddressError?: ((error: Error) => void) | undefined;
56
- /** onBlur handler */
57
- onBlur?: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;
58
- /** attach a DOM reference variable to your component */
59
- ref?: React.Ref<HTMLInputElement> | undefined;
60
- }, "apiKey" | "countries" | "errorMessage" | "hasError" | "isValid" | "isValidVisible" | "isInvalidVisible" | "label" | "onAddressError" | "onAddressSelected" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
61
- export default AddressLookup;
1
+ import React, { InputHTMLAttributes, Ref, FocusEvent } from "react";
2
+ import { AddressDataType } from "../../types";
3
+ export type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {
4
+ /** api key for loqate */
5
+ apiKey: string;
6
+ /** list of countries codes you want the address look up to search within */
7
+ countries?: string[];
8
+ /** callback function which is passed the selected address data */
9
+ onAddressSelected: (address: AddressDataType) => void;
10
+ /** error message */
11
+ errorMessage?: string;
12
+ /** when true a input has a red border */
13
+ hasError?: boolean;
14
+ /** flag which effects the check or cross icons to the right of the input */
15
+ isValid?: boolean;
16
+ /** flag to hide or show the check icon when valid */
17
+ isValidVisible?: boolean;
18
+ /** flag to hide or show the cross icon when invalid */
19
+ isInvalidVisible?: boolean;
20
+ /** label text */
21
+ label?: string;
22
+ /** callback function which is passed the error */
23
+ onAddressError?: (error: Error) => void;
24
+ /** onBlur handler */
25
+ onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
26
+ /** attach a DOM reference variable to your component */
27
+ ref?: Ref<HTMLInputElement>;
28
+ };
29
+ /**
30
+ * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.
31
+ * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.
32
+ * You will need a Loqate api key, the examples below use "MG17-ZD93-FF33-KF13" our development key.
33
+ * This component is generally only used for country codes including "GBR", "GGY", "IMN", "JEY". An example of this behavior is included bellow.
34
+ */
35
+ declare const AddressLookup: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement> & {
36
+ /** api key for loqate */
37
+ apiKey: string;
38
+ /** list of countries codes you want the address look up to search within */
39
+ countries?: string[] | undefined;
40
+ /** callback function which is passed the selected address data */
41
+ onAddressSelected: (address: AddressDataType) => void;
42
+ /** error message */
43
+ errorMessage?: string | undefined;
44
+ /** when true a input has a red border */
45
+ hasError?: boolean | undefined;
46
+ /** flag which effects the check or cross icons to the right of the input */
47
+ isValid?: boolean | undefined;
48
+ /** flag to hide or show the check icon when valid */
49
+ isValidVisible?: boolean | undefined;
50
+ /** flag to hide or show the cross icon when invalid */
51
+ isInvalidVisible?: boolean | undefined;
52
+ /** label text */
53
+ label?: string | undefined;
54
+ /** callback function which is passed the error */
55
+ onAddressError?: ((error: Error) => void) | undefined;
56
+ /** onBlur handler */
57
+ onBlur?: ((e: FocusEvent<HTMLInputElement>) => void) | undefined;
58
+ /** attach a DOM reference variable to your component */
59
+ ref?: React.Ref<HTMLInputElement> | undefined;
60
+ }, "apiKey" | "countries" | "errorMessage" | "hasError" | "isValid" | "isValidVisible" | "isInvalidVisible" | "label" | "onAddressError" | "onAddressSelected" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
61
+ export default AddressLookup;
@@ -1,14 +1,14 @@
1
- /// <reference types="react" />
2
- interface ListWrapperProps extends React.HTMLProps<HTMLDivElement> {
3
- tabIndex?: number;
4
- }
5
- export declare const ListWrapper: import("styled-components").StyledComponent<"div", any, ListWrapperProps, never>;
6
- export declare const List: import("styled-components").StyledComponent<"ul", any, {
7
- ref?: import("react").Ref<HTMLUListElement> | undefined;
8
- }, never>;
9
- export declare const ListItem: import("styled-components").StyledComponent<"li", any, {
10
- isActive: boolean;
11
- ref?: import("react").Ref<HTMLLIElement> | undefined;
12
- }, never>;
13
- export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"div", any, {}, never>;
14
- export {};
1
+ /// <reference types="react" />
2
+ interface ListWrapperProps extends React.HTMLProps<HTMLDivElement> {
3
+ tabIndex?: number;
4
+ }
5
+ export declare const ListWrapper: import("styled-components").StyledComponent<"div", any, ListWrapperProps, never>;
6
+ export declare const List: import("styled-components").StyledComponent<"ul", any, {
7
+ ref?: import("react").Ref<HTMLUListElement> | undefined;
8
+ }, never>;
9
+ export declare const ListItem: import("styled-components").StyledComponent<"li", any, {
10
+ isActive: boolean;
11
+ ref?: import("react").Ref<HTMLLIElement> | undefined;
12
+ }, never>;
13
+ export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export {};
@@ -1,20 +1,33 @@
1
- import { Story, Meta } from "@storybook/react";
2
- import { AvatarProps } from ".";
3
- declare const _default: Meta<AvatarProps>;
4
- export default _default;
5
- export declare const Default: Story;
6
- export declare const Small: Story;
7
- export declare const Medium: Story;
8
- export declare const Large: Story;
9
- export declare const ExtraLarge: Story;
10
- export declare const CustomImage: Story;
11
- export declare const SU2CDefault: Story;
12
- export declare const SU2CSmall: Story;
13
- export declare const SU2CMedium: Story;
14
- export declare const SU2CLarge: Story;
15
- export declare const SU2CExtraLarge: Story;
16
- export declare const BowelbabeDefault: Story;
17
- export declare const BowelbabeSmall: Story;
18
- export declare const BowelbabeMedium: Story;
19
- export declare const BowelbabeLarge: Story;
20
- export declare const BowelbabeExtraLarge: Story;
1
+ /// <reference types="react" />
2
+ import { StoryObj } from "@storybook/react";
3
+ import Avatar from ".";
4
+ declare const _default: {
5
+ title: string;
6
+ component: ({ url, name, size, alt, ...rest }: import(".").AvatarProps) => JSX.Element;
7
+ args: {
8
+ name: string;
9
+ size: string;
10
+ alt: string;
11
+ };
12
+ tags: string[];
13
+ };
14
+ export default _default;
15
+ type Story = StoryObj<typeof Avatar>;
16
+ export declare const Default: Story;
17
+ export declare const Small: Story;
18
+ export declare const Medium: Story;
19
+ export declare const Large: Story;
20
+ export declare const ExtraLarge: Story;
21
+ export declare const CustomImage: Story;
22
+ export declare const DefaultSU2C: Story;
23
+ export declare const SmallSU2C: Story;
24
+ export declare const MediumSU2C: Story;
25
+ export declare const LargeSU2C: Story;
26
+ export declare const ExtraLargeSU2C: Story;
27
+ export declare const CustomImageSU2C: Story;
28
+ export declare const DefaultBowelBabe: Story;
29
+ export declare const SmallBowelBabe: Story;
30
+ export declare const MediumBowelBabe: Story;
31
+ export declare const LargeBowelBabe: Story;
32
+ export declare const ExtraLargeBowelBabe: Story;
33
+ export declare const CustomImageBowelBabe: Story;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,15 +1,15 @@
1
- import { ImgHTMLAttributes } from "react";
2
- export type AvatarProps = ImgHTMLAttributes<HTMLElement> & {
3
- /** name of user/entity */
4
- name?: string;
5
- /** image url */
6
- url?: string;
7
- /** image size */
8
- size?: "s" | "m" | "l" | "xl";
9
- };
10
- /**
11
- *
12
- * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.
13
- */
14
- declare const Avatar: ({ url, name, size, alt, ...rest }: AvatarProps) => JSX.Element;
15
- export default Avatar;
1
+ import { ImgHTMLAttributes } from "react";
2
+ export type AvatarProps = ImgHTMLAttributes<HTMLElement> & {
3
+ /** name of user/entity */
4
+ name?: string;
5
+ /** image url */
6
+ url?: string;
7
+ /** image size */
8
+ size?: "s" | "m" | "l" | "xl";
9
+ };
10
+ /**
11
+ *
12
+ * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.
13
+ */
14
+ declare const Avatar: ({ url, name, size, alt, ...rest }: AvatarProps) => JSX.Element;
15
+ export default Avatar;
@@ -1,7 +1,7 @@
1
- import { ThemeType } from "../../types";
2
- type AvatarStyledProps = {
3
- size?: string;
4
- theme: ThemeType;
5
- };
6
- export declare const StyledAvatar: import("styled-components").StyledComponent<"img", any, AvatarStyledProps, never>;
7
- export default StyledAvatar;
1
+ import { ThemeType } from "../../types";
2
+ type AvatarStyledProps = {
3
+ size?: string;
4
+ theme: ThemeType;
5
+ };
6
+ export declare const StyledAvatar: import("styled-components").StyledComponent<"img", any, AvatarStyledProps, never>;
7
+ export default StyledAvatar;
@@ -1,16 +1,26 @@
1
- import { Story, Meta } from "@storybook/react";
2
- import { BadgeProps } from ".";
3
- declare const _default: Meta<BadgeProps>;
4
- export default _default;
5
- export declare const BadgeWithText: Story;
6
- export declare const Default: Story;
7
- export declare const BadgeWithColour: Story;
8
- export declare const BadgeWithInverseColours: Story;
9
- export declare const SU2CBadgeWithText: Story;
10
- export declare const SU2CDefault: Story;
11
- export declare const SU2CBadgeWithColour: Story;
12
- export declare const SU2CBadgeWithInverseColours: Story;
13
- export declare const BowelbabeBadgeWithText: Story;
14
- export declare const BowelbabeDefault: Story;
15
- export declare const BowelbabeBadgeWithColour: Story;
16
- export declare const BowelbabeBadgeWithInverseColours: Story;
1
+ import { StoryObj } from "@storybook/react";
2
+ import Badge, { BadgeProps } from ".";
3
+ declare const _default: {
4
+ title: string;
5
+ component: ({ children, ...rest }: BadgeProps) => JSX.Element;
6
+ args: {
7
+ borderColor: string;
8
+ backgroundColor: string;
9
+ textColor: string;
10
+ };
11
+ tags: string[];
12
+ };
13
+ export default _default;
14
+ type Story = StoryObj<typeof Badge>;
15
+ export declare const Default: Story;
16
+ export declare const BadgeWithText: Story;
17
+ export declare const BadgeWithColour: Story;
18
+ export declare const BadgeWithInverseColours: Story;
19
+ export declare const DefaultSU2C: Story;
20
+ export declare const BadgeWithTextSU2C: Story;
21
+ export declare const BadgeWithColourSU2C: Story;
22
+ export declare const BadgeWithInverseColoursSU2C: Story;
23
+ export declare const DefaultBowelbabe: Story;
24
+ export declare const BadgeWithTextBowelbabe: Story;
25
+ export declare const BadgeWithColourBowelbabe: Story;
26
+ export declare const BadgeWithInverseColoursBowelbabe: Story;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,29 +1,29 @@
1
- import { ReactNode } from "react";
2
- import { SpaceType } from "../../types";
3
- export type BadgeProps = {
4
- /** background colour of badge */
5
- backgroundColor?: string;
6
- /** border colour of badge */
7
- borderColor?: string;
8
- /** text colour of badge */
9
- textColor?: string;
10
- /** size of badge */
11
- size?: SpaceType;
12
- /** contents of badge */
13
- children?: ReactNode;
14
- };
15
- /**
16
- * Displays a numeric or icon indicator. You can use the icon prop to
17
- indicate the importance of the badge to the user.
1
+ import { ReactNode } from "react";
2
+ import { SpaceType } from "../../types";
3
+ export type BadgeProps = {
4
+ /** background colour of badge */
5
+ backgroundColor?: string;
6
+ /** border colour of badge */
7
+ borderColor?: string;
8
+ /** text colour of badge */
9
+ textColor?: string;
10
+ /** size of badge */
11
+ size?: SpaceType;
12
+ /** contents of badge */
13
+ children?: ReactNode;
14
+ };
15
+ /**
16
+ * Displays a numeric or icon indicator. You can use the icon prop to
17
+ indicate the importance of the badge to the user.
18
18
 
19
- Note that depending on how they are used, badges may be confusing for users
20
- of screen readers and similar assistive technologies. While the styling of
21
- badges provides a visual cue as to their purpose, these users will simply
22
- be presented with the content of the badge. Depending on the specific
23
- situation, these badges may seem like random additional words or numbers
24
- at the end of a sentence, link, or button. Unless the context is clear,
25
- consider including additional context with a visually hidden piece of
26
- additional text.
27
- */
28
- declare const Badge: ({ children, ...rest }: BadgeProps) => JSX.Element;
29
- export default Badge;
19
+ Note that depending on how they are used, badges may be confusing for users
20
+ of screen readers and similar assistive technologies. While the styling of
21
+ badges provides a visual cue as to their purpose, these users will simply
22
+ be presented with the content of the badge. Depending on the specific
23
+ situation, these badges may seem like random additional words or numbers
24
+ at the end of a sentence, link, or button. Unless the context is clear,
25
+ consider including additional context with a visually hidden piece of
26
+ additional text.
27
+ */
28
+ declare const Badge: ({ children, ...rest }: BadgeProps) => JSX.Element;
29
+ export default Badge;
@@ -1,11 +1,11 @@
1
- import { SpaceType, ThemeType } from "../../types";
2
- type StyleBadgeProps = {
3
- backgroundColor?: string;
4
- borderColor?: string;
5
- textColor?: string;
6
- isText?: boolean;
7
- size: SpaceType;
8
- theme: ThemeType;
9
- };
10
- export declare const StyledBadge: import("styled-components").StyledComponent<"span", any, StyleBadgeProps, never>;
11
- export default StyledBadge;
1
+ import { SpaceType, ThemeType } from "../../types";
2
+ type StyleBadgeProps = {
3
+ backgroundColor?: string;
4
+ borderColor?: string;
5
+ textColor?: string;
6
+ isText?: boolean;
7
+ size: SpaceType;
8
+ theme: ThemeType;
9
+ };
10
+ export declare const StyledBadge: import("styled-components").StyledComponent<"span", any, StyleBadgeProps, never>;
11
+ export default StyledBadge;
@@ -1,13 +1,20 @@
1
- import { Story, Meta } from "@storybook/react";
2
- import { BoxProps } from ".";
3
- declare const _default: Meta<BoxProps>;
4
- export default _default;
5
- export declare const Default: Story;
6
- export declare const BoxWithColour: Story;
7
- export declare const BoxWithColourWithCustomSpacing: Story;
8
- export declare const SU2CDefault: Story;
9
- export declare const SU2CBoxWithColour: Story;
10
- export declare const SU2CBoxWithColourWithCustomSpacing: Story;
11
- export declare const BowelbabeDefault: Story;
12
- export declare const BowelbabeBoxWithColour: Story;
13
- export declare const BowelbabeBoxWithColourWithCustomSpacing: Story;
1
+ import React from "react";
2
+ import { StoryObj } from "@storybook/react";
3
+ import Box, { BoxProps } from ".";
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.FunctionComponent<BoxProps>;
7
+ args: {};
8
+ tags: string[];
9
+ };
10
+ export default _default;
11
+ type Story = StoryObj<typeof Box>;
12
+ export declare const Default: Story;
13
+ export declare const BoxWithColour: Story;
14
+ export declare const BoxWithColourWithCustomSpacing: Story;
15
+ export declare const DefaultSU2C: Story;
16
+ export declare const BoxWithColourSU2C: Story;
17
+ export declare const BoxWithColourWithCustomSpacingSU2C: Story;
18
+ export declare const DefaultBowelBabe: Story;
19
+ export declare const BoxWithColourBowelBabe: Story;
20
+ export declare const BoxWithColourWithCustomSpacingBowelBabe: Story;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,18 +1,18 @@
1
- import { FunctionComponent, HTMLAttributes, Ref, ReactNode, ElementType } from "react";
2
- import { SpacingProps } from "../Spacing";
3
- export type BoxProps = SpacingProps & HTMLAttributes<HTMLElement> & {
4
- /** background color of box, this will add default padding */
5
- backgroundColor?: string;
6
- css?: string;
7
- ref?: Ref<HTMLDivElement>;
8
- children?: ReactNode;
9
- /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a "span" for example */
10
- as?: ElementType;
11
- };
12
- /**
13
- * Box is used to wrap other components to add margin and padding. The values will be in the t-shirt sizes specified in the theme sizes.
1
+ import { FunctionComponent, HTMLAttributes, Ref, ReactNode, ElementType } from "react";
2
+ import { SpacingProps } from "../Spacing";
3
+ export type BoxProps = SpacingProps & HTMLAttributes<HTMLElement> & {
4
+ /** background color of box, this will add default padding */
5
+ backgroundColor?: string;
6
+ css?: string;
7
+ ref?: Ref<HTMLDivElement>;
8
+ children?: ReactNode;
9
+ /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a "span" for example */
10
+ as?: ElementType;
11
+ };
12
+ /**
13
+ * Box is used to wrap other components to add margin and padding. The values will be in the t-shirt sizes specified in the theme sizes.
14
14
 
15
- The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.
16
- */
17
- declare const Box: FunctionComponent<BoxProps>;
18
- export default Box;
15
+ The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.
16
+ */
17
+ declare const Box: FunctionComponent<BoxProps>;
18
+ export default Box;
@@ -1,8 +1,8 @@
1
- import { SpacingProps } from "../Spacing";
2
- import { ThemeType } from "../../types";
3
- export declare const StyledBox: import("styled-components").StyledComponent<"div", any, SpacingProps & {
4
- backgroundColor?: string | undefined;
5
- css?: string | undefined;
6
- theme: ThemeType;
7
- }, never>;
8
- export default StyledBox;
1
+ import { SpacingProps } from "../Spacing";
2
+ import { ThemeType } from "../../types";
3
+ export declare const StyledBox: import("styled-components").StyledComponent<"div", any, SpacingProps & {
4
+ backgroundColor?: string | undefined;
5
+ css?: string | undefined;
6
+ theme: ThemeType;
7
+ }, never>;
8
+ export default StyledBox;
@@ -1,15 +1,39 @@
1
- import { Story, Meta } from "@storybook/react";
2
- import { Props } from ".";
3
- declare const _default: Meta<Props>;
4
- export default _default;
5
- export declare const Primary: Story;
6
- export declare const PrimaryAnchorButton: Story;
7
- export declare const Secondary: Story;
8
- export declare const Tertiary: Story;
9
- export declare const WithIcons: Story;
10
- export declare const SU2CPrimary: Story;
11
- export declare const SU2CSecondary: Story;
12
- export declare const SU2CTertiary: Story;
13
- export declare const BowelbabePrimary: Story;
14
- export declare const BowelbabeSecondary: Story;
15
- export declare const BowelbabeTertiary: Story;
1
+ import React from "react";
2
+ import { StoryObj } from "@storybook/react";
3
+ import { Button } from "./";
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.ForwardRefExoticComponent<Pick<React.ButtonHTMLAttributes<HTMLElement> & {
7
+ appearance?: import("..").ButtonAppearanceType | undefined;
8
+ full?: boolean | undefined;
9
+ href?: string | undefined;
10
+ size?: "m" | "l" | undefined;
11
+ css?: any;
12
+ as?: React.ElementType | undefined;
13
+ isIconButton?: boolean | undefined;
14
+ ref?: React.Ref<HTMLElement> | undefined;
15
+ children?: React.ReactNode;
16
+ }, "css" | "as" | "size" | keyof React.ButtonHTMLAttributes<HTMLElement> | "appearance" | "full" | "href" | "isIconButton"> & React.RefAttributes<HTMLElement>>;
17
+ args: {
18
+ appearance: string;
19
+ disabled: boolean;
20
+ children: string;
21
+ full: boolean;
22
+ size: string;
23
+ };
24
+ tags: string[];
25
+ };
26
+ export default _default;
27
+ type Story = StoryObj<typeof Button>;
28
+ export declare const Default: Story;
29
+ export declare const Primary: Story;
30
+ export declare const PrimaryAnchorButton: Story;
31
+ export declare const Secondary: Story;
32
+ export declare const Tertiary: Story;
33
+ export declare const WithIcons: Story;
34
+ export declare const PrimarySU2C: Story;
35
+ export declare const SecondarySU2C: Story;
36
+ export declare const TertiarySU2C: Story;
37
+ export declare const PrimaryBowelbabe: Story;
38
+ export declare const SecondaryBowelbabe: Story;
39
+ export declare const TertiaryBowelbabe: Story;
@@ -1 +1 @@
1
- export {};
1
+ export {};