@lockin90/ui-native 2.3.0 → 2.4.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.
Files changed (52) hide show
  1. package/lib/commonjs/components/BackLink.js +2 -2
  2. package/lib/commonjs/components/BackLink.js.map +1 -1
  3. package/lib/commonjs/components/Button.js +6 -2
  4. package/lib/commonjs/components/Button.js.map +1 -1
  5. package/lib/commonjs/components/Chip.js +2 -3
  6. package/lib/commonjs/components/Chip.js.map +1 -1
  7. package/lib/commonjs/components/FollowButton.js +2 -2
  8. package/lib/commonjs/components/FollowButton.js.map +1 -1
  9. package/lib/commonjs/components/FormField.js +5 -3
  10. package/lib/commonjs/components/FormField.js.map +1 -1
  11. package/lib/commonjs/components/Input.js +9 -3
  12. package/lib/commonjs/components/Input.js.map +1 -1
  13. package/lib/commonjs/components/PasswordInput.js +11 -4
  14. package/lib/commonjs/components/PasswordInput.js.map +1 -1
  15. package/lib/commonjs/components/Select.js +6 -4
  16. package/lib/commonjs/components/Select.js.map +1 -1
  17. package/lib/commonjs/components/SplitButton.js +1 -1
  18. package/lib/commonjs/components/SplitButton.js.map +1 -1
  19. package/lib/commonjs/components/SsoButton.js +4 -3
  20. package/lib/commonjs/components/SsoButton.js.map +1 -1
  21. package/lib/module/components/BackLink.js +2 -2
  22. package/lib/module/components/BackLink.js.map +1 -1
  23. package/lib/module/components/Button.js +7 -2
  24. package/lib/module/components/Button.js.map +1 -1
  25. package/lib/module/components/Chip.js +2 -3
  26. package/lib/module/components/Chip.js.map +1 -1
  27. package/lib/module/components/FollowButton.js +2 -2
  28. package/lib/module/components/FollowButton.js.map +1 -1
  29. package/lib/module/components/FormField.js +5 -3
  30. package/lib/module/components/FormField.js.map +1 -1
  31. package/lib/module/components/Input.js +9 -3
  32. package/lib/module/components/Input.js.map +1 -1
  33. package/lib/module/components/PasswordInput.js +11 -4
  34. package/lib/module/components/PasswordInput.js.map +1 -1
  35. package/lib/module/components/Select.js +6 -4
  36. package/lib/module/components/Select.js.map +1 -1
  37. package/lib/module/components/SplitButton.js +1 -1
  38. package/lib/module/components/SplitButton.js.map +1 -1
  39. package/lib/module/components/SsoButton.js +4 -3
  40. package/lib/module/components/SsoButton.js.map +1 -1
  41. package/lib/typescript/components/Button.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/components/BackLink.tsx +2 -2
  44. package/src/components/Button.tsx +7 -4
  45. package/src/components/Chip.tsx +3 -3
  46. package/src/components/FollowButton.tsx +2 -2
  47. package/src/components/FormField.tsx +5 -3
  48. package/src/components/Input.tsx +9 -5
  49. package/src/components/PasswordInput.tsx +11 -5
  50. package/src/components/Select.tsx +6 -4
  51. package/src/components/SplitButton.tsx +1 -1
  52. package/src/components/SsoButton.tsx +3 -2
@@ -4,6 +4,9 @@ import { LinearGradient } from 'expo-linear-gradient';
4
4
  import { colors, radii, gradients, fonts, nativeShadows } from '@lockin90/tokens';
5
5
  import { hapticSelection } from '../internal/optionalHaptics';
6
6
 
7
+ // the web's body line height (1.55): the md button is 12 + 14 × 1.55 + 12 = 45.7, as on web
8
+ const LINE = 1.55;
9
+
7
10
  export type ButtonVariant = 'default' | 'primary' | 'ghost';
8
11
  export type ButtonTone = 'danger';
9
12
 
