@scripso-homepad/ui 0.3.5 → 0.3.7

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.ts CHANGED
@@ -1,31 +1,335 @@
1
1
  import * as react from 'react';
2
- import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle } from 'react-native';
2
+ import { ReactNode } from 'react';
3
+ import { GestureResponderEvent, StyleProp, ViewStyle, TextStyle, TextInputProps, TextProps } from 'react-native';
3
4
 
4
- type ButtonVariant = "primary" | "secondary" | "outline" | "ghost";
5
- type ButtonSize = "small" | "medium" | "large";
5
+ type ButtonVariant = "white" | "primary" | "green" | "gray";
6
+ type ButtonSize = "lg" | "sm";
6
7
  interface ButtonProps {
7
- title: string;
8
+ title?: string;
9
+ children?: ReactNode;
8
10
  onPress: (event: GestureResponderEvent) => void;
9
11
  disabled?: boolean;
10
- /** Visual style preset. */
11
12
  variant?: ButtonVariant;
12
- /** Size preset. */
13
13
  size?: ButtonSize;
14
- /** Additional container styles (works on web and native). */
14
+ showIcon?: boolean;
15
+ /** Custom icon inside the badge. Defaults to `ArrowUpRightIcon` when `showIcon` is true. */
16
+ icon?: ReactNode;
15
17
  style?: StyleProp<ViewStyle>;
16
- /** Additional label styles (works on web and native). */
17
18
  textStyle?: StyleProp<TextStyle>;
18
- /**
19
- * CSS class names for the container (web: applied to the same DOM node as default styles).
20
- * On native: ignored unless using NativeWind with cssInterop.
21
- */
22
19
  className?: string;
23
- /**
24
- * CSS class names for the label (web).
25
- * On native: ignored unless using NativeWind with cssInterop.
26
- */
27
20
  textClassName?: string;
28
21
  }
29
- declare function Button({ title, onPress, disabled, variant, size, style, textStyle, className, textClassName, }: ButtonProps): react.JSX.Element;
22
+ declare function Button({ title, children, onPress, disabled, variant, size, showIcon, icon, style, textStyle, className, textClassName, }: ButtonProps): react.JSX.Element;
30
23
 
