@scripso-homepad/ui 0.4.12 → 0.4.14

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/index.d.cts CHANGED
@@ -40,13 +40,15 @@ interface InputProps extends TextInputProps {
40
40
  /** Styles merged into the bordered field container. */
41
41
  fieldStyle?: StyleProp<ViewStyle>;
42
42
  labelClassName?: string;
43
+ /** Styles merged into the field label. */
44
+ labelStyles?: StyleProp<TextStyle>;
43
45
  inputClassName?: string;
44
46
  errorClassName?: string;
45
47
  hintClassName?: string;
46
48
  /** When `secureTextEntry` is set, show a toggleable eye icon. Pass `false` to disable. */
47
49
  showPasswordToggle?: boolean;
48
50
  }
49
- declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
51
+ declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, labelStyles, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
50
52
 
51
53
  type SelectOption = {
52
54
  value: string;
@@ -96,11 +98,13 @@ interface PhoneInputProps extends Omit<TextInputProps, "style"> {
96
98
  style?: StyleProp<TextStyle>;
97
99
  className?: string;
98
100
  labelClassName?: string;
101
+ /** Styles merged into the field label. */
102
+ labelStyles?: StyleProp<TextStyle>;
99
103
  inputClassName?: string;
100
104
  errorClassName?: string;
101
105
  hintClassName?: string;
102
106
  }
103
- declare function PhoneInput({ label, countryCode, onCountryCodeChange, error, hint, containerStyle, style, className, labelClassName, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: PhoneInputProps): react.JSX.Element;
107
+ declare function PhoneInput({ label, countryCode, onCountryCodeChange, error, hint, containerStyle, style, className, labelClassName, labelStyles, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: PhoneInputProps): react.JSX.Element;
104
108
 
105
109
  type Country = {
106
110
  code: string;
@@ -428,6 +432,37 @@ declare const fontSize: {
428
432
  readonly xl: 24;
429
433
  readonly xxl: 32;
430
434
  };
435
+ /**
436
+ * Canonical Homepad type scale (matches `.typography-*` in `src/web/styles/typography.css`).
437
+ * font-size / line-height pairs:
438
+ * 12/16 · 14/19 · 18/24 · 20/27 · 24/25 · 32/34
439
+ */
440
+ declare const typographyScale: {
441
+ readonly 12: {
442
+ readonly fontSize: 12;
443
+ readonly lineHeight: 16;
444
+ };
445
+ readonly 14: {
446
+ readonly fontSize: 14;
447
+ readonly lineHeight: 19;
448
+ };
449
+ readonly 18: {
450
+ readonly fontSize: 18;
451
+ readonly lineHeight: 24;
452
+ };
453
+ readonly 20: {
454
+ readonly fontSize: 20;
455
+ readonly lineHeight: 27;
456
+ };
457
+ readonly 24: {
458
+ readonly fontSize: 24;
459
+ readonly lineHeight: 25;
460
+ };
461
+ readonly 32: {
462
+ readonly fontSize: 32;
463
+ readonly lineHeight: 34;
464
+ };
465
+ };
431
466
  declare const fontWeight: {
432
467
  regular: "400";
433
468
  medium: "500";
@@ -437,12 +472,12 @@ declare const fontWeight: {
437
472
  declare const fonts: {
438
473
  readonly sans: "Noto Sans Armenian";
439
474
  };
440
- /** Input label typography — matches Figma (Medium, 100% line-height). */
475
+ /** Input label typography — Medium, typography-12 scale. */
441
476
  declare const labelTypography: {
442
477
  readonly fontFamily: "Noto Sans Armenian";
443
478
  readonly fontSize: 12;
444
479
  readonly fontWeight: "500";
445
- readonly lineHeight: 12;
480
+ readonly lineHeight: 16;
446
481
  readonly letterSpacing: 0;
447
482
  };
448
483
  /** Button label typography — SemiBold. */
@@ -485,4 +520,4 @@ declare const shadows: {
485
520
  };
486
521
  };
487
522
 
488
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, useCalendarLocale };
523
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
package/dist/index.d.ts CHANGED
@@ -40,13 +40,15 @@ interface InputProps extends TextInputProps {
40
40
  /** Styles merged into the bordered field container. */
41
41
  fieldStyle?: StyleProp<ViewStyle>;
42
42
  labelClassName?: string;
43
+ /** Styles merged into the field label. */
44
+ labelStyles?: StyleProp<TextStyle>;
43
45
  inputClassName?: string;
44
46
  errorClassName?: string;
45
47
  hintClassName?: string;
46
48
  /** When `secureTextEntry` is set, show a toggleable eye icon. Pass `false` to disable. */
47
49
  showPasswordToggle?: boolean;
48
50
  }
49
- declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
51
+ declare function Input({ label, leftIcon, rightIcon, error, invalid, hint, containerStyle, style, className, fieldClassName, fieldStyle, labelClassName, labelStyles, inputClassName, errorClassName, hintClassName, editable, secureTextEntry, showPasswordToggle, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
50
52
 
51
53
  type SelectOption = {
52
54
  value: string;
@@ -96,11 +98,13 @@ interface PhoneInputProps extends Omit<TextInputProps, "style"> {
96
98
  style?: StyleProp<TextStyle>;
97
99
  className?: string;
98
100
  labelClassName?: string;
101
+ /** Styles merged into the field label. */
102
+ labelStyles?: StyleProp<TextStyle>;
99
103
  inputClassName?: string;
100
104
  errorClassName?: string;
101
105
  hintClassName?: string;
102
106
  }
103
- declare function PhoneInput({ label, countryCode, onCountryCodeChange, error, hint, containerStyle, style, className, labelClassName, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: PhoneInputProps): react.JSX.Element;
107
+ declare function PhoneInput({ label, countryCode, onCountryCodeChange, error, hint, containerStyle, style, className, labelClassName, labelStyles, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: PhoneInputProps): react.JSX.Element;
104
108
 
105
109
  type Country = {
106
110
  code: string;
@@ -428,6 +432,37 @@ declare const fontSize: {
428
432
  readonly xl: 24;
429
433
  readonly xxl: 32;
430
434
  };
435
+ /**
436
+ * Canonical Homepad type scale (matches `.typography-*` in `src/web/styles/typography.css`).
437
+ * font-size / line-height pairs:
438
+ * 12/16 · 14/19 · 18/24 · 20/27 · 24/25 · 32/34
439
+ */
440
+ declare const typographyScale: {
441
+ readonly 12: {
442
+ readonly fontSize: 12;
443
+ readonly lineHeight: 16;
444
+ };
445
+ readonly 14: {
446
+ readonly fontSize: 14;
447
+ readonly lineHeight: 19;
448
+ };
449
+ readonly 18: {
450
+ readonly fontSize: 18;
451
+ readonly lineHeight: 24;
452
+ };
453
+ readonly 20: {
454
+ readonly fontSize: 20;
455
+ readonly lineHeight: 27;
456
+ };
457
+ readonly 24: {
458
+ readonly fontSize: 24;
459
+ readonly lineHeight: 25;
460
+ };
461
+ readonly 32: {
462
+ readonly fontSize: 32;
463
+ readonly lineHeight: 34;
464
+ };
465
+ };
431
466
  declare const fontWeight: {
432
467
  regular: "400";
433
468
  medium: "500";
@@ -437,12 +472,12 @@ declare const fontWeight: {
437
472
  declare const fonts: {
438
473
  readonly sans: "Noto Sans Armenian";
439
474
  };
440
- /** Input label typography — matches Figma (Medium, 100% line-height). */
475
+ /** Input label typography — Medium, typography-12 scale. */
441
476
  declare const labelTypography: {
442
477
  readonly fontFamily: "Noto Sans Armenian";
443
478
  readonly fontSize: 12;
444
479
  readonly fontWeight: "500";
445
- readonly lineHeight: 12;
480
+ readonly lineHeight: 16;
446
481
  readonly letterSpacing: 0;
447
482
  };
448
483
  /** Button label typography — SemiBold. */
@@ -485,4 +520,4 @@ declare const shadows: {
485
520
  };
486
521
  };
487
522
 
488
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, useCalendarLocale };
523
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, CalendarIcon, type CalendarLabels, type CalendarLocale, CalendarLocaleProvider, type CalendarLocaleProviderProps, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type CalendarTranslationKey$1 as CalendarTranslationKey, type CalendarTranslations, type Country, CountryCodeSelector, type CountryCodeSelectorProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, LockIcon, type MultipleSelectProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, Select, type SelectOption, type SelectProps, type SingleSelectProps, type StormGrayStep, brand, buttonTypography, calendarTranslations, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, formatLocalizedCalendarMonthYear, getCalendarMonthLabels, getCalendarTranslations, labelTypography, navy, radii, resolveCalendarLocale, resolveWeekdayLabels, rubyRed, shadows, spacing, stormGray, typographyScale, useCalendarLocale };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-YSDLHEJ7.js';
2
- export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray } from './chunk-YSDLHEJ7.js';
1
+ import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-ANDWP4YU.js';
2
+ export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray, typographyScale } from './chunk-ANDWP4YU.js';
3
3
  import { createContext, useRef, useState, useMemo, useEffect, useLayoutEffect, useContext, isValidElement, cloneElement } from 'react';
4
4
  import { Platform, StyleSheet, Animated, Easing, View, Pressable, Text, Modal, ScrollView, TextInput, Dimensions } from 'react-native';
5
5
  import Svg2, { Path } from 'react-native-svg';
@@ -757,12 +757,12 @@ var styles = StyleSheet.create({
757
757
  },
758
758
  error: {
759
759
  fontSize: 12,
760
- lineHeight: 12,
760
+ lineHeight: 16,
761
761
  color: colors.inputError
762
762
  },
763
763
  hint: {
764
764
  fontSize: 12,
765
- lineHeight: 12,
765
+ lineHeight: 16,
766
766
  color: colors.stormGray300
767
767
  }
768
768
  });
@@ -1032,11 +1032,12 @@ var styles2 = StyleSheet.create({
1032
1032
  },
1033
1033
  flag: {
1034
1034
  fontSize: 18,
1035
- lineHeight: 22
1035
+ lineHeight: 24
1036
1036
  },
1037
1037
  dialCode: {
1038
1038
  fontSize: fontSize.md,
1039
- fontWeight: fontWeight.medium
1039
+ fontWeight: fontWeight.medium,
1040
+ lineHeight: 19
1040
1041
  },
1041
1042
  overlay: {
1042
1043
  flex: 1,
@@ -1092,6 +1093,7 @@ function PhoneInput({
1092
1093
  style,
1093
1094
  className,
1094
1095
  labelClassName,
1096
+ labelStyles,
1095
1097
  inputClassName,
1096
1098
  errorClassName,
1097
1099
  hintClassName,
@@ -1124,7 +1126,15 @@ function PhoneInput({
1124
1126
  }
1125
1127
  const helperMessage = error ?? hint;
1126
1128
  return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles3.wrapper, containerStyle], children: [
1127
- label ? /* @__PURE__ */ jsx(Label, { disabled: isDisabled, className: labelClassName, children: label }) : null,
1129
+ label ? /* @__PURE__ */ jsx(
1130
+ Label,
1131
+ {
1132
+ disabled: isDisabled,
1133
+ className: labelClassName,
1134
+ style: labelStyles,
1135
+ children: label
1136
+ }
1137
+ ) : null,
1128
1138
  /* @__PURE__ */ jsxs(View, { style: styles3.row, children: [
1129
1139
  /* @__PURE__ */ jsx(
1130
1140
  CountryCodeSelector,
@@ -1135,38 +1145,36 @@ function PhoneInput({
1135
1145
  style: styles3.countrySelector
1136
1146
  }
1137
1147
  ),
1138
- /* @__PURE__ */ jsxs(View, { style: styles3.phoneColumn, children: [
1139
- /* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline, styles3.phoneOutline], children: /* @__PURE__ */ jsx(
1140
- View,
1141
- {
1142
- style: [
1143
- inputFieldMetrics.container,
1144
- phoneFieldStyles.container,
1145
- styles3.phoneField
1146
- ],
1147
- children: /* @__PURE__ */ jsx(
1148
- TextInput,
1149
- {
1150
- ref: inputRef,
1151
- style: [
1152
- inputFieldMetrics.input,
1153
- phoneFieldStyles.text,
1154
- style
1155
- ],
1156
- keyboardType: "phone-pad",
1157
- placeholderTextColor: phoneFieldStyles.placeholder,
1158
- editable,
1159
- onFocus: handleFocus,
1160
- onBlur: handleBlur,
1161
- accessibilityState: { disabled: isDisabled },
1162
- ...props
1163
- }
1164
- )
1165
- }
1166
- ) }),
1167
- helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles3.error : styles3.hint, children: helperMessage }) : null
1168
- ] })
1169
- ] })
1148
+ /* @__PURE__ */ jsx(View, { style: [phoneFieldStyles.outline, styles3.phoneOutline], children: /* @__PURE__ */ jsx(
1149
+ View,
1150
+ {
1151
+ style: [
1152
+ inputFieldMetrics.container,
1153
+ phoneFieldStyles.container,
1154
+ styles3.phoneField
1155
+ ],
1156
+ children: /* @__PURE__ */ jsx(
1157
+ TextInput,
1158
+ {
1159
+ ref: inputRef,
1160
+ style: [
1161
+ inputFieldMetrics.input,
1162
+ phoneFieldStyles.text,
1163
+ style
1164
+ ],
1165
+ keyboardType: "phone-pad",
1166
+ placeholderTextColor: error ? colors.inputError : phoneFieldStyles.placeholder,
1167
+ editable,
1168
+ onFocus: handleFocus,
1169
+ onBlur: handleBlur,
1170
+ accessibilityState: { disabled: isDisabled },
1171
+ ...props
1172
+ }
1173
+ )
1174
+ }
1175
+ ) })
1176
+ ] }),
1177
+ helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles3.error : styles3.hint, children: helperMessage }) : null
1170
1178
  ] });
