@retray-dev/ui-kit 3.0.0 → 3.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/COMPONENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- # @retray-dev/ui-kit — Component Reference (v3.0.0)
1
+ # @retray-dev/ui-kit — Component Reference (v3.1.0)
2
2
 
3
3
  This file is the AI reference for this package. It is shipped inside the npm package so consuming projects can import it into their `CLAUDE.md` with:
4
4
 
@@ -713,8 +713,8 @@ All sub-components (`CardHeader`, `CardTitle`, `CardDescription`, `CardContent`,
713
713
 
714
714
  | Prop | Type | Default | Notes |
715
715
  |------|------|---------|-------|
716
- | title | `string` | | Bold heading |
717
- | description | `string` | — | Detail text |
716
+ | title | `string` | required | Bold heading |
717
+ | description | `string` | — | Optional detail text below the title |
718
718
  | variant | `'default' \| 'destructive' \| 'success'` | `'default'` | Controls border/text color |
719
719
  | icon | `ReactNode` | — | Icon placed to the left of the text content. Defaults to a variant-appropriate symbol (`ℹ`, `⚠`, `✓`) |
720
720
  | iconName | `string` | — | Icon name from `@expo/vector-icons`. Takes precedence over `icon` (but still falls back to the variant default when neither is set) |
package/dist/index.d.mts CHANGED
@@ -150,8 +150,10 @@ interface InputProps extends TextInputProps {
150
150
  type?: 'text' | 'password';
151
151
  /** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
152
152
  containerStyle?: ViewStyle;
153
+ /** Style for the inner border wrapper (overrides padding, etc). */
154
+ inputWrapperStyle?: ViewStyle;
153
155
  }
154
- declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
156
+ declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, inputWrapperStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
155
157
 
156
158
  type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'successOutline' | 'destructiveOutline';
157
159
  type BadgeSize = 'sm' | 'md' | 'lg';
@@ -245,7 +247,7 @@ declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.
245
247
 
246
248
  type AlertBannerVariant = 'default' | 'destructive' | 'success';
247
249
  interface AlertBannerProps {
248
- title?: string;
250
+ title: string;
249
251
  description?: string;
250
252
  variant?: AlertBannerVariant;
251
253
  icon?: React.ReactNode;
@@ -501,12 +503,10 @@ interface CurrencyInputProps {
501
503
  hint?: string;
502
504
  placeholder?: string;
503
505
  editable?: boolean;
504
- /** Icon or element rendered at the left edge inside the input field. */
505
- prefixIcon?: React.ReactNode;
506
506
  containerStyle?: ViewStyle;
507
507
  style?: TextStyle;
508
508
  }
509
- declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, prefixIcon, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
509
+ declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
510
510
 
511
511
  interface CurrencyDisplayProps {
512
512
  value: number | string;
package/dist/index.d.ts CHANGED
@@ -150,8 +150,10 @@ interface InputProps extends TextInputProps {
150
150
  type?: 'text' | 'password';
151
151
  /** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
152
152
  containerStyle?: ViewStyle;
153
+ /** Style for the inner border wrapper (overrides padding, etc). */
154
+ inputWrapperStyle?: ViewStyle;
153
155
  }
154
- declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
156
+ declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, inputWrapperStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
155
157
 
156
158
  type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'successOutline' | 'destructiveOutline';
157
159
  type BadgeSize = 'sm' | 'md' | 'lg';
@@ -245,7 +247,7 @@ declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.
245
247
 
246
248
  type AlertBannerVariant = 'default' | 'destructive' | 'success';
247
249
  interface AlertBannerProps {
248
- title?: string;
250
+ title: string;
249
251
  description?: string;
250
252
  variant?: AlertBannerVariant;
251
253
  icon?: React.ReactNode;
@@ -501,12 +503,10 @@ interface CurrencyInputProps {
501
503
  hint?: string;
502
504
  placeholder?: string;
503
505
  editable?: boolean;
504
- /** Icon or element rendered at the left edge inside the input field. */
505
- prefixIcon?: React.ReactNode;
506
506
  containerStyle?: ViewStyle;
507
507
  style?: TextStyle;
508
508
  }
509
- declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, prefixIcon, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
509
+ declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
510
510
 
511
511
  interface CurrencyDisplayProps {
512
512
  value: number | string;
package/dist/index.js CHANGED
@@ -393,7 +393,7 @@ function Text2({ variant = "body", color, style, children, ...props }) {
393
393
  );
394
394
  }
395
395
  var webInputResetStyle = reactNative.Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
396
- function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = "text", containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
396
+ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = "text", containerStyle, inputWrapperStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
397
397
  const { colors } = useTheme();
398
398
  const [focused, setFocused] = React25.useState(false);
399
399
  const [showPassword, setShowPassword] = React25.useState(false);
@@ -409,7 +409,8 @@ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, p
409
409
  {
410
410
  borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
411
411
  backgroundColor: colors.background
412
- }
412
+ },
413
+ inputWrapperStyle
413
414
  ]
414
415
  },
415
416
  effectivePrefix ? typeof effectivePrefix === "string" ? /* @__PURE__ */ React25__default.default.createElement(reactNative.Text, { style: [styles3.prefixText, { color: colors.mutedForeground }, prefixStyle], allowFontScaling: true }, effectivePrefix) : /* @__PURE__ */ React25__default.default.createElement(reactNative.View, { style: styles3.prefixContainer }, effectivePrefix) : null,
@@ -2199,10 +2200,10 @@ function CurrencyInput({
2199
2200
  hint,
2200
2201
  placeholder,
2201
2202
  editable,
2202
- prefixIcon,
2203
2203
  containerStyle,
2204
2204
  style
2205
2205
  }) {
2206
+ const { colors } = useTheme();
2206
2207
  const handleChange = (text) => {
2207
2208
  const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
2208
2209
  const formatted = formatCurrency(withoutPrefix, thousandsSeparator);
@@ -2213,6 +2214,7 @@ function CurrencyInput({
2213
2214
  onChangeValue?.(isNaN(raw) ? 0 : raw);
2214
2215
  };
2215
2216
  const inputStyle = size === "large" ? { fontFamily: "Poppins-Regular", fontSize: ms(36) } : { fontFamily: "Poppins-Regular" };
2217
+ const dollarIcon = renderIcon("dollar-sign", size === "large" ? 24 : 16, colors.mutedForeground);
2216
2218
  const displayValue = value && prefix && value.startsWith(prefix) ? value.slice(prefix.length) : value;
2217
2219
  return /* @__PURE__ */ React25__default.default.createElement(
2218
2220
  Input,
@@ -2225,8 +2227,9 @@ function CurrencyInput({
2225
2227
  hint,
2226
2228
  placeholder: placeholder ?? "0",
2227
2229
  editable,
2228
- prefix: prefixIcon,
2230
+ prefix: dollarIcon,
2229
2231
  containerStyle,
2232
+ inputWrapperStyle: size === "large" ? { paddingVertical: 10 } : void 0,
2230
2233
  style: [inputStyle, style]
2231
2234
  }
2232
2235
  );
package/dist/index.mjs CHANGED
@@ -380,7 +380,7 @@ function Text2({ variant = "body", color, style, children, ...props }) {
380
380
  );
381
381
  }
382
382
  var webInputResetStyle = Platform.OS === "web" ? { outlineStyle: "none", outlineWidth: 0, outlineColor: "transparent", boxShadow: "none" } : {};
383
- function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = "text", containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
383
+ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = "text", containerStyle, inputWrapperStyle, style, onFocus, onBlur, secureTextEntry, ...props }) {
384
384
  const { colors } = useTheme();
385
385
  const [focused, setFocused] = useState(false);
386
386
  const [showPassword, setShowPassword] = useState(false);
@@ -396,7 +396,8 @@ function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, p
396
396
  {
397
397
  borderColor: error ? colors.destructive : focused ? colors.ring ?? colors.primary : colors.border,
398
398
  backgroundColor: colors.background
399
- }
399
+ },
400
+ inputWrapperStyle
400
401
  ]
401
402
  },
