@kivid/native-components 1.0.0-alpha.2 → 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 +10 -4
- package/dist/commonjs/components/Button/index.js.map +1 -1
- package/dist/commonjs/components/Chip/index.js +7 -3
- 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/InputOTP/components/InformationStatus/index.js +3 -3
- 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/Toggle/enums/variant.js +8 -8
- package/dist/commonjs/components/Toggle/enums/variant.js.map +1 -1
- package/dist/commonjs/components/Toggle/index.js +1 -1
- 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 +9 -5
- 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/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 +11 -4
- package/dist/module/components/Button/index.js.map +1 -1
- package/dist/module/components/Chip/index.js +8 -4
- 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/InputOTP/components/InformationStatus/index.js +1 -1
- 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/Toggle/enums/variant.js +7 -7
- package/dist/module/components/Toggle/enums/variant.js.map +1 -1
- package/dist/module/components/Toggle/index.js +2 -2
- 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 +9 -5
- 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/package.json +1 -2
- 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/package.json +12 -14
- package/src/components/Button/assets/class-variants.ts +0 -5
- package/src/components/Button/index.tsx +24 -6
- package/src/components/Chip/index.tsx +16 -8
- 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/InputOTP/components/InformationStatus/index.tsx +1 -1
- package/src/components/InputOTP/enums/index.ts +7 -1
- package/src/components/InputOTP/index.stories.tsx +13 -4
- package/src/components/Title/index.stories.tsx +185 -75
- package/src/components/Toggle/enums/variant.ts +1 -1
- package/src/components/Toggle/index.stories.tsx +19 -19
- package/src/components/Toggle/index.tsx +2 -2
- 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 +9 -5
- package/src/components/Typography/types.ts +5 -3
- package/src/components/index.ts +27 -0
- package/src/hooks/use-fonts.ts +8 -0
- 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
|
@@ -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
|
}
|
|
@@ -4,7 +4,7 @@ import { useMemo } from "react";
|
|
|
4
4
|
import type { InformationStatusProps } from "./types";
|
|
5
5
|
|
|
6
6
|
import { merge } from "@kivid/tailwind-preset";
|
|
7
|
-
import Button from "../../../Button";
|
|
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
|
/>
|