@hero-design/rn 8.91.0 → 8.91.3

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.
Files changed (91) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +23 -0
  3. package/es/index.js +157 -37
  4. package/lib/index.js +157 -37
  5. package/package.json +1 -1
  6. package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +6 -6
  7. package/src/components/Checkbox/StyledCheckbox.tsx +3 -3
  8. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +1 -1
  9. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  10. package/src/components/Checkbox/__tests__/index.spec.tsx +11 -7
  11. package/src/components/Checkbox/index.tsx +11 -2
  12. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
  13. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +63 -3
  14. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +21 -1
  15. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +21 -1
  16. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +42 -2
  17. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  18. package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  19. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +2 -2
  20. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  21. package/src/components/FloatingIsland/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  22. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +3 -2
  23. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -2
  24. package/src/components/MapPin/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  25. package/src/components/RichTextEditor/RichTextEditor.tsx +2 -1
  26. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +40 -2
  27. package/src/components/Search/SearchOneLine.tsx +3 -1
  28. package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +7 -0
  29. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +147 -7
  30. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +126 -6
  31. package/src/components/Slider/__tests__/__snapshots__/RangeSlider.spec.tsx.snap +2 -2
  32. package/src/components/Success/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  33. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  34. package/src/components/Switch/StyledSwitch.tsx +1 -0
  35. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +8 -4
  36. package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +4 -2
  37. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +337 -16
  38. package/src/components/TextInput/__tests__/index.spec.tsx +2 -0
  39. package/src/components/TextInput/index.tsx +7 -2
  40. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +42 -2
  41. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +42 -2
  42. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +7 -7
  43. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +44 -16
  44. package/src/theme/components/attachment.ts +1 -1
  45. package/src/theme/components/checkbox.ts +7 -0
  46. package/src/theme/components/success.ts +1 -1
  47. package/src/theme/components/switch.ts +5 -5
  48. package/src/theme/components/textInput.ts +1 -0
  49. package/src/theme/global/colors/__tests__/__snapshots__/swagLight.spec.ts.snap +4 -3
  50. package/src/theme/global/colors/__tests__/__snapshots__/swagLightGlobal.spec.ts.snap +3 -3
  51. package/src/theme/global/colors/__tests__/__snapshots__/swagLightJobs.spec.ts.snap +4 -3
  52. package/src/theme/global/colors/ehWorkDark.ts +1 -0
  53. package/src/theme/global/colors/swagLight.ts +1 -0
  54. package/src/theme/global/colors/swagLightGlobal.ts +3 -3
  55. package/src/theme/global/colors/swagLightJobs.ts +3 -1
  56. package/src/theme/global/colors/types.ts +2 -0
  57. package/src/theme/global/shadows/__tests__/__snapshots__/ehWorkDark.spec.ts.snap +36 -0
  58. package/src/theme/global/shadows/__tests__/__snapshots__/swagLight.spec.ts.snap +36 -0
  59. package/src/theme/global/shadows/__tests__/__snapshots__/swagLightJobs.spec.ts.snap +36 -0
  60. package/src/theme/global/shadows/__tests__/ehWorkDark.spec.ts +7 -0
  61. package/src/theme/global/shadows/__tests__/index.spec.ts +24 -0
  62. package/src/theme/global/shadows/__tests__/swagLight.spec.ts +7 -0
  63. package/src/theme/global/shadows/__tests__/swagLightJobs.spec.ts +7 -0
  64. package/src/theme/global/shadows/ehWorkDark.ts +37 -0
  65. package/src/theme/global/shadows/index.ts +23 -0
  66. package/src/theme/global/shadows/swagLight.ts +37 -0
  67. package/src/theme/global/shadows/swagLightJobs.ts +37 -0
  68. package/src/theme/global/shadows/types.ts +16 -0
  69. package/stats/8.91.1/rn-stats.html +4842 -0
  70. package/stats/8.91.2/rn-stats.html +4842 -0
  71. package/stats/8.91.3/rn-stats.html +4844 -0
  72. package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
  73. package/types/components/Checkbox/index.d.ts +2 -1
  74. package/types/components/TextInput/index.d.ts +3 -1
  75. package/types/theme/components/attachment.d.ts +1 -1
  76. package/types/theme/components/checkbox.d.ts +7 -0
  77. package/types/theme/components/chip.d.ts +1 -10
  78. package/types/theme/components/floatingIsland.d.ts +1 -10
  79. package/types/theme/components/slider.d.ts +1 -10
  80. package/types/theme/components/switch.d.ts +1 -1
  81. package/types/theme/components/textInput.d.ts +1 -0
  82. package/types/theme/global/colors/swagLightJobs.d.ts +2 -50
  83. package/types/theme/global/colors/types.d.ts +2 -0
  84. package/types/theme/global/index.d.ts +2 -12
  85. package/types/theme/global/shadows/ehWorkDark.d.ts +3 -0
  86. package/types/theme/global/shadows/index.d.ts +5 -0
  87. package/types/theme/global/shadows/swagLight.d.ts +3 -0
  88. package/types/theme/global/shadows/swagLightJobs.d.ts +3 -0
  89. package/types/theme/global/shadows/types.d.ts +15 -0
  90. package/src/theme/global/shadows.ts +0 -19
  91. package/types/theme/global/shadows.d.ts +0 -16
