@ovotech/element-native 2.2.0 → 3.0.0-canary-edaf96f-93

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 (302) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/Accordion.js +22 -25
  3. package/dist/components/Accordion/Group.js +10 -32
  4. package/dist/components/Accordion/Icon.js +19 -14
  5. package/dist/components/Accordion/hooks.d.ts +1 -1
  6. package/dist/components/Accordion/hooks.js +3 -26
  7. package/dist/components/Accordion/styles.d.ts +688 -46
  8. package/dist/components/Accordion/styles.js +56 -49
  9. package/dist/components/Badge/Badge.d.ts +54 -46
  10. package/dist/components/Badge/Badge.js +35 -20
  11. package/dist/components/CTAButton/CTAButton.d.ts +7 -12
  12. package/dist/components/CTAButton/CTAButton.js +23 -27
  13. package/dist/components/CTALink/CTALink.d.ts +4 -4
  14. package/dist/components/CTALink/CTALink.js +5 -27
  15. package/dist/components/Card/Card.d.ts +47 -45
  16. package/dist/components/Card/Card.js +5 -25
  17. package/dist/components/Checkbox/Checkbox.d.ts +3 -3
  18. package/dist/components/Checkbox/Checkbox.js +18 -57
  19. package/dist/components/Checkbox/CheckboxField.js +7 -37
  20. package/dist/components/DataTable/DataTable.d.ts +3 -12
  21. package/dist/components/DataTable/DataTable.js +11 -98
  22. package/dist/components/DataTable/TableRow.d.ts +2 -0
  23. package/dist/components/DataTable/TableRow.js +31 -0
  24. package/dist/components/DataTable/index.d.ts +2 -0
  25. package/dist/components/DataTable/index.js +16 -0
  26. package/dist/components/DataTable/styles.d.ts +2517 -0
  27. package/dist/components/DataTable/styles.js +77 -0
  28. package/dist/components/DataTable/types.d.ts +15 -0
  29. package/dist/components/DataTable/types.js +2 -0
  30. package/dist/components/DateField/DateField.d.ts +2 -2
  31. package/dist/components/DateField/DateField.js +9 -28
  32. package/dist/components/DescriptionList/DescriptionList.js +8 -32
  33. package/dist/components/DescriptionList/styled.d.ts +50 -44
  34. package/dist/components/DescriptionList/styled.js +9 -34
  35. package/dist/components/Disclosure/Disclosure.d.ts +3 -3
  36. package/dist/components/Disclosure/Disclosure.js +12 -18
  37. package/dist/components/Divider/Divider.js +4 -7
  38. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
  39. package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -28
  40. package/dist/components/ErrorText/ErrorText.d.ts +45 -39
  41. package/dist/components/ErrorText/ErrorText.js +7 -4
  42. package/dist/components/Field/Field.d.ts +2 -2
  43. package/dist/components/Field/Field.js +18 -49
  44. package/dist/components/FormGroup/FormGroup.js +2 -3
  45. package/dist/components/Grid/Col.d.ts +45 -39
  46. package/dist/components/Grid/Col.js +4 -3
  47. package/dist/components/Grid/Row.d.ts +47 -41
  48. package/dist/components/Grid/Row.js +7 -10
  49. package/dist/components/Heading/Heading.js +21 -32
  50. package/dist/components/HintText/HintText.d.ts +45 -39
  51. package/dist/components/HintText/HintText.js +7 -4
  52. package/dist/components/Icon/Icon.d.ts +3 -4
  53. package/dist/components/Icon/Icon.js +5 -27
  54. package/dist/components/Input/CurrencyInput.d.ts +6 -6
  55. package/dist/components/Input/CurrencyInput.js +3 -25
  56. package/dist/components/Input/EmailInput.d.ts +6 -6
  57. package/dist/components/Input/EmailInput.js +3 -25
  58. package/dist/components/Input/Input.d.ts +8 -8
  59. package/dist/components/Input/Input.js +26 -32
  60. package/dist/components/Input/NumberInput.d.ts +6 -6
  61. package/dist/components/Input/NumberInput.js +3 -25
  62. package/dist/components/Input/PasswordInput.d.ts +6 -6
  63. package/dist/components/Input/PasswordInput.js +3 -25
  64. package/dist/components/Input/PasswordInput.styled.d.ts +45 -39
  65. package/dist/components/Input/PasswordInput.styled.js +2 -5
  66. package/dist/components/Input/PasswordVisibilityToggle.js +14 -29
  67. package/dist/components/Input/PhoneInput.d.ts +10 -0
  68. package/dist/components/Input/PhoneInput.js +19 -0
  69. package/dist/components/Input/TextInput.d.ts +6 -6
  70. package/dist/components/Input/TextInput.js +3 -25
  71. package/dist/components/Input/TextareaInput.d.ts +6 -6
  72. package/dist/components/Input/TextareaInput.js +13 -10
  73. package/dist/components/Input/index.d.ts +1 -1
  74. package/dist/components/Input/index.js +3 -3
  75. package/dist/components/LabelText/LabelText.d.ts +45 -39
  76. package/dist/components/LabelText/LabelText.js +5 -4
  77. package/dist/components/List/List.d.ts +149 -131
  78. package/dist/components/List/List.js +30 -44
  79. package/dist/components/Margin/Margin.d.ts +45 -39
  80. package/dist/components/Margin/Margin.js +3 -3
  81. package/dist/components/NavHeader/NavHeader.d.ts +1 -1
  82. package/dist/components/NavHeader/NavHeader.js +34 -35
  83. package/dist/components/Notification/Notification.d.ts +104 -100
  84. package/dist/components/Notification/Notification.js +32 -49
  85. package/dist/components/Radio/Radio.d.ts +3 -3
  86. package/dist/components/Radio/Radio.js +16 -61
  87. package/dist/components/Radio/RadioField.js +11 -41
  88. package/dist/components/SelectField/Select.d.ts +244 -0
  89. package/dist/components/SelectField/Select.js +102 -0
  90. package/dist/components/SelectField/SelectField.d.ts +7 -0
  91. package/dist/components/SelectField/SelectField.js +33 -0
  92. package/dist/components/SelectField/index.d.ts +1 -0
  93. package/dist/components/SelectField/index.js +5 -0
  94. package/dist/components/SkeletonLoading/Skeleton.d.ts +45 -39
  95. package/dist/components/SkeletonLoading/SkeletonAnimation.js +22 -33
  96. package/dist/components/SkeletonLoading/SkeletonCTA.js +4 -5
  97. package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -6
  98. package/dist/components/SkeletonLoading/SkeletonHeading.js +4 -5
  99. package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
  100. package/dist/components/Stack/Stack.js +6 -28
  101. package/dist/components/Stretch/Stretch.js +2 -2
  102. package/dist/components/SubLabelText/SubLabelText.d.ts +45 -39
  103. package/dist/components/SubLabelText/SubLabelText.js +5 -4
  104. package/dist/components/SummaryList/SummaryList.js +8 -32
  105. package/dist/components/Tabs/Tab.d.ts +4 -4
  106. package/dist/components/Tabs/Tab.js +23 -20
  107. package/dist/components/Tabs/TabList.d.ts +11 -222
  108. package/dist/components/Tabs/TabList.js +22 -18
  109. package/dist/components/Tabs/TabPanel.js +33 -10
  110. package/dist/components/Tabs/Tabs.d.ts +8 -227
  111. package/dist/components/Tabs/Tabs.js +26 -23
  112. package/dist/components/Text/Text.d.ts +234 -204
  113. package/dist/components/Text/Text.js +17 -20
  114. package/dist/components/TextField/CurrencyField.d.ts +6 -6
  115. package/dist/components/TextField/CurrencyField.js +3 -26
  116. package/dist/components/TextField/EmailField.d.ts +6 -6
  117. package/dist/components/TextField/EmailField.js +3 -26
  118. package/dist/components/TextField/NumberField.d.ts +6 -6
  119. package/dist/components/TextField/NumberField.js +3 -26
  120. package/dist/components/TextField/PasswordField.d.ts +6 -6
  121. package/dist/components/TextField/PasswordField.js +3 -26
  122. package/dist/components/TextField/PhoneField.d.ts +10 -0
  123. package/dist/components/TextField/PhoneField.js +33 -0
  124. package/dist/components/TextField/TelField.d.ts +10 -6
  125. package/dist/components/TextField/TelField.js +9 -27
  126. package/dist/components/TextField/TextField.d.ts +6 -6
  127. package/dist/components/TextField/TextField.js +3 -26
  128. package/dist/components/TextField/TextareaField.d.ts +6 -6
  129. package/dist/components/TextField/TextareaField.js +3 -26
  130. package/dist/components/TextField/index.d.ts +1 -0
  131. package/dist/components/TextField/index.js +3 -1
  132. package/dist/components/TextLink/TextLink.d.ts +4 -4
  133. package/dist/components/TextLink/TextLink.js +5 -8
  134. package/dist/components/index.d.ts +1 -0
  135. package/dist/components/index.js +1 -0
  136. package/dist/esm/components/Accordion/Accordion.js +25 -28
  137. package/dist/esm/components/Accordion/Group.js +10 -9
  138. package/dist/esm/components/Accordion/Icon.js +20 -12
  139. package/dist/esm/components/Accordion/hooks.js +3 -3
  140. package/dist/esm/components/Accordion/styles.js +29 -48
  141. package/dist/esm/components/Badge/Badge.js +35 -17
  142. package/dist/esm/components/CTAButton/CTAButton.js +24 -28
  143. package/dist/esm/components/CTALink/CTALink.js +5 -4
  144. package/dist/esm/components/Card/Card.js +5 -25
  145. package/dist/esm/components/Checkbox/Checkbox.js +15 -34
  146. package/dist/esm/components/Checkbox/CheckboxField.js +7 -14
  147. package/dist/esm/components/DataTable/DataTable.js +10 -74
  148. package/dist/esm/components/DataTable/TableRow.js +27 -0
  149. package/dist/esm/components/DataTable/index.js +2 -0
  150. package/dist/esm/components/DataTable/styles.js +51 -0
  151. package/dist/esm/components/DataTable/types.js +1 -0
  152. package/dist/esm/components/DateField/DateField.js +9 -28
  153. package/dist/esm/components/DescriptionList/DescriptionList.js +8 -9
  154. package/dist/esm/components/DescriptionList/styled.js +9 -31
  155. package/dist/esm/components/Disclosure/Disclosure.js +13 -19
  156. package/dist/esm/components/Divider/Divider.js +4 -4
  157. package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -5
  158. package/dist/esm/components/ErrorText/ErrorText.js +7 -4
  159. package/dist/esm/components/Field/Field.js +18 -26
  160. package/dist/esm/components/FormGroup/FormGroup.js +2 -3
  161. package/dist/esm/components/Grid/Col.js +4 -3
  162. package/dist/esm/components/Grid/Row.js +7 -7
  163. package/dist/esm/components/Heading/Heading.js +21 -29
  164. package/dist/esm/components/HintText/HintText.js +7 -4
  165. package/dist/esm/components/Icon/Icon.js +5 -4
  166. package/dist/esm/components/Input/CurrencyInput.js +3 -2
  167. package/dist/esm/components/Input/EmailInput.js +3 -2
  168. package/dist/esm/components/Input/Input.js +27 -33
  169. package/dist/esm/components/Input/NumberInput.js +3 -2
  170. package/dist/esm/components/Input/PasswordInput.js +3 -2
  171. package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
  172. package/dist/esm/components/Input/PasswordVisibilityToggle.js +15 -7
  173. package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +4 -3
  174. package/dist/esm/components/Input/TextInput.js +3 -2
  175. package/dist/esm/components/Input/TextareaInput.js +13 -10
  176. package/dist/esm/components/Input/index.js +1 -1
  177. package/dist/esm/components/LabelText/LabelText.js +5 -4
  178. package/dist/esm/components/List/List.js +31 -45
  179. package/dist/esm/components/Margin/Margin.js +3 -3
  180. package/dist/esm/components/NavHeader/NavHeader.js +34 -32
  181. package/dist/esm/components/Notification/Notification.js +33 -50
  182. package/dist/esm/components/Radio/Radio.js +16 -38
  183. package/dist/esm/components/Radio/RadioField.js +11 -18
  184. package/dist/esm/components/SelectField/Select.js +75 -0
  185. package/dist/esm/components/SelectField/SelectField.js +29 -0
  186. package/dist/esm/components/SelectField/index.js +1 -0
  187. package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +23 -11
  188. package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +4 -5
  189. package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -6
  190. package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +4 -5
  191. package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
  192. package/dist/esm/components/Stack/Stack.js +6 -5
  193. package/dist/esm/components/Stretch/Stretch.js +2 -2
  194. package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
  195. package/dist/esm/components/SummaryList/SummaryList.js +8 -9
  196. package/dist/esm/components/Tabs/Tab.js +23 -17
  197. package/dist/esm/components/Tabs/TabList.js +21 -18
  198. package/dist/esm/components/Tabs/TabPanel.js +10 -7
  199. package/dist/esm/components/Tabs/Tabs.js +25 -23
  200. package/dist/esm/components/Text/Text.js +17 -20
  201. package/dist/esm/components/TextField/CurrencyField.js +3 -3
  202. package/dist/esm/components/TextField/EmailField.js +3 -3
  203. package/dist/esm/components/TextField/NumberField.js +3 -3
  204. package/dist/esm/components/TextField/PasswordField.js +3 -3
  205. package/dist/esm/components/TextField/PhoneField.js +30 -0
  206. package/dist/esm/components/TextField/TelField.js +9 -4
  207. package/dist/esm/components/TextField/TextField.js +3 -3
  208. package/dist/esm/components/TextField/TextareaField.js +3 -3
  209. package/dist/esm/components/TextField/index.js +1 -0
  210. package/dist/esm/components/TextLink/TextLink.js +5 -8
  211. package/dist/esm/components/index.js +1 -0
  212. package/dist/esm/hooks/use-breakpoint.js +4 -4
  213. package/dist/esm/providers/IconsProvider.js +3 -2
  214. package/dist/esm/providers/icons/ArrowDown.js +2 -3
  215. package/dist/esm/providers/icons/ArrowLeft.js +2 -3
  216. package/dist/esm/providers/icons/ArrowRight.js +2 -3
  217. package/dist/esm/providers/icons/ArrowUp.js +2 -3
  218. package/dist/esm/providers/icons/CaretDown.js +2 -3
  219. package/dist/esm/providers/icons/CaretLeft.js +2 -3
  220. package/dist/esm/providers/icons/CaretRight.js +2 -3
  221. package/dist/esm/providers/icons/CaretUp.js +2 -3
  222. package/dist/esm/providers/icons/Chart.js +2 -3
  223. package/dist/esm/providers/icons/Check.js +2 -3
  224. package/dist/esm/providers/icons/ChevronDown.js +2 -3
  225. package/dist/esm/providers/icons/ChevronLeft.js +2 -3
  226. package/dist/esm/providers/icons/ChevronLeftSmall.js +2 -3
  227. package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +2 -3
  228. package/dist/esm/providers/icons/ChevronRight.js +2 -3
  229. package/dist/esm/providers/icons/ChevronRightSmall.js +2 -3
  230. package/dist/esm/providers/icons/ChevronRightSmallLast.js +2 -3
  231. package/dist/esm/providers/icons/ChevronUp.js +2 -3
  232. package/dist/esm/providers/icons/Cross.js +2 -3
  233. package/dist/esm/providers/icons/Dollar.js +2 -3
  234. package/dist/esm/providers/icons/Download.js +2 -3
  235. package/dist/esm/providers/icons/Electricity.js +2 -3
  236. package/dist/esm/providers/icons/Euro.js +2 -3
  237. package/dist/esm/providers/icons/Gas.js +2 -4
  238. package/dist/esm/providers/icons/Help.js +2 -3
  239. package/dist/esm/providers/icons/Hide.js +2 -3
  240. package/dist/esm/providers/icons/Home.js +2 -3
  241. package/dist/esm/providers/icons/Info.js +2 -3
  242. package/dist/esm/providers/icons/Link.js +2 -4
  243. package/dist/esm/providers/icons/Logo.js +3 -4
  244. package/dist/esm/providers/icons/Minus.js +2 -3
  245. package/dist/esm/providers/icons/NewWindow.js +2 -3
  246. package/dist/esm/providers/icons/PaymentCard.js +2 -3
  247. package/dist/esm/providers/icons/Plus.js +2 -3
  248. package/dist/esm/providers/icons/Pound.js +2 -3
  249. package/dist/esm/providers/icons/Search.js +2 -3
  250. package/dist/esm/providers/icons/Show.js +2 -3
  251. package/dist/esm/providers/icons/User.js +2 -3
  252. package/dist/esm/theme/create-theme.js +0 -153
  253. package/dist/esm/utils/utils.js +7 -3
  254. package/dist/hooks/use-breakpoint.js +4 -4
  255. package/dist/providers/IconsProvider.js +3 -25
  256. package/dist/providers/icons/ArrowDown.js +2 -6
  257. package/dist/providers/icons/ArrowLeft.js +2 -6
  258. package/dist/providers/icons/ArrowRight.js +2 -6
  259. package/dist/providers/icons/ArrowUp.js +2 -6
  260. package/dist/providers/icons/CaretDown.js +2 -6
  261. package/dist/providers/icons/CaretLeft.js +2 -6
  262. package/dist/providers/icons/CaretRight.js +2 -6
  263. package/dist/providers/icons/CaretUp.js +2 -6
  264. package/dist/providers/icons/Chart.js +2 -6
  265. package/dist/providers/icons/Check.js +2 -6
  266. package/dist/providers/icons/ChevronDown.js +2 -6
  267. package/dist/providers/icons/ChevronLeft.js +2 -6
  268. package/dist/providers/icons/ChevronLeftSmall.js +2 -6
  269. package/dist/providers/icons/ChevronLeftSmallFirst.js +2 -6
  270. package/dist/providers/icons/ChevronRight.js +2 -6
  271. package/dist/providers/icons/ChevronRightSmall.js +2 -6
  272. package/dist/providers/icons/ChevronRightSmallLast.js +2 -6
  273. package/dist/providers/icons/ChevronUp.js +2 -6
  274. package/dist/providers/icons/Cross.js +2 -6
  275. package/dist/providers/icons/Dollar.js +2 -6
  276. package/dist/providers/icons/Download.js +2 -6
  277. package/dist/providers/icons/Electricity.js +2 -6
  278. package/dist/providers/icons/Euro.js +2 -6
  279. package/dist/providers/icons/Gas.js +2 -7
  280. package/dist/providers/icons/Help.js +2 -6
  281. package/dist/providers/icons/Hide.js +2 -6
  282. package/dist/providers/icons/Home.js +2 -6
  283. package/dist/providers/icons/Info.js +2 -6
  284. package/dist/providers/icons/Link.js +2 -7
  285. package/dist/providers/icons/Logo.js +2 -6
  286. package/dist/providers/icons/Minus.js +2 -6
  287. package/dist/providers/icons/NewWindow.js +2 -6
  288. package/dist/providers/icons/PaymentCard.js +2 -6
  289. package/dist/providers/icons/Plus.js +2 -6
  290. package/dist/providers/icons/Pound.js +2 -6
  291. package/dist/providers/icons/Search.js +2 -6
  292. package/dist/providers/icons/Show.js +2 -6
  293. package/dist/providers/icons/User.js +2 -6
  294. package/dist/styled.native.d.ts +270 -234
  295. package/dist/theme/create-theme.js +0 -153
  296. package/dist/theme/index.d.ts +45 -39
  297. package/dist/theme/theme.d.ts +0 -90
  298. package/dist/utils/utils.d.ts +5 -4
  299. package/dist/utils/utils.js +8 -26
  300. package/package.json +6 -5
  301. package/dist/components/Input/TelInput.d.ts +0 -10
  302. package/dist/components/Input/TelInput.js +0 -41
