@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 { InputFieldWrapper } from "@jobber/components-native";
|
|
3
|
+
import type { InputFieldWrapperProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputFieldWrapperBasic(props: Partial<InputFieldWrapperProps>) {
|
|
6
|
+
return (
|
|
7
|
+
<InputFieldWrapper
|
|
8
|
+
placeholder="Enter a value in cents"
|
|
9
|
+
prefix={{ icon: "invoice" }}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{props.children}
|
|
13
|
+
</InputFieldWrapper>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { InputFieldWrapper, Text } from "@jobber/components-native";
|
|
3
|
+
import type { InputFieldWrapperProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type ClearableStoryProps = Pick<InputFieldWrapperProps, "showClearAction">;
|
|
6
|
+
|
|
7
|
+
export function InputFieldWrapperClearable(
|
|
8
|
+
props: Partial<ClearableStoryProps>,
|
|
9
|
+
) {
|
|
10
|
+
const [value, setValue] = useState("cucumber");
|
|
11
|
+
|
|
12
|
+
function handleClear() {
|
|
13
|
+
setValue("");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<InputFieldWrapper
|
|
18
|
+
showClearAction={props.showClearAction}
|
|
19
|
+
onClear={handleClear}
|
|
20
|
+
>
|
|
21
|
+
<Text>{value}</Text>
|
|
22
|
+
</InputFieldWrapper>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputFieldWrapper } from "@jobber/components-native";
|
|
3
|
+
import type { InputFieldWrapperProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputFieldWrapperDisabled(
|
|
6
|
+
props: Partial<InputFieldWrapperProps>,
|
|
7
|
+
) {
|
|
8
|
+
return (
|
|
9
|
+
<InputFieldWrapper
|
|
10
|
+
placeholder="Enter a value in cents"
|
|
11
|
+
prefix={{ icon: "invoice" }}
|
|
12
|
+
disabled={true}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{props.children}
|
|
16
|
+
</InputFieldWrapper>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputFieldWrapper } from "@jobber/components-native";
|
|
3
|
+
import type { InputFieldWrapperProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputFieldWrapperInvalid(
|
|
6
|
+
props: Partial<InputFieldWrapperProps>,
|
|
7
|
+
) {
|
|
8
|
+
return (
|
|
9
|
+
<InputFieldWrapper
|
|
10
|
+
placeholder="Enter a value in cents"
|
|
11
|
+
prefix={{ icon: "invoice" }}
|
|
12
|
+
invalid={true}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{props.children}
|
|
16
|
+
</InputFieldWrapper>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputFieldWrapper } from "@jobber/components-native";
|
|
3
|
+
import type { InputFieldWrapperProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputFieldWrapperPrefixAndSuffix(
|
|
6
|
+
props: Partial<InputFieldWrapperProps>,
|
|
7
|
+
) {
|
|
8
|
+
return (
|
|
9
|
+
<InputFieldWrapper
|
|
10
|
+
placeholder="Invoice Total"
|
|
11
|
+
prefix={{ label: "$", icon: "invoice" }}
|
|
12
|
+
placeholderMode="mini"
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{props.children}
|
|
16
|
+
</InputFieldWrapper>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InputFieldWrapperBasic } from "./InputFieldWrapperBasic";
|
|
2
|
+
export { InputFieldWrapperPrefixAndSuffix } from "./InputFieldWrapperPrefixAndSuffix";
|
|
3
|
+
export { InputFieldWrapperDisabled } from "./InputFieldWrapperDisabled";
|
|
4
|
+
export { InputFieldWrapperInvalid } from "./InputFieldWrapperInvalid";
|
|
5
|
+
export { InputFieldWrapperClearable } from "./InputFieldWrapperClearable";
|
|
@@ -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 { InputNumber } from "@jobber/components-native";
|
|
4
|
+
import { InputNumberBasic, InputNumberInvalid } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Forms and Inputs/InputNumber",
|
|
@@ -11,12 +12,10 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof InputNumber>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Partial<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => <InputNumber {...args} />;
|
|
15
|
+
type Story = StoryObj<Partial<ComponentProps<typeof InputNumber>>>;
|
|
17
16
|
|
|
18
17
|
export const Basic: Story = {
|
|
19
|
-
render:
|
|
18
|
+
render: InputNumberBasic,
|
|
20
19
|
args: {
|
|
21
20
|
placeholder: "Quantity",
|
|
22
21
|
value: 12,
|
|
@@ -24,7 +23,7 @@ export const Basic: Story = {
|
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export const Invalid: Story = {
|
|
27
|
-
render:
|
|
26
|
+
render: InputNumberInvalid,
|
|
28
27
|
args: {
|
|
29
28
|
placeholder: "Area",
|
|
30
29
|
invalid: "Enter a number",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputNumber } from "@jobber/components-native";
|
|
3
|
+
import type { InputNumberProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputNumberBasic(props: Partial<InputNumberProps>) {
|
|
6
|
+
return <InputNumber placeholder="Quantity" value={12} {...props} />;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputNumber } from "@jobber/components-native";
|
|
3
|
+
import type { InputNumberProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputNumberInvalid(props: Partial<InputNumberProps>) {
|
|
6
|
+
return (
|
|
7
|
+
<InputNumber
|
|
8
|
+
placeholder="Area"
|
|
9
|
+
invalid="Enter a number"
|
|
10
|
+
suffix={{ label: "meters" }}
|
|
11
|
+
clearable="never"
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -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 { InputPassword } from "@jobber/components-native";
|
|
4
|
+
import { InputPasswordBasic } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Forms and Inputs/InputPassword",
|
|
@@ -11,12 +12,10 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof InputPassword>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Partial<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => <InputPassword {...args} />;
|
|
15
|
+
type Story = StoryObj<Partial<ComponentProps<typeof InputPassword>>>;
|
|
17
16
|
|
|
18
17
|
export const Basic: Story = {
|
|
19
|
-
render:
|
|
18
|
+
render: InputPasswordBasic,
|
|
20
19
|
args: {
|
|
21
20
|
placeholder: "Password",
|
|
22
21
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputPassword } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputPasswordProps = ComponentProps<typeof InputPassword>;
|
|
6
|
+
|
|
7
|
+
export function InputPasswordBasic(props: Partial<InputPasswordProps>) {
|
|
8
|
+
return <InputPassword placeholder="Password" {...props} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputPasswordBasic } from "./InputPasswordBasic";
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
2
|
import { action } from "storybook/actions";
|
|
4
3
|
import { InputPressable } from "@jobber/components-native";
|
|
4
|
+
import {
|
|
5
|
+
InputPressableBasic,
|
|
6
|
+
InputPressableClearable,
|
|
7
|
+
InputPressableClickableSuffix,
|
|
8
|
+
InputPressableDisabled,
|
|
9
|
+
InputPressableInvalid,
|
|
10
|
+
InputPressablePrefixOrSuffix,
|
|
11
|
+
} from "./docs";
|
|
5
12
|
|
|
6
13
|
const meta = {
|
|
7
14
|
title: "Components/Forms and Inputs/InputPressable",
|
|
@@ -13,17 +20,8 @@ const meta = {
|
|
|
13
20
|
export default meta;
|
|
14
21
|
type Story = StoryObj<typeof meta>;
|
|
15
22
|
|
|
16
|
-
const ClearableTemplate = (args: Story["args"]) => {
|
|
17
|
-
const [value, setValue] = useState("Cucumber");
|
|
18
|
-
|
|
19
|
-
function handleClear() {
|
|
20
|
-
setValue("");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return <InputPressable {...args} value={value} onClear={handleClear} />;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
23
|
export const Basic: Story = {
|
|
24
|
+
render: InputPressableBasic,
|
|
27
25
|
args: {
|
|
28
26
|
placeholder: "Placeholder",
|
|
29
27
|
value: "Mango",
|
|
@@ -32,6 +30,7 @@ export const Basic: Story = {
|
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
export const PrefixOrSuffix: Story = {
|
|
33
|
+
render: InputPressablePrefixOrSuffix,
|
|
35
34
|
args: {
|
|
36
35
|
placeholder: "Selected date",
|
|
37
36
|
value: "2021-01-01",
|
|
@@ -41,17 +40,11 @@ export const PrefixOrSuffix: Story = {
|
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
export const ClickableSuffix: Story = {
|
|
44
|
-
render:
|
|
45
|
-
<InputPressable
|
|
46
|
-
placeholder="Placeholder"
|
|
47
|
-
value="input value"
|
|
48
|
-
onPress={() => action("alert")("👍")}
|
|
49
|
-
suffix={{ icon: "dropdown", onPress: () => action("alert")("👍") }}
|
|
50
|
-
/>
|
|
51
|
-
),
|
|
43
|
+
render: InputPressableClickableSuffix,
|
|
52
44
|
};
|
|
53
45
|
|
|
54
46
|
export const Disabled: Story = {
|
|
47
|
+
render: InputPressableDisabled,
|
|
55
48
|
args: {
|
|
56
49
|
placeholder: "Favourite fruit",
|
|
57
50
|
disabled: true,
|
|
@@ -60,6 +53,7 @@ export const Disabled: Story = {
|
|
|
60
53
|
};
|
|
61
54
|
|
|
62
55
|
export const Invalid: Story = {
|
|
56
|
+
render: InputPressableInvalid,
|
|
63
57
|
args: {
|
|
64
58
|
placeholder: "Favourite fruit",
|
|
65
59
|
value: "Cucumber",
|
|
@@ -68,7 +62,7 @@ export const Invalid: Story = {
|
|
|
68
62
|
};
|
|
69
63
|
|
|
70
64
|
export const Clearable: Story = {
|
|
71
|
-
render:
|
|
65
|
+
render: InputPressableClearable,
|
|
72
66
|
args: {
|
|
73
67
|
placeholder: "Favourite fruit",
|
|
74
68
|
clearable: "always",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
|
+
import { InputPressable } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
type InputPressableProps = ComponentProps<typeof InputPressable>;
|
|
7
|
+
|
|
8
|
+
export function InputPressableBasic(props: Partial<InputPressableProps>) {
|
|
9
|
+
return (
|
|
10
|
+
<InputPressable
|
|
11
|
+
placeholder="Placeholder"
|
|
12
|
+
value="Mango"
|
|
13
|
+
onPress={() => action("alert")("👍")}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputPressable } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputPressableProps = ComponentProps<typeof InputPressable>;
|
|
6
|
+
|
|
7
|
+
export function InputPressableClearable(props: Partial<InputPressableProps>) {
|
|
8
|
+
const [value, setValue] = useState("Cucumber");
|
|
9
|
+
|
|
10
|
+
function handleClear() {
|
|
11
|
+
setValue("");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<InputPressable
|
|
16
|
+
placeholder="Favourite fruit"
|
|
17
|
+
clearable="always"
|
|
18
|
+
{...props}
|
|
19
|
+
value={value}
|
|
20
|
+
onClear={handleClear}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { InputPressable } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputPressableClickableSuffix() {
|
|
6
|
+
return (
|
|
7
|
+
<InputPressable
|
|
8
|
+
placeholder="Placeholder"
|
|
9
|
+
value="input value"
|
|
10
|
+
onPress={() => action("alert")("👍")}
|
|
11
|
+
suffix={{ icon: "dropdown", onPress: () => action("alert")("👍") }}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputPressable } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputPressableProps = ComponentProps<typeof InputPressable>;
|
|
6
|
+
|
|
7
|
+
export function InputPressableDisabled(props: Partial<InputPressableProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<InputPressable
|
|
10
|
+
placeholder="Favourite fruit"
|
|
11
|
+
disabled={true}
|
|
12
|
+
value="Mango"
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { InputPressable } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
type InputPressableProps = ComponentProps<typeof InputPressable>;
|
|
6
|
+
|
|
7
|
+
export function InputPressableInvalid(props: Partial<InputPressableProps>) {
|
|
8
|
+
return (
|
|
9
|
+
<InputPressable
|
|
10
|
+
placeholder="Favourite fruit"
|
|
11
|
+
value="Cucumber"
|
|
12
|
+
invalid="That isn't a fruit!"
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { action } from "storybook/actions";
|
|
4
|
+
import { InputPressable } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
type InputPressableProps = ComponentProps<typeof InputPressable>;
|
|
7
|
+
|
|
8
|
+
export function InputPressablePrefixOrSuffix(
|
|
9
|
+
props: Partial<InputPressableProps>,
|
|
10
|
+
) {
|
|
11
|
+
return (
|
|
12
|
+
<InputPressable
|
|
13
|
+
placeholder="Selected date"
|
|
14
|
+
value="2021-01-01"
|
|
15
|
+
prefix={{ icon: "calendar" }}
|
|
16
|
+
onPress={() => action("alert")("📅")}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { InputPressableBasic } from "./InputPressableBasic";
|
|
2
|
+
export { InputPressablePrefixOrSuffix } from "./InputPressablePrefixOrSuffix";
|
|
3
|
+
export { InputPressableClickableSuffix } from "./InputPressableClickableSuffix";
|
|
4
|
+
export { InputPressableDisabled } from "./InputPressableDisabled";
|
|
5
|
+
export { InputPressableInvalid } from "./InputPressableInvalid";
|
|
6
|
+
export { InputPressableClearable } from "./InputPressableClearable";
|
|
@@ -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 { action } from "storybook/actions";
|
|
4
3
|
import { InputSearch } from "@jobber/components-native";
|
|
4
|
+
import { InputSearchBasic } from "./docs";
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: "Components/Forms and Inputs/InputSearch",
|
|
@@ -14,25 +14,11 @@ const meta = {
|
|
|
14
14
|
export default meta;
|
|
15
15
|
|
|
16
16
|
type Story = StoryObj<
|
|
17
|
-
Pick<
|
|
17
|
+
Pick<ComponentProps<typeof InputSearch>, "placeholder" | "prefix">
|
|
18
18
|
>;
|
|
19
19
|
|
|
20
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
21
|
-
const [value, setValue] = useState("");
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<InputSearch
|
|
25
|
-
placeholder={args?.placeholder}
|
|
26
|
-
prefix={args?.prefix}
|
|
27
|
-
value={value}
|
|
28
|
-
onChange={newValue => setValue(newValue)}
|
|
29
|
-
onDebouncedChange={() => action("alert")(value)}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
20
|
export const Basic: Story = {
|
|
35
|
-
render:
|
|
21
|
+
render: InputSearchBasic,
|
|
36
22
|
args: {
|
|
37
23
|
placeholder: "Search",
|
|
38
24
|
prefix: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { action } from "storybook/actions";
|
|
3
|
+
import { InputSearch } from "@jobber/components-native";
|
|
4
|
+
import type { InputSearchProps } from "@jobber/components-native";
|
|
5
|
+
|
|
6
|
+
type InputSearchStoryArgs = Pick<InputSearchProps, "placeholder" | "prefix">;
|
|
7
|
+
|
|
8
|
+
export function InputSearchBasic(props: Partial<InputSearchStoryArgs>) {
|
|
9
|
+
const [value, setValue] = useState("");
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<InputSearch
|
|
13
|
+
placeholder={props.placeholder}
|
|
14
|
+
prefix={props.prefix}
|
|
15
|
+
value={value}
|
|
16
|
+
onChange={newValue => setValue(newValue)}
|
|
17
|
+
onDebouncedChange={() => action("alert")(value)}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputSearchBasic } from "./InputSearchBasic";
|
|
@@ -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 { InputText } from "@jobber/components-native";
|
|
4
|
+
import { InputTextBasic, InputTextInvalid, InputTextToolbar } from "./docs";
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: "Components/Forms and Inputs/InputText",
|
|
@@ -11,14 +12,10 @@ const meta = {
|
|
|
11
12
|
},
|
|
12
13
|
} satisfies Meta<typeof InputText>;
|
|
13
14
|
export default meta;
|
|
14
|
-
type Story = StoryObj<Partial<
|
|
15
|
-
|
|
16
|
-
const BasicTemplate = (args: Story["args"]) => {
|
|
17
|
-
return <InputText {...args} />;
|
|
18
|
-
};
|
|
15
|
+
type Story = StoryObj<Partial<ComponentProps<typeof InputText>>>;
|
|
19
16
|
|
|
20
17
|
export const Basic: Story = {
|
|
21
|
-
render:
|
|
18
|
+
render: InputTextBasic,
|
|
22
19
|
args: {
|
|
23
20
|
name: "age",
|
|
24
21
|
placeholder: "Age in words",
|
|
@@ -26,7 +23,7 @@ export const Basic: Story = {
|
|
|
26
23
|
};
|
|
27
24
|
|
|
28
25
|
export const Invalid: Story = {
|
|
29
|
-
render:
|
|
26
|
+
render: InputTextInvalid,
|
|
30
27
|
args: {
|
|
31
28
|
placeholder: "What is your favorite fruit?",
|
|
32
29
|
defaultValue: "Tomato",
|
|
@@ -35,27 +32,8 @@ export const Invalid: Story = {
|
|
|
35
32
|
};
|
|
36
33
|
|
|
37
34
|
export const Toolbar: Story = {
|
|
38
|
-
render:
|
|
35
|
+
render: InputTextToolbar,
|
|
39
36
|
args: {
|
|
40
37
|
placeholder: "Write your message",
|
|
41
|
-
toolbar: (
|
|
42
|
-
<>
|
|
43
|
-
<Button
|
|
44
|
-
label="Rewrite"
|
|
45
|
-
size="small"
|
|
46
|
-
icon="sparkles"
|
|
47
|
-
variation="cancel"
|
|
48
|
-
fullWidth={false}
|
|
49
|
-
/>
|
|
50
|
-
<Button
|
|
51
|
-
accessibilityLabel="Undo"
|
|
52
|
-
size="small"
|
|
53
|
-
icon="redo"
|
|
54
|
-
type="tertiary"
|
|
55
|
-
variation="cancel"
|
|
56
|
-
fullWidth={false}
|
|
57
|
-
/>
|
|
58
|
-
</>
|
|
59
|
-
),
|
|
60
38
|
},
|
|
61
39
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputText } from "@jobber/components-native";
|
|
3
|
+
import type { InputTextProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputTextBasic(props: Partial<InputTextProps>) {
|
|
6
|
+
return <InputText name="age" placeholder="Age in words" {...props} />;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputText } from "@jobber/components-native";
|
|
3
|
+
import type { InputTextProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputTextInvalid(props: Partial<InputTextProps>) {
|
|
6
|
+
return (
|
|
7
|
+
<InputText
|
|
8
|
+
placeholder="What is your favorite fruit?"
|
|
9
|
+
defaultValue="Tomato"
|
|
10
|
+
invalid="That's not a fruit"
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, InputText } from "@jobber/components-native";
|
|
3
|
+
import type { InputTextProps } from "@jobber/components-native";
|
|
4
|
+
|
|
5
|
+
export function InputTextToolbar(props: Partial<InputTextProps>) {
|
|
6
|
+
return (
|
|
7
|
+
<InputText
|
|
8
|
+
placeholder="Write your message"
|
|
9
|
+
toolbar={
|
|
10
|
+
<>
|
|
11
|
+
<Button
|
|
12
|
+
label="Rewrite"
|
|
13
|
+
size="small"
|
|
14
|
+
icon="sparkles"
|
|
15
|
+
variation="cancel"
|
|
16
|
+
fullWidth={false}
|
|
17
|
+
/>
|
|
18
|
+
<Button
|
|
19
|
+
accessibilityLabel="Undo"
|
|
20
|
+
size="small"
|
|
21
|
+
icon="redo"
|
|
22
|
+
type="tertiary"
|
|
23
|
+
variation="cancel"
|
|
24
|
+
fullWidth={false}
|
|
25
|
+
/>
|
|
26
|
+
</>
|
|
27
|
+
}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|