@jobber/components-native 0.101.7 → 0.101.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/InputDate/InputDate.md +1 -4
- package/dist/docs/Select/Select.md +22 -16
- package/dist/docs/usage-guidelines/usage-guidelines.md +9 -13
- package/dist/package.json +3 -3
- package/dist/tsconfig.build.json +8 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.json +1 -0
- package/package.json +3 -3
- 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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { FormField, InputText } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type FormFieldProps = ComponentProps<typeof FormField>;
|
|
6
|
+
|
|
7
|
+
export function FormFieldBasic(props: Partial<FormFieldProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<FormField name={props.name ?? "name"} {...props}>
|
|
10
|
+
{field => {
|
|
11
|
+
return <InputText value={field.value} placeholder="Enter name here" />;
|
|
12
|
+
}}
|
|
13
|
+
</FormField>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
+
import { FormField, InputText, Text } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
type FormFieldProps = ComponentProps<typeof FormField>;
|
|
7
|
+
|
|
8
|
+
export function FormFieldWithValidations(props: Partial<FormFieldProps>) {
|
|
9
|
+
const methods = useForm({ mode: "onChange" });
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<FormProvider {...methods}>
|
|
13
|
+
<FormField
|
|
14
|
+
name={props.name ?? "validations"}
|
|
15
|
+
validations={{
|
|
16
|
+
maxLength: {
|
|
17
|
+
value: 5,
|
|
18
|
+
message: "Should not exceed 5 characters",
|
|
19
|
+
},
|
|
20
|
+
}}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{(field, error) => {
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
{error && <Text variation="error">{error.message}</Text>}
|
|
27
|
+
<InputText
|
|
28
|
+
value={field.value}
|
|
29
|
+
placeholder="Should not exceed 5 characters"
|
|
30
|
+
onChangeText={field.onChange}
|
|
31
|
+
/>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
}}
|
|
35
|
+
</FormField>
|
|
36
|
+
</FormProvider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { FormatFile } from "@jobber/components-native";
|
|
4
|
+
import { FormatFileBasic } from "./docs";
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: "Components/Images and Icons/FormatFile",
|
|
@@ -12,38 +12,10 @@ const meta = {
|
|
|
12
12
|
},
|
|
13
13
|
} satisfies Meta<typeof FormatFile>;
|
|
14
14
|
export default meta;
|
|
15
|
-
type Story = StoryObj<Partial<
|
|
16
|
-
|
|
17
|
-
const BasicTemplate = (args: Story["args"]) => (
|
|
18
|
-
<SafeAreaProvider>
|
|
19
|
-
<AtlantisOverlayProvider>
|
|
20
|
-
<FormatFile
|
|
21
|
-
file={
|
|
22
|
-
args?.file ?? {
|
|
23
|
-
fileName: "image.png",
|
|
24
|
-
contentType: "image/png",
|
|
25
|
-
url: "https://picsum.photos/250",
|
|
26
|
-
thumbnailUrl: "https://picsum.photos/250",
|
|
27
|
-
fileSize: 1024,
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
styleInGrid={args?.styleInGrid}
|
|
31
|
-
accessibilityLabel={args?.accessibilityLabel}
|
|
32
|
-
accessibilityHint={args?.accessibilityHint}
|
|
33
|
-
onTap={args?.onTap}
|
|
34
|
-
onRemove={args?.onRemove}
|
|
35
|
-
onPreviewPress={args?.onPreviewPress}
|
|
36
|
-
bottomSheetOptionsSuffix={args?.bottomSheetOptionsSuffix}
|
|
37
|
-
testID={args?.testID}
|
|
38
|
-
showFileTypeIndicator={args?.showFileTypeIndicator}
|
|
39
|
-
createThumbnail={args?.createThumbnail}
|
|
40
|
-
/>
|
|
41
|
-
</AtlantisOverlayProvider>
|
|
42
|
-
</SafeAreaProvider>
|
|
43
|
-
);
|
|
15
|
+
type Story = StoryObj<Partial<ComponentProps<typeof FormatFile>>>;
|
|
44
16
|
|
|
45
17
|
export const Image: Story = {
|
|
46
|
-
render:
|
|
18
|
+
render: FormatFileBasic,
|
|
47
19
|
args: {
|
|
48
20
|
file: {
|
|
49
21
|
fileName: "image.png",
|
|
@@ -56,7 +28,7 @@ export const Image: Story = {
|
|
|
56
28
|
};
|
|
57
29
|
|
|
58
30
|
export const ImageGrid: Story = {
|
|
59
|
-
render:
|
|
31
|
+
render: FormatFileBasic,
|
|
60
32
|
args: {
|
|
61
33
|
file: {
|
|
62
34
|
fileName: "image.png",
|
|
@@ -70,7 +42,7 @@ export const ImageGrid: Story = {
|
|
|
70
42
|
};
|
|
71
43
|
|
|
72
44
|
export const Video: Story = {
|
|
73
|
-
render:
|
|
45
|
+
render: FormatFileBasic,
|
|
74
46
|
args: {
|
|
75
47
|
file: {
|
|
76
48
|
fileName: "video.mp4",
|
|
@@ -83,7 +55,7 @@ export const Video: Story = {
|
|
|
83
55
|
};
|
|
84
56
|
|
|
85
57
|
export const PDF: Story = {
|
|
86
|
-
render:
|
|
58
|
+
render: FormatFileBasic,
|
|
87
59
|
args: {
|
|
88
60
|
file: {
|
|
89
61
|
fileName: "document.pdf",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
3
|
+
import { AtlantisOverlayProvider, FormatFile } from "@jobber/components-native";
|
|
4
|
+
import type { FormatFileProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
export function FormatFileBasic(props: Partial<FormatFileProps<unknown>>) {
|
|
7
|
+
return (
|
|
8
|
+
<SafeAreaProvider>
|
|
9
|
+
<AtlantisOverlayProvider>
|
|
10
|
+
<FormatFile
|
|
11
|
+
file={
|
|
12
|
+
props.file ?? {
|
|
13
|
+
fileName: "image.png",
|
|
14
|
+
contentType: "image/png",
|
|
15
|
+
url: "https://picsum.photos/250",
|
|
16
|
+
thumbnailUrl: "https://picsum.photos/250",
|
|
17
|
+
fileSize: 1024,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
</AtlantisOverlayProvider>
|
|
23
|
+
</SafeAreaProvider>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormatFileBasic } from "./FormatFileBasic";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
2
3
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
4
|
+
import { Glimmer } from "@jobber/components-native";
|
|
5
|
+
import { GlimmerBasic, GlimmerInDepth } from "./docs";
|
|
4
6
|
|
|
5
7
|
const meta = {
|
|
6
8
|
title: "Components/Status and Feedback/Glimmer",
|
|
@@ -20,12 +22,10 @@ const meta = {
|
|
|
20
22
|
],
|
|
21
23
|
} satisfies Meta<typeof Glimmer>;
|
|
22
24
|
export default meta;
|
|
23
|
-
type Story = StoryObj<Partial<
|
|
24
|
-
|
|
25
|
-
const BasicTemplate = (args: Story["args"]) => <Glimmer {...args} />;
|
|
25
|
+
type Story = StoryObj<Partial<ComponentProps<typeof Glimmer>>>;
|
|
26
26
|
|
|
27
27
|
export const Basic: Story = {
|
|
28
|
-
render:
|
|
28
|
+
render: GlimmerBasic,
|
|
29
29
|
args: {
|
|
30
30
|
shape: "rectangle",
|
|
31
31
|
size: "base",
|
|
@@ -33,33 +33,8 @@ export const Basic: Story = {
|
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const InDepthTemplate = (args: Story["args"]) => (
|
|
37
|
-
<Content spacing="none">
|
|
38
|
-
<Flex template={["shrink", "grow"]}>
|
|
39
|
-
<Glimmer {...args} />
|
|
40
|
-
<Content spacing="none" childSpacing="small">
|
|
41
|
-
<Glimmer size="large" width="30%" />
|
|
42
|
-
<Glimmer size="small" width="40%" />
|
|
43
|
-
</Content>
|
|
44
|
-
</Flex>
|
|
45
|
-
|
|
46
|
-
<Content spacing="none" childSpacing="small">
|
|
47
|
-
<Glimmer size="small" width="80%" />
|
|
48
|
-
<Glimmer size="small" />
|
|
49
|
-
<Glimmer size="small" width="70%" />
|
|
50
|
-
</Content>
|
|
51
|
-
|
|
52
|
-
<Flex template={["shrink", "shrink", "shrink", "shrink"]}>
|
|
53
|
-
<Glimmer size="largest" shape="square" />
|
|
54
|
-
<Glimmer size="largest" shape="square" />
|
|
55
|
-
<Glimmer size="largest" shape="square" />
|
|
56
|
-
<Glimmer size="largest" shape="square" />
|
|
57
|
-
</Flex>
|
|
58
|
-
</Content>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
36
|
export const InDepth: Story = {
|
|
62
|
-
render:
|
|
37
|
+
render: GlimmerInDepth,
|
|
63
38
|
args: {
|
|
64
39
|
size: "larger",
|
|
65
40
|
shape: "circle",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Glimmer } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type GlimmerProps = ComponentProps<typeof Glimmer>;
|
|
6
|
+
|
|
7
|
+
export function GlimmerBasic(props: Partial<GlimmerProps>) {
|
|
8
|
+
return <Glimmer shape="rectangle" size="base" timing="base" {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Content, Flex, Glimmer } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type GlimmerProps = ComponentProps<typeof Glimmer>;
|
|
6
|
+
|
|
7
|
+
export function GlimmerInDepth(props: Partial<GlimmerProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<Content spacing="none">
|
|
10
|
+
<Flex template={["shrink", "grow"]}>
|
|
11
|
+
<Glimmer size="larger" shape="circle" {...props} />
|
|
12
|
+
<Content spacing="none" childSpacing="small">
|
|
13
|
+
<Glimmer size="large" width="30%" />
|
|
14
|
+
<Glimmer size="small" width="40%" />
|
|
15
|
+
</Content>
|
|
16
|
+
</Flex>
|
|
17
|
+
|
|
18
|
+
<Content spacing="none" childSpacing="small">
|
|
19
|
+
<Glimmer size="small" width="80%" />
|
|
20
|
+
<Glimmer size="small" />
|
|
21
|
+
<Glimmer size="small" width="70%" />
|
|
22
|
+
</Content>
|
|
23
|
+
|
|
24
|
+
<Flex template={["shrink", "shrink", "shrink", "shrink"]}>
|
|
25
|
+
<Glimmer size="largest" shape="square" />
|
|
26
|
+
<Glimmer size="largest" shape="square" />
|
|
27
|
+
<Glimmer size="largest" shape="square" />
|
|
28
|
+
<Glimmer size="largest" shape="square" />
|
|
29
|
+
</Flex>
|
|
30
|
+
</Content>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
3
|
+
import { Heading } from "@jobber/components-native";
|
|
4
|
+
import { HeadingLevels } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Text and Typography/Heading",
|
|
@@ -11,23 +12,9 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof Heading>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Pick<
|
|
15
|
-
|
|
16
|
-
const LevelsTemplate = (args: Story["args"]) => {
|
|
17
|
-
return (
|
|
18
|
-
<Content>
|
|
19
|
-
<Heading level={args?.level ?? "title"}>New client</Heading>
|
|
20
|
-
<Divider size="base" />
|
|
21
|
-
<Heading level="subtitle">Client details</Heading>
|
|
22
|
-
<Divider size="base" />
|
|
23
|
-
<Heading level="heading">Additional details</Heading>
|
|
24
|
-
<Divider size="base" />
|
|
25
|
-
<Heading level="subHeading">Receives SMS</Heading>
|
|
26
|
-
</Content>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
15
|
+
type Story = StoryObj<Pick<ComponentProps<typeof Heading>, "level">>;
|
|
29
16
|
|
|
30
17
|
export const Levels: Story = {
|
|
31
|
-
render:
|
|
18
|
+
render: HeadingLevels,
|
|
32
19
|
args: { level: "title" },
|
|
33
20
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Content, Divider, Heading } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type HeadingProps = ComponentProps<typeof Heading>;
|
|
6
|
+
|
|
7
|
+
export function HeadingLevels(props: Partial<HeadingProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<Content>
|
|
10
|
+
<Heading level="title" {...props}>
|
|
11
|
+
New client
|
|
12
|
+
</Heading>
|
|
13
|
+
<Divider size="base" />
|
|
14
|
+
<Heading level="subtitle">Client details</Heading>
|
|
15
|
+
<Divider size="base" />
|
|
16
|
+
<Heading level="heading">Additional details</Heading>
|
|
17
|
+
<Divider size="base" />
|
|
18
|
+
<Heading level="subHeading">Receives SMS</Heading>
|
|
19
|
+
</Content>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeadingLevels } from "./HeadingLevels";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
3
|
import { Icon } from "@jobber/components-native";
|
|
4
|
+
import { IconBasic } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Images and Icons/Icon",
|
|
@@ -11,14 +12,10 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof Icon>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Pick<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => (
|
|
17
|
-
<Icon name={args?.name ?? "gift"} />
|
|
18
|
-
);
|
|
15
|
+
type Story = StoryObj<Pick<ComponentProps<typeof Icon>, "name">>;
|
|
19
16
|
|
|
20
17
|
export const Basic: Story = {
|
|
21
|
-
render:
|
|
18
|
+
render: IconBasic,
|
|
22
19
|
args: {
|
|
23
20
|
name: "gift",
|
|
24
21
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconBasic } from "./IconBasic";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
import { action } from "storybook/actions";
|
|
3
3
|
import { IconButton } from "@jobber/components-native";
|
|
4
|
+
import { IconButtonBasic } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Actions/IconButton",
|
|
@@ -13,6 +14,7 @@ export default meta;
|
|
|
13
14
|
type Story = StoryObj<typeof meta>;
|
|
14
15
|
|
|
15
16
|
export const Basic: Story = {
|
|
17
|
+
render: IconButtonBasic,
|
|
16
18
|
args: {
|
|
17
19
|
accessibilityLabel: "New Job",
|
|
18
20
|
name: "remove",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
|
+
import { IconButton } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
type IconButtonProps = ComponentProps<typeof IconButton>;
|
|
7
|
+
|
|
8
|
+
export function IconButtonBasic(props: Partial<IconButtonProps>) {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton
|
|
11
|
+
accessibilityLabel="New Job"
|
|
12
|
+
name="remove"
|
|
13
|
+
onPress={() => action("alert")("👍")}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconButtonBasic } from "./IconButtonBasic";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
import { InputCurrency } from "@jobber/components-native";
|
|
3
|
+
import { InputCurrencyBasic } from "./docs";
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: "Components/Forms and Inputs/InputCurrency",
|
|
@@ -12,6 +13,7 @@ export default meta;
|
|
|
12
13
|
type Story = StoryObj<typeof meta>;
|
|
13
14
|
|
|
14
15
|
export const Basic: Story = {
|
|
16
|
+
render: InputCurrencyBasic,
|
|
15
17
|
args: {
|
|
16
18
|
placeholder: "Unit Price",
|
|
17
19
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputCurrency } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputCurrencyProps = ComponentProps<typeof InputCurrency>;
|
|
6
|
+
|
|
7
|
+
export function InputCurrencyBasic(props: Partial<InputCurrencyProps>) {
|
|
8
|
+
return <InputCurrency placeholder="Unit Price" {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputCurrencyBasic } from "./InputCurrencyBasic";
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
3
|
import { InputDate } from "@jobber/components-native";
|
|
4
|
+
import {
|
|
5
|
+
InputDateBasic,
|
|
6
|
+
InputDateEmptyValueLabel,
|
|
7
|
+
InputDateInvalid,
|
|
8
|
+
} from "./docs";
|
|
4
9
|
|
|
5
10
|
const meta = {
|
|
6
11
|
title: "Components/Forms and Inputs/InputDate",
|
|
@@ -11,20 +16,14 @@ const meta = {
|
|
|
11
16
|
},
|
|
12
17
|
} satisfies Meta<typeof InputDate>;
|
|
13
18
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Partial<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
17
|
-
const [date, setDate] = useState(new Date("11/11/2011"));
|
|
18
|
-
|
|
19
|
-
return <InputDate {...args} value={date} onChange={setDate} />;
|
|
20
|
-
};
|
|
19
|
+
type Story = StoryObj<Partial<ComponentProps<typeof InputDate>>>;
|
|
21
20
|
|
|
22
21
|
export const Basic: Story = {
|
|
23
|
-
render:
|
|
22
|
+
render: InputDateBasic,
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export const EmptyValueLabel: Story = {
|
|
27
|
-
render:
|
|
26
|
+
render: InputDateEmptyValueLabel,
|
|
28
27
|
args: {
|
|
29
28
|
placeholder: "Start date",
|
|
30
29
|
emptyValueLabel: "Unscheduled",
|
|
@@ -32,7 +31,7 @@ export const EmptyValueLabel: Story = {
|
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
export const Invalid: Story = {
|
|
35
|
-
render:
|
|
34
|
+
render: InputDateInvalid,
|
|
36
35
|
args: {
|
|
37
36
|
placeholder: "Start date",
|
|
38
37
|
invalid: "Start Date is required",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { InputDate } from "@jobber/components-native";
|
|
3
|
+
import type { InputDateProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputDateBasic(props: Partial<InputDateProps>) {
|
|
6
|
+
const [date, setDate] = useState(new Date("11/11/2011"));
|
|
7
|
+
|
|
8
|
+
return <InputDate {...props} value={date} onChange={setDate} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { InputDate } from "@jobber/components-native";
|
|
3
|
+
import type { InputDateProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputDateEmptyValueLabel(props: Partial<InputDateProps>) {
|
|
6
|
+
const [date, setDate] = useState(new Date("11/11/2011"));
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<InputDate
|
|
10
|
+
placeholder="Start date"
|
|
11
|
+
emptyValueLabel="Unscheduled"
|
|
12
|
+
{...props}
|
|
13
|
+
value={date}
|
|
14
|
+
onChange={setDate}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { InputDate } from "@jobber/components-native";
|
|
3
|
+
import type { InputDateProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputDateInvalid(props: Partial<InputDateProps>) {
|
|
6
|
+
const [date, setDate] = useState(new Date("11/11/2011"));
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<InputDate
|
|
10
|
+
placeholder="Start date"
|
|
11
|
+
invalid="Start Date is required"
|
|
12
|
+
{...props}
|
|
13
|
+
value={date}
|
|
14
|
+
onChange={setDate}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
3
|
import { InputEmail } from "@jobber/components-native";
|
|
4
|
+
import { InputEmailBasic } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Forms and Inputs/InputEmail",
|
|
@@ -11,14 +12,10 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof InputEmail>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Partial<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
17
|
-
return <InputEmail {...args} />;
|
|
18
|
-
};
|
|
15
|
+
type Story = StoryObj<Partial<ComponentProps<typeof InputEmail>>>;
|
|
19
16
|
|
|
20
17
|
export const Basic: Story = {
|
|
21
|
-
render:
|
|
18
|
+
render: InputEmailBasic,
|
|
22
19
|
args: {
|
|
23
20
|
placeholder: "Enter your email",
|
|
24
21
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputEmail } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputEmailProps = ComponentProps<typeof InputEmail>;
|
|
6
|
+
|
|
7
|
+
export function InputEmailBasic(props: Partial<InputEmailProps>) {
|
|
8
|
+
return <InputEmail placeholder="Enter your email" {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputEmailBasic } from "./InputEmailBasic";
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import { InputFieldWrapper
|
|
3
|
+
import { InputFieldWrapper } from "@jobber/components-native";
|
|
4
|
+
import {
|
|
5
|
+
InputFieldWrapperBasic,
|
|
6
|
+
InputFieldWrapperClearable,
|
|
7
|
+
InputFieldWrapperDisabled,
|
|
8
|
+
InputFieldWrapperInvalid,
|
|
9
|
+
InputFieldWrapperPrefixAndSuffix,
|
|
10
|
+
} from "./docs";
|
|
4
11
|
|
|
5
12
|
const meta = {
|
|
6
13
|
title: "Components/Private/InputFieldWrapper",
|
|
@@ -13,10 +20,11 @@ const meta = {
|
|
|
13
20
|
export default meta;
|
|
14
21
|
type Story = StoryObj<typeof meta>;
|
|
15
22
|
type ClearableStory = StoryObj<
|
|
16
|
-
Pick<
|
|
23
|
+
Pick<ComponentProps<typeof InputFieldWrapper>, "showClearAction">
|
|
17
24
|
>;
|
|
18
25
|
|
|
19
26
|
export const Basic: Story = {
|
|
27
|
+
render: InputFieldWrapperBasic,
|
|
20
28
|
args: {
|
|
21
29
|
placeholder: "Enter a value in cents",
|
|
22
30
|
prefix: { icon: "invoice" },
|
|
@@ -24,6 +32,7 @@ export const Basic: Story = {
|
|
|
24
32
|
};
|
|
25
33
|
|
|
26
34
|
export const PrefixAndSuffix: Story = {
|
|
35
|
+
render: InputFieldWrapperPrefixAndSuffix,
|
|
27
36
|
args: {
|
|
28
37
|
placeholder: "Invoice Total",
|
|
29
38
|
prefix: { label: "$", icon: "invoice" },
|
|
@@ -32,6 +41,7 @@ export const PrefixAndSuffix: Story = {
|
|
|
32
41
|
};
|
|
33
42
|
|
|
34
43
|
export const Disabled: Story = {
|
|
44
|
+
render: InputFieldWrapperDisabled,
|
|
35
45
|
args: {
|
|
36
46
|
placeholder: "Enter a value in cents",
|
|
37
47
|
prefix: { icon: "invoice" },
|
|
@@ -40,6 +50,7 @@ export const Disabled: Story = {
|
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
export const Invalid: Story = {
|
|
53
|
+
render: InputFieldWrapperInvalid,
|
|
43
54
|
args: {
|
|
44
55
|
placeholder: "Enter a value in cents",
|
|
45
56
|
prefix: { icon: "invoice" },
|
|
@@ -47,27 +58,8 @@ export const Invalid: Story = {
|
|
|
47
58
|
},
|
|
48
59
|
};
|
|
49
60
|
|
|
50
|
-
const ClearableTemplate = (
|
|
51
|
-
args: React.ComponentProps<typeof InputFieldWrapper>,
|
|
52
|
-
) => {
|
|
53
|
-
const [value, setValue] = useState("cucumber");
|
|
54
|
-
|
|
55
|
-
function handleClear() {
|
|
56
|
-
setValue("");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<InputFieldWrapper {...args} onClear={handleClear}>
|
|
61
|
-
<Text>{value}</Text>
|
|
62
|
-
</InputFieldWrapper>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
61
|
export const Clearable: ClearableStory = {
|
|
67
|
-
render:
|
|
68
|
-
ClearableTemplate({
|
|
69
|
-
showClearAction: args.showClearAction,
|
|
70
|
-
}),
|
|
62
|
+
render: InputFieldWrapperClearable,
|
|
71
63
|
args: {
|
|
72
64
|
showClearAction: true,
|
|
73
65
|
},
|