@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
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
4
|
-
import { action } from "storybook/actions";
|
|
2
|
+
import { InputTime } from "@jobber/components-native";
|
|
5
3
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "@jobber/components-native";
|
|
4
|
+
InputTimeBasic,
|
|
5
|
+
InputTimeEmptyValue,
|
|
6
|
+
InputTimeFormControlled,
|
|
7
|
+
} from "./docs";
|
|
11
8
|
|
|
12
9
|
const meta = {
|
|
13
10
|
title: "Components/Forms and Inputs/InputTime",
|
|
@@ -34,74 +31,15 @@ interface NativeInputTimeFormStoryArgs {
|
|
|
34
31
|
type ControlledStory = StoryObj<NativeInputTimeControlledStoryArgs>;
|
|
35
32
|
type FormStory = StoryObj<NativeInputTimeFormStoryArgs>;
|
|
36
33
|
|
|
37
|
-
const BasicTemplate = (args: ControlledStory["args"]) => {
|
|
38
|
-
const [time, setTime] = useState<Date | undefined>(
|
|
39
|
-
new Date("2023-07-21T16:36:34.873Z"),
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<InputTime
|
|
44
|
-
placeholder={args?.placeholder}
|
|
45
|
-
disabled={args?.disabled}
|
|
46
|
-
invalid={args?.invalid}
|
|
47
|
-
emptyValueLabel={args?.emptyValueLabel}
|
|
48
|
-
value={time}
|
|
49
|
-
onChange={newTime => setTime(newTime)}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const EmptyValueTemplate = (args: ControlledStory["args"]) => {
|
|
55
|
-
const [time, setTime] = useState<Date | undefined>(undefined);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<InputTime
|
|
59
|
-
placeholder={args?.placeholder}
|
|
60
|
-
disabled={args?.disabled}
|
|
61
|
-
invalid={args?.invalid}
|
|
62
|
-
emptyValueLabel={args?.emptyValueLabel}
|
|
63
|
-
value={time}
|
|
64
|
-
onChange={newTime => setTime(newTime)}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const FormControlledTemplate = (args: FormStory["args"]) => (
|
|
70
|
-
<SafeAreaProvider>
|
|
71
|
-
<AtlantisOverlayProvider>
|
|
72
|
-
<Form
|
|
73
|
-
initialValues={{ startTime: new Date("2023-07-21T16:36:34.873Z") }}
|
|
74
|
-
onSubmit={value =>
|
|
75
|
-
new Promise(resolve => {
|
|
76
|
-
setTimeout(
|
|
77
|
-
() => resolve(action("alert")(JSON.stringify(value, undefined))),
|
|
78
|
-
1000,
|
|
79
|
-
);
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
onSubmitError={() => undefined}
|
|
83
|
-
onSubmitSuccess={() => undefined}
|
|
84
|
-
>
|
|
85
|
-
<Content>
|
|
86
|
-
<InputTime
|
|
87
|
-
name={args?.name ?? "startTime"}
|
|
88
|
-
placeholder={args?.placeholder}
|
|
89
|
-
/>
|
|
90
|
-
</Content>
|
|
91
|
-
</Form>
|
|
92
|
-
</AtlantisOverlayProvider>
|
|
93
|
-
</SafeAreaProvider>
|
|
94
|
-
);
|
|
95
|
-
|
|
96
34
|
export const Basic: ControlledStory = {
|
|
97
|
-
render:
|
|
35
|
+
render: InputTimeBasic,
|
|
98
36
|
args: {
|
|
99
37
|
placeholder: "Start time",
|
|
100
38
|
},
|
|
101
39
|
};
|
|
102
40
|
|
|
103
41
|
export const Disabled: ControlledStory = {
|
|
104
|
-
render:
|
|
42
|
+
render: InputTimeBasic,
|
|
105
43
|
args: {
|
|
106
44
|
placeholder: "Start time",
|
|
107
45
|
disabled: true,
|
|
@@ -109,7 +47,7 @@ export const Disabled: ControlledStory = {
|
|
|
109
47
|
};
|
|
110
48
|
|
|
111
49
|
export const Invalid: ControlledStory = {
|
|
112
|
-
render:
|
|
50
|
+
render: InputTimeBasic,
|
|
113
51
|
args: {
|
|
114
52
|
placeholder: "Start time",
|
|
115
53
|
invalid: "Start time is required",
|
|
@@ -117,7 +55,7 @@ export const Invalid: ControlledStory = {
|
|
|
117
55
|
};
|
|
118
56
|
|
|
119
57
|
export const FormControlled: FormStory = {
|
|
120
|
-
render:
|
|
58
|
+
render: InputTimeFormControlled,
|
|
121
59
|
args: {
|
|
122
60
|
name: "startTime",
|
|
123
61
|
placeholder: "Created time",
|
|
@@ -125,7 +63,7 @@ export const FormControlled: FormStory = {
|
|
|
125
63
|
};
|
|
126
64
|
|
|
127
65
|
export const EmptyValue: ControlledStory = {
|
|
128
|
-
render:
|
|
66
|
+
render: InputTimeEmptyValue,
|
|
129
67
|
args: {
|
|
130
68
|
placeholder: "Start time",
|
|
131
69
|
emptyValueLabel: "Unscheduled",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputTime } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputTimeProps = ComponentProps<typeof InputTime>;
|
|
6
|
+
|
|
7
|
+
interface InputTimeControlledArgs {
|
|
8
|
+
placeholder?: InputTimeProps["placeholder"];
|
|
9
|
+
disabled?: InputTimeProps["disabled"];
|
|
10
|
+
invalid?: InputTimeProps["invalid"];
|
|
11
|
+
emptyValueLabel?: InputTimeProps["emptyValueLabel"];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function InputTimeBasic(props: Partial<InputTimeControlledArgs>) {
|
|
15
|
+
const [time, setTime] = useState<Date | undefined>(
|
|
16
|
+
new Date("2023-07-21T16:36:34.873Z"),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<InputTime
|
|
21
|
+
placeholder={props.placeholder}
|
|
22
|
+
disabled={props.disabled}
|
|
23
|
+
invalid={props.invalid}
|
|
24
|
+
emptyValueLabel={props.emptyValueLabel}
|
|
25
|
+
value={time}
|
|
26
|
+
onChange={newTime => setTime(newTime)}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputTime } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputTimeProps = ComponentProps<typeof InputTime>;
|
|
6
|
+
|
|
7
|
+
interface InputTimeControlledArgs {
|
|
8
|
+
placeholder?: InputTimeProps["placeholder"];
|
|
9
|
+
disabled?: InputTimeProps["disabled"];
|
|
10
|
+
invalid?: InputTimeProps["invalid"];
|
|
11
|
+
emptyValueLabel?: InputTimeProps["emptyValueLabel"];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function InputTimeEmptyValue(props: Partial<InputTimeControlledArgs>) {
|
|
15
|
+
const [time, setTime] = useState<Date | undefined>(undefined);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputTime
|
|
19
|
+
placeholder={props.placeholder}
|
|
20
|
+
disabled={props.disabled}
|
|
21
|
+
invalid={props.invalid}
|
|
22
|
+
emptyValueLabel={props.emptyValueLabel}
|
|
23
|
+
value={time}
|
|
24
|
+
onChange={newTime => setTime(newTime)}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
|
+
import {
|
|
5
|
+
AtlantisOverlayProvider,
|
|
6
|
+
Content,
|
|
7
|
+
Form,
|
|
8
|
+
InputTime,
|
|
9
|
+
} from "@jobber/components-native";
|
|
10
|
+
|
|
11
|
+
interface InputTimeFormStoryArgs {
|
|
12
|
+
name?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function InputTimeFormControlled(
|
|
17
|
+
props: Partial<InputTimeFormStoryArgs>,
|
|
18
|
+
) {
|
|
19
|
+
return (
|
|
20
|
+
<SafeAreaProvider>
|
|
21
|
+
<AtlantisOverlayProvider>
|
|
22
|
+
<Form
|
|
23
|
+
initialValues={{ startTime: new Date("2023-07-21T16:36:34.873Z") }}
|
|
24
|
+
onSubmit={value =>
|
|
25
|
+
new Promise(resolve => {
|
|
26
|
+
setTimeout(
|
|
27
|
+
() =>
|
|
28
|
+
resolve(action("alert")(JSON.stringify(value, undefined))),
|
|
29
|
+
1000,
|
|
30
|
+
);
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
onSubmitError={() => undefined}
|
|
34
|
+
onSubmitSuccess={() => undefined}
|
|
35
|
+
>
|
|
36
|
+
<Content>
|
|
37
|
+
<InputTime
|
|
38
|
+
name={props.name ?? "startTime"}
|
|
39
|
+
placeholder={props.placeholder}
|
|
40
|
+
/>
|
|
41
|
+
</Content>
|
|
42
|
+
</Form>
|
|
43
|
+
</AtlantisOverlayProvider>
|
|
44
|
+
</SafeAreaProvider>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
Content,
|
|
6
|
-
Heading,
|
|
7
|
-
ProgressBar,
|
|
8
|
-
} from "@jobber/components-native";
|
|
3
|
+
import { ProgressBar } from "@jobber/components-native";
|
|
4
|
+
import { ProgressBarBasic, ProgressBarWithHeader } from "./docs";
|
|
9
5
|
|
|
10
6
|
type ProgressBarStoryArgs = Partial<
|
|
11
7
|
Pick<
|
|
12
|
-
|
|
8
|
+
ComponentProps<typeof ProgressBar>,
|
|
13
9
|
"current" | "total" | "inProgress" | "variation" | "size"
|
|
14
10
|
>
|
|
15
11
|
>;
|
|
@@ -28,15 +24,7 @@ export default meta;
|
|
|
28
24
|
type Story = StoryObj<ProgressBarStoryArgs>;
|
|
29
25
|
|
|
30
26
|
export const Basic: Story = {
|
|
31
|
-
render:
|
|
32
|
-
<ProgressBar
|
|
33
|
-
current={args?.current ?? 1}
|
|
34
|
-
inProgress={args?.inProgress}
|
|
35
|
-
size={args?.size}
|
|
36
|
-
total={args?.total ?? 5}
|
|
37
|
-
variation={args?.variation}
|
|
38
|
-
/>
|
|
39
|
-
),
|
|
27
|
+
render: ProgressBarBasic,
|
|
40
28
|
args: {
|
|
41
29
|
total: 5,
|
|
42
30
|
current: 1,
|
|
@@ -45,35 +33,7 @@ export const Basic: Story = {
|
|
|
45
33
|
};
|
|
46
34
|
|
|
47
35
|
export const WithHeader: Story = {
|
|
48
|
-
render:
|
|
49
|
-
const [step, setStep] = useState(1);
|
|
50
|
-
const totalSteps = 6;
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<ProgressBar
|
|
54
|
-
current={step}
|
|
55
|
-
inProgress={args?.inProgress}
|
|
56
|
-
size={args?.size}
|
|
57
|
-
total={totalSteps}
|
|
58
|
-
variation={args?.variation}
|
|
59
|
-
header={
|
|
60
|
-
<>
|
|
61
|
-
<Content>
|
|
62
|
-
<Heading level="heading">Upload progress</Heading>
|
|
63
|
-
</Content>
|
|
64
|
-
<Button
|
|
65
|
-
label="Step Back"
|
|
66
|
-
onPress={() => setStep(Math.max(0, step - 1))}
|
|
67
|
-
/>
|
|
68
|
-
<Button
|
|
69
|
-
label="Step Forward"
|
|
70
|
-
onPress={() => setStep(Math.min(totalSteps, step + 1))}
|
|
71
|
-
/>
|
|
72
|
-
</>
|
|
73
|
-
}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
},
|
|
36
|
+
render: ProgressBarWithHeader,
|
|
77
37
|
args: {
|
|
78
38
|
total: 6,
|
|
79
39
|
current: 1,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ProgressBar } from "@jobber/components-native";
|
|
3
|
+
import type { ProgressBarProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type ProgressBarStoryArgs = Partial<
|
|
6
|
+
Pick<
|
|
7
|
+
ProgressBarProps,
|
|
8
|
+
"current" | "total" | "inProgress" | "variation" | "size"
|
|
9
|
+
>
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export function ProgressBarBasic(props: ProgressBarStoryArgs) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressBar
|
|
15
|
+
current={props.current ?? 1}
|
|
16
|
+
inProgress={props.inProgress}
|
|
17
|
+
size={props.size}
|
|
18
|
+
total={props.total ?? 5}
|
|
19
|
+
variation={props.variation}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Content,
|
|
5
|
+
Heading,
|
|
6
|
+
ProgressBar,
|
|
7
|
+
} from "@jobber/components-native";
|
|
8
|
+
import type { ProgressBarProps } from "@jobber/components-native";
|
|
9
|
+
|
|
10
|
+
type ProgressBarStoryArgs = Partial<
|
|
11
|
+
Pick<
|
|
12
|
+
ProgressBarProps,
|
|
13
|
+
"current" | "total" | "inProgress" | "variation" | "size"
|
|
14
|
+
>
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export function ProgressBarWithHeader(props: ProgressBarStoryArgs) {
|
|
18
|
+
const [step, setStep] = useState(1);
|
|
19
|
+
const totalSteps = 6;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ProgressBar
|
|
23
|
+
current={step}
|
|
24
|
+
inProgress={props.inProgress}
|
|
25
|
+
size={props.size}
|
|
26
|
+
total={totalSteps}
|
|
27
|
+
variation={props.variation}
|
|
28
|
+
header={
|
|
29
|
+
<>
|
|
30
|
+
<Content>
|
|
31
|
+
<Heading level="heading">Upload progress</Heading>
|
|
32
|
+
</Content>
|
|
33
|
+
<Button
|
|
34
|
+
label="Step Back"
|
|
35
|
+
onPress={() => setStep(Math.max(0, step - 1))}
|
|
36
|
+
/>
|
|
37
|
+
<Button
|
|
38
|
+
label="Step Forward"
|
|
39
|
+
onPress={() => setStep(Math.min(totalSteps, step + 1))}
|
|
40
|
+
/>
|
|
41
|
+
</>
|
|
42
|
+
}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
3
|
+
import { Select } from "@jobber/components-native";
|
|
4
|
+
import { SelectBasic, SelectInitialValue } from "./docs";
|
|
4
5
|
|
|
5
6
|
type SelectStoryArgs = Pick<
|
|
6
|
-
|
|
7
|
+
ComponentProps<typeof Select>,
|
|
7
8
|
"label" | "defaultValue"
|
|
8
9
|
>;
|
|
9
10
|
|
|
@@ -21,27 +22,14 @@ export default meta;
|
|
|
21
22
|
type Story = StoryObj<SelectStoryArgs>;
|
|
22
23
|
|
|
23
24
|
export const Basic: Story = {
|
|
24
|
-
render:
|
|
25
|
-
<Select label={args?.label ?? "Favorite number"}>
|
|
26
|
-
<Option value="1">1</Option>
|
|
27
|
-
<Option value="2">2</Option>
|
|
28
|
-
</Select>
|
|
29
|
-
),
|
|
25
|
+
render: SelectBasic,
|
|
30
26
|
args: {
|
|
31
27
|
label: "Favorite number",
|
|
32
28
|
},
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
export const InitialValue: Story = {
|
|
36
|
-
render:
|
|
37
|
-
<Select
|
|
38
|
-
label={args?.label ?? "Favorite number"}
|
|
39
|
-
defaultValue={args?.defaultValue ?? "2"}
|
|
40
|
-
>
|
|
41
|
-
<Option value="1">1</Option>
|
|
42
|
-
<Option value="2">2</Option>
|
|
43
|
-
</Select>
|
|
44
|
-
),
|
|
32
|
+
render: SelectInitialValue,
|
|
45
33
|
args: {
|
|
46
34
|
label: "Favorite number",
|
|
47
35
|
defaultValue: "2",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Option, Select } from "@jobber/components-native";
|
|
3
|
+
import type { SelectProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type SelectStoryArgs = Pick<SelectProps, "label" | "defaultValue">;
|
|
6
|
+
|
|
7
|
+
export function SelectBasic(props: Partial<SelectStoryArgs>) {
|
|
8
|
+
return (
|
|
9
|
+
<Select label={props.label ?? "Favorite number"} {...props}>
|
|
10
|
+
<Option value="1">1</Option>
|
|
11
|
+
<Option value="2">2</Option>
|
|
12
|
+
</Select>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Option, Select } from "@jobber/components-native";
|
|
3
|
+
import type { SelectProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type SelectStoryArgs = Pick<SelectProps, "label" | "defaultValue">;
|
|
6
|
+
|
|
7
|
+
export function SelectInitialValue(props: Partial<SelectStoryArgs>) {
|
|
8
|
+
return (
|
|
9
|
+
<Select
|
|
10
|
+
label={props.label ?? "Favorite number"}
|
|
11
|
+
defaultValue={props.defaultValue ?? "2"}
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
<Option value="1">1</Option>
|
|
15
|
+
<Option value="2">2</Option>
|
|
16
|
+
</Select>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
2
|
import { StatusLabel } from "@jobber/components-native";
|
|
3
|
+
import { StatusLabelBasic } from "./docs";
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: "Components/Status and Feedback/StatusLabel",
|
|
@@ -15,6 +16,7 @@ export default meta;
|
|
|
15
16
|
type Story = StoryObj<typeof meta>;
|
|
16
17
|
|
|
17
18
|
export const Basic: Story = {
|
|
19
|
+
render: StatusLabelBasic,
|
|
18
20
|
args: {
|
|
19
21
|
text: "Success",
|
|
20
22
|
alignment: "start",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { StatusLabel } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type StatusLabelProps = ComponentProps<typeof StatusLabel>;
|
|
6
|
+
|
|
7
|
+
export function StatusLabelBasic(props: Partial<StatusLabelProps>) {
|
|
8
|
+
return <StatusLabel text="Success" alignment="start" {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusLabelBasic } from "./StatusLabelBasic";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
3
|
+
import { Switch } from "@jobber/components-native";
|
|
4
|
+
import { SwitchBasic, SwitchControlled } from "./docs";
|
|
4
5
|
|
|
5
|
-
type SwitchStoryArgs = Pick<
|
|
6
|
+
type SwitchStoryArgs = Pick<ComponentProps<typeof Switch>, "label">;
|
|
6
7
|
|
|
7
8
|
const meta = {
|
|
8
9
|
title: "Components/Selections/Switch",
|
|
@@ -18,27 +19,14 @@ export default meta;
|
|
|
18
19
|
type Story = StoryObj<SwitchStoryArgs>;
|
|
19
20
|
|
|
20
21
|
export const Basic: Story = {
|
|
21
|
-
render:
|
|
22
|
+
render: SwitchBasic,
|
|
22
23
|
args: {
|
|
23
24
|
label: "Toggle example",
|
|
24
25
|
},
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export const Controlled: Story = {
|
|
28
|
-
render:
|
|
29
|
-
const [value, setValue] = useState(false);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Content>
|
|
33
|
-
<Button onPress={() => setValue(!value)} label="Toggle Switch" />
|
|
34
|
-
<Switch
|
|
35
|
-
label={args?.label ?? "Controlled Toggle example"}
|
|
36
|
-
value={value}
|
|
37
|
-
onValueChange={setValue}
|
|
38
|
-
/>
|
|
39
|
-
</Content>
|
|
40
|
-
);
|
|
41
|
-
},
|
|
29
|
+
render: SwitchControlled,
|
|
42
30
|
args: {
|
|
43
31
|
label: "Controlled Toggle example",
|
|
44
32
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Switch } from "@jobber/components-native";
|
|
3
|
+
import type { SwitchProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type SwitchStoryArgs = Pick<SwitchProps, "label">;
|
|
6
|
+
|
|
7
|
+
export function SwitchBasic(props: Partial<SwitchStoryArgs>) {
|
|
8
|
+
return <Switch label={props.label ?? "Toggle example"} {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Button, Content, Switch } from "@jobber/components-native";
|
|
3
|
+
import type { SwitchProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type SwitchStoryArgs = Pick<SwitchProps, "label">;
|
|
6
|
+
|
|
7
|
+
export function SwitchControlled(props: Partial<SwitchStoryArgs>) {
|
|
8
|
+
const [value, setValue] = useState(false);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Content>
|
|
12
|
+
<Button onPress={() => setValue(!value)} label="Toggle Switch" />
|
|
13
|
+
<Switch
|
|
14
|
+
label={props.label ?? "Controlled Toggle example"}
|
|
15
|
+
{...props}
|
|
16
|
+
value={value}
|
|
17
|
+
onValueChange={setValue}
|
|
18
|
+
/>
|
|
19
|
+
</Content>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
3
|
import { Text } from "@jobber/components-native";
|
|
4
|
+
import {
|
|
5
|
+
TextBasic,
|
|
6
|
+
TextMultiLevelNesting,
|
|
7
|
+
TextNestedBold,
|
|
8
|
+
TextNestedMixedStyles,
|
|
9
|
+
} from "./docs";
|
|
4
10
|
|
|
5
11
|
type TextStoryArgs = Pick<
|
|
6
|
-
|
|
12
|
+
ComponentProps<typeof Text>,
|
|
7
13
|
"children" | "level" | "reverseTheme"
|
|
8
14
|
>;
|
|
9
15
|
|
|
@@ -20,16 +26,8 @@ export default meta;
|
|
|
20
26
|
|
|
21
27
|
type Story = StoryObj<TextStoryArgs>;
|
|
22
28
|
|
|
23
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
24
|
-
return (
|
|
25
|
-
<Text level={args?.level} reverseTheme={args?.reverseTheme}>
|
|
26
|
-
{args?.children}
|
|
27
|
-
</Text>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
29
|
export const Basic: Story = {
|
|
32
|
-
render:
|
|
30
|
+
render: TextBasic,
|
|
33
31
|
args: {
|
|
34
32
|
children:
|
|
35
33
|
'"640K is more memory than anyone will ever need on a computer" - Not Bill Gates',
|
|
@@ -37,7 +35,7 @@ export const Basic: Story = {
|
|
|
37
35
|
};
|
|
38
36
|
|
|
39
37
|
export const SupportingText: Story = {
|
|
40
|
-
render:
|
|
38
|
+
render: TextBasic,
|
|
41
39
|
args: {
|
|
42
40
|
children:
|
|
43
41
|
"Supporting Text should be used to supplement additional, more important content",
|
|
@@ -46,7 +44,7 @@ export const SupportingText: Story = {
|
|
|
46
44
|
};
|
|
47
45
|
|
|
48
46
|
export const ReverseTheme: Story = {
|
|
49
|
-
render:
|
|
47
|
+
render: TextBasic,
|
|
50
48
|
args: {
|
|
51
49
|
children: "Changes Text color for display on a dark background",
|
|
52
50
|
reverseTheme: true,
|
|
@@ -57,30 +55,13 @@ export const ReverseTheme: Story = {
|
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
export const NestedBold: Story = {
|
|
60
|
-
render:
|
|
61
|
-
<Text>
|
|
62
|
-
This is <Text emphasis="strong">bold</Text> inside a sentence.
|
|
63
|
-
</Text>
|
|
64
|
-
),
|
|
58
|
+
render: TextNestedBold,
|
|
65
59
|
};
|
|
66
60
|
|
|
67
61
|
export const NestedMixedStyles: Story = {
|
|
68
|
-
render:
|
|
69
|
-
<Text>
|
|
70
|
-
Start, <Text italic>italic segment</Text>, and a
|
|
71
|
-
<Text emphasis="strong"> bold segment</Text>.
|
|
72
|
-
</Text>
|
|
73
|
-
),
|
|
62
|
+
render: TextNestedMixedStyles,
|
|
74
63
|
};
|
|
75
64
|
|
|
76
65
|
export const MultiLevelNesting: Story = {
|
|
77
|
-
render:
|
|
78
|
-
<Text>
|
|
79
|
-
Level 1{" "}
|
|
80
|
-
<Text>
|
|
81
|
-
contains <Text emphasis="strong">Level 2</Text>
|
|
82
|
-
</Text>{" "}
|
|
83
|
-
done.
|
|
84
|
-
</Text>
|
|
85
|
-
),
|
|
66
|
+
render: TextMultiLevelNesting,
|
|
86
67
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Text } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type TextStoryArgs = Pick<
|
|
6
|
+
ComponentProps<typeof Text>,
|
|
7
|
+
"children" | "level" | "reverseTheme"
|
|
8
|
+
>;
|
|
9
|
+
|
|
10
|
+
export function TextBasic(props: Partial<TextStoryArgs>) {
|
|
11
|
+
return (
|
|
12
|
+
<Text level={props.level} reverseTheme={props.reverseTheme}>
|
|
13
|
+
{props.children ??
|
|
14
|
+
'"640K is more memory than anyone will ever need on a computer" - Not Bill Gates'}
|
|
15
|
+
</Text>
|
|
16
|
+
);
|
|
17
|
+
}
|