@kivid/native-components 1.0.0-alpha.24 → 1.0.0-alpha.26
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/DatePicker/assets/theme.js +60 -0
- package/dist/commonjs/components/DatePicker/assets/theme.js.map +1 -1
- package/dist/commonjs/components/DatePicker/index.js +84 -0
- package/dist/commonjs/components/DatePicker/index.js.map +1 -1
- package/dist/commonjs/components/Dropdown/index.js +156 -0
- package/dist/commonjs/components/Dropdown/index.js.map +1 -0
- package/dist/commonjs/components/Dropdown/types.js +6 -0
- package/dist/commonjs/components/Dropdown/types.js.map +1 -0
- package/dist/commonjs/components/ListButton/assets/class-variants.js +2 -1
- package/dist/commonjs/components/ListButton/assets/class-variants.js.map +1 -1
- package/dist/commonjs/components/ListButton/assets/design-system-showcase.js +59 -0
- package/dist/commonjs/components/ListButton/assets/design-system-showcase.js.map +1 -1
- package/dist/commonjs/components/ListButton/enums/variant.js +1 -0
- package/dist/commonjs/components/ListButton/enums/variant.js.map +1 -1
- package/dist/commonjs/components/Tab/assets/class-variants.js +69 -0
- package/dist/commonjs/components/Tab/assets/class-variants.js.map +1 -0
- package/dist/commonjs/components/Tab/index.js +90 -0
- package/dist/commonjs/components/Tab/index.js.map +1 -0
- package/dist/commonjs/components/Tab/types.js +6 -0
- package/dist/commonjs/components/Tab/types.js.map +1 -0
- package/dist/commonjs/components/TextAreaInput/assets/class-variants.js +91 -0
- package/dist/commonjs/components/TextAreaInput/assets/class-variants.js.map +1 -0
- package/dist/commonjs/components/TextAreaInput/enums.js +12 -0
- package/dist/commonjs/components/TextAreaInput/enums.js.map +1 -0
- package/dist/commonjs/components/TextAreaInput/index.js +105 -0
- package/dist/commonjs/components/TextAreaInput/index.js.map +1 -0
- package/dist/commonjs/components/TextAreaInput/types.js +6 -0
- package/dist/commonjs/components/TextAreaInput/types.js.map +1 -0
- package/dist/commonjs/components/Title/components/marker/index.js +11 -4
- package/dist/commonjs/components/Title/components/marker/index.js.map +1 -1
- package/dist/commonjs/components/index.js +81 -26
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/module/components/DatePicker/assets/theme.js +60 -0
- package/dist/module/components/DatePicker/assets/theme.js.map +1 -1
- package/dist/module/components/DatePicker/index.js +85 -1
- package/dist/module/components/DatePicker/index.js.map +1 -1
- package/dist/module/components/Dropdown/index.js +151 -0
- package/dist/module/components/Dropdown/index.js.map +1 -0
- package/dist/module/components/Dropdown/types.js +4 -0
- package/dist/module/components/Dropdown/types.js.map +1 -0
- package/dist/module/components/ListButton/assets/class-variants.js +2 -1
- package/dist/module/components/ListButton/assets/class-variants.js.map +1 -1
- package/dist/module/components/ListButton/assets/design-system-showcase.js +59 -0
- package/dist/module/components/ListButton/assets/design-system-showcase.js.map +1 -1
- package/dist/module/components/ListButton/enums/variant.js +1 -0
- package/dist/module/components/ListButton/enums/variant.js.map +1 -1
- package/dist/module/components/Tab/assets/class-variants.js +66 -0
- package/dist/module/components/Tab/assets/class-variants.js.map +1 -0
- package/dist/module/components/Tab/index.js +86 -0
- package/dist/module/components/Tab/index.js.map +1 -0
- package/dist/module/components/Tab/types.js +4 -0
- package/dist/module/components/Tab/types.js.map +1 -0
- package/dist/module/components/TextAreaInput/assets/class-variants.js +87 -0
- package/dist/module/components/TextAreaInput/assets/class-variants.js.map +1 -0
- package/dist/module/components/TextAreaInput/enums.js +8 -0
- package/dist/module/components/TextAreaInput/enums.js.map +1 -0
- package/dist/module/components/TextAreaInput/index.js +100 -0
- package/dist/module/components/TextAreaInput/index.js.map +1 -0
- package/dist/module/components/TextAreaInput/types.js +4 -0
- package/dist/module/components/TextAreaInput/types.js.map +1 -0
- package/dist/module/components/Title/components/marker/index.js +11 -4
- package/dist/module/components/Title/components/marker/index.js.map +1 -1
- package/dist/module/components/index.js +5 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/typescript/components/DatePicker/assets/theme.d.ts +60 -0
- package/dist/typescript/components/Dropdown/index.d.ts +3 -0
- package/dist/typescript/components/Dropdown/types.d.ts +20 -0
- package/dist/typescript/components/ListButton/enums/variant.d.ts +2 -1
- package/dist/typescript/components/Tab/assets/class-variants.d.ts +18 -0
- package/dist/typescript/components/Tab/index.d.ts +2 -0
- package/dist/typescript/components/Tab/types.d.ts +17 -0
- package/dist/typescript/components/TextAreaInput/assets/class-variants.d.ts +17 -0
- package/dist/typescript/components/TextAreaInput/enums.d.ts +4 -0
- package/dist/typescript/components/TextAreaInput/index.d.ts +2 -0
- package/dist/typescript/components/TextAreaInput/types.d.ts +22 -0
- package/dist/typescript/components/Title/components/marker/index.d.ts +1 -1
- package/dist/typescript/components/Title/components/marker/types.d.ts +1 -0
- package/dist/typescript/components/index.d.ts +8 -0
- package/package.json +6 -5
- package/src/components/DatePicker/assets/theme.ts +60 -0
- package/src/components/DatePicker/index.tsx +106 -4
- package/src/components/Dropdown/index.tsx +165 -0
- package/src/components/Dropdown/types.ts +21 -0
- package/src/components/ListButton/assets/class-variants.ts +4 -0
- package/src/components/ListButton/assets/design-system-showcase.ts +69 -0
- package/src/components/ListButton/enums/variant.ts +1 -0
- package/src/components/Tab/assets/class-variants.ts +83 -0
- package/src/components/Tab/index.tsx +92 -0
- package/src/components/Tab/types.ts +20 -0
- package/src/components/TextAreaInput/assets/class-variants.ts +96 -0
- package/src/components/TextAreaInput/enums.ts +4 -0
- package/src/components/TextAreaInput/index.tsx +119 -0
- package/src/components/TextAreaInput/types.ts +28 -0
- package/src/components/Title/components/marker/index.tsx +10 -2
- package/src/components/Title/components/marker/types.ts +1 -0
- package/src/components/index.ts +11 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, TextInput as RNTextInput, Pressable } from 'react-native';
|
|
4
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
5
|
+
import { TooltipVariantEnum } from "../Tooltip/enum/index.js";
|
|
6
|
+
import Typography from "../Typography/index.js";
|
|
7
|
+
import { TextAreaInputCornersEnum } from "./enums.js";
|
|
8
|
+
import { labelVariant, textInputContainerVariants, textInputFieldVariants } from "./assets/class-variants.js";
|
|
9
|
+
import { merge } from '@kivid/tailwind-preset';
|
|
10
|
+
import { useRef } from 'react';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export function TextAreaInput(props) {
|
|
13
|
+
const {
|
|
14
|
+
value,
|
|
15
|
+
onChangeText,
|
|
16
|
+
onBlur,
|
|
17
|
+
placeholder,
|
|
18
|
+
label,
|
|
19
|
+
error,
|
|
20
|
+
maxLength = 200,
|
|
21
|
+
disabled = false,
|
|
22
|
+
corners = TextAreaInputCornersEnum.MEDIUM,
|
|
23
|
+
insideLabel = false,
|
|
24
|
+
className,
|
|
25
|
+
inputClassName,
|
|
26
|
+
labelClassName,
|
|
27
|
+
tooltipClassName,
|
|
28
|
+
tooltipPointerClassName,
|
|
29
|
+
tooltipContainerClassName,
|
|
30
|
+
showMaxLength = true,
|
|
31
|
+
containerTestID,
|
|
32
|
+
...rest
|
|
33
|
+
} = props;
|
|
34
|
+
const currentLength = value?.length || 0;
|
|
35
|
+
const hasLabel = !!label;
|
|
36
|
+
const hasError = !!error;
|
|
37
|
+
const inputRef = useRef(null);
|
|
38
|
+
const handleChangeText = text => {
|
|
39
|
+
if (text.length <= maxLength) {
|
|
40
|
+
onChangeText?.(text);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const formattedCurrentLength = currentLength.toString().padStart(3, '0');
|
|
44
|
+
return /*#__PURE__*/_jsxs(Tooltip, {
|
|
45
|
+
isOpenedByVariantError: hasError,
|
|
46
|
+
message: error,
|
|
47
|
+
variant: TooltipVariantEnum.ERROR,
|
|
48
|
+
className: tooltipClassName,
|
|
49
|
+
pointerClassName: tooltipPointerClassName,
|
|
50
|
+
containerClassName: tooltipContainerClassName,
|
|
51
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
52
|
+
className: labelVariant({
|
|
53
|
+
insideLabel,
|
|
54
|
+
corners
|
|
55
|
+
}),
|
|
56
|
+
children: [label && /*#__PURE__*/_jsx(Typography, {
|
|
57
|
+
variant: "label_small",
|
|
58
|
+
weight: "600",
|
|
59
|
+
className: merge("text-chia-900", labelClassName),
|
|
60
|
+
children: label
|
|
61
|
+
}), showMaxLength && /*#__PURE__*/_jsxs(Typography, {
|
|
62
|
+
variant: "label_small",
|
|
63
|
+
weight: "500",
|
|
64
|
+
className: "text-chia-600",
|
|
65
|
+
children: [formattedCurrentLength, "/", maxLength]
|
|
66
|
+
})]
|
|
67
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
68
|
+
testID: containerTestID,
|
|
69
|
+
className: merge(textInputContainerVariants({
|
|
70
|
+
corners,
|
|
71
|
+
error: !!error,
|
|
72
|
+
disabled,
|
|
73
|
+
insideLabel
|
|
74
|
+
}), className),
|
|
75
|
+
onPress: () => {
|
|
76
|
+
if (!disabled) {
|
|
77
|
+
inputRef.current?.focus();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
disabled: disabled,
|
|
81
|
+
children: /*#__PURE__*/_jsx(RNTextInput, {
|
|
82
|
+
value: value,
|
|
83
|
+
onChangeText: handleChangeText,
|
|
84
|
+
onBlur: onBlur,
|
|
85
|
+
placeholder: placeholder,
|
|
86
|
+
multiline: true,
|
|
87
|
+
maxLength: maxLength,
|
|
88
|
+
placeholderTextColor: "#9CA3AF",
|
|
89
|
+
textAlignVertical: "top",
|
|
90
|
+
className: merge(textInputFieldVariants({
|
|
91
|
+
disabled,
|
|
92
|
+
error: hasError,
|
|
93
|
+
showLabel: hasLabel
|
|
94
|
+
}), inputClassName),
|
|
95
|
+
...rest
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","TextInput","RNTextInput","Pressable","Tooltip","TooltipVariantEnum","Typography","TextAreaInputCornersEnum","labelVariant","textInputContainerVariants","textInputFieldVariants","merge","useRef","jsx","_jsx","jsxs","_jsxs","TextAreaInput","props","value","onChangeText","onBlur","placeholder","label","error","maxLength","disabled","corners","MEDIUM","insideLabel","className","inputClassName","labelClassName","tooltipClassName","tooltipPointerClassName","tooltipContainerClassName","showMaxLength","containerTestID","rest","currentLength","length","hasLabel","hasError","inputRef","handleChangeText","text","formattedCurrentLength","toString","padStart","isOpenedByVariantError","message","variant","ERROR","pointerClassName","containerClassName","children","weight","testID","onPress","current","focus","multiline","placeholderTextColor","textAlignVertical","showLabel"],"sourceRoot":"../../../../src","sources":["components/TextAreaInput/index.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/TextAreaInput/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -6,7 +6,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
export function Marker(props) {
|
|
7
7
|
const {
|
|
8
8
|
size = SizeEnum.MEDIUM,
|
|
9
|
-
color = "chia"
|
|
9
|
+
color = "chia",
|
|
10
|
+
customMarkerComponent
|
|
10
11
|
} = props;
|
|
11
12
|
const mappedSize = {
|
|
12
13
|
[SizeEnum.SMALL]: "w-700 h-300",
|
|
@@ -23,8 +24,14 @@ export function Marker(props) {
|
|
|
23
24
|
chia: "bg-chia-600",
|
|
24
25
|
ghost: "bg-chia-200"
|
|
25
26
|
}[color];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
function renderMarker() {
|
|
28
|
+
if (customMarkerComponent) {
|
|
29
|
+
return customMarkerComponent;
|
|
30
|
+
}
|
|
31
|
+
return /*#__PURE__*/_jsx(View, {
|
|
32
|
+
className: `${mappedColor} ${mappedSize} rounded-500`
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return renderMarker();
|
|
29
36
|
}
|
|
30
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","SizeEnum","jsx","_jsx","Marker","props","size","MEDIUM","color","mappedSize","SMALL","mappedColor","pear","java","grape","pitaya","tangerine","mango","blackberry","chia","ghost","className"],"sourceRoot":"../../../../../../src","sources":["components/Title/components/marker/index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AAEnC,SAASC,QAAQ,QAAQ,4BAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,OAAO,SAASC,MAAMA,CAACC,KAAkB,EAAE;EACzC,MAAM;IAAEC,IAAI,GAAGL,QAAQ,CAACM,MAAM;IAAEC,KAAK,GAAG;
|
|
1
|
+
{"version":3,"names":["View","SizeEnum","jsx","_jsx","Marker","props","size","MEDIUM","color","customMarkerComponent","mappedSize","SMALL","mappedColor","pear","java","grape","pitaya","tangerine","mango","blackberry","chia","ghost","renderMarker","className"],"sourceRoot":"../../../../../../src","sources":["components/Title/components/marker/index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AAEnC,SAASC,QAAQ,QAAQ,4BAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,OAAO,SAASC,MAAMA,CAACC,KAAkB,EAAE;EACzC,MAAM;IAAEC,IAAI,GAAGL,QAAQ,CAACM,MAAM;IAAEC,KAAK,GAAG,MAAM;IAAEC;EAAsB,CAAC,GAAGJ,KAAK;EAE/E,MAAMK,UAAU,GAAG;IACjB,CAACT,QAAQ,CAACU,KAAK,GAAG,aAAa;IAC/B,CAACV,QAAQ,CAACM,MAAM,GAAG;EACrB,CAAC,CAACD,IAAI,CAAC;EAEP,MAAMM,WAAW,GAAG;IAClBC,IAAI,EAAE,aAAa;IACnBC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE,cAAc;IACrBC,MAAM,EAAE,eAAe;IACvBC,SAAS,EAAE,kBAAkB;IAC7BC,KAAK,EAAE,cAAc;IACrBC,UAAU,EAAE,mBAAmB;IAC/BC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC,CAACb,KAAK,CAAC;EAER,SAASc,YAAYA,CAAA,EAAG;IACtB,IAAIb,qBAAqB,EAAE;MACzB,OAAOA,qBAAqB;IAC9B;IAEA,oBAAON,IAAA,CAACH,IAAI;MAACuB,SAAS,EAAE,GAAGX,WAAW,IAAIF,UAAU;IAAe,CAAE,CAAC;EACxE;EAEA,OAAOY,YAAY,CAAC,CAAC;AACvB","ignoreList":[]}
|
|
@@ -25,6 +25,7 @@ export * from "./Typography/index.js";
|
|
|
25
25
|
export * from "./Toast/index.js";
|
|
26
26
|
export * from "./Toast/enums/index.js";
|
|
27
27
|
export * from "./Tooltip/index.js";
|
|
28
|
+
export * from "./Tooltip/enum/index.js";
|
|
28
29
|
export * from "./ListButton/index.js";
|
|
29
30
|
export * from "./ListButton/enums/index.js";
|
|
30
31
|
export * from "./TextInput/index.js";
|
|
@@ -40,4 +41,8 @@ export * from "./PageIndicators/index.js";
|
|
|
40
41
|
export * from "./ActionButton/index.js";
|
|
41
42
|
export * from "./MessageInput/index.js";
|
|
42
43
|
export * from "./DatePicker/index.js";
|
|
44
|
+
export * from "./Tab/index.js";
|
|
45
|
+
export * from "./Dropdown/index.js";
|
|
46
|
+
export * from "./TextAreaInput/index.js";
|
|
47
|
+
export * from "./TextAreaInput/enums.js";
|
|
43
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;AACxB,cAAc,mBAAU;AAGxB,cAAc,uBAAc;AAI5B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,iBAAc;AAE5B,cAAc,8BAAqB;AACnC,cAAc,8BAA2B;AAGzC,cAAc,0BAAiB;AAC/B,cAAc,gCAAuB;AAGrC,cAAc,qBAAY;AAC1B,cAAc,2BAAkB;AAGhC,cAAc,yBAAgB;AAG9B,cAAc,4BAAmB;AAGjC,cAAc,wBAAe;AAC7B,cAAc,wBAAqB;AAEnC,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAG5B,cAAc,kBAAS;AAGvB,cAAc,mBAAU;AACxB,cAAc,yBAAgB;AAG9B,cAAc,uBAAc;AAG5B,cAAc,kBAAS;AACvB,cAAc,wBAAe;AAG7B,cAAc,oBAAW;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;AACxB,cAAc,mBAAU;AAGxB,cAAc,uBAAc;AAI5B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,iBAAc;AAE5B,cAAc,8BAAqB;AACnC,cAAc,8BAA2B;AAGzC,cAAc,0BAAiB;AAC/B,cAAc,gCAAuB;AAGrC,cAAc,qBAAY;AAC1B,cAAc,2BAAkB;AAGhC,cAAc,yBAAgB;AAG9B,cAAc,4BAAmB;AAGjC,cAAc,wBAAe;AAC7B,cAAc,wBAAqB;AAEnC,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAG5B,cAAc,kBAAS;AAGvB,cAAc,mBAAU;AACxB,cAAc,yBAAgB;AAG9B,cAAc,uBAAc;AAG5B,cAAc,kBAAS;AACvB,cAAc,wBAAe;AAG7B,cAAc,oBAAW;AACzB,cAAc,yBAAgB;AAG9B,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;AAG9B,cAAc,uBAAc;AAG5B,cAAc,gBAAO;AAGrB,cAAc,qBAAY;AAG1B,cAAc,0BAAiB;AAC/B,cAAc,0BAAuB","ignoreList":[]}
|
|
@@ -89,4 +89,64 @@ export declare const defaultTheme: {
|
|
|
89
89
|
color: string;
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
+
"stylesheet.day.period": {
|
|
93
|
+
container: {
|
|
94
|
+
alignSelf: "stretch";
|
|
95
|
+
alignItems: "center";
|
|
96
|
+
};
|
|
97
|
+
base: {
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
alignItems: "center";
|
|
101
|
+
justifyContent: "center";
|
|
102
|
+
borderWidth: number;
|
|
103
|
+
borderColor: string;
|
|
104
|
+
borderRadius: number;
|
|
105
|
+
};
|
|
106
|
+
text: {
|
|
107
|
+
fontSize: number;
|
|
108
|
+
fontWeight: "500";
|
|
109
|
+
color: string;
|
|
110
|
+
};
|
|
111
|
+
leftFiller: {
|
|
112
|
+
backgroundColor: string;
|
|
113
|
+
};
|
|
114
|
+
rightFiller: {
|
|
115
|
+
backgroundColor: string;
|
|
116
|
+
};
|
|
117
|
+
fillers: {
|
|
118
|
+
backgroundColor: string;
|
|
119
|
+
};
|
|
120
|
+
selected: {
|
|
121
|
+
backgroundColor: string;
|
|
122
|
+
borderWidth: number;
|
|
123
|
+
borderColor: string;
|
|
124
|
+
borderRadius: number;
|
|
125
|
+
};
|
|
126
|
+
today: {
|
|
127
|
+
backgroundColor: string;
|
|
128
|
+
borderWidth: number;
|
|
129
|
+
borderColor: string;
|
|
130
|
+
};
|
|
131
|
+
todayText: {
|
|
132
|
+
color: string;
|
|
133
|
+
fontWeight: "600";
|
|
134
|
+
};
|
|
135
|
+
disabled: {
|
|
136
|
+
opacity: number;
|
|
137
|
+
borderWidth: number;
|
|
138
|
+
borderRadius: number;
|
|
139
|
+
};
|
|
140
|
+
disabledText: {
|
|
141
|
+
color: string;
|
|
142
|
+
};
|
|
143
|
+
dot: {
|
|
144
|
+
width: number;
|
|
145
|
+
height: number;
|
|
146
|
+
marginTop: number;
|
|
147
|
+
borderRadius: number;
|
|
148
|
+
opacity: number;
|
|
149
|
+
position: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
92
152
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { IconButtonProps } from "../IconButton/types";
|
|
3
|
+
import { SizeEnum } from "../../enums";
|
|
4
|
+
export interface DropdownProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
contentBoxClassName?: string;
|
|
11
|
+
leftButtonText?: string;
|
|
12
|
+
hidePlaceholder?: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
iconButtonTrigger?: IconButtonProps;
|
|
15
|
+
iconButtonAlign?: "left" | "right" | "center";
|
|
16
|
+
size?: SizeEnum.SMALL | SizeEnum.MEDIUM;
|
|
17
|
+
corner?: SizeEnum.SMALL | SizeEnum.MEDIUM;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
onActiveChange: (isActive: boolean) => void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SizeEnum } from "../../../enums";
|
|
2
|
+
declare const tabContainerVariants: (props?: ({
|
|
3
|
+
size?: SizeEnum.SMALL | SizeEnum.MEDIUM | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
declare const dividerVariants: (props?: ({
|
|
6
|
+
selected?: boolean | null | undefined;
|
|
7
|
+
size?: SizeEnum.SMALL | SizeEnum.MEDIUM | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare const tabLabelVariants: (props?: ({
|
|
10
|
+
selected?: boolean | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare const tabCountVariants: (props?: ({
|
|
13
|
+
selected?: boolean | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
declare const tabCountTextVariants: (props?: ({
|
|
16
|
+
selected?: boolean | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
export { tabContainerVariants, dividerVariants, tabLabelVariants, tabCountVariants, tabCountTextVariants, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SizeEnum } from "../../enums";
|
|
3
|
+
export type TabSize = SizeEnum.SMALL | SizeEnum.MEDIUM;
|
|
4
|
+
export interface TabItem {
|
|
5
|
+
label: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TabProps {
|
|
9
|
+
items: TabItem[];
|
|
10
|
+
onTabChange: (index: number) => void;
|
|
11
|
+
size?: TabSize;
|
|
12
|
+
className?: string;
|
|
13
|
+
customDividerColor?: string;
|
|
14
|
+
customDividerComponent?: ReactNode;
|
|
15
|
+
selectedTab: number;
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const textInputContainerVariants: (props?: ({
|
|
2
|
+
corners?: "small" | "medium" | null | undefined;
|
|
3
|
+
error?: boolean | null | undefined;
|
|
4
|
+
disabled?: boolean | null | undefined;
|
|
5
|
+
insideLabel?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const labelVariant: (props?: ({
|
|
8
|
+
insideLabel?: boolean | null | undefined;
|
|
9
|
+
corners?: "small" | "medium" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export declare const textInputFieldVariants: (props?: ({
|
|
12
|
+
disabled?: boolean | null | undefined;
|
|
13
|
+
isValid?: boolean | null | undefined;
|
|
14
|
+
error?: boolean | null | undefined;
|
|
15
|
+
showLabel?: boolean | null | undefined;
|
|
16
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TextInputProps as RNTextInputProps, TextInput as RNTextInput } from "react-native";
|
|
2
|
+
import { TextAreaInputCornersEnum } from "./enums";
|
|
3
|
+
export type TextAreaInputCorners = TextAreaInputCornersEnum;
|
|
4
|
+
export interface TextAreaInputProps extends Omit<RNTextInputProps, "value" | "onChangeText"> {
|
|
5
|
+
corners?: TextAreaInputCorners;
|
|
6
|
+
label?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
inputClassName?: string;
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
containerTestID?: string;
|
|
14
|
+
tooltipClassName?: string;
|
|
15
|
+
tooltipPointerClassName?: string;
|
|
16
|
+
tooltipContainerClassName?: string;
|
|
17
|
+
maxLength?: number;
|
|
18
|
+
showMaxLength?: boolean;
|
|
19
|
+
insideLabel?: boolean;
|
|
20
|
+
onChangeText?: (text: string) => void;
|
|
21
|
+
ref?: React.RefObject<RNTextInput | null>;
|
|
22
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { MarkerProps } from "./types";
|
|
2
|
-
export declare function Marker(props: MarkerProps): import("react").JSX.Element;
|
|
2
|
+
export declare function Marker(props: MarkerProps): string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SizeEnum } from "../../../../enums";
|
|
2
2
|
export type MarkerSize = SizeEnum.SMALL | SizeEnum.MEDIUM;
|
|
3
3
|
export interface MarkerProps {
|
|
4
|
+
customMarkerComponent?: React.ReactNode;
|
|
4
5
|
size?: MarkerSize;
|
|
5
6
|
color?: "pear" | "java" | "grape" | "pitaya" | "tangerine" | "mango" | "blackberry" | "chia" | "ghost";
|
|
6
7
|
}
|
|
@@ -36,6 +36,7 @@ export * from "./Toast";
|
|
|
36
36
|
export * from "./Toast/enums";
|
|
37
37
|
export type * from "./Toast/types";
|
|
38
38
|
export * from "./Tooltip";
|
|
39
|
+
export * from "./Tooltip/enum";
|
|
39
40
|
export type * from "./Tooltip/types";
|
|
40
41
|
export * from "./ListButton";
|
|
41
42
|
export * from "./ListButton/enums";
|
|
@@ -62,3 +63,10 @@ export * from "./MessageInput";
|
|
|
62
63
|
export type * from "./MessageInput/types";
|
|
63
64
|
export * from "./DatePicker";
|
|
64
65
|
export type * from "./DatePicker/types";
|
|
66
|
+
export * from "./Tab";
|
|
67
|
+
export type * from "./Tab/types";
|
|
68
|
+
export * from "./Dropdown";
|
|
69
|
+
export type * from "./Dropdown/types";
|
|
70
|
+
export * from "./TextAreaInput";
|
|
71
|
+
export * from "./TextAreaInput/enums";
|
|
72
|
+
export type * from "./TextAreaInput/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.26",
|
|
4
4
|
"description": "A React Native component library for the Butterfly Design System.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"react-test-renderer": "19.0.0",
|
|
89
89
|
"ts-jest": "^29.2.5",
|
|
90
90
|
"typescript": "~5.8.3",
|
|
91
|
-
"@kivid/tailwind-preset": "1.0.0-alpha.
|
|
92
|
-
"@kivid/icons": "1.0.0-alpha.
|
|
91
|
+
"@kivid/tailwind-preset": "1.0.0-alpha.26",
|
|
92
|
+
"@kivid/icons": "1.0.0-alpha.26"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"react": "19.0.0",
|
|
100
100
|
"react-native": "0.79.5",
|
|
101
101
|
"react-native-svg": "^15.12.0",
|
|
102
|
-
"@kivid/tailwind-preset": "1.0.0-alpha.
|
|
103
|
-
"@kivid/icons": "1.0.0-alpha.
|
|
102
|
+
"@kivid/tailwind-preset": "1.0.0-alpha.26",
|
|
103
|
+
"@kivid/icons": "1.0.0-alpha.26"
|
|
104
104
|
},
|
|
105
105
|
"eslintIgnore": [
|
|
106
106
|
"node_modules/",
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
116
116
|
"lint": "eslint src --ext .ts,.tsx",
|
|
117
117
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
118
|
+
"check-types": "tsc --noEmit",
|
|
118
119
|
"test": "jest",
|
|
119
120
|
"test:watch": "jest --watch",
|
|
120
121
|
"test:coverage": "jest --coverage"
|
|
@@ -89,4 +89,64 @@ export const defaultTheme = {
|
|
|
89
89
|
color: "#D1D5DB",
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
+
"stylesheet.day.period": {
|
|
93
|
+
container: {
|
|
94
|
+
alignSelf: "stretch" as const,
|
|
95
|
+
alignItems: "center" as const,
|
|
96
|
+
},
|
|
97
|
+
base: {
|
|
98
|
+
width: 40,
|
|
99
|
+
height: 35,
|
|
100
|
+
alignItems: "center" as const,
|
|
101
|
+
justifyContent: "center" as const,
|
|
102
|
+
borderWidth: 1,
|
|
103
|
+
borderColor: "#DEE7E7",
|
|
104
|
+
borderRadius: 8,
|
|
105
|
+
},
|
|
106
|
+
text: {
|
|
107
|
+
fontSize: 16,
|
|
108
|
+
fontWeight: "500" as const,
|
|
109
|
+
color: "#1F2937",
|
|
110
|
+
},
|
|
111
|
+
leftFiller: {
|
|
112
|
+
backgroundColor: "#FAFCFC",
|
|
113
|
+
},
|
|
114
|
+
rightFiller: {
|
|
115
|
+
backgroundColor: "#FAFCFC",
|
|
116
|
+
},
|
|
117
|
+
fillers: {
|
|
118
|
+
backgroundColor: "#FAFCFC",
|
|
119
|
+
},
|
|
120
|
+
selected: {
|
|
121
|
+
backgroundColor: "#EAE0FF",
|
|
122
|
+
borderWidth: 1,
|
|
123
|
+
borderColor: "#B9A0F2",
|
|
124
|
+
borderRadius: 8,
|
|
125
|
+
},
|
|
126
|
+
today: {
|
|
127
|
+
backgroundColor: "transparent",
|
|
128
|
+
borderWidth: 1,
|
|
129
|
+
borderColor: "#DEE7E7",
|
|
130
|
+
},
|
|
131
|
+
todayText: {
|
|
132
|
+
color: "#1F2937",
|
|
133
|
+
fontWeight: "600" as const,
|
|
134
|
+
},
|
|
135
|
+
disabled: {
|
|
136
|
+
opacity: 0.3,
|
|
137
|
+
borderWidth: 0,
|
|
138
|
+
borderRadius: 8,
|
|
139
|
+
},
|
|
140
|
+
disabledText: {
|
|
141
|
+
color: "#D1D5DB",
|
|
142
|
+
},
|
|
143
|
+
dot: {
|
|
144
|
+
width: 0,
|
|
145
|
+
height: 0,
|
|
146
|
+
marginTop: 0,
|
|
147
|
+
borderRadius: 0,
|
|
148
|
+
opacity: 0,
|
|
149
|
+
position: "absolute",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
92
152
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React, { useState, useMemo, useCallback } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Calendar, DateData, LocaleConfig } from "react-native-calendars";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
format,
|
|
6
|
+
eachDayOfInterval,
|
|
7
|
+
parseISO,
|
|
8
|
+
isAfter,
|
|
9
|
+
isValid,
|
|
10
|
+
} from "date-fns";
|
|
5
11
|
import { ptBR } from "date-fns/locale";
|
|
6
12
|
import type { DatePickerProps } from "./types";
|
|
7
13
|
|
|
@@ -53,6 +59,26 @@ LocaleConfig.locales["pt-br"] = {
|
|
|
53
59
|
};
|
|
54
60
|
LocaleConfig.defaultLocale = "pt-br";
|
|
55
61
|
|
|
62
|
+
function generateDateRange(startDate: string, endDate: string): string[] {
|
|
63
|
+
try {
|
|
64
|
+
const start = parseISO(startDate);
|
|
65
|
+
const end = parseISO(endDate);
|
|
66
|
+
|
|
67
|
+
if (!isValid(start) || !isValid(end)) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (isAfter(start, end)) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const days = eachDayOfInterval({ start, end });
|
|
76
|
+
return days.map((d) => format(d, "yyyy-MM-dd"));
|
|
77
|
+
} catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
56
82
|
function DatePicker(props: DatePickerProps) {
|
|
57
83
|
const {
|
|
58
84
|
selectedDates,
|
|
@@ -68,7 +94,7 @@ function DatePicker(props: DatePickerProps) {
|
|
|
68
94
|
} = props;
|
|
69
95
|
|
|
70
96
|
const [currentMonth, setCurrentMonth] = useState<string>(
|
|
71
|
-
initialDate || format(new Date(), "yyyy-MM-dd")
|
|
97
|
+
initialDate || format(new Date(), "yyyy-MM-dd"),
|
|
72
98
|
);
|
|
73
99
|
|
|
74
100
|
const onDayPress = useCallback(
|
|
@@ -99,13 +125,39 @@ function DatePicker(props: DatePickerProps) {
|
|
|
99
125
|
});
|
|
100
126
|
return;
|
|
101
127
|
}
|
|
128
|
+
|
|
129
|
+
if (selectionType === "period") {
|
|
130
|
+
onSelectedDatesChange((prev) => {
|
|
131
|
+
if (prev.length === 0) {
|
|
132
|
+
return [dateString];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (prev.length === 1) {
|
|
136
|
+
const startDate = prev[0];
|
|
137
|
+
|
|
138
|
+
if (startDate === dateString) {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const range = generateDateRange(
|
|
143
|
+
startDate < dateString ? startDate : dateString,
|
|
144
|
+
startDate < dateString ? dateString : startDate,
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
return range;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return [dateString];
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
102
154
|
},
|
|
103
155
|
[
|
|
104
156
|
onSelectedDatesChange,
|
|
105
157
|
selectionType,
|
|
106
158
|
externalMarkedDates,
|
|
107
159
|
unavailableDates,
|
|
108
|
-
]
|
|
160
|
+
],
|
|
109
161
|
);
|
|
110
162
|
|
|
111
163
|
const markedDates = useMemo(() => {
|
|
@@ -117,7 +169,7 @@ function DatePicker(props: DatePickerProps) {
|
|
|
117
169
|
}
|
|
118
170
|
return acc;
|
|
119
171
|
},
|
|
120
|
-
{} as typeof externalMarkedDates
|
|
172
|
+
{} as typeof externalMarkedDates,
|
|
121
173
|
)
|
|
122
174
|
: {};
|
|
123
175
|
|
|
@@ -173,6 +225,56 @@ function DatePicker(props: DatePickerProps) {
|
|
|
173
225
|
return marked;
|
|
174
226
|
}
|
|
175
227
|
|
|
228
|
+
if (selectionType === "period") {
|
|
229
|
+
if (selectedDates.length === 1) {
|
|
230
|
+
const singleDate = selectedDates[0];
|
|
231
|
+
if (!unavailableDates?.includes(singleDate)) {
|
|
232
|
+
marked[singleDate] = {
|
|
233
|
+
...marked[singleDate],
|
|
234
|
+
selected: true,
|
|
235
|
+
selectedColor: "#EAE0FF",
|
|
236
|
+
selectedTextColor: "#1F2937",
|
|
237
|
+
customContainerStyle: {
|
|
238
|
+
backgroundColor: "#EAE0FF",
|
|
239
|
+
borderWidth: 1,
|
|
240
|
+
borderColor: "#B9A0F2",
|
|
241
|
+
borderRadius: 8,
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
} else if (selectedDates.length > 1) {
|
|
246
|
+
selectedDates.forEach((date, index) => {
|
|
247
|
+
const isStart = index === 0;
|
|
248
|
+
const isEnd = index === selectedDates.length - 1;
|
|
249
|
+
const isUnavailable = unavailableDates?.includes(date);
|
|
250
|
+
|
|
251
|
+
if (isUnavailable) {
|
|
252
|
+
marked[date] = {
|
|
253
|
+
...marked[date],
|
|
254
|
+
startingDay: isStart,
|
|
255
|
+
endingDay: isEnd,
|
|
256
|
+
};
|
|
257
|
+
} else {
|
|
258
|
+
marked[date] = {
|
|
259
|
+
...marked[date],
|
|
260
|
+
selected: true,
|
|
261
|
+
color: "#EAE0FF",
|
|
262
|
+
textColor: "#1F2937",
|
|
263
|
+
startingDay: isStart,
|
|
264
|
+
endingDay: isEnd,
|
|
265
|
+
customContainerStyle: {
|
|
266
|
+
backgroundColor: "#EAE0FF",
|
|
267
|
+
borderWidth: 1,
|
|
268
|
+
borderColor: "#B9A0F2",
|
|
269
|
+
borderRadius: 8,
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return marked;
|
|
276
|
+
}
|
|
277
|
+
|
|
176
278
|
return marked;
|
|
177
279
|
}, [selectedDates, externalMarkedDates, selectionType, unavailableDates]);
|
|
178
280
|
|