@@ -1,222 +1,11 @@
1
- export declare const TabList: import("styled-components").StyledComponent<({ children, setActiveTab, activeTab, tabRefs, fullWidth, inline, ...rest }: any) => JSX.Element, import("../../theme/theme").Theme & {
2
- core: {
3
- radius: Record<"small" | "medium" | "large" | "max", string>;
4
- borderWidth: Record<"small" | "medium" | "large", string>;
5
- breakpoint: Record<"small" | "medium" | "large", string | number>;
6
- mediaQuery: Record<"small" | "medium" | "large", string>;
7
- space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
8
- transition: Record<"medium" | "slow" | "fast", string>;
9
- opacity: Record<"transparent" | "translucent" | "solid", string | number>;
10
- color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
11
- lightest: string;
12
- lighter: string;
13
- light: string;
14
- base: string;
15
- dark: string;
16
- darker: string;
17
- darkest: string;
18
- }> & {
19
- brand: Record<string, string>;
20
- };
21
- fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
22
- native: string;
23
- web: string;
24
- }>;
25
- fontWeight: Record<"bold" | "book" | "black", string | number>;
26
- fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
27
- small: string | number;
28
- large: string | number;
29
- }>;
30
- lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
31
- small: string | number;
32
- large: string | number;
33
- }>;
34
- };
35
- semantic: {
36
- surface: Record<"base" | "cutout" | "elevated", string>;
37
- message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
38
- border: Record<"graphic" | "differentiated" | "functional", string>;
39
- focus: Record<"outline" | "surface", string>;
40
- inverted: Record<"surface" | "border", string> & {
41
- message: Record<"base" | "link" | "secondary" | "branded", string>;
42
- };
43
- success: {
44
- border: string;
45
- surface: string;
46
- message: {
47
- base: string;
48
- secondary: string;
49
- };
50
- };
51
- warning: {
52
- border: string;
53
- surface: string;
54
- message: {
55
- base: string;
56
- secondary: string;
57
- };
58
- };
59
- error: {
60
- border: string;
61
- surface: string;
62
- message: {
63
- base: string;
64
- secondary: string;
65
- };
66
- };
67
- info: {
68
- border: string;
69
- surface: string;
70
- message: {
71
- base: string;
72
- secondary: string;
73
- };
74
- };
75
- electricity: {
76
- border: string;
77
- surface: string;
78
- message: {
79
- base: string;
80
- secondary: string;
81
- };
82
- };
83
- gas: {
84
- border: string;
85
- surface: string;
86
- message: {
87
- base: string;
88
- secondary: string;
89
- };
90
- };
91
- };
92
- component: {
93
- heading1: {
94
- fontFamily: string;
95
- fontWeight: string | number;
96
- fontSize: {
97
- small: string | number;
98
- large: string | number;
99
- };
100
- lineHeight: {
101
- small: string | number;
102
- large: string | number;
103
- };
104
- };
105
- heading2: {
106
- fontFamily: string;
107
- fontWeight: string | number;
108
- fontSize: {
109
- small: string | number;
110
- large: string | number;
111
- };
112
- lineHeight: {
113
- small: string | number;
114
- large: string | number;
115
- };
116
- };
117
- heading3: {
118
- fontFamily: string;
119
- fontWeight: string | number;
120
- fontSize: {
121
- small: string | number;
122
- large: string | number;
123
- };
124
- lineHeight: {
125
- small: string | number;
126
- large: string | number;
127
- };
128
- };
129
- heading4: {
130
- fontFamily: string;
131
- fontWeight: string | number;
132
- fontSize: {
133
- small: string | number;
134
- large: string | number;
135
- };
136
- lineHeight: {
137
- small: string | number;
138
- large: string | number;
139
- };
140
- };
141
- lead: {
142
- fontFamily: string;
143
- fontWeight: string | number;
144
- fontSize: {
145
- small: string | number;
146
- large: string | number;
147
- };
148
- lineHeight: {
149
- small: string | number;
150
- large: string | number;
151
- };
152
- };
153
- body: {
154
- fontFamily: string;
155
- fontWeight: string | number;
156
- fontSize: {
157
- small: string | number;
158
- large: string | number;
159
- };
160
- lineHeight: {
161
- small: string | number;
162
- large: string | number;
163
- };
164
- };
165
- small: {
166
- fontFamily: string;
167
- fontWeight: string | number;
168
- fontSize: {
169
- small: string | number;
170
- large: string | number;
171
- };
172
- lineHeight: {
173
- small: string | number;
174
- large: string | number;
175
- };
176
- };
177
- label: {
178
- fontFamily: string;
179
- fontWeight: string | number;
180
- fontSize: {
181
- small: string | number;
182
- large: string | number;
183
- };
184
- lineHeight: {
185
- small: string | number;
186
- large: string | number;
187
- };
188
- };
189
- cta: {
190
- primary: {
191
- message: string;
192
- surface: string;
193
- messageHover: string;
194
- surfaceHover: string;
195
- messageFocused: string;
196
- surfaceFocused: string;
197
- outlineFocused: string;
198
- backgroundFocused: string;
199
- };
200
- secondary: {
201
- message: string;
202
- surface: string;
203
- messageHover: string;
204
- surfaceHover: string;
205
- messageFocused: string;
206
- surfaceFocused: string;
207
- outlineFocused: string;
208
- backgroundFocused: string;
209
- };
210
- destructive: {
211
- message: string;
212
- surface: string;
213
- messageHover: string;
214
- surfaceHover: string;
215
- messageFocused: string;
216
- surfaceFocused: string;
217
- outlineFocused: string;
218
- backgroundFocused: string;
219
- };
220
- };
221
- };
222
- }, {}, never>;
1
+ /// <reference types="react" />
2
+ import { ViewProps } from 'react-native';
3
+ declare type TabListProps = ViewProps & {
4
+ fullWidth?: 'always' | 'never' | 'small';
5
+ setActiveTab?: (i: number) => void;
6
+ activeTab?: number;
7
+ tabRefs?: React.RefObject<any>[];
8
+ inline?: boolean;
9
+ };
10
+ export declare const TabList: ({ children, setActiveTab, activeTab, tabRefs, fullWidth, inline, ...rest }: TabListProps) => JSX.Element;
11
+ export {};
@@ -50,25 +50,29 @@ var __rest = (this && this.__rest) || function (s, e) {
50
50
  };