@@ -59,7 +62,7 @@ export function Button({ variant = 'default', tone, size = 'md', title, leading,
59
62
  style={[styles.base, pad, styles.primary, pressed && styles.pressed, style]}
60
63
  >
61
64
  {leading}
62
- <Text style={[styles.label, { fontSize: labelSize, color: '#0A0A12' }]}>{title}</Text>
65
+ <Text style={[styles.label, { fontSize: labelSize, lineHeight: labelSize * LINE, color: '#0A0A12' }]}>{title}</Text>
63
66
  {trailing}
64
67
  </LinearGradient>
65
68
  )}
@@ -90,7 +93,7 @@ export function Button({ variant = 'default', tone, size = 'md', title, leading,
90
93
  textColor = colors.bad;
91
94
  } else {
92
95
  backgroundColor = ghost ? 'transparent' : colors.glass2;
93
- borderColor = ghost ? colors.border : colors.border2;
96
+ borderColor = colors.border2;
94
97
  textColor = ghost ? colors.textDim : colors.text;
95
98
  }
96
99
 
@@ -108,7 +111,7 @@ export function Button({ variant = 'default', tone, size = 'md', title, leading,
108
111
  ]}
109
112
  >
110
113
  {leading}
111
- <Text style={[styles.label, { fontSize: labelSize, color: textColor }]}>{title}</Text>
114
+ <Text style={[styles.label, { fontSize: labelSize, lineHeight: labelSize * LINE, color: textColor }]}>{title}</Text>
112
115
  {trailing}
113
116
  </View>
114
117
  )}