402
403
  effectivePrefix ? typeof effectivePrefix === "string" ? /* @__PURE__ */ React25.createElement(Text, { style: [styles3.prefixText, { color: colors.mutedForeground }, prefixStyle], allowFontScaling: true }, effectivePrefix) : /* @__PURE__ */ React25.createElement(View, { style: styles3.prefixContainer }, effectivePrefix) : null,
@@ -2186,10 +2187,10 @@ function CurrencyInput({
2186
2187
  hint,
2187
2188
  placeholder,
2188
2189
  editable,
2189
- prefixIcon,
2190
2190
  containerStyle,
2191
2191
  style
2192
2192
  }) {
2193
+ const { colors } = useTheme();
2193
2194
  const handleChange = (text) => {
2194
2195
  const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text;
2195
2196
  const formatted = formatCurrency(withoutPrefix, thousandsSeparator);
@@ -2200,6 +2201,7 @@ function CurrencyInput({
2200
2201
  onChangeValue?.(isNaN(raw) ? 0 : raw);
2201
2202
  };
2202
2203
  const inputStyle = size === "large" ? { fontFamily: "Poppins-Regular", fontSize: ms(36) } : { fontFamily: "Poppins-Regular" };
2204
+ const dollarIcon = renderIcon("dollar-sign", size === "large" ? 24 : 16, colors.mutedForeground);
2203
2205
  const displayValue = value && prefix && value.startsWith(prefix) ? value.slice(prefix.length) : value;
2204
2206
  return /* @__PURE__ */ React25.createElement(
2205
2207
  Input,
@@ -2212,8 +2214,9 @@ function CurrencyInput({
2212
2214
  hint,
2213
2215
  placeholder: placeholder ?? "0",
2214
2216
  editable,
2215
- prefix: prefixIcon,
2217
+ prefix: dollarIcon,
2216
2218
  containerStyle,
2219
+ inputWrapperStyle: size === "large" ? { paddingVertical: 10 } : void 0,
2217
2220
  style: [inputStyle, style]
2218
2221
  }
2219
2222
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retray-dev/ui-kit",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Personal UI Kit for React Native / Expo",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -8,7 +8,7 @@ import { renderIcon } from '../../utils/icons'
8
8
  export type AlertBannerVariant = 'default' | 'destructive' | 'success'
9
9
 
10
10
  export interface AlertBannerProps {
11
- title?: string
11
+ title: string
12
12
  description?: string
13
13
  variant?: AlertBannerVariant
14
14
  icon?: React.ReactNode
@@ -2,6 +2,8 @@ import React from 'react'
2
2
  import { ViewStyle, TextStyle } from 'react-native'
3
3
  import { Input } from '../Input'
4
4
  import { ms } from '../../utils/scaling'
5
+ import { renderIcon } from '../../utils/icons'
6
+ import { useTheme } from '../../theme'
5
7
 
6
8
  export interface CurrencyInputProps {
7
9
  value?: string
@@ -20,8 +22,6 @@ export interface CurrencyInputProps {
20
22
  hint?: string
21
23
  placeholder?: string
22
24
  editable?: boolean
23
- /** Icon or element rendered at the left edge inside the input field. */
24
- prefixIcon?: React.ReactNode
25
25
  containerStyle?: ViewStyle
26
26
  style?: TextStyle
27
27
  }
@@ -44,10 +44,10 @@ export function CurrencyInput({
44
44
  hint,
45
45
  placeholder,
46
46
  editable,
47
- prefixIcon,
48
47
  containerStyle,
49
48
  style,
50
49
  }: CurrencyInputProps) {
50
+ const { colors } = useTheme()
51
51
  const handleChange = (text: string) => {
52
52
  const withoutPrefix = prefix && text.startsWith(prefix) ? text.slice(prefix.length) : text
53
53
  const formatted = formatCurrency(withoutPrefix, thousandsSeparator)
@@ -60,6 +60,8 @@ export function CurrencyInput({
60
60
 
61
61
  const inputStyle: TextStyle = size === 'large' ? { fontFamily: 'Poppins-Regular', fontSize: ms(36) } : { fontFamily: 'Poppins-Regular' }
62
62
 
63
+ const dollarIcon = renderIcon('dollar-sign', size === 'large' ? 24 : 16, colors.mutedForeground)
64
+
63
65
  // Remove prefix from display value if present
64
66
  const displayValue = value && prefix && value.startsWith(prefix) ? value.slice(prefix.length) : value
65
67
 
@@ -73,8 +75,9 @@ export function CurrencyInput({
73
75
  hint={hint}
74
76
  placeholder={placeholder ?? '0'}
75
77
  editable={editable}
76
- prefix={prefixIcon}
78
+ prefix={dollarIcon}
77
79
  containerStyle={containerStyle}
80
+ inputWrapperStyle={size === 'large' ? { paddingVertical: 10 } : undefined}
78
81
  style={[inputStyle, style]}
79
82
  />
80
83
  )
@@ -42,9 +42,11 @@ export interface InputProps extends TextInputProps {
42
42
  type?: 'text' | 'password'
43
43
  /** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
44
44
  containerStyle?: ViewStyle
45
+ /** Style for the inner border wrapper (overrides padding, etc). */
46
+ inputWrapperStyle?: ViewStyle
45
47
  }
46
48
 
47
- export function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = 'text', containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps) {
49
+ export function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type = 'text', containerStyle, inputWrapperStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps) {
48
50
  const { colors } = useTheme()
49
51
  const [focused, setFocused] = useState(false)
50
52
  const [showPassword, setShowPassword] = useState(false)
@@ -79,6 +81,7 @@ export function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixS
79
81
  : colors.border,
80
82
  backgroundColor: colors.background,
81
83
  },
84
+ inputWrapperStyle,
82
85
  ]}
83
86
  >
84
87
  {effectivePrefix ? (