51
51
  Object.defineProperty(exports, "__esModule", { value: true });
52
52
  exports.TabList = void 0;
53
- var react_1 = __importStar(require("react"));
54
- var react_native_1 = require("react-native");
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
54
+ var react_1 = require("react");
55
55
  var styled_native_1 = __importStar(require("../../styled.native"));
56
56
  var utils_1 = require("../../utils");
57
- exports.TabList = (0, styled_native_1.default)(function (_a) {
58
- var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
59
- return (react_1.default.createElement(react_native_1.View, __assign({ accessibilityRole: "tablist" }, rest), react_1.Children.map(children, function (child, i) {
60
- return (0, react_1.cloneElement)(child, {
61
- onPress: (0, utils_1.callAll)(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
62
- active: activeTab === i,
63
- fullWidth: fullWidth,
64
- ref: tabRefs[i],
65
- first: i === 0,
66
- last: react_1.Children.count(children) - 1 === i,
67
- inline: inline,
68
- });
69
- })));
70
- })(function (_a) {
71
- var card = _a.theme.card;
72
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), card.borderWidth);
57
+ var StyledTabList = styled_native_1.default.View(function (_a) {
58
+ var core = _a.theme.core;
59
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), core.borderWidth.small);
73
60
  });
61
+ var TabList = function (_a) {
62
+ var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
63
+ return ((0, jsx_runtime_1.jsx)(StyledTabList, __assign({ accessibilityRole: "tablist" }, rest, { children: react_1.Children.map(children, function (child, i) {
64
+ return child
65
+ ? (0, react_1.cloneElement)(child, {
66
+ onPress: (0, utils_1.callAll)(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
67
+ active: activeTab === i,
68
+ fullWidth: fullWidth,
69
+ ref: tabRefs === null || tabRefs === void 0 ? void 0 : tabRefs[i],
70
+ first: i === 0,
71
+ last: react_1.Children.count(children) - 1 === i,
72
+ inline: inline,
73
+ })
74
+ : null;
75
+ }) })));
76
+ };
77
+ exports.TabList = TabList;
74
78
  var templateObject_1;
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
2
6
  var __assign = (this && this.__assign) || function () {
3
7
  __assign = Object.assign || function(t) {
4
8
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -10,6 +14,29 @@ var __assign = (this && this.__assign) || function () {
10
14
  };
11
15
  return __assign.apply(this, arguments);
12
16
  };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
13
40
  var __rest = (this && this.__rest) || function (s, e) {
14
41
  var t = {};
15
42
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -21,21 +48,17 @@ var __rest = (this && this.__rest) || function (s, e) {
21
48
  }
22
49
  return t;
23
50
  };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
51
  Object.defineProperty(exports, "__esModule", { value: true });
28
52
  exports.TabPanel = void 0;
29
- var react_1 = __importDefault(require("react"));
30
- var hooks_1 = require("../../hooks");
31
- var styled_native_1 = __importDefault(require("../../styled.native"));
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
54
+ var styled_native_1 = __importStar(require("../../styled.native"));
32
55
  var StyledView = styled_native_1.default.View(function (_a) {
33
- var card = _a.theme.card, smallAndUp = _a.smallAndUp;
34
- return "\n padding: ".concat(card.padding[smallAndUp ? 1 : 0], ";\n border-top-width: ").concat(card.borderWidth, ";\n border-style: solid;\n border-color: ").concat(card.borderColor, ";\n z-index: -1;\n ");
56
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic;
57
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "], ["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "])), core.space[4], core.borderWidth.small, semantic.border.differentiated);
35
58
  });
36
59
  var TabPanel = function (_a) {
37
60
  var rest = __rest(_a, []);
38
- var breakpoints = (0, hooks_1.useBreakpoint)();
39
- return react_1.default.createElement(StyledView, __assign({}, breakpoints, rest));
61
+ return (0, jsx_runtime_1.jsx)(StyledView, __assign({}, rest));
40
62
  };
41
63
  exports.TabPanel = TabPanel;
64
+ var templateObject_1;
@@ -1,230 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { FullWidthOptions } from '../../hooks';
3
- export declare const Tabs: import("styled-components").StyledComponent<({ children, defaultSelected, onSelected, fullWidth, inline, ...rest }: {
4
- defaultSelected?: number | undefined;
5
- inline?: boolean | undefined;
3
+ declare type TabsProps = {
4
+ defaultSelected?: number;
5
+ inline?: boolean;
6
6
  children: ReactNode;
7
- onSelected?: Function | undefined;
8
- fullWidth?: FullWidthOptions | undefined;
9
- }) => JSX.Element, import("../../theme/theme").Theme & {
10
- core: {
11
- radius: Record<"small" | "medium" | "large" | "max", string>;
12
- borderWidth: Record<"small" | "medium" | "large", string>;
13
- breakpoint: Record<"small" | "medium" | "large", string | number>;
14
- mediaQuery: Record<"small" | "medium" | "large", string>;
15
- space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
16
- transition: Record<"medium" | "slow" | "fast", string>;
17
- opacity: Record<"transparent" | "translucent" | "solid", string | number>;
18
- color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
19
- lightest: string;
20
- lighter: string;
21
- light: string;
22
- base: string;
23
- dark: string;
24
- darker: string;
25
- darkest: string;
26
- }> & {
27
- brand: Record<string, string>;
28
- };
29
- fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
30
- native: string;
31
- web: string;
32
- }>;
33
- fontWeight: Record<"bold" | "book" | "black", string | number>;
34
- fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
35
- small: string | number;
36
- large: string | number;
37
- }>;
38
- lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
39
- small: string | number;
40
- large: string | number;
41
- }>;
42
- };
43
- semantic: {
44
- surface: Record<"base" | "cutout" | "elevated", string>;
45
- message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
46
- border: Record<"graphic" | "differentiated" | "functional", string>;
47
- focus: Record<"outline" | "surface", string>;
48
- inverted: Record<"surface" | "border", string> & {
49
- message: Record<"base" | "link" | "secondary" | "branded", string>;
50
- };
51
- success: {
52
- border: string;
53
- surface: string;
54
- message: {
55
- base: string;
56
- secondary: string;
57
- };
58
- };
59
- warning: {
60
- border: string;
61
- surface: string;
62
- message: {
63
- base: string;
64
- secondary: string;
65
- };
66
- };
67
- error: {
68
- border: string;
69
- surface: string;
70
- message: {
71
- base: string;
72
- secondary: string;
73
- };
74
- };
75
- info: {
76
- border: string;
77
- surface: string;
78
- message: {
79
- base: string;
80
- secondary: string;
81
- };
82
- };
83
- electricity: {
84
- border: string;
85
- surface: string;
86
- message: {
87
- base: string;
88
- secondary: string;
89
- };
90
- };
91
- gas: {
92
- border: string;
93
- surface: string;
94
- message: {
95
- base: string;
96
- secondary: string;
97
- };
98
- };
99
- };
100
- component: {
101
- heading1: {
102
- fontFamily: string;
103
- fontWeight: string | number;
104
- fontSize: {
105
- small: string | number;
106
- large: string | number;
107
- };
108
- lineHeight: {
109
- small: string | number;
110
- large: string | number;
111
- };
112
- };
113
- heading2: {
114
- fontFamily: string;
115
- fontWeight: string | number;
116
- fontSize: {
117
- small: string | number;
118
- large: string | number;
119
- };
120
- lineHeight: {
121
- small: string | number;
122
- large: string | number;
123
- };
124
- };
125
- heading3: {
126
- fontFamily: string;
127
- fontWeight: string | number;
128
- fontSize: {
129
- small: string | number;
130
- large: string | number;
131
- };
132
- lineHeight: {
133
- small: string | number;
134
- large: string | number;
135
- };
136
- };
137
- heading4: {
138
- fontFamily: string;
139
- fontWeight: string | number;
140
- fontSize: {
141
- small: string | number;
142
- large: string | number;
143
- };
144
- lineHeight: {
145
- small: string | number;
146
- large: string | number;
147
- };
148
- };
149
- lead: {
150
- fontFamily: string;
151
- fontWeight: string | number;
152
- fontSize: {
153
- small: string | number;
154
- large: string | number;
155
- };
156
- lineHeight: {
157
- small: string | number;
158
- large: string | number;
159
- };
160
- };
161
- body: {
162
- fontFamily: string;
163
- fontWeight: string | number;
164
- fontSize: {
165
- small: string | number;
166
- large: string | number;
167
- };
168
- lineHeight: {
169
- small: string | number;
170
- large: string | number;
171
- };
172
- };
173
- small: {
174
- fontFamily: string;
175
- fontWeight: string | number;
176
- fontSize: {
177
- small: string | number;
178
- large: string | number;
179
- };
180
- lineHeight: {
181
- small: string | number;
182
- large: string | number;
183
- };
184
- };
185
- label: {
186
- fontFamily: string;
187
- fontWeight: string | number;
188
- fontSize: {
189
- small: string | number;
190
- large: string | number;
191
- };
192
- lineHeight: {
193
- small: string | number;
194
- large: string | number;
195
- };
196
- };
197
- cta: {
198
- primary: {
199
- message: string;
200
- surface: string;
201
- messageHover: string;
202
- surfaceHover: string;
203
- messageFocused: string;
204
- surfaceFocused: string;
205
- outlineFocused: string;
206
- backgroundFocused: string;
207
- };
208
- secondary: {
209
- message: string;
210
- surface: string;
211
- messageHover: string;
212
- surfaceHover: string;
213
- messageFocused: string;
214
- surfaceFocused: string;
215
- outlineFocused: string;
216
- backgroundFocused: string;
217
- };
218
- destructive: {
219
- message: string;
220
- surface: string;
221
- messageHover: string;
222
- surfaceHover: string;
223
- messageFocused: string;
224
- surfaceFocused: string;
225
- outlineFocused: string;
226
- backgroundFocused: string;
227
- };
228
- };
229
- };
230
- }, {}, never>;
7
+ onSelected?: (activeTab: number) => void;
8
+ fullWidth?: FullWidthOptions;
9
+ };
10
+ export declare const Tabs: ({ children, defaultSelected, onSelected, fullWidth, inline, ...rest }: TabsProps) => JSX.Element;
11
+ export {};
@@ -50,15 +50,22 @@ var __rest = (this && this.__rest) || function (s, e) {
50
50
  };
