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