@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.
Files changed (100) hide show
  1. package/dist/commonjs/components/Button/assets/class-variants.js +0 -5
  2. package/dist/commonjs/components/Button/assets/class-variants.js.map +1 -1
  3. package/dist/commonjs/components/Button/index.js +10 -4
  4. package/dist/commonjs/components/Button/index.js.map +1 -1
  5. package/dist/commonjs/components/Chip/index.js +7 -3
  6. package/dist/commonjs/components/Chip/index.js.map +1 -1
  7. package/dist/commonjs/components/HighlightedText/index.js +20 -16
  8. package/dist/commonjs/components/HighlightedText/index.js.map +1 -1
  9. package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js +3 -3
  10. package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js.map +1 -1
  11. package/dist/commonjs/components/InputOTP/enums/index.js +9 -11
  12. package/dist/commonjs/components/InputOTP/enums/index.js.map +1 -1
  13. package/dist/commonjs/components/Toggle/enums/variant.js +8 -8
  14. package/dist/commonjs/components/Toggle/enums/variant.js.map +1 -1
  15. package/dist/commonjs/components/Toggle/index.js +1 -1
  16. package/dist/commonjs/components/Toggle/index.js.map +1 -1
  17. package/dist/commonjs/components/Typography/assets/class-variants.js +59 -0
  18. package/dist/commonjs/components/Typography/assets/class-variants.js.map +1 -0
  19. package/dist/commonjs/components/Typography/index.js +9 -5
  20. package/dist/commonjs/components/Typography/index.js.map +1 -1
  21. package/dist/commonjs/components/index.js +97 -9
  22. package/dist/commonjs/components/index.js.map +1 -1
  23. package/dist/commonjs/hooks/use-fonts.js +8 -0
  24. package/dist/commonjs/hooks/use-fonts.js.map +1 -1
  25. package/dist/module/components/Button/assets/class-variants.js +0 -5
  26. package/dist/module/components/Button/assets/class-variants.js.map +1 -1
  27. package/dist/module/components/Button/index.js +11 -4
  28. package/dist/module/components/Button/index.js.map +1 -1
  29. package/dist/module/components/Chip/index.js +8 -4
  30. package/dist/module/components/Chip/index.js.map +1 -1
  31. package/dist/module/components/HighlightedText/index.js +20 -16
  32. package/dist/module/components/HighlightedText/index.js.map +1 -1
  33. package/dist/module/components/InputOTP/components/InformationStatus/index.js +1 -1
  34. package/dist/module/components/InputOTP/components/InformationStatus/index.js.map +1 -1
  35. package/dist/module/components/InputOTP/enums/index.js +8 -1
  36. package/dist/module/components/InputOTP/enums/index.js.map +1 -1
  37. package/dist/module/components/Toggle/enums/variant.js +7 -7
  38. package/dist/module/components/Toggle/enums/variant.js.map +1 -1
  39. package/dist/module/components/Toggle/index.js +2 -2
  40. package/dist/module/components/Toggle/index.js.map +1 -1
  41. package/dist/module/components/Typography/assets/class-variants.js +55 -0
  42. package/dist/module/components/Typography/assets/class-variants.js.map +1 -0
  43. package/dist/module/components/Typography/index.js +9 -5
  44. package/dist/module/components/Typography/index.js.map +1 -1
  45. package/dist/module/components/index.js +8 -0
  46. package/dist/module/components/index.js.map +1 -1
  47. package/dist/module/hooks/use-fonts.js +8 -0
  48. package/dist/module/hooks/use-fonts.js.map +1 -1
  49. package/dist/package.json +1 -2
  50. package/dist/typescript/components/Button/assets/class-variants.d.ts +0 -1
  51. package/dist/typescript/components/Button/index.d.ts +2 -2
  52. package/dist/typescript/components/Chip/index.d.ts +2 -1
  53. package/dist/typescript/components/HighlightedText/index.d.ts +1 -0
  54. package/dist/typescript/components/HighlightedText/types.d.ts +9 -3
  55. package/dist/typescript/components/InputOTP/enums/index.d.ts +7 -1
  56. package/dist/typescript/components/Toggle/enums/variant.d.ts +1 -1
  57. package/dist/typescript/components/Toggle/types.d.ts +2 -2
  58. package/dist/typescript/components/Typography/assets/class-variants.d.ts +4 -0
  59. package/dist/typescript/components/Typography/index.d.ts +3 -3
  60. package/dist/typescript/components/Typography/types.d.ts +3 -3
  61. package/dist/typescript/components/index.d.ts +17 -0
  62. package/package.json +12 -14
  63. package/src/components/Button/assets/class-variants.ts +0 -5
  64. package/src/components/Button/index.tsx +24 -6
  65. package/src/components/Chip/index.tsx +16 -8
  66. package/src/components/HighlightedText/index.stories.tsx +117 -18
  67. package/src/components/HighlightedText/index.tsx +36 -16
  68. package/src/components/HighlightedText/types.ts +9 -3
  69. package/src/components/InputOTP/components/InformationStatus/index.tsx +1 -1
  70. package/src/components/InputOTP/enums/index.ts +7 -1
  71. package/src/components/InputOTP/index.stories.tsx +13 -4
  72. package/src/components/Title/index.stories.tsx +185 -75
  73. package/src/components/Toggle/enums/variant.ts +1 -1
  74. package/src/components/Toggle/index.stories.tsx +19 -19
  75. package/src/components/Toggle/index.tsx +2 -2
  76. package/src/components/Toggle/types.ts +2 -2
  77. package/src/components/Typography/assets/class-variants.ts +56 -0
  78. package/src/components/Typography/index.stories.tsx +117 -159
  79. package/src/components/Typography/index.tsx +9 -5
  80. package/src/components/Typography/types.ts +5 -3
  81. package/src/components/index.ts +27 -0
  82. package/src/hooks/use-fonts.ts +8 -0
  83. package/assets/adaptive-icon.png +0 -0
  84. package/assets/favicon.png +0 -0
  85. package/assets/fonts/Nunito-Bold.ttf +0 -0
  86. package/assets/fonts/Nunito-BoldItalic.ttf +0 -0
  87. package/assets/fonts/Nunito-Italic.ttf +0 -0
  88. package/assets/fonts/Nunito-Medium.ttf +0 -0
  89. package/assets/fonts/Nunito-MediumItalic.ttf +0 -0
  90. package/assets/fonts/Nunito-Regular.ttf +0 -0
  91. package/assets/fonts/Nunito-SemiBold.ttf +0 -0
  92. package/assets/fonts/Nunito-SemiBoldItalic.ttf +0 -0
  93. package/assets/icon.png +0 -0
  94. package/assets/splash.png +0 -0
  95. package/dist/commonjs/components/InputOTP/enums/information-status.js +0 -15
  96. package/dist/commonjs/components/InputOTP/enums/information-status.js.map +0 -1
  97. package/dist/module/components/InputOTP/enums/information-status.js +0 -11
  98. package/dist/module/components/InputOTP/enums/information-status.js.map +0 -1
  99. package/dist/typescript/components/InputOTP/enums/information-status.d.ts +0 -7
  100. 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