51
51
  Object.defineProperty(exports, "__esModule", { value: true });
52
52
  exports.Tabs = void 0;
53
- var react_1 = __importStar(require("react"));
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
54
+ var react_1 = require("react");
54
55
  var styled_native_1 = __importStar(require("../../styled.native"));
55
56
  var utils_1 = require("../../utils");
56
57
  var Card_1 = require("../Card");
57
58
  var TabList_1 = require("./TabList");
58
59
  var TabPanel_1 = require("./TabPanel");
59
- exports.Tabs = (0, styled_native_1.default)(function (_a) {
60
+ var TabsCard = (0, styled_native_1.default)(Card_1.Card)(function (_a) {
61
+ var _b = _a.theme, core = _b.core, semantic = _b.semantic, inline = _a.inline;
62
+ return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n "])), core.borderWidth.small, inline ? semantic.border.differentiated : 'transparent');
63
+ });
64
+ var Tabs = function (_a) {
60
65
  var children = _a.children, _b = _a.defaultSelected, defaultSelected = _b === void 0 ? 0 : _b, onSelected = _a.onSelected, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "defaultSelected", "onSelected", "fullWidth", "inline"]);
61
66
  var _c = (0, react_1.useState)(defaultSelected), activeTab = _c[0], setActiveTab = _c[1];
67
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
68
+ // @ts-ignore there is no way to properly type it
62
69
  var tabList = (0, utils_1.filterChildrenByType)(children, TabList_1.TabList);
63
70
  var tabPanels = (0, utils_1.filterChildrenByType)(children, TabPanel_1.TabPanel);
64
71
  var tabRefs = tabPanels.map(function () { return (0, react_1.createRef)(); });
@@ -71,25 +78,21 @@ exports.Tabs = (0, styled_native_1.default)(function (_a) {
71
78
  loaded.current = true;
72
79
  }
73
80
  }, [onSelected, activeTab]);