@@ -117,7 +120,7 @@ export function Button({ variant = 'default', tone, size = 'md', title, leading,
117
120
  }
118
121
 
119
122
  const styles = StyleSheet.create({
120
- base: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 9, borderRadius: radii.pill },
123
+ base: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 9, borderRadius: radii.sm },
121
124
  padMd: { paddingVertical: 12, paddingHorizontal: 20 },
122
125
  padSm: { paddingVertical: 8, paddingHorizontal: 14 },
123
126
  primary: { ...nativeShadows.glowAccent },
@@ -18,7 +18,7 @@ export interface ChipProps extends ViewProps {
18
18
  }
19
19
 
20
20
  const TONE: Record<ChipTone, { color: string; border: string; bg: string }> = {
21
- default: { color: colors.textDim, border: colors.border, bg: colors.glass },
21
+ default: { color: colors.textDim, border: colors.border2, bg: colors.glass },
22
22
  neutral: { color: colors.textFaint, border: colors.border2, bg: colors.glass2 },
23
23
  high: { color: colors.zoneHigh, border: 'rgba(52,245,197,0.35)', bg: 'rgba(52,245,197,0.08)' },
24
24
  mid: { color: colors.zoneMid, border: 'rgba(255,176,32,0.35)', bg: 'rgba(255,176,32,0.08)' },
@@ -34,7 +34,7 @@ const TONE: Record<ChipTone, { color: string; border: string; bg: string }> = {
34
34
  * pill (high/mid/low read slightly stronger; neutral reads dim on glass-2).
35
35
  * The `accent` tone is handled specially (filled gradient). */
36
36
  const TONE_SM: Partial<Record<ChipTone, Partial<{ color: string; border: string; bg: string }>>> = {
37
- neutral: { color: colors.textDim, border: colors.border, bg: colors.glass2 },
37
+ neutral: { color: colors.textDim, bg: colors.glass2 },
38
38
  high: { bg: 'rgba(52,245,197,0.10)' },
39
39
  mid: { bg: 'rgba(255,176,32,0.10)' },
40
40
  low: { bg: 'rgba(255,77,109,0.10)' },
@@ -102,7 +102,7 @@ const styles = StyleSheet.create({
102
102
  gap: 7,
103
103
  paddingVertical: 5,
104
104
  paddingHorizontal: 11,
105
- borderRadius: radii.pill,
105
+ borderRadius: radii.sm,
106
106
  borderWidth: 1,
107
107
  alignSelf: 'flex-start',
108
108
  },
@@ -35,7 +35,7 @@ export function FollowButton({
35
35
  const labelSize = size === 'sm' ? 12 : 12.5;
36
36
 
37
37
  const tone = following
38
- ? { color: colors.textDim, border: colors.border, bg: colors.glass }
38
+ ? { color: colors.textDim, border: colors.border2, bg: colors.glass }
39
39
  : { color: '#cbbcff', border: 'rgba(124,92,255,0.45)', bg: 'rgba(124,92,255,0.10)' };
40
40
 
41
41
  return (
@@ -66,7 +66,7 @@ const styles = StyleSheet.create({
66
66
  flexDirection: 'row',
67
67
  alignItems: 'center',
68
68
  gap: 6,
69
- borderRadius: radii.pill,
69
+ borderRadius: radii.sm,
70
70
  borderWidth: 1,
71
71
  alignSelf: 'flex-start',
72
72
  },
@@ -169,12 +169,14 @@ const styles = StyleSheet.create({
169
169
  // FormField
170
170
  field: { gap: 6, minWidth: 0 },
171
171
  labelRow: { flexDirection: 'row', alignItems: 'baseline', justifyContent: 'space-between', gap: 10 },
172
+ // the label the web shows (11px / 500, text-dim, 0.12em, line height 1.55 = 17)
172
173
  fieldLabel: {
173
174
  fontFamily: fonts.mono,
174
- fontSize: 10,
175
+ fontSize: 11,
176
+ lineHeight: 17,
175
177
  fontWeight: '500',
176
- letterSpacing: 1.2,
177
- color: colors.textFaint,
178
+ letterSpacing: 1.32,
179
+ color: colors.textDim,
178
180
  },
179
181
  req: { color: colors.accent, fontSize: 11 },
180
182
  control: { minWidth: 0 },
@@ -70,28 +70,32 @@ export function Input({
70
70
 
71
71
  const styles = StyleSheet.create({
72
72
  wrap: { gap: 6, minWidth: 0 },
73
+ // the same caption as FormField's label (11px / 500, text-dim, line height 17), as the web shows
73
74
  label: {
74
75
  fontFamily: fonts.mono,
75
- fontSize: 10,
76
+ fontSize: 11,
77
+ lineHeight: 17,
76
78
  fontWeight: '500',
77
- letterSpacing: 1.2,
78
- color: colors.textFaint,
79
+ letterSpacing: 1.32,
80
+ color: colors.textDim,
79
81
  },
80
82
  field: {
81
83
  flexDirection: 'row',
82
84
  alignItems: 'center',
83
85
  gap: 8,
84
86
  minWidth: 0,
87
+ minHeight: 39.6,
85
88
  paddingVertical: 9,
86
89
  paddingHorizontal: 12,
87
90
  borderRadius: radii.sm,
88
91
  borderWidth: 1,
89
92
  backgroundColor: colors.glass2,
90
93
  },
91
- fieldSm: { paddingVertical: 6, paddingHorizontal: 10 },
94
+ // the web box: 9 + 14 × 1.4 + 9 + 2 borders = 39.6 (sm: 6 + 12.5 × 1.4 + 6 + 2 = 31.5)
95
+ fieldSm: { minHeight: 31.5, paddingVertical: 6, paddingHorizontal: 10 },
92
96
  // design `.strow .sv` — glass-2 fill (already the field default), border-2
93
97
  // (already default), 9px radius, roomier centered padding.
94
- fieldNumeral: { justifyContent: 'center', paddingVertical: 10, paddingHorizontal: 10, borderRadius: 9 },
98
+ fieldNumeral: { minHeight: 0, justifyContent: 'center', paddingVertical: 10, paddingHorizontal: 10, borderRadius: 9 },
95
99
  lead: { flexShrink: 0 },
96
100
  input: {
97
101
  flex: 1,
@@ -80,25 +80,29 @@ export function PasswordInput({
80
80
 
81
81
  const styles = StyleSheet.create({
82
82
  wrap: { gap: 6, minWidth: 0 },
83
+ // the same caption as FormField's label (11px / 500, text-dim, line height 17), as the web shows
83
84
  label: {
84
85
  fontFamily: fonts.mono,
85
- fontSize: 10,
86
+ fontSize: 11,
87
+ lineHeight: 17,
86
88
  fontWeight: '500',
87
- letterSpacing: 1.2,
88
- color: colors.textFaint,
89
+ letterSpacing: 1.32,
90
+ color: colors.textDim,
89
91
  },
90
92
  field: {
91
93
  flexDirection: 'row',
92
94
  alignItems: 'center',
93
95
  gap: 8,
94
96
  minWidth: 0,
97
+ minHeight: 39.6,
95
98
  paddingVertical: 9,
96
99
  paddingHorizontal: 12,
97
100
  borderRadius: radii.sm,
98
101
  borderWidth: 1,
99
102
  backgroundColor: colors.glass2,
100
103
  },
101
- fieldSm: { paddingVertical: 6, paddingHorizontal: 10 },
104
+ // the web box: 9 + 14 × 1.4 + 9 + 2 borders = 39.6 (sm: 6 + 12.5 × 1.4 + 6 + 2 = 31.5)
105
+ fieldSm: { minHeight: 31.5, paddingVertical: 6, paddingHorizontal: 10 },
102
106
  lead: { flexShrink: 0 },
103
107
  input: {
104
108
  flex: 1,
@@ -107,7 +111,9 @@ const styles = StyleSheet.create({
107
111
  color: colors.text,
108
112
  fontFamily: fonts.ui,
109
113
  fontSize: 14,
110
- lineHeight: 20,
114
+ // centred by the field's height, as Input (an explicit lineHeight biases the glyph)
115
+ textAlignVertical: 'center',
116
+ includeFontPadding: false,
111
117
  },
112
118
  inputSm: { fontSize: 12.5 },
113
119
  trail: { flexShrink: 0 },
@@ -248,12 +248,14 @@ const styles = StyleSheet.create({
248
248
  wrap: { flexDirection: 'column', gap: 6, alignSelf: 'stretch' },
249
249
  // sm hugs its content instead of stretching (design `.pref-select` pill)
250
250
  wrapSm: { alignSelf: 'auto' },
251
+ // the same caption as FormField's label (11px / 500, text-dim, line height 17), as the web shows
251
252
  label: {
252
- fontFamily: fonts.ui,
253
- fontSize: 10,
253
+ fontFamily: fonts.mono,
254
+ fontSize: 11,
255
+ lineHeight: 17,
254
256
  fontWeight: '500',
255
- letterSpacing: 1.2,
256
- color: colors.textFaint,
257
+ letterSpacing: 1.32,
258
+ color: colors.textDim,
257
259
  },
258
260
  field: {
259
261
  flexDirection: 'row',
@@ -87,7 +87,7 @@ const styles = StyleSheet.create({
87
87
  overflow: 'hidden',
88
88
  },
89
89
  groupPrimary: { ...nativeShadows.glowAccent },
90
- groupDefault: { borderWidth: 1, borderColor: colors.border },
90
+ groupDefault: { borderWidth: 1, borderColor: colors.border2 },
91
91
  main: {
92
92
  flexDirection: 'row',
93
93
  alignItems: 'center',
@@ -75,11 +75,10 @@ const styles = StyleSheet.create({
75
75
  borderRadius: radii.sm,
76
76
  backgroundColor: 'rgba(255,255,255,0.04)',
77
77
  borderWidth: 1,
78
- borderColor: 'rgba(255,255,255,0.10)',
78
+ borderColor: colors.border2,
79
79
  },
80
80
  pressed: {
81
81
  backgroundColor: 'rgba(255,255,255,0.06)',
82
- borderColor: 'rgba(255,255,255,0.16)',
83
82
  },
84
83
  disabled: { opacity: 0.5 },
85
84
  iconSlot: { width: 16, height: 16, alignItems: 'center', justifyContent: 'center' },
@@ -88,6 +87,8 @@ const styles = StyleSheet.create({
88
87
  fontFamily: fonts.ui,
89
88
  fontWeight: '600',
90
89
  fontSize: 12.5,
90
+ // the web's 1.55 line height: 10 + 19.4 + 10 + 2 borders = 41.4, as on web
91
+ lineHeight: 12.5 * 1.55,
91
92
  letterSpacing: 0.1,
92
93
  },
93
94
  });