@rehagro/ui 1.0.42 → 1.0.44
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.mts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +32 -1
- package/dist/native.d.ts +32 -1
- package/dist/native.js +32 -7
- package/dist/native.js.map +1 -1
- package/dist/native.mjs +32 -7
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
package/dist/native.d.mts
CHANGED
|
@@ -159,8 +159,9 @@ declare const IconButton: React__default.ForwardRefExoticComponent<Omit<Pressabl
|
|
|
159
159
|
} & React__default.RefAttributes<View>>;
|
|
160
160
|
|
|
161
161
|
type TextInputStatus = "default" | "error";
|
|
162
|
-
type TextInputSize = "sm" | "md" | "lg";
|
|
162
|
+
type TextInputSize = "sm" | "md" | "lg" | "xl";
|
|
163
163
|
type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
164
|
+
type TextInputBorderWidth = "sm" | "md" | "lg";
|
|
164
165
|
type TextInputProps = Omit<TextInputProps$1, "style"> & {
|
|
165
166
|
/** Label text displayed above the input */
|
|
166
167
|
label?: string;
|
|
@@ -182,6 +183,21 @@ type TextInputProps = Omit<TextInputProps$1, "style"> & {
|
|
|
182
183
|
wrapperStyle?: StyleProp<ViewStyle>;
|
|
183
184
|
/** Custom style for the input container */
|
|
184
185
|
style?: StyleProp<ViewStyle>;
|
|
186
|
+
/**
|
|
187
|
+
* Custom border color for the input container. When provided,
|
|
188
|
+
* overrides the resting border color from `status`/`focused`.
|
|
189
|
+
* Mirrors the web `TextInput#borderColor` prop. Useful for
|
|
190
|
+
* highlighting cells in tables or custom themed states.
|
|
191
|
+
*/
|
|
192
|
+
borderColor?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Border width token for the input container.
|
|
195
|
+
*
|
|
196
|
+
* - `sm`: default 1px border.
|
|
197
|
+
* - `md`: default 2px border.
|
|
198
|
+
* - `lg`: default 3px border.
|
|
199
|
+
*/
|
|
200
|
+
borderWidth?: TextInputBorderWidth;
|
|
185
201
|
};
|
|
186
202
|
declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInputProps$1, "style"> & {
|
|
187
203
|
/** Label text displayed above the input */
|
|
@@ -204,6 +220,21 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInput
|
|
|
204
220
|
wrapperStyle?: StyleProp<ViewStyle>;
|
|
205
221
|
/** Custom style for the input container */
|
|
206
222
|
style?: StyleProp<ViewStyle>;
|
|
223
|
+
/**
|
|
224
|
+
* Custom border color for the input container. When provided,
|
|
225
|
+
* overrides the resting border color from `status`/`focused`.
|
|
226
|
+
* Mirrors the web `TextInput#borderColor` prop. Useful for
|
|
227
|
+
* highlighting cells in tables or custom themed states.
|
|
228
|
+
*/
|
|
229
|
+
borderColor?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Border width token for the input container.
|
|
232
|
+
*
|
|
233
|
+
* - `sm`: default 1px border.
|
|
234
|
+
* - `md`: default 2px border.
|
|
235
|
+
* - `lg`: default 3px border.
|
|
236
|
+
*/
|
|
237
|
+
borderWidth?: TextInputBorderWidth;
|
|
207
238
|
} & React__default.RefAttributes<TextInput$1>>;
|
|
208
239
|
|
|
209
240
|
type CheckboxSize = "sm" | "md" | "lg";
|
package/dist/native.d.ts
CHANGED
|
@@ -159,8 +159,9 @@ declare const IconButton: React__default.ForwardRefExoticComponent<Omit<Pressabl
|
|
|
159
159
|
} & React__default.RefAttributes<View>>;
|
|
160
160
|
|
|
161
161
|
type TextInputStatus = "default" | "error";
|
|
162
|
-
type TextInputSize = "sm" | "md" | "lg";
|
|
162
|
+
type TextInputSize = "sm" | "md" | "lg" | "xl";
|
|
163
163
|
type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
164
|
+
type TextInputBorderWidth = "sm" | "md" | "lg";
|
|
164
165
|
type TextInputProps = Omit<TextInputProps$1, "style"> & {
|
|
165
166
|
/** Label text displayed above the input */
|
|
166
167
|
label?: string;
|
|
@@ -182,6 +183,21 @@ type TextInputProps = Omit<TextInputProps$1, "style"> & {
|
|
|
182
183
|
wrapperStyle?: StyleProp<ViewStyle>;
|
|
183
184
|
/** Custom style for the input container */
|
|
184
185
|
style?: StyleProp<ViewStyle>;
|
|
186
|
+
/**
|
|
187
|
+
* Custom border color for the input container. When provided,
|
|
188
|
+
* overrides the resting border color from `status`/`focused`.
|
|
189
|
+
* Mirrors the web `TextInput#borderColor` prop. Useful for
|
|
190
|
+
* highlighting cells in tables or custom themed states.
|
|
191
|
+
*/
|
|
192
|
+
borderColor?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Border width token for the input container.
|
|
195
|
+
*
|
|
196
|
+
* - `sm`: default 1px border.
|
|
197
|
+
* - `md`: default 2px border.
|
|
198
|
+
* - `lg`: default 3px border.
|
|
199
|
+
*/
|
|
200
|
+
borderWidth?: TextInputBorderWidth;
|
|
185
201
|
};
|
|
186
202
|
declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInputProps$1, "style"> & {
|
|
187
203
|
/** Label text displayed above the input */
|
|
@@ -204,6 +220,21 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInput
|
|
|
204
220
|
wrapperStyle?: StyleProp<ViewStyle>;
|
|
205
221
|
/** Custom style for the input container */
|
|
206
222
|
style?: StyleProp<ViewStyle>;
|
|
223
|
+
/**
|
|
224
|
+
* Custom border color for the input container. When provided,
|
|
225
|
+
* overrides the resting border color from `status`/`focused`.
|
|
226
|
+
* Mirrors the web `TextInput#borderColor` prop. Useful for
|
|
227
|
+
* highlighting cells in tables or custom themed states.
|
|
228
|
+
*/
|
|
229
|
+
borderColor?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Border width token for the input container.
|
|
232
|
+
*
|
|
233
|
+
* - `sm`: default 1px border.
|
|
234
|
+
* - `md`: default 2px border.
|
|
235
|
+
* - `lg`: default 3px border.
|
|
236
|
+
*/
|
|
237
|
+
borderWidth?: TextInputBorderWidth;
|
|
207
238
|
} & React__default.RefAttributes<TextInput$1>>;
|
|
208
239
|
|
|
209
240
|
type CheckboxSize = "sm" | "md" | "lg";
|
package/dist/native.js
CHANGED
|
@@ -326,6 +326,8 @@ var TextInput = react.forwardRef(function TextInput2({
|
|
|
326
326
|
editable = true,
|
|
327
327
|
wrapperStyle,
|
|
328
328
|
style,
|
|
329
|
+
borderColor,
|
|
330
|
+
borderWidth = "sm",
|
|
329
331
|
accessibilityLabel,
|
|
330
332
|
...rest
|
|
331
333
|
}, ref) {
|
|
@@ -335,17 +337,23 @@ var TextInput = react.forwardRef(function TextInput2({
|
|
|
335
337
|
const heightMap = {
|
|
336
338
|
sm: theme.inputHeightSm ?? 36,
|
|
337
339
|
md: theme.inputHeightMd ?? 44,
|
|
338
|
-
lg: theme.inputHeightLg ?? 52
|
|
340
|
+
lg: theme.inputHeightLg ?? 52,
|
|
341
|
+
// `xl` (44) sits between md/lg — same height as web. Native
|
|
342
|
+
// theme doesn't expose a token for it, so we fall back to a
|
|
343
|
+
// hard-coded value matching the CSS `--rh-input-height-xl`.
|
|
344
|
+
xl: 44
|
|
339
345
|
};
|
|
340
346
|
const paddingMap2 = {
|
|
341
347
|
sm: 12,
|
|
342
348
|
md: 14,
|
|
343
|
-
lg: 16
|
|
349
|
+
lg: 16,
|
|
350
|
+
xl: 14
|
|
344
351
|
};
|
|
345
352
|
const fontSizeMap = {
|
|
346
353
|
sm: 14,
|
|
347
354
|
md: 14,
|
|
348
|
-
lg: 16
|
|
355
|
+
lg: 16,
|
|
356
|
+
xl: 14
|
|
349
357
|
};
|
|
350
358
|
const radiusMap2 = {
|
|
351
359
|
none: 0,
|
|
@@ -357,14 +365,19 @@ var TextInput = react.forwardRef(function TextInput2({
|
|
|
357
365
|
xl: theme.radiusXl ?? 32,
|
|
358
366
|
full: 9999
|
|
359
367
|
};
|
|
368
|
+
const borderWidthMap = {
|
|
369
|
+
sm: theme.borderWidthSm ?? 1,
|
|
370
|
+
md: theme.borderWidthMd ?? 2,
|
|
371
|
+
lg: theme.borderWidthLg ?? 3
|
|
372
|
+
};
|
|
360
373
|
const hasError = status === "error" || !!helperText;
|
|
361
|
-
const
|
|
374
|
+
const effectiveBorderColor = hasError ? theme.danger : focused ? theme.primary : borderColor ?? theme.border;
|
|
362
375
|
const containerStyle = {
|
|
363
376
|
height: heightMap[size],
|
|
364
377
|
paddingHorizontal: paddingMap2[size],
|
|
365
378
|
borderRadius: radiusMap2[radius],
|
|
366
|
-
borderWidth:
|
|
367
|
-
borderColor,
|
|
379
|
+
borderWidth: borderWidthMap[borderWidth],
|
|
380
|
+
borderColor: effectiveBorderColor,
|
|
368
381
|
backgroundColor: isDisabled ? theme.background : theme.surface,
|
|
369
382
|
flexDirection: "row",
|
|
370
383
|
alignItems: "center",
|
|
@@ -375,7 +388,19 @@ var TextInput = react.forwardRef(function TextInput2({
|
|
|
375
388
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: 4 }, wrapperStyle], children: [
|
|
376
389
|
label && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flexDirection: "row", alignItems: "baseline", gap: 4 }, children: [
|
|
377
390
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: 14, fontWeight: "500", color: theme.text }, children: label }),
|
|
378
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
391
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
392
|
+
reactNative.Text,
|
|
393
|
+
{
|
|
394
|
+
style: {
|
|
395
|
+
fontSize: 14,
|
|
396
|
+
// Required-marker convention (matches web): a lone
|
|
397
|
+
// `*` is rendered in danger color; any other text
|
|
398
|
+
// stays muted.
|
|
399
|
+
color: subtitle.trim() === "*" ? theme.danger : theme.textMuted
|
|
400
|
+
},
|
|
401
|
+
children: subtitle
|
|
402
|
+
}
|
|
403
|
+
)
|
|
379
404
|
] }),
|
|
380
405
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [containerStyle, style], children: [
|
|
381
406
|
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityElementsHidden: true, children: leftIcon }),
|