74
- return (react_1.default.createElement(Card_1.Card, __assign({}, rest),
75
- tabList.map(function (child) {
76
- return (0, react_1.cloneElement)(child, {
77
- setActiveTab: setActiveTab,
78
- activeTab: activeTab,
79
- tabRefs: tabRefs,
80
- fullWidth: fullWidth,
81
- inline: inline,
82
- });
83
- }),
84
- tabPanels
85
- .filter(function (_, index) { return index === activeTab; })
86
- .map(function (child, index) {
87
- return (0, react_1.cloneElement)(child, {
88
- hidden: activeTab !== index,
89
- });
90
- })));
91
- })(function (_a) {
92
- var _b = _a.theme, card = _b.card, tabs = _b.tabs, inline = _a.inline;
93
- return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n "])), card.borderWidth, inline ? card.borderColor : tabs.tab.borderColor);
94
- });
81
+ return ((0, jsx_runtime_1.jsxs)(TabsCard, __assign({ inline: inline }, rest, { children: [tabList.map(function (child) {
82
+ return (0, react_1.cloneElement)(child, {
83
+ setActiveTab: setActiveTab,
84
+ activeTab: activeTab,
85
+ tabRefs: tabRefs,
86
+ fullWidth: fullWidth,
87
+ inline: inline,
88
+ });
89
+ }), tabPanels
90
+ .filter(function (_, index) { return index === activeTab; })
91
+ .map(function (child, index) {
92
+ return (0, react_1.cloneElement)(child, {
93
+ hidden: activeTab !== index,
94
+ });
95
+ })] })));
96
+ };
97
+ exports.Tabs = Tabs;
95
98
  var templateObject_1;