@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
@@ -1,6 +1,13 @@
1
- import React, { useState } from "react";
1
+ import type React from "react";
2
2
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
3
  import { Checkbox, CheckboxGroup } from "@jobber/components-native";
4
+ import {
5
+ CheckboxBasicExample,
6
+ CheckboxControlledExample,
7
+ CheckboxGroupBasicExample,
8
+ CheckboxGroupControlledExample,
9
+ CheckboxGroupLabelledExample,
10
+ } from "./docs";
4
11
 
5
12
  const meta = {
6
13
  title: "Components/Selections/Checkbox",
@@ -14,37 +21,23 @@ export default meta;
14
21
  type Story = StoryObj<typeof meta>;
15
22
  type CheckboxGroupStory = StoryObj<React.ComponentProps<typeof CheckboxGroup>>;
16
23
 
17
- const BasicTemplate = (args: Story["args"]) => <Checkbox {...args} />;
18
-
19
24
  export const Basic: Story = {
20
- render: BasicTemplate,
25
+ render: CheckboxBasicExample,
21
26
  args: {
22
27
  label: "Check me out",
23
28
  name: "storyCheckbox",
24
29
  },
25
30
  };
26
31
 
27
- const ControlledTemplate = (args: Story["args"]) => {
28
- const [checked, setChecked] = useState(false);
29
-
30
- return (
31
- <Checkbox
32
- {...args}
33
- checked={checked}
34
- onChange={() => setChecked(!checked)}
35
- />
36
- );
37
- };
38
-
39
32
  export const Controlled: Story = {
40
- render: ControlledTemplate,
33
+ render: CheckboxControlledExample,
41
34
  args: {
42
35
  label: "Check me out",
43
36
  },
44
37
  };
45
38
 
46
39
  export const Indeterminate: Story = {
47
- render: BasicTemplate,
40
+ render: CheckboxBasicExample,
48
41
  args: {
49
42
  label: "Label",
50
43
  name: "storyCheckbox",
@@ -53,7 +46,7 @@ export const Indeterminate: Story = {
53
46
  };
54
47
 
55
48
  export const Disabled: Story = {
56
- render: BasicTemplate,
49
+ render: CheckboxBasicExample,
57
50
  args: {
58
51
  label: "Label",
59
52
  name: "storyCheckbox",
@@ -61,56 +54,23 @@ export const Disabled: Story = {
61
54
  },
62
55
  };
63
56
 
64
- const CheckboxGroupTemplate = (args: CheckboxGroupStory["args"]) => (
65
- <CheckboxGroup {...args}>
66
- <Checkbox name="checkbox1" label="Mustard" />
67
- <Checkbox name="checkbox2" label="Relish" />
68
- <Checkbox name="checkbox3" label="Ketchup" />
69
- </CheckboxGroup>
70
- );
71
-
72
57
  export const CheckboxGroupExample: CheckboxGroupStory = {
73
- render: CheckboxGroupTemplate,
58
+ render: CheckboxGroupBasicExample,
74
59
  args: {
75
60
  name: "testgroup",
76
61
  },
77
62
  };
78
63
 
79
64
  export const LabelledCheckboxGroup: CheckboxGroupStory = {
80
- render: CheckboxGroupTemplate,
65
+ render: CheckboxGroupLabelledExample,
81
66
  args: {
82
67
  name: "testgroup",
83
68
  label: "Select all",
84
69
  },
85
70
  };
86
71
 
87
- const ControlledCheckboxGroupTemplate = (args: CheckboxGroupStory["args"]) => {
88
- const [checkboxGroupState, setCheckboxGroupState] = useState<
89
- NonNullable<React.ComponentProps<typeof CheckboxGroup>["state"]>
90
- >({
91
- parentChecked: false,
92
- childrenChecked: {
93
- relish: true,
94
- ketchup: true,
95
- mustard: false,
96
- },
97
- });
98
-
99
- return (
100
- <CheckboxGroup
101
- {...args}
102
- state={checkboxGroupState}
103
- onChange={state => setCheckboxGroupState(state)}
104
- >
105
- <Checkbox name="mustard" label="Mustard" />
106
- <Checkbox name="relish" label="Relish" />
107
- <Checkbox name="ketchup" label="Ketchup" />
108
- </CheckboxGroup>
109
- );
110
- };
111
-
112
72
  export const ControlledCheckboxGroup: CheckboxGroupStory = {
113
- render: ControlledCheckboxGroupTemplate,
73
+ render: CheckboxGroupControlledExample,
114
74
  args: {
115
75
  name: "testgroup",
116
76
  label: "All",
@@ -118,7 +78,7 @@ export const ControlledCheckboxGroup: CheckboxGroupStory = {
118
78
  };
119
79
 
120
80
  export const DisabledCheckboxGroup: CheckboxGroupStory = {
121
- render: CheckboxGroupTemplate,
81
+ render: CheckboxGroupBasicExample,
122
82
  args: {
123
83
  name: "testgroup",
124
84
  label: "Label",
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Checkbox } from "@jobber/components-native";
4
+
5
+ export function CheckboxBasicExample(
6
+ props: Partial<ComponentProps<typeof Checkbox>>,
7
+ ) {
8
+ return <Checkbox label="Check me out" name="storyCheckbox" {...props} />;
9
+ }
@@ -0,0 +1,18 @@
1
+ import React, { useState } from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Checkbox } from "@jobber/components-native";
4
+
5
+ export function CheckboxControlledExample(
6
+ props: Partial<ComponentProps<typeof Checkbox>>,
7
+ ) {
8
+ const [checked, setChecked] = useState(false);
9
+
10
+ return (
11
+ <Checkbox
12
+ label="Check me out"
13
+ {...props}
14
+ checked={checked}
15
+ onChange={() => setChecked(!checked)}
16
+ />
17
+ );
18
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Checkbox, CheckboxGroup } from "@jobber/components-native";
4
+
5
+ export function CheckboxGroupBasicExample(
6
+ props: Partial<ComponentProps<typeof CheckboxGroup>>,
7
+ ) {
8
+ return (
9
+ <CheckboxGroup name="testgroup" {...props}>
10
+ <Checkbox name="checkbox1" label="Mustard" />
11
+ <Checkbox name="checkbox2" label="Relish" />
12
+ <Checkbox name="checkbox3" label="Ketchup" />
13
+ </CheckboxGroup>
14
+ );
15
+ }
@@ -0,0 +1,32 @@
1
+ import React, { useState } from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Checkbox, CheckboxGroup } from "@jobber/components-native";
4
+
5
+ export function CheckboxGroupControlledExample(
6
+ props: Partial<ComponentProps<typeof CheckboxGroup>>,
7
+ ) {
8
+ const [checkboxGroupState, setCheckboxGroupState] = useState<
9
+ NonNullable<ComponentProps<typeof CheckboxGroup>["state"]>
10
+ >({
11
+ parentChecked: false,
12
+ childrenChecked: {
13
+ relish: true,
14
+ ketchup: true,
15
+ mustard: false,
16
+ },
17
+ });
18
+
19
+ return (
20
+ <CheckboxGroup
21
+ name="testgroup"
22
+ label="All"
23
+ {...props}
24
+ state={checkboxGroupState}
25
+ onChange={state => setCheckboxGroupState(state)}
26
+ >
27
+ <Checkbox name="mustard" label="Mustard" />
28
+ <Checkbox name="relish" label="Relish" />
29
+ <Checkbox name="ketchup" label="Ketchup" />
30
+ </CheckboxGroup>
31
+ );
32
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Checkbox, CheckboxGroup } from "@jobber/components-native";
4
+
5
+ export function CheckboxGroupLabelledExample(
6
+ props: Partial<ComponentProps<typeof CheckboxGroup>>,
7
+ ) {
8
+ return (
9
+ <CheckboxGroup name="testgroup" label="Select all" {...props}>
10
+ <Checkbox name="checkbox1" label="Mustard" />
11
+ <Checkbox name="checkbox2" label="Relish" />
12
+ <Checkbox name="checkbox3" label="Ketchup" />
13
+ </CheckboxGroup>
14
+ );
15
+ }
@@ -0,0 +1,5 @@
1
+ export { CheckboxBasicExample } from "./CheckboxBasicExample";
2
+ export { CheckboxControlledExample } from "./CheckboxControlledExample";
3
+ export { CheckboxGroupBasicExample } from "./CheckboxGroupBasicExample";
4
+ export { CheckboxGroupLabelledExample } from "./CheckboxGroupLabelledExample";
5
+ export { CheckboxGroupControlledExample } from "./CheckboxGroupControlledExample";
@@ -1,8 +1,12 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
4
2
  import { action } from "storybook/actions";
5
- import { Chip, useAtlantisTheme } from "@jobber/components-native";
3
+ import { Chip } from "@jobber/components-native";
4
+ import {
5
+ ChipAccentExample,
6
+ ChipBasicExample,
7
+ ChipDismissableExample,
8
+ ChipInactiveBackgroundColorExample,
9
+ } from "./docs";
6
10
 
7
11
  const meta = {
8
12
  title: "Components/Selections/Chip",
@@ -14,14 +18,8 @@ const meta = {
14
18
  export default meta;
15
19
  type Story = StoryObj<typeof meta>;
16
20
 
17
- const BasicTemplate = (args: Story["args"]) => (
18
- <View style={{ display: "flex", flexDirection: "row" }}>
19
- <Chip {...args} />
20
- </View>
21
- );
22
-
23
21
  export const Basic: Story = {
24
- render: BasicTemplate,
22
+ render: ChipBasicExample,
25
23
  args: {
26
24
  label: "Active chip",
27
25
  onPress: () => action("alert")("hi!"),
@@ -30,57 +28,8 @@ export const Basic: Story = {
30
28
  },
31
29
  };
32
30
 
33
- const AccentTemplate = (args: Story["args"]) => {
34
- const { tokens } = useAtlantisTheme();
35
-
36
- return (
37
- <View
38
- style={{
39
- display: "flex",
40
- flexDirection: "row",
41
- flexWrap: "wrap",
42
- gap: tokens["space-small"],
43
- }}
44
- >
45
- <Chip {...args} />
46
- <Chip
47
- label="Select requests"
48
- accent="request"
49
- icon="request"
50
- onPress={() => action("alert")("Requests")}
51
- accessibilityLabel={"Select Requests"}
52
- isActive={true}
53
- />
54
- <Chip
55
- label="Select quotes"
56
- accent="quote"
57
- icon="quote"
58
- onPress={() => action("alert")("Quotes")}
59
- accessibilityLabel={"Select Quotes"}
60
- isActive={true}
61
- />
62
- <Chip
63
- label="Select jobs"
64
- accent="job"
65
- icon="job"
66
- onPress={() => action("alert")("Jobs")}
67
- accessibilityLabel={"Select Jobs"}
68
- isActive={true}
69
- />
70
- <Chip
71
- label="Select invoices"
72
- accent="invoice"
73
- icon="invoice"
74
- onPress={() => action("alert")("Invoices")}
75
- accessibilityLabel={"Select Invoices"}
76
- isActive={true}
77
- />
78
- </View>
79
- );
80
- };
81
-
82
31
  export const Accent: Story = {
83
- render: AccentTemplate,
32
+ render: ChipAccentExample,
84
33
  args: {
85
34
  label: "Select clients",
86
35
  accent: "client",
@@ -92,7 +41,7 @@ export const Accent: Story = {
92
41
  };
93
42
 
94
43
  export const Dismissable: Story = {
95
- render: BasicTemplate,
44
+ render: ChipDismissableExample,
96
45
  args: {
97
46
  label: "Test Chip",
98
47
  accent: "client",
@@ -104,7 +53,7 @@ export const Dismissable: Story = {
104
53
  };
105
54
 
106
55
  export const InactiveBackgroundColor: Story = {
107
- render: BasicTemplate,
56
+ render: ChipInactiveBackgroundColorExample,
108
57
  args: {
109
58
  label: "Inactive Chip",
110
59
  accent: "client",
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { action } from "storybook/actions";
4
+ import type { ComponentProps } from "react";
5
+ import { Chip, useAtlantisTheme } from "@jobber/components-native";
6
+
7
+ export function ChipAccentExample(props: Partial<ComponentProps<typeof Chip>>) {
8
+ const { tokens } = useAtlantisTheme();
9
+
10
+ return (
11
+ <View
12
+ style={{
13
+ display: "flex",
14
+ flexDirection: "row",
15
+ flexWrap: "wrap",
16
+ gap: tokens["space-small"],
17
+ }}
18
+ >
19
+ <Chip
20
+ label="Select clients"
21
+ accent="client"
22
+ icon="clients"
23
+ onPress={() => action("alert")("Clients")}
24
+ accessibilityLabel="Select clients"
25
+ isActive={true}
26
+ {...props}
27
+ />
28
+ <Chip
29
+ label="Select requests"
30
+ accent="request"
31
+ icon="request"
32
+ onPress={() => action("alert")("Requests")}
33
+ accessibilityLabel={"Select Requests"}
34
+ isActive={true}
35
+ />
36
+ <Chip
37
+ label="Select quotes"
38
+ accent="quote"
39
+ icon="quote"
40
+ onPress={() => action("alert")("Quotes")}
41
+ accessibilityLabel={"Select Quotes"}
42
+ isActive={true}
43
+ />
44
+ <Chip
45
+ label="Select jobs"
46
+ accent="job"
47
+ icon="job"
48
+ onPress={() => action("alert")("Jobs")}
49
+ accessibilityLabel={"Select Jobs"}
50
+ isActive={true}
51
+ />
52
+ <Chip
53
+ label="Select invoices"
54
+ accent="invoice"
55
+ icon="invoice"
56
+ onPress={() => action("alert")("Invoices")}
57
+ accessibilityLabel={"Select Invoices"}
58
+ isActive={true}
59
+ />
60
+ </View>
61
+ );
62
+ }
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { View } from "react-native";
4
+ import { action } from "storybook/actions";
5
+ import { Chip } from "@jobber/components-native";
6
+
7
+ export function ChipBasicExample(props: Partial<ComponentProps<typeof Chip>>) {
8
+ return (
9
+ <View style={{ display: "flex", flexDirection: "row" }}>
10
+ <Chip
11
+ label="Active chip"
12
+ onPress={() => action("alert")("hi!")}
13
+ accessibilityLabel="Active chip"
14
+ isActive={true}
15
+ {...props}
16
+ />
17
+ </View>
18
+ );
19
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { action } from "storybook/actions";
4
+ import type { ComponentProps } from "react";
5
+ import { Chip } from "@jobber/components-native";
6
+
7
+ export function ChipDismissableExample(
8
+ props: Partial<ComponentProps<typeof Chip>>,
9
+ ) {
10
+ return (
11
+ <View style={{ display: "flex", flexDirection: "row" }}>
12
+ <Chip
13
+ label="Test Chip"
14
+ accent="client"
15
+ icon="clients"
16
+ onPress={() => action("alert")("Clients")}
17
+ accessibilityLabel="Select clients"
18
+ isDismissible={true}
19
+ {...props}
20
+ />
21
+ </View>
22
+ );
23
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { action } from "storybook/actions";
4
+ import type { ComponentProps } from "react";
5
+ import { Chip } from "@jobber/components-native";
6
+
7
+ export function ChipInactiveBackgroundColorExample(
8
+ props: Partial<ComponentProps<typeof Chip>>,
9
+ ) {
10
+ return (
11
+ <View style={{ display: "flex", flexDirection: "row" }}>
12
+ <Chip
13
+ label="Inactive Chip"
14
+ accent="client"
15
+ icon="clients"
16
+ onPress={() => action("alert")("Clients")}
17
+ accessibilityLabel="Select clients"
18
+ inactiveBackgroundColor="surface"
19
+ {...props}
20
+ />
21
+ </View>
22
+ );
23
+ }
@@ -0,0 +1,4 @@
1
+ export { ChipBasicExample } from "./ChipBasicExample";
2
+ export { ChipAccentExample } from "./ChipAccentExample";
3
+ export { ChipDismissableExample } from "./ChipDismissableExample";
4
+ export { ChipInactiveBackgroundColorExample } from "./ChipInactiveBackgroundColorExample";
@@ -1,6 +1,6 @@
1
- import React from "react";
2
1
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
- import { Card, Content, Text } from "@jobber/components-native";
2
+ import { Content } from "@jobber/components-native";
3
+ import { ContentHorizontal, ContentVertical } from "./docs";
4
4
 
5
5
  const meta = {
6
6
  title: "Components/Layouts and Structure/Content",
@@ -18,30 +18,15 @@ const meta = {
18
18
  export default meta;
19
19
  type Story = StoryObj<typeof meta>;
20
20
 
21
- const BasicTemplate = (args: Story["args"]) => (
22
- <Card>
23
- <Content {...args}>
24
- <Text>
25
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
26
- neque quam nemo dolores illo eaque qui possimus consequuntur libero.
27
- </Text>
28
- <Text>
29
- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
30
- neque quam nemo dolores illo eaque qui possimus consequuntur libero.
31
- </Text>
32
- </Content>
33
- </Card>
34
- );
35
-
36
21
  export const Vertical: Story = {
37
- render: BasicTemplate,
22
+ render: ContentVertical,
38
23
  args: {
39
24
  direction: "vertical",
40
25
  },
41
26
  };
42
27
 
43
28
  export const Horizontal: Story = {
44
- render: BasicTemplate,
29
+ render: ContentHorizontal,
45
30
  args: {
46
31
  direction: "horizontal",
47
32
  },
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import type { ComponentProps } from "react";
3
+ import { Card, Content, Text } from "@jobber/components-native";
4
+
5
+ export function ContentHorizontal(
6
+ props: Partial<ComponentProps<typeof Content>>,
7
+ ) {
8
+ return (
9
+ <Card>
10
+ <Content direction="horizontal" {...props}>
11
+ <Text>
12
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
13
+ neque quam nemo dolores illo eaque qui possimus consequuntur libero.
14
+ </Text>
15
+ <Text>
16
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
17
+ neque quam nemo dolores illo eaque qui possimus consequuntur libero.
18
+ </Text>
19
+ </Content>
20
+ </Card>
21
+ );
22
+ }
@@ -0,0 +1,22 @@
1
+ import type { ComponentProps } from "react";
2
+ import React from "react";
3
+ import { Card, Content, Text } from "@jobber/components-native";
4
+
5
+ export function ContentVertical(
6
+ props: Partial<ComponentProps<typeof Content>>,
7
+ ) {
8
+ return (
9
+ <Card>
10
+ <Content direction="vertical" {...props}>
11
+ <Text>
12
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
13
+ neque quam nemo dolores illo eaque qui possimus consequuntur libero.
14
+ </Text>
15
+ <Text>
16
+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Itaque totam
17
+ neque quam nemo dolores illo eaque qui possimus consequuntur libero.
18
+ </Text>
19
+ </Content>
20
+ </Card>
21
+ );
22
+ }
@@ -0,0 +1,2 @@
1
+ export { ContentVertical } from "./ContentVertical";
2
+ export { ContentHorizontal } from "./ContentHorizontal";
@@ -1,16 +1,8 @@
1
- import React, { useRef } 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 { SafeAreaProvider } from "react-native-safe-area-context";
5
3
  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";
4
+ import { ContentOverlay } from "@jobber/components-native";
5
+ import { ContentOverlayBasic } from "./docs";
14
6
 
15
7
  const meta = {
16
8
  title: "Components/Overlays/ContentOverlay",
@@ -20,53 +12,15 @@ export default meta;
20
12
 
21
13
  interface ContentOverlayStoryArgs {
22
14
  title: string;
23
- onClose?: React.ComponentProps<typeof ContentOverlay>["onClose"];
24
- onOpen?: React.ComponentProps<typeof ContentOverlay>["onOpen"];
15
+ onClose?: ComponentProps<typeof ContentOverlay>["onClose"];
16
+ onOpen?: ComponentProps<typeof ContentOverlay>["onOpen"];
25
17
  fullScreen?: boolean;
26
18
  }
27
19
 
28
20
  type Story = StoryObj<ContentOverlayStoryArgs>;
29
21
 
30
- const BasicTemplate = () => {
31
- const contentOverlayRef = useRef<ContentOverlayRef>(null);
32
-
33
- const openContentOverlay = () => {
34
- contentOverlayRef.current?.open?.();
35
- };
36
-
37
- const closeContentOverlay = () => {
38
- contentOverlayRef.current?.close?.();
39
- };
40
-
41
- return (
42
- <SafeAreaProvider>
43
- <BottomSheetModalProvider>
44
- <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
45
- <Heading>Basic ContentOverlay</Heading>
46
- <Text>
47
- Note that due to the differences between React Native Web and React
48
- Native, this does not render 100% properly
49
- </Text>
50
- <Button label="Open Content Overlay" onPress={openContentOverlay} />
51
- <Button label="Close Content Overlay" onPress={closeContentOverlay} />
52
- </View>
53
- <ContentOverlay
54
- ref={contentOverlayRef}
55
- title="Content Overlay Title"
56
- onClose={() => action("console.log")("closed content overlay")}
57
- onOpen={() => action("console.log")("opened content overlay")}
58
- >
59
- <View style={{ padding: 16 }}>
60
- <Text>This is the content inside the overlay.</Text>
61
- </View>
62
- </ContentOverlay>
63
- </BottomSheetModalProvider>
64
- </SafeAreaProvider>
65
- );
66
- };
67
-
68
22
  export const Basic: Story = {
69
- render: BasicTemplate,
23
+ render: ContentOverlayBasic,
70
24
  args: {
71
25
  title: "Overlay Title",
72
26
  onClose: () => action("alert")("Overlay Dismissed"),