@jobber/components-native 0.101.7 → 0.101.8

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 (201) hide show
  1. package/dist/docs/InputDate/InputDate.md +1 -4
  2. package/dist/docs/Select/Select.md +22 -16
  3. package/dist/docs/usage-guidelines/usage-guidelines.md +9 -13
  4. package/dist/package.json +3 -3
  5. package/dist/tsconfig.build.json +8 -2
  6. package/dist/tsconfig.build.tsbuildinfo +1 -1
  7. package/dist/tsconfig.json +1 -0
  8. package/package.json +3 -3
  9. package/src/ActionItem/ActionItem.stories.tsx +16 -95
  10. package/src/ActionItem/ActionItemGroup.stories.tsx +7 -84
  11. package/src/ActionItem/docs/ActionItemActionAlignmentExample.tsx +23 -0
  12. package/src/ActionItem/docs/ActionItemBasicExample.tsx +12 -0
  13. package/src/ActionItem/docs/ActionItemGroupBasicExample.tsx +39 -0
  14. package/src/ActionItem/docs/ActionItemGroupMixedComponentsExample.tsx +52 -0
  15. package/src/ActionItem/docs/ActionItemInACardExample.tsx +27 -0
  16. package/src/ActionItem/docs/ActionItemInteractiveChildrenExample.tsx +30 -0
  17. package/src/ActionItem/docs/ActionItemMixedComponentsExample.tsx +36 -0
  18. package/src/ActionItem/docs/ActionItemNoActionExample.tsx +15 -0
  19. package/src/ActionItem/docs/ActionItemTitleOnlyExample.tsx +18 -0
  20. package/src/ActionItem/docs/index.ts +9 -0
  21. package/src/ActionLabel/ActionLabel.stories.tsx +10 -11
  22. package/src/ActionLabel/docs/ActionLabelBasicExample.tsx +15 -0
  23. package/src/ActionLabel/docs/ActionLabelColorExample.tsx +15 -0
  24. package/src/ActionLabel/docs/ActionLabelDarkBackgroundExample.tsx +25 -0
  25. package/src/ActionLabel/docs/ActionLabelDisabledExample.tsx +15 -0
  26. package/src/ActionLabel/docs/index.ts +4 -0
  27. package/src/ActivityIndicator/ActivityIndicator.stories.tsx +3 -18
  28. package/src/ActivityIndicator/docs/ActivityIndicatorBasicExample.tsx +22 -0
  29. package/src/ActivityIndicator/docs/index.ts +1 -0
  30. package/src/AtlantisThemeContext/AtlantisThemeContext.stories.tsx +7 -70
  31. package/src/AtlantisThemeContext/docs/AtlantisThemeContextBasicExample.tsx +41 -0
  32. package/src/AtlantisThemeContext/docs/AtlantisThemeContextForceThemeForProviderExample.tsx +56 -0
  33. package/src/AtlantisThemeContext/docs/index.ts +2 -0
  34. package/src/AutoLink/AutoLink.stories.tsx +3 -0
  35. package/src/AutoLink/docs/AutoLinkBasicExample.tsx +14 -0
  36. package/src/AutoLink/docs/AutoLinkSkipPhoneNumberExample.tsx +14 -0
  37. package/src/AutoLink/docs/index.ts +2 -0
  38. package/src/Banner/Banner.stories.tsx +11 -45
  39. package/src/Banner/docs/BannerActionsInBannersExample.tsx +18 -0
  40. package/src/Banner/docs/BannerBasicExample.tsx +21 -0
  41. package/src/Banner/docs/BannerErrorDetailsExample.tsx +19 -0
  42. package/src/Banner/docs/BannerErrorExample.tsx +13 -0
  43. package/src/Banner/docs/index.ts +4 -0
  44. package/src/BottomSheet/BottomSheet.stories.tsx +6 -111
  45. package/src/BottomSheet/docs/BottomSheetBasicExample.tsx +63 -0
  46. package/src/BottomSheet/docs/BottomSheetHeaderFooterExample.tsx +65 -0
  47. package/src/BottomSheet/docs/index.ts +2 -0
  48. package/src/Button/Button.stories.tsx +3 -5
  49. package/src/Button/docs/ButtonBasicExample.tsx +14 -0
  50. package/src/Button/docs/ButtonCancelExample.tsx +15 -0
  51. package/src/Button/docs/index.ts +2 -0
  52. package/src/ButtonGroup/ButtonGroup.stories.tsx +9 -64
  53. package/src/ButtonGroup/docs/ButtonGroupBasicExample.tsx +34 -0
  54. package/src/ButtonGroup/docs/ButtonGroupPrimaryExample.tsx +37 -0
  55. package/src/ButtonGroup/docs/ButtonGroupSecondaryExample.tsx +35 -0
  56. package/src/ButtonGroup/docs/index.ts +3 -0
  57. package/src/Card/Card.stories.tsx +9 -43
  58. package/src/Card/docs/CardBasicExample.tsx +20 -0
  59. package/src/Card/docs/CardElevationExample.tsx +30 -0
  60. package/src/Card/docs/CardPressableExample.tsx +34 -0
  61. package/src/Card/docs/index.ts +3 -0
  62. package/src/Checkbox/Checkbox.stories.tsx +16 -56
  63. package/src/Checkbox/docs/CheckboxBasicExample.tsx +9 -0
  64. package/src/Checkbox/docs/CheckboxControlledExample.tsx +18 -0
  65. package/src/Checkbox/docs/CheckboxGroupBasicExample.tsx +15 -0
  66. package/src/Checkbox/docs/CheckboxGroupControlledExample.tsx +32 -0
  67. package/src/Checkbox/docs/CheckboxGroupLabelledExample.tsx +15 -0
  68. package/src/Checkbox/docs/index.ts +5 -0
  69. package/src/Chip/Chip.stories.tsx +11 -62
  70. package/src/Chip/docs/ChipAccentExample.tsx +62 -0
  71. package/src/Chip/docs/ChipBasicExample.tsx +19 -0
  72. package/src/Chip/docs/ChipDismissableExample.tsx +23 -0
  73. package/src/Chip/docs/ChipInactiveBackgroundColorExample.tsx +23 -0
  74. package/src/Chip/docs/index.ts +4 -0
  75. package/src/Content/Content.stories.tsx +4 -19
  76. package/src/Content/docs/ContentHorizontal.tsx +22 -0
  77. package/src/Content/docs/ContentVertical.tsx +22 -0
  78. package/src/Content/docs/index.ts +2 -0
  79. package/src/ContentOverlay/ContentOverlay.stories.tsx +6 -52
  80. package/src/ContentOverlay/docs/ContentOverlayBasic.tsx +54 -0
  81. package/src/ContentOverlay/docs/index.ts +1 -0
  82. package/src/Disclosure/Disclosure.stories.tsx +4 -20
  83. package/src/Disclosure/docs/DisclosureBasic.tsx +23 -0
  84. package/src/Disclosure/docs/index.ts +1 -0
  85. package/src/Divider/Divider.stories.tsx +6 -50
  86. package/src/Divider/docs/DividerHorizontal.tsx +21 -0
  87. package/src/Divider/docs/DividerVertical.tsx +39 -0
  88. package/src/Divider/docs/index.ts +2 -0
  89. package/src/EmptyState/EmptyState.stories.tsx +2 -0
  90. package/src/EmptyState/docs/EmptyStateBasic.tsx +27 -0
  91. package/src/EmptyState/docs/index.ts +1 -0
  92. package/src/Flex/Flex.stories.tsx +6 -57
  93. package/src/Flex/docs/FlexMultiRow.tsx +25 -0
  94. package/src/Flex/docs/FlexNested.tsx +22 -0
  95. package/src/Flex/docs/index.ts +2 -0
  96. package/src/Form/Form.stories.tsx +6 -50
  97. package/src/Form/docs/FormBasic.tsx +63 -0
  98. package/src/Form/docs/index.ts +1 -0
  99. package/src/FormField/FormField.stories.tsx +4 -46
  100. package/src/FormField/docs/FormFieldBasic.tsx +15 -0
  101. package/src/FormField/docs/FormFieldWithValidations.tsx +38 -0
  102. package/src/FormField/docs/index.ts +2 -0
  103. package/src/FormatFile/FormatFile.stories.tsx +8 -36
  104. package/src/FormatFile/docs/FormatFileBasic.tsx +25 -0
  105. package/src/FormatFile/docs/index.ts +1 -0
  106. package/src/Glimmer/Glimmer.stories.tsx +6 -31
  107. package/src/Glimmer/docs/GlimmerBasic.tsx +9 -0
  108. package/src/Glimmer/docs/GlimmerInDepth.tsx +32 -0
  109. package/src/Glimmer/docs/index.ts +2 -0
  110. package/src/Heading/Heading.stories.tsx +5 -18
  111. package/src/Heading/docs/HeadingLevels.tsx +21 -0
  112. package/src/Heading/docs/index.ts +1 -0
  113. package/src/Icon/Icon.stories.tsx +4 -7
  114. package/src/Icon/docs/IconBasic.tsx +7 -0
  115. package/src/Icon/docs/index.ts +1 -0
  116. package/src/IconButton/IconButton.stories.tsx +2 -0
  117. package/src/IconButton/docs/IconButtonBasic.tsx +17 -0
  118. package/src/IconButton/docs/index.ts +1 -0
  119. package/src/InputCurrency/InputCurrency.stories.tsx +2 -0
  120. package/src/InputCurrency/docs/InputCurrencyBasic.tsx +9 -0
  121. package/src/InputCurrency/docs/index.ts +1 -0
  122. package/src/InputDate/InputDate.stories.tsx +10 -11
  123. package/src/InputDate/docs/InputDateBasic.tsx +9 -0
  124. package/src/InputDate/docs/InputDateEmptyValueLabel.tsx +17 -0
  125. package/src/InputDate/docs/InputDateInvalid.tsx +17 -0
  126. package/src/InputDate/docs/index.ts +3 -0
  127. package/src/InputEmail/InputEmail.stories.tsx +4 -7
  128. package/src/InputEmail/docs/InputEmailBasic.tsx +9 -0
  129. package/src/InputEmail/docs/index.ts +1 -0
  130. package/src/InputFieldWrapper/InputFieldWrapper.stories.tsx +15 -23
  131. package/src/InputFieldWrapper/docs/InputFieldWrapperBasic.tsx +15 -0
  132. package/src/InputFieldWrapper/docs/InputFieldWrapperClearable.tsx +24 -0
  133. package/src/InputFieldWrapper/docs/InputFieldWrapperDisabled.tsx +18 -0
  134. package/src/InputFieldWrapper/docs/InputFieldWrapperInvalid.tsx +18 -0
  135. package/src/InputFieldWrapper/docs/InputFieldWrapperPrefixAndSuffix.tsx +18 -0
  136. package/src/InputFieldWrapper/docs/index.ts +5 -0
  137. package/src/InputNumber/InputNumber.stories.tsx +5 -6
  138. package/src/InputNumber/docs/InputNumberBasic.tsx +7 -0
  139. package/src/InputNumber/docs/InputNumberInvalid.tsx +15 -0
  140. package/src/InputNumber/docs/index.ts +2 -0
  141. package/src/InputPassword/InputPassword.stories.tsx +4 -5
  142. package/src/InputPassword/docs/InputPasswordBasic.tsx +9 -0
  143. package/src/InputPassword/docs/index.ts +1 -0
  144. package/src/InputPressable/InputPressable.stories.tsx +14 -20
  145. package/src/InputPressable/docs/InputPressableBasic.tsx +17 -0
  146. package/src/InputPressable/docs/InputPressableClearable.tsx +23 -0
  147. package/src/InputPressable/docs/InputPressableClickableSuffix.tsx +14 -0
  148. package/src/InputPressable/docs/InputPressableDisabled.tsx +16 -0
  149. package/src/InputPressable/docs/InputPressableInvalid.tsx +16 -0
  150. package/src/InputPressable/docs/InputPressablePrefixOrSuffix.tsx +20 -0
  151. package/src/InputPressable/docs/index.ts +6 -0
  152. package/src/InputSearch/InputSearch.stories.tsx +4 -18
  153. package/src/InputSearch/docs/InputSearchBasic.tsx +20 -0
  154. package/src/InputSearch/docs/index.ts +1 -0
  155. package/src/InputText/InputText.stories.tsx +7 -29
  156. package/src/InputText/docs/InputTextBasic.tsx +7 -0
  157. package/src/InputText/docs/InputTextInvalid.tsx +14 -0
  158. package/src/InputText/docs/InputTextToolbar.tsx +31 -0
  159. package/src/InputText/docs/index.ts +3 -0
  160. package/src/InputTime/InputTime.stories.tsx +10 -72
  161. package/src/InputTime/docs/InputTimeBasic.tsx +29 -0
  162. package/src/InputTime/docs/InputTimeEmptyValue.tsx +27 -0
  163. package/src/InputTime/docs/InputTimeFormControlled.tsx +46 -0
  164. package/src/InputTime/docs/index.ts +3 -0
  165. package/src/ProgressBar/ProgressBar.stories.tsx +6 -46
  166. package/src/ProgressBar/docs/ProgressBarBasic.tsx +22 -0
  167. package/src/ProgressBar/docs/ProgressBarWithHeader.tsx +45 -0
  168. package/src/ProgressBar/docs/index.ts +2 -0
  169. package/src/Select/Select.stories.tsx +6 -18
  170. package/src/Select/docs/SelectBasic.tsx +14 -0
  171. package/src/Select/docs/SelectInitialValue.tsx +18 -0
  172. package/src/Select/docs/index.ts +2 -0
  173. package/src/StatusLabel/StatusLabel.stories.tsx +2 -0
  174. package/src/StatusLabel/docs/StatusLabelBasic.tsx +9 -0
  175. package/src/StatusLabel/docs/index.ts +1 -0
  176. package/src/Switch/Switch.stories.tsx +6 -18
  177. package/src/Switch/docs/SwitchBasic.tsx +9 -0
  178. package/src/Switch/docs/SwitchControlled.tsx +21 -0
  179. package/src/Switch/docs/index.ts +2 -0
  180. package/src/Text/Text.stories.tsx +14 -33
  181. package/src/Text/docs/TextBasic.tsx +17 -0
  182. package/src/Text/docs/TextMultiLevelNesting.tsx +14 -0
  183. package/src/Text/docs/TextNestedBold.tsx +10 -0
  184. package/src/Text/docs/TextNestedMixedStyles.tsx +11 -0
  185. package/src/Text/docs/index.ts +4 -0
  186. package/src/TextList/TextList.stories.tsx +12 -0
  187. package/src/TextList/docs/TextListBasic.tsx +9 -0
  188. package/src/TextList/docs/TextListChildSpacing.tsx +19 -0
  189. package/src/TextList/docs/TextListEmphasis.tsx +19 -0
  190. package/src/TextList/docs/TextListLevels.tsx +19 -0
  191. package/src/TextList/docs/TextListSpacing.tsx +19 -0
  192. package/src/TextList/docs/index.ts +5 -0
  193. package/src/ThumbnailList/ThumbnailList.stories.tsx +3 -61
  194. package/src/ThumbnailList/docs/ThumbnailListBasic.tsx +62 -0
  195. package/src/ThumbnailList/docs/index.ts +1 -0
  196. package/src/Toast/Toast.stories.tsx +10 -21
  197. package/src/Toast/docs/ToastBasic.tsx +23 -0
  198. package/src/Toast/docs/index.ts +1 -0
  199. package/src/Typography/Typography.stories.tsx +5 -11
  200. package/src/Typography/docs/TypographyBasic.tsx +9 -0
  201. package/src/Typography/docs/index.ts +1 -0