1171
1179
  }
1172
1180
  var styles3 = StyleSheet.create({
@@ -1183,12 +1191,8 @@ var styles3 = StyleSheet.create({
1183
1191
  flexShrink: 0,
1184
1192
  alignSelf: "flex-start"
1185
1193
  },
1186
- phoneColumn: {
1187
- flex: 1,
1188
- gap: spacing.sm
1189
- },
1190
1194
  phoneOutline: {
1191
- width: "100%"
1195
+ flex: 1
1192
1196
  },
1193
1197
  phoneField: {
1194
1198
  flex: 1
@@ -1277,7 +1281,7 @@ var calendarLabelTypography = {
1277
1281
  fontFamily: fonts.sans,
1278
1282
  fontSize: fontSize.sm,
1279
1283
  fontWeight: fontWeight.medium,
1280
- lineHeight: fontSize.sm,
1284
+ lineHeight: 16,
1281
1285
  letterSpacing: 0,
1282
1286
  color: colors.slateBlue
1283
1287
  };
@@ -1285,7 +1289,7 @@ var calendarFieldTypography = {
1285
1289
  fontFamily: fonts.sans,
1286
1290
  fontSize: fontSize.md,
1287
1291
  fontWeight: fontWeight.regular,
1288
- lineHeight: fontSize.md,
1292
+ lineHeight: 19,
1289
1293
  letterSpacing: 0,
1290
1294
  textAlign: "left"
1291
1295
  };
@@ -1323,7 +1327,7 @@ var calendarDropdownMetrics = StyleSheet.create({
1323
1327
  fontFamily: fonts.sans,
1324
1328
  fontSize: fontSize.md,
1325
1329
  fontWeight: fontWeight.bold,
1326
- lineHeight: 18,
1330
+ lineHeight: 19,
1327
1331
  letterSpacing: 0,
1328
1332
  color: colors.stormGray850
1329
1333
  },
@@ -1364,7 +1368,7 @@ var calendarDropdownMetrics = StyleSheet.create({
1364
1368
  fontFamily: fonts.sans,
1365
1369
  fontSize: fontSize.sm,
1366
1370
  fontWeight: fontWeight.regular,
1367
- lineHeight: fontSize.sm,
1371
+ lineHeight: 16,
1368
1372
  letterSpacing: 0,
1369
1373
  textAlign: "center",
1370
1374
  color: colors.stormGray300,
@@ -1406,7 +1410,7 @@ var calendarDropdownMetrics = StyleSheet.create({
1406
1410
  fontFamily: fonts.sans,
1407
1411
  fontSize: fontSize.md,
1408
1412
  fontWeight: fontWeight.regular,
1409
- lineHeight: 18,
1413
+ lineHeight: 19,
1410
1414
  letterSpacing: 0,
1411
1415
  textAlign: "center",
1412
1416
  color: colors.navy,
@@ -1477,7 +1481,7 @@ var calendarDropdownMetrics = StyleSheet.create({
1477
1481
  fontFamily: fonts.sans,
1478
1482
  fontSize: fontSize.md,
1479
1483
  fontWeight: fontWeight.regular,
1480
- lineHeight: 18,
1484
+ lineHeight: 19,
1481
1485
  letterSpacing: 0,
1482
1486
  textAlign: "center",
1483
1487
  color: colors.navy,
@@ -2508,12 +2512,12 @@ var styles4 = StyleSheet.create({
2508
2512
  },
2509
2513
  error: {
2510
2514
  fontSize: 12,
2511
- lineHeight: 12,
2515
+ lineHeight: 16,
2512
2516
  color: colors.inputError
2513
2517
  },
2514
2518
  hint: {
2515
2519
  fontSize: 12,
2516
- lineHeight: 12,
2520
+ lineHeight: 16,
2517
2521
  color: colors.stormGray300
2518
2522
  }
2519
2523
  });