@atlure/ui 0.12.1 → 0.12.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlure/ui",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Atlure React Native component library: NativeWind primitives built on @atlure/tokens, shipped as untranspiled TypeScript source",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "David Moreira",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"class-variance-authority": "0.7.1",
|
|
38
38
|
"clsx": "2.1.1",
|
|
39
39
|
"tailwind-merge": "2.6.0",
|
|
40
|
-
"@atlure/icons": "0.12.
|
|
41
|
-
"@atlure/tokens": "0.12.
|
|
42
|
-
"@atlure/types": "0.12.
|
|
40
|
+
"@atlure/icons": "0.12.3",
|
|
41
|
+
"@atlure/tokens": "0.12.3",
|
|
42
|
+
"@atlure/types": "0.12.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"nativewind": "^4.2.6",
|
|
@@ -22,9 +22,24 @@ export interface InputProps extends Omit<TextInputProps, "editable" | "multiline
|
|
|
22
22
|
ref?: Ref<ComponentRef<typeof TextInput>>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
:
|
|
25
|
+
const CONTROL_HEIGHT_PX: Record<NonNullable<InputVariantProps["size"]>, number> = {
|
|
26
|
+
sm: 36,
|
|
27
|
+
md: 40,
|
|
28
|
+
lg: 48,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function singleLineVerticalFix(
|
|
32
|
+
size: NonNullable<InputVariantProps["size"]>,
|
|
33
|
+
): { paddingTop: 0; paddingBottom: 0; lineHeight: number; includeFontPadding?: false } {
|
|
34
|
+
const base = {
|
|
35
|
+
paddingTop: 0 as const,
|
|
36
|
+
paddingBottom: 0 as const,
|
|
37
|
+
lineHeight: CONTROL_HEIGHT_PX[size],
|
|
38
|
+
};
|
|
39
|
+
return Platform.OS === "android"
|
|
40
|
+
? { ...base, includeFontPadding: false as const }
|
|
41
|
+
: base;
|
|
42
|
+
}
|
|
28
43
|
|
|
29
44
|
export function Input({
|
|
30
45
|
size = "md",
|
|
@@ -44,7 +59,7 @@ export function Input({
|
|
|
44
59
|
const isControlInvalid = isInvalid ?? field?.isInvalid ?? false;
|
|
45
60
|
const isControlRequired = isRequired ?? field?.isRequired ?? false;
|
|
46
61
|
|
|
47
|
-
const verticalFix = isMultiline ? null :
|
|
62
|
+
const verticalFix = isMultiline ? null : singleLineVerticalFix(size);
|
|
48
63
|
|
|
49
64
|
const control = (
|
|
50
65
|
<TextInput
|