31
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant };
24
+ interface InputProps extends TextInputProps {
25
+ /** Optional field label rendered above the input. */
26
+ label?: string;
27
+ leftIcon?: ReactNode;
28
+ rightIcon?: ReactNode;
29
+ /** Validation or helper error message. Shown instead of `hint` when set. */
30
+ error?: string;
31
+ /** Helper text shown below the input when there is no error. */
32
+ hint?: string;
33
+ containerStyle?: StyleProp<ViewStyle>;
34
+ style?: StyleProp<TextStyle>;
35
+ className?: string;
36
+ labelClassName?: string;
37
+ inputClassName?: string;
38
+ errorClassName?: string;
39
+ hintClassName?: string;
40
+ }
41
+ declare function Input({ label, leftIcon, rightIcon, error, hint, containerStyle, style, className, labelClassName, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: InputProps): react.JSX.Element;
42
+
43
+ interface PhoneInputProps extends Omit<TextInputProps, "style"> {
44
+ label?: string;
45
+ countryCode?: string;
46
+ onCountryCodeChange?: (countryCode: string) => void;
47
+ error?: string;
48
+ hint?: string;
49
+ containerStyle?: StyleProp<ViewStyle>;
50
+ style?: StyleProp<TextStyle>;
51
+ className?: string;
52
+ labelClassName?: string;
53
+ inputClassName?: string;
54
+ errorClassName?: string;
55
+ hintClassName?: string;
56
+ }
57
+ declare function PhoneInput({ label, countryCode, onCountryCodeChange, error, hint, containerStyle, style, className, labelClassName, inputClassName, errorClassName, hintClassName, editable, onFocus, onBlur, ...props }: PhoneInputProps): react.JSX.Element;
58
+
59
+ type Country = {
60
+ code: string;
61
+ name: string;
62
+ dialCode: string;
63
+ };
64
+ declare const defaultCountry: Country;
65
+ declare const countries: Country[];
66
+ declare function findCountry(code: string): Country;
67
+
68
+ interface CountryCodeSelectorProps {
69
+ value?: string;
70
+ onValueChange?: (countryCode: string) => void;
71
+ /** Country list (defaults to built-in list). */
72
+ options?: Country[];
73
+ disabled?: boolean;
74
+ style?: StyleProp<ViewStyle>;
75
+ className?: string;
76
+ }
77
+ declare function CountryCodeSelector({ value, onValueChange, options, disabled, style, className, }: CountryCodeSelectorProps): react.JSX.Element;
78
+
79
+ interface LabelProps extends TextProps {
80
+ children: ReactNode;
81
+ /** Render as a required field indicator. */
82
+ required?: boolean;
83
+ disabled?: boolean;
84
+ style?: StyleProp<TextStyle>;
85
+ className?: string;
86
+ }
87
+ declare function Label({ children, required, disabled, style, className, ...props }: LabelProps): react.JSX.Element;
88
+
89
+ /**
90
+ * HomePad design tokens — aligned with the Figma design system
91
+ * (navy / storm gray / slate-blue palette from HomePad brand).
92
+ */
93
+ /** Storm Gray scale — Figma steps 0 → 8.5 */
94
+ declare const stormGray: {
95
+ readonly "0": "#fbfcfc";
96
+ readonly "0.5": "#eceef0";
97
+ readonly "1": "#dadde0";
98
+ readonly "1.5": "#c7cdd1";
99
+ readonly "2": "#b5bcc1";
100
+ readonly "3": "#8f9aa3";
101
+ readonly "4": "#6a7984";
102
+ readonly "5": "#455765";
103
+ readonly "6": "#374651";
104
+ readonly "7": "#29343d";
105
+ readonly "8": "#1c2328";
106
+ readonly "8.5": "#151a1e";
107
+ };
108
+ type StormGrayStep = keyof typeof stormGray;
109
+ /** Navy scale — Figma steps 0 → 8.5 */
110
+ declare const navy: {
111
+ readonly "0": "#f8f9fb";
112
+ readonly "0.5": "#e5e9ef";
113
+ readonly "1": "#cdd3df";
114
+ readonly "1.5": "#b4bece";
115
+ readonly "2": "#9ca8be";
116
+ readonly "3": "#6a7d9e";
117
+ readonly "4": "#39527d";
118
+ readonly "5": "#08275d";
119
+ readonly "6": "#061f4a";
120
+ readonly "7": "#051738";
121
+ readonly "8": "#031025";
122
+ readonly "8.5": "#020c1c";
123
+ };
124
+ type NavyStep = keyof typeof navy;
125
+ /** Ruby Red scale — Figma steps 0 → 8.5 */
126
+ declare const rubyRed: {
127
+ readonly "0": "#fff5f6";
128
+ readonly "0.5": "#f7dddf";
129
+ readonly "1": "#efc4c8";
130
+ readonly "1.5": "#e7acb1";
131
+ readonly "2": "#df939a";
132
+ readonly "3": "#ce626d";
133
+ readonly "4": "#be313f";
134
+ readonly "5": "#ae0011";
135
+ readonly "6": "#8b000e";
136
+ readonly "7": "#68000a";
137
+ readonly "8": "#460007";
138
+ readonly "8.5": "#340005";
139
+ };
140
+ type RubyRedStep = keyof typeof rubyRed;
141
+ /** Emerald Green scale — Figma steps 0 → 8.5 */
142
+ declare const emeraldGreen: {
143
+ readonly "0": "#f0fbf5";
144
+ readonly "0.5": "#dcf2e5";
145
+ readonly "1": "#c8e8d5";
146
+ readonly "1.5": "#b4dfc5";
147
+ readonly "2": "#a0d5b5";
148
+ readonly "3": "#77c394";
149
+ readonly "4": "#4fb074";
150
+ readonly "5": "#279d54";
151
+ readonly "6": "#1f7e43";
152
+ readonly "7": "#175e32";
153
+ readonly "8": "#103f22";
154
+ readonly "8.5": "#0c2f19";
155
+ };
156
+ type EmeraldGreenStep = keyof typeof emeraldGreen;
157
+ /** Figma brand palette — primary swatch per color family */
158
+ declare const brand: {
159
+ readonly slateBlue: "#182e3c";
160
+ readonly stormGray: "#455765";
161
+ readonly navy: "#08275d";
162
+ readonly rubyRed: "#ae0011";
163
+ readonly emeraldGreen: "#279d54";
164
+ };
165
+ declare const colors: {
166
+ readonly slateBlue: "#182e3c";
167
+ readonly emeraldGreen0: "#f0fbf5";
168
+ readonly emeraldGreen50: "#dcf2e5";
169
+ readonly emeraldGreen100: "#c8e8d5";
170
+ readonly emeraldGreen150: "#b4dfc5";
171
+ readonly emeraldGreen200: "#a0d5b5";
172
+ readonly emeraldGreen300: "#77c394";
173
+ readonly emeraldGreen400: "#4fb074";
174
+ readonly emeraldGreen500: "#279d54";
175
+ readonly emeraldGreen600: "#1f7e43";
176
+ readonly emeraldGreen700: "#175e32";
177
+ readonly emeraldGreen800: "#103f22";
178
+ readonly emeraldGreen850: "#0c2f19";
179
+ /** Primary brand emerald green — Figma Emerald Green 5 */
180
+ readonly emeraldGreen: "#279d54";
181
+ readonly rubyRed0: "#fff5f6";
182
+ readonly rubyRed50: "#f7dddf";
183
+ readonly rubyRed100: "#efc4c8";
184
+ readonly rubyRed150: "#e7acb1";
185
+ readonly rubyRed200: "#df939a";
186
+ readonly rubyRed300: "#ce626d";
187
+ readonly rubyRed400: "#be313f";
188
+ readonly rubyRed500: "#ae0011";
189
+ readonly rubyRed600: "#8b000e";
190
+ readonly rubyRed700: "#68000a";
191
+ readonly rubyRed800: "#460007";
192
+ readonly rubyRed850: "#340005";
193
+ /** Primary brand ruby red — Figma Ruby Red 5 */
194
+ readonly rubyRed: "#ae0011";
195
+ readonly navy0: "#f8f9fb";
196
+ readonly navy50: "#e5e9ef";
197
+ readonly navy100: "#cdd3df";
198
+ readonly navy150: "#b4bece";
199
+ readonly navy200: "#9ca8be";
200
+ readonly navy300: "#6a7d9e";
201
+ readonly navy400: "#39527d";
202
+ readonly navy500: "#08275d";
203
+ readonly navy600: "#061f4a";
204
+ readonly navy700: "#051738";
205
+ readonly navy800: "#031025";
206
+ readonly navy850: "#020c1c";
207
+ /** Primary brand navy — Figma Navy 5 */
208
+ readonly navy: "#08275d";
209
+ readonly stormGray0: "#fbfcfc";
210
+ readonly stormGray50: "#eceef0";
211
+ readonly stormGray100: "#dadde0";
212
+ readonly stormGray150: "#c7cdd1";
213
+ readonly stormGray200: "#b5bcc1";
214
+ readonly stormGray300: "#8f9aa3";
215
+ readonly stormGray400: "#6a7984";
216
+ readonly stormGray500: "#455765";
217
+ /** Figma brand swatch "Storm Gray" — same as `stormGray500` */
218
+ readonly stormGrayBrand: "#455765";
219
+ readonly stormGray600: "#374651";
220
+ readonly stormGray700: "#29343d";
221
+ readonly stormGray800: "#1c2328";
222
+ readonly stormGray850: "#151a1e";
223
+ /** @deprecated Use `stormGray0` */
224
+ readonly storm0: "#fbfcfc";
225
+ /** @deprecated Use `stormGray50` */
226
+ readonly storm50: "#eceef0";
227
+ /** @deprecated Use `stormGray200` */
228
+ readonly storm200: "#b5bcc1";
229
+ /** @deprecated Use `stormGray300` */
230
+ readonly storm300: "#8f9aa3";
231
+ /** @deprecated Use `stormGray500` */
232
+ readonly storm500: "#455765";
233
+ /** @deprecated Use `stormGray700` */
234
+ readonly storm700: "#29343d";
235
+ /** @deprecated Use `stormGray850` */
236
+ readonly storm900: "#151a1e";
237
+ readonly countrySelectorSelectedBg: "#eceef099";
238
+ readonly white: "#ffffff";
239
+ readonly error: "#dc2626";
240
+ readonly errorDark: "#b3261e";
241
+ readonly errorLight: "#fee2e2";
242
+ /** @deprecated Use `rubyRed` */
243
+ readonly inputError: "#ae0011";
244
+ readonly inputOutlineFocus: "#e5e9ef";
245
+ readonly inputOutlineError: "#f7dddf";
246
+ readonly warning: "#92400e";
247
+ readonly warningBg: "#fef3c7";
248
+ readonly success: "#28a745";
249
+ readonly successMuted: "#9fd4a8";
250
+ /** @deprecated Use `emeraldGreen` */
251
+ readonly green: "#279d54";
252
+ readonly transparent: "transparent";
253
+ };
254
+ declare const radii: {
255
+ readonly sm: 8;
256
+ readonly md: 12;
257
+ readonly lg: 16;
258
+ readonly xl: 20;
259
+ readonly full: 9999;
260
+ };
261
+ declare const spacing: {
262
+ readonly xs: 4;
263
+ readonly sm: 8;
264
+ readonly md: 12;
265
+ readonly lg: 16;
266
+ readonly xl: 24;
267
+ readonly xxl: 32;
268
+ };
269
+ declare const fontSize: {
270
+ readonly xs: 11;
271
+ readonly sm: 12;
272
+ readonly md: 14;
273
+ readonly base: 16;
274
+ readonly lg: 18;
275
+ readonly xl: 24;
276
+ readonly xxl: 32;
277
+ };
278
+ declare const fontWeight: {
279
+ regular: "400";
280
+ medium: "500";
281
+ semibold: "600";
282
+ bold: "700";
283
+ };
284
+ declare const fonts: {
285
+ readonly sans: "Noto Sans Armenian";
286
+ };
287
+ /** Input label typography — matches Figma (Medium, 100% line-height). */
288
+ declare const labelTypography: {
289
+ readonly fontFamily: "Noto Sans Armenian";
290
+ readonly fontSize: 12;
291
+ readonly fontWeight: "500";
292
+ readonly lineHeight: 12;
293
+ readonly letterSpacing: 0;
294
+ };
295
+ /** Button label typography — matches Figma (SemiBold, 100% line-height). */
296
+ declare const buttonTypography: {
297
+ readonly lg: {
298
+ readonly fontFamily: "Noto Sans Armenian";
299
+ readonly fontSize: 14;
300
+ readonly fontWeight: "600";
301
+ readonly lineHeight: 14;
302
+ readonly letterSpacing: 0;
303
+ };
304
+ readonly sm: {
305
+ readonly fontFamily: "Noto Sans Armenian";
306
+ readonly fontSize: 12;
307
+ readonly fontWeight: "600";
308
+ readonly lineHeight: 12;
309
+ readonly letterSpacing: 0;
310
+ };
311
+ };
312
+ declare const shadows: {
313
+ readonly card: {
314
+ readonly shadowColor: "#08275d";
315
+ readonly shadowOffset: {
316
+ readonly width: 0;
317
+ readonly height: 4;
318
+ };
319
+ readonly shadowOpacity: 0.05;
320
+ readonly shadowRadius: 20;
321
+ readonly elevation: 2;
322
+ };
323
+ readonly cardLg: {
324
+ readonly shadowColor: "#08275d";
325
+ readonly shadowOffset: {
326
+ readonly width: 0;
327
+ readonly height: 4;
328
+ };
329
+ readonly shadowOpacity: 0.1;
330
+ readonly shadowRadius: 20;
331
+ readonly elevation: 4;
332
+ };
333
+ };
334
+
335
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type Country, CountryCodeSelector, type CountryCodeSelectorProps, type EmeraldGreenStep, Input, type InputProps, Label, type LabelProps, type NavyStep, PhoneInput, type PhoneInputProps, type RubyRedStep, type StormGrayStep, brand, buttonTypography, colors, countries, defaultCountry, emeraldGreen, findCountry, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray };