@jobber/components-native 0.101.6 → 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 (204) hide show
  1. package/dist/docs/Icon/Icon.md +1 -0
  2. package/dist/docs/InputDate/InputDate.md +1 -4
  3. package/dist/docs/InputPressable/InputPressable.md +1 -1
  4. package/dist/docs/Select/Select.md +22 -16
  5. package/dist/docs/usage-guidelines/usage-guidelines.md +9 -14
  6. package/dist/package.json +4 -4
  7. package/dist/tsconfig.build.json +8 -2
  8. package/dist/tsconfig.build.tsbuildinfo +1 -1
  9. package/dist/tsconfig.json +1 -0
  10. package/dist/types/src/ContentOverlay/BottomSheetKeyboardAwareScrollView.d.ts +1 -2
  11. package/package.json +4 -4
  12. package/src/ActionItem/ActionItem.stories.tsx +16 -95
  13. package/src/ActionItem/ActionItemGroup.stories.tsx +7 -84
  14. package/src/ActionItem/docs/ActionItemActionAlignmentExample.tsx +23 -0
  15. package/src/ActionItem/docs/ActionItemBasicExample.tsx +12 -0
  16. package/src/ActionItem/docs/ActionItemGroupBasicExample.tsx +39 -0
  17. package/src/ActionItem/docs/ActionItemGroupMixedComponentsExample.tsx +52 -0
  18. package/src/ActionItem/docs/ActionItemInACardExample.tsx +27 -0
  19. package/src/ActionItem/docs/ActionItemInteractiveChildrenExample.tsx +30 -0
  20. package/src/ActionItem/docs/ActionItemMixedComponentsExample.tsx +36 -0
  21. package/src/ActionItem/docs/ActionItemNoActionExample.tsx +15 -0
  22. package/src/ActionItem/docs/ActionItemTitleOnlyExample.tsx +18 -0
  23. package/src/ActionItem/docs/index.ts +9 -0
  24. package/src/ActionLabel/ActionLabel.stories.tsx +10 -11
  25. package/src/ActionLabel/docs/ActionLabelBasicExample.tsx +15 -0
  26. package/src/ActionLabel/docs/ActionLabelColorExample.tsx +15 -0
  27. package/src/ActionLabel/docs/ActionLabelDarkBackgroundExample.tsx +25 -0
  28. package/src/ActionLabel/docs/ActionLabelDisabledExample.tsx +15 -0
  29. package/src/ActionLabel/docs/index.ts +4 -0
  30. package/src/ActivityIndicator/ActivityIndicator.stories.tsx +3 -18
  31. package/src/ActivityIndicator/docs/ActivityIndicatorBasicExample.tsx +22 -0
  32. package/src/ActivityIndicator/docs/index.ts +1 -0
  33. package/src/AtlantisThemeContext/AtlantisThemeContext.stories.tsx +7 -70
  34. package/src/AtlantisThemeContext/docs/AtlantisThemeContextBasicExample.tsx +41 -0
  35. package/src/AtlantisThemeContext/docs/AtlantisThemeContextForceThemeForProviderExample.tsx +56 -0
  36. package/src/AtlantisThemeContext/docs/index.ts +2 -0
  37. package/src/AutoLink/AutoLink.stories.tsx +3 -0
  38. package/src/AutoLink/docs/AutoLinkBasicExample.tsx +14 -0
  39. package/src/AutoLink/docs/AutoLinkSkipPhoneNumberExample.tsx +14 -0
  40. package/src/AutoLink/docs/index.ts +2 -0
  41. package/src/Banner/Banner.stories.tsx +11 -45
  42. package/src/Banner/docs/BannerActionsInBannersExample.tsx +18 -0
  43. package/src/Banner/docs/BannerBasicExample.tsx +21 -0
  44. package/src/Banner/docs/BannerErrorDetailsExample.tsx +19 -0
  45. package/src/Banner/docs/BannerErrorExample.tsx +13 -0
  46. package/src/Banner/docs/index.ts +4 -0
  47. package/src/BottomSheet/BottomSheet.stories.tsx +6 -111
  48. package/src/BottomSheet/docs/BottomSheetBasicExample.tsx +63 -0
  49. package/src/BottomSheet/docs/BottomSheetHeaderFooterExample.tsx +65 -0
  50. package/src/BottomSheet/docs/index.ts +2 -0
  51. package/src/Button/Button.stories.tsx +3 -5
  52. package/src/Button/docs/ButtonBasicExample.tsx +14 -0
  53. package/src/Button/docs/ButtonCancelExample.tsx +15 -0
  54. package/src/Button/docs/index.ts +2 -0
  55. package/src/ButtonGroup/ButtonGroup.stories.tsx +9 -64
  56. package/src/ButtonGroup/docs/ButtonGroupBasicExample.tsx +34 -0
  57. package/src/ButtonGroup/docs/ButtonGroupPrimaryExample.tsx +37 -0
  58. package/src/ButtonGroup/docs/ButtonGroupSecondaryExample.tsx +35 -0
  59. package/src/ButtonGroup/docs/index.ts +3 -0
  60. package/src/Card/Card.stories.tsx +9 -43
  61. package/src/Card/docs/CardBasicExample.tsx +20 -0
  62. package/src/Card/docs/CardElevationExample.tsx +30 -0
  63. package/src/Card/docs/CardPressableExample.tsx +34 -0
  64. package/src/Card/docs/index.ts +3 -0
  65. package/src/Checkbox/Checkbox.stories.tsx +16 -56
  66. package/src/Checkbox/docs/CheckboxBasicExample.tsx +9 -0
  67. package/src/Checkbox/docs/CheckboxControlledExample.tsx +18 -0
  68. package/src/Checkbox/docs/CheckboxGroupBasicExample.tsx +15 -0
  69. package/src/Checkbox/docs/CheckboxGroupControlledExample.tsx +32 -0
  70. package/src/Checkbox/docs/CheckboxGroupLabelledExample.tsx +15 -0
  71. package/src/Checkbox/docs/index.ts +5 -0
  72. package/src/Chip/Chip.stories.tsx +11 -62
  73. package/src/Chip/docs/ChipAccentExample.tsx +62 -0
  74. package/src/Chip/docs/ChipBasicExample.tsx +19 -0
  75. package/src/Chip/docs/ChipDismissableExample.tsx +23 -0
  76. package/src/Chip/docs/ChipInactiveBackgroundColorExample.tsx +23 -0
  77. package/src/Chip/docs/index.ts +4 -0
  78. package/src/Content/Content.stories.tsx +4 -19
  79. package/src/Content/docs/ContentHorizontal.tsx +22 -0
  80. package/src/Content/docs/ContentVertical.tsx +22 -0
  81. package/src/Content/docs/index.ts +2 -0
  82. package/src/ContentOverlay/ContentOverlay.stories.tsx +6 -52
  83. package/src/ContentOverlay/docs/ContentOverlayBasic.tsx +54 -0
  84. package/src/ContentOverlay/docs/index.ts +1 -0
  85. package/src/Disclosure/Disclosure.stories.tsx +4 -20
  86. package/src/Disclosure/docs/DisclosureBasic.tsx +23 -0
  87. package/src/Disclosure/docs/index.ts +1 -0
  88. package/src/Divider/Divider.stories.tsx +6 -50
  89. package/src/Divider/docs/DividerHorizontal.tsx +21 -0
  90. package/src/Divider/docs/DividerVertical.tsx +39 -0
  91. package/src/Divider/docs/index.ts +2 -0
  92. package/src/EmptyState/EmptyState.stories.tsx +2 -0
  93. package/src/EmptyState/docs/EmptyStateBasic.tsx +27 -0
  94. package/src/EmptyState/docs/index.ts +1 -0
  95. package/src/Flex/Flex.stories.tsx +6 -57
  96. package/src/Flex/docs/FlexMultiRow.tsx +25 -0
  97. package/src/Flex/docs/FlexNested.tsx +22 -0
  98. package/src/Flex/docs/index.ts +2 -0
  99. package/src/Form/Form.stories.tsx +6 -50
  100. package/src/Form/docs/FormBasic.tsx +63 -0
  101. package/src/Form/docs/index.ts +1 -0
  102. package/src/FormField/FormField.stories.tsx +4 -46
  103. package/src/FormField/docs/FormFieldBasic.tsx +15 -0
  104. package/src/FormField/docs/FormFieldWithValidations.tsx +38 -0
  105. package/src/FormField/docs/index.ts +2 -0
  106. package/src/FormatFile/FormatFile.stories.tsx +8 -36
  107. package/src/FormatFile/docs/FormatFileBasic.tsx +25 -0
  108. package/src/FormatFile/docs/index.ts +1 -0
  109. package/src/Glimmer/Glimmer.stories.tsx +6 -31
  110. package/src/Glimmer/docs/GlimmerBasic.tsx +9 -0
  111. package/src/Glimmer/docs/GlimmerInDepth.tsx +32 -0
  112. package/src/Glimmer/docs/index.ts +2 -0
  113. package/src/Heading/Heading.stories.tsx +5 -18
  114. package/src/Heading/docs/HeadingLevels.tsx +21 -0
  115. package/src/Heading/docs/index.ts +1 -0
  116. package/src/Icon/Icon.stories.tsx +4 -7
  117. package/src/Icon/docs/IconBasic.tsx +7 -0
  118. package/src/Icon/docs/index.ts +1 -0
  119. package/src/IconButton/IconButton.stories.tsx +2 -0
  120. package/src/IconButton/docs/IconButtonBasic.tsx +17 -0
  121. package/src/IconButton/docs/index.ts +1 -0
  122. package/src/InputCurrency/InputCurrency.stories.tsx +2 -0
  123. package/src/InputCurrency/docs/InputCurrencyBasic.tsx +9 -0
  124. package/src/InputCurrency/docs/index.ts +1 -0
  125. package/src/InputDate/InputDate.stories.tsx +10 -11
  126. package/src/InputDate/docs/InputDateBasic.tsx +9 -0
  127. package/src/InputDate/docs/InputDateEmptyValueLabel.tsx +17 -0
  128. package/src/InputDate/docs/InputDateInvalid.tsx +17 -0
  129. package/src/InputDate/docs/index.ts +3 -0
  130. package/src/InputEmail/InputEmail.stories.tsx +4 -7
  131. package/src/InputEmail/docs/InputEmailBasic.tsx +9 -0
  132. package/src/InputEmail/docs/index.ts +1 -0
  133. package/src/InputFieldWrapper/InputFieldWrapper.stories.tsx +15 -23
  134. package/src/InputFieldWrapper/docs/InputFieldWrapperBasic.tsx +15 -0
  135. package/src/InputFieldWrapper/docs/InputFieldWrapperClearable.tsx +24 -0
  136. package/src/InputFieldWrapper/docs/InputFieldWrapperDisabled.tsx +18 -0
  137. package/src/InputFieldWrapper/docs/InputFieldWrapperInvalid.tsx +18 -0
  138. package/src/InputFieldWrapper/docs/InputFieldWrapperPrefixAndSuffix.tsx +18 -0
  139. package/src/InputFieldWrapper/docs/index.ts +5 -0
  140. package/src/InputNumber/InputNumber.stories.tsx +5 -6
  141. package/src/InputNumber/docs/InputNumberBasic.tsx +7 -0
  142. package/src/InputNumber/docs/InputNumberInvalid.tsx +15 -0
  143. package/src/InputNumber/docs/index.ts +2 -0
  144. package/src/InputPassword/InputPassword.stories.tsx +4 -5
  145. package/src/InputPassword/docs/InputPasswordBasic.tsx +9 -0
  146. package/src/InputPassword/docs/index.ts +1 -0
  147. package/src/InputPressable/InputPressable.stories.tsx +14 -20
  148. package/src/InputPressable/docs/InputPressableBasic.tsx +17 -0
  149. package/src/InputPressable/docs/InputPressableClearable.tsx +23 -0
  150. package/src/InputPressable/docs/InputPressableClickableSuffix.tsx +14 -0
  151. package/src/InputPressable/docs/InputPressableDisabled.tsx +16 -0
  152. package/src/InputPressable/docs/InputPressableInvalid.tsx +16 -0
  153. package/src/InputPressable/docs/InputPressablePrefixOrSuffix.tsx +20 -0
  154. package/src/InputPressable/docs/index.ts +6 -0
  155. package/src/InputSearch/InputSearch.stories.tsx +4 -18
  156. package/src/InputSearch/docs/InputSearchBasic.tsx +20 -0
  157. package/src/InputSearch/docs/index.ts +1 -0
  158. package/src/InputText/InputText.stories.tsx +7 -29
  159. package/src/InputText/docs/InputTextBasic.tsx +7 -0
  160. package/src/InputText/docs/InputTextInvalid.tsx +14 -0
  161. package/src/InputText/docs/InputTextToolbar.tsx +31 -0
  162. package/src/InputText/docs/index.ts +3 -0
  163. package/src/InputTime/InputTime.stories.tsx +10 -72
  164. package/src/InputTime/docs/InputTimeBasic.tsx +29 -0
  165. package/src/InputTime/docs/InputTimeEmptyValue.tsx +27 -0
  166. package/src/InputTime/docs/InputTimeFormControlled.tsx +46 -0
  167. package/src/InputTime/docs/index.ts +3 -0
  168. package/src/ProgressBar/ProgressBar.stories.tsx +6 -46
  169. package/src/ProgressBar/docs/ProgressBarBasic.tsx +22 -0
  170. package/src/ProgressBar/docs/ProgressBarWithHeader.tsx +45 -0
  171. package/src/ProgressBar/docs/index.ts +2 -0
  172. package/src/Select/Select.stories.tsx +6 -18
  173. package/src/Select/docs/SelectBasic.tsx +14 -0
  174. package/src/Select/docs/SelectInitialValue.tsx +18 -0
  175. package/src/Select/docs/index.ts +2 -0
  176. package/src/StatusLabel/StatusLabel.stories.tsx +2 -0
  177. package/src/StatusLabel/docs/StatusLabelBasic.tsx +9 -0
  178. package/src/StatusLabel/docs/index.ts +1 -0
  179. package/src/Switch/Switch.stories.tsx +6 -18
  180. package/src/Switch/docs/SwitchBasic.tsx +9 -0
  181. package/src/Switch/docs/SwitchControlled.tsx +21 -0
  182. package/src/Switch/docs/index.ts +2 -0
  183. package/src/Text/Text.stories.tsx +14 -33
  184. package/src/Text/docs/TextBasic.tsx +17 -0
  185. package/src/Text/docs/TextMultiLevelNesting.tsx +14 -0
  186. package/src/Text/docs/TextNestedBold.tsx +10 -0
  187. package/src/Text/docs/TextNestedMixedStyles.tsx +11 -0
  188. package/src/Text/docs/index.ts +4 -0
  189. package/src/TextList/TextList.stories.tsx +12 -0
  190. package/src/TextList/docs/TextListBasic.tsx +9 -0
  191. package/src/TextList/docs/TextListChildSpacing.tsx +19 -0
  192. package/src/TextList/docs/TextListEmphasis.tsx +19 -0
  193. package/src/TextList/docs/TextListLevels.tsx +19 -0
  194. package/src/TextList/docs/TextListSpacing.tsx +19 -0
  195. package/src/TextList/docs/index.ts +5 -0
  196. package/src/ThumbnailList/ThumbnailList.stories.tsx +3 -61
  197. package/src/ThumbnailList/docs/ThumbnailListBasic.tsx +62 -0
  198. package/src/ThumbnailList/docs/index.ts +1 -0
  199. package/src/Toast/Toast.stories.tsx +10 -21
  200. package/src/Toast/docs/ToastBasic.tsx +23 -0
  201. package/src/Toast/docs/index.ts +1 -0
  202. package/src/Typography/Typography.stories.tsx +5 -11
  203. package/src/Typography/docs/TypographyBasic.tsx +9 -0
  204. package/src/Typography/docs/index.ts +1 -0
@@ -0,0 +1,63 @@
1
+ import React, { useRef } from "react";
2
+ import { View } from "react-native";
3
+ import { SafeAreaProvider } from "react-native-safe-area-context";
4
+ import { action } from "storybook/actions";
5
+ import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
6
+ import {
7
+ BottomSheet,
8
+ BottomSheetOption,
9
+ Button,
10
+ Heading,
11
+ Text,
12
+ } from "@jobber/components-native";
13
+ import type { BottomSheetRef } from "@jobber/components-native";
14
+
15
+ export function BottomSheetBasicExample() {
16
+ const bottomSheetRef = useRef<BottomSheetRef>(null);
17
+
18
+ return (
19
+ <SafeAreaProvider>
20
+ <BottomSheetModalProvider>
21
+ <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
22
+ <Heading>Basic BottomSheet</Heading>
23
+ <Text>
24
+ Note that due to the differences between React Native Web and React
25
+ Native, this does not render 100% properly
26
+ </Text>
27
+ <Button
28
+ label="Open Bottom Sheet"
29
+ onPress={() => bottomSheetRef.current?.open()}
30
+ />
31
+ <Button
32
+ label="Close Bottom Sheet"
33
+ onPress={() => bottomSheetRef.current?.close()}
34
+ />
35
+ </View>
36
+ <BottomSheet
37
+ ref={bottomSheetRef}
38
+ onClose={() => action("console.log")("closed bottom sheet")}
39
+ onOpen={() => action("console.log")("opened bottom sheet")}
40
+ >
41
+ <BottomSheetOption
42
+ icon="sendMessage"
43
+ iconColor="greyBlue"
44
+ text="Send message"
45
+ onPress={() => action("alert")("send message")}
46
+ />
47
+ <BottomSheetOption
48
+ icon="phone"
49
+ iconColor="greyBlue"
50
+ text="Call a friend"
51
+ onPress={() => action("alert")("Calling a friend")}
52
+ />
53
+ <BottomSheetOption
54
+ destructive={true}
55
+ icon="trash"
56
+ text="Remove"
57
+ onPress={() => action("alert")("Removed")}
58
+ />
59
+ </BottomSheet>
60
+ </BottomSheetModalProvider>
61
+ </SafeAreaProvider>
62
+ );
63
+ }
@@ -0,0 +1,65 @@
1
+ import React, { useRef } from "react";
2
+ import { View } from "react-native";
3
+ import { SafeAreaProvider } from "react-native-safe-area-context";
4
+ import { action } from "storybook/actions";
5
+ import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
6
+ import {
7
+ BottomSheet,
8
+ BottomSheetOption,
9
+ Button,
10
+ Heading,
11
+ Text,
12
+ } from "@jobber/components-native";
13
+ import type { BottomSheetRef } from "@jobber/components-native";
14
+
15
+ export function BottomSheetHeaderFooterExample() {
16
+ const bottomSheetRef = useRef<BottomSheetRef>(null);
17
+
18
+ return (
19
+ <SafeAreaProvider>
20
+ <BottomSheetModalProvider>
21
+ <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
22
+ <Heading>Basic BottomSheet</Heading>
23
+ <Text>
24
+ Note that due to the differences between React Native Web and React
25
+ Native, this does not render 100% properly
26
+ </Text>
27
+ <Button
28
+ label="Open Bottom Sheet"
29
+ onPress={() => bottomSheetRef.current?.open()}
30
+ />
31
+ <Button
32
+ label="Close Bottom Sheet"
33
+ onPress={() => bottomSheetRef.current?.close()}
34
+ />
35
+ </View>
36
+ <BottomSheet
37
+ ref={bottomSheetRef}
38
+ showCancel={true}
39
+ heading="BottomSheet Header"
40
+ onClose={() => action("console.log")("closed bottom sheet")}
41
+ onOpen={() => action("console.log")("opened bottom sheet")}
42
+ >
43
+ <BottomSheetOption
44
+ icon="sendMessage"
45
+ iconColor="greyBlue"
46
+ text="Send message"
47
+ onPress={() => action("alert")("send message")}
48
+ />
49
+ <BottomSheetOption
50
+ icon="phone"
51
+ iconColor="greyBlue"
52
+ text="Call a friend"
53
+ onPress={() => action("alert")("Calling a friend")}
54
+ />
55
+ <BottomSheetOption
56
+ destructive={true}
57
+ icon="trash"
58
+ text="Remove"
59
+ onPress={() => action("alert")("Removed")}
60
+ />
61
+ </BottomSheet>
62
+ </BottomSheetModalProvider>
63
+ </SafeAreaProvider>
64
+ );
65
+ }
@@ -0,0 +1,2 @@
1
+ export { BottomSheetBasicExample } from "./BottomSheetBasicExample";
2
+ export { BottomSheetHeaderFooterExample } from "./BottomSheetHeaderFooterExample";
@@ -1,7 +1,7 @@
1
- import React from "react";
2
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
2
  import { fn } from "storybook/test";