package/lib/index.js CHANGED
@@ -2014,10 +2014,10 @@ var swagDarkSystemPalette = _objectSpread2(_objectSpread2(_objectSpread2({}, glo
2014
2014
 
2015
2015
  var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1), {}, {
2016
2016
  onDefaultGlobalSurface: palette$3.offBlack,
2017
- mutedOnDefaultGlobalSurface: palette$3.offBlackLight30,
2018
- inactiveOnDefaultGlobalSurface: palette$3.offBlackLight50,
2017
+ mutedOnDefaultGlobalSurface: '#4d6265',
2018
+ inactiveOnDefaultGlobalSurface: '#808f91',
2019
2019
  primaryOutline: palette$3.offBlack,
2020
- inactiveOutline: palette$3.offBlackLight50
2020
+ inactiveOutline: '#808f91'
2021
2021
  });
2022
2022
 
2023
2023
  var swagBrandSystemPallete = {
@@ -2033,9 +2033,12 @@ var swagBrandSystemPallete = {
2033
2033
  decorativeSecondary: '#fdfbff',
2034
2034
  decorativeSecondarySurface: '#f0e6ff'
2035
2035
  };
2036
- var swagSystemPalette = _objectSpread2(_objectSpread2({}, swagLightGlobalPalette), swagBrandSystemPallete);
2036
+ var swagSystemPalette = _objectSpread2(_objectSpread2(_objectSpread2({}, swagLightGlobalPalette), swagBrandSystemPallete), {}, {
2037
+ name: 'swagLight'
2038
+ });
2037
2039
 
2038
2040
  var swagLightJobsSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette), {}, {
2041
+ name: 'swagLightJobs',
2039
2042
  secondary: '#40d1ff',
2040
2043
  onSecondary: '#460078',
2041
2044
  secondaryHighlightedSurface: '#ecfaff',
@@ -2152,7 +2155,8 @@ var ehWorkDarkSystemPalette = {
2152
2155
  decorativeSecondary: '#280541',
2153
2156
  decorativeSecondarySurface: '#4c1d95',
2154
2157
  // Theme Mode
2155
- themeMode: 'dark'
2158
+ themeMode: 'dark',
2159
+ name: 'ehWorkDark'
2156
2160
  };
2157
2161
 
2158
2162
  var BASE_WIDTH = 390; // Based on iPhone 13's viewport size
@@ -2317,19 +2321,116 @@ var getRadii = function getRadii(baseRadius) {
2317
2321
  };
2318
2322
  };
2319
2323
 
2320
- var getShadows = function getShadows(systemPalette) {
2321
- return {
2322
- "default": {
2323
- shadowOffset: {
2324
- width: 0,
2325
- height: 2
2326
- },
2327
- shadowColor: systemPalette.primaryOutline,
2328
- shadowOpacity: 0.12,
2329
- shadowRadius: 4,
2330
- elevation: 3
2331
- }
2332
- };
2324
+ var swagLightShadowPalette = {
2325
+ "default": {
2326
+ shadowOffset: {
2327
+ width: 0,
2328
+ height: 2
2329
+ },
2330
+ shadowColor: swagSystemPalette.primaryOutline,
2331
+ shadowOpacity: 0.12,
2332
+ shadowRadius: 4,
2333
+ elevation: 3
2334
+ },
2335
+ cardDrawer: {
2336
+ shadowOffset: {
2337
+ width: 0,
2338
+ height: 2
2339
+ },
2340
+ shadowColor: '#001f23',
2341
+ shadowOpacity: 0.12,
2342
+ shadowRadius: 2,
2343
+ elevation: 6
2344
+ },
2345
+ tabBar: {
2346
+ shadowOffset: {
2347
+ width: 0,
2348
+ height: -4
2349
+ },
2350
+ shadowColor: '#001f23',
2351
+ shadowOpacity: 0.04,
2352
+ shadowRadius: 6,
2353
+ elevation: 10
2354
+ }
2355
+ };
2356
+
2357
+ var swagLightJobsShadowPalette = {
2358
+ "default": {
2359
+ shadowOffset: {
2360
+ width: 0,
2361
+ height: 2
2362
+ },
2363
+ shadowColor: swagLightJobsSystemPalette.primaryOutline,
2364
+ shadowOpacity: 0.12,
2365
+ shadowRadius: 4,
2366
+ elevation: 3
2367
+ },
2368
+ cardDrawer: {
2369
+ shadowOffset: {
2370
+ width: 0,
2371
+ height: 2
2372
+ },
2373
+ shadowColor: '#001f23',
2374
+ shadowOpacity: 0.12,
2375
+ shadowRadius: 2,
2376
+ elevation: 6
2377
+ },
2378
+ tabBar: {
2379
+ shadowOffset: {
2380
+ width: 0,
2381
+ height: -4
2382
+ },
2383
+ shadowColor: '#001f23',
2384
+ shadowOpacity: 0.04,
2385
+ shadowRadius: 6,
2386
+ elevation: 10
2387
+ }
2388
+ };
2389
+
2390
+ var ehWorkDarkShadowPalette = {
2391
+ "default": {
2392
+ shadowOffset: {
2393
+ width: 0,
2394
+ height: 2
2395
+ },
2396
+ shadowColor: ehWorkDarkSystemPalette.primaryOutline,
2397
+ shadowOpacity: 0.12,
2398
+ shadowRadius: 4,
2399
+ elevation: 3
2400
+ },
2401
+ cardDrawer: {
2402
+ shadowOffset: {
2403
+ width: 0,
2404
+ height: 2
2405
+ },
2406
+ shadowColor: '#000000',
2407
+ shadowOpacity: 0.56,
2408
+ shadowRadius: 2,
2409
+ elevation: 6
2410
+ },
2411
+ tabBar: {
2412
+ shadowOffset: {
2413
+ width: 0,
2414
+ height: -4
2415
+ },
2416
+ shadowColor: '#000000',
2417
+ shadowOpacity: 0.24,
2418
+ shadowRadius: 6,
2419
+ elevation: 10
2420
+ }
2421
+ };
2422
+
2423
+ var getShadows = function getShadows(palette) {
2424
+ switch (palette.name) {
2425
+ case 'swagLight':
2426
+ return swagLightShadowPalette;
2427
+ case 'swagLightJobs':
2428
+ return swagLightJobsShadowPalette;
2429
+ case 'ehWorkDark':
2430
+ return ehWorkDarkShadowPalette;
2431
+ default:
2432
+ return swagLightShadowPalette;
2433
+ }
2333
2434
  };
2334
2435
 
2335
2436
  var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
@@ -2415,7 +2516,7 @@ var getAlertTheme = function getAlertTheme(theme) {
2415
2516
 
2416
2517
  var getAttachmentTheme = function getAttachmentTheme(theme) {
2417
2518
  var colors = {
2418
- highlightedBackground: theme.colors.highlightedSurface
2519
+ highlightedBackground: theme.colors.decorativeSecondarySurface
2419
2520
  };
2420
2521
  var sizes = {
2421
2522
  imageHeight: theme.sizes.xxxlarge,
@@ -2836,8 +2937,15 @@ var getCheckboxTheme = function getCheckboxTheme(theme) {
2836
2937
  var colors = {
2837
2938
  borders: {
2838
2939
  "default": theme.colors.primaryOutline,
2940
+ checked: theme.colors.primaryOutline,
2839
2941
  disabled: theme.colors.disabledOutline,
2840
2942
  readonly: theme.colors.inactiveOutline
2943
+ },
2944
+ checkboxBorder: {
2945
+ "default": theme.colors.primaryOutline,
2946
+ checked: theme.colors.primary,
2947
+ disabled: theme.colors.disabledOutline,
2948
+ readonly: theme.colors.mutedOnDefaultGlobalSurface
2841
2949
  }
2842
2950
  };
2843
2951
  var space = {
@@ -3567,7 +3675,7 @@ var getSuccessTheme = function getSuccessTheme(theme) {
3567
3675
  var colors = {
3568
3676
  title: theme.colors.onDefaultGlobalSurface,
3569
3677
  description: theme.colors.mutedOnDefaultGlobalSurface,
3570
- fullScreenBackground: theme.colors.decorativePrimarySurface,
3678
+ fullScreenBackground: theme.colors.defaultGlobalSurface,
3571
3679
  inPageBackground: theme.colors.neutralGlobalSurface
3572
3680
  };
3573
3681
  var fontSizes = {
@@ -3610,14 +3718,14 @@ var getSwipeableTheme = function getSwipeableTheme(theme) {
3610
3718
  var getSwitchTheme = function getSwitchTheme(theme) {
3611
3719
  var colors = {
3612
3720
  backgroundColors: {
3613
- checked: theme.colors.primary,
3721
+ checked: theme.colors.pressedSurface,
3614
3722
  unchecked: theme.colors.inactiveOnDefaultGlobalSurface,
3615
- 'disabled-checked': theme.colors.highlightedSurface,
3616
- 'disabled-unchecked': theme.colors.mutedOnDefaultGlobalSurface
3723
+ 'disabled-checked': theme.colors.inactiveOnDefaultGlobalSurface,
3724
+ 'disabled-unchecked': theme.colors.inactiveOnDefaultGlobalSurface
3617
3725
  },
3618
- thumb: theme.colors.onDarkGlobalSurface,
3726
+ thumb: theme.colors.white,
3619
3727
  selector: {
3620
- background: theme.colors.defaultGlobalSurface,
3728
+ background: theme.colors.neutralGlobalSurface,
3621
3729
  textBackground: theme.colors.decorativePrimarySurface
3622
3730
  }
3623
3731
  };
@@ -3773,7 +3881,8 @@ var getTextInputTheme = function getTextInputTheme(theme) {
3773
3881
  disabled: theme.colors.disabledOnDefaultGlobalSurface,
3774
3882
  readonly: theme.colors.inactiveOnDefaultGlobalSurface,
3775
3883
  filled: theme.colors.onDefaultGlobalSurface
3776
- }
3884
+ },
3885
+ placeholder: theme.colors.mutedOnDefaultGlobalSurface
3777
3886
  };
3778
3887
  var space = {
3779
3888
  containerPadding: theme.space.medium,
@@ -14380,7 +14489,7 @@ var StyledCheckbox = index$a(reactNative.View)(function (_ref4) {
14380
14489
  flex: 1,
14381
14490
  borderRadius: theme.__hd__.checkbox.radii.icon,
14382
14491
  borderWidth: theme.__hd__.checkbox.borderWidths.icon,
14383
- borderColor: theme.__hd__.checkbox.colors.borders[themeState]
14492
+ borderColor: theme.__hd__.checkbox.colors.checkboxBorder[themeState]
14384
14493
  };
14385
14494
  });
14386
14495
  var StyledCheckMark = index$a(Icon)(function (_ref5) {
@@ -14389,19 +14498,23 @@ var StyledCheckMark = index$a(Icon)(function (_ref5) {
14389
14498
  return {
14390
14499
  position: 'absolute',
14391
14500
  top: theme.__hd__.checkbox.space.iconTop,
14392
- color: theme.__hd__.checkbox.colors.borders[themeState]
14501
+ color: theme.__hd__.checkbox.colors.checkboxBorder[themeState]
14393
14502
  };
14394
14503
  });
14395
14504
 
14396
14505
  var getThemeState = function getThemeState(_ref) {
14397
14506
  var disabled = _ref.disabled,
14398
- readonly = _ref.readonly;
14507
+ readonly = _ref.readonly,
14508
+ checked = _ref.checked;
14399
14509
  if (disabled) {
14400
14510
  return 'disabled';
14401
14511
  }
14402
14512
  if (readonly) {
14403
14513
  return 'readonly';
14404
14514
  }
14515
+ if (checked) {
14516
+ return 'checked';
14517
+ }
14405
14518
  return 'default';
14406
14519
  };
14407
14520
  var Checkbox = function Checkbox(_ref2) {
@@ -14419,7 +14532,8 @@ var Checkbox = function Checkbox(_ref2) {
14419
14532
  useDeprecation("Checkbox's withBorder prop will be removed in the next major release, all checkboxes will have border by default. Please remove it.", withBorder === true);
14420
14533
  var themeState = getThemeState({
14421
14534
  disabled: disabled,
14422
- readonly: readonly
14535
+ readonly: readonly,
14536
+ checked: checked
14423
14537
  });
14424
14538
  return /*#__PURE__*/React__namespace.default.createElement(StyledWrapper$8, {
14425
14539
  onPress: onPress,
@@ -14612,11 +14726,13 @@ var renderInput$1 = function renderInput(_ref3) {
14612
14726
  var variant = _ref3.variant,
14613
14727
  nativeInputProps = _ref3.nativeInputProps,
14614
14728
  renderInputValue = _ref3.renderInputValue,
14615
- ref = _ref3.ref;
14729
+ ref = _ref3.ref,
14730
+ theme = _ref3.theme;
14616
14731
  return renderInputValue ? renderInputValue(nativeInputProps) : /*#__PURE__*/React__namespace.default.createElement(StyledTextInput, _extends$1({}, nativeInputProps, {
14617
14732
  themeVariant: variant,
14618
14733
  multiline: variant === 'textarea' || nativeInputProps.multiline,
14619
- ref: ref
14734
+ ref: ref,
14735
+ placeholderTextColor: theme.__hd__.textInput.colors.placeholder
14620
14736
  }));
14621
14737
  };
14622
14738
  var renderSuffix$1 = function renderSuffix(_ref4) {
@@ -14871,13 +14987,14 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
14871
14987
  },
14872
14988
  themeState: state,
14873
14989
  testID: "input-label-asterisk"
14874
- }, "*"), label)), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, renderInput$1({
14990
+ }, "*"), /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, label))), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, renderInput$1({
14875
14991
  variant: variant,
14876
14992
  nativeInputProps: nativeInputProps,
14877
14993
  renderInputValue: renderInputValue,
14878
14994
  ref: function ref(rnTextInputRef) {
14879
14995
  innerTextInput.current = rnTextInputRef;
14880
- }
14996
+ },
14997
+ theme: theme
14881
14998
  })), renderSuffix$1({
14882
14999
  state: state,
14883
15000
  loading: loading,
@@ -19487,7 +19604,8 @@ var StyledWrapper$2 = index$a(reactNative.View)(function (_ref) {
19487
19604
  borderRadius: theme.__hd__["switch"].radii.rounded,
19488
19605
  backgroundColor: theme.__hd__["switch"].colors.backgroundColors[themeVariant],
19489
19606
  display: 'flex',
19490
- justifyContent: 'center'
19607
+ justifyContent: 'center',
19608
+ opacity: themeVariant.includes('disabled') ? 0.4 : 1
19491
19609
  };
19492
19610
  });
19493
19611
  var StyledKnot = index$a(reactNative.Animated.View)(function (_ref2) {
@@ -39842,7 +39960,7 @@ var RichTextEditor = function RichTextEditor(_ref) {
39842
39960
  backgroundColor: theme.__hd__.textInput.colors.labelBackground
39843
39961
  },
39844
39962
  themeState: state
39845
- }, "*"), label)), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputContainer, {
39963
+ }, "*"), /*#__PURE__*/React__namespace.default.createElement(Typography.Body, null, label))), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputContainer, {
39846
39964
  onLayout: onLayout
39847
39965
  }, /*#__PURE__*/React__namespace.default.createElement(StyledBorderBackDrop, {
39848
39966
  themeState: state,
@@ -40237,6 +40355,7 @@ var SearchOneLine = /*#__PURE__*/React.forwardRef(function (props, ref) {
40237
40355
  _React$useState2 = _slicedToArray(_React$useState, 2),
40238
40356
  isFocused = _React$useState2[0],
40239
40357
  setIsFocused = _React$useState2[1];
40358
+ var theme = useTheme();
40240
40359
  var displayText = (_ref3 = value !== undefined ? value : defaultValue) !== null && _ref3 !== void 0 ? _ref3 : '';
40241
40360
  var isEmptyValue = displayText.length === 0;
40242
40361
  var state = getState({
@@ -40321,7 +40440,8 @@ var SearchOneLine = /*#__PURE__*/React.forwardRef(function (props, ref) {
40321
40440
  maxLength: maxLength,
40322
40441
  value: value,
40323
40442
  defaultValue: defaultValue,
40324
- placeholder: placeholder
40443
+ placeholder: placeholder,
40444
+ placeholderTextColor: theme.__hd__.textInput.colors.placeholder
40325
40445
  }),
40326
40446
  ref: function ref(rnTextInputRef) {
40327
40447
  innerTextInput.current = rnTextInputRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.91.0",
3
+ "version": "8.91.3",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -815,7 +815,7 @@ exports[`Scrollables With FAB [Function ExampleFlatListWithFAB] renders ActionGr
815
815
  "marginTop": 24,
816
816
  "opacity": 1,
817
817
  "padding": 20,
818
- "shadowColor": "#001f23",
818
+ "shadowColor": "#121214",
819
819
  "shadowOffset": {
820
820
  "height": 2,
821
821
  "width": 0,
@@ -1727,7 +1727,7 @@ exports[`Scrollables With FAB [Function ExampleFlatListWithFAB] renders FAB corr
1727
1727
  "justifyContent": "center",
1728
1728
  "opacity": 1,
1729
1729
  "padding": 20,
1730
- "shadowColor": "#001f23",
1730
+ "shadowColor": "#121214",
1731
1731
  "shadowOffset": {
1732
1732
  "height": 2,
1733
1733
  "width": 0,
@@ -1999,7 +1999,7 @@ exports[`Scrollables With FAB [Function ExampleScrollViewWithFAB] renders Action
1999
1999
  "marginTop": 24,
2000
2000
  "opacity": 1,
2001
2001
  "padding": 20,
2002
- "shadowColor": "#001f23",
2002
+ "shadowColor": "#121214",
2003
2003
  "shadowOffset": {
2004
2004
  "height": 2,
2005
2005
  "width": 0,
@@ -2251,7 +2251,7 @@ exports[`Scrollables With FAB [Function ExampleScrollViewWithFAB] renders FAB co
2251
2251
  "justifyContent": "center",
2252
2252
  "opacity": 1,
2253
2253
  "padding": 20,
2254
- "shadowColor": "#001f23",
2254
+ "shadowColor": "#121214",
2255
2255
  "shadowOffset": {
2256
2256
  "height": 2,
2257
2257
  "width": 0,
@@ -2830,7 +2830,7 @@ exports[`Scrollables With FAB [Function ExampleSectionListWithFAB] renders Actio
2830
2830
  "marginTop": 24,
2831
2831
  "opacity": 1,
2832
2832
  "padding": 20,
2833
- "shadowColor": "#001f23",
2833
+ "shadowColor": "#121214",
2834
2834
  "shadowOffset": {
2835
2835
  "height": 2,
2836
2836
  "width": 0,
@@ -3389,7 +3389,7 @@ exports[`Scrollables With FAB [Function ExampleSectionListWithFAB] renders FAB c
3389
3389
  "justifyContent": "center",
3390
3390
  "opacity": 1,
3391
3391
  "padding": 20,
3392
- "shadowColor": "#001f23",
3392
+ "shadowColor": "#121214",
3393
3393
  "shadowOffset": {
3394
3394
  "height": 2,
3395
3395
  "width": 0,
@@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native';
3
3
  import HeroIcon from '../Icon';
4
4
  import Typography from '../Typography';
5
5
 
6
- type CheckboxThemeState = 'default' | 'disabled' | 'readonly';
6
+ type CheckboxThemeState = 'default' | 'checked' | 'disabled' | 'readonly';
7
7
 
8
8
  export const StyledWrapper = styled(TouchableOpacity)<{
9
9
  themeState: CheckboxThemeState;
@@ -32,7 +32,7 @@ export const StyledCheckbox = styled(View)<{
32
32
  flex: 1,
33
33
  borderRadius: theme.__hd__.checkbox.radii.icon,
34
34
  borderWidth: theme.__hd__.checkbox.borderWidths.icon,
35
- borderColor: theme.__hd__.checkbox.colors.borders[themeState],
35
+ borderColor: theme.__hd__.checkbox.colors.checkboxBorder[themeState],
36
36
  }));
37
37
 
38
38
  export const StyledCheckMark = styled(HeroIcon)<{
@@ -40,5 +40,5 @@ export const StyledCheckMark = styled(HeroIcon)<{
40
40
  }>(({ theme, themeState }) => ({
41
41
  position: 'absolute',
42
42
  top: theme.__hd__.checkbox.space.iconTop,
43
- color: theme.__hd__.checkbox.colors.borders[themeState],
43
+ color: theme.__hd__.checkbox.colors.checkboxBorder[themeState],
44
44
  }));
@@ -57,7 +57,7 @@ exports[`StyledCheckbox renders correctly when disabled is false and readonly is
57
57
  style={
58
58
  [
59
59
  {
60
- "borderColor": "#808f91",
60
+ "borderColor": "#4d6265",
61
61
  "borderRadius": 4,
62
62
  "borderWidth": 2,
63
63
  "flex": 1,
@@ -167,7 +167,7 @@ exports[`Checkbox renders correctly when checked is true and there is no descrip
167
167
  },
168
168
  [
169
169
  {
170
- "color": "#001f23",
170
+ "color": "#401960",
171
171
  "position": "absolute",
172
172
  "top": 0,
173
173
  },
@@ -183,7 +183,7 @@ exports[`Checkbox renders correctly when checked is true and there is no descrip
183
183
  style={
184
184
  [
185
185
  {
186
- "borderColor": "#001f23",
186
+ "borderColor": "#401960",
187
187
  "borderRadius": 4,
188
188
  "borderWidth": 2,
189
189
  "flex": 1,
@@ -191,7 +191,7 @@ exports[`Checkbox renders correctly when checked is true and there is no descrip
191
191
  undefined,
192
192
  ]
193
193
  }
194
- themeState="default"
194
+ themeState="checked"
195
195
  />
196
196
  </View>
197
197
  </View>
@@ -431,7 +431,7 @@ exports[`Checkbox renders correctly when disabled is false and readonly is true
431
431
  style={
432
432
  [
433
433
  {
434
- "borderColor": "#808f91",
434
+ "borderColor": "#4d6265",
435
435
  "borderRadius": 4,
436
436
  "borderWidth": 2,
437
437
  "flex": 1,
@@ -6,15 +6,19 @@ import Checkbox, { getThemeState } from '..';
6
6
 
7
7
  describe('getThemeState', () => {
8
8
  it.each`
9
- disabled | readonly | expected
10
- ${false} | ${false} | ${'default'}
11
- ${false} | ${true} | ${'readonly'}
12
- ${true} | ${false} | ${'disabled'}
13
- ${true} | ${true} | ${'disabled'}
9
+ disabled | readonly | checked | expected
10
+ ${false} | ${false} | ${false} | ${'default'}
11
+ ${false} | ${false} | ${true} | ${'checked'}
12
+ ${false} | ${true} | ${false} | ${'readonly'}
13
+ ${false} | ${true} | ${true} | ${'readonly'}
14
+ ${true} | ${false} | ${false} | ${'disabled'}
15
+ ${true} | ${false} | ${true} | ${'disabled'}
16
+ ${true} | ${true} | ${false} | ${'disabled'}
17
+ ${true} | ${true} | ${true} | ${'disabled'}
14
18
  `(
15
19
  `should return correctly if disabled is $disabled and readonly is $readonly`,
16
- ({ disabled, readonly, expected }) => {
17
- expect(getThemeState({ disabled, readonly })).toBe(expected);
20
+ ({ disabled, readonly, checked, expected }) => {
21
+ expect(getThemeState({ disabled, readonly, checked })).toBe(expected);
18
22
  }
19
23
  );
20
24
  });
@@ -48,9 +48,14 @@ export interface CheckboxProps {
48
48
  type getStateType = {
49
49
  disabled: boolean;
50
50
  readonly: boolean;
51
+ checked?: boolean;
51
52
  };
52
53
 
53
- export const getThemeState = ({ disabled, readonly }: getStateType) => {
54
+ export const getThemeState = ({
55
+ disabled,
56
+ readonly,
57
+ checked,
58
+ }: getStateType) => {
54
59
  if (disabled) {
55
60
  return 'disabled';
56
61
  }
@@ -59,6 +64,10 @@ export const getThemeState = ({ disabled, readonly }: getStateType) => {
59
64
  return 'readonly';
60
65
  }
61
66
 
67
+ if (checked) {
68
+ return 'checked';
69
+ }
70
+
62
71
  return 'default';
63
72
  };
64
73
 
@@ -77,7 +86,7 @@ const Checkbox = ({
77
86
  withBorder === true
78
87
  );
79
88
 
80
- const themeState = getThemeState({ disabled, readonly });
89
+ const themeState = getThemeState({ disabled, readonly, checked });
81
90
 
82
91
  return (
83
92
  <StyledWrapper
@@ -369,7 +369,7 @@ exports[`Chip renders correctly with custom icon 1`] = `
369
369
  "opacity": 1,
370
370
  "paddingHorizontal": 12,
371
371
  "paddingVertical": 8,
372
- "shadowColor": "#001f23",
372
+ "shadowColor": "#121214",
373
373
  "shadowOffset": {
374
374
  "height": 2,
375
375
  "width": 0,
@@ -505,7 +505,7 @@ exports[`Chip renders correctly with custom icon 2`] = `
505
505
  "opacity": 1,
506
506
  "paddingHorizontal": 12,
507
507
  "paddingVertical": 8,
508
- "shadowColor": "#001f23",
508
+ "shadowColor": "#121214",
509
509
  "shadowOffset": {
510
510
  "height": 2,
511
511
  "width": 0,
@@ -867,7 +867,7 @@ exports[`Chip renders correctly with variant compact and selected false 1`] = `
867
867
  "opacity": 1,
868
868
  "paddingHorizontal": 8,
869
869
  "paddingVertical": 4,
870
- "shadowColor": "#001f23",
870
+ "shadowColor": "#121214",
871
871
  "shadowOffset": {
872
872
  "height": 2,
873
873
  "width": 0,
@@ -971,7 +971,7 @@ exports[`Chip renders correctly with variant compact and selected true 1`] = `
971
971
  "opacity": 1,
972
972
  "paddingHorizontal": 8,
973
973
  "paddingVertical": 4,
974
- "shadowColor": "#001f23",
974
+ "shadowColor": "#121214",
975
975
  "shadowOffset": {
976
976
  "height": 2,
977
977
  "width": 0,
@@ -1301,7 +1301,7 @@ exports[`Chip renders correctly with variant filled and selected false 1`] = `
1301
1301
  "opacity": 1,
1302
1302
  "paddingHorizontal": 12,
1303
1303
  "paddingVertical": 8,
1304
- "shadowColor": "#001f23",
1304
+ "shadowColor": "#121214",
1305
1305
  "shadowOffset": {
1306
1306
  "height": 2,
1307
1307
  "width": 0,
@@ -1405,7 +1405,7 @@ exports[`Chip renders correctly with variant filled and selected true 1`] = `
1405
1405
  "opacity": 1,
1406
1406
  "paddingHorizontal": 12,
1407
1407
  "paddingVertical": 8,
1408
- "shadowColor": "#001f23",
1408
+ "shadowColor": "#121214",
1409
1409
  "shadowOffset": {
1410
1410
  "height": 2,
1411
1411
  "width": 0,
@@ -1509,7 +1509,7 @@ exports[`Chip renders correctly with variant filter and selected false 1`] = `
1509
1509
  "opacity": 1,
1510
1510
  "paddingHorizontal": 12,
1511
1511
  "paddingVertical": 8,
1512
- "shadowColor": "#001f23",
1512
+ "shadowColor": "#121214",
1513
1513
  "shadowOffset": {
1514
1514
  "height": 2,
1515
1515
  "width": 0,
@@ -1613,7 +1613,7 @@ exports[`Chip renders correctly with variant filter and selected true 1`] = `
1613
1613
  "opacity": 1,
1614
1614
  "paddingHorizontal": 12,
1615
1615
  "paddingVertical": 8,
1616
- "shadowColor": "#001f23",
1616
+ "shadowColor": "#121214",
1617
1617
  "shadowOffset": {
1618
1618
  "height": 2,
1619
1619
  "width": 0,