@kivid/native-components 1.0.0-alpha.1 → 1.0.0-alpha.4
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/commonjs/components/Button/assets/class-variants.js +0 -5
- package/dist/commonjs/components/Button/assets/class-variants.js.map +1 -1
- package/dist/commonjs/components/Button/index.js +11 -5
- package/dist/commonjs/components/Button/index.js.map +1 -1
- package/dist/commonjs/components/Chip/index.js +8 -4
- package/dist/commonjs/components/Chip/index.js.map +1 -1
- package/dist/commonjs/components/HighlightedText/index.js +20 -16
- package/dist/commonjs/components/HighlightedText/index.js.map +1 -1
- package/dist/commonjs/components/InformationStatus/index.js +1 -1
- package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js +4 -4
- package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js.map +1 -1
- package/dist/commonjs/components/InputOTP/enums/index.js +9 -11
- package/dist/commonjs/components/InputOTP/enums/index.js.map +1 -1
- package/dist/commonjs/components/InputOTP/index.js +1 -1
- package/dist/commonjs/components/Seal/index.js +1 -1
- package/dist/commonjs/components/Title/index.js +1 -1
- package/dist/commonjs/components/Toggle/enums/variant.js +8 -8
- package/dist/commonjs/components/Toggle/enums/variant.js.map +1 -1
- package/dist/commonjs/components/Toggle/index.js +2 -2
- package/dist/commonjs/components/Toggle/index.js.map +1 -1
- package/dist/commonjs/components/Typography/assets/class-variants.js +59 -0
- package/dist/commonjs/components/Typography/assets/class-variants.js.map +1 -0
- package/dist/commonjs/components/Typography/index.js +10 -6
- package/dist/commonjs/components/Typography/index.js.map +1 -1
- package/dist/commonjs/components/index.js +97 -9
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/hooks/use-fonts.js +8 -0
- package/dist/commonjs/hooks/use-fonts.js.map +1 -1
- package/dist/commonjs/iconography/Icons/index.js +7 -8
- package/dist/commonjs/iconography/Icons/index.js.map +1 -1
- package/dist/module/components/Button/assets/class-variants.js +0 -5
- package/dist/module/components/Button/assets/class-variants.js.map +1 -1
- package/dist/module/components/Button/index.js +12 -5
- package/dist/module/components/Button/index.js.map +1 -1
- package/dist/module/components/Chip/index.js +9 -5
- package/dist/module/components/Chip/index.js.map +1 -1
- package/dist/module/components/HighlightedText/index.js +20 -16
- package/dist/module/components/HighlightedText/index.js.map +1 -1
- package/dist/module/components/InformationStatus/index.js +1 -1
- package/dist/module/components/InformationStatus/index.js.map +1 -1
- package/dist/module/components/InputOTP/components/InformationStatus/index.js +2 -2
- package/dist/module/components/InputOTP/components/InformationStatus/index.js.map +1 -1
- package/dist/module/components/InputOTP/enums/index.js +8 -1
- package/dist/module/components/InputOTP/enums/index.js.map +1 -1
- package/dist/module/components/InputOTP/index.js +1 -1
- package/dist/module/components/InputOTP/index.js.map +1 -1
- package/dist/module/components/Seal/index.js +1 -1
- package/dist/module/components/Seal/index.js.map +1 -1
- package/dist/module/components/Title/index.js +1 -1
- package/dist/module/components/Title/index.js.map +1 -1
- package/dist/module/components/Toggle/enums/variant.js +7 -7
- package/dist/module/components/Toggle/enums/variant.js.map +1 -1
- package/dist/module/components/Toggle/index.js +3 -3
- package/dist/module/components/Toggle/index.js.map +1 -1
- package/dist/module/components/Typography/assets/class-variants.js +55 -0
- package/dist/module/components/Typography/assets/class-variants.js.map +1 -0
- package/dist/module/components/Typography/index.js +10 -6
- package/dist/module/components/Typography/index.js.map +1 -1
- package/dist/module/components/index.js +8 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/hooks/use-fonts.js +8 -0
- package/dist/module/hooks/use-fonts.js.map +1 -1
- package/dist/module/iconography/Icons/index.js +9 -10
- package/dist/module/iconography/Icons/index.js.map +1 -1
- package/dist/package.json +3 -4
- package/dist/typescript/components/Button/assets/class-variants.d.ts +0 -1
- package/dist/typescript/components/Button/index.d.ts +2 -2
- package/dist/typescript/components/Chip/index.d.ts +2 -1
- package/dist/typescript/components/HighlightedText/index.d.ts +1 -0
- package/dist/typescript/components/HighlightedText/types.d.ts +9 -3
- package/dist/typescript/components/InputOTP/enums/index.d.ts +7 -1
- package/dist/typescript/components/Toggle/enums/variant.d.ts +1 -1
- package/dist/typescript/components/Toggle/types.d.ts +2 -2
- package/dist/typescript/components/Typography/assets/class-variants.d.ts +4 -0
- package/dist/typescript/components/Typography/index.d.ts +3 -3
- package/dist/typescript/components/Typography/types.d.ts +3 -3
- package/dist/typescript/components/index.d.ts +17 -0
- package/dist/typescript/iconography/Icons/index.d.ts +1 -1
- package/package.json +12 -14
- package/src/components/Button/assets/class-variants.ts +0 -5
- package/src/components/Button/index.tsx +25 -7
- package/src/components/Chip/index.tsx +17 -9
- package/src/components/HighlightedText/index.stories.tsx +117 -18
- package/src/components/HighlightedText/index.tsx +36 -16
- package/src/components/HighlightedText/types.ts +9 -3
- package/src/components/InformationStatus/index.tsx +1 -1
- package/src/components/InputOTP/components/InformationStatus/index.tsx +2 -2
- package/src/components/InputOTP/enums/index.ts +7 -1
- package/src/components/InputOTP/index.stories.tsx +13 -4
- package/src/components/InputOTP/index.tsx +1 -1
- package/src/components/Seal/index.tsx +1 -1
- package/src/components/Title/index.stories.tsx +186 -76
- package/src/components/Title/index.tsx +1 -1
- package/src/components/Toggle/enums/variant.ts +1 -1
- package/src/components/Toggle/index.stories.tsx +19 -19
- package/src/components/Toggle/index.tsx +3 -3
- package/src/components/Toggle/types.ts +2 -2
- package/src/components/Typography/assets/class-variants.ts +56 -0
- package/src/components/Typography/index.stories.tsx +117 -159
- package/src/components/Typography/index.tsx +10 -6
- package/src/components/Typography/types.ts +5 -3
- package/src/components/index.ts +27 -0
- package/src/hooks/use-fonts.ts +8 -0
- package/src/iconography/Icons/index.tsx +21 -15
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/fonts/Nunito-Bold.ttf +0 -0
- package/assets/fonts/Nunito-BoldItalic.ttf +0 -0
- package/assets/fonts/Nunito-Italic.ttf +0 -0
- package/assets/fonts/Nunito-Medium.ttf +0 -0
- package/assets/fonts/Nunito-MediumItalic.ttf +0 -0
- package/assets/fonts/Nunito-Regular.ttf +0 -0
- package/assets/fonts/Nunito-SemiBold.ttf +0 -0
- package/assets/fonts/Nunito-SemiBoldItalic.ttf +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/dist/commonjs/components/InputOTP/enums/information-status.js +0 -15
- package/dist/commonjs/components/InputOTP/enums/information-status.js.map +0 -1
- package/dist/module/components/InputOTP/enums/information-status.js +0 -11
- package/dist/module/components/InputOTP/enums/information-status.js.map +0 -1
- package/dist/typescript/components/InputOTP/enums/information-status.d.ts +0 -7
- package/src/components/InputOTP/enums/information-status.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kivid/native-components",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "A React Native component library for the Butterfly Design System.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"main": "index.js",
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
18
|
-
"src"
|
|
19
|
-
"assets"
|
|
18
|
+
"src"
|
|
20
19
|
],
|
|
21
20
|
"exports": {
|
|
22
21
|
".": {
|
|
@@ -50,21 +49,22 @@
|
|
|
50
49
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
51
50
|
"@react-native-community/datetimepicker": "8.4.1",
|
|
52
51
|
"@react-native-community/slider": "4.5.6",
|
|
53
|
-
"expo": "~53.0.9",
|
|
54
52
|
"expo-constants": "~17.1.6",
|
|
55
53
|
"expo-font": "~13.3.2",
|
|
56
54
|
"expo-splash-screen": "^0.30.10",
|
|
57
55
|
"expo-status-bar": "~2.2.3",
|
|
56
|
+
"expo": "~53.0.9",
|
|
58
57
|
"nativewind": "^4.1.23",
|
|
59
|
-
"react": "19.0.0",
|
|
60
58
|
"react-dom": "19.0.0",
|
|
61
|
-
"react-native": "0.79.5",
|
|
62
59
|
"react-native-gesture-handler": "~2.24.0",
|
|
63
60
|
"react-native-reanimated": "~3.17.5",
|
|
64
61
|
"react-native-safe-area-context": "5.4.0",
|
|
65
62
|
"react-native-svg": "^15.11.2",
|
|
66
63
|
"react-native-web": "^0.20.0",
|
|
67
|
-
"
|
|
64
|
+
"react-native": "0.79.5",
|
|
65
|
+
"react": "19.0.0",
|
|
66
|
+
"@kivid/tailwind-preset": "1.0.0-alpha.4",
|
|
67
|
+
"@kivid/icons": "1.0.0-alpha.4"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.24.0",
|
|
@@ -95,8 +95,7 @@
|
|
|
95
95
|
"storybook": "^9",
|
|
96
96
|
"tailwindcss": "^3.4.17",
|
|
97
97
|
"typescript": "~5.8.3",
|
|
98
|
-
"vite": "^6.3.5"
|
|
99
|
-
"@butterfly/tailwind-preset": "npm:@kivid/tailwind-preset@1.0.0-alpha.1"
|
|
98
|
+
"vite": "^6.3.5"
|
|
100
99
|
},
|
|
101
100
|
"peerDependencies": {
|
|
102
101
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
|
@@ -104,8 +103,7 @@
|
|
|
104
103
|
"lottie-react-native": "^7.2.4",
|
|
105
104
|
"react": "19.0.0",
|
|
106
105
|
"react-native": "0.79.5",
|
|
107
|
-
"@
|
|
108
|
-
"@butterfly/tailwind-preset": "npm:@kivid/tailwind-preset@1.0.0-alpha.1"
|
|
106
|
+
"@kivid/icons": "1.0.0-alpha.4"
|
|
109
107
|
},
|
|
110
108
|
"eslintIgnore": [
|
|
111
109
|
"node_modules/",
|
|
@@ -121,8 +119,8 @@
|
|
|
121
119
|
"storybook:web": "storybook dev -p 6006",
|
|
122
120
|
"build-storybook": "storybook build",
|
|
123
121
|
"storybook-generate": "sb-rn-get-stories",
|
|
124
|
-
"storybook": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo
|
|
125
|
-
"storybook:ios": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo
|
|
126
|
-
"storybook:android": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo
|
|
122
|
+
"storybook": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo run",
|
|
123
|
+
"storybook:ios": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo run:ios",
|
|
124
|
+
"storybook:android": "cross-env EXPO_PUBLIC_STORYBOOK_ENABLED='true' expo run:android"
|
|
127
125
|
}
|
|
128
126
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { merge } from "@
|
|
2
|
+
import { Pressable, Animated, GestureResponderEvent } from "react-native";
|
|
3
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
4
4
|
import { LoadingDots } from "../LoadingDots";
|
|
5
5
|
import { LoadingDotsVariant } from "../LoadingDots/types";
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
|
+
ButtonCorners,
|
|
8
|
+
ButtonProps,
|
|
9
|
+
ButtonSize,
|
|
10
|
+
ButtonVariant,
|
|
11
|
+
} from "./types";
|
|
12
|
+
import { Typography } from "../Typography";
|
|
7
13
|
import {
|
|
8
14
|
textVariants,
|
|
9
15
|
buttonVariants,
|
|
@@ -43,11 +49,18 @@ export function Button(props: ButtonProps) {
|
|
|
43
49
|
ghost: "grape",
|
|
44
50
|
};
|
|
45
51
|
|
|
52
|
+
const typographyVariantMap = {
|
|
53
|
+
small: "label_small" as const,
|
|
54
|
+
medium: "label_medium" as const,
|
|
55
|
+
large: "label_large" as const,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const typographyVariant = typographyVariantMap[size ?? "medium"];
|
|
59
|
+
|
|
46
60
|
function renderContent() {
|
|
47
61
|
const textStyle = merge(
|
|
48
62
|
textVariants({
|
|
49
63
|
variant,
|
|
50
|
-
size,
|
|
51
64
|
selected: selected && (variant === "outline" || variant === "ghost"),
|
|
52
65
|
})
|
|
53
66
|
);
|
|
@@ -63,9 +76,14 @@ export function Button(props: ButtonProps) {
|
|
|
63
76
|
}
|
|
64
77
|
|
|
65
78
|
return (
|
|
66
|
-
<
|
|
79
|
+
<Typography
|
|
80
|
+
variant={typographyVariant}
|
|
81
|
+
weight="700"
|
|
82
|
+
className={textStyle}
|
|
83
|
+
numberOfLines={1}
|
|
84
|
+
>
|
|
67
85
|
{children}
|
|
68
|
-
</
|
|
86
|
+
</Typography>
|
|
69
87
|
);
|
|
70
88
|
}
|
|
71
89
|
|
|
@@ -134,4 +152,4 @@ export function Button(props: ButtonProps) {
|
|
|
134
152
|
|
|
135
153
|
Button.displayName = "Button";
|
|
136
154
|
|
|
137
|
-
export
|
|
155
|
+
export { ButtonProps, ButtonVariant, ButtonSize, ButtonCorners };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { merge } from "@
|
|
2
|
-
import type { ChipProps } from "./types";
|
|
1
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
2
|
+
import type { ChipProps, ChipSize, ChipVariant } from "./types";
|
|
3
3
|
import { chipVariants } from "./assets/class-variants";
|
|
4
4
|
import { Seal } from "../Seal";
|
|
5
|
-
import {
|
|
5
|
+
import { View } from "react-native";
|
|
6
6
|
import { SealVariantEnum } from "../Seal/enums";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
7
8
|
|
|
8
9
|
export function Chip(props: ChipProps) {
|
|
9
10
|
const {
|
|
@@ -14,11 +15,10 @@ export function Chip(props: ChipProps) {
|
|
|
14
15
|
variant = "outline",
|
|
15
16
|
} = props;
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
variant === "filled" ? "text-chia-200" : "text-chia-900"
|
|
21
|
-
);
|
|
18
|
+
const typographyVariant = size === "medium" ? "label_small" : "label_medium";
|
|
19
|
+
|
|
20
|
+
const textColorClass =
|
|
21
|
+
variant === "filled" ? "text-chia-200" : "text-chia-900";
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<View
|
|
@@ -29,7 +29,15 @@ export function Chip(props: ChipProps) {
|
|
|
29
29
|
inverted={variant === "filled"}
|
|
30
30
|
size="small"
|
|
31
31
|
/>
|
|
32
|
-
<
|
|
32
|
+
<Typography
|
|
33
|
+
variant={typographyVariant}
|
|
34
|
+
weight="700"
|
|
35
|
+
className={merge("mx-auto", textColorClass)}
|
|
36
|
+
>
|
|
37
|
+
{label}
|
|
38
|
+
</Typography>
|
|
33
39
|
</View>
|
|
34
40
|
);
|
|
35
41
|
}
|
|
42
|
+
|
|
43
|
+
export { ChipProps, ChipSize, ChipVariant };
|
|
@@ -15,10 +15,33 @@ const meta = {
|
|
|
15
15
|
highlightText: {
|
|
16
16
|
control: "text",
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
control: "
|
|
18
|
+
variant: {
|
|
19
|
+
control: "select",
|
|
20
|
+
options: [
|
|
21
|
+
"label_small",
|
|
22
|
+
"label_medium",
|
|
23
|
+
"label_large",
|
|
24
|
+
"body_small",
|
|
25
|
+
"body_medium",
|
|
26
|
+
"body_large",
|
|
27
|
+
"title_small",
|
|
28
|
+
"title_medium",
|
|
29
|
+
"title_large",
|
|
30
|
+
"headline_small",
|
|
31
|
+
"headline_medium",
|
|
32
|
+
"headline_large",
|
|
33
|
+
"display_small",
|
|
34
|
+
"display_medium",
|
|
35
|
+
"display_large",
|
|
36
|
+
],
|
|
37
|
+
description: "Typography variant for the base text",
|
|
20
38
|
},
|
|
21
|
-
|
|
39
|
+
weight: {
|
|
40
|
+
control: "select",
|
|
41
|
+
options: ["400", "500", "600", "700"],
|
|
42
|
+
description: "Typography weight for the base text",
|
|
43
|
+
},
|
|
44
|
+
className: {
|
|
22
45
|
control: "text",
|
|
23
46
|
},
|
|
24
47
|
reverse: {
|
|
@@ -26,6 +49,11 @@ const meta = {
|
|
|
26
49
|
description:
|
|
27
50
|
"If true, the highlighted text will be displayed before the regular text.",
|
|
28
51
|
},
|
|
52
|
+
highlightedTextProps: {
|
|
53
|
+
control: "object",
|
|
54
|
+
description:
|
|
55
|
+
"Props for the highlighted text Typography component (className, variant, weight)",
|
|
56
|
+
},
|
|
29
57
|
},
|
|
30
58
|
} satisfies Meta<typeof HighlightedText>;
|
|
31
59
|
|
|
@@ -49,8 +77,12 @@ export const LabelVariant: Story = {
|
|
|
49
77
|
args: {
|
|
50
78
|
text: "Label text",
|
|
51
79
|
highlightText: "important",
|
|
52
|
-
|
|
53
|
-
|
|
80
|
+
variant: "label_medium",
|
|
81
|
+
weight: "400",
|
|
82
|
+
highlightedTextProps: {
|
|
83
|
+
variant: "label_medium",
|
|
84
|
+
weight: "700",
|
|
85
|
+
},
|
|
54
86
|
},
|
|
55
87
|
};
|
|
56
88
|
|
|
@@ -58,8 +90,12 @@ export const BodyVariant: Story = {
|
|
|
58
90
|
args: {
|
|
59
91
|
text: "Body text content",
|
|
60
92
|
highlightText: "highlighted part",
|
|
61
|
-
|
|
62
|
-
|
|
93
|
+
variant: "body_medium",
|
|
94
|
+
weight: "400",
|
|
95
|
+
highlightedTextProps: {
|
|
96
|
+
variant: "body_medium",
|
|
97
|
+
weight: "700",
|
|
98
|
+
},
|
|
63
99
|
},
|
|
64
100
|
};
|
|
65
101
|
|
|
@@ -67,17 +103,25 @@ export const TitleVariant: Story = {
|
|
|
67
103
|
args: {
|
|
68
104
|
text: "Title text content",
|
|
69
105
|
highlightText: "highlighted part",
|
|
70
|
-
|
|
71
|
-
|
|
106
|
+
variant: "title_medium",
|
|
107
|
+
weight: "400",
|
|
108
|
+
highlightedTextProps: {
|
|
109
|
+
variant: "title_medium",
|
|
110
|
+
weight: "700",
|
|
111
|
+
},
|
|
72
112
|
},
|
|
73
113
|
};
|
|
74
114
|
|
|
75
|
-
export const
|
|
115
|
+
export const HeadingVariant: Story = {
|
|
76
116
|
args: {
|
|
77
|
-
text: "
|
|
117
|
+
text: "Heading text content",
|
|
78
118
|
highlightText: "highlighted part",
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
variant: "headline_medium",
|
|
120
|
+
weight: "400",
|
|
121
|
+
highlightedTextProps: {
|
|
122
|
+
variant: "headline_medium",
|
|
123
|
+
weight: "700",
|
|
124
|
+
},
|
|
81
125
|
},
|
|
82
126
|
};
|
|
83
127
|
|
|
@@ -85,8 +129,12 @@ export const DisplayVariant: Story = {
|
|
|
85
129
|
args: {
|
|
86
130
|
text: "Display text content",
|
|
87
131
|
highlightText: "highlighted part",
|
|
88
|
-
|
|
89
|
-
|
|
132
|
+
variant: "display_medium",
|
|
133
|
+
weight: "400",
|
|
134
|
+
highlightedTextProps: {
|
|
135
|
+
variant: "display_medium",
|
|
136
|
+
weight: "700",
|
|
137
|
+
},
|
|
90
138
|
},
|
|
91
139
|
};
|
|
92
140
|
|
|
@@ -94,8 +142,14 @@ export const WithCustomClasses: Story = {
|
|
|
94
142
|
args: {
|
|
95
143
|
text: "Styled text",
|
|
96
144
|
highlightText: "with custom styling",
|
|
145
|
+
variant: "body_medium",
|
|
146
|
+
weight: "400",
|
|
97
147
|
className: "text-tangerine-900",
|
|
98
|
-
|
|
148
|
+
highlightedTextProps: {
|
|
149
|
+
variant: "body_medium",
|
|
150
|
+
weight: "600",
|
|
151
|
+
className: "text-mango-900 underline",
|
|
152
|
+
},
|
|
99
153
|
},
|
|
100
154
|
};
|
|
101
155
|
|
|
@@ -103,8 +157,53 @@ export const ReverseHighlight: Story = {
|
|
|
103
157
|
args: {
|
|
104
158
|
text: "text with reverse highlight",
|
|
105
159
|
highlightText: "Highlighted first",
|
|
160
|
+
variant: "label_medium",
|
|
161
|
+
weight: "400",
|
|
106
162
|
reverse: true,
|
|
107
|
-
|
|
108
|
-
|
|
163
|
+
highlightedTextProps: {
|
|
164
|
+
variant: "label_medium",
|
|
165
|
+
weight: "700",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const WeightVariations: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
text: "Different weight for",
|
|
173
|
+
highlightText: "highlighted text",
|
|
174
|
+
variant: "body_medium",
|
|
175
|
+
weight: "400",
|
|
176
|
+
highlightedTextProps: {
|
|
177
|
+
variant: "body_medium",
|
|
178
|
+
weight: "600",
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const MixedStyling: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
text: "Typography props with",
|
|
186
|
+
highlightText: "custom classes",
|
|
187
|
+
variant: "body_medium",
|
|
188
|
+
weight: "400",
|
|
189
|
+
className: "text-blue-600",
|
|
190
|
+
highlightedTextProps: {
|
|
191
|
+
variant: "title_small",
|
|
192
|
+
weight: "700",
|
|
193
|
+
className: "text-red-500 underline",
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const BaseTextVariations: Story = {
|
|
199
|
+
args: {
|
|
200
|
+
text: "Large title base text with",
|
|
201
|
+
highlightText: "small label highlight",
|
|
202
|
+
variant: "title_large",
|
|
203
|
+
weight: "600",
|
|
204
|
+
highlightedTextProps: {
|
|
205
|
+
variant: "label_small",
|
|
206
|
+
weight: "700",
|
|
207
|
+
},
|
|
109
208
|
},
|
|
110
209
|
};
|
|
@@ -1,38 +1,58 @@
|
|
|
1
1
|
import type { HighlightedTextProps } from "./types";
|
|
2
|
-
import {
|
|
3
|
-
import { Text } from "react-native";
|
|
2
|
+
import { Typography } from "../Typography";
|
|
4
3
|
|
|
5
4
|
export function HighlightedText(props: HighlightedTextProps) {
|
|
6
5
|
const {
|
|
7
6
|
text,
|
|
8
7
|
highlightText,
|
|
9
8
|
className,
|
|
10
|
-
highlightTextClassName,
|
|
11
9
|
reverse,
|
|
12
|
-
|
|
10
|
+
highlightedTextProps = {},
|
|
11
|
+
variant = "label_medium",
|
|
12
|
+
weight = "400",
|
|
13
13
|
...rest
|
|
14
14
|
} = props;
|
|
15
15
|
|
|
16
|
-
const mergeClassName = merge("text-label_medium_300", className);
|
|
17
|
-
const mergeHighlightClassName = merge(
|
|
18
|
-
"text-label_medium_700",
|
|
19
|
-
highlightTextClassName
|
|
20
|
-
);
|
|
21
|
-
|
|
22
16
|
if (reverse) {
|
|
23
17
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
<Typography
|
|
19
|
+
variant={variant}
|
|
20
|
+
weight={weight}
|
|
21
|
+
className={className}
|
|
22
|
+
{...rest}
|
|
23
|
+
>
|
|
24
|
+
<Typography
|
|
25
|
+
variant={highlightedTextProps.variant}
|
|
26
|
+
weight={highlightedTextProps.weight}
|
|
27
|
+
{...highlightedTextProps}
|
|
28
|
+
>
|
|
29
|
+
{highlightText}
|
|
30
|
+
</Typography>{" "}
|
|
31
|
+
{text}
|
|
32
|
+
</Typography>
|
|
27
33
|
);
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
<Typography
|
|
38
|
+
variant={variant}
|
|
39
|
+
weight={weight}
|
|
40
|
+
className={className}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
{text}{" "}
|
|
44
|
+
<Typography
|
|
45
|
+
variant={highlightedTextProps.variant || "label_medium"}
|
|
46
|
+
weight={highlightedTextProps.weight || "700"}
|
|
47
|
+
{...highlightedTextProps}
|
|
48
|
+
>
|
|
49
|
+
{highlightText}
|
|
50
|
+
</Typography>
|
|
51
|
+
</Typography>
|
|
34
52
|
);
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
HighlightedText.displayName = "HighlightedText";
|
|
38
56
|
export default HighlightedText;
|
|
57
|
+
|
|
58
|
+
export { HighlightedTextProps };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextProps } from "react-native";
|
|
2
|
+
import type { TypographyProps } from "../Typography/types";
|
|
2
3
|
|
|
3
4
|
export interface HighlightedTextProps extends TextProps {
|
|
4
5
|
text: string;
|
|
5
6
|
highlightText?: string;
|
|
6
|
-
highlightTextClassName?: string;
|
|
7
7
|
className?: string;
|
|
8
|
-
ref?: React.RefObject<Text | null>;
|
|
9
8
|
reverse?: boolean;
|
|
9
|
+
variant?: TypographyProps["variant"];
|
|
10
|
+
weight?: TypographyProps["weight"];
|
|
11
|
+
highlightedTextProps?: {
|
|
12
|
+
className?: string;
|
|
13
|
+
variant?: TypographyProps["variant"];
|
|
14
|
+
weight?: TypographyProps["weight"];
|
|
15
|
+
};
|
|
10
16
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import type { InformationStatusProps } from "./types";
|
|
8
8
|
import { InformationStatusOptionsEnum } from "./enums";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
|
-
import { merge } from "@
|
|
10
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
11
11
|
import { View } from "react-native";
|
|
12
12
|
|
|
13
13
|
export function InformationStatus(props: InformationStatusProps) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import type { InformationStatusProps } from "./types";
|
|
5
5
|
|
|
6
|
-
import { merge } from "@
|
|
7
|
-
import Button from "../../../Button";
|
|
6
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
7
|
+
import { Button } from "../../../Button";
|
|
8
8
|
import { HighlightedText } from "../../../HighlightedText";
|
|
9
9
|
import LoadingDots from "../../../LoadingDots";
|
|
10
10
|
import { Chip } from "../../../Chip";
|
|
@@ -3,6 +3,7 @@ import { InputOTP } from "./index";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Text, View } from "react-native";
|
|
5
5
|
import { InformationStatusEnum } from "./enums";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof InputOTP> = {
|
|
8
9
|
title: "Components/InputOTP",
|
|
@@ -106,12 +107,20 @@ export const WithCustomInformation: Story = {
|
|
|
106
107
|
{...args}
|
|
107
108
|
customInformation={
|
|
108
109
|
<View>
|
|
109
|
-
<
|
|
110
|
+
<Typography
|
|
111
|
+
variant="label_medium"
|
|
112
|
+
weight="700"
|
|
113
|
+
className="text-blackberry-500"
|
|
114
|
+
>
|
|
110
115
|
O código realmente é esse?
|
|
111
|
-
</
|
|
112
|
-
<
|
|
116
|
+
</Typography>
|
|
117
|
+
<Typography
|
|
118
|
+
variant="label_medium"
|
|
119
|
+
weight="700"
|
|
120
|
+
className="text-chia-900"
|
|
121
|
+
>
|
|
113
122
|
Tente novamente
|
|
114
|
-
</
|
|
123
|
+
</Typography>
|
|
115
124
|
</View>
|
|
116
125
|
}
|
|
117
126
|
/>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
TextInputChangeEventData,
|
|
10
10
|
} from "react-native";
|
|
11
11
|
import type { InputOTPProps } from "./types";
|
|
12
|
-
import { merge } from "@
|
|
12
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
13
13
|
import { InformationStatus } from "./components";
|
|
14
14
|
import { InformationStatusEnum } from "./enums";
|
|
15
15
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
LeftIcon,
|
|
13
13
|
AlertIcon,
|
|
14
14
|
} from "./components";
|
|
15
|
-
import { merge } from "@
|
|
15
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
16
16
|
import { sealVariants } from "./assets/class-variants";
|
|
17
17
|
|
|
18
18
|
export const Seal: React.FC<SealProps> = ({
|