@kivid/native-components 1.0.0-alpha.20 → 1.0.0-alpha.21

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 (87) hide show
  1. package/dist/commonjs/components/ChatBubble/assets/class-variants.js +55 -4
  2. package/dist/commonjs/components/ChatBubble/assets/class-variants.js.map +1 -1
  3. package/dist/commonjs/components/ChatBubble/components/ChatBubbleEar/index.js +25 -20
  4. package/dist/commonjs/components/ChatBubble/components/ChatBubbleEar/index.js.map +1 -1
  5. package/dist/commonjs/components/ChatBubble/components/ChatBubbleEar/types.js +6 -0
  6. package/dist/commonjs/components/ChatBubble/components/ChatBubbleEar/types.js.map +1 -0
  7. package/dist/commonjs/components/ChatBubble/components/ChatBubbleText/index.js +8 -3
  8. package/dist/commonjs/components/ChatBubble/components/ChatBubbleText/index.js.map +1 -1
  9. package/dist/commonjs/components/ChatBubble/components/ChatBubbleTime/index.js +7 -1
  10. package/dist/commonjs/components/ChatBubble/components/ChatBubbleTime/index.js.map +1 -1
  11. package/dist/commonjs/components/ChatBubble/index.js +58 -13
  12. package/dist/commonjs/components/ChatBubble/index.js.map +1 -1
  13. package/dist/commonjs/components/IconButton/index.js +1 -0
  14. package/dist/commonjs/components/IconButton/index.js.map +1 -1
  15. package/dist/commonjs/components/MessageInput/assets/class-variants.js +31 -0
  16. package/dist/commonjs/components/MessageInput/assets/class-variants.js.map +1 -0
  17. package/dist/commonjs/components/MessageInput/index.js +105 -0
  18. package/dist/commonjs/components/MessageInput/index.js.map +1 -0
  19. package/dist/commonjs/components/MessageInput/types.js +6 -0
  20. package/dist/commonjs/components/MessageInput/types.js.map +1 -0
  21. package/dist/commonjs/components/TextInput/assets/class-variants.js +21 -4
  22. package/dist/commonjs/components/TextInput/assets/class-variants.js.map +1 -1
  23. package/dist/commonjs/components/TextInput/enums.js +7 -1
  24. package/dist/commonjs/components/TextInput/enums.js.map +1 -1
  25. package/dist/commonjs/components/TextInput/index.js +13 -3
  26. package/dist/commonjs/components/TextInput/index.js.map +1 -1
  27. package/dist/commonjs/components/index.js +54 -43
  28. package/dist/commonjs/components/index.js.map +1 -1
  29. package/dist/module/components/ChatBubble/assets/class-variants.js +54 -3
  30. package/dist/module/components/ChatBubble/assets/class-variants.js.map +1 -1
  31. package/dist/module/components/ChatBubble/components/ChatBubbleEar/index.js +26 -21
  32. package/dist/module/components/ChatBubble/components/ChatBubbleEar/index.js.map +1 -1
  33. package/dist/module/components/ChatBubble/components/ChatBubbleEar/types.js +4 -0
  34. package/dist/module/components/ChatBubble/components/ChatBubbleEar/types.js.map +1 -0
  35. package/dist/module/components/ChatBubble/components/ChatBubbleText/index.js +7 -2
  36. package/dist/module/components/ChatBubble/components/ChatBubbleText/index.js.map +1 -1
  37. package/dist/module/components/ChatBubble/components/ChatBubbleTime/index.js +9 -2
  38. package/dist/module/components/ChatBubble/components/ChatBubbleTime/index.js.map +1 -1
  39. package/dist/module/components/ChatBubble/index.js +59 -14
  40. package/dist/module/components/ChatBubble/index.js.map +1 -1
  41. package/dist/module/components/IconButton/index.js +1 -0
  42. package/dist/module/components/IconButton/index.js.map +1 -1
  43. package/dist/module/components/MessageInput/assets/class-variants.js +27 -0
  44. package/dist/module/components/MessageInput/assets/class-variants.js.map +1 -0
  45. package/dist/module/components/MessageInput/index.js +100 -0
  46. package/dist/module/components/MessageInput/index.js.map +1 -0
  47. package/dist/module/components/MessageInput/types.js +4 -0
  48. package/dist/module/components/MessageInput/types.js.map +1 -0
  49. package/dist/module/components/TextInput/assets/class-variants.js +21 -4
  50. package/dist/module/components/TextInput/assets/class-variants.js.map +1 -1
  51. package/dist/module/components/TextInput/enums.js +6 -0
  52. package/dist/module/components/TextInput/enums.js.map +1 -1
  53. package/dist/module/components/TextInput/index.js +14 -4
  54. package/dist/module/components/TextInput/index.js.map +1 -1
  55. package/dist/module/components/index.js +2 -0
  56. package/dist/module/components/index.js.map +1 -1
  57. package/dist/typescript/components/ChatBubble/assets/class-variants.d.ts +7 -1
  58. package/dist/typescript/components/ChatBubble/components/ChatBubbleEar/index.d.ts +1 -6
  59. package/dist/typescript/components/ChatBubble/components/ChatBubbleEar/types.d.ts +6 -0
  60. package/dist/typescript/components/ChatBubble/contexts/ChatBubbleContext/types.d.ts +1 -0
  61. package/dist/typescript/components/ChatBubble/types.d.ts +1 -0
  62. package/dist/typescript/components/MessageInput/assets/class-variants.d.ts +7 -0
  63. package/dist/typescript/components/MessageInput/index.d.ts +6 -0
  64. package/dist/typescript/components/MessageInput/types.d.ts +13 -0
  65. package/dist/typescript/components/TextInput/assets/class-variants.d.ts +3 -0
  66. package/dist/typescript/components/TextInput/enums.d.ts +5 -0
  67. package/dist/typescript/components/TextInput/index.d.ts +1 -1
  68. package/dist/typescript/components/TextInput/types.d.ts +4 -1
  69. package/dist/typescript/components/index.d.ts +4 -0
  70. package/package.json +22 -11
  71. package/src/components/ChatBubble/assets/class-variants.ts +130 -66
  72. package/src/components/ChatBubble/components/ChatBubbleEar/index.tsx +35 -24
  73. package/src/components/ChatBubble/components/ChatBubbleEar/types.ts +7 -0
  74. package/src/components/ChatBubble/components/ChatBubbleText/index.tsx +8 -5
  75. package/src/components/ChatBubble/components/ChatBubbleTime/index.tsx +4 -1
  76. package/src/components/ChatBubble/contexts/ChatBubbleContext/types.ts +1 -0
  77. package/src/components/ChatBubble/index.tsx +83 -23
  78. package/src/components/ChatBubble/types.ts +1 -0
  79. package/src/components/IconButton/index.tsx +1 -0
  80. package/src/components/MessageInput/assets/class-variants.ts +35 -0
  81. package/src/components/MessageInput/index.tsx +121 -0
  82. package/src/components/MessageInput/types.ts +18 -0
  83. package/src/components/TextInput/assets/class-variants.ts +32 -13
  84. package/src/components/TextInput/enums.ts +6 -0
  85. package/src/components/TextInput/index.tsx +9 -1
  86. package/src/components/TextInput/types.ts +4 -1
  87. package/src/components/index.ts +5 -0
