@indra-inter/neobrutalism-components 0.1.0
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/README.md +1330 -0
- package/dist/module/assets/avatar-profile.png +0 -0
- package/dist/module/components/accordion/accordion.js +203 -0
- package/dist/module/components/accordion/accordion.js.map +1 -0
- package/dist/module/components/app-bar/app-bar.js +140 -0
- package/dist/module/components/app-bar/app-bar.js.map +1 -0
- package/dist/module/components/avatar/avatar.js +184 -0
- package/dist/module/components/avatar/avatar.js.map +1 -0
- package/dist/module/components/badge/badge.js +133 -0
- package/dist/module/components/badge/badge.js.map +1 -0
- package/dist/module/components/bottom-navigation/bottom-navigation.js +166 -0
- package/dist/module/components/bottom-navigation/bottom-navigation.js.map +1 -0
- package/dist/module/components/bottom-sheet/bottom-sheet.js +285 -0
- package/dist/module/components/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/module/components/button/button.js +253 -0
- package/dist/module/components/button/button.js.map +1 -0
- package/dist/module/components/calendar/calendar.js +458 -0
- package/dist/module/components/calendar/calendar.js.map +1 -0
- package/dist/module/components/call-item/call-item.js +128 -0
- package/dist/module/components/call-item/call-item.js.map +1 -0
- package/dist/module/components/card/card.js +189 -0
- package/dist/module/components/card/card.js.map +1 -0
- package/dist/module/components/chat-list-item/chat-list-item.js +212 -0
- package/dist/module/components/chat-list-item/chat-list-item.js.map +1 -0
- package/dist/module/components/checkbox/checkbox.js +141 -0
- package/dist/module/components/checkbox/checkbox.js.map +1 -0
- package/dist/module/components/dialog/dialog.js +342 -0
- package/dist/module/components/dialog/dialog.js.map +1 -0
- package/dist/module/components/divider/divider.js +41 -0
- package/dist/module/components/divider/divider.js.map +1 -0
- package/dist/module/components/dropdown/dropdown-menu.js +214 -0
- package/dist/module/components/dropdown/dropdown-menu.js.map +1 -0
- package/dist/module/components/dropdown/dropdown.js +616 -0
- package/dist/module/components/dropdown/dropdown.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/icon-button/icon-button.js +140 -0
- package/dist/module/components/icon-button/icon-button.js.map +1 -0
- package/dist/module/components/input/currency-input.js +60 -0
- package/dist/module/components/input/currency-input.js.map +1 -0
- package/dist/module/components/input/input.js +281 -0
- package/dist/module/components/input/input.js.map +1 -0
- package/dist/module/components/input/otp-input.js +196 -0
- package/dist/module/components/input/otp-input.js.map +1 -0
- package/dist/module/components/input/password-input.js +74 -0
- package/dist/module/components/input/password-input.js.map +1 -0
- package/dist/module/components/input/phone-input.js +68 -0
- package/dist/module/components/input/phone-input.js.map +1 -0
- package/dist/module/components/input/url-input.js +43 -0
- package/dist/module/components/input/url-input.js.map +1 -0
- package/dist/module/components/list-item/list-item.js +148 -0
- package/dist/module/components/list-item/list-item.js.map +1 -0
- package/dist/module/components/pin-code-field/pin-code-field.js +164 -0
- package/dist/module/components/pin-code-field/pin-code-field.js.map +1 -0
- package/dist/module/components/progress/progress.js +261 -0
- package/dist/module/components/progress/progress.js.map +1 -0
- package/dist/module/components/radio/radio.js +135 -0
- package/dist/module/components/radio/radio.js.map +1 -0
- package/dist/module/components/skeleton/skeleton.js +328 -0
- package/dist/module/components/skeleton/skeleton.js.map +1 -0
- package/dist/module/components/switch/switch.js +170 -0
- package/dist/module/components/switch/switch.js.map +1 -0
- package/dist/module/components/tabs/tabs.js +197 -0
- package/dist/module/components/tabs/tabs.js.map +1 -0
- package/dist/module/components/toast/toast-provider.js +117 -0
- package/dist/module/components/toast/toast-provider.js.map +1 -0
- package/dist/module/components/toast/toast.js +154 -0
- package/dist/module/components/toast/toast.js.map +1 -0
- package/dist/module/index.js +38 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/theme/design-tokens.generated.js +379 -0
- package/dist/module/theme/design-tokens.generated.js.map +1 -0
- package/dist/module/theme/theme-provider.js +20 -0
- package/dist/module/theme/theme-provider.js.map +1 -0
- package/dist/module/theme/theme.js +56 -0
- package/dist/module/theme/theme.js.map +1 -0
- package/dist/typescript/components/accordion/accordion.d.ts +40 -0
- package/dist/typescript/components/accordion/accordion.d.ts.map +1 -0
- package/dist/typescript/components/app-bar/app-bar.d.ts +34 -0
- package/dist/typescript/components/app-bar/app-bar.d.ts.map +1 -0
- package/dist/typescript/components/avatar/avatar.d.ts +17 -0
- package/dist/typescript/components/avatar/avatar.d.ts.map +1 -0
- package/dist/typescript/components/badge/badge.d.ts +20 -0
- package/dist/typescript/components/badge/badge.d.ts.map +1 -0
- package/dist/typescript/components/bottom-navigation/bottom-navigation.d.ts +28 -0
- package/dist/typescript/components/bottom-navigation/bottom-navigation.d.ts.map +1 -0
- package/dist/typescript/components/bottom-sheet/bottom-sheet.d.ts +38 -0
- package/dist/typescript/components/bottom-sheet/bottom-sheet.d.ts.map +1 -0
- package/dist/typescript/components/button/button.d.ts +21 -0
- package/dist/typescript/components/button/button.d.ts.map +1 -0
- package/dist/typescript/components/calendar/calendar.d.ts +41 -0
- package/dist/typescript/components/calendar/calendar.d.ts.map +1 -0
- package/dist/typescript/components/call-item/call-item.d.ts +21 -0
- package/dist/typescript/components/call-item/call-item.d.ts.map +1 -0
- package/dist/typescript/components/card/card.d.ts +37 -0
- package/dist/typescript/components/card/card.d.ts.map +1 -0
- package/dist/typescript/components/chat-list-item/chat-list-item.d.ts +37 -0
- package/dist/typescript/components/chat-list-item/chat-list-item.d.ts.map +1 -0
- package/dist/typescript/components/checkbox/checkbox.d.ts +15 -0
- package/dist/typescript/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/typescript/components/dialog/dialog.d.ts +34 -0
- package/dist/typescript/components/dialog/dialog.d.ts.map +1 -0
- package/dist/typescript/components/divider/divider.d.ts +10 -0
- package/dist/typescript/components/divider/divider.d.ts.map +1 -0
- package/dist/typescript/components/dropdown/dropdown-menu.d.ts +27 -0
- package/dist/typescript/components/dropdown/dropdown-menu.d.ts.map +1 -0
- package/dist/typescript/components/dropdown/dropdown.d.ts +4 -0
- package/dist/typescript/components/dropdown/dropdown.d.ts.map +1 -0
- package/dist/typescript/components/dropdown/types.d.ts +52 -0
- package/dist/typescript/components/dropdown/types.d.ts.map +1 -0
- package/dist/typescript/components/icon-button/icon-button.d.ts +20 -0
- package/dist/typescript/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/typescript/components/input/currency-input.d.ts +10 -0
- package/dist/typescript/components/input/currency-input.d.ts.map +1 -0
- package/dist/typescript/components/input/input.d.ts +32 -0
- package/dist/typescript/components/input/input.d.ts.map +1 -0
- package/dist/typescript/components/input/otp-input.d.ts +23 -0
- package/dist/typescript/components/input/otp-input.d.ts.map +1 -0
- package/dist/typescript/components/input/password-input.d.ts +14 -0
- package/dist/typescript/components/input/password-input.d.ts.map +1 -0
- package/dist/typescript/components/input/phone-input.d.ts +13 -0
- package/dist/typescript/components/input/phone-input.d.ts.map +1 -0
- package/dist/typescript/components/input/url-input.d.ts +10 -0
- package/dist/typescript/components/input/url-input.d.ts.map +1 -0
- package/dist/typescript/components/list-item/list-item.d.ts +30 -0
- package/dist/typescript/components/list-item/list-item.d.ts.map +1 -0
- package/dist/typescript/components/pin-code-field/pin-code-field.d.ts +25 -0
- package/dist/typescript/components/pin-code-field/pin-code-field.d.ts.map +1 -0
- package/dist/typescript/components/progress/progress.d.ts +18 -0
- package/dist/typescript/components/progress/progress.d.ts.map +1 -0
- package/dist/typescript/components/radio/radio.d.ts +12 -0
- package/dist/typescript/components/radio/radio.d.ts.map +1 -0
- package/dist/typescript/components/skeleton/skeleton.d.ts +16 -0
- package/dist/typescript/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/typescript/components/switch/switch.d.ts +12 -0
- package/dist/typescript/components/switch/switch.d.ts.map +1 -0
- package/dist/typescript/components/tabs/tabs.d.ts +37 -0
- package/dist/typescript/components/tabs/tabs.d.ts.map +1 -0
- package/dist/typescript/components/toast/toast-provider.d.ts +22 -0
- package/dist/typescript/components/toast/toast-provider.d.ts.map +1 -0
- package/dist/typescript/components/toast/toast.d.ts +15 -0
- package/dist/typescript/components/toast/toast.d.ts.map +1 -0
- package/dist/typescript/index.d.ts +36 -0
- package/dist/typescript/index.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/dist/typescript/theme/design-tokens.generated.d.ts +375 -0
- package/dist/typescript/theme/design-tokens.generated.d.ts.map +1 -0
- package/dist/typescript/theme/theme-provider.d.ts +8 -0
- package/dist/typescript/theme/theme-provider.d.ts.map +1 -0
- package/dist/typescript/theme/theme.d.ts +52 -0
- package/dist/typescript/theme/theme.d.ts.map +1 -0
- package/package.json +88 -0
- package/tokens.css +132 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
4
|
+
import { useTheme } from "../../theme/theme-provider.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function IconButton({
|
|
7
|
+
accessibilityLabel,
|
|
8
|
+
containerStyle,
|
|
9
|
+
disabled,
|
|
10
|
+
icon,
|
|
11
|
+
label,
|
|
12
|
+
labelStyle,
|
|
13
|
+
radius,
|
|
14
|
+
rounded = 'rounded',
|
|
15
|
+
shadow = true,
|
|
16
|
+
shadowColor,
|
|
17
|
+
size = 60,
|
|
18
|
+
style,
|
|
19
|
+
variant = 'default',
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const styles = createStyles(theme);
|
|
24
|
+
const isDisabled = disabled ?? false;
|
|
25
|
+
const resolvedRadius = radius ?? (rounded === 'sharp' ? 0 : theme.border.radius);
|
|
26
|
+
const resolvedShadowColor = shadowColor ?? theme.shadow.color;
|
|
27
|
+
const shouldShowShadow = shadow && variant !== 'ghost';
|
|
28
|
+
const usesAndroidHardShadow = Platform.OS === 'android' && shouldShowShadow;
|
|
29
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
30
|
+
style: [styles.container, containerStyle],
|
|
31
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
32
|
+
style: [styles.surfaceContainer, usesAndroidHardShadow && styles.androidShadowContainer],
|
|
33
|
+
children: [usesAndroidHardShadow ? /*#__PURE__*/_jsx(View, {
|
|
34
|
+
pointerEvents: "none",
|
|
35
|
+
style: [styles.androidHardShadow, {
|
|
36
|
+
backgroundColor: resolvedShadowColor,
|
|
37
|
+
borderRadius: resolvedRadius
|
|
38
|
+
}],
|
|
39
|
+
testID: "icon-button-hard-shadow"
|
|
40
|
+
}) : null, /*#__PURE__*/_jsx(Pressable, {
|
|
41
|
+
accessibilityLabel: accessibilityLabel,
|
|
42
|
+
accessibilityRole: "button",
|
|
43
|
+
accessibilityState: {
|
|
44
|
+
disabled: isDisabled
|
|
45
|
+
},
|
|
46
|
+
disabled: isDisabled,
|
|
47
|
+
style: ({
|
|
48
|
+
pressed
|
|
49
|
+
}) => [styles.surface, styles[variant], {
|
|
50
|
+
borderRadius: resolvedRadius,
|
|
51
|
+
height: size,
|
|
52
|
+
width: size
|
|
53
|
+
}, shouldShowShadow && !usesAndroidHardShadow && {
|
|
54
|
+
elevation: theme.shadow.offset,
|
|
55
|
+
marginBottom: theme.shadow.offset,
|
|
56
|
+
marginRight: theme.shadow.offset,
|
|
57
|
+
shadowColor: resolvedShadowColor,
|
|
58
|
+
shadowOffset: {
|
|
59
|
+
width: theme.shadow.offset,
|
|
60
|
+
height: theme.shadow.offset
|
|
61
|
+
},
|
|
62
|
+
shadowOpacity: 1,
|
|
63
|
+
shadowRadius: 0
|
|
64
|
+
}, pressed && !isDisabled && variant !== 'ghost' && styles.pressed, pressed && !isDisabled && variant === 'ghost' && styles.ghostPressed, isDisabled && styles.disabled, style],
|
|
65
|
+
...props,
|
|
66
|
+
children: icon
|
|
67
|
+
})]
|
|
68
|
+
}), label ? /*#__PURE__*/_jsx(Text, {
|
|
69
|
+
numberOfLines: 1,
|
|
70
|
+
style: [styles.label, variant === 'primary' && styles.primaryLabel, labelStyle],
|
|
71
|
+
children: label
|
|
72
|
+
}) : null]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function createStyles(theme) {
|
|
76
|
+
return StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
gap: theme.spacing.xs,
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
padding: 6
|
|
82
|
+
},
|
|
83
|
+
surfaceContainer: {
|
|
84
|
+
position: 'relative'
|
|
85
|
+
},
|
|
86
|
+
androidShadowContainer: {
|
|
87
|
+
paddingBottom: theme.shadow.offset,
|
|
88
|
+
paddingRight: theme.shadow.offset
|
|
89
|
+
},
|
|
90
|
+
androidHardShadow: {
|
|
91
|
+
bottom: 0,
|
|
92
|
+
left: theme.shadow.offset,
|
|
93
|
+
position: 'absolute',
|
|
94
|
+
right: 0,
|
|
95
|
+
top: theme.shadow.offset
|
|
96
|
+
},
|
|
97
|
+
surface: {
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
borderColor: theme.border.color,
|
|
100
|
+
borderWidth: theme.border.width,
|
|
101
|
+
justifyContent: 'center'
|
|
102
|
+
},
|
|
103
|
+
default: {
|
|
104
|
+
backgroundColor: theme.colors.surface
|
|
105
|
+
},
|
|
106
|
+
primary: {
|
|
107
|
+
backgroundColor: theme.colors.primary
|
|
108
|
+
},
|
|
109
|
+
destructive: {
|
|
110
|
+
backgroundColor: theme.colors.destructive
|
|
111
|
+
},
|
|
112
|
+
ghost: {
|
|
113
|
+
backgroundColor: 'transparent',
|
|
114
|
+
borderWidth: 0
|
|
115
|
+
},
|
|
116
|
+
pressed: {
|
|
117
|
+
transform: [{
|
|
118
|
+
translateX: theme.shadow.offset
|
|
119
|
+
}, {
|
|
120
|
+
translateY: theme.shadow.offset
|
|
121
|
+
}]
|
|
122
|
+
},
|
|
123
|
+
ghostPressed: {
|
|
124
|
+
opacity: 0.7
|
|
125
|
+
},
|
|
126
|
+
disabled: {
|
|
127
|
+
opacity: 0.6
|
|
128
|
+
},
|
|
129
|
+
label: {
|
|
130
|
+
color: theme.colors.foreground,
|
|
131
|
+
fontSize: theme.typography.sm,
|
|
132
|
+
lineHeight: 20,
|
|
133
|
+
textAlign: 'center'
|
|
134
|
+
},
|
|
135
|
+
primaryLabel: {
|
|
136
|
+
color: theme.colors.primary
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","Pressable","StyleSheet","Text","View","useTheme","jsx","_jsx","jsxs","_jsxs","IconButton","accessibilityLabel","containerStyle","disabled","icon","label","labelStyle","radius","rounded","shadow","shadowColor","size","style","variant","props","theme","styles","createStyles","isDisabled","resolvedRadius","border","resolvedShadowColor","color","shouldShowShadow","usesAndroidHardShadow","OS","container","children","surfaceContainer","androidShadowContainer","pointerEvents","androidHardShadow","backgroundColor","borderRadius","testID","accessibilityRole","accessibilityState","pressed","surface","height","width","elevation","offset","marginBottom","marginRight","shadowOffset","shadowOpacity","shadowRadius","ghostPressed","numberOfLines","primaryLabel","create","alignItems","gap","spacing","xs","justifyContent","padding","position","paddingBottom","paddingRight","bottom","left","right","top","borderColor","borderWidth","default","colors","primary","destructive","ghost","transform","translateX","translateY","opacity","foreground","fontSize","typography","sm","lineHeight","textAlign"],"sourceRoot":"../../../../src","sources":["components/icon-button/icon-button.tsx"],"mappings":";;AACA,SACEA,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,IAAI,QAKC,cAAc;AAGrB,SAASC,QAAQ,QAAQ,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAqBtD,OAAO,SAASC,UAAUA,CAAC;EACzBC,kBAAkB;EAClBC,cAAc;EACdC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,UAAU;EACVC,MAAM;EACNC,OAAO,GAAG,SAAS;EACnBC,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AK,CAACN,MAAM,CAACiC;MAAO,CAAC;IAEvC,CAAC;IACDM,YAAY,EAAE;MACZ2B,OAAO,EAAE;IACX,CAAC;IACDxE,QAAQ,EAAE;MACRwE,OAAO,EAAE;IACX,CAAC;IACDtE,KAAK,EAAE;MACLiB,KAAK,EAAEP,KAAK,CAACqD,MAAM,CAACQ,UAAU;MAC9BC,QAAQ,EAAE9D,KAAK,CAAC+D,UAAU,CAACC,EAAE;MAC7BC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;IACb,CAAC;IACD/B,YAAY,EAAE;MACZ5B,KAAK,EAAEP,KAAK,CAACqD,MAAM,CAACC;IACtB;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { StyleSheet, Text } from 'react-native';
|
|
5
|
+
import { useTheme } from "../../theme/theme-provider.js";
|
|
6
|
+
import { Input } from "./input.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export const CurrencyInput = /*#__PURE__*/forwardRef(function CurrencyInput({
|
|
9
|
+
currencyCode = 'USD',
|
|
10
|
+
keyboardType = 'decimal-pad',
|
|
11
|
+
placeholder = '0.00',
|
|
12
|
+
showCurrencyCode = true,
|
|
13
|
+
showSymbol = true,
|
|
14
|
+
style,
|
|
15
|
+
symbol = '$',
|
|
16
|
+
...props
|
|
17
|
+
}, ref) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const styles = createStyles(theme);
|
|
20
|
+
const leadingAddon = showSymbol ? /*#__PURE__*/_jsx(Text, {
|
|
21
|
+
style: styles.symbol,
|
|
22
|
+
children: symbol
|
|
23
|
+
}) : undefined;
|
|
24
|
+
const trailingAddon = showCurrencyCode ? /*#__PURE__*/_jsx(Text, {
|
|
25
|
+
style: styles.currencyCode,
|
|
26
|
+
children: currencyCode
|
|
27
|
+
}) : undefined;
|
|
28
|
+
return /*#__PURE__*/_jsx(Input, {
|
|
29
|
+
ref: ref,
|
|
30
|
+
...props,
|
|
31
|
+
keyboardType: keyboardType,
|
|
32
|
+
leadingAddon: leadingAddon,
|
|
33
|
+
leadingAddonStyle: styles.symbolAddon,
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
style: [styles.input, style],
|
|
36
|
+
trailingAddon: trailingAddon
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
function createStyles(theme) {
|
|
40
|
+
return StyleSheet.create({
|
|
41
|
+
currencyCode: {
|
|
42
|
+
color: theme.colors.foreground,
|
|
43
|
+
fontSize: theme.typography.sm,
|
|
44
|
+
lineHeight: 20
|
|
45
|
+
},
|
|
46
|
+
input: {
|
|
47
|
+
textAlign: 'right'
|
|
48
|
+
},
|
|
49
|
+
symbol: {
|
|
50
|
+
color: theme.colors.foreground,
|
|
51
|
+
fontSize: theme.typography.sm,
|
|
52
|
+
fontWeight: '700',
|
|
53
|
+
lineHeight: 20
|
|
54
|
+
},
|
|
55
|
+
symbolAddon: {
|
|
56
|
+
backgroundColor: theme.colors.success
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=currency-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","StyleSheet","Text","useTheme","Input","jsx","_jsx","CurrencyInput","currencyCode","keyboardType","placeholder","showCurrencyCode","showSymbol","style","symbol","props","ref","theme","styles","createStyles","leadingAddon","children","undefined","trailingAddon","leadingAddonStyle","symbolAddon","input","create","color","colors","foreground","fontSize","typography","sm","lineHeight","textAlign","fontWeight","backgroundColor","success"],"sourceRoot":"../../../../src","sources":["components/input/currency-input.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAE1D,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASC,KAAK,QAAyB,YAAS;AAA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,UAAU,EAAE;IACd,CAAC;IACDR,KAAK,EAAE;MACLS,SAAS,EAAE;IACb,CAAC;IACDrB,MAAM,EAAE;MACNc,KAAK,EAAEX,KAAK,CAACY,MAAM,CAACC,UAAU;MAC9BC,QAAQ,EAAEd,KAAK,CAACe,UAAU,CAACC,EAAE;MAC7BG,UAAU,EAAE,KAAK;MACjBF,UAAU,EAAE;IACd,CAAC;IACDT,WAAW,EAAE;MACXY,eAAe,EAAEpB,KAAK,CAACY,MAAM,CAACS;IAChC;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, useState } from 'react';
|
|
4
|
+
import { Platform, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
5
|
+
import { useTheme } from "../../theme/theme-provider.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export const Input = /*#__PURE__*/forwardRef(function Input({
|
|
8
|
+
changeShadowOnFocus = false,
|
|
9
|
+
containerStyle,
|
|
10
|
+
editable = true,
|
|
11
|
+
error,
|
|
12
|
+
fieldStyle,
|
|
13
|
+
helperText,
|
|
14
|
+
label,
|
|
15
|
+
leadingAddon,
|
|
16
|
+
leadingAddonStyle,
|
|
17
|
+
leadingIcon,
|
|
18
|
+
onBlur,
|
|
19
|
+
onChangeText,
|
|
20
|
+
onFocus,
|
|
21
|
+
placeholderTextColor,
|
|
22
|
+
readOnly = false,
|
|
23
|
+
style,
|
|
24
|
+
trailingAddon,
|
|
25
|
+
trailingAddonStyle,
|
|
26
|
+
trailingIcon,
|
|
27
|
+
value,
|
|
28
|
+
defaultValue,
|
|
29
|
+
variant = 'default',
|
|
30
|
+
...props
|
|
31
|
+
}, ref) {
|
|
32
|
+
const [focused, setFocused] = useState(false);
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const styles = createStyles(theme);
|
|
35
|
+
const isDisabled = editable === false && !readOnly;
|
|
36
|
+
const hasError = Boolean(error);
|
|
37
|
+
const hasLeadingAddon = leadingAddon !== undefined && leadingAddon !== null;
|
|
38
|
+
const hasTrailingAddon = trailingAddon !== undefined && trailingAddon !== null;
|
|
39
|
+
const usesDashedBorder = (variant === 'dashed' || isDisabled || readOnly) && !hasError;
|
|
40
|
+
const hasShadow = variant === 'default' && !isDisabled && !readOnly && !hasError;
|
|
41
|
+
// Android can clear native TextInput focus whenever this hard-shadow wrapper
|
|
42
|
+
// changes color. iOS only changes its native shadow for shadowed fields.
|
|
43
|
+
const hasPrimaryShadow = Platform.OS === 'ios' && changeShadowOnFocus && hasShadow && focused;
|
|
44
|
+
const hasFocusedBorder = focused && !hasError && !isDisabled && !readOnly;
|
|
45
|
+
const usesAndroidHardShadow = Platform.OS === 'android' && hasShadow;
|
|
46
|
+
const usesIOSNativeShadow = Platform.OS === 'ios' && hasShadow;
|
|
47
|
+
const isMultiline = props.multiline === true;
|
|
48
|
+
const inputPlatformStyle = isMultiline ? styles.multilineInput : Platform.OS === 'ios' ? styles.iosInput : styles.androidInput;
|
|
49
|
+
const helperCopy = error ?? helperText;
|
|
50
|
+
const fieldTestID = isDisabled ? 'input-disabled' : readOnly ? 'input-read-only' : hasFocusedBorder ? 'input-focused' : undefined;
|
|
51
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
52
|
+
style: [styles.root, containerStyle],
|
|
53
|
+
children: [label ? /*#__PURE__*/_jsxs(View, {
|
|
54
|
+
style: styles.labelRow,
|
|
55
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
56
|
+
style: [styles.label, isDisabled && styles.disabledCopy, hasError && styles.errorCopy],
|
|
57
|
+
children: label
|
|
58
|
+
}), hasError ? /*#__PURE__*/_jsx(Text, {
|
|
59
|
+
style: styles.errorAsterisk,
|
|
60
|
+
children: "*"
|
|
61
|
+
}) : null]
|
|
62
|
+
}) : null, /*#__PURE__*/_jsxs(View, {
|
|
63
|
+
style: usesAndroidHardShadow && styles.androidShadowContainer,
|
|
64
|
+
testID: usesAndroidHardShadow ? 'input-hard-shadow' : undefined,
|
|
65
|
+
children: [usesAndroidHardShadow ? /*#__PURE__*/_jsx(View, {
|
|
66
|
+
pointerEvents: "none",
|
|
67
|
+
style: styles.androidHardShadowLayer,
|
|
68
|
+
testID: "input-hard-shadow-layer"
|
|
69
|
+
}) : null, /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: [styles.field, hasLeadingAddon && styles.fieldWithLeadingAddon, hasTrailingAddon && styles.fieldWithTrailingAddon, isMultiline && styles.multilineField, isDisabled && styles.disabledField, usesDashedBorder && styles.dashedField, hasFocusedBorder && styles.focusedField, hasError && styles.errorField, usesIOSNativeShadow && styles.iosShadow, hasPrimaryShadow && styles.primaryIosShadow, fieldStyle],
|
|
71
|
+
testID: fieldTestID,
|
|
72
|
+
children: [hasLeadingAddon ? /*#__PURE__*/_jsx(View, {
|
|
73
|
+
style: [styles.leadingAddon, leadingAddonStyle],
|
|
74
|
+
children: leadingAddon
|
|
75
|
+
}) : null, leadingIcon ? /*#__PURE__*/_jsx(View, {
|
|
76
|
+
style: styles.iconSlot,
|
|
77
|
+
children: leadingIcon
|
|
78
|
+
}) : null, /*#__PURE__*/_jsx(TextInput, {
|
|
79
|
+
ref: ref,
|
|
80
|
+
...props,
|
|
81
|
+
editable: !isDisabled && !readOnly,
|
|
82
|
+
placeholderTextColor: placeholderTextColor ?? theme.colors.mutedForeground,
|
|
83
|
+
style: [styles.input, inputPlatformStyle, isDisabled && styles.disabledInput, isDisabled && styles.disabledCopy, style],
|
|
84
|
+
value: value,
|
|
85
|
+
defaultValue: defaultValue,
|
|
86
|
+
onBlur: event => {
|
|
87
|
+
setFocused(false);
|
|
88
|
+
onBlur?.(event);
|
|
89
|
+
},
|
|
90
|
+
onChangeText: text => {
|
|
91
|
+
onChangeText?.(text);
|
|
92
|
+
},
|
|
93
|
+
onFocus: event => {
|
|
94
|
+
setFocused(true);
|
|
95
|
+
onFocus?.(event);
|
|
96
|
+
}
|
|
97
|
+
}), hasTrailingAddon ? /*#__PURE__*/_jsx(View, {
|
|
98
|
+
style: [styles.trailingAddon, trailingAddonStyle],
|
|
99
|
+
children: trailingAddon
|
|
100
|
+
}) : null, trailingIcon ? /*#__PURE__*/_jsx(View, {
|
|
101
|
+
style: styles.iconSlot,
|
|
102
|
+
children: trailingIcon
|
|
103
|
+
}) : null]
|
|
104
|
+
})]
|
|
105
|
+
}), helperCopy ? /*#__PURE__*/_jsx(Text, {
|
|
106
|
+
style: [styles.helperText, isDisabled && styles.disabledCopy, hasError && styles.errorCopy],
|
|
107
|
+
children: helperCopy
|
|
108
|
+
}) : null]
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
export const TextArea = /*#__PURE__*/forwardRef(function TextArea({
|
|
112
|
+
fieldStyle,
|
|
113
|
+
height = 80,
|
|
114
|
+
numberOfLines = 3,
|
|
115
|
+
style,
|
|
116
|
+
...props
|
|
117
|
+
}, ref) {
|
|
118
|
+
return /*#__PURE__*/_jsx(Input, {
|
|
119
|
+
ref: ref,
|
|
120
|
+
...props,
|
|
121
|
+
fieldStyle: [{
|
|
122
|
+
height,
|
|
123
|
+
paddingHorizontal: 16,
|
|
124
|
+
paddingVertical: 12
|
|
125
|
+
}, fieldStyle],
|
|
126
|
+
multiline: true,
|
|
127
|
+
numberOfLines: numberOfLines,
|
|
128
|
+
style: style
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
function createStyles(theme) {
|
|
132
|
+
const innerBorderRadius = Math.max(0, theme.border.radius - theme.border.width);
|
|
133
|
+
return StyleSheet.create({
|
|
134
|
+
root: {
|
|
135
|
+
gap: 4,
|
|
136
|
+
width: '100%'
|
|
137
|
+
},
|
|
138
|
+
labelRow: {
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
gap: 4
|
|
141
|
+
},
|
|
142
|
+
label: {
|
|
143
|
+
color: theme.colors.foreground,
|
|
144
|
+
fontSize: theme.typography.sm,
|
|
145
|
+
fontWeight: '700',
|
|
146
|
+
lineHeight: 20
|
|
147
|
+
},
|
|
148
|
+
errorAsterisk: {
|
|
149
|
+
color: theme.colors.destructive,
|
|
150
|
+
fontSize: theme.typography.sm,
|
|
151
|
+
fontWeight: '800',
|
|
152
|
+
lineHeight: 20
|
|
153
|
+
},
|
|
154
|
+
androidShadowContainer: {
|
|
155
|
+
paddingBottom: theme.shadow.offset,
|
|
156
|
+
paddingRight: theme.shadow.offset,
|
|
157
|
+
position: 'relative'
|
|
158
|
+
},
|
|
159
|
+
androidHardShadowLayer: {
|
|
160
|
+
backgroundColor: theme.shadow.color,
|
|
161
|
+
borderRadius: theme.border.radius,
|
|
162
|
+
bottom: 0,
|
|
163
|
+
left: theme.shadow.offset,
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
right: 0,
|
|
166
|
+
top: theme.shadow.offset
|
|
167
|
+
},
|
|
168
|
+
field: {
|
|
169
|
+
alignItems: 'center',
|
|
170
|
+
backgroundColor: theme.colors.background,
|
|
171
|
+
borderColor: theme.border.color,
|
|
172
|
+
borderRadius: theme.border.radius,
|
|
173
|
+
borderWidth: theme.border.width,
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
gap: theme.spacing.sm,
|
|
176
|
+
height: 55,
|
|
177
|
+
paddingHorizontal: 18
|
|
178
|
+
},
|
|
179
|
+
fieldWithLeadingAddon: {
|
|
180
|
+
gap: 0,
|
|
181
|
+
paddingLeft: 0
|
|
182
|
+
},
|
|
183
|
+
fieldWithTrailingAddon: {
|
|
184
|
+
gap: 0,
|
|
185
|
+
paddingRight: 0
|
|
186
|
+
},
|
|
187
|
+
multilineField: {
|
|
188
|
+
alignItems: 'stretch'
|
|
189
|
+
},
|
|
190
|
+
input: {
|
|
191
|
+
backgroundColor: theme.colors.background,
|
|
192
|
+
color: theme.colors.foreground,
|
|
193
|
+
flex: 1,
|
|
194
|
+
fontSize: theme.typography.md,
|
|
195
|
+
minWidth: 0,
|
|
196
|
+
padding: 0
|
|
197
|
+
},
|
|
198
|
+
iosInput: {
|
|
199
|
+
alignSelf: 'stretch',
|
|
200
|
+
height: '100%',
|
|
201
|
+
paddingVertical: 0
|
|
202
|
+
},
|
|
203
|
+
androidInput: {
|
|
204
|
+
alignSelf: 'stretch',
|
|
205
|
+
includeFontPadding: false,
|
|
206
|
+
textAlignVertical: 'center'
|
|
207
|
+
},
|
|
208
|
+
multilineInput: {
|
|
209
|
+
alignSelf: 'stretch',
|
|
210
|
+
height: '100%',
|
|
211
|
+
includeFontPadding: false,
|
|
212
|
+
lineHeight: 24,
|
|
213
|
+
paddingVertical: 0,
|
|
214
|
+
textAlignVertical: 'top'
|
|
215
|
+
},
|
|
216
|
+
iconSlot: {
|
|
217
|
+
alignItems: 'center',
|
|
218
|
+
justifyContent: 'center'
|
|
219
|
+
},
|
|
220
|
+
leadingAddon: {
|
|
221
|
+
alignItems: 'center',
|
|
222
|
+
alignSelf: 'stretch',
|
|
223
|
+
backgroundColor: theme.colors.surface,
|
|
224
|
+
borderBottomLeftRadius: innerBorderRadius,
|
|
225
|
+
borderTopLeftRadius: innerBorderRadius,
|
|
226
|
+
justifyContent: 'center',
|
|
227
|
+
paddingHorizontal: 16
|
|
228
|
+
},
|
|
229
|
+
trailingAddon: {
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
alignSelf: 'stretch',
|
|
232
|
+
backgroundColor: theme.colors.surface,
|
|
233
|
+
borderBottomRightRadius: innerBorderRadius,
|
|
234
|
+
borderTopRightRadius: innerBorderRadius,
|
|
235
|
+
justifyContent: 'center',
|
|
236
|
+
paddingHorizontal: 16
|
|
237
|
+
},
|
|
238
|
+
iosShadow: {
|
|
239
|
+
shadowColor: theme.shadow.color,
|
|
240
|
+
shadowOffset: {
|
|
241
|
+
width: theme.shadow.offset,
|
|
242
|
+
height: theme.shadow.offset
|
|
243
|
+
},
|
|
244
|
+
shadowOpacity: 1,
|
|
245
|
+
shadowRadius: 0
|
|
246
|
+
},
|
|
247
|
+
primaryIosShadow: {
|
|
248
|
+
shadowColor: theme.colors.primary
|
|
249
|
+
},
|
|
250
|
+
errorField: {
|
|
251
|
+
borderColor: theme.colors.destructive
|
|
252
|
+
},
|
|
253
|
+
focusedField: {
|
|
254
|
+
borderColor: theme.colors.primary
|
|
255
|
+
},
|
|
256
|
+
dashedField: {
|
|
257
|
+
borderStyle: 'dashed'
|
|
258
|
+
},
|
|
259
|
+
disabledField: {
|
|
260
|
+
backgroundColor: theme.colors.disabled,
|
|
261
|
+
borderColor: theme.colors.mutedForeground,
|
|
262
|
+
borderStyle: 'dashed'
|
|
263
|
+
},
|
|
264
|
+
disabledInput: {
|
|
265
|
+
backgroundColor: theme.colors.disabled
|
|
266
|
+
},
|
|
267
|
+
helperText: {
|
|
268
|
+
color: theme.colors.mutedForeground,
|
|
269
|
+
fontSize: theme.typography.sm,
|
|
270
|
+
lineHeight: 20,
|
|
271
|
+
paddingTop: 4
|
|
272
|
+
},
|
|
273
|
+
errorCopy: {
|
|
274
|
+
color: theme.colors.destructive
|
|
275
|
+
},
|
|
276
|
+
disabledCopy: {
|
|
277
|
+
color: theme.colors.mutedForeground
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useState","Platform","StyleSheet","Text","TextInput","View","useTheme","jsx","_jsx","jsxs","_jsxs","Input","changeShadowOnFocus","containerStyle","editable","error","fieldStyle","helperText","label","leadingAddon","leadingAddonStyle","leadingIcon","onBlur","onChangeText","onFocus","placeholderTextColor","readOnly","style","trailingAddon","trailingAddonStyle","trailingIcon","value","defaultValue","variant","props","ref","focused","setFocused","theme","styles","createStyles","isDisabled","hasError","Boolean","hasLeadingAddon","undefined","hasTrailingAddon","usesDashedBorder","hasShadow","hasPrimaryShadow","OS","hasFocusedBorder","usesAndroidHardShadow","usesIOSNativeShadow","isMultiline","multiline","inputPlatformStyle","multilineInput","iosInput","androidInput","helperCopy","fieldTestID","root","children","labelRow","disabledCopy","errorCopy","errorAsterisk","androidShadowContainer","testID","pointerEvents","androidHardShadowLayer","field","fieldWithLeadingAddon","fieldWithTrailingAddon","multilineField","disabledField","dashedField","focusedField","errorField","iosShadow","primaryIosShadow","iconSlot","colors","mutedForeground","input","disabledInput","event","text","TextArea","height","numberOfLines","paddingHorizontal","paddingVertical","innerBorderRadius","Math","max","border","radius","width","create","gap","flexDirection","color","foreground","fontSize","typography","sm","fontWeight","lineHeight","destructive","paddingBottom","shadow","offset","paddingRight","position","backgroundColor","borderRadius","bottom","left","right","top","alignItems","background","borderColor","borderWidth","spacing","paddingLeft","flex","md","minWidth","padding","alignSelf","includeFontPadding","textAlignVertical","justifyContent","surface","borderBottomLeftRadius","borderTopLeftRadius","borderBottomRightRadius","borderTopRightRadius","shadowColor","shadowOffset","shadowOpacity","shadowRadius","primary","borderStyle","disabled","paddingTop"],"sourceRoot":"../../../../src","sources":["components/input/input.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,QAAQ,QAAwB,OAAO;AAC5D,SACEC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,IAAI,QAKC,cAAc;AAGrB,SAASC,QAAQ,QAAQ,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA0BtD,OAAO,MAAMC,KAAK,gBAAGZ,UAAU,CAAwB,SAASY,KAAKA,CACnE;EACEC,mBAAmB,GAAG,KAAK;EAC3BC,cAAc;EACdC,QAAQ,GAAG,IAAI;EACfC,KAAK;EACLC,UAAU;EACVC,UAAU;EACVC,KAAK;EACLC,YAAY;EACZC,iBAAiB;EACjBC,WAAW;EACXC,MAAM;EACNC,YAAY;EACZC,OAAO;EACPC,oBAAoB;EACpBC,QAAQ,GAAG,KAAK;EAChBC,KAAK;EACLC,aAAa;EACbC,kBAAkB;EAClBC,YAAY;EACZC,KAAK;EACLC,YAAY;EACZC,OAAO,GAAG,SAAS;E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