@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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Text } from "react-native";
|
|
5
5
|
import { merge } from "@kivid/tailwind-preset";
|
|
6
|
+
import { typographyVariants } from "./assets/class-variants.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Universal Typography component for React Native.
|
|
@@ -15,15 +16,15 @@ import { merge } from "@kivid/tailwind-preset";
|
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* // Display text with automatic font mapping
|
|
18
|
-
* <Typography variant="
|
|
19
|
+
* <Typography variant="display_large" weight="700">Hero Title</Typography>
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* // Body text with medium weight
|
|
22
|
-
* <Typography variant="
|
|
23
|
+
* <Typography variant="body_medium" weight="500">Content text</Typography>
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
26
|
* // With additional styling
|
|
26
|
-
* <Typography variant="
|
|
27
|
+
* <Typography variant="label_small" weight="300" className="text-gray-600">
|
|
27
28
|
* Form label
|
|
28
29
|
* </Typography>
|
|
29
30
|
*/
|
|
@@ -31,11 +32,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
31
32
|
export const Typography = ({
|
|
32
33
|
variant,
|
|
33
34
|
className,
|
|
34
|
-
|
|
35
|
+
weight,
|
|
35
36
|
children,
|
|
36
37
|
...props
|
|
37
38
|
}) => {
|
|
38
|
-
const textClassName = merge(
|
|
39
|
+
const textClassName = merge(typographyVariants({
|
|
40
|
+
variant,
|
|
41
|
+
weight
|
|
42
|
+
}), className);
|
|
39
43
|
return /*#__PURE__*/_jsx(Text, {
|
|
40
44
|
className: textClassName,
|
|
41
45
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","merge","jsx","_jsx","Typography","variant","className","
|
|
1
|
+
{"version":3,"names":["React","Text","merge","typographyVariants","jsx","_jsx","Typography","variant","className","weight","children","props","textClassName","displayName"],"sourceRoot":"../../../../src","sources":["components/Typography/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,kBAAkB,QAAQ,4BAAyB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,SAAAC,GAAA,IAAAC,IAAA;AAuBA,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EACpDC,OAAO;EACPC,SAAS;EACTC,MAAM;EACNC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,aAAa,GAAGV,KAAK,CACzBC,kBAAkB,CAAC;IAAEI,OAAO;IAAEE;EAAO,CAAC,CAAC,EACvCD,SACF,CAAC;EAED,oBACEH,IAAA,CAACJ,IAAI;IAACO,SAAS,EAAEI,aAAc;IAAA,GAAKD,KAAK;IAAAD,QAAA,EACtCA;EAAQ,CACL,CAAC;AAEX,CAAC;AAEDJ,UAAU,CAACO,WAAW,GAAG,YAAY;AACrC,eAAeP,UAAU","ignoreList":[]}
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
export * from "./Button/index.js";
|
|
4
4
|
export * from "./Chip/index.js";
|
|
5
|
+
export * from "./Chip/types.js";
|
|
6
|
+
export * from "./Chip/enums/index.js";
|
|
5
7
|
export * from "./InformationStatus/index.js";
|
|
8
|
+
export * from "./InformationStatus/enums.js";
|
|
6
9
|
export * from "./InputCheckbox/index.js";
|
|
10
|
+
export * from "./InputCheckbox/enums/index.js";
|
|
7
11
|
export * from "./InputOTP/index.js";
|
|
12
|
+
export * from "./InputOTP/enums/index.js";
|
|
8
13
|
export * from "./HighlightedText/index.js";
|
|
9
14
|
export * from "./LoadingDots/index.js";
|
|
15
|
+
export * from "./LoadingDots/types.js";
|
|
10
16
|
export * from "./Seal/index.js";
|
|
17
|
+
export * from "./Seal/enums/index.js";
|
|
11
18
|
export * from "./Title/index.js";
|
|
12
19
|
export * from "./Toggle/index.js";
|
|
20
|
+
export * from "./Toggle/enums/index.js";
|
|
13
21
|
export * from "./Typography/index.js";
|
|
14
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;AAGxB,cAAc,iBAAQ;AACtB,cAAc,iBAAc;AAC5B,cAAc,uBAAc;AAE5B,cAAc,8BAAqB;AAEnC,cAAc,8BAA2B;AAEzC,cAAc,0BAAiB;AAE/B,cAAc,gCAAuB;AAErC,cAAc,qBAAY;AAE1B,cAAc,2BAAkB;AAEhC,cAAc,4BAAmB;AAGjC,cAAc,wBAAe;AAC7B,cAAc,wBAAqB;AAEnC,cAAc,iBAAQ;AAEtB,cAAc,uBAAc;AAE5B,cAAc,kBAAS;AAGvB,cAAc,mBAAU;AAExB,cAAc,yBAAgB;AAE9B,cAAc,uBAAc","ignoreList":[]}
|
|
@@ -10,9 +10,17 @@ import { useFonts as useExpoFonts } from "expo-font";
|
|
|
10
10
|
*/
|
|
11
11
|
export const useBrandFonts = () => {
|
|
12
12
|
const [fontsLoaded, fontError] = useExpoFonts({
|
|
13
|
+
"Nunito-Black": require("../../assets/fonts/Nunito-Black.ttf"),
|
|
14
|
+
"Nunito-BlackItalic": require("../../assets/fonts/Nunito-BlackItalic.ttf"),
|
|
13
15
|
"Nunito-Bold": require("../../assets/fonts/Nunito-Bold.ttf"),
|
|
14
16
|
"Nunito-BoldItalic": require("../../assets/fonts/Nunito-BoldItalic.ttf"),
|
|
17
|
+
"Nunito-ExtraBold": require("../../assets/fonts/Nunito-ExtraBold.ttf"),
|
|
18
|
+
"Nunito-ExtraBoldItalic": require("../../assets/fonts/Nunito-ExtraBoldItalic.ttf"),
|
|
19
|
+
"Nunito-ExtraLight": require("../../assets/fonts/Nunito-ExtraLight.ttf"),
|
|
20
|
+
"Nunito-ExtraLightItalic": require("../../assets/fonts/Nunito-ExtraLightItalic.ttf"),
|
|
15
21
|
"Nunito-Italic": require("../../assets/fonts/Nunito-Italic.ttf"),
|
|
22
|
+
"Nunito-Light": require("../../assets/fonts/Nunito-Light.ttf"),
|
|
23
|
+
"Nunito-LightItalic": require("../../assets/fonts/Nunito-LightItalic.ttf"),
|
|
16
24
|
"Nunito-Medium": require("../../assets/fonts/Nunito-Medium.ttf"),
|
|
17
25
|
"Nunito-MediumItalic": require("../../assets/fonts/Nunito-MediumItalic.ttf"),
|
|
18
26
|
"Nunito-Regular": require("../../assets/fonts/Nunito-Regular.ttf"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFonts","useExpoFonts","useBrandFonts","fontsLoaded","fontError","require"],"sourceRoot":"../../../src","sources":["hooks/use-fonts.ts"],"mappings":";;AAAA,SAASA,QAAQ,IAAIC,YAAY,QAAQ,WAAW;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM,CAACC,WAAW,EAAEC,SAAS,CAAC,GAAGH,YAAY,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"names":["useFonts","useExpoFonts","useBrandFonts","fontsLoaded","fontError","require"],"sourceRoot":"../../../src","sources":["hooks/use-fonts.ts"],"mappings":";;AAAA,SAASA,QAAQ,IAAIC,YAAY,QAAQ,WAAW;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM,CAACC,WAAW,EAAEC,SAAS,CAAC,GAAGH,YAAY,CAAC;IAC5C,cAAc,EAAEI,OAAO,CAAC,qCAAqC,CAAC;IAC9D,oBAAoB,EAAEA,OAAO,CAAC,2CAA2C,CAAC;IAC1E,aAAa,EAAEA,OAAO,CAAC,oCAAoC,CAAC;IAC5D,mBAAmB,EAAEA,OAAO,CAAC,0CAA0C,CAAC;IACxE,kBAAkB,EAAEA,OAAO,CAAC,yCAAyC,CAAC;IACtE,wBAAwB,EAAEA,OAAO,CAAC,+CAA+C,CAAC;IAClF,mBAAmB,EAAEA,OAAO,CAAC,0CAA0C,CAAC;IACxE,yBAAyB,EAAEA,OAAO,CAAC,gDAAgD,CAAC;IACpF,eAAe,EAAEA,OAAO,CAAC,sCAAsC,CAAC;IAChE,cAAc,EAAEA,OAAO,CAAC,qCAAqC,CAAC;IAC9D,oBAAoB,EAAEA,OAAO,CAAC,2CAA2C,CAAC;IAC1E,eAAe,EAAEA,OAAO,CAAC,sCAAsC,CAAC;IAChE,qBAAqB,EAAEA,OAAO,CAAC,4CAA4C,CAAC;IAC5E,gBAAgB,EAAEA,OAAO,CAAC,uCAAuC,CAAC;IAClE,iBAAiB,EAAEA,OAAO,CAAC,wCAAwC,CAAC;IACpE,uBAAuB,EAAEA,OAAO,CAAC,8CAA8C;EACjF,CAAC,CAAC;EAEF,OAAO;IAAEF,WAAW;IAAEC;EAAU,CAAC;AACnC,CAAC","ignoreList":[]}
|
package/dist/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",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@kivid/icons": "workspace:*",
|
|
21
|
-
"@kivid/tailwind-preset": "workspace:*",
|
|
22
21
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
|
23
22
|
"class-variance-authority": "^0.7.1",
|
|
24
23
|
"lottie-react-native": "^7.2.4",
|
|
@@ -7,7 +7,6 @@ declare const buttonVariants: (props?: ({
|
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare const textVariants: (props?: ({
|
|
9
9
|
variant?: "grape" | "java" | "pear" | "tangerine" | "blackberry" | "chia" | "outline" | "glass" | "ghost" | null | undefined;
|
|
10
|
-
size?: "small" | "medium" | "large" | null | undefined;
|
|
11
10
|
selected?: boolean | null | undefined;
|
|
12
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
12
|
declare const selectedVariants: (props?: ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ButtonProps } from "./types";
|
|
1
|
+
import type { ButtonCorners, ButtonProps, ButtonSize, ButtonVariant } from "./types";
|
|
2
2
|
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare namespace Button {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export { ButtonProps, ButtonVariant, ButtonSize, ButtonCorners };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextProps } from "react-native";
|
|
2
|
+
import type { TypographyProps } from "../Typography/types";
|
|
2
3
|
export interface HighlightedTextProps extends TextProps {
|
|
3
4
|
text: string;
|
|
4
5
|
highlightText?: string;
|
|
5
|
-
highlightTextClassName?: string;
|
|
6
6
|
className?: string;
|
|
7
|
-
ref?: React.RefObject<Text | null>;
|
|
8
7
|
reverse?: boolean;
|
|
8
|
+
variant?: TypographyProps["variant"];
|
|
9
|
+
weight?: TypographyProps["weight"];
|
|
10
|
+
highlightedTextProps?: {
|
|
11
|
+
className?: string;
|
|
12
|
+
variant?: TypographyProps["variant"];
|
|
13
|
+
weight?: TypographyProps["weight"];
|
|
14
|
+
};
|
|
9
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToggleVariantEnum } from "./enums";
|
|
2
2
|
export interface ToggleProps {
|
|
3
3
|
checked: boolean;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
variant?:
|
|
5
|
+
variant?: ToggleVariantEnum;
|
|
6
6
|
onChange: (checked: boolean) => void;
|
|
7
7
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const typographyVariants: (props?: ({
|
|
2
|
+
variant?: "label_small" | "label_medium" | "label_large" | "body_small" | "body_medium" | "body_large" | "title_small" | "title_medium" | "title_large" | "headline_small" | "headline_medium" | "headline_large" | "display_small" | "display_medium" | "display_large" | null | undefined;
|
|
3
|
+
weight?: "400" | "200" | "300" | "500" | "600" | "700" | "800" | "900" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -11,15 +11,15 @@ import type { TypographyProps } from "./types";
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* // Display text with automatic font mapping
|
|
14
|
-
* <Typography variant="
|
|
14
|
+
* <Typography variant="display_large" weight="700">Hero Title</Typography>
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* // Body text with medium weight
|
|
18
|
-
* <Typography variant="
|
|
18
|
+
* <Typography variant="body_medium" weight="500">Content text</Typography>
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* // With additional styling
|
|
22
|
-
* <Typography variant="
|
|
22
|
+
* <Typography variant="label_small" weight="300" className="text-gray-600">
|
|
23
23
|
* Form label
|
|
24
24
|
* </Typography>
|
|
25
25
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TextProps as RNTextProps } from "react-native";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { typographyVariants } from "./assets/class-variants";
|
|
4
|
+
export interface TypographyProps extends Omit<RNTextProps, "children">, VariantProps<typeof typographyVariants> {
|
|
5
5
|
className?: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
export * from "./Button";
|
|
2
|
+
export type * from "./Button/types";
|
|
2
3
|
export * from "./Chip";
|
|
4
|
+
export * from "./Chip/types";
|
|
5
|
+
export * from "./Chip/enums";
|
|
3
6
|
export * from "./InformationStatus";
|
|
7
|
+
export type * from "./InformationStatus/types";
|
|
8
|
+
export * from "./InformationStatus/enums";
|
|
4
9
|
export * from "./InputCheckbox";
|
|
10
|
+
export type * from "./InputCheckbox/types";
|
|
11
|
+
export * from "./InputCheckbox/enums";
|
|
5
12
|
export * from "./InputOTP";
|
|
13
|
+
export type * from "./InputOTP/types";
|
|
14
|
+
export * from "./InputOTP/enums";
|
|
6
15
|
export * from "./HighlightedText";
|
|
16
|
+
export type * from "./HighlightedText/types";
|
|
7
17
|
export * from "./LoadingDots";
|
|
18
|
+
export * from "./LoadingDots/types";
|
|
8
19
|
export * from "./Seal";
|
|
20
|
+
export type * from "./Seal/types";
|
|
21
|
+
export * from "./Seal/enums";
|
|
9
22
|
export * from "./Title";
|
|
23
|
+
export type * from "./Title/types";
|
|
10
24
|
export * from "./Toggle";
|
|
25
|
+
export type * from "./Toggle/types";
|
|
26
|
+
export * from "./Toggle/enums";
|
|
11
27
|
export * from "./Typography";
|
|
28
|
+
export type * from "./Typography/types";
|
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
|
-
"@kivid/tailwind-preset": "1.0.0-alpha.2"
|
|
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
|
-
"@kivid/
|
|
108
|
-
"@kivid/icons": "1.0.0-alpha.2"
|
|
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 {
|
|
2
|
+
import { Pressable, Animated, GestureResponderEvent } from "react-native";
|
|
3
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
1
|
import { merge } from "@kivid/tailwind-preset";
|
|
2
|
-
import type { ChipProps } from "./types";
|
|
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 };
|