@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.mjs
CHANGED
|
@@ -324,6 +324,8 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
324
324
|
editable = true,
|
|
325
325
|
wrapperStyle,
|
|
326
326
|
style,
|
|
327
|
+
borderColor,
|
|
328
|
+
borderWidth = "sm",
|
|
327
329
|
accessibilityLabel,
|
|
328
330
|
...rest
|
|
329
331
|
}, ref) {
|
|
@@ -333,17 +335,23 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
333
335
|
const heightMap = {
|
|
334
336
|
sm: theme.inputHeightSm ?? 36,
|
|
335
337
|
md: theme.inputHeightMd ?? 44,
|
|
336
|
-
lg: theme.inputHeightLg ?? 52
|
|
338
|
+
lg: theme.inputHeightLg ?? 52,
|
|
339
|
+
// `xl` (44) sits between md/lg — same height as web. Native
|
|
340
|
+
// theme doesn't expose a token for it, so we fall back to a
|
|
341
|
+
// hard-coded value matching the CSS `--rh-input-height-xl`.
|
|
342
|
+
xl: 44
|
|
337
343
|
};
|
|
338
344
|
const paddingMap2 = {
|
|
339
345
|
sm: 12,
|
|
340
346
|
md: 14,
|
|
341
|
-
lg: 16
|
|
347
|
+
lg: 16,
|
|
348
|
+
xl: 14
|
|
342
349
|
};
|
|
343
350
|
const fontSizeMap = {
|
|
344
351
|
sm: 14,
|
|
345
352
|
md: 14,
|
|
346
|
-
lg: 16
|
|
353
|
+
lg: 16,
|
|
354
|
+
xl: 14
|
|
347
355
|
};
|
|
348
356
|
const radiusMap2 = {
|
|
349
357
|
none: 0,
|
|
@@ -355,14 +363,19 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
355
363
|
xl: theme.radiusXl ?? 32,
|
|
356
364
|
full: 9999
|
|
357
365
|
};
|
|
366
|
+
const borderWidthMap = {
|
|
367
|
+
sm: theme.borderWidthSm ?? 1,
|
|
368
|
+
md: theme.borderWidthMd ?? 2,
|
|
369
|
+
lg: theme.borderWidthLg ?? 3
|
|
370
|
+
};
|
|
358
371
|
const hasError = status === "error" || !!helperText;
|
|
359
|
-
const
|
|
372
|
+
const effectiveBorderColor = hasError ? theme.danger : focused ? theme.primary : borderColor ?? theme.border;
|
|
360
373
|
const containerStyle = {
|
|
361
374
|
height: heightMap[size],
|
|
362
375
|
paddingHorizontal: paddingMap2[size],
|
|
363
376
|
borderRadius: radiusMap2[radius],
|
|
364
|
-
borderWidth:
|
|
365
|
-
borderColor,
|
|
377
|
+
borderWidth: borderWidthMap[borderWidth],
|
|
378
|
+
borderColor: effectiveBorderColor,
|
|
366
379
|
backgroundColor: isDisabled ? theme.background : theme.surface,
|
|
367
380
|
flexDirection: "row",
|
|
368
381
|
alignItems: "center",
|
|
@@ -373,7 +386,19 @@ var TextInput = forwardRef(function TextInput2({
|
|
|
373
386
|
return /* @__PURE__ */ jsxs(View, { style: [{ gap: 4 }, wrapperStyle], children: [
|
|
374
387
|
label && /* @__PURE__ */ jsxs(View, { style: { flexDirection: "row", alignItems: "baseline", gap: 4 }, children: [
|
|
375
388
|
/* @__PURE__ */ jsx(Text, { style: { fontSize: 14, fontWeight: "500", color: theme.text }, children: label }),
|
|
376
|
-
subtitle && /* @__PURE__ */ jsx(
|
|
389
|
+
subtitle && /* @__PURE__ */ jsx(
|
|
390
|
+
Text,
|
|
391
|
+
{
|
|
392
|
+
style: {
|
|
393
|
+
fontSize: 14,
|
|
394
|
+
// Required-marker convention (matches web): a lone
|
|
395
|
+
// `*` is rendered in danger color; any other text
|
|
396
|
+
// stays muted.
|
|
397
|
+
color: subtitle.trim() === "*" ? theme.danger : theme.textMuted
|
|
398
|
+
},
|
|
399
|
+
children: subtitle
|
|
400
|
+
}
|
|
401
|
+
)
|
|
377
402
|
] }),
|
|
378
403
|
/* @__PURE__ */ jsxs(View, { style: [containerStyle, style], children: [
|
|
379
404
|
leftIcon && /* @__PURE__ */ jsx(View, { accessibilityElementsHidden: true, children: leftIcon }),
|