- className: {
19
- control: "text",
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
- highlightTextClassName: {
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
- className: "text-label_medium_300",
53
- highlightTextClassName: "text-label_medium_700",
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
- className: "text-body_medium_300",
62
- highlightTextClassName: "text-body_medium_700",
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
- className: "text-title_medium_300",
71
- highlightTextClassName: "text-title_medium_700",
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 HeadlineVariant: Story = {
115
+ export const HeadingVariant: Story = {
76
116
  args: {
77
- text: "Headline text content",
117
+ text: "Heading text content",
78
118
  highlightText: "highlighted part",
79
- className: "text-headline_medium_300",
80
- highlightTextClassName: "text-headline_medium_700",
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
- className: "text-display_medium_300",
89
- highlightTextClassName: "text-display_medium_700",
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
- highlightTextClassName: "text-mango-900 underline",
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
- className: "text-label_medium_300",
108
- highlightTextClassName: "text-label_medium_700",
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 { merge } from "@kivid/tailwind-preset";
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
- ref,
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
- <Text ref={ref} className={mergeClassName} {...rest}>
25
- <Text className={mergeHighlightClassName}>{highlightText}</Text> {text}
26
- </Text>
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
- <Text ref={ref} className={mergeClassName} {...rest}>
32
- {text} <Text className={mergeHighlightClassName}>{highlightText}</Text>
33
- </Text>
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 { Text, TextProps } from "react-native";
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";
@@ -1 +1,7 @@
1
- export * from "./information-status";
1
+ export enum InformationStatusEnum {
2
+ DEFAULT = "default",
3
+ ERROR = "error",
4
+ SUCCESS = "success",
5
+ LOADING = "loading",
6
+ COOLDOWN = "cooldown",
7
+ }
@@ -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
- <Text className="text-label_medium_700 text-blackberry-500">
110
+ <Typography
111
+ variant="label_medium"
112
+ weight="700"
113
+ className="text-blackberry-500"
114
+ >
110
115
  O código realmente é esse?
111
- </Text>
112
- <Text className="text-label_medium_700 text-chia-900">
116
+ </Typography>
117
+ <Typography
118
+ variant="label_medium"
119
+ weight="700"
120
+ className="text-chia-900"
121
+ >
113
122
  Tente novamente
114
- </Text>
123
+ </Typography>
115
124
  </View>
116
125
  }
117
126
  />