4
3
  import { Button } from "@jobber/components-native";
4
+ import { ButtonBasicExample, ButtonCancelExample } from "./docs";
5
5
 
6
6
  const meta = {
7
7
  title: "Components/Actions/Button",
@@ -10,10 +10,8 @@ const meta = {
10
10
  export default meta;
11
11
  type Story = StoryObj<typeof meta>;
12
12
 
13
- const BasicTemplate = (args: Story["args"]) => <Button {...args} />;
14
-
15
13
  export const Basic: Story = {
16
- render: BasicTemplate,
14
+ render: ButtonBasicExample,
17
15
  args: {
18
16
  label: "New Job",
19
17
  onPress: fn(),
@@ -21,7 +19,7 @@ export const Basic: Story = {
21
19
  };
22
20
 
23
21
  export const Cancel: Story = {
24
- render: BasicTemplate,
22
+ render: ButtonCancelExample,
25
23
  args: {
26
24
  label: "Cancel",
27
25
  variation: "cancel",
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { action } from "storybook/actions";
3
+ import { Button } from "@jobber/components-native";
4
+ import type { ButtonProps } from "@jobber/components-native";
5
+
6
+ export function ButtonBasicExample(props: Partial<ButtonProps>) {
7
+ return (
8
+ <Button
9
+ label="New Job"
10
+ onPress={action("console.log")("New Job button pressed")}
11
+ {...props}
12
+ />
13
+ );
14
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { action } from "storybook/actions";
3
+ import { Button } from "@jobber/components-native";
4
+ import type { ButtonProps } from "@jobber/components-native";
5
+
6
+ export function ButtonCancelExample(props: Partial<ButtonProps>) {
7
+ return (
8
+ <Button
9
+ label="Cancel"
10
+ variation="cancel"
11
+ onPress={action("console.log")("Cancel button pressed")}
12
+ {...props}
13
+ />
14
+ );
15
+ }
@@ -0,0 +1,2 @@
1
+ export { ButtonBasicExample } from "./ButtonBasicExample";
2
+ export { ButtonCancelExample } from "./ButtonCancelExample";
@@ -1,11 +1,12 @@
1
- import React from "react";
1
+ import type React 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";
4
+ import { ButtonGroup } from "@jobber/components-native";
5
5
  import {
6
- AtlantisOverlayProvider,
7
- ButtonGroup,
8
- } from "@jobber/components-native";
6
+ ButtonGroupBasicExample,
7
+ ButtonGroupPrimaryExample,
8
+ ButtonGroupSecondaryExample,
9
+ } from "./docs";
9
10
 
10
11
  const meta = {
11
12
  title: "Components/Actions/ButtonGroup",
@@ -32,52 +33,12 @@ type SecondaryActionStory = StoryObj<
32
33
  >;
33
34
 
34
35
  export const Basic: ButtonGroupStory = {
35
- render: args => (
36
- <SafeAreaProvider>
37
- <AtlantisOverlayProvider>
38
- <ButtonGroup {...args}>
39
- <ButtonGroup.PrimaryAction
40
- label={"Create"}
41
- icon={"plus"}
42
- onPress={() => action("console.log")("create")}
43
- />
44
- <ButtonGroup.PrimaryAction
45
- label={"Edit"}
46
- icon={"edit"}
47
- onPress={() => action("console.log")("edit")}
48
- />
49
- <ButtonGroup.SecondaryAction
50
- label={"Delete"}
51
- icon={"trash"}
52
- onPress={() => action("console.log")("delete")}
53
- />
54
- </ButtonGroup>
55
- </AtlantisOverlayProvider>
56
- </SafeAreaProvider>
57
- ),
36
+ render: ButtonGroupBasicExample,
58
37
  args: {},
59
38
  };
60
39
 
61
40
  export const Primary: PrimaryActionStory = {
62
- render: args => (
63
- <SafeAreaProvider>
64
- <AtlantisOverlayProvider>
65
- <ButtonGroup>
66
- <ButtonGroup.PrimaryAction {...args} />
67
- <ButtonGroup.SecondaryAction
68
- label={"Edit"}
69
- icon={"edit"}
70
- onPress={() => action("console.log")("edit")}
71
- />
72
- <ButtonGroup.SecondaryAction
73
- label={"Delete"}
74
- icon={"trash"}
75
- onPress={() => action("console.log")("delete")}
76
- />
77
- </ButtonGroup>
78
- </AtlantisOverlayProvider>
79
- </SafeAreaProvider>
80
- ),
41
+ render: ButtonGroupPrimaryExample,
81
42
  args: {
82
43
  label: "Create",
83
44
  icon: "plus",
@@ -86,23 +47,7 @@ export const Primary: PrimaryActionStory = {
86
47
  };
87
48
 
88
49
  export const Secondary: SecondaryActionStory = {
89
- render: args => (
90
- <SafeAreaProvider>
91
- <AtlantisOverlayProvider>
92
- <ButtonGroup
93
- bottomSheetHeading="What would you like to do"
94
- showCancelInBottomSheet={true}
95
- >
96
- <ButtonGroup.PrimaryAction
97
- label={"Click that ellipsis >>>"}
98
- buttonType={"secondary"}
99
- onPress={() => action("alert")("No, not me. The ellipsis!")}
100
- />
101
- <ButtonGroup.SecondaryAction {...args} />
102
- </ButtonGroup>
103
- </AtlantisOverlayProvider>
104
- </SafeAreaProvider>
105
- ),
50
+ render: ButtonGroupSecondaryExample,
106
51
  args: {
107
52
  label: "Create",
108
53
  icon: "plus",
@@ -0,0 +1,34 @@
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
+ ButtonGroup,
7
+ } from "@jobber/components-native";
8
+ import type { ButtonGroupProps } from "../ButtonGroup";
9
+
10
+ export function ButtonGroupBasicExample(props: Partial<ButtonGroupProps>) {
11
+ return (
12
+ <SafeAreaProvider>
13
+ <AtlantisOverlayProvider>
14
+ <ButtonGroup {...props}>
15
+ <ButtonGroup.PrimaryAction
16
+ label={"Create"}
17
+ icon={"plus"}
18
+ onPress={() => action("console.log")("create")}
19
+ />
20
+ <ButtonGroup.PrimaryAction
21
+ label={"Edit"}
22
+ icon={"edit"}
23
+ onPress={() => action("console.log")("edit")}
24
+ />
25
+ <ButtonGroup.SecondaryAction
26
+ label={"Delete"}
27
+ icon={"trash"}
28
+ onPress={() => action("console.log")("delete")}
29
+ />
30
+ </ButtonGroup>
31
+ </AtlantisOverlayProvider>
32
+ </SafeAreaProvider>
33
+ );
34
+ }
@@ -0,0 +1,37 @@
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
+ ButtonGroup,
7
+ } from "@jobber/components-native";
8
+ import type { ButtonGroupPrimaryActionProps } from "../index";
9
+
10
+ export function ButtonGroupPrimaryExample(
11
+ props: Partial<ButtonGroupPrimaryActionProps>,
12
+ ) {
13
+ return (
14
+ <SafeAreaProvider>
15
+ <AtlantisOverlayProvider>
16
+ <ButtonGroup>
17
+ <ButtonGroup.PrimaryAction
18
+ label="Create"
19
+ icon="plus"
20
+ onPress={() => action("console.log")("create")}
21
+ {...props}
22
+ />
23
+ <ButtonGroup.SecondaryAction
24
+ label={"Edit"}
25
+ icon={"edit"}
26
+ onPress={() => action("console.log")("edit")}
27
+ />
28
+ <ButtonGroup.SecondaryAction
29
+ label={"Delete"}
30
+ icon={"trash"}
31
+ onPress={() => action("console.log")("delete")}
32
+ />
33
+ </ButtonGroup>
34
+ </AtlantisOverlayProvider>
35
+ </SafeAreaProvider>
36
+ );
37
+ }
@@ -0,0 +1,35 @@
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
+ ButtonGroup,
7
+ } from "@jobber/components-native";
8
+ import type { ButtonGroupSecondaryActionProps } from "../index";
9
+
10
+ export function ButtonGroupSecondaryExample(
11
+ props: Partial<ButtonGroupSecondaryActionProps>,
12
+ ) {
13
+ return (
14
+ <SafeAreaProvider>
15
+ <AtlantisOverlayProvider>
16
+ <ButtonGroup
17
+ bottomSheetHeading="What would you like to do"
18
+ showCancelInBottomSheet={true}
19
+ >
20
+ <ButtonGroup.PrimaryAction
21
+ label={"Click that ellipsis >>>"}
22
+ buttonType={"secondary"}
23
+ onPress={() => action("alert")("No, not me. The ellipsis!")}
24
+ />
25
+ <ButtonGroup.SecondaryAction
26
+ label="Create"
27
+ icon="plus"
28
+ onPress={() => action("console.log")("create")}
29
+ {...props}
30
+ />
31
+ </ButtonGroup>
32
+ </AtlantisOverlayProvider>
33
+ </SafeAreaProvider>
34
+ );
35
+ }
@@ -0,0 +1,3 @@
1
+ export { ButtonGroupBasicExample } from "./ButtonGroupBasicExample";
2
+ export { ButtonGroupPrimaryExample } from "./ButtonGroupPrimaryExample";
3
+ export { ButtonGroupSecondaryExample } from "./ButtonGroupSecondaryExample";
@@ -1,7 +1,11 @@
1
- import React from "react";
2
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
2
  import { action } from "storybook/actions";
4
- import { Card, Content, Text } from "@jobber/components-native";
3
+ import { Card } from "@jobber/components-native";
4
+ import {
5
+ CardBasicExample,
6
+ CardElevationExample,
7
+ CardPressableExample,
8
+ } from "./docs";
5
9
 
6
10
  const meta = {
7
11
  title: "Components/Layouts and Structure/Card",
@@ -16,60 +20,22 @@ const meta = {
16
20
  export default meta;
17
21
  type Story = StoryObj<typeof meta>;
18
22
 
19
- const BasicTemplate = (args: Story["args"]) => (
20
- <Card {...args}>
21
- <Content childSpacing={"small"}>
22
- <Content spacing={"none"} childSpacing={"none"}>
23
- <Text variation={"subdued"}>Address</Text>
24
- <Text>12345 Fake Street</Text>
25
- </Content>
26
- <Content spacing={"none"} childSpacing={"none"}>
27
- <Text variation={"subdued"}>Phone</Text>
28
- <Text>555-555-5555</Text>
29
- </Content>
30
- </Content>
31
- </Card>
32
- );
33
-
34
23
  export const Basic: Story = {
35
- render: BasicTemplate,
24
+ render: CardBasicExample,
36
25
  args: {
37
26
  header: { title: "Client" },
38
27
  },
39
28
  };
40
29
 
41
- const ElevationTemplate = (args: Story["args"]) => (
42
- <Content spacing="none" direction="horizontal">
43
- <Card header={{ title: "Properties" }}>
44
- <Content>
45
- <Card {...args}>
46
- <Content childSpacing="none">
47
- <Text>10130 103 St NW</Text>
48
- <Text>Edmonton, Alberta</Text>
49
- <Text>T5J 3N9</Text>
50
- </Content>
51
- </Card>
52
- <Card {...args}>
53
- <Content childSpacing="none">
54
- <Text>10520 Jasper Ave NW</Text>
55
- <Text>Edmonton, Alberta</Text>
56
- <Text>T5J 3N9</Text>
57
- </Content>
58
- </Card>
59
- </Content>
60
- </Card>
61
- </Content>
62
- );
63
-
64
30
  export const Elevation: Story = {
65
- render: ElevationTemplate,
31
+ render: CardElevationExample,
66
32
  args: {
67
33
  elevation: "base",
68
34
  },
69
35
  };
70
36
 
71
37
  export const Pressable: Story = {
72
- render: BasicTemplate,
38
+ render: CardPressableExample,
73
39
  args: {
74
40
  header: {
75
41
  title: "Your address",
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Card, Content, Text } from "@jobber/components-native";
4
+
5
+ export function CardBasicExample(props: Partial<ComponentProps<typeof Card>>) {
6
+ return (
7
+ <Card header={{ title: "Client" }} {...props}>
8
+ <Content childSpacing={"small"}>
9
+ <Content spacing={"none"} childSpacing={"none"}>
10
+ <Text variation={"subdued"}>Address</Text>
11
+ <Text>12345 Fake Street</Text>
12
+ </Content>
13
+ <Content spacing={"none"} childSpacing={"none"}>
14
+ <Text variation={"subdued"}>Phone</Text>
15
+ <Text>555-555-5555</Text>
16
+ </Content>
17
+ </Content>
18
+ </Card>
19
+ );
20
+ }
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Card, Content, Text } from "@jobber/components-native";
4
+
5
+ export function CardElevationExample(
6
+ props: Partial<ComponentProps<typeof Card>>,
7
+ ) {
8
+ return (
9
+ <Content spacing="none" direction="horizontal">
10
+ <Card header={{ title: "Properties" }}>
11
+ <Content>
12
+ <Card elevation="base" {...props}>
13
+ <Content childSpacing="none">
14
+ <Text>10130 103 St NW</Text>
15
+ <Text>Edmonton, Alberta</Text>
16
+ <Text>T5J 3N9</Text>
17
+ </Content>
18
+ </Card>
19
+ <Card elevation="base" {...props}>
20
+ <Content childSpacing="none">
21
+ <Text>10520 Jasper Ave NW</Text>
22
+ <Text>Edmonton, Alberta</Text>
23
+ <Text>T5J 3N9</Text>
24
+ </Content>
25
+ </Card>
26
+ </Content>
27
+ </Card>
28
+ </Content>
29
+ );
30
+ }
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { action } from "storybook/actions";
4
+ import { Card, Content, Text } from "@jobber/components-native";
5
+
6
+ export function CardPressableExample(
7
+ props: Partial<ComponentProps<typeof Card>>,
8
+ ) {
9
+ return (
10
+ <Card
11
+ header={{
12
+ title: "Your address",
13
+ actionItem: { iconName: "plus2" },
14
+ onPress: () => action("alert")("🏡"),
15
+ }}
16
+ footer={{
17
+ title: "View All",
18
+ onPress: () => action("alert")("View all"),
19
+ }}
20
+ {...props}
21
+ >
22
+ <Content childSpacing={"small"}>
23
+ <Content spacing={"none"} childSpacing={"none"}>
24
+ <Text variation={"subdued"}>Address</Text>
25
+ <Text>12345 Fake Street</Text>
26
+ </Content>
27
+ <Content spacing={"none"} childSpacing={"none"}>
28
+ <Text variation={"subdued"}>Phone</Text>
29
+ <Text>555-555-5555</Text>
30
+ </Content>
31
+ </Content>
32
+ </Card>
33
+ );
34
+ }
@@ -0,0 +1,3 @@
1
+ export { CardBasicExample } from "./CardBasicExample";
2
+ export { CardElevationExample } from "./CardElevationExample";
3
+ export { CardPressableExample } from "./CardPressableExample";