@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.
- package/dist/docs/Icon/Icon.md +1 -0
- package/dist/docs/InputDate/InputDate.md +1 -4
- package/dist/docs/InputPressable/InputPressable.md +1 -1
- package/dist/docs/Select/Select.md +22 -16
- package/dist/docs/usage-guidelines/usage-guidelines.md +9 -14
- package/dist/package.json +4 -4
- package/dist/tsconfig.build.json +8 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.json +1 -0
- package/dist/types/src/ContentOverlay/BottomSheetKeyboardAwareScrollView.d.ts +1 -2
- package/package.json +4 -4
- package/src/ActionItem/ActionItem.stories.tsx +16 -95
- package/src/ActionItem/ActionItemGroup.stories.tsx +7 -84
- package/src/ActionItem/docs/ActionItemActionAlignmentExample.tsx +23 -0
- package/src/ActionItem/docs/ActionItemBasicExample.tsx +12 -0
- package/src/ActionItem/docs/ActionItemGroupBasicExample.tsx +39 -0
- package/src/ActionItem/docs/ActionItemGroupMixedComponentsExample.tsx +52 -0
- package/src/ActionItem/docs/ActionItemInACardExample.tsx +27 -0
- package/src/ActionItem/docs/ActionItemInteractiveChildrenExample.tsx +30 -0
- package/src/ActionItem/docs/ActionItemMixedComponentsExample.tsx +36 -0
- package/src/ActionItem/docs/ActionItemNoActionExample.tsx +15 -0
- package/src/ActionItem/docs/ActionItemTitleOnlyExample.tsx +18 -0
- package/src/ActionItem/docs/index.ts +9 -0
- package/src/ActionLabel/ActionLabel.stories.tsx +10 -11
- package/src/ActionLabel/docs/ActionLabelBasicExample.tsx +15 -0
- package/src/ActionLabel/docs/ActionLabelColorExample.tsx +15 -0
- package/src/ActionLabel/docs/ActionLabelDarkBackgroundExample.tsx +25 -0
- package/src/ActionLabel/docs/ActionLabelDisabledExample.tsx +15 -0
- package/src/ActionLabel/docs/index.ts +4 -0
- package/src/ActivityIndicator/ActivityIndicator.stories.tsx +3 -18
- package/src/ActivityIndicator/docs/ActivityIndicatorBasicExample.tsx +22 -0
- package/src/ActivityIndicator/docs/index.ts +1 -0
- package/src/AtlantisThemeContext/AtlantisThemeContext.stories.tsx +7 -70
- package/src/AtlantisThemeContext/docs/AtlantisThemeContextBasicExample.tsx +41 -0
- package/src/AtlantisThemeContext/docs/AtlantisThemeContextForceThemeForProviderExample.tsx +56 -0
- package/src/AtlantisThemeContext/docs/index.ts +2 -0
- package/src/AutoLink/AutoLink.stories.tsx +3 -0
- package/src/AutoLink/docs/AutoLinkBasicExample.tsx +14 -0
- package/src/AutoLink/docs/AutoLinkSkipPhoneNumberExample.tsx +14 -0
- package/src/AutoLink/docs/index.ts +2 -0
- package/src/Banner/Banner.stories.tsx +11 -45
- package/src/Banner/docs/BannerActionsInBannersExample.tsx +18 -0
- package/src/Banner/docs/BannerBasicExample.tsx +21 -0
- package/src/Banner/docs/BannerErrorDetailsExample.tsx +19 -0
- package/src/Banner/docs/BannerErrorExample.tsx +13 -0
- package/src/Banner/docs/index.ts +4 -0
- package/src/BottomSheet/BottomSheet.stories.tsx +6 -111
- package/src/BottomSheet/docs/BottomSheetBasicExample.tsx +63 -0
- package/src/BottomSheet/docs/BottomSheetHeaderFooterExample.tsx +65 -0
- package/src/BottomSheet/docs/index.ts +2 -0
- package/src/Button/Button.stories.tsx +3 -5
- package/src/Button/docs/ButtonBasicExample.tsx +14 -0
- package/src/Button/docs/ButtonCancelExample.tsx +15 -0
- package/src/Button/docs/index.ts +2 -0
- package/src/ButtonGroup/ButtonGroup.stories.tsx +9 -64
- package/src/ButtonGroup/docs/ButtonGroupBasicExample.tsx +34 -0
- package/src/ButtonGroup/docs/ButtonGroupPrimaryExample.tsx +37 -0
- package/src/ButtonGroup/docs/ButtonGroupSecondaryExample.tsx +35 -0
- package/src/ButtonGroup/docs/index.ts +3 -0
- package/src/Card/Card.stories.tsx +9 -43
- package/src/Card/docs/CardBasicExample.tsx +20 -0
- package/src/Card/docs/CardElevationExample.tsx +30 -0
- package/src/Card/docs/CardPressableExample.tsx +34 -0
- package/src/Card/docs/index.ts +3 -0
- package/src/Checkbox/Checkbox.stories.tsx +16 -56
- package/src/Checkbox/docs/CheckboxBasicExample.tsx +9 -0
- package/src/Checkbox/docs/CheckboxControlledExample.tsx +18 -0
- package/src/Checkbox/docs/CheckboxGroupBasicExample.tsx +15 -0
- package/src/Checkbox/docs/CheckboxGroupControlledExample.tsx +32 -0
- package/src/Checkbox/docs/CheckboxGroupLabelledExample.tsx +15 -0
- package/src/Checkbox/docs/index.ts +5 -0
- package/src/Chip/Chip.stories.tsx +11 -62
- package/src/Chip/docs/ChipAccentExample.tsx +62 -0
- package/src/Chip/docs/ChipBasicExample.tsx +19 -0
- package/src/Chip/docs/ChipDismissableExample.tsx +23 -0
- package/src/Chip/docs/ChipInactiveBackgroundColorExample.tsx +23 -0
- package/src/Chip/docs/index.ts +4 -0
- package/src/Content/Content.stories.tsx +4 -19
- package/src/Content/docs/ContentHorizontal.tsx +22 -0
- package/src/Content/docs/ContentVertical.tsx +22 -0
- package/src/Content/docs/index.ts +2 -0
- package/src/ContentOverlay/ContentOverlay.stories.tsx +6 -52
- package/src/ContentOverlay/docs/ContentOverlayBasic.tsx +54 -0
- package/src/ContentOverlay/docs/index.ts +1 -0
- package/src/Disclosure/Disclosure.stories.tsx +4 -20
- package/src/Disclosure/docs/DisclosureBasic.tsx +23 -0
- package/src/Disclosure/docs/index.ts +1 -0
- package/src/Divider/Divider.stories.tsx +6 -50
- package/src/Divider/docs/DividerHorizontal.tsx +21 -0
- package/src/Divider/docs/DividerVertical.tsx +39 -0
- package/src/Divider/docs/index.ts +2 -0
- package/src/EmptyState/EmptyState.stories.tsx +2 -0
- package/src/EmptyState/docs/EmptyStateBasic.tsx +27 -0
- package/src/EmptyState/docs/index.ts +1 -0
- package/src/Flex/Flex.stories.tsx +6 -57
- package/src/Flex/docs/FlexMultiRow.tsx +25 -0
- package/src/Flex/docs/FlexNested.tsx +22 -0
- package/src/Flex/docs/index.ts +2 -0
- package/src/Form/Form.stories.tsx +6 -50
- package/src/Form/docs/FormBasic.tsx +63 -0
- package/src/Form/docs/index.ts +1 -0
- package/src/FormField/FormField.stories.tsx +4 -46
- package/src/FormField/docs/FormFieldBasic.tsx +15 -0
- package/src/FormField/docs/FormFieldWithValidations.tsx +38 -0
- package/src/FormField/docs/index.ts +2 -0
- package/src/FormatFile/FormatFile.stories.tsx +8 -36
- package/src/FormatFile/docs/FormatFileBasic.tsx +25 -0
- package/src/FormatFile/docs/index.ts +1 -0
- package/src/Glimmer/Glimmer.stories.tsx +6 -31
- package/src/Glimmer/docs/GlimmerBasic.tsx +9 -0
- package/src/Glimmer/docs/GlimmerInDepth.tsx +32 -0
- package/src/Glimmer/docs/index.ts +2 -0
- package/src/Heading/Heading.stories.tsx +5 -18
- package/src/Heading/docs/HeadingLevels.tsx +21 -0
- package/src/Heading/docs/index.ts +1 -0
- package/src/Icon/Icon.stories.tsx +4 -7
- package/src/Icon/docs/IconBasic.tsx +7 -0
- package/src/Icon/docs/index.ts +1 -0
- package/src/IconButton/IconButton.stories.tsx +2 -0
- package/src/IconButton/docs/IconButtonBasic.tsx +17 -0
- package/src/IconButton/docs/index.ts +1 -0
- package/src/InputCurrency/InputCurrency.stories.tsx +2 -0
- package/src/InputCurrency/docs/InputCurrencyBasic.tsx +9 -0
- package/src/InputCurrency/docs/index.ts +1 -0
- package/src/InputDate/InputDate.stories.tsx +10 -11
- package/src/InputDate/docs/InputDateBasic.tsx +9 -0
- package/src/InputDate/docs/InputDateEmptyValueLabel.tsx +17 -0
- package/src/InputDate/docs/InputDateInvalid.tsx +17 -0
- package/src/InputDate/docs/index.ts +3 -0
- package/src/InputEmail/InputEmail.stories.tsx +4 -7
- package/src/InputEmail/docs/InputEmailBasic.tsx +9 -0
- package/src/InputEmail/docs/index.ts +1 -0
- package/src/InputFieldWrapper/InputFieldWrapper.stories.tsx +15 -23
- package/src/InputFieldWrapper/docs/InputFieldWrapperBasic.tsx +15 -0
- package/src/InputFieldWrapper/docs/InputFieldWrapperClearable.tsx +24 -0
- package/src/InputFieldWrapper/docs/InputFieldWrapperDisabled.tsx +18 -0
- package/src/InputFieldWrapper/docs/InputFieldWrapperInvalid.tsx +18 -0
- package/src/InputFieldWrapper/docs/InputFieldWrapperPrefixAndSuffix.tsx +18 -0
- package/src/InputFieldWrapper/docs/index.ts +5 -0
- package/src/InputNumber/InputNumber.stories.tsx +5 -6
- package/src/InputNumber/docs/InputNumberBasic.tsx +7 -0
- package/src/InputNumber/docs/InputNumberInvalid.tsx +15 -0
- package/src/InputNumber/docs/index.ts +2 -0
- package/src/InputPassword/InputPassword.stories.tsx +4 -5
- package/src/InputPassword/docs/InputPasswordBasic.tsx +9 -0
- package/src/InputPassword/docs/index.ts +1 -0
- package/src/InputPressable/InputPressable.stories.tsx +14 -20
- package/src/InputPressable/docs/InputPressableBasic.tsx +17 -0
- package/src/InputPressable/docs/InputPressableClearable.tsx +23 -0
- package/src/InputPressable/docs/InputPressableClickableSuffix.tsx +14 -0
- package/src/InputPressable/docs/InputPressableDisabled.tsx +16 -0
- package/src/InputPressable/docs/InputPressableInvalid.tsx +16 -0
- package/src/InputPressable/docs/InputPressablePrefixOrSuffix.tsx +20 -0
- package/src/InputPressable/docs/index.ts +6 -0
- package/src/InputSearch/InputSearch.stories.tsx +4 -18
- package/src/InputSearch/docs/InputSearchBasic.tsx +20 -0
- package/src/InputSearch/docs/index.ts +1 -0
- package/src/InputText/InputText.stories.tsx +7 -29
- package/src/InputText/docs/InputTextBasic.tsx +7 -0
- package/src/InputText/docs/InputTextInvalid.tsx +14 -0
- package/src/InputText/docs/InputTextToolbar.tsx +31 -0
- package/src/InputText/docs/index.ts +3 -0
- package/src/InputTime/InputTime.stories.tsx +10 -72
- package/src/InputTime/docs/InputTimeBasic.tsx +29 -0
- package/src/InputTime/docs/InputTimeEmptyValue.tsx +27 -0
- package/src/InputTime/docs/InputTimeFormControlled.tsx +46 -0
- package/src/InputTime/docs/index.ts +3 -0
- package/src/ProgressBar/ProgressBar.stories.tsx +6 -46
- package/src/ProgressBar/docs/ProgressBarBasic.tsx +22 -0
- package/src/ProgressBar/docs/ProgressBarWithHeader.tsx +45 -0
- package/src/ProgressBar/docs/index.ts +2 -0
- package/src/Select/Select.stories.tsx +6 -18
- package/src/Select/docs/SelectBasic.tsx +14 -0
- package/src/Select/docs/SelectInitialValue.tsx +18 -0
- package/src/Select/docs/index.ts +2 -0
- package/src/StatusLabel/StatusLabel.stories.tsx +2 -0
- package/src/StatusLabel/docs/StatusLabelBasic.tsx +9 -0
- package/src/StatusLabel/docs/index.ts +1 -0
- package/src/Switch/Switch.stories.tsx +6 -18
- package/src/Switch/docs/SwitchBasic.tsx +9 -0
- package/src/Switch/docs/SwitchControlled.tsx +21 -0
- package/src/Switch/docs/index.ts +2 -0
- package/src/Text/Text.stories.tsx +14 -33
- package/src/Text/docs/TextBasic.tsx +17 -0
- package/src/Text/docs/TextMultiLevelNesting.tsx +14 -0
- package/src/Text/docs/TextNestedBold.tsx +10 -0
- package/src/Text/docs/TextNestedMixedStyles.tsx +11 -0
- package/src/Text/docs/index.ts +4 -0
- package/src/TextList/TextList.stories.tsx +12 -0
- package/src/TextList/docs/TextListBasic.tsx +9 -0
- package/src/TextList/docs/TextListChildSpacing.tsx +19 -0
- package/src/TextList/docs/TextListEmphasis.tsx +19 -0
- package/src/TextList/docs/TextListLevels.tsx +19 -0
- package/src/TextList/docs/TextListSpacing.tsx +19 -0
- package/src/TextList/docs/index.ts +5 -0
- package/src/ThumbnailList/ThumbnailList.stories.tsx +3 -61
- package/src/ThumbnailList/docs/ThumbnailListBasic.tsx +62 -0
- package/src/ThumbnailList/docs/index.ts +1 -0
- package/src/Toast/Toast.stories.tsx +10 -21
- package/src/Toast/docs/ToastBasic.tsx +23 -0
- package/src/Toast/docs/index.ts +1 -0
- package/src/Typography/Typography.stories.tsx +5 -11
- package/src/Typography/docs/TypographyBasic.tsx +9 -0
- package/src/Typography/docs/index.ts +1 -0
package/dist/tsconfig.json
CHANGED
|
@@ -5,8 +5,7 @@ declare const BottomSheetKeyboardAwareScrollView: import("react").NamedExoticCom
|
|
|
5
5
|
disableScrollOnKeyboardHide?: boolean;
|
|
6
6
|
enabled?: boolean;
|
|
7
7
|
extraKeyboardSpace?: number;
|
|
8
|
-
|
|
9
|
-
ScrollViewComponent?: import("react-native-keyboard-controller/lib/typescript/components/ScrollViewWithBottomPadding").AnimatedScrollViewComponent;
|
|
8
|
+
ScrollViewComponent?: React.ComponentType<import("react-native").ScrollViewProps>;
|
|
10
9
|
} & import("react-native").ScrollViewProps & import("react").RefAttributes<BottomSheetScrollViewMethods>>;
|
|
11
10
|
export { BottomSheetKeyboardAwareScrollView };
|
|
12
11
|
export type { KeyboardAwareScrollViewProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.101.
|
|
3
|
+
"version": "0.101.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"./jestSetup.js"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
-
"clean": "rm -rf dist/* tsconfig.tsbuildinfo",
|
|
32
|
+
"clean": "rm -rf dist/* tsconfig.build.tsbuildinfo",
|
|
33
33
|
"build": "pnpm run build:clean && pnpm run compile && pnpm run build:llm-docs:bundle",
|
|
34
34
|
"build:llm-docs:bundle": "pnpm run build:llm-docs:clean && pnpm run build:llm-docs:mobile",
|
|
35
35
|
"build:llm-docs:mobile": "pnpm run --filter @jobber/atlantis-site generate:llm-docs -- --platform mobile --out ../components-native/dist/docs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/runtime": "^7.29.2",
|
|
60
60
|
"@gorhom/bottom-sheet": "^5.2.8",
|
|
61
|
-
"@jobber/design": "0.
|
|
61
|
+
"@jobber/design": "0.99.0",
|
|
62
62
|
"@jobber/hooks": "2.19.4",
|
|
63
63
|
"@react-native-community/datetimepicker": "^8.4.5",
|
|
64
64
|
"@react-native/babel-preset": "^0.82.1",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"react-native-screens": ">=4.18.0",
|
|
110
110
|
"react-native-svg": ">=12.0.0"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "6290db9d722109c8a82f97a2d0f6159beeb4ff01"
|
|
113
113
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
2
|
import { action } from "storybook/actions";
|
|
3
|
+
import { ActionItem } from "@jobber/components-native";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
ActionItemActionAlignmentExample,
|
|
6
|
+
ActionItemBasicExample,
|
|
7
|
+
ActionItemInACardExample,
|
|
8
|
+
ActionItemInteractiveChildrenExample,
|
|
9
|
+
ActionItemMixedComponentsExample,
|
|
10
|
+
ActionItemNoActionExample,
|
|
11
|
+
ActionItemTitleOnlyExample,
|
|
12
|
+
} from "./docs";
|
|
12
13
|
|
|
13
14
|
const meta = {
|
|
14
15
|
title: "Components/Layouts and Structure/ActionItem",
|
|
@@ -23,88 +24,8 @@ const meta = {
|
|
|
23
24
|
export default meta;
|
|
24
25
|
type Story = StoryObj<typeof meta>;
|
|
25
26
|
|
|
26
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
27
|
-
return (
|
|
28
|
-
<ActionItem {...args}>
|
|
29
|
-
<Text>Service Checklist</Text>
|
|
30
|
-
</ActionItem>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const InACardTemplate = (args: Story["args"]) => {
|
|
35
|
-
return (
|
|
36
|
-
<Card>
|
|
37
|
-
<ActionItem icon="work" {...args}>
|
|
38
|
-
<Text>Service Checklist</Text>
|
|
39
|
-
</ActionItem>
|
|
40
|
-
<ActionItem icon="address" {...args}>
|
|
41
|
-
<Text>Address</Text>
|
|
42
|
-
</ActionItem>
|
|
43
|
-
<ActionItem icon="quote" title="Quote #64" {...args} />
|
|
44
|
-
</Card>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const MixedComponentsTemplate = (args: Story["args"]) => {
|
|
49
|
-
return (
|
|
50
|
-
<Card>
|
|
51
|
-
<Content>
|
|
52
|
-
<InputDate placeholder="Start date" />
|
|
53
|
-
</Content>
|
|
54
|
-
<ActionItem {...args}>
|
|
55
|
-
<Text>Casey Young</Text>
|
|
56
|
-
</ActionItem>
|
|
57
|
-
</Card>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const ActionAlignmentTemplate = (args: Story["args"]) => {
|
|
62
|
-
return (
|
|
63
|
-
<Card>
|
|
64
|
-
<ActionItem {...args}>
|
|
65
|
-
<Text>
|
|
66
|
-
Cut front, back and area behind garage. Give the customer a heads up.
|
|
67
|
-
</Text>
|
|
68
|
-
</ActionItem>
|
|
69
|
-
</Card>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const TitleOnlyTemplate = (args: Story["args"]) => {
|
|
74
|
-
return (
|
|
75
|
-
<Card>
|
|
76
|
-
<ActionItem {...args} />
|
|
77
|
-
</Card>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const InteractiveChildrenTemplate = (args: Story["args"]) => {
|
|
82
|
-
return (
|
|
83
|
-
<Card>
|
|
84
|
-
<ActionItem {...args}>
|
|
85
|
-
<Content spacing="none">
|
|
86
|
-
<Text>You can tap this link or the whole ActionItem</Text>
|
|
87
|
-
<AutoLink>{"www.getjobber.com"}</AutoLink>
|
|
88
|
-
</Content>
|
|
89
|
-
</ActionItem>
|
|
90
|
-
</Card>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const NoActionTemplate = (args: Story["args"]) => {
|
|
95
|
-
return (
|
|
96
|
-
<Card>
|
|
97
|
-
<ActionItem {...args}>
|
|
98
|
-
<Text>Nathaniel Lewis</Text>
|
|
99
|
-
<Text>Christian Carlino</Text>
|
|
100
|
-
<Text>Lorna Erikssen</Text>
|
|
101
|
-
</ActionItem>
|
|
102
|
-
</Card>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
27
|
export const Basic: Story = {
|
|
107
|
-
render:
|
|
28
|
+
render: ActionItemBasicExample,
|
|
108
29
|
args: {
|
|
109
30
|
icon: "work",
|
|
110
31
|
onPress: () => action("alert")("👍"),
|
|
@@ -112,14 +33,14 @@ export const Basic: Story = {
|
|
|
112
33
|
};
|
|
113
34
|
|
|
114
35
|
export const InACard: Story = {
|
|
115
|
-
render:
|
|
36
|
+
render: ActionItemInACardExample,
|
|
116
37
|
args: {
|
|
117
38
|
onPress: () => action("alert")("👍"),
|
|
118
39
|
},
|
|
119
40
|
};
|
|
120
41
|
|
|
121
42
|
export const MixedComponents: Story = {
|
|
122
|
-
render:
|
|
43
|
+
render: ActionItemMixedComponentsExample,
|
|
123
44
|
args: {
|
|
124
45
|
onPress: () => action("alert")("👍"),
|
|
125
46
|
icon: "person",
|
|
@@ -128,7 +49,7 @@ export const MixedComponents: Story = {
|
|
|
128
49
|
};
|
|
129
50
|
|
|
130
51
|
export const ActionAlignment: Story = {
|
|
131
|
-
render:
|
|
52
|
+
render: ActionItemActionAlignmentExample,
|
|
132
53
|
args: {
|
|
133
54
|
onPress: () => action("alert")("👍"),
|
|
134
55
|
actionIconAlignment: "flex-start",
|
|
@@ -137,7 +58,7 @@ export const ActionAlignment: Story = {
|
|
|
137
58
|
};
|
|
138
59
|
|
|
139
60
|
export const TitleOnly: Story = {
|
|
140
|
-
render:
|
|
61
|
+
render: ActionItemTitleOnlyExample,
|
|
141
62
|
args: {
|
|
142
63
|
title: "Add client",
|
|
143
64
|
icon: "person",
|
|
@@ -147,7 +68,7 @@ export const TitleOnly: Story = {
|
|
|
147
68
|
};
|
|
148
69
|
|
|
149
70
|
export const InteractiveChildren: Story = {
|
|
150
|
-
render:
|
|
71
|
+
render: ActionItemInteractiveChildrenExample,
|
|
151
72
|
args: {
|
|
152
73
|
onPress: () => action("alert")("Tapped the entire action item"),
|
|
153
74
|
icon: "presentation",
|
|
@@ -156,7 +77,7 @@ export const InteractiveChildren: Story = {
|
|
|
156
77
|
};
|
|
157
78
|
|
|
158
79
|
export const NoAction: Story = {
|
|
159
|
-
render:
|
|
80
|
+
render: ActionItemNoActionExample,
|
|
160
81
|
args: {
|
|
161
82
|
icon: "userSwitch",
|
|
162
83
|
title: "Team",
|
|
@@ -1,14 +1,10 @@
|
|
|
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 {
|
|
3
|
+
import { ActionItemGroup } from "@jobber/components-native";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Content,
|
|
9
|
-
Text,
|
|
10
|
-
Typography,
|
|
11
|
-
} from "@jobber/components-native";
|
|
5
|
+
ActionItemGroupBasicExample,
|
|
6
|
+
ActionItemGroupMixedComponentsExample,
|
|
7
|
+
} from "./docs";
|
|
12
8
|
|
|
13
9
|
const meta = {
|
|
14
10
|
title: "Components/Layouts and Structure/ActionItemGroup",
|
|
@@ -27,83 +23,10 @@ type Story = StoryObj<
|
|
|
27
23
|
}
|
|
28
24
|
>;
|
|
29
25
|
|
|
30
|
-
const BasicTemplate = () => {
|
|
31
|
-
return (
|
|
32
|
-
<ActionItemGroup>
|
|
33
|
-
<Card>
|
|
34
|
-
<ActionItem
|
|
35
|
-
title={"Request #13"}
|
|
36
|
-
icon={"request"}
|
|
37
|
-
onPress={() => action("alert")("request")}
|
|
38
|
-
/>
|
|
39
|
-
<ActionItem
|
|
40
|
-
title={"Quote #64"}
|
|
41
|
-
icon={"quote"}
|
|
42
|
-
onPress={() => action("alert")("quote")}
|
|
43
|
-
/>
|
|
44
|
-
<ActionItem
|
|
45
|
-
title={"Job #12"}
|
|
46
|
-
icon={"job"}
|
|
47
|
-
onPress={() => action("alert")("job")}
|
|
48
|
-
/>
|
|
49
|
-
<ActionItem
|
|
50
|
-
title={"Invoice #72"}
|
|
51
|
-
icon={"invoice"}
|
|
52
|
-
onPress={() => action("alert")("invoice")}
|
|
53
|
-
>
|
|
54
|
-
<Text>$250.00</Text>
|
|
55
|
-
</ActionItem>
|
|
56
|
-
</Card>
|
|
57
|
-
</ActionItemGroup>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const MixedComponentsTemplate = () => {
|
|
62
|
-
return (
|
|
63
|
-
<Card>
|
|
64
|
-
<ActionItemGroup>
|
|
65
|
-
<ActionItem
|
|
66
|
-
title={"Stephen Campbell"}
|
|
67
|
-
icon={"person"}
|
|
68
|
-
onPress={() => action("alert")("client")}
|
|
69
|
-
/>
|
|
70
|
-
<Content>
|
|
71
|
-
<Typography fontFamily="display">Client name</Typography>
|
|
72
|
-
<Text>Stephen Campbell</Text>
|
|
73
|
-
<Typography fontFamily="display">Client type</Typography>
|
|
74
|
-
<Text>Residential</Text>
|
|
75
|
-
</Content>
|
|
76
|
-
<ActionItem
|
|
77
|
-
title={"Request #13"}
|
|
78
|
-
icon={"request"}
|
|
79
|
-
onPress={() => action("alert")("request")}
|
|
80
|
-
/>
|
|
81
|
-
<ActionItem
|
|
82
|
-
title={"Quote #64"}
|
|
83
|
-
icon={"quote"}
|
|
84
|
-
onPress={() => action("alert")("quote")}
|
|
85
|
-
/>
|
|
86
|
-
<ActionItem
|
|
87
|
-
title={"Job #12"}
|
|
88
|
-
icon={"job"}
|
|
89
|
-
onPress={() => action("alert")("job")}
|
|
90
|
-
/>
|
|
91
|
-
<ActionItem
|
|
92
|
-
title={"Invoice #72"}
|
|
93
|
-
icon={"invoice"}
|
|
94
|
-
onPress={() => action("alert")("invoice")}
|
|
95
|
-
>
|
|
96
|
-
<Text>$250.00</Text>
|
|
97
|
-
</ActionItem>
|
|
98
|
-
</ActionItemGroup>
|
|
99
|
-
</Card>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
26
|
export const Basic: Story = {
|
|
104
|
-
render:
|
|
27
|
+
render: ActionItemGroupBasicExample,
|
|
105
28
|
};
|
|
106
29
|
|
|
107
30
|
export const MixedComponents: Story = {
|
|
108
|
-
render:
|
|
31
|
+
render: ActionItemGroupMixedComponentsExample,
|
|
109
32
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { ActionItem, Card, Text } from "@jobber/components-native";
|
|
4
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
export function ActionItemActionAlignmentExample(
|
|
7
|
+
props: Partial<ActionItemProps>,
|
|
8
|
+
) {
|
|
9
|
+
return (
|
|
10
|
+
<Card>
|
|
11
|
+
<ActionItem
|
|
12
|
+
actionIconAlignment="flex-start"
|
|
13
|
+
title="Service Details"
|
|
14
|
+
onPress={() => action("alert")("👍")}
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<Text>
|
|
18
|
+
Cut front, back and area behind garage. Give the customer a heads up.
|
|
19
|
+
</Text>
|
|
20
|
+
</ActionItem>
|
|
21
|
+
</Card>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { ActionItem, Text } from "@jobber/components-native";
|
|
4
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
export function ActionItemBasicExample(props: Partial<ActionItemProps>) {
|
|
7
|
+
return (
|
|
8
|
+
<ActionItem icon="work" onPress={() => action("alert")("👍")} {...props}>
|
|
9
|
+
<Text>Service Checklist</Text>
|
|
10
|
+
</ActionItem>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import {
|
|
4
|
+
ActionItem,
|
|
5
|
+
ActionItemGroup,
|
|
6
|
+
Card,
|
|
7
|
+
Text,
|
|
8
|
+
} from "@jobber/components-native";
|
|
9
|
+
|
|
10
|
+
export function ActionItemGroupBasicExample() {
|
|
11
|
+
return (
|
|
12
|
+
<ActionItemGroup>
|
|
13
|
+
<Card>
|
|
14
|
+
<ActionItem
|
|
15
|
+
title={"Request #13"}
|
|
16
|
+
icon={"request"}
|
|
17
|
+
onPress={() => action("alert")("request")}
|
|
18
|
+
/>
|
|
19
|
+
<ActionItem
|
|
20
|
+
title={"Quote #64"}
|
|
21
|
+
icon={"quote"}
|
|
22
|
+
onPress={() => action("alert")("quote")}
|
|
23
|
+
/>
|
|
24
|
+
<ActionItem
|
|
25
|
+
title={"Job #12"}
|
|
26
|
+
icon={"job"}
|
|
27
|
+
onPress={() => action("alert")("job")}
|
|
28
|
+
/>
|
|
29
|
+
<ActionItem
|
|
30
|
+
title={"Invoice #72"}
|
|
31
|
+
icon={"invoice"}
|
|
32
|
+
onPress={() => action("alert")("invoice")}
|
|
33
|
+
>
|
|
34
|
+
<Text>$250.00</Text>
|
|
35
|
+
</ActionItem>
|
|
36
|
+
</Card>
|
|
37
|
+
</ActionItemGroup>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import {
|
|
4
|
+
ActionItem,
|
|
5
|
+
ActionItemGroup,
|
|
6
|
+
Card,
|
|
7
|
+
Content,
|
|
8
|
+
Text,
|
|
9
|
+
Typography,
|
|
10
|
+
} from "@jobber/components-native";
|
|
11
|
+
|
|
12
|
+
export function ActionItemGroupMixedComponentsExample() {
|
|
13
|
+
return (
|
|
14
|
+
<Card>
|
|
15
|
+
<ActionItemGroup>
|
|
16
|
+
<ActionItem
|
|
17
|
+
title={"Stephen Campbell"}
|
|
18
|
+
icon={"person"}
|
|
19
|
+
onPress={() => action("alert")("client")}
|
|
20
|
+
/>
|
|
21
|
+
<Content>
|
|
22
|
+
<Typography fontFamily="display">Client name</Typography>
|
|
23
|
+
<Text>Stephen Campbell</Text>
|
|
24
|
+
<Typography fontFamily="display">Client type</Typography>
|
|
25
|
+
<Text>Residential</Text>
|
|
26
|
+
</Content>
|
|
27
|
+
<ActionItem
|
|
28
|
+
title={"Request #13"}
|
|
29
|
+
icon={"request"}
|
|
30
|
+
onPress={() => action("alert")("request")}
|
|
31
|
+
/>
|
|
32
|
+
<ActionItem
|
|
33
|
+
title={"Quote #64"}
|
|
34
|
+
icon={"quote"}
|
|
35
|
+
onPress={() => action("alert")("quote")}
|
|
36
|
+
/>
|
|
37
|
+
<ActionItem
|
|
38
|
+
title={"Job #12"}
|
|
39
|
+
icon={"job"}
|
|
40
|
+
onPress={() => action("alert")("job")}
|
|
41
|
+
/>
|
|
42
|
+
<ActionItem
|
|
43
|
+
title={"Invoice #72"}
|
|
44
|
+
icon={"invoice"}
|
|
45
|
+
onPress={() => action("alert")("invoice")}
|
|
46
|
+
>
|
|
47
|
+
<Text>$250.00</Text>
|
|
48
|
+
</ActionItem>
|
|
49
|
+
</ActionItemGroup>
|
|
50
|
+
</Card>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { ActionItem, Card, Text } from "@jobber/components-native";
|
|
4
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
export function ActionItemInACardExample(props: Partial<ActionItemProps>) {
|
|
7
|
+
return (
|
|
8
|
+
<Card>
|
|
9
|
+
<ActionItem icon="work" onPress={() => action("alert")("👍")} {...props}>
|
|
10
|
+
<Text>Service Checklist</Text>
|
|
11
|
+
</ActionItem>
|
|
12
|
+
<ActionItem
|
|
13
|
+
icon="address"
|
|
14
|
+
onPress={() => action("alert")("👍")}
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<Text>Address</Text>
|
|
18
|
+
</ActionItem>
|
|
19
|
+
<ActionItem
|
|
20
|
+
icon="quote"
|
|
21
|
+
title="Quote #64"
|
|
22
|
+
onPress={() => action("alert")("👍")}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
</Card>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import {
|
|
4
|
+
ActionItem,
|
|
5
|
+
AutoLink,
|
|
6
|
+
Card,
|
|
7
|
+
Content,
|
|
8
|
+
Text,
|
|
9
|
+
} from "@jobber/components-native";
|
|
10
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
11
|
+
|
|
12
|
+
export function ActionItemInteractiveChildrenExample(
|
|
13
|
+
props: Partial<ActionItemProps>,
|
|
14
|
+
) {
|
|
15
|
+
return (
|
|
16
|
+
<Card>
|
|
17
|
+
<ActionItem
|
|
18
|
+
icon="presentation"
|
|
19
|
+
actionIcon="link"
|
|
20
|
+
onPress={() => action("alert")("Tapped the entire action item")}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
<Content spacing="none">
|
|
24
|
+
<Text>You can tap this link or the whole ActionItem</Text>
|
|
25
|
+
<AutoLink>{"www.getjobber.com"}</AutoLink>
|
|
26
|
+
</Content>
|
|
27
|
+
</ActionItem>
|
|
28
|
+
</Card>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import {
|
|
4
|
+
ActionItem,
|
|
5
|
+
Card,
|
|
6
|
+
Content,
|
|
7
|
+
InputDate,
|
|
8
|
+
Text,
|
|
9
|
+
} from "@jobber/components-native";
|
|
10
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
11
|
+
|
|
12
|
+
export function ActionItemMixedComponentsExample(
|
|
13
|
+
props: Partial<ActionItemProps>,
|
|
14
|
+
) {
|
|
15
|
+
const [startDate, setStartDate] = useState<Date | undefined>(undefined);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Card>
|
|
19
|
+
<Content>
|
|
20
|
+
<InputDate
|
|
21
|
+
placeholder="Start date"
|
|
22
|
+
value={startDate}
|
|
23
|
+
onChange={setStartDate}
|
|
24
|
+
/>
|
|
25
|
+
</Content>
|
|
26
|
+
<ActionItem
|
|
27
|
+
icon="person"
|
|
28
|
+
title="Assigned to"
|
|
29
|
+
onPress={() => action("alert")("👍")}
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
<Text>Casey Young</Text>
|
|
33
|
+
</ActionItem>
|
|
34
|
+
</Card>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ActionItem, Card, Text } from "@jobber/components-native";
|
|
3
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function ActionItemNoActionExample(props: Partial<ActionItemProps>) {
|
|
6
|
+
return (
|
|
7
|
+
<Card>
|
|
8
|
+
<ActionItem icon="userSwitch" title="Team" {...props}>
|
|
9
|
+
<Text>Nathaniel Lewis</Text>
|
|
10
|
+
<Text>Christian Carlino</Text>
|
|
11
|
+
<Text>Lorna Erikssen</Text>
|
|
12
|
+
</ActionItem>
|
|
13
|
+
</Card>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { ActionItem, Card } from "@jobber/components-native";
|
|
4
|
+
import type { ActionItemProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
export function ActionItemTitleOnlyExample(props: Partial<ActionItemProps>) {
|
|
7
|
+
return (
|
|
8
|
+
<Card>
|
|
9
|
+
<ActionItem
|
|
10
|
+
title="Add client"
|
|
11
|
+
icon="person"
|
|
12
|
+
actionIcon="add"
|
|
13
|
+
onPress={() => action("alert")("👍")}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
</Card>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ActionItemBasicExample } from "./ActionItemBasicExample";
|
|
2
|
+
export { ActionItemInACardExample } from "./ActionItemInACardExample";
|
|
3
|
+
export { ActionItemMixedComponentsExample } from "./ActionItemMixedComponentsExample";
|
|
4
|
+
export { ActionItemActionAlignmentExample } from "./ActionItemActionAlignmentExample";
|
|
5
|
+
export { ActionItemTitleOnlyExample } from "./ActionItemTitleOnlyExample";
|
|
6
|
+
export { ActionItemInteractiveChildrenExample } from "./ActionItemInteractiveChildrenExample";
|
|
7
|
+
export { ActionItemNoActionExample } from "./ActionItemNoActionExample";
|
|
8
|
+
export { ActionItemGroupBasicExample } from "./ActionItemGroupBasicExample";
|
|
9
|
+
export { ActionItemGroupMixedComponentsExample } from "./ActionItemGroupMixedComponentsExample";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
2
|
import { ActionLabel } from "@jobber/components-native";
|
|
3
|
+
import {
|
|
4
|
+
ActionLabelBasicExample,
|
|
5
|
+
ActionLabelColorExample,
|
|
6
|
+
ActionLabelDarkBackgroundExample,
|
|
7
|
+
ActionLabelDisabledExample,
|
|
8
|
+
} from "./docs";
|
|
4
9
|
|
|
5
10
|
const meta = {
|
|
6
11
|
title: "Components/Actions/ActionLabel",
|
|
@@ -12,24 +17,18 @@ const meta = {
|
|
|
12
17
|
export default meta;
|
|
13
18
|
type Story = StoryObj<typeof meta>;
|
|
14
19
|
|
|
15
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
16
|
-
const { children, ...actionLabelProps } = args ?? {};
|
|
17
|
-
|
|
18
|
-
return <ActionLabel {...actionLabelProps}>{children}</ActionLabel>;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
20
|
export const Basic: Story = {
|
|
22
|
-
render:
|
|
21
|
+
render: ActionLabelBasicExample,
|
|
23
22
|
args: { children: "I am a label text" },
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export const Color: Story = {
|
|
27
|
-
render:
|
|
26
|
+
render: ActionLabelColorExample,
|
|
28
27
|
args: { variation: "learning", children: "Learning" },
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
export const DarkBackground: Story = {
|
|
32
|
-
render:
|
|
31
|
+
render: ActionLabelDarkBackgroundExample,
|
|
33
32
|
args: { variation: "onPrimary", children: "Light Me Up" },
|
|
34
33
|
parameters: {
|
|
35
34
|
backgrounds: { default: "dark" },
|
|
@@ -37,6 +36,6 @@ export const DarkBackground: Story = {
|
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
export const Disabled: Story = {
|
|
40
|
-
render:
|
|
39
|
+
render: ActionLabelDisabledExample,
|
|
41
40
|
args: { disabled: true, children: "Disabled" },
|
|
42
41
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ActionLabel } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function ActionLabelBasicExample(
|
|
6
|
+
props: Partial<ComponentProps<typeof ActionLabel>>,
|
|
7
|
+
) {
|
|
8
|
+
const { children, ...actionLabelProps } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<ActionLabel {...actionLabelProps}>
|
|
12
|
+
{children ?? "I am a label text"}
|
|
13
|
+
</ActionLabel>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ActionLabel } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function ActionLabelColorExample(
|
|
6
|
+
props: Partial<ComponentProps<typeof ActionLabel>>,
|
|
7
|
+
) {
|
|
8
|
+
const { children, ...actionLabelProps } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<ActionLabel variation="learning" {...actionLabelProps}>
|
|
12
|
+
{children ?? "Learning"}
|
|
13
|
+
</ActionLabel>
|
|
14
|
+
);
|
|
15
|
+
}
|