@hero-design/rn-work-uikit 1.13.4 → 1.13.5
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/CHANGELOG.md +9 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +221 -145
- package/lib/index.js +221 -145
- package/package.json +3 -3
- package/src/components/TextInput/index.tsx +1 -1
- package/src/theme/components/textInput.ts +17 -6
- package/types/index.d.ts +25 -12
package/lib/index.js
CHANGED
|
@@ -5515,6 +5515,8 @@ var getFonts = function getFonts(_ref) {
|
|
|
5515
5515
|
lightItalic: "".concat(neutral, "-LightItalic"),
|
|
5516
5516
|
regular: "".concat(neutral, "-Regular"),
|
|
5517
5517
|
regularItalic: "".concat(neutral, "-RegularItalic"),
|
|
5518
|
+
medium: "".concat(neutral, "-Medium"),
|
|
5519
|
+
mediumItalic: "".concat(neutral, "-MediumItalic"),
|
|
5518
5520
|
semiBold: "".concat(neutral, "-SemiBold"),
|
|
5519
5521
|
semiBoldItalic: "".concat(neutral, "-SemiBoldItalic")
|
|
5520
5522
|
},
|
|
@@ -5523,6 +5525,8 @@ var getFonts = function getFonts(_ref) {
|
|
|
5523
5525
|
lightItalic: "".concat(playful, "-LightItalic"),
|
|
5524
5526
|
regular: "".concat(playful, "-Regular"),
|
|
5525
5527
|
regularItalic: "".concat(playful, "-RegularItalic"),
|
|
5528
|
+
medium: "".concat(playful, "-Regular"),
|
|
5529
|
+
mediumItalic: "".concat(playful, "-RegularItalic"),
|
|
5526
5530
|
semiBold: "".concat(playful, "-Medium"),
|
|
5527
5531
|
semiBoldItalic: "".concat(playful, "-MediumItalic")
|
|
5528
5532
|
}
|
|
@@ -7393,33 +7397,41 @@ var getTextInputTheme$1 = function getTextInputTheme(theme) {
|
|
|
7393
7397
|
asterisks: {
|
|
7394
7398
|
"default": theme.colors.onErrorSurface,
|
|
7395
7399
|
error: theme.colors.onErrorSurface,
|
|
7396
|
-
disabled: theme.colors.
|
|
7397
|
-
readonly: theme.colors.
|
|
7400
|
+
disabled: theme.colors.onErrorSurface,
|
|
7401
|
+
readonly: theme.colors.onErrorSurface,
|
|
7398
7402
|
filled: theme.colors.onErrorSurface
|
|
7399
7403
|
},
|
|
7400
7404
|
error: theme.colors.onErrorSurface,
|
|
7401
|
-
text:
|
|
7405
|
+
text: {
|
|
7406
|
+
"default": theme.colors.onDefaultGlobalSurface,
|
|
7407
|
+
filled: theme.colors.onDefaultGlobalSurface,
|
|
7408
|
+
error: theme.colors.onDefaultGlobalSurface,
|
|
7409
|
+
readonly: theme.colors.mutedOnDefaultGlobalSurface,
|
|
7410
|
+
disabled: theme.colors.mutedOnDefaultGlobalSurface
|
|
7411
|
+
},
|
|
7402
7412
|
borders: {
|
|
7403
|
-
"default": theme.colors.
|
|
7413
|
+
"default": theme.colors.inactiveOutline,
|
|
7404
7414
|
error: theme.colors.onErrorSurface,
|
|
7405
|
-
disabled: theme.colors.
|
|
7415
|
+
disabled: theme.colors.inactiveOutline,
|
|
7406
7416
|
readonly: theme.colors.inactiveOutline,
|
|
7407
|
-
filled: theme.colors.
|
|
7417
|
+
filled: theme.colors.inactiveOutline,
|
|
7418
|
+
focused: theme.colors.primaryOutline
|
|
7408
7419
|
},
|
|
7409
7420
|
labels: {
|
|
7410
|
-
"default": theme.colors.
|
|
7421
|
+
"default": theme.colors.mutedOnDefaultGlobalSurface,
|
|
7411
7422
|
error: theme.colors.onDefaultGlobalSurface,
|
|
7412
7423
|
disabled: theme.colors.disabledOnDefaultGlobalSurface,
|
|
7413
7424
|
readonly: theme.colors.mutedOnDefaultGlobalSurface,
|
|
7414
|
-
filled: theme.colors.
|
|
7425
|
+
filled: theme.colors.mutedOnDefaultGlobalSurface
|
|
7415
7426
|
},
|
|
7416
7427
|
labelsInsideTextInput: {
|
|
7417
|
-
"default": theme.colors.
|
|
7428
|
+
"default": theme.colors.mutedOnDefaultGlobalSurface,
|
|
7418
7429
|
error: theme.colors.onDefaultGlobalSurface,
|
|
7419
7430
|
disabled: theme.colors.disabledOnDefaultGlobalSurface,
|
|
7420
|
-
readonly: theme.colors.
|
|
7421
|
-
filled: theme.colors.
|
|
7431
|
+
readonly: theme.colors.mutedOnDefaultGlobalSurface,
|
|
7432
|
+
filled: theme.colors.mutedOnDefaultGlobalSurface
|
|
7422
7433
|
},
|
|
7434
|
+
readonlyBackground: theme.colors.neutralGlobalSurface,
|
|
7423
7435
|
maxLengthLabels: {
|
|
7424
7436
|
"default": theme.colors.onDefaultGlobalSurface,
|
|
7425
7437
|
error: theme.colors.onErrorSurface,
|
|
@@ -7436,19 +7448,21 @@ var getTextInputTheme$1 = function getTextInputTheme(theme) {
|
|
|
7436
7448
|
}
|
|
7437
7449
|
};
|
|
7438
7450
|
var space = {
|
|
7439
|
-
|
|
7451
|
+
containerHorizontalPadding: theme.space.medium,
|
|
7452
|
+
containerVerticalPadding: theme.space.small,
|
|
7440
7453
|
labelLeft: theme.space.xlarge,
|
|
7441
7454
|
labelTop: theme.space.xlarge / 3,
|
|
7442
7455
|
labelPaddingBottom: theme.space.small,
|
|
7443
7456
|
labelHorizontalPadding: theme.space.xsmall,
|
|
7444
|
-
inputHorizontalMargin: theme.space.
|
|
7457
|
+
inputHorizontalMargin: theme.space.smallMedium,
|
|
7445
7458
|
errorContainerMarginRight: theme.space.xsmall,
|
|
7446
7459
|
errorAndHelpTextContainerMarginTop: theme.space.xxsmall,
|
|
7447
|
-
errorMarginLeft: theme.space.xsmall,
|
|
7448
|
-
errorAndHelpTextContainerHorizontalPadding: theme.space.medium,
|
|
7449
7460
|
containerMarginTop: theme.space.small,
|
|
7450
|
-
labelInsideTextInputMarginTop:
|
|
7451
|
-
errorAndHelpTextContainerPaddingTop: theme.space.xxsmall
|
|
7461
|
+
labelInsideTextInputMarginTop: 0,
|
|
7462
|
+
errorAndHelpTextContainerPaddingTop: theme.space.xxsmall,
|
|
7463
|
+
inputAndLabelContainerPaddingTop: theme.lineHeights.medium,
|
|
7464
|
+
labelFocusedTranslateY: theme.space.xsmall * 2,
|
|
7465
|
+
textareaLabelIdleTranslateY: theme.space.large
|
|
7452
7466
|
};
|
|
7453
7467
|
var fonts = {
|
|
7454
7468
|
text: theme.fonts.neutral.regular
|
|
@@ -7464,19 +7478,21 @@ var getTextInputTheme$1 = function getTextInputTheme(theme) {
|
|
|
7464
7478
|
var borderWidths = {
|
|
7465
7479
|
container: {
|
|
7466
7480
|
normal: theme.borderWidths.base,
|
|
7467
|
-
focused: theme.borderWidths.
|
|
7481
|
+
focused: theme.borderWidths.base
|
|
7468
7482
|
}
|
|
7469
7483
|
};
|
|
7470
7484
|
var radii = {
|
|
7471
7485
|
container: theme.radii.medium
|
|
7472
7486
|
};
|
|
7473
7487
|
var sizes = {
|
|
7474
|
-
|
|
7475
|
-
|
|
7488
|
+
errorAndHelpTextContainerMinHeight: theme.space.large,
|
|
7489
|
+
containerMinHeight: scale(58),
|
|
7490
|
+
textareaHeight: scale(120),
|
|
7476
7491
|
textInputMaxHeight: theme.sizes['15xlarge']
|
|
7477
7492
|
};
|
|
7478
7493
|
var lineHeights = {
|
|
7479
|
-
topLabel: theme.lineHeights.large / 2
|
|
7494
|
+
topLabel: theme.lineHeights.large / 2,
|
|
7495
|
+
label: theme.lineHeights.large
|
|
7480
7496
|
};
|
|
7481
7497
|
return {
|
|
7482
7498
|
colors: colors,
|
|
@@ -7727,11 +7743,13 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
7727
7743
|
body: {
|
|
7728
7744
|
neutral: {
|
|
7729
7745
|
semiBold: 0.24,
|
|
7746
|
+
medium: 0.3,
|
|
7730
7747
|
regular: 0.48,
|
|
7731
7748
|
small: 0.48
|
|
7732
7749
|
},
|
|
7733
7750
|
playful: {
|
|
7734
7751
|
semiBold: 0.54,
|
|
7752
|
+
medium: 0.54,
|
|
7735
7753
|
regular: 0.54,
|
|
7736
7754
|
small: 0.54
|
|
7737
7755
|
}
|
|
@@ -9079,9 +9097,15 @@ var Text = function Text(_ref) {
|
|
|
9079
9097
|
var FONTWEIGHT_MAP$1 = {
|
|
9080
9098
|
light: 'light',
|
|
9081
9099
|
regular: 'regular',
|
|
9100
|
+
medium: 'medium',
|
|
9082
9101
|
'semi-bold': 'semiBold'
|
|
9083
9102
|
};
|
|
9084
9103
|
|
|
9104
|
+
var LETTER_SPACING_MAP = {
|
|
9105
|
+
regular: 0.36,
|
|
9106
|
+
medium: 0.3,
|
|
9107
|
+
'semi-bold': 0.24
|
|
9108
|
+
};
|
|
9085
9109
|
var StyledCaption = index$c(reactNative.Text)(function (_ref) {
|
|
9086
9110
|
var themeFontWeight = _ref.themeFontWeight,
|
|
9087
9111
|
themeIntent = _ref.themeIntent,
|
|
@@ -9089,10 +9113,11 @@ var StyledCaption = index$c(reactNative.Text)(function (_ref) {
|
|
|
9089
9113
|
themeIsItalic = _ref.themeIsItalic;
|
|
9090
9114
|
var baseFontWeight = FONTWEIGHT_MAP$1[themeFontWeight];
|
|
9091
9115
|
var fontFamily = themeIsItalic ? theme.__hd__.typography.fonts.neutral["".concat(baseFontWeight, "Italic")] : theme.__hd__.typography.fonts.neutral[baseFontWeight];
|
|
9116
|
+
var letterSpacing = LETTER_SPACING_MAP[themeFontWeight];
|
|
9092
9117
|
return {
|
|
9093
9118
|
fontSize: theme.__hd__.typography.fontSizes.caption,
|
|
9094
9119
|
lineHeight: theme.__hd__.typography.lineHeights.caption,
|
|
9095
|
-
letterSpacing:
|
|
9120
|
+
letterSpacing: letterSpacing,
|
|
9096
9121
|
color: theme.__hd__.typography.colors[themeIntent],
|
|
9097
9122
|
fontFamily: fontFamily
|
|
9098
9123
|
};
|
|
@@ -9202,10 +9227,10 @@ var Caption = function Caption(_ref) {
|
|
|
9202
9227
|
var StyledLabel$2 = index$c(reactNative.Text)(function (_ref) {
|
|
9203
9228
|
var themeIntent = _ref.themeIntent,
|
|
9204
9229
|
theme = _ref.theme,
|
|
9205
|
-
themeIsItalic = _ref.themeIsItalic
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
var fontFamily = themeIsItalic ? theme.__hd__.typography.fonts.neutral["".concat(
|
|
9230
|
+
themeIsItalic = _ref.themeIsItalic,
|
|
9231
|
+
_ref$themeFontWeight = _ref.themeFontWeight,
|
|
9232
|
+
themeFontWeight = _ref$themeFontWeight === void 0 ? 'regular' : _ref$themeFontWeight;
|
|
9233
|
+
var fontFamily = themeIsItalic ? theme.__hd__.typography.fonts.neutral["".concat(themeFontWeight, "Italic")] : theme.__hd__.typography.fonts.neutral[themeFontWeight];
|
|
9209
9234
|
return {
|
|
9210
9235
|
fontSize: theme.__hd__.typography.fontSizes.label,
|
|
9211
9236
|
lineHeight: theme.__hd__.typography.lineHeights.label,
|
|
@@ -9215,7 +9240,7 @@ var StyledLabel$2 = index$c(reactNative.Text)(function (_ref) {
|
|
|
9215
9240
|
};
|
|
9216
9241
|
});
|
|
9217
9242
|
|
|
9218
|
-
var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
|
|
9243
|
+
var _excluded$M = ["children", "intent", "allowFontScaling", "fontStyle", "fontWeight", "style", "testID"];
|
|
9219
9244
|
var Label = function Label(_ref) {
|
|
9220
9245
|
var children = _ref.children,
|
|
9221
9246
|
_ref$intent = _ref.intent,
|
|
@@ -9224,6 +9249,8 @@ var Label = function Label(_ref) {
|
|
|
9224
9249
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
9225
9250
|
_ref$fontStyle = _ref.fontStyle,
|
|
9226
9251
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
9252
|
+
_ref$fontWeight = _ref.fontWeight,
|
|
9253
|
+
fontWeight = _ref$fontWeight === void 0 ? 'regular' : _ref$fontWeight,
|
|
9227
9254
|
style = _ref.style,
|
|
9228
9255
|
testID = _ref.testID,
|
|
9229
9256
|
nativeProps = _objectWithoutProperties(_ref, _excluded$M);
|
|
@@ -9231,6 +9258,7 @@ var Label = function Label(_ref) {
|
|
|
9231
9258
|
var styledText = /*#__PURE__*/React__namespace.default.createElement(StyledLabel$2, _extends$1({}, nativeProps, {
|
|
9232
9259
|
themeIntent: isAi ? 'body' : intent,
|
|
9233
9260
|
themeIsItalic: fontStyle === 'italic',
|
|
9261
|
+
themeFontWeight: fontWeight,
|
|
9234
9262
|
allowFontScaling: allowFontScaling,
|
|
9235
9263
|
style: style,
|
|
9236
9264
|
testID: testID
|
|
@@ -9291,12 +9319,16 @@ var Title = function Title(_ref) {
|
|
|
9291
9319
|
var FONTWEIGHT_MAP = {
|
|
9292
9320
|
regular: 'regular',
|
|
9293
9321
|
small: 'regular',
|
|
9322
|
+
'regular-medium': 'medium',
|
|
9323
|
+
'small-medium': 'medium',
|
|
9294
9324
|
'regular-bold': 'semiBold',
|
|
9295
9325
|
'small-bold': 'semiBold'
|
|
9296
9326
|
};
|
|
9297
9327
|
var FONTSIZE_MAP = {
|
|
9298
9328
|
regular: 'regular',
|
|
9299
9329
|
small: 'small',
|
|
9330
|
+
'regular-medium': 'regular',
|
|
9331
|
+
'small-medium': 'small',
|
|
9300
9332
|
'regular-bold': 'regular',
|
|
9301
9333
|
'small-bold': 'small'
|
|
9302
9334
|
};
|
|
@@ -9306,12 +9338,12 @@ var StyledBody$2 = index$c(reactNative.Text)(function (_ref) {
|
|
|
9306
9338
|
themeTypeface = _ref.themeTypeface,
|
|
9307
9339
|
themeVariant = _ref.themeVariant,
|
|
9308
9340
|
themeIsItalic = _ref.themeIsItalic;
|
|
9309
|
-
var
|
|
9310
|
-
var fontFamily = themeIsItalic ? theme.__hd__.typography.fonts[themeTypeface]["".concat(
|
|
9341
|
+
var fontWeight = FONTWEIGHT_MAP[themeVariant];
|
|
9342
|
+
var fontFamily = themeIsItalic ? theme.__hd__.typography.fonts[themeTypeface]["".concat(fontWeight, "Italic")] : theme.__hd__.typography.fonts[themeTypeface][fontWeight];
|
|
9311
9343
|
return {
|
|
9312
9344
|
fontSize: theme.__hd__.typography.fontSizes.body[themeTypeface][FONTSIZE_MAP[themeVariant]],
|
|
9313
9345
|
lineHeight: theme.__hd__.typography.lineHeights.body[themeTypeface][FONTSIZE_MAP[themeVariant]],
|
|
9314
|
-
letterSpacing: theme.__hd__.typography.letterSpacings.body[themeTypeface][
|
|
9346
|
+
letterSpacing: theme.__hd__.typography.letterSpacings.body[themeTypeface][fontWeight],
|
|
9315
9347
|
fontFamily: fontFamily,
|
|
9316
9348
|
color: theme.__hd__.typography.colors[themeIntent]
|
|
9317
9349
|
};
|
|
@@ -10344,6 +10376,24 @@ var Box = function Box(_ref) {
|
|
|
10344
10376
|
}), children);
|
|
10345
10377
|
};
|
|
10346
10378
|
|
|
10379
|
+
var genBorderWidth = function genBorderWidth(theme, themeState, themeFocused) {
|
|
10380
|
+
if (themeState === 'readonly') return 0;
|
|
10381
|
+
return themeFocused ? theme.__hd__.textInput.borderWidths.container.focused : theme.__hd__.textInput.borderWidths.container.normal;
|
|
10382
|
+
};
|
|
10383
|
+
var genBorderColor = function genBorderColor(theme, themeState, themeFocused, themeFilled) {
|
|
10384
|
+
var _theme$__hd__$textInp2;
|
|
10385
|
+
if (themeState === 'error' && !themeFilled) {
|
|
10386
|
+
return theme.__hd__.textInput.colors.borders["default"];
|
|
10387
|
+
}
|
|
10388
|
+
if (themeState === 'error' && themeFilled) {
|
|
10389
|
+
return theme.__hd__.textInput.colors.borders.error;
|
|
10390
|
+
}
|
|
10391
|
+
if (themeFocused) {
|
|
10392
|
+
var _theme$__hd__$textInp;
|
|
10393
|
+
return (_theme$__hd__$textInp = theme.__hd__.textInput.colors.borders.focused) !== null && _theme$__hd__$textInp !== void 0 ? _theme$__hd__$textInp : theme.__hd__.textInput.colors.borders["default"];
|
|
10394
|
+
}
|
|
10395
|
+
return (_theme$__hd__$textInp2 = theme.__hd__.textInput.colors.borders[themeState]) !== null && _theme$__hd__$textInp2 !== void 0 ? _theme$__hd__$textInp2 : theme.__hd__.textInput.colors.borders["default"];
|
|
10396
|
+
};
|
|
10347
10397
|
var StyledContainer$b = index$c(reactNative.View)(function (_ref) {
|
|
10348
10398
|
var theme = _ref.theme;
|
|
10349
10399
|
return {
|
|
@@ -10353,16 +10403,15 @@ var StyledContainer$b = index$c(reactNative.View)(function (_ref) {
|
|
|
10353
10403
|
});
|
|
10354
10404
|
var StyledLabelContainerInsideTextInput = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
10355
10405
|
var themeVariant = _ref2.themeVariant,
|
|
10356
|
-
themeHasPrefix = _ref2.themeHasPrefix,
|
|
10357
10406
|
theme = _ref2.theme;
|
|
10358
10407
|
return {
|
|
10359
10408
|
flexDirection: 'row',
|
|
10360
10409
|
alignItems: themeVariant === 'text' ? 'center' : 'flex-start',
|
|
10361
10410
|
position: 'absolute',
|
|
10362
10411
|
zIndex: 1,
|
|
10363
|
-
left:
|
|
10412
|
+
left: 0,
|
|
10364
10413
|
right: theme.space.medium,
|
|
10365
|
-
top:
|
|
10414
|
+
top: 0
|
|
10366
10415
|
};
|
|
10367
10416
|
});
|
|
10368
10417
|
var StyledLabelInsideTextInput = index$c(reactNative.View)(function (_ref3) {
|
|
@@ -10397,8 +10446,7 @@ var StyledErrorContainer$2 = index$c(reactNative.View)(function (_ref5) {
|
|
|
10397
10446
|
var StyledError$1 = index$c(Typography.Caption)(function (_ref6) {
|
|
10398
10447
|
var theme = _ref6.theme;
|
|
10399
10448
|
return {
|
|
10400
|
-
color: theme.__hd__.textInput.colors.error
|
|
10401
|
-
marginLeft: theme.__hd__.textInput.space.errorMarginLeft
|
|
10449
|
+
color: theme.__hd__.textInput.colors.error
|
|
10402
10450
|
};
|
|
10403
10451
|
});
|
|
10404
10452
|
var StyledMaxLengthMessage = index$c(Typography.Caption)(function (_ref7) {
|
|
@@ -10420,7 +10468,7 @@ var StyledTextInput$1 = index$c(reactNative.TextInput)(function (_ref8) {
|
|
|
10420
10468
|
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
10421
10469
|
alignSelf: 'stretch',
|
|
10422
10470
|
flexGrow: 2,
|
|
10423
|
-
marginHorizontal:
|
|
10471
|
+
marginHorizontal: 0,
|
|
10424
10472
|
paddingVertical: 0,
|
|
10425
10473
|
maxHeight: theme.__hd__.textInput.sizes.textInputMaxHeight,
|
|
10426
10474
|
height: themeVariant === 'text' ? undefined : theme.__hd__.textInput.sizes.textareaHeight,
|
|
@@ -10428,45 +10476,66 @@ var StyledTextInput$1 = index$c(reactNative.TextInput)(function (_ref8) {
|
|
|
10428
10476
|
};
|
|
10429
10477
|
});
|
|
10430
10478
|
var StyledBorderBackDrop = index$c(reactNative.View)(function (_ref9) {
|
|
10431
|
-
var _theme$__hd__$textInp;
|
|
10432
10479
|
var theme = _ref9.theme,
|
|
10433
10480
|
themeFocused = _ref9.themeFocused,
|
|
10434
|
-
themeState = _ref9.themeState
|
|
10481
|
+
themeState = _ref9.themeState,
|
|
10482
|
+
themeFilled = _ref9.themeFilled;
|
|
10435
10483
|
return _objectSpread2(_objectSpread2({}, reactNative.StyleSheet.absoluteFillObject), {}, {
|
|
10436
|
-
borderWidth:
|
|
10484
|
+
borderWidth: genBorderWidth(theme, themeState, themeFocused),
|
|
10437
10485
|
borderRadius: theme.__hd__.textInput.radii.container,
|
|
10438
|
-
borderColor: (
|
|
10486
|
+
borderColor: genBorderColor(theme, themeState, themeFocused, themeFilled)
|
|
10439
10487
|
});
|
|
10440
10488
|
});
|
|
10441
10489
|
var StyledTextInputContainer = index$c(reactNative.View)(function (_ref10) {
|
|
10442
|
-
var theme = _ref10.theme
|
|
10443
|
-
|
|
10490
|
+
var theme = _ref10.theme,
|
|
10491
|
+
themeVariant = _ref10.themeVariant,
|
|
10492
|
+
themeState = _ref10.themeState;
|
|
10493
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({
|
|
10444
10494
|
flexDirection: 'row',
|
|
10445
10495
|
alignItems: 'center',
|
|
10446
|
-
|
|
10447
|
-
|
|
10496
|
+
paddingHorizontal: theme.__hd__.textInput.space.containerHorizontalPadding,
|
|
10497
|
+
paddingVertical: theme.__hd__.textInput.space.containerVerticalPadding,
|
|
10448
10498
|
borderRadius: theme.__hd__.textInput.radii.container
|
|
10449
|
-
}
|
|
10499
|
+
}, themeVariant === 'text' && {
|
|
10500
|
+
minHeight: theme.__hd__.textInput.sizes.containerMinHeight
|
|
10501
|
+
}), themeState === 'disabled' && {
|
|
10502
|
+
opacity: 0.5
|
|
10503
|
+
}), {}, {
|
|
10504
|
+
gap: theme.space.smallMedium
|
|
10505
|
+
});
|
|
10450
10506
|
});
|
|
10451
|
-
|
|
10507
|
+
|
|
10508
|
+
// Outer wrapper that owns flex-grow/shrink and provides the positioning context
|
|
10509
|
+
// for StyledLabelContainerInsideTextInput (position: absolute).
|
|
10510
|
+
var StyledInputContentContainer = index$c(reactNative.View)(function (_ref11) {
|
|
10511
|
+
var themeHasLabel = _ref11.themeHasLabel;
|
|
10452
10512
|
return {
|
|
10453
|
-
flexDirection: 'row',
|
|
10454
|
-
alignItems: 'center',
|
|
10455
|
-
alignSelf: 'stretch',
|
|
10456
10513
|
flexGrow: 2,
|
|
10457
|
-
flexShrink: 1
|
|
10514
|
+
flexShrink: 1,
|
|
10515
|
+
alignSelf: 'stretch',
|
|
10516
|
+
justifyContent: themeHasLabel ? 'flex-start' : 'center'
|
|
10458
10517
|
};
|
|
10459
10518
|
});
|
|
10460
|
-
var
|
|
10461
|
-
var theme =
|
|
10519
|
+
var StyledTextInputAndLabelContainer = index$c(reactNative.View)(function (_ref12) {
|
|
10520
|
+
var theme = _ref12.theme,
|
|
10521
|
+
themeHasLabel = _ref12.themeHasLabel;
|
|
10522
|
+
return _objectSpread2({
|
|
10523
|
+
flexDirection: 'row',
|
|
10524
|
+
alignItems: 'center',
|
|
10525
|
+
alignSelf: 'stretch'
|
|
10526
|
+
}, themeHasLabel && {
|
|
10527
|
+
paddingTop: theme.__hd__.textInput.space.inputAndLabelContainerPaddingTop
|
|
10528
|
+
});
|
|
10529
|
+
});
|
|
10530
|
+
var StyledErrorAndHelpTextContainer = index$c(reactNative.View)(function (_ref13) {
|
|
10531
|
+
var theme = _ref13.theme;
|
|
10462
10532
|
return {
|
|
10463
|
-
|
|
10464
|
-
minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
|
|
10533
|
+
minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerMinHeight,
|
|
10465
10534
|
paddingTop: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingTop
|
|
10466
10535
|
};
|
|
10467
10536
|
});
|
|
10468
|
-
var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (
|
|
10469
|
-
var theme =
|
|
10537
|
+
var StyledErrorAndMaxLengthContainer = index$c(reactNative.View)(function (_ref14) {
|
|
10538
|
+
var theme = _ref14.theme;
|
|
10470
10539
|
return {
|
|
10471
10540
|
flexDirection: 'row',
|
|
10472
10541
|
justifyContent: 'space-between',
|
|
@@ -10504,12 +10573,7 @@ var LABEL_ANIMATION_DURATION$1 = 150;
|
|
|
10504
10573
|
var renderErrorOrHelpText = function renderErrorOrHelpText(_ref2) {
|
|
10505
10574
|
var error = _ref2.error,
|
|
10506
10575
|
helpText = _ref2.helpText;
|
|
10507
|
-
return error ? /*#__PURE__*/React__namespace.default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__namespace.default.createElement(
|
|
10508
|
-
testID: "input-error-icon",
|
|
10509
|
-
icon: "circle-info",
|
|
10510
|
-
size: "xsmall",
|
|
10511
|
-
intent: "danger"
|
|
10512
|
-
}), /*#__PURE__*/React__namespace.default.createElement(StyledError$1, {
|
|
10576
|
+
return error ? /*#__PURE__*/React__namespace.default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__namespace.default.createElement(StyledError$1, {
|
|
10513
10577
|
testID: "input-error-message"
|
|
10514
10578
|
}, error)) : !!helpText && /*#__PURE__*/React__namespace.default.createElement(StyledHelperText$1, null, helpText);
|
|
10515
10579
|
};
|
|
@@ -10539,7 +10603,7 @@ var renderSuffix$1 = function renderSuffix(_ref4) {
|
|
|
10539
10603
|
suffix = _ref4.suffix;
|
|
10540
10604
|
var actualSuffix = loading ? 'loading' : suffix;
|
|
10541
10605
|
return typeof actualSuffix === 'string' ? /*#__PURE__*/React__namespace.default.createElement(Icon, {
|
|
10542
|
-
intent: state === 'disabled' ? 'disabled-text' : '
|
|
10606
|
+
intent: state === 'disabled' ? 'disabled-text' : 'muted',
|
|
10543
10607
|
testID: "input-suffix",
|
|
10544
10608
|
icon: actualSuffix,
|
|
10545
10609
|
spin: actualSuffix === 'loading',
|
|
@@ -10550,10 +10614,10 @@ var renderPrefix$1 = function renderPrefix(_ref5) {
|
|
|
10550
10614
|
var state = _ref5.state,
|
|
10551
10615
|
prefix = _ref5.prefix;
|
|
10552
10616
|
return typeof prefix === 'string' ? /*#__PURE__*/React__namespace.default.createElement(Icon, {
|
|
10553
|
-
intent: state === 'disabled' ? 'disabled-text' : '
|
|
10617
|
+
intent: state === 'disabled' ? 'disabled-text' : 'muted',
|
|
10554
10618
|
testID: "input-prefix",
|
|
10555
10619
|
icon: prefix,
|
|
10556
|
-
size: "
|
|
10620
|
+
size: "medium"
|
|
10557
10621
|
}) : prefix;
|
|
10558
10622
|
};
|
|
10559
10623
|
var renderMaxLengthMessage = function renderMaxLengthMessage(_ref6) {
|
|
@@ -10600,13 +10664,10 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10600
10664
|
nativeProps = _objectWithoutProperties(_ref8, _excluded$G);
|
|
10601
10665
|
var displayText = getDisplayText(value, defaultValue);
|
|
10602
10666
|
var isEmptyValue = displayText.length === 0;
|
|
10603
|
-
var _React$useState = React__namespace.default.useState(
|
|
10604
|
-
height: 0,
|
|
10605
|
-
width: 0
|
|
10606
|
-
}),
|
|
10667
|
+
var _React$useState = React__namespace.default.useState(0),
|
|
10607
10668
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10608
|
-
|
|
10609
|
-
|
|
10669
|
+
containerHeight = _React$useState2[0],
|
|
10670
|
+
setContainerHeight = _React$useState2[1];
|
|
10610
10671
|
var _React$useState3 = React__namespace.default.useState(false),
|
|
10611
10672
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
10612
10673
|
isFocused = _React$useState4[0],
|
|
@@ -10628,18 +10689,14 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10628
10689
|
useNativeDriver: true
|
|
10629
10690
|
}).start();
|
|
10630
10691
|
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
10631
|
-
var onLayout = React.useCallback(function (event) {
|
|
10632
|
-
var _event$nativeEvent$la = event.nativeEvent.layout,
|
|
10633
|
-
height = _event$nativeEvent$la.height,
|
|
10634
|
-
width = _event$nativeEvent$la.width;
|
|
10635
|
-
setInputSize(function (prev) {
|
|
10636
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
10637
|
-
height: height,
|
|
10638
|
-
width: width
|
|
10639
|
-
});
|
|
10640
|
-
});
|
|
10641
|
-
}, []);
|
|
10642
10692
|
var innerTextInput = React__namespace.default.useRef(null);
|
|
10693
|
+
var focusInnerTextInput = React.useCallback(function () {
|
|
10694
|
+
var _innerTextInput$curre;
|
|
10695
|
+
return (_innerTextInput$curre = innerTextInput.current) === null || _innerTextInput$curre === void 0 ? void 0 : _innerTextInput$curre.focus();
|
|
10696
|
+
}, []);
|
|
10697
|
+
var onContentLayout = React.useCallback(function (e) {
|
|
10698
|
+
setContainerHeight(e.nativeEvent.layout.height);
|
|
10699
|
+
}, []);
|
|
10643
10700
|
React__namespace.default.useImperativeHandle(ref, function () {
|
|
10644
10701
|
return {
|
|
10645
10702
|
// we don't expose this method, it's for testing https://medium.com/developer-rants/how-to-test-useref-without-mocking-useref-699165f4994e
|
|
@@ -10647,24 +10704,24 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10647
10704
|
return innerTextInput.current;
|
|
10648
10705
|
},
|
|
10649
10706
|
focus: function focus() {
|
|
10650
|
-
var _innerTextInput$
|
|
10651
|
-
(_innerTextInput$
|
|
10707
|
+
var _innerTextInput$curre2;
|
|
10708
|
+
(_innerTextInput$curre2 = innerTextInput.current) === null || _innerTextInput$curre2 === void 0 || _innerTextInput$curre2.focus();
|
|
10652
10709
|
},
|
|
10653
10710
|
clear: function clear() {
|
|
10654
|
-
var _innerTextInput$
|
|
10655
|
-
return (_innerTextInput$
|
|
10711
|
+
var _innerTextInput$curre3;
|
|
10712
|
+
return (_innerTextInput$curre3 = innerTextInput.current) === null || _innerTextInput$curre3 === void 0 ? void 0 : _innerTextInput$curre3.clear();
|
|
10656
10713
|
},
|
|
10657
10714
|
setNativeProps: function setNativeProps(args) {
|
|
10658
|
-
var _innerTextInput$
|
|
10659
|
-
return (_innerTextInput$
|
|
10715
|
+
var _innerTextInput$curre4;
|
|
10716
|
+
return (_innerTextInput$curre4 = innerTextInput.current) === null || _innerTextInput$curre4 === void 0 ? void 0 : _innerTextInput$curre4.setNativeProps(args);
|
|
10660
10717
|
},
|
|
10661
10718
|
isFocused: function isFocused() {
|
|
10662
|
-
var _innerTextInput$
|
|
10663
|
-
return ((_innerTextInput$
|
|
10719
|
+
var _innerTextInput$curre5;
|
|
10720
|
+
return ((_innerTextInput$curre5 = innerTextInput.current) === null || _innerTextInput$curre5 === void 0 ? void 0 : _innerTextInput$curre5.isFocused()) || false;
|
|
10664
10721
|
},
|
|
10665
10722
|
blur: function blur() {
|
|
10666
|
-
var _innerTextInput$
|
|
10667
|
-
return (_innerTextInput$
|
|
10723
|
+
var _innerTextInput$curre6;
|
|
10724
|
+
return (_innerTextInput$curre6 = innerTextInput.current) === null || _innerTextInput$curre6 === void 0 ? void 0 : _innerTextInput$curre6.blur();
|
|
10668
10725
|
}
|
|
10669
10726
|
};
|
|
10670
10727
|
}, [innerTextInput]);
|
|
@@ -10683,26 +10740,28 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10683
10740
|
}, [textStyle]),
|
|
10684
10741
|
borderStyle = _useMemo.borderStyle,
|
|
10685
10742
|
textStyleWithoutBorderStyle = _useMemo.textStyleWithoutBorderStyle;
|
|
10743
|
+
var readonlyBackground = hexToRgba(theme.__hd__.textInput.colors.readonlyBackground, 0.7);
|
|
10686
10744
|
var _useMemo2 = React.useMemo(function () {
|
|
10687
10745
|
var _flattenTextStyle$bac;
|
|
10746
|
+
var defaultBackground = state === 'readonly' ? readonlyBackground : theme.__hd__.textInput.colors.containerBackground;
|
|
10688
10747
|
if (!style) {
|
|
10689
10748
|
return {
|
|
10690
|
-
backgroundColor:
|
|
10749
|
+
backgroundColor: defaultBackground
|
|
10691
10750
|
};
|
|
10692
10751
|
}
|
|
10693
10752
|
var flattenTextStyle = reactNative.StyleSheet.flatten(style);
|
|
10694
10753
|
return {
|
|
10695
|
-
backgroundColor: (_flattenTextStyle$bac = flattenTextStyle.backgroundColor) !== null && _flattenTextStyle$bac !== void 0 ? _flattenTextStyle$bac :
|
|
10754
|
+
backgroundColor: (_flattenTextStyle$bac = flattenTextStyle.backgroundColor) !== null && _flattenTextStyle$bac !== void 0 ? _flattenTextStyle$bac : defaultBackground,
|
|
10696
10755
|
styleWithoutBackgroundColor: omit(['backgroundColor'], flattenTextStyle)
|
|
10697
10756
|
};
|
|
10698
|
-
}, [style, theme]),
|
|
10757
|
+
}, [style, theme, state, readonlyBackground]),
|
|
10699
10758
|
backgroundColor = _useMemo2.backgroundColor,
|
|
10700
10759
|
styleWithoutBackgroundColor = _useMemo2.styleWithoutBackgroundColor;
|
|
10701
10760
|
var nativeInputTestIDSuffix = testID ? "-".concat(testID) : '';
|
|
10702
10761
|
var nativeInputProps = _objectSpread2(_objectSpread2({
|
|
10703
10762
|
style: reactNative.StyleSheet.flatten([{
|
|
10704
10763
|
backgroundColor: backgroundColor,
|
|
10705
|
-
color: theme.__hd__.textInput.colors.text
|
|
10764
|
+
color: theme.__hd__.textInput.colors.text[state]
|
|
10706
10765
|
}, textStyleWithoutBorderStyle]),
|
|
10707
10766
|
testID: "text-input".concat(nativeInputTestIDSuffix),
|
|
10708
10767
|
accessibilityState: {
|
|
@@ -10735,22 +10794,30 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10735
10794
|
});
|
|
10736
10795
|
return /*#__PURE__*/React__namespace.default.createElement(StyledContainer$b, {
|
|
10737
10796
|
style: styleWithoutBackgroundColor,
|
|
10738
|
-
pointerEvents: state === 'disabled' || state === 'readonly' ? 'none' : 'auto',
|
|
10797
|
+
pointerEvents: state === 'disabled' || state === 'readonly' || loading ? 'none' : 'auto',
|
|
10739
10798
|
testID: testID
|
|
10799
|
+
}, /*#__PURE__*/React__namespace.default.createElement(reactNative.Pressable, {
|
|
10800
|
+
onPress: focusInnerTextInput,
|
|
10801
|
+
accessible: false,
|
|
10802
|
+
importantForAccessibility: "no"
|
|
10740
10803
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledTextInputContainer, {
|
|
10741
|
-
|
|
10804
|
+
themeVariant: variant,
|
|
10805
|
+
themeState: state
|
|
10742
10806
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledBorderBackDrop, {
|
|
10743
10807
|
themeFocused: isFocused,
|
|
10744
10808
|
themeState: state,
|
|
10809
|
+
themeFilled: !isEmptyValue,
|
|
10745
10810
|
testID: "text-input-border",
|
|
10746
10811
|
style: [{
|
|
10747
10812
|
backgroundColor: backgroundColor
|
|
10748
10813
|
}, borderStyle]
|
|
10749
|
-
}), /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, renderPrefix$1({
|
|
10814
|
+
}), prefix !== undefined && /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, renderPrefix$1({
|
|
10750
10815
|
state: state,
|
|
10751
10816
|
prefix: prefix
|
|
10752
|
-
})), /*#__PURE__*/React__namespace.default.createElement(
|
|
10753
|
-
|
|
10817
|
+
})), /*#__PURE__*/React__namespace.default.createElement(StyledInputContentContainer, {
|
|
10818
|
+
themeHasLabel: !!label,
|
|
10819
|
+
onLayout: onContentLayout
|
|
10820
|
+
}, /*#__PURE__*/React__namespace.default.createElement(StyledLabelContainerInsideTextInput, {
|
|
10754
10821
|
themeVariant: variant,
|
|
10755
10822
|
pointerEvents: "none",
|
|
10756
10823
|
style: [{
|
|
@@ -10759,7 +10826,7 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10759
10826
|
transform: [{
|
|
10760
10827
|
translateY: focusAnimation.interpolate({
|
|
10761
10828
|
inputRange: [0, 1],
|
|
10762
|
-
outputRange: [variant !== 'textarea' ?
|
|
10829
|
+
outputRange: [variant !== 'textarea' ? Math.max(0, (containerHeight - theme.__hd__.textInput.lineHeights.label) / 2) : theme.__hd__.textInput.space.textareaLabelIdleTranslateY, 0]
|
|
10763
10830
|
})
|
|
10764
10831
|
}, {
|
|
10765
10832
|
scale: focusAnimation.interpolate({
|
|
@@ -10783,8 +10850,11 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10783
10850
|
testID: "input-label-asterisk"
|
|
10784
10851
|
}, "*"), /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
10785
10852
|
testID: "input-label-text".concat(nativeInputTestIDSuffix),
|
|
10786
|
-
numberOfLines: 1
|
|
10787
|
-
|
|
10853
|
+
numberOfLines: 1,
|
|
10854
|
+
intent: "muted"
|
|
10855
|
+
}, label))), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, {
|
|
10856
|
+
themeHasLabel: !!label
|
|
10857
|
+
}, renderInput$1({
|
|
10788
10858
|
variant: variant,
|
|
10789
10859
|
nativeInputProps: nativeInputProps,
|
|
10790
10860
|
renderInputValue: renderInputValue,
|
|
@@ -10793,11 +10863,11 @@ var TextInput$1 = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
10793
10863
|
},
|
|
10794
10864
|
theme: theme,
|
|
10795
10865
|
state: state
|
|
10796
|
-
})), renderSuffix$1({
|
|
10866
|
+
}))), renderSuffix$1({
|
|
10797
10867
|
state: state,
|
|
10798
10868
|
loading: loading,
|
|
10799
10869
|
suffix: suffix
|
|
10800
|
-
})), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, renderErrorOrHelpText({
|
|
10870
|
+
}))), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, renderErrorOrHelpText({
|
|
10801
10871
|
error: error,
|
|
10802
10872
|
helpText: helpText
|
|
10803
10873
|
}), renderMaxLengthMessage({
|
|
@@ -41498,13 +41568,10 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41498
41568
|
}
|
|
41499
41569
|
return 'default';
|
|
41500
41570
|
}, [isFocused, error, isEmptyValue]);
|
|
41501
|
-
var _React$useState = React__namespace.default.useState(
|
|
41502
|
-
height: 0,
|
|
41503
|
-
width: 0
|
|
41504
|
-
}),
|
|
41571
|
+
var _React$useState = React__namespace.default.useState(0),
|
|
41505
41572
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41506
|
-
|
|
41507
|
-
|
|
41573
|
+
containerHeight = _React$useState2[0],
|
|
41574
|
+
setContainerHeight = _React$useState2[1];
|
|
41508
41575
|
var focusAnimation = React.useRef(new reactNative.Animated.Value(0)).current;
|
|
41509
41576
|
React.useEffect(function () {
|
|
41510
41577
|
reactNative.Animated.timing(focusAnimation, {
|
|
@@ -41515,16 +41582,9 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41515
41582
|
}).start();
|
|
41516
41583
|
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
41517
41584
|
var onLayout = React.useCallback(function (event) {
|
|
41518
|
-
|
|
41519
|
-
height = _event$nativeEvent$la.height,
|
|
41520
|
-
width = _event$nativeEvent$la.width;
|
|
41521
|
-
setInputSize(function (prev) {
|
|
41522
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
41523
|
-
height: height,
|
|
41524
|
-
width: width
|
|
41525
|
-
});
|
|
41526
|
-
});
|
|
41585
|
+
setContainerHeight(event.nativeEvent.layout.height);
|
|
41527
41586
|
}, []);
|
|
41587
|
+
var backgroundColor = theme.__hd__.textInput.colors.containerBackground;
|
|
41528
41588
|
var handleEditorFocus = React.useCallback(function () {
|
|
41529
41589
|
onFocus === null || onFocus === void 0 || onFocus();
|
|
41530
41590
|
setIsFocused(true);
|
|
@@ -41535,8 +41595,20 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41535
41595
|
}, [onBlur]);
|
|
41536
41596
|
return /*#__PURE__*/React__namespace.default.createElement(StyledContainer$b, {
|
|
41537
41597
|
testID: testID
|
|
41598
|
+
}, /*#__PURE__*/React__namespace.default.createElement(StyledTextInputContainer, {
|
|
41599
|
+
onLayout: onLayout,
|
|
41600
|
+
themeVariant: "text",
|
|
41601
|
+
themeState: state
|
|
41602
|
+
}, /*#__PURE__*/React__namespace.default.createElement(StyledBorderBackDrop, {
|
|
41603
|
+
themeState: state,
|
|
41604
|
+
themeFocused: isFocused,
|
|
41605
|
+
themeFilled: !isEmptyValue,
|
|
41606
|
+
style: {
|
|
41607
|
+
backgroundColor: backgroundColor
|
|
41608
|
+
}
|
|
41609
|
+
}), /*#__PURE__*/React__namespace.default.createElement(StyledInputContentContainer, {
|
|
41610
|
+
themeHasLabel: !!label
|
|
41538
41611
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledLabelContainerInsideTextInput, {
|
|
41539
|
-
themeHasPrefix: false,
|
|
41540
41612
|
themeVariant: "text",
|
|
41541
41613
|
pointerEvents: "none",
|
|
41542
41614
|
testID: "input-label-container",
|
|
@@ -41546,7 +41618,7 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41546
41618
|
transform: [{
|
|
41547
41619
|
translateY: focusAnimation.interpolate({
|
|
41548
41620
|
inputRange: [0, 1],
|
|
41549
|
-
outputRange: [
|
|
41621
|
+
outputRange: [Math.max(0, (containerHeight - theme.__hd__.textInput.lineHeights.label) / 2), theme.__hd__.textInput.space.labelFocusedTranslateY]
|
|
41550
41622
|
})
|
|
41551
41623
|
}, {
|
|
41552
41624
|
scale: focusAnimation.interpolate({
|
|
@@ -41567,13 +41639,11 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41567
41639
|
},
|
|
41568
41640
|
themeState: state
|
|
41569
41641
|
}, "*"), /*#__PURE__*/React__namespace.default.createElement(Typography.Body, {
|
|
41642
|
+
intent: "muted",
|
|
41570
41643
|
numberOfLines: 1
|
|
41571
|
-
}, label))), /*#__PURE__*/React__namespace.default.createElement(
|
|
41572
|
-
|
|
41573
|
-
}, /*#__PURE__*/React__namespace.default.createElement(
|
|
41574
|
-
themeState: state,
|
|
41575
|
-
themeFocused: isFocused
|
|
41576
|
-
}), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, /*#__PURE__*/React__namespace.default.createElement(RichTextEditorInput$1, {
|
|
41644
|
+
}, label))), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, {
|
|
41645
|
+
themeHasLabel: !!label
|
|
41646
|
+
}, /*#__PURE__*/React__namespace.default.createElement(RichTextEditorInput$1, {
|
|
41577
41647
|
name: name,
|
|
41578
41648
|
value: value,
|
|
41579
41649
|
style: [style, {
|
|
@@ -41587,12 +41657,7 @@ var RichTextEditor$1 = function RichTextEditor(_ref) {
|
|
|
41587
41657
|
onBlur: handleEditorBlur,
|
|
41588
41658
|
onFocus: handleEditorFocus,
|
|
41589
41659
|
onCursorChange: onCursorChange
|
|
41590
|
-
}))), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React__namespace.default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__namespace.default.createElement(
|
|
41591
|
-
testID: "input-error-icon",
|
|
41592
|
-
icon: "circle-info",
|
|
41593
|
-
size: "xsmall",
|
|
41594
|
-
intent: "danger"
|
|
41595
|
-
}), /*#__PURE__*/React__namespace.default.createElement(StyledError$1, {
|
|
41660
|
+
})))), /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndHelpTextContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledErrorAndMaxLengthContainer, null, error ? /*#__PURE__*/React__namespace.default.createElement(StyledErrorContainer$2, null, /*#__PURE__*/React__namespace.default.createElement(StyledError$1, {
|
|
41596
41661
|
testID: "input-error-message"
|
|
41597
41662
|
}, error)) : !!helpText && /*#__PURE__*/React__namespace.default.createElement(StyledHelperText$1, null, helpText))));
|
|
41598
41663
|
};
|
|
@@ -41838,7 +41903,7 @@ var StyledInput = index$c(reactNative.TextInput)(function (_ref4) {
|
|
|
41838
41903
|
return {
|
|
41839
41904
|
textAlignVertical: 'center',
|
|
41840
41905
|
fontSize: theme.__hd__.search.fontSizes.text,
|
|
41841
|
-
color: theme.__hd__.textInput.colors.text,
|
|
41906
|
+
color: theme.__hd__.textInput.colors.text["default"],
|
|
41842
41907
|
alignSelf: 'stretch',
|
|
41843
41908
|
flexGrow: 1,
|
|
41844
41909
|
flexShrink: 1,
|
|
@@ -42850,7 +42915,13 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
42850
42915
|
// Override specific values here as needed
|
|
42851
42916
|
var colors = _objectSpread2(_objectSpread2({}, baseTextInputTheme.colors), {}, {
|
|
42852
42917
|
// Example: override specific colors
|
|
42853
|
-
|
|
42918
|
+
asterisks: {
|
|
42919
|
+
"default": theme.colors.onErrorSurface,
|
|
42920
|
+
error: theme.colors.onErrorSurface,
|
|
42921
|
+
disabled: theme.colors.disabledOnDefaultGlobalSurface,
|
|
42922
|
+
readonly: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
42923
|
+
filled: theme.colors.onErrorSurface
|
|
42924
|
+
},
|
|
42854
42925
|
borders: {
|
|
42855
42926
|
"default": theme.colors.secondaryOutline,
|
|
42856
42927
|
error: theme.colors.onErrorSurface,
|
|
@@ -42867,6 +42938,13 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
42867
42938
|
filled: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
42868
42939
|
focused: theme.colors.onDefaultGlobalSurface
|
|
42869
42940
|
},
|
|
42941
|
+
labelsInsideTextInput: {
|
|
42942
|
+
"default": theme.colors.onDefaultGlobalSurface,
|
|
42943
|
+
error: theme.colors.onDefaultGlobalSurface,
|
|
42944
|
+
disabled: theme.colors.disabledOnDefaultGlobalSurface,
|
|
42945
|
+
readonly: theme.colors.inactiveOnDefaultGlobalSurface,
|
|
42946
|
+
filled: theme.colors.onDefaultGlobalSurface
|
|
42947
|
+
},
|
|
42870
42948
|
maxLengthLabels: {
|
|
42871
42949
|
"default": theme.colors.onDefaultGlobalSurface,
|
|
42872
42950
|
error: theme.colors.onErrorSurface,
|
|
@@ -42878,22 +42956,20 @@ var getTextInputTheme = function getTextInputTheme(theme) {
|
|
|
42878
42956
|
});
|
|
42879
42957
|
var space = _objectSpread2(_objectSpread2({}, baseTextInputTheme.space), {}, {
|
|
42880
42958
|
// Example: override specific spacing
|
|
42881
|
-
|
|
42959
|
+
containerPadding: theme.space.medium,
|
|
42960
|
+
errorMarginLeft: theme.space.xsmall,
|
|
42882
42961
|
inputWrapperMarginVertical: theme.space.small,
|
|
42883
42962
|
prefixAndInputContainerGap: theme.space.xsmall
|
|
42884
42963
|
});
|
|
42885
42964
|
var fonts = _objectSpread2({}, baseTextInputTheme.fonts);
|
|
42886
42965
|
var fontSizes = _objectSpread2({}, baseTextInputTheme.fontSizes);
|
|
42887
|
-
var borderWidths = _objectSpread2(
|
|
42888
|
-
container: _objectSpread2(_objectSpread2({}, baseTextInputTheme.borderWidths.container), {}, {
|
|
42889
|
-
normal: theme.borderWidths.medium
|
|
42890
|
-
})
|
|
42891
|
-
});
|
|
42966
|
+
var borderWidths = _objectSpread2({}, baseTextInputTheme.borderWidths);
|
|
42892
42967
|
var radii = _objectSpread2({}, baseTextInputTheme.radii);
|
|
42893
42968
|
var sizes = _objectSpread2(_objectSpread2({}, baseTextInputTheme.sizes), {}, {
|
|
42894
42969
|
containerMinHeight: theme.sizes.xxxxlarge,
|
|
42895
42970
|
errorAndHelpTextContainerHeight: 0,
|
|
42896
|
-
textInputMinHeight: baseTextInputTheme.fontSizes.text + theme.space.small
|
|
42971
|
+
textInputMinHeight: baseTextInputTheme.fontSizes.text + theme.space.small,
|
|
42972
|
+
textareaHeight: theme.sizes['15xlarge']
|
|
42897
42973
|
});
|
|
42898
42974
|
var lineHeights = _objectSpread2({}, baseTextInputTheme.lineHeights);
|
|
42899
42975
|
return {
|
|
@@ -43586,7 +43662,7 @@ var InternalTextInput = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
43586
43662
|
var nativeInputProps = _objectSpread2(_objectSpread2({
|
|
43587
43663
|
style: reactNative.StyleSheet.flatten([{
|
|
43588
43664
|
backgroundColor: backgroundColor,
|
|
43589
|
-
color: theme.__hd__.textInput.colors.text
|
|
43665
|
+
color: theme.__hd__.textInput.colors.text["default"]
|
|
43590
43666
|
}, textInputStyle]),
|
|
43591
43667
|
testID: "text-input".concat(nativeInputTestIDSuffix),
|
|
43592
43668
|
accessibilityState: {
|