@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { Platform } from "react-native";
|
|
3
|
+
|
|
4
|
+
const getWeightVariants = () => {
|
|
5
|
+
if (Platform.OS === "web") {
|
|
6
|
+
return {
|
|
7
|
+
"200": "font-[200]",
|
|
8
|
+
"300": "font-[300]",
|
|
9
|
+
"400": "font-[400]",
|
|
10
|
+
"500": "font-[500]",
|
|
11
|
+
"600": "font-[600]",
|
|
12
|
+
"700": "font-[700]",
|
|
13
|
+
"800": "font-[800]",
|
|
14
|
+
"900": "font-[900]",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
"200": "font-nunito-extralight",
|
|
20
|
+
"300": "font-nunito-light",
|
|
21
|
+
"400": "font-nunito-regular",
|
|
22
|
+
"500": "font-nunito-medium",
|
|
23
|
+
"600": "font-nunito-semibold",
|
|
24
|
+
"700": "font-nunito-bold",
|
|
25
|
+
"800": "font-nunito-extrabold",
|
|
26
|
+
"900": "font-nunito-black",
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const typographyVariants = cva("font-nunito-regular", {
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
label_small: "text-[12px] leading-[16px]",
|
|
34
|
+
label_medium: "text-[14px] leading-[16px]",
|
|
35
|
+
label_large: "text-[16px] leading-[18px]",
|
|
36
|
+
body_small: "text-[12px] leading-[16px]",
|
|
37
|
+
body_medium: "text-[14px] leading-[20px]",
|
|
38
|
+
body_large: "text-[16px] leading-[24px]",
|
|
39
|
+
title_small: "text-[16px] leading-[20px]",
|
|
40
|
+
title_medium: "text-[18px] leading-[22px]",
|
|
41
|
+
title_large: "text-[22px] leading-[24px]",
|
|
42
|
+
headline_small: "text-[26px] leading-[32px]",
|
|
43
|
+
headline_medium: "text-[32px] leading-[36px]",
|
|
44
|
+
headline_large: "text-[36px] leading-[40px]",
|
|
45
|
+
display_small: "text-[40px] leading-[48px]",
|
|
46
|
+
display_medium: "text-[44px] leading-[56px]",
|
|
47
|
+
display_large: "text-[56px] leading-[64px]",
|
|
48
|
+
},
|
|
49
|
+
weight: getWeightVariants(),
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
variant: "body_medium",
|
|
54
|
+
weight: "400",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
@@ -1,56 +1,36 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native";
|
|
2
2
|
import { Typography } from "./index";
|
|
3
|
-
import type { TypographyVariant } from "@butterfly/tailwind-preset";
|
|
4
3
|
import { ScrollView, View } from "react-native";
|
|
4
|
+
import type { VariantProps } from "class-variance-authority";
|
|
5
|
+
import { typographyVariants } from "./assets/class-variants";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"text-title_medium_500",
|
|
30
|
-
"text-title_medium_300",
|
|
31
|
-
"text-title_small_700",
|
|
32
|
-
"text-title_small_500",
|
|
33
|
-
"text-title_small_300",
|
|
34
|
-
"text-body_large_700",
|
|
35
|
-
"text-body_large_500",
|
|
36
|
-
"text-body_large_300",
|
|
37
|
-
"text-body_medium_700",
|
|
38
|
-
"text-body_medium_500",
|
|
39
|
-
"text-body_medium_300",
|
|
40
|
-
"text-body_small_700",
|
|
41
|
-
"text-body_small_500",
|
|
42
|
-
"text-body_small_300",
|
|
43
|
-
"text-label_large_700",
|
|
44
|
-
"text-label_large_500",
|
|
45
|
-
"text-label_large_300",
|
|
46
|
-
"text-label_medium_700",
|
|
47
|
-
"text-label_medium_500",
|
|
48
|
-
"text-label_medium_300",
|
|
49
|
-
"text-label_small_700",
|
|
50
|
-
"text-label_small_500",
|
|
51
|
-
"text-label_small_300",
|
|
7
|
+
type TypographyVariant = NonNullable<
|
|
8
|
+
VariantProps<typeof typographyVariants>["variant"]
|
|
9
|
+
>;
|
|
10
|
+
type TypographyWeight = NonNullable<
|
|
11
|
+
VariantProps<typeof typographyVariants>["weight"]
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
const variantOptions = [
|
|
15
|
+
"label_small",
|
|
16
|
+
"label_medium",
|
|
17
|
+
"label_large",
|
|
18
|
+
"body_small",
|
|
19
|
+
"body_medium",
|
|
20
|
+
"body_large",
|
|
21
|
+
"title_small",
|
|
22
|
+
"title_medium",
|
|
23
|
+
"title_large",
|
|
24
|
+
"headline_small",
|
|
25
|
+
"headline_medium",
|
|
26
|
+
"headline_large",
|
|
27
|
+
"display_small",
|
|
28
|
+
"display_medium",
|
|
29
|
+
"display_large",
|
|
52
30
|
];
|
|
53
31
|
|
|
32
|
+
const weightOptions = ["400", "500", "600", "700"];
|
|
33
|
+
|
|
54
34
|
const meta: Meta<typeof Typography> = {
|
|
55
35
|
title: "Components/Typography",
|
|
56
36
|
component: Typography,
|
|
@@ -65,9 +45,14 @@ const meta: Meta<typeof Typography> = {
|
|
|
65
45
|
argTypes: {
|
|
66
46
|
variant: {
|
|
67
47
|
control: { type: "select" },
|
|
68
|
-
options:
|
|
48
|
+
options: variantOptions,
|
|
69
49
|
description: "Typography variant from the design system",
|
|
70
50
|
},
|
|
51
|
+
weight: {
|
|
52
|
+
control: { type: "select" },
|
|
53
|
+
options: weightOptions,
|
|
54
|
+
description: "Font weight",
|
|
55
|
+
},
|
|
71
56
|
children: {
|
|
72
57
|
control: { type: "text" },
|
|
73
58
|
description: "Content to display",
|
|
@@ -78,7 +63,8 @@ const meta: Meta<typeof Typography> = {
|
|
|
78
63
|
},
|
|
79
64
|
},
|
|
80
65
|
args: {
|
|
81
|
-
variant: "
|
|
66
|
+
variant: "body_medium",
|
|
67
|
+
weight: "400",
|
|
82
68
|
children: "Sample text content",
|
|
83
69
|
},
|
|
84
70
|
};
|
|
@@ -88,86 +74,59 @@ type Story = StoryObj<typeof Typography>;
|
|
|
88
74
|
|
|
89
75
|
export const Default: Story = {
|
|
90
76
|
args: {
|
|
91
|
-
variant: "
|
|
77
|
+
variant: "body_medium",
|
|
78
|
+
weight: "400",
|
|
92
79
|
children: "This is the default body text style",
|
|
93
80
|
},
|
|
94
81
|
};
|
|
95
82
|
|
|
96
83
|
export const Interactive: Story = {
|
|
97
84
|
args: {
|
|
98
|
-
variant: "
|
|
99
|
-
|
|
85
|
+
variant: "body_medium",
|
|
86
|
+
weight: "500",
|
|
87
|
+
children:
|
|
88
|
+
"Change the variant and weight using the controls to see different styles",
|
|
100
89
|
},
|
|
101
90
|
};
|
|
102
91
|
|
|
103
|
-
// Comprehensive showcase of all 45 typography variants
|
|
104
92
|
export const AllVariants: Story = {
|
|
105
93
|
render: () => {
|
|
106
|
-
const roles
|
|
107
|
-
display: [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"text-display_medium_500",
|
|
113
|
-
"text-display_medium_300",
|
|
114
|
-
"text-display_small_700",
|
|
115
|
-
"text-display_small_500",
|
|
116
|
-
"text-display_small_300",
|
|
117
|
-
],
|
|
118
|
-
headline: [
|
|
119
|
-
"text-headline_large_700",
|
|
120
|
-
"text-headline_large_500",
|
|
121
|
-
"text-headline_large_300",
|
|
122
|
-
"text-headline_medium_700",
|
|
123
|
-
"text-headline_medium_500",
|
|
124
|
-
"text-headline_medium_300",
|
|
125
|
-
"text-headline_small_700",
|
|
126
|
-
"text-headline_small_500",
|
|
127
|
-
"text-headline_small_300",
|
|
128
|
-
],
|
|
129
|
-
title: [
|
|
130
|
-
"text-title_large_700",
|
|
131
|
-
"text-title_large_500",
|
|
132
|
-
"text-title_large_300",
|
|
133
|
-
"text-title_medium_700",
|
|
134
|
-
"text-title_medium_500",
|
|
135
|
-
"text-title_medium_300",
|
|
136
|
-
"text-title_small_700",
|
|
137
|
-
"text-title_small_500",
|
|
138
|
-
"text-title_small_300",
|
|
139
|
-
],
|
|
140
|
-
body: [
|
|
141
|
-
"text-body_large_700",
|
|
142
|
-
"text-body_large_500",
|
|
143
|
-
"text-body_large_300",
|
|
144
|
-
"text-body_medium_700",
|
|
145
|
-
"text-body_medium_500",
|
|
146
|
-
"text-body_medium_300",
|
|
147
|
-
"text-body_small_700",
|
|
148
|
-
"text-body_small_500",
|
|
149
|
-
"text-body_small_300",
|
|
150
|
-
],
|
|
151
|
-
label: [
|
|
152
|
-
"text-label_large_700",
|
|
153
|
-
"text-label_large_500",
|
|
154
|
-
"text-label_large_300",
|
|
155
|
-
"text-label_medium_700",
|
|
156
|
-
"text-label_medium_500",
|
|
157
|
-
"text-label_medium_300",
|
|
158
|
-
"text-label_small_700",
|
|
159
|
-
"text-label_small_500",
|
|
160
|
-
"text-label_small_300",
|
|
161
|
-
],
|
|
94
|
+
const roles = {
|
|
95
|
+
display: ["display_large", "display_medium", "display_small"],
|
|
96
|
+
headline: ["headline_large", "headline_medium", "headline_small"],
|
|
97
|
+
title: ["title_large", "title_medium", "title_small"],
|
|
98
|
+
body: ["body_large", "body_medium", "body_small"],
|
|
99
|
+
label: ["label_large", "label_medium", "label_small"],
|
|
162
100
|
};
|
|
163
101
|
|
|
102
|
+
const commonWeights = ["400", "500", "600", "700"];
|
|
103
|
+
|
|
104
|
+
function renderVariantDescription(variant: string, weight: string) {
|
|
105
|
+
const [type, size] = variant.split("_");
|
|
106
|
+
const sizeDescription = size.charAt(0).toUpperCase() + size.slice(1);
|
|
107
|
+
const typeDescription = type.charAt(0).toUpperCase() + type.slice(1);
|
|
108
|
+
|
|
109
|
+
const weightDescriptions = {
|
|
110
|
+
"400": "Regular",
|
|
111
|
+
"500": "Medium",
|
|
112
|
+
"600": "Semi Bold",
|
|
113
|
+
"700": "Bold",
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const weightDescription =
|
|
117
|
+
weightDescriptions[weight as keyof typeof weightDescriptions];
|
|
118
|
+
|
|
119
|
+
return `${typeDescription} ${sizeDescription} - ${weightDescription}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
164
122
|
return (
|
|
165
123
|
<ScrollView>
|
|
166
|
-
<View style={{ padding:
|
|
124
|
+
<View style={{ padding: 16, gap: 24 }}>
|
|
167
125
|
{Object.entries(roles).map(([role, variants]) => (
|
|
168
|
-
<View key={role} style={{ gap:
|
|
126
|
+
<View key={role} style={{ gap: 16 }}>
|
|
169
127
|
<Typography
|
|
170
|
-
variant="
|
|
128
|
+
variant="title_medium"
|
|
129
|
+
weight="700"
|
|
171
130
|
style={{
|
|
172
131
|
textTransform: "capitalize",
|
|
173
132
|
borderBottomWidth: 1,
|
|
@@ -177,54 +136,53 @@ export const AllVariants: Story = {
|
|
|
177
136
|
>
|
|
178
137
|
{role}
|
|
179
138
|
</Typography>
|
|
180
|
-
<View style={{ gap:
|
|
181
|
-
{variants.map((variant
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}}
|
|
195
|
-
>
|
|
196
|
-
<Typography
|
|
197
|
-
variant="text-label_small_300"
|
|
139
|
+
<View style={{ gap: 12 }}>
|
|
140
|
+
{variants.map((variant) => (
|
|
141
|
+
<View key={variant} style={{ gap: 8 }}>
|
|
142
|
+
<Typography
|
|
143
|
+
variant="body_small"
|
|
144
|
+
weight="600"
|
|
145
|
+
style={{ color: "#666" }}
|
|
146
|
+
>
|
|
147
|
+
{variant.replace("_", " ").toUpperCase()}
|
|
148
|
+
</Typography>
|
|
149
|
+
<View style={{ gap: 6 }}>
|
|
150
|
+
{commonWeights.map((weight) => (
|
|
151
|
+
<View
|
|
152
|
+
key={`${variant}_${weight}`}
|
|
198
153
|
style={{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
borderRadius:
|
|
204
|
-
minWidth: 140,
|
|
154
|
+
flexDirection: "column",
|
|
155
|
+
gap: 6,
|
|
156
|
+
padding: 12,
|
|
157
|
+
backgroundColor: "#f9f9f9",
|
|
158
|
+
borderRadius: 8,
|
|
205
159
|
}}
|
|
206
160
|
>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
161
|
+
<Typography
|
|
162
|
+
variant="body_small"
|
|
163
|
+
weight="400"
|
|
164
|
+
style={{
|
|
165
|
+
fontFamily: "monospace",
|
|
166
|
+
backgroundColor: "#e5e5e5",
|
|
167
|
+
paddingHorizontal: 6,
|
|
168
|
+
paddingVertical: 3,
|
|
169
|
+
borderRadius: 4,
|
|
170
|
+
fontSize: 10,
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
variant="{variant}" weight="{weight}"
|
|
174
|
+
</Typography>
|
|
175
|
+
<Typography
|
|
176
|
+
variant={variant as TypographyVariant}
|
|
177
|
+
weight={weight as TypographyWeight}
|
|
178
|
+
>
|
|
179
|
+
{renderVariantDescription(variant, weight)}
|
|
180
|
+
</Typography>
|
|
181
|
+
</View>
|
|
182
|
+
))}
|
|
225
183
|
</View>
|
|
226
|
-
|
|
227
|
-
|
|
184
|
+
</View>
|
|
185
|
+
))}
|
|
228
186
|
</View>
|
|
229
187
|
</View>
|
|
230
188
|
))}
|
|
@@ -236,16 +194,16 @@ export const AllVariants: Story = {
|
|
|
236
194
|
docs: {
|
|
237
195
|
description: {
|
|
238
196
|
story:
|
|
239
|
-
"Complete showcase of all
|
|
197
|
+
"Complete showcase of all typography variants organized by role (display, headline, title, body, label) and size (small, medium, large), with common font weights.",
|
|
240
198
|
},
|
|
241
199
|
},
|
|
242
200
|
},
|
|
243
201
|
};
|
|
244
202
|
|
|
245
|
-
// Custom styling example
|
|
246
203
|
export const WithCustomStyling: Story = {
|
|
247
204
|
args: {
|
|
248
|
-
variant: "
|
|
205
|
+
variant: "headline_medium",
|
|
206
|
+
weight: "500",
|
|
249
207
|
className: "text-blue-600",
|
|
250
208
|
children: "Custom styled headline with color override",
|
|
251
209
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Text } from "react-native";
|
|
3
3
|
import type { TypographyProps } from "./types";
|
|
4
|
-
import { merge } from "@
|
|
4
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
5
|
+
import { typographyVariants } from "./assets/class-variants";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Universal Typography component for React Native.
|
|
@@ -14,26 +15,29 @@ import { merge } from "@butterfly/tailwind-preset";
|
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* // Display text with automatic font mapping
|
|
17
|
-
* <Typography variant="
|
|
18
|
+
* <Typography variant="display_large" weight="700">Hero Title</Typography>
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* // Body text with medium weight
|
|
21
|
-
* <Typography variant="
|
|
22
|
+
* <Typography variant="body_medium" weight="500">Content text</Typography>
|
|
22
23
|
*
|
|
23
24
|
* @example
|
|
24
25
|
* // With additional styling
|
|
25
|
-
* <Typography variant="
|
|
26
|
+
* <Typography variant="label_small" weight="300" className="text-gray-600">
|
|
26
27
|
* Form label
|
|
27
28
|
* </Typography>
|
|
28
29
|
*/
|
|
29
30
|
export const Typography: React.FC<TypographyProps> = ({
|
|
30
31
|
variant,
|
|
31
32
|
className,
|
|
32
|
-
|
|
33
|
+
weight,
|
|
33
34
|
children,
|
|
34
35
|
...props
|
|
35
36
|
}) => {
|
|
36
|
-
const textClassName = merge(
|
|
37
|
+
const textClassName = merge(
|
|
38
|
+
typographyVariants({ variant, weight }),
|
|
39
|
+
className
|
|
40
|
+
);
|
|
37
41
|
|
|
38
42
|
return (
|
|
39
43
|
<Text className={textClassName} {...props}>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { TextProps as RNTextProps } from "react-native";
|
|
2
|
-
import type {
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { typographyVariants } from "./assets/class-variants";
|
|
3
4
|
|
|
4
|
-
export interface TypographyProps
|
|
5
|
-
|
|
5
|
+
export interface TypographyProps
|
|
6
|
+
extends Omit<RNTextProps, "children">,
|
|
7
|
+
VariantProps<typeof typographyVariants> {
|
|
6
8
|
className?: string;
|
|
7
9
|
children: React.ReactNode;
|
|
8
10
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
export * from "./Button";
|
|
2
|
+
export type * from "./Button/types";
|
|
3
|
+
|
|
2
4
|
export * from "./Chip";
|
|
5
|
+
export * from "./Chip/types";
|
|
6
|
+
export * from "./Chip/enums";
|
|
7
|
+
|
|
3
8
|
export * from "./InformationStatus";
|
|
9
|
+
export type * from "./InformationStatus/types";
|
|
10
|
+
export * from "./InformationStatus/enums";
|
|
11
|
+
|
|
4
12
|
export * from "./InputCheckbox";
|
|
13
|
+
export type * from "./InputCheckbox/types";
|
|
14
|
+
export * from "./InputCheckbox/enums";
|
|
15
|
+
|
|
5
16
|
export * from "./InputOTP";
|
|
17
|
+
export type * from "./InputOTP/types";
|
|
18
|
+
export * from "./InputOTP/enums";
|
|
19
|
+
|
|
6
20
|
export * from "./HighlightedText";
|
|
21
|
+
export type * from "./HighlightedText/types";
|
|
22
|
+
|
|
7
23
|
export * from "./LoadingDots";
|
|
24
|
+
export * from "./LoadingDots/types";
|
|
25
|
+
|
|
8
26
|
export * from "./Seal";
|
|
27
|
+
export type * from "./Seal/types";
|
|
28
|
+
export * from "./Seal/enums";
|
|
29
|
+
|
|
9
30
|
export * from "./Title";
|
|
31
|
+
export type * from "./Title/types";
|
|
32
|
+
|
|
10
33
|
export * from "./Toggle";
|
|
34
|
+
export type * from "./Toggle/types";
|
|
35
|
+
export * from "./Toggle/enums";
|
|
36
|
+
|
|
11
37
|
export * from "./Typography";
|
|
38
|
+
export type * from "./Typography/types";
|
package/src/hooks/use-fonts.ts
CHANGED
|
@@ -8,9 +8,17 @@ import { useFonts as useExpoFonts } from "expo-font";
|
|
|
8
8
|
*/
|
|
9
9
|
export const useBrandFonts = () => {
|
|
10
10
|
const [fontsLoaded, fontError] = useExpoFonts({
|
|
11
|
+
"Nunito-Black": require("../../assets/fonts/Nunito-Black.ttf"),
|
|
12
|
+
"Nunito-BlackItalic": require("../../assets/fonts/Nunito-BlackItalic.ttf"),
|
|
11
13
|
"Nunito-Bold": require("../../assets/fonts/Nunito-Bold.ttf"),
|
|
12
14
|
"Nunito-BoldItalic": require("../../assets/fonts/Nunito-BoldItalic.ttf"),
|
|
15
|
+
"Nunito-ExtraBold": require("../../assets/fonts/Nunito-ExtraBold.ttf"),
|
|
16
|
+
"Nunito-ExtraBoldItalic": require("../../assets/fonts/Nunito-ExtraBoldItalic.ttf"),
|
|
17
|
+
"Nunito-ExtraLight": require("../../assets/fonts/Nunito-ExtraLight.ttf"),
|
|
18
|
+
"Nunito-ExtraLightItalic": require("../../assets/fonts/Nunito-ExtraLightItalic.ttf"),
|
|
13
19
|
"Nunito-Italic": require("../../assets/fonts/Nunito-Italic.ttf"),
|
|
20
|
+
"Nunito-Light": require("../../assets/fonts/Nunito-Light.ttf"),
|
|
21
|
+
"Nunito-LightItalic": require("../../assets/fonts/Nunito-LightItalic.ttf"),
|
|
14
22
|
"Nunito-Medium": require("../../assets/fonts/Nunito-Medium.ttf"),
|
|
15
23
|
"Nunito-MediumItalic": require("../../assets/fonts/Nunito-MediumItalic.ttf"),
|
|
16
24
|
"Nunito-Regular": require("../../assets/fonts/Nunito-Regular.ttf"),
|
|
@@ -1,46 +1,52 @@
|
|
|
1
|
-
import * as IconsNative from
|
|
2
|
-
import React, { useMemo, useState } from
|
|
3
|
-
import type { IconsProps, IconProps } from
|
|
4
|
-
import {
|
|
1
|
+
import * as IconsNative from "@kivid/icons/native";
|
|
2
|
+
import React, { useMemo, useState } from "react";
|
|
3
|
+
import type { IconsProps, IconProps } from "./types";
|
|
4
|
+
import {
|
|
5
|
+
Alert,
|
|
6
|
+
FlatList,
|
|
7
|
+
Pressable,
|
|
8
|
+
SafeAreaView,
|
|
9
|
+
Text,
|
|
10
|
+
TextInput,
|
|
11
|
+
View,
|
|
12
|
+
} from "react-native";
|
|
5
13
|
|
|
6
14
|
export function Icons(props: IconsProps) {
|
|
7
|
-
const { size = 24, color =
|
|
15
|
+
const { size = 24, color = "currentColor" } = props;
|
|
8
16
|
|
|
9
17
|
const icons = Object.entries(IconsNative).map(([name, IconComponent]) => ({
|
|
10
18
|
name,
|
|
11
19
|
component: IconComponent as React.FC<IconProps>,
|
|
12
20
|
}));
|
|
13
21
|
|
|
14
|
-
const [searchTerm, setSearchTerm] = useState(
|
|
22
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
15
23
|
|
|
16
24
|
const iconsFiltered = useMemo(() => {
|
|
17
25
|
const sorted = [...icons].sort((a, b) => a.name.localeCompare(b.name));
|
|
18
|
-
return sorted.filter(icon =>
|
|
26
|
+
return sorted.filter((icon) =>
|
|
19
27
|
icon.name.toLowerCase().includes(searchTerm.toLowerCase())
|
|
20
28
|
);
|
|
21
29
|
}, [icons, searchTerm]);
|
|
22
30
|
|
|
23
31
|
function handleIconPress(name: string) {
|
|
24
|
-
const isCurrentColor = color ===
|
|
25
|
-
const component = `<${name} size={${size}} ${isCurrentColor ?
|
|
32
|
+
const isCurrentColor = color === "currentColor";
|
|
33
|
+
const component = `<${name} size={${size}} ${isCurrentColor ? "" : `color="${color}"`} />`;
|
|
26
34
|
|
|
27
35
|
Alert.alert(`Ícone selecionado: ${component}`);
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
return (
|
|
31
|
-
<SafeAreaView
|
|
32
|
-
className='m-16'
|
|
33
|
-
>
|
|
39
|
+
<SafeAreaView className="m-16">
|
|
34
40
|
<TextInput
|
|
35
41
|
placeholder="Pesquisar ícones..."
|
|
36
42
|
placeholderTextColor="#98A3A3"
|
|
37
43
|
style={{
|
|
38
|
-
width:
|
|
44
|
+
width: "100%",
|
|
39
45
|
height: 40,
|
|
40
46
|
marginBottom: 16,
|
|
41
47
|
borderRadius: 8,
|
|
42
48
|
borderWidth: 1,
|
|
43
|
-
borderColor:
|
|
49
|
+
borderColor: "#98A3A3",
|
|
44
50
|
paddingHorizontal: 12,
|
|
45
51
|
fontSize: 16,
|
|
46
52
|
}}
|
|
@@ -86,4 +92,4 @@ export function Icons(props: IconsProps) {
|
|
|
86
92
|
/>
|
|
87
93
|
</SafeAreaView>
|
|
88
94
|
);
|
|
89
|
-
}
|
|
95
|
+
}
|
package/assets/adaptive-icon.png
DELETED
|
Binary file
|
package/assets/favicon.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/icon.png
DELETED
|
Binary file
|
package/assets/splash.png
DELETED
|
Binary file
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.InformationStatusEnum = void 0;
|
|
7
|
-
let InformationStatusEnum = exports.InformationStatusEnum = /*#__PURE__*/function (InformationStatusEnum) {
|
|
8
|
-
InformationStatusEnum["DEFAULT"] = "default";
|
|
9
|
-
InformationStatusEnum["ERROR"] = "error";
|
|
10
|
-
InformationStatusEnum["SUCCESS"] = "success";
|
|
11
|
-
InformationStatusEnum["LOADING"] = "loading";
|
|
12
|
-
InformationStatusEnum["COOLDOWN"] = "cooldown";
|
|
13
|
-
return InformationStatusEnum;
|
|
14
|
-
}({});
|
|
15
|
-
//# sourceMappingURL=information-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["InformationStatusEnum","exports"],"sourceRoot":"../../../../../src","sources":["components/InputOTP/enums/information-status.ts"],"mappings":";;;;;;IAAYA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export let InformationStatusEnum = /*#__PURE__*/function (InformationStatusEnum) {
|
|
4
|
-
InformationStatusEnum["DEFAULT"] = "default";
|
|
5
|
-
InformationStatusEnum["ERROR"] = "error";
|
|
6
|
-
InformationStatusEnum["SUCCESS"] = "success";
|
|
7
|
-
InformationStatusEnum["LOADING"] = "loading";
|
|
8
|
-
InformationStatusEnum["COOLDOWN"] = "cooldown";
|
|
9
|
-
return InformationStatusEnum;
|
|
10
|
-
}({});
|
|
11
|
-
//# sourceMappingURL=information-status.js.map
|