@@ -0,0 +1,54 @@
1
+ import React, { useRef } from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { View } from "react-native";
4
+ import { SafeAreaProvider } from "react-native-safe-area-context";
5
+ import { action } from "storybook/actions";
6
+ import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
7
+ import type { ContentOverlayRef } from "@jobber/components-native";
8
+ import {
9
+ Button,
10
+ ContentOverlay,
11
+ Heading,
12
+ Text,
13
+ } from "@jobber/components-native";
14
+
15
+ type ContentOverlayProps = ComponentProps<typeof ContentOverlay>;
16
+
17
+ export function ContentOverlayBasic(props: Partial<ContentOverlayProps>) {
18
+ const contentOverlayRef = useRef<ContentOverlayRef>(null);
19
+
20
+ const openContentOverlay = () => {
21
+ contentOverlayRef.current?.open?.();
22
+ };
23
+
24
+ const closeContentOverlay = () => {
25
+ contentOverlayRef.current?.close?.();
26
+ };
27
+
28
+ return (
29
+ <SafeAreaProvider>
30
+ <BottomSheetModalProvider>
31
+ <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
32
+ <Heading>Basic ContentOverlay</Heading>
33
+ <Text>
34
+ Note that due to the differences between React Native Web and React
35
+ Native, this does not render 100% properly
36
+ </Text>
37
+ <Button label="Open Content Overlay" onPress={openContentOverlay} />
38
+ <Button label="Close Content Overlay" onPress={closeContentOverlay} />
39
+ </View>
40
+ <ContentOverlay
41
+ ref={contentOverlayRef}
42
+ title="Content Overlay Title"
43
+ onClose={() => action("console.log")("closed content overlay")}
44
+ onOpen={() => action("console.log")("opened content overlay")}
45
+ {...props}
46
+ >
47
+ <View style={{ padding: 16 }}>
48
+ <Text>This is the content inside the overlay.</Text>
49
+ </View>
50
+ </ContentOverlay>
51
+ </BottomSheetModalProvider>
52
+ </SafeAreaProvider>
53
+ );
54
+ }
@@ -0,0 +1 @@
1
+ export { ContentOverlayBasic } from "./ContentOverlayBasic";
@@ -1,6 +1,7 @@
1
- import React, { useState } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
3
  import { Disclosure } from "@jobber/components-native";