@@ -5,7 +5,7 @@ import { View, TextInput as RNTextInput, Pressable } from "react-native";
5
5
  import { merge } from "@kivid/tailwind-preset";
6
6
  import { Seal } from "../Seal/index.js";
7
7
  import { SealVariantEnum } from "../Seal/enums/index.js";
8
- import { TextInputCornersEnum } from "./enums.js";
8
+ import { TextInputCornersEnum, TextInputSizeEnum } from "./enums.js";
9
9
  import { textInputContainerVariants, textInputContentVariants, textInputFieldVariants } from "./assets/class-variants.js";
10
10
  import Typography from "../Typography/index.js";
11
11
  import { SizeEnum } from "../../enums/index.js";
@@ -14,6 +14,7 @@ import { TooltipVariantEnum } from "../Tooltip/enum/index.js";
14
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  export function TextInput({
16
16
  corners = TextInputCornersEnum.MEDIUM,
17
+ size = TextInputSizeEnum.LARGE,
17
18
  label,
18
19
  value,
19
20
  onChangeText,
@@ -30,12 +31,14 @@ export function TextInput({
30
31
  tooltipClassName = "",
31
32
  tooltipPointerClassName,
32
33
  tooltipContainerClassName,
34
+ leftIcon,
33
35
  rightIcon,
34
36
  ...rest
35
37
  }) {
36
38
  const inputRef = useRef(null);
37
39
  const hasLabel = !!label;
38
40
  const hasError = !!error;
41
+ const hasLeftIcon = !!leftIcon;
39
42
  const shouldShowSeal = error || isValid;
40
43
  const renderSeal = () => {
41
44
  if (!shouldShowSeal) return null;
@@ -78,9 +81,11 @@ export function TextInput({
78
81
  testID: containerTestID,
79
82
  className: merge(textInputContainerVariants({
80
83
  corners,
84
+ size,
81
85
  error: !!error,
82
86
  disabled,
83
- showLabel: hasLabel
87
+ showLabel: hasLabel,
88
+ showLeftIcon: hasLeftIcon
84
89
  }), className),
85
90
  onPress: () => {
86
91
  if (!disabled) {
@@ -88,7 +93,10 @@ export function TextInput({
88
93
  }
89
94
  },
90
95
  disabled: disabled,
91
- children: [/*#__PURE__*/_jsxs(View, {
96
+ children: [leftIcon && /*#__PURE__*/_jsx(View, {
97
+ className: "mr-400",
98
+ children: leftIcon
99
+ }), /*#__PURE__*/_jsxs(View, {
92
100
  className: merge(textInputContentVariants({
93
101
  showLabel: hasLabel
94
102
  })),
@@ -102,11 +110,13 @@ export function TextInput({
102
110
  onChangeText: handleChangeText,
103
111
  editable: !disabled,
104
112
  placeholder: placeholder,
113
+ textAlignVertical: "center",
105
114
  className: merge(textInputFieldVariants({
106
115
  disabled,
107
116
  isValid,
108
117
  error: hasError,
109
- showLabel: hasLabel
118
+ showLabel: hasLabel,
119
+ size
110
120
  }), inputClassName),
111
121
  accessibilityLabel: getAccessibilityLabel(),
112
122
  accessibilityState: {
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","View","TextInput","RNTextInput","Pressable","merge","Seal","SealVariantEnum","TextInputCornersEnum","textInputContainerVariants","textInputContentVariants","textInputFieldVariants","Typography","SizeEnum","Tooltip","TooltipVariantEnum","jsx","_jsx","jsxs","_jsxs","corners","MEDIUM","label","value","onChangeText","disabled","error","isValid","className","inputClassName","labelClassName","placeholder","accessibilityLabel","containerTestID","ref","tooltipClassName","tooltipPointerClassName","tooltipContainerClassName","rightIcon","rest","inputRef","hasLabel","hasError","shouldShowSeal","renderSeal","testID","sealVariant","ERROR","SUCCESS","children","variant","size","renderRightIcon","handleChangeText","text","getAccessibilityLabel","labelText","isOpenedByVariantError","message","pointerClassName","containerClassName","showLabel","onPress","current","focus","weight","editable","accessibilityState","instance","displayName"],"sourceRoot":"../../../../src","sources":["components/TextInput/index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,IAAI,EAAEC,SAAS,IAAIC,WAAW,EAAEC,SAAS,QAAQ,cAAc;AACxE,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,eAAe,QAAQ,wBAAe;AAE/C,SAASC,oBAAoB,QAAQ,YAAS;AAC9C,SACEC,0BAA0B,EAC1BC,wBAAwB,EACxBC,sBAAsB,QACjB,4BAAyB;AAChC,OAAOC,UAAU,MAAM,wBAAe;AACtC,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,OAAO,QAAQ,q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,CAAE;QAAAQ,QAAA,GAEnE3B,KAAK,iBACJH,KAAA,CAACP,UAAU;UACTsC,OAAO,EAAC,aAAa;UACrBe,MAAM,EAAC,KAAK;UACZrC,SAAS,EAAEvB,KAAK,CAAC,eAAe,EAAEyB,cAAc,CAAE;UAAAmB,QAAA,GAEjD3B,KAAK,EAAC,GACT;QAAA,CAAY,CACb,eAEDL,IAAA,CAACd,WAAW;UACVoB,KAAK,EAAEA,KAAM;UACbC,YAAY,EAAE6B,gBAAiB;UAC/Ba,QAAQ,EAAE,CAACzC,QAAS;UACpBM,WAAW,EAAEA,WAAY;UACzBH,SAAS,EAAEvB,KAAK,CACdM,sBAAsB,CAAC;YACrBc,QAAQ;YACRE,OAAO;YACPD,KAAK,EAAEgB,QAAQ;YACfmB,SAAS,EAAEpB;UACb,CAAC,CAAC,EACFZ,cACF,CAAE;UACFG,kBAAkB,EAAEuB,qBAAqB,CAAC,CAAE;UAC5CY,kBAAkB,EAAE;YAClB1C;UACF,CAAE;UAAA,GACEc,IAAI;UACRL,GAAG,EAAGkC,QAAQ,IAAK;YACjB5B,QAAQ,CAACuB,OAAO,GAAGK,QAAQ;YAE3B,IAAIlC,GAAG,EAAE;cACPA,GAAG,CAAC6B,OAAO,GAAGK,QAAQ;YACxB;UACF;QAAE,CACH,CAAC;MAAA,CACE,CAAC,EAENhB,eAAe,CAAC,CAAC;IAAA,CACT;EAAC,CACL,CAAC;AAEd;AAEAlD,SAAS,CAACmE,WAAW,GAAG,WAAW;AAEnC,eAAenE,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["useRef","View","TextInput","RNTextInput","Pressable","merge","Seal","SealVariantEnum","TextInputCornersEnum","TextInputSizeEnum","textInputContainerVariants","textInputContentVariants","textInputFieldVariants","Typography","SizeEnum","Tooltip","TooltipVariantEnum","jsx","_jsx","jsxs","_jsxs","corners","MEDIUM","size","LARGE","label","value","onChangeText","disabled","error","isValid","className","inputClassName","labelClassName","placeholder","accessibilityLabel","containerTestID","ref","tooltipClassName","tooltipPointerClassName","tooltipContainerClassName","leftIcon","rightIcon","rest","inputRef","hasLabel","hasError","hasLeftIcon","shouldShowSeal","renderSeal","testID","sealVariant","ERROR","SUCCESS","children","variant","renderRightIcon","handleChangeText","text","getAccessibilityLabel","labelText","isOpenedByVariantError","message","pointerClassName","containerClassName","showLabel","showLeftIcon","onPress","current","focus","weight","editable","textAlignVertical","accessibilityState","instance","displayName"],"sourceRoot":"../../../../src","sources":["components/TextInput/index.tsx"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,IAAI,EAAEC,SAAS,IAAIC,WAAW,EAAEC,SAAS,QAAQ,cAAc;AACxE,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,eAAe,QAAQ,wBAAe;AAE/C,SAASC,oBAAoB,EAAEC,iBAAiB,QAAQ,YAAS;AACjE,SACEC,0BAA0B,EAC1BC,wBAAwB,EACxBC,sBAAsB,QACjB,4BAAyB;AAChC,OAAOC,UAAU,MAAM,wBAAe;AACtC,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,OAAO,QAAQ,qBAAY;AACpC,SAASC,kBAAkB,QAAQ,0BAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErD,OAAO,SAASlB,SAASA,CAAC;EACxBmB,OAAO,GAAGb,oBAAoB,CAACc,MAAM;EACrCC,IAAI,GAAGd,iBAAiB,CAACe,KAAK;EAC9BC,KAAK;EACLC,KAAK;EACLC,YAAY;EACZC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACLC,OAAO;EACPC,SAAS,GAAG,EAAE;EACdC,cAAc,GAAG,EAAE;EACnBC,cAAc,GAAG,EAAE;EACnBC,WAAW,GAAG,aAAa;EAC3BC,kBAAkB;EAClBC,eAAe;EACfC,GAAG;EACHC,gBAAgB,GAAG,EAAE;EACrBC,uBAAuB;EACvBC,yBAAyB;EACzB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AAW;UACVuB,KAAK,EAAEA,KAAM;UACbC,YAAY,EAAE8B,gBAAiB;UAC/Bc,QAAQ,EAAE,CAAC3C,QAAS;UACpBM,WAAW,EAAEA,WAAY;UACzBsC,iBAAiB,EAAC,QAAQ;UAC1BzC,SAAS,EAAE1B,KAAK,CACdO,sBAAsB,CAAC;YACrBgB,QAAQ;YACRE,OAAO;YACPD,KAAK,EAAEiB,QAAQ;YACfmB,SAAS,EAAEpB,QAAQ;YACnBtB;UACF,CAAC,CAAC,EACFS,cACF,CAAE;UACFG,kBAAkB,EAAEwB,qBAAqB,CAAC,CAAE;UAC5Cc,kBAAkB,EAAE;YAClB7C;UACF,CAAE;UAAA,GACEe,IAAI;UACRN,GAAG,EAAGqC,QAAQ,IAAK;YACjB9B,QAAQ,CAACwB,OAAO,GAAGM,QAAQ;YAE3B,IAAIrC,GAAG,EAAE;cACPA,GAAG,CAAC+B,OAAO,GAAGM,QAAQ;YACxB;UACF;QAAE,CACH,CAAC;MAAA,CACE,CAAC,EAENlB,eAAe,CAAC,CAAC;IAAA,CACT;EAAC,CACL,CAAC;AAEd;AAEAtD,SAAS,CAACyE,WAAW,GAAG,WAAW;AAEnC,eAAezE,SAAS","ignoreList":[]}
@@ -12,6 +12,7 @@ export * from "./CheckboxInput/index.js";
12
12
  export * from "./CheckboxInput/enums/index.js";
13
13
  export * from "./OtpInput/index.js";
14
14
  export * from "./OtpInput/enums/index.js";
15
+ export * from "./MessageInput/index.js";
15
16
  export * from "./HighlightedText/index.js";
16
17
  export * from "./LoadingDots/index.js";
17
18
  export * from "./LoadingDots/types.js";
@@ -37,4 +38,5 @@ export * from "./IconButton/enums.js";
37
38
  export * from "./PasswordInput/index.js";
38
39
  export * from "./PageIndicators/index.js";
39
40
  export * from "./ActionButton/index.js";
41
+ export * from "./MessageInput/index.js";
40
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,c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vB,cAAc,mBAAU;AACxB,cAAc,yBAAgB;AAG9B,cAAc,uBAAc;AAG5B,cAAc,kBAAS;AACvB,cAAc,wBAAe;AAG7B,cAAc,oBAAW;AAGzB,cAAc,uBAAc;AAC5B,cAAc,6BAAoB;AAGlC,cAAc,sBAAa;AAC3B,cAAc,sBAAmB;AAGjC,cAAc,yBAAgB;AAC9B,cAAc,+BAAsB;AAGpC,cAAc,uBAAc;AAC5B,cAAc,6BAAoB;AAGlC,cAAc,uBAAc;AAC5B,cAAc,uBAAoB;AAGlC,cAAc,0BAAiB;AAG/B,cAAc,2BAAkB;AAGhC,cAAc,yBAAgB;AAG9B,cAAc,yBAAgB","ignoreList":[]}
@@ -4,5 +4,11 @@ export declare const chatBubbleBoxVariants: (props?: ({
4
4
  hasEar?: boolean | null | undefined;
5
5
  messageType?: "initial" | "followUp" | null | undefined;
6
6
  fullWidth?: boolean | null | undefined;
7
+ origin?: "user" | "assistant" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ export declare const chatBubbleTimeVariants: (props?: ({
10
+ origin?: "user" | "assistant" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ export declare const chatBubbleContainerVariants: (props?: ({
13
+ origin?: "user" | "assistant" | null | undefined;
7
14
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
- export declare const chatBubbleTimeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -1,8 +1,3 @@
1
1
  import React from "react";
2
- import type { SvgProps } from "react-native-svg";
3
- interface ChatBubbleEarProps extends SvgProps {
4
- type: "fill" | "outline";
5
- color?: string;
6
- }
2
+ import { ChatBubbleEarProps } from "./types";
7
3
  export declare const ChatBubbleEar: React.FC<ChatBubbleEarProps>;
8
- export {};
@@ -0,0 +1,6 @@
1
+ import { SvgProps } from "react-native-svg";
2
+ export interface ChatBubbleEarProps extends SvgProps {
3
+ type: "fill" | "outline";
4
+ color?: string;
5
+ mirrored?: boolean;
6
+ }
@@ -3,4 +3,5 @@ export interface ChatBubbleContextValue {
3
3
  variant?: ChatBubbleType;
4
4
  colorState: ChatBubbleColorState;
5
5
  messageType: ChatBubbleMessageType;
6
+ origin: "user" | "assistant";
6
7
  }
@@ -10,6 +10,7 @@ export interface ChatBubbleProps extends Omit<ViewProps, "children"> {
10
10
  children?: React.ReactNode;
11
11
  time?: string;
12
12
  shouldDisplayTime?: boolean;
13
+ origin?: "user" | "assistant";
13
14
  messageType?: ChatBubbleMessageType;
14
15
  chatBubbleBoxClassName?: string;
15
16
  fullWidth?: boolean;
@@ -0,0 +1,7 @@
1
+ export declare const messageInputContainerVariants: (props?: ({
2
+ disabled?: boolean | null | undefined;
3
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
+ export declare const messageInputContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export declare const messageInputFieldVariants: (props?: ({
6
+ disabled?: boolean | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,6 @@
1
+ import type { MessageInputProps } from "./types";
2
+ export declare function MessageInput({ value, onChangeText, disabled, className, inputClassName, placeholder, accessibilityLabel, containerTestID, ref, onSend, sendButtonDisabled, sendButtonAccessibilityLabel, multiline, ...rest }: MessageInputProps): import("react").JSX.Element;
3
+ export declare namespace MessageInput {
4
+ var displayName: string;
5
+ }
6
+ export default MessageInput;
@@ -0,0 +1,13 @@
1
+ import { TextInputProps as RNTextInputProps, TextInput as RNTextInput } from "react-native";
2
+ export interface MessageInputProps extends Omit<RNTextInputProps, "value" | "onChangeText"> {
3
+ value?: string;
4
+ disabled?: boolean;
5
+ className?: string;
6
+ inputClassName?: string;
7
+ containerTestID?: string;
8
+ onChangeText?: (text: string) => void;
9
+ onSend?: (text: string) => void;
10
+ ref?: React.RefObject<RNTextInput | null>;
11
+ sendButtonDisabled?: boolean;
12
+ sendButtonAccessibilityLabel?: string;
13
+ }
@@ -1,6 +1,8 @@
1
1
  export declare const textInputContainerVariants: (props?: ({
2
2
  corners?: "small" | "medium" | null | undefined;
3
+ size?: "small" | "medium" | "large" | null | undefined;
3
4
  showLabel?: boolean | null | undefined;
5
+ showLeftIcon?: boolean | null | undefined;
4
6
  error?: boolean | null | undefined;
5
7
  disabled?: boolean | null | undefined;
6
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -12,4 +14,5 @@ export declare const textInputFieldVariants: (props?: ({
12
14
  isValid?: boolean | null | undefined;
13
15
  error?: boolean | null | undefined;
14
16
  showLabel?: boolean | null | undefined;
17
+ size?: "small" | "medium" | "large" | null | undefined;
15
18
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -2,3 +2,8 @@ export declare enum TextInputCornersEnum {
2
2
  SMALL = "small",
3
3
  MEDIUM = "medium"
4
4
  }
5
+ export declare enum TextInputSizeEnum {
6
+ SMALL = "small",
7
+ MEDIUM = "medium",
8
+ LARGE = "large"
9
+ }
@@ -1,5 +1,5 @@
1
1
  import type { TextInputProps } from "./types";
2
- export declare function TextInput({ corners, label, value, onChangeText, disabled, error, isValid, className, inputClassName, labelClassName, placeholder, accessibilityLabel, containerTestID, ref, tooltipClassName, tooltipPointerClassName, tooltipContainerClassName, rightIcon, ...rest }: TextInputProps): import("react").JSX.Element;
2
+ export declare function TextInput({ corners, size, label, value, onChangeText, disabled, error, isValid, className, inputClassName, labelClassName, placeholder, accessibilityLabel, containerTestID, ref, tooltipClassName, tooltipPointerClassName, tooltipContainerClassName, leftIcon, rightIcon, ...rest }: TextInputProps): import("react").JSX.Element;
3
3
  export declare namespace TextInput {
4
4
  var displayName: string;
5
5
  }
@@ -1,8 +1,10 @@
1
1
  import { TextInputProps as RNTextInputProps, TextInput as RNTextInput } from "react-native";
2
- import { TextInputCornersEnum } from "./enums";
2
+ import { TextInputCornersEnum, TextInputSizeEnum } from "./enums";
3
3
  export type TextInputCorners = TextInputCornersEnum;
4
+ export type TextInputSize = TextInputSizeEnum;
4
5
  export interface TextInputProps extends Omit<RNTextInputProps, "value" | "onChangeText"> {
5
6
  corners?: TextInputCorners;
7
+ size?: TextInputSize;
6
8
  label?: string;
7
9
  value?: string;
8
10
  disabled?: boolean;
@@ -15,6 +17,7 @@ export interface TextInputProps extends Omit<RNTextInputProps, "value" | "onChan
15
17
  tooltipClassName?: string;
16
18
  tooltipPointerClassName?: string;
17
19
  tooltipContainerClassName?: string;
20
+ leftIcon?: React.ReactNode;
18
21
  rightIcon?: React.ReactNode;
19
22
  onChangeText?: (text: string) => void;
20
23
  ref?: React.RefObject<RNTextInput | null>;
@@ -16,6 +16,8 @@ export type * from "./CheckboxInput/types";
16
16
  export * from "./OtpInput";
17
17
  export * from "./OtpInput/enums";
18
18
  export type * from "./OtpInput/types";
19
+ export * from "./MessageInput";
20
+ export type * from "./MessageInput/types";
19
21
  export * from "./HighlightedText";
20
22
  export type * from "./HighlightedText/types";
21
23
  export * from "./LoadingDots";
@@ -56,3 +58,5 @@ export * from "./PageIndicators";
56
58
  export type * from "./PageIndicators/types";
57
59
  export * from "./ActionButton";
58
60
  export type * from "./ActionButton/types";
61
+ export * from "./MessageInput";
62
+ export type * from "./MessageInput/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kivid/native-components",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.21",
4
4
  "description": "A React Native component library for the Butterfly Design System.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,45 +53,54 @@
53
53
  ]
54
54
  ]
55
55
  },
56
- "dependencies": {},
57
56
  "devDependencies": {
58
57
  "@babel/core": "^7.24.0",
58
+ "@babel/eslint-parser": "^7.28.5",
59
59
  "@babel/preset-env": "^7.25.4",
60
60
  "@lottiefiles/dotlottie-react": "^0.15.1",
61
61
  "@react-native-community/cli": "^15.1.3",
62
62
  "@react-native/babel-preset": "^0.77.0",
63
+ "@react-native/eslint-config": "^0.77.0",
64
+ "@react-native/eslint-plugin": "^0.83.0",
63
65
  "@testing-library/react-native": "^13.3.3",
64
66
  "@types/jest": "^29.5.12",
65
67
  "@types/node": "^24.1.0",
66
68
  "@types/react": "19.0.14",
69
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
70
+ "@typescript-eslint/parser": "^6.21.0",
67
71
  "babel-jest": "^29.7.0",
68
72
  "babel-plugin-module-resolver": "^5.0.2",
69
73
  "class-variance-authority": "^0.7.1",
70
74
  "cross-env": "^7.0.3",
71
- "jest-environment-jsdom": "^29.7.0",
75
+ "eslint": "^8.57.1",
76
+ "eslint-config-prettier": "^10.1.8",
77
+ "eslint-plugin-react": "^7.37.5",
78
+ "eslint-plugin-react-hooks": "^4.6.0",
79
+ "eslint-plugin-react-native": "^5.0.0",
72
80
  "jest": "^29.7.0",
81
+ "jest-environment-jsdom": "^29.7.0",
73
82
  "lottie-react-native": "^7.2.2",
74
83
  "prettier-plugin-tailwindcss": "^0.5.14",
84
+ "react": "19.0.0",
85
+ "react-native": "0.79.5",
75
86
  "react-native-builder-bob": "^0.40.13",
76
87
  "react-native-svg": "^15.12.0",
77
- "react-native": "0.79.5",
78
88
  "react-test-renderer": "19.0.0",
79
- "react": "19.0.0",
80
89
  "ts-jest": "^29.2.5",
81
90
  "typescript": "~5.8.3",
82
- "@kivid/tailwind-preset": "1.0.0-alpha.20",
83
- "@kivid/icons": "1.0.0-alpha.20"
91
+ "@kivid/tailwind-preset": "1.0.0-alpha.21",
92
+ "@kivid/icons": "1.0.0-alpha.21"
84
93
  },
85
94
  "peerDependencies": {
86
95
  "@lottiefiles/dotlottie-react": "^0.15.1",
87
96
  "class-variance-authority": "^0.7.1",
88
97
  "lottie-react-native": "^7.2.4",
89
98
  "nativewind": "4.1.23",
90
- "react-native-svg": "^15.12.0",
91
- "react-native": "0.79.5",
92
99
  "react": "19.0.0",
93
- "@kivid/tailwind-preset": "1.0.0-alpha.20",
94
- "@kivid/icons": "1.0.0-alpha.20"
100
+ "react-native": "0.79.5",
101
+ "react-native-svg": "^15.12.0",
102
+ "@kivid/tailwind-preset": "1.0.0-alpha.21",
103
+ "@kivid/icons": "1.0.0-alpha.21"
95
104
  },
96
105
  "eslintIgnore": [
97
106
  "node_modules/",
@@ -100,6 +109,8 @@
100
109
  "scripts": {
101
110
  "build": "rm -rf dist && tsc -p tsconfig.build.json && bob build && node postbuild.js",
102
111
  "dev": "tsc -p tsconfig.build.json --watch",
112
+ "lint": "eslint src --ext .ts,.tsx",
113
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
103
114
  "test": "jest",
104
115
  "test:watch": "jest --watch",
105
116
  "test:coverage": "jest --coverage"
@@ -1,77 +1,141 @@
1
1
  import { cva } from "class-variance-authority";
2
2
 
3
- export const chatBubbleBoxVariants = cva("gap-400 px-600 py-500 min-h-1000", {
4
- variants: {
5
- variant: {
6
- check: "",
7
- alert: "",
8
- error: "",
9
- custom: "",
10
- },
11
- colorState: {
12
- fill: "",
13
- outline: "border border-chia-400",
14
- },
15
- hasEar: {
16
- true: "",
17
- false: "",
18
- },
19
- messageType: {
20
- initial: "",
21
- followUp: "",
22
- },
23
- fullWidth: {
24
- true: "flex-row w-full",
25
- false: "flex-row",
26
- },
27
- },
28
- compoundVariants: [
29
- {
30
- variant: "check",
31
- colorState: "fill",
32
- className: "bg-pear-500",
33
- },
34
- {
35
- variant: "alert",
36
- colorState: "fill",
37
- className: "bg-tangerine-500",
38
- },
39
- {
40
- variant: "error",
41
- colorState: "fill",
42
- className: "bg-blackberry-500",
3
+ export const chatBubbleBoxVariants = cva(
4
+ "gap-400 px-600 py-500 min-h-1000 shrink min-w-0",
5
+ {
6
+ variants: {
7
+ variant: {
8
+ check: "",
9
+ alert: "",
10
+ error: "",
11
+ custom: "",
12
+ },
13
+ colorState: {
14
+ fill: "",
15
+ outline: "border border-chia-400",
16
+ },
17
+ hasEar: {
18
+ true: "",
19
+ false: "",
20
+ },
21
+ messageType: {
22
+ initial: "",
23
+ followUp: "",
24
+ },
25
+ fullWidth: {
26
+ true: "flex-row w-full",
27
+ false: "flex-row",
28
+ },
29
+ origin: {
30
+ assistant: "",
31
+ user: "",
32
+ },
43
33
  },
44
- {
45
- variant: "custom",
34
+ compoundVariants: [
35
+ {
36
+ variant: "check",
37
+ colorState: "fill",
38
+ className: "bg-pear-500",
39
+ },
40
+ {
41
+ variant: "alert",
42
+ colorState: "fill",
43
+ className: "bg-tangerine-500",
44
+ },
45
+ {
46
+ variant: "error",
47
+ colorState: "fill",
48
+ className: "bg-blackberry-500",
49
+ },
50
+ {
51
+ variant: "custom",
52
+ colorState: "fill",
53
+ className: "bg-chia-100",
54
+ },
55
+ {
56
+ variant: "custom",
57
+ colorState: "outline",
58
+ className: "bg-chia-100",
59
+ },
60
+ {
61
+ colorState: "outline",
62
+ className: "bg-chia-100",
63
+ },
64
+ {
65
+ hasEar: true,
66
+ origin: "assistant",
67
+ className: "rounded-700 rounded-bl-100",
68
+ },
69
+ {
70
+ hasEar: false,
71
+ origin: "assistant",
72
+ className: "rounded-700 rounded-bl-300",
73
+ },
74
+ {
75
+ hasEar: true,
76
+ origin: "user",
77
+ className: "rounded-700 rounded-br-100",
78
+ },
79
+ {
80
+ hasEar: false,
81
+ origin: "user",
82
+ className: "rounded-700 rounded-br-300",
83
+ },
84
+ {
85
+ messageType: "followUp",
86
+ origin: "assistant",
87
+ className: "rounded-tl-300",
88
+ },
89
+ {
90
+ messageType: "followUp",
91
+ origin: "user",
92
+ className: "rounded-tr-300",
93
+ },
94
+ {
95
+ origin: "user",
96
+ variant: "custom",
97
+ colorState: "fill",
98
+ className: "bg-grape-500",
99
+ },
100
+ {
101
+ origin: "user",
102
+ variant: "custom",
103
+ colorState: "outline",
104
+ className: "",
105
+ },
106
+ ],
107
+ defaultVariants: {
46
108
  colorState: "fill",
47
- className: "bg-chia-100",
109
+ messageType: "initial",
110
+ fullWidth: false,
111
+ origin: "assistant",
48
112
  },
49
- {
50
- variant: "custom",
51
- colorState: "outline",
52
- className: "bg-chia-100",
53
- },
54
- {
55
- colorState: "outline",
56
- className: "bg-chia-100",
113
+ }
114
+ );
115
+
116
+ export const chatBubbleTimeVariants = cva(
117
+ "flex-row items-center gap-400 pt-400",
118
+ {
119
+ variants: {
120
+ origin: {
121
+ assistant: "pl-400",
122
+ user: "pr-400",
123
+ },
57
124
  },
58
- {
59
- hasEar: true,
60
- className: "rounded-700 rounded-bl-100",
125
+ defaultVariants: {
126
+ origin: "assistant",
61
127
  },
62
- {
63
- hasEar: false,
64
- className: "rounded-700 rounded-bl-300",
128
+ }
129
+ );
130
+
131
+ export const chatBubbleContainerVariants = cva("flex", {
132
+ variants: {
133
+ origin: {
134
+ assistant: "items-start",
135
+ user: "items-end",
65
136
  },
66
- { messageType: "followUp", className: "rounded-tl-300" },
67
- ],
137
+ },
68
138
  defaultVariants: {
69
- colorState: "fill",
70
- messageType: "initial",
71
- fullWidth: false,
139
+ origin: "assistant",
72
140
  },
73
141
  });
74
-
75
- export const chatBubbleTimeVariants = cva(
76
- "flex-row items-center gap-400 pt-400 pl-400"
77
- );
@@ -1,40 +1,51 @@
1
1
  import React from "react";
2
2
  import Svg, { Path } from "react-native-svg";
3
- import type { SvgProps } from "react-native-svg";
4
-
5
- interface ChatBubbleEarProps extends SvgProps {
6
- type: "fill" | "outline";
7
- color?: string;
8
- }
3
+ import { ChatBubbleEarProps } from "./types";
9
4
 
10
5
  export const ChatBubbleEar: React.FC<ChatBubbleEarProps> = ({
11
6
  type = "fill",
12
7
  color = "#F2F7F7",
8
+ mirrored = false,
13
9
  ...props
14
10
  }) => {
15
- if (type === "outline") {
16
- return (
17
- <Svg width={12} height={10} viewBox="0 0 12 10" fill="none" {...props}>
18
- <Path
19
- d="M11.5 0.5V9.5H7.75098C2.95557 9.34303 1.06326 5.41102 0.511719 3.91016C0.476256 3.80748 0.523736 3.72138 0.575195 3.69141L0.576172 3.69043C0.597192 3.67831 0.616459 3.67593 0.632812 3.67773C0.649308 3.67957 0.669032 3.68628 0.688477 3.7041C1.18665 4.17051 2.2435 4.93738 3.79004 4.9375C6.23009 4.9375 8.23446 2.96737 8.47559 0.5H11.5Z"
20
- fill={color}
21
- stroke="#DEE7E7"
22
- strokeMiterlimit={10}
23
- />
24
- <Path
25
- d="M8 3.15144V9H12V0H9C9 1.47424 8.5 2.46333 8 3.15144Z"
26
- fill={color}
27
- />
28
- </Svg>
29
- );
30
- }
11
+ const transform = mirrored ? [{ scaleX: -1 }] : undefined;
31
12
 
32
- return (
33
- <Svg width={12} height={10} viewBox="0 0 12 10" fill="none" {...props}>
13
+ function renderSvgContent() {
14
+ if (type === "outline") {
15
+ return (
16
+ <>
17
+ <Path
18
+ d="M11.5 0.5V9.5H7.75098C2.95557 9.34303 1.06326 5.41102 0.511719 3.91016C0.476256 3.80748 0.523736 3.72138 0.575195 3.69141L0.576172 3.69043C0.597192 3.67831 0.616459 3.67593 0.632812 3.67773C0.649308 3.67957 0.669032 3.68628 0.688477 3.7041C1.18665 4.17051 2.2435 4.93738 3.79004 4.9375C6.23009 4.9375 8.23446 2.96737 8.47559 0.5H11.5Z"
19
+ fill={color}
20
+ stroke="#DEE7E7"
21
+ strokeMiterlimit={10}
22
+ />
23
+ <Path
24
+ d="M8 3.15144V9H12V0H9C9 1.47424 8.5 2.46333 8 3.15144Z"
25
+ fill={color}
26
+ />
27
+ </>
28
+ );
29
+ }
30
+
31
+ return (
34
32
  <Path
35
33
  d="M12 10V3.55405e-05L8 0C8 2.4436 6.09369 4.43749 3.79039 4.43749C2.41431 4.43749 1.47239 3.75438 1.02718 3.3367C0.832174 3.15714 0.552541 3.12591 0.324419 3.25863C0.0484661 3.41867 -0.0692741 3.76609 0.0411073 4.07837C0.604052 5.61245 2.60563 9.83215 7.73469 10H12Z"
36
34
  fill={color}
37
35
  />
36
+ );
37
+ }
38
+
39
+ return (
40
+ <Svg
41
+ width={12}
42
+ height={10}
43
+ viewBox="0 0 12 10"
44
+ fill="none"
45
+ style={{ transform }}
46
+ {...props}
47
+ >
48
+ {renderSvgContent()}
38
49
  </Svg>
39
50
  );
40
51
  };
@@ -0,0 +1,7 @@
1
+ import { SvgProps } from "react-native-svg";
2
+
3
+ export interface ChatBubbleEarProps extends SvgProps {
4
+ type: "fill" | "outline";
5
+ color?: string;
6
+ mirrored?: boolean;
7
+ }