4
+ import { DisclosureBasic } from "./docs";
4
5
 
5
6
  const meta = {
6
7
  title: "Components/Layouts and Structure/Disclosure",
@@ -12,30 +13,13 @@ const meta = {
12
13
  } satisfies Meta<typeof Disclosure>;
13
14
  export default meta;
14
15
  type DisclosureStoryArgs = Pick<
15
- React.ComponentProps<typeof Disclosure>,
16
+ ComponentProps<typeof Disclosure>,
16
17
  "header" | "content" | "isEmpty"
17
18
  >;
18
19
  type Story = StoryObj<DisclosureStoryArgs>;
19
20
 
20
- const BasicTemplate = (args: Story["args"]) => {
21
- const [open, setOpen] = useState(false);
22
-
23
- return (
24
- <Disclosure
25
- header={args?.header ?? "Advanced Instructions"}
26
- content={
27
- args?.content ??
28
- "For every 2 team members you add, your profits will triple."
29
- }
30
- isEmpty={args?.isEmpty ?? false}
31
- open={open}
32
- onToggle={() => setOpen(!open)}
33
- />
34
- );
35
- };
36
-
37
21
  export const Basic: Story = {
38
- render: BasicTemplate,
22
+ render: DisclosureBasic,
39
23
  args: {
40
24
  header: "Advanced Instructions",
41
25
  content: "For every 2 team members you add, your profits will triple.",
@@ -0,0 +1,23 @@
1
+ import React, { useState } from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Disclosure } from "@jobber/components-native";
4
+
5
+ type DisclosureProps = ComponentProps<typeof Disclosure>;
6
+
7
+ export function DisclosureBasic(props: Partial<DisclosureProps>) {
8
+ const [open, setOpen] = useState(false);
9
+
10
+ return (
11
+ <Disclosure
12
+ header={props.header ?? "Advanced Instructions"}
13
+ content={
14
+ props.content ??
15
+ "For every 2 team members you add, your profits will triple."
16
+ }
17
+ isEmpty={props.isEmpty ?? false}
18
+ {...props}
19
+ open={open}
20
+ onToggle={() => setOpen(!open)}
21
+ />
22
+ );
23
+ }
@@ -0,0 +1 @@
1
+ export { DisclosureBasic } from "./DisclosureBasic";
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
4
- import { Content, Divider, Heading, Text } from "@jobber/components-native";
2
+ import type { ComponentProps } from "react";
3
+ import { Divider } from "@jobber/components-native";
4
+ import { DividerHorizontal, DividerVertical } from "./docs";
5
5
 
6
6
  const meta = {
7
7
  title: "Components/Layouts and Structure/Divider",
@@ -11,54 +11,10 @@ const meta = {
11
11
  },
12
12
  } satisfies Meta<typeof Divider>;
13
13
  export default meta;
14
- type Story = StoryObj<Partial<React.ComponentProps<typeof Divider>>>;
15
-
16
- const HorizontalTemplate = (args: Story["args"]) => (
17
- <View
18
- style={{
19
- display: "flex",
20
- gap: 16,
21
- }}
22
- >
23
- <Content>Some amazing content</Content>
24
- <Divider {...args} />
25
- <Content>Even more amazing content</Content>
26
- </View>
27
- );
28
-
29
- const VerticalTemplate = (args: Story["args"]) => (
30
- <View>
31
- <View style={{ marginBottom: 16 }}>
32
- <Heading>Summary</Heading>
33
- </View>
34
- <View
35
- style={{
36
- display: "flex",
37
- flexDirection: "row",
38
- height: 40,
39
- gap: 16,
40
- }}
41
- >
42
- <Content spacing="small">
43
- <Heading level="subHeading">Today</Heading>
44
- <Text>{"\n"}$104.13</Text>
45
- </Content>
46
- <Divider {...args} direction="vertical" />
47
- <Content spacing="small">
48
- <Heading level="subHeading">Tomorrow</Heading>
49
- <Text>{"\n"}$262.42</Text>
50
- </Content>
51
- <Divider {...args} direction="vertical" />
52
- <Content spacing="small">
53
- <Heading level="subHeading">Next Week</Heading>
54
- <Text>{"\n"}$123.23</Text>
55
- </Content>
56
- </View>
57
- </View>
58
- );
14
+ type Story = StoryObj<Partial<ComponentProps<typeof Divider>>>;
59
15
 
60
16
  export const Horizontal: Story = {
61
- render: HorizontalTemplate,
17
+ render: DividerHorizontal,
62
18
  args: {
63
19
  size: "base",
64
20
  direction: "horizontal",
@@ -66,7 +22,7 @@ export const Horizontal: Story = {
66
22
  };
67
23
 
68
24
  export const Vertical: Story = {
69
- render: VerticalTemplate,
25
+ render: DividerVertical,
70
26
  args: {
71
27
  size: "base",
72
28
  direction: "vertical",
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { View } from "react-native";
4
+ import { Content, Divider } from "@jobber/components-native";
5
+
6
+ type DividerProps = ComponentProps<typeof Divider>;
7
+
8
+ export function DividerHorizontal(props: Partial<DividerProps>) {
9
+ return (
10
+ <View
11
+ style={{
12
+ display: "flex",
13
+ gap: 16,
14
+ }}
15
+ >
16
+ <Content>Some amazing content</Content>
17
+ <Divider size="base" direction="horizontal" {...props} />
18
+ <Content>Even more amazing content</Content>
19
+ </View>
20
+ );
21
+ }
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { View } from "react-native";
4
+ import { Content, Divider, Heading, Text } from "@jobber/components-native";
5
+
6
+ type DividerProps = ComponentProps<typeof Divider>;
7
+
8
+ export function DividerVertical(props: Partial<DividerProps>) {
9
+ return (
10
+ <View>
11
+ <View style={{ marginBottom: 16 }}>
12
+ <Heading>Summary</Heading>
13
+ </View>
14
+ <View
15
+ style={{
16
+ display: "flex",
17
+ flexDirection: "row",
18
+ height: 40,
19
+ gap: 16,
20
+ }}
21
+ >
22
+ <Content spacing="small">
23
+ <Heading level="subHeading">Today</Heading>
24
+ <Text>{"\n"}$104.13</Text>
25
+ </Content>
26
+ <Divider size="base" direction="vertical" {...props} />
27
+ <Content spacing="small">
28
+ <Heading level="subHeading">Tomorrow</Heading>
29
+ <Text>{"\n"}$262.42</Text>
30
+ </Content>
31
+ <Divider size="base" direction="vertical" {...props} />
32
+ <Content spacing="small">
33
+ <Heading level="subHeading">Next Week</Heading>
34
+ <Text>{"\n"}$123.23</Text>
35
+ </Content>
36
+ </View>
37
+ </View>
38
+ );
39
+ }
@@ -0,0 +1,2 @@
1
+ export { DividerHorizontal } from "./DividerHorizontal";
2
+ export { DividerVertical } from "./DividerVertical";
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
2
2
  import { action } from "storybook/actions";
3
3
  import { EmptyState } from "@jobber/components-native";
4
+ import { EmptyStateBasic } from "./docs";
4
5
 
5
6
  const meta = {
6
7
  title: "Components/Status and Feedback/EmptyState",
@@ -13,6 +14,7 @@ export default meta;
13
14
  type Story = StoryObj<typeof meta>;
14
15
 
15
16
  export const Basic: Story = {
17
+ render: EmptyStateBasic,
16
18
  args: {
17
19
  icon: "home",
18
20
  title: "Title",
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { action } from "storybook/actions";
3
+ import { EmptyState } from "@jobber/components-native";
4
+ import type { EmptyStateProps } from "@jobber/components-native";
5
+
6
+ export function EmptyStateBasic(props: Partial<EmptyStateProps>) {
7
+ return (
8
+ <EmptyState
9
+ icon="home"
10
+ title="Title"
11
+ description="Description"
12
+ primaryAction={{
13
+ label: "Click Me",
14
+ onPress: () => {
15
+ action("alert")("👋");
16
+ },
17
+ }}
18
+ secondaryAction={{
19
+ label: "Don't Forget About Me",
20
+ onPress: () => {
21
+ action("alert")("👋");
22
+ },
23
+ }}
24
+ {...props}
25
+ />
26
+ );
27
+ }
@@ -0,0 +1 @@
1
+ export { EmptyStateBasic } from "./EmptyStateBasic";
@@ -1,14 +1,7 @@
1
- import React from "react";
2
- import { View } from "react-native";
1
+ import type { ComponentProps } from "react";
3
2
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
4
- import {
5
- Card,
6
- Content,
7
- Flex,
8
- Icon,
9
- StatusLabel,
10
- Text,
11
- } from "@jobber/components-native";
3
+ import { Flex } from "@jobber/components-native";
4
+ import { FlexMultiRow, FlexNested } from "./docs";
12
5
 
13
6
  const meta = {
14
7
  title: "Components/Layouts and Structure/Flex",
@@ -22,57 +15,13 @@ const meta = {
22
15
  } satisfies Meta<typeof Flex>;
23
16
  export default meta;
24
17
  type FlexStoryArgs = Pick<
25
- React.ComponentProps<typeof Flex>,
18
+ ComponentProps<typeof Flex>,
26
19
  "template" | "align" | "gap"
27
20
  >;
28
21
  type Story = StoryObj<FlexStoryArgs>;
29
22
 
30
- const NestedTemplate = (args: Story["args"]) => (
31
- <Flex
32
- template={args?.template ?? ["grow", "shrink"]}
33
- align={args?.align}
34
- gap={args?.gap}
35
- >
36
- <Flex align={"flex-start"} template={["shrink", "grow"]}>
37
- <Icon name="quote" />
38
- <View>
39
- <Flex template={["grow", "shrink"]}>
40
- <Text emphasis="strong">Dylan Tec</Text>
41
- <StatusLabel text="Success" status="success" />
42
- </Flex>
43
- <Text>Sep 03 | $100 | Quote #93</Text>
44
- </View>
45
- </Flex>
46
- <Icon name="arrowRight" />
47
- </Flex>
48
- );
49
-
50
- const MultiRowTemplate = (args: Story["args"]) => (
51
- <Flex
52
- template={args?.template ?? ["grow", "grow"]}
53
- align={args?.align}
54
- gap={args?.gap}
55
- >
56
- {[
57
- "Cash",
58
- "Cheque",
59
- "Credit card",
60
- "Bank transfer",
61
- "Money order",
62
- "Pigeon Mail",
63
- "Other",
64
- ].map(name => (
65
- <Card key={name}>
66
- <Content>
67
- <Text emphasis="strong">{name}</Text>
68
- </Content>
69
- </Card>
70
- ))}
71
- </Flex>
72
- );
73
-
74
23
  export const Nested: Story = {
75
- render: NestedTemplate,
24
+ render: FlexNested,
76
25
  args: {
77
26
  template: ["grow", "shrink"],
78
27
  align: "center",
@@ -80,7 +29,7 @@ export const Nested: Story = {
80
29
  };
81
30
 
82
31
  export const MultiRow: Story = {
83
- render: MultiRowTemplate,
32
+ render: FlexMultiRow,
84
33
  args: {
85
34
  template: ["grow", "grow"],
86
35
  gap: "small",
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { Card, Content, Flex, Text } from "@jobber/components-native";
3
+ import type { FlexProps } from "@jobber/components-native";
4
+
5
+ export function FlexMultiRow(props: Partial<FlexProps>) {
6
+ return (
7
+ <Flex template={["grow", "grow"]} gap="small" {...props}>
8
+ {[
9
+ "Cash",
10
+ "Cheque",
11
+ "Credit card",
12
+ "Bank transfer",
13
+ "Money order",
14
+ "Pigeon Mail",
15
+ "Other",
16
+ ].map(name => (
17
+ <Card key={name}>
18
+ <Content>
19
+ <Text emphasis="strong">{name}</Text>
20
+ </Content>
21
+ </Card>
22
+ ))}
23
+ </Flex>
24
+ );
25
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { Flex, Icon, StatusLabel, Text } from "@jobber/components-native";
4
+ import type { FlexProps } from "@jobber/components-native";
5
+
6
+ export function FlexNested(props: Partial<FlexProps>) {
7
+ return (
8
+ <Flex template={["grow", "shrink"]} align="center" {...props}>
9
+ <Flex align={"flex-start"} template={["shrink", "grow"]}>
10
+ <Icon name="quote" />
11
+ <View>
12
+ <Flex template={["grow", "shrink"]}>
13
+ <Text emphasis="strong">Dylan Tec</Text>
14
+ <StatusLabel text="Success" status="success" />
15
+ </Flex>
16
+ <Text>Sep 03 | $100 | Quote #93</Text>
17
+ </View>
18
+ </Flex>
19
+ <Icon name="arrowRight" />
20
+ </Flex>
21
+ );
22
+ }
@@ -0,0 +1,2 @@
1
+ export { FlexNested } from "./FlexNested";
2
+ export { FlexMultiRow } from "./FlexMultiRow";
@@ -1,13 +1,8 @@
1
- import React from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
- import { SafeAreaProvider } from "react-native-safe-area-context";
4
3
  import { action } from "storybook/actions";
5
- import {
6
- AtlantisOverlayProvider,
7
- Content,
8
- Form,
9
- InputText,
10
- } from "@jobber/components-native";
4
+ import { Form } from "@jobber/components-native";
5
+ import { FormBasic } from "./docs";
11
6
 
12
7
  const meta = {
13
8
  title: "Components/Forms and Inputs/Form",
@@ -25,51 +20,12 @@ interface NativeFormStoryArgs {
25
20
  lastName: string;
26
21
  nickName: string;
27
22
  };
28
- secondaryActions?: React.ComponentProps<typeof Form>["secondaryActions"];
23
+ secondaryActions?: ComponentProps<typeof Form>["secondaryActions"];
29
24
  }
30
25
  type Story = StoryObj<NativeFormStoryArgs>;
31
26
 
32
- const BasicTemplate = (args: Story["args"]) => (
33
- <SafeAreaProvider>
34
- <AtlantisOverlayProvider>
35
- <Form
36
- initialValues={args?.initialValues}
37
- secondaryActions={args?.secondaryActions}
38
- onSubmit={value =>
39
- new Promise(resolve => {
40
- setTimeout(
41
- () => resolve(action("alert")(JSON.stringify(value, undefined))),
42
- 1000,
43
- );
44
- })
45
- }
46
- onSubmitError={() => undefined}
47
- onSubmitSuccess={() => undefined}
48
- >
49
- <Content>
50
- <InputText
51
- name="firstName"
52
- placeholder="First name"
53
- validations={{ required: "Please add a first name" }}
54
- />
55
- <InputText
56
- name="lastName"
57
- placeholder="Last name"
58
- validations={{ required: "Please add a last name" }}
59
- />
60
- <InputText
61
- name="nickName"
62
- placeholder="Nick name"
63
- validations={{ required: "Please add a nick name" }}
64
- />
65
- </Content>
66
- </Form>
67
- </AtlantisOverlayProvider>
68
- </SafeAreaProvider>
69
- );
70
-
71
27
  export const Basic: Story = {
72
- render: BasicTemplate,
28
+ render: FormBasic,
73
29
  args: {
74
30
  initialValues: {
75
31
  firstName: "Greatest",
@@ -80,7 +36,7 @@ export const Basic: Story = {
80
36
  };
81
37
 
82
38
  export const WithSecondaryActions: Story = {
83
- render: BasicTemplate,
39
+ render: FormBasic,
84
40
  args: {
85
41
  initialValues: {
86
42
  firstName: "Test",
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { SafeAreaProvider } from "react-native-safe-area-context";
3
+ import { action } from "storybook/actions";
4
+ import {
5
+ AtlantisOverlayProvider,
6
+ Content,
7
+ Form,
8
+ InputText,
9
+ } from "@jobber/components-native";
10
+ import type { FormProps } from "@jobber/components-native";
11
+
12
+ type FormStoryArgs = Pick<
13
+ FormProps<{ firstName: string; lastName: string; nickName: string }, unknown>,
14
+ "initialValues" | "secondaryActions"
15
+ >;
16
+
17
+ export function FormBasic(props: Partial<FormStoryArgs>) {
18
+ return (
19
+ <SafeAreaProvider>
20
+ <AtlantisOverlayProvider>
21
+ <Form
22
+ initialValues={
23
+ props.initialValues ?? {
24
+ firstName: "Greatest",
25
+ lastName: "Ever",
26
+ nickName: "",
27
+ }
28
+ }
29
+ secondaryActions={props.secondaryActions}
30
+ onSubmit={value =>
31
+ new Promise(resolve => {
32
+ setTimeout(
33
+ () =>
34
+ resolve(action("alert")(JSON.stringify(value, undefined))),
35
+ 1000,
36
+ );
37
+ })
38
+ }
39
+ onSubmitError={() => undefined}
40
+ onSubmitSuccess={() => undefined}
41
+ >
42
+ <Content>
43
+ <InputText
44
+ name="firstName"
45
+ placeholder="First name"
46
+ validations={{ required: "Please add a first name" }}
47
+ />
48
+ <InputText
49
+ name="lastName"
50
+ placeholder="Last name"
51
+ validations={{ required: "Please add a last name" }}
52
+ />
53
+ <InputText
54
+ name="nickName"
55
+ placeholder="Nick name"
56
+ validations={{ required: "Please add a nick name" }}
57
+ />
58
+ </Content>
59
+ </Form>
60
+ </AtlantisOverlayProvider>
61
+ </SafeAreaProvider>
62
+ );
63
+ }
@@ -0,0 +1 @@
1
+ export { FormBasic } from "./FormBasic";
@@ -1,7 +1,6 @@
1
- import React from "react";
2
- import { FormProvider, useForm } from "react-hook-form";
3
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
4
- import { FormField, InputText, Text } from "@jobber/components-native";
2
+ import { FormField } from "@jobber/components-native";
3
+ import { FormFieldBasic, FormFieldWithValidations } from "./docs";
5
4
 
6
5
  const meta = {
7
6
  title: "Components/Private/FormField",
@@ -17,56 +16,15 @@ interface NativeFormFieldStoryArgs {
17
16
  }
18
17
  type Story = StoryObj<NativeFormFieldStoryArgs>;
19
18
 
20
- const BasicTemplate = (args: Story["args"]) => {
21
- return (
22
- <FormField name={args?.name ?? "name"}>
23
- {field => {
24
- return <InputText value={field.value} placeholder="Enter name here" />;
25
- }}
26
- </FormField>
27
- );
28
- };
29
-
30
- const WithValidationsTemplate = (args: Story["args"]) => {
31
- const methods = useForm({ mode: "onChange" });
32
-
33
- return (
34
- <FormProvider {...methods}>
35
- <FormField
36
- name={args?.name ?? "validations"}
37
- validations={{
38
- maxLength: {
39
- value: 5,
40
- message: "Should not exceed 5 characters",
41
- },
42
- }}
43
- >
44
- {(field, error) => {
45
- return (
46
- <>
47
- {error && <Text variation="error">{error.message}</Text>}
48
- <InputText
49
- value={field.value}
50
- placeholder="Should not exceed 5 characters"
51
- onChangeText={field.onChange}
52
- />
53
- </>
54
- );
55
- }}
56
- </FormField>
57
- </FormProvider>
58
- );
59
- };
60
-
61
19
  export const Basic: Story = {
62
- render: BasicTemplate,
20
+ render: FormFieldBasic,
63
21
  args: {
64
22
  name: "name",
65
23
  },
66
24
  };
67
25
 
68
26
  export const WithValidations: Story = {
69
- render: WithValidationsTemplate,
27
+ render: FormFieldWithValidations,
70
28
  args: {
71
29
  name: "validations",
72
30
  },