@hero-design/rn 8.89.0 → 8.90.1

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 (40) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/CHANGELOG.md +26 -0
  3. package/es/index.js +20 -4
  4. package/lib/index.js +20 -4
  5. package/package.json +3 -3
  6. package/src/components/Calendar/CalendarRange.tsx +1 -0
  7. package/src/components/Calendar/index.tsx +2 -0
  8. package/src/components/Card/DataCard/StyledDataCard.tsx +1 -0
  9. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +1 -0
  10. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
  11. package/src/components/Card/StyledCard.tsx +1 -0
  12. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +72 -5
  13. package/src/components/Card/__tests__/index.spec.tsx +3 -2
  14. package/src/components/Card/index.tsx +1 -0
  15. package/src/components/DatePicker/DatePickerAndroid.tsx +3 -0
  16. package/src/components/DatePicker/DatePickerIOS.tsx +1 -0
  17. package/src/components/DatePicker/types.ts +4 -0
  18. package/src/components/Icon/HeroIcon/index.tsx +7 -1
  19. package/src/components/Icon/index.tsx +1 -1
  20. package/src/components/Image/index.tsx +5 -0
  21. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +4 -0
  22. package/src/theme/components/card.ts +2 -0
  23. package/src/theme/components/icon.ts +1 -0
  24. package/src/theme/getTheme.ts +4 -0
  25. package/src/theme/global/colors/__tests__/__snapshots__/swagDark.spec.ts.snap +1 -0
  26. package/src/theme/global/colors/swagDark.ts +2 -0
  27. package/src/theme/global/colors/types.ts +5 -1
  28. package/stats/8.90.1/rn-stats.html +4842 -0
  29. package/stats/9.0.0/rn-stats.html +4842 -0
  30. package/types/components/Card/StyledCard.d.ts +1 -1
  31. package/types/components/Card/index.d.ts +1 -1
  32. package/types/components/DatePicker/types.d.ts +4 -0
  33. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  34. package/types/components/Icon/index.d.ts +1 -1
  35. package/types/theme/components/card.d.ts +2 -0
  36. package/types/theme/components/icon.d.ts +1 -0
  37. package/types/theme/getTheme.d.ts +3 -0
  38. package/types/theme/global/colors/swagLightJobs.d.ts +1 -0
  39. package/types/theme/global/colors/types.d.ts +4 -1
  40. package/types/theme/global/index.d.ts +1 -0
@@ -1,4 +1,4 @@
1
- (node:3039) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:2935) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
3
  
4
4
  src/index.ts → lib/index.js, es/index.js...
@@ -10,4 +10,4 @@
10
10
     ~~~~~~~~~~~~~~~~~~~
11
11
  
12
12
  (!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.
13
- created lib/index.js, es/index.js in 53.2s
13
+ created lib/index.js, es/index.js in 52.1s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.90.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3677](https://github.com/Thinkei/hero-design/pull/3677) [`ac973b40ec94c3fa7e83a6cfc9d781a3ccb68f5b`](https://github.com/Thinkei/hero-design/commit/ac973b40ec94c3fa7e83a6cfc9d781a3ccb68f5b) Thanks [@ttkien](https://github.com/ttkien)! - [Theme] add themeMode to specify dark or light mode
8
+ [MonthYearPicker] change themeVariant base on theme mode
9
+ - Updated dependencies [[`ac973b40ec94c3fa7e83a6cfc9d781a3ccb68f5b`](https://github.com/Thinkei/hero-design/commit/ac973b40ec94c3fa7e83a6cfc9d781a3ccb68f5b)]:
10
+ - @hero-design/react-native-month-year-picker@8.43.1
11
+
12
+ ## 8.90.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#3682](https://github.com/Thinkei/hero-design/pull/3682) [`9cc1860a717736c1116affb45f44f381c1e0b616`](https://github.com/Thinkei/hero-design/commit/9cc1860a717736c1116affb45f44f381c1e0b616) Thanks [@ttkien](https://github.com/ttkien)! - [Icon] Add xxxsmall size
17
+
18
+ - [#3682](https://github.com/Thinkei/hero-design/pull/3682) [`9cc1860a717736c1116affb45f44f381c1e0b616`](https://github.com/Thinkei/hero-design/commit/9cc1860a717736c1116affb45f44f381c1e0b616) Thanks [@ttkien](https://github.com/ttkien)! - [Card] Add secondary intent and update Card.Data background color
19
+
20
+ ### Patch Changes
21
+
22
+ - [#3682](https://github.com/Thinkei/hero-design/pull/3682) [`9cc1860a717736c1116affb45f44f381c1e0b616`](https://github.com/Thinkei/hero-design/commit/9cc1860a717736c1116affb45f44f381c1e0b616) Thanks [@ttkien](https://github.com/ttkien)! - [Image] Deprecate component
23
+
24
+ - [#3682](https://github.com/Thinkei/hero-design/pull/3682) [`9cc1860a717736c1116affb45f44f381c1e0b616`](https://github.com/Thinkei/hero-design/commit/9cc1860a717736c1116affb45f44f381c1e0b616) Thanks [@ttkien](https://github.com/ttkien)! - [iOS] support text color for react-native-month-year-picker
25
+
26
+ - Updated dependencies [[`9cc1860a717736c1116affb45f44f381c1e0b616`](https://github.com/Thinkei/hero-design/commit/9cc1860a717736c1116affb45f44f381c1e0b616)]:
27
+ - @hero-design/react-native-month-year-picker@8.43.0
28
+
3
29
  ## 8.89.0
4
30
 
5
31
  ### Minor Changes
package/es/index.js CHANGED
@@ -1979,7 +1979,10 @@ var swagDarkBrandSystemPalette = {
1979
1979
  decorativePrimary: palette$2.maasstrichtBlue,
1980
1980
  decorativePrimarySurface: palette$2.maasstrichtBlueLight10
1981
1981
  };
1982
- var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette);
1982
+ var swagDarkSystemPalette = _objectSpread2(_objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette), {}, {
1983
+ // Theme Mode
1984
+ themeMode: 'dark'
1985
+ });
1983
1986
 
1984
1987
  var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1), {}, {
1985
1988
  onDefaultGlobalSurface: palette$3.offBlack,
@@ -2667,12 +2670,14 @@ var getCardTheme = function getCardTheme(theme) {
2667
2670
  var colors = {
2668
2671
  dataCardIndicator: theme.colors.primary,
2669
2672
  primary: theme.colors.primary,
2673
+ secondary: theme.colors.highlightedSurface,
2670
2674
  info: theme.colors.info,
2671
2675
  success: theme.colors.success,
2672
2676
  warning: theme.colors.warning,
2673
2677
  danger: theme.colors.error,
2674
2678
  archived: theme.colors.archived,
2675
- neutral: theme.colors.neutralGlobalSurface
2679
+ neutral: theme.colors.neutralGlobalSurface,
2680
+ dataCardBackground: theme.colors.neutralGlobalSurface
2676
2681
  };
2677
2682
  var sizes = {
2678
2683
  indicatorWidth: theme.sizes.medium
@@ -3041,6 +3046,7 @@ var getIconTheme = function getIconTheme(theme) {
3041
3046
  muted: theme.colors.mutedOnDefaultGlobalSurface
3042
3047
  };
3043
3048
  var sizes = {
3049
+ xxxsmall: theme.fontSizes.small,
3044
3050
  xsmall: theme.fontSizes.large,
3045
3051
  small: theme.fontSizes.xxlarge,
3046
3052
  medium: theme.fontSizes.xxxlarge,
@@ -4189,7 +4195,9 @@ var getTheme$1 = function getTheme() {
4189
4195
  var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
4190
4196
  var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : swagSystemPalette$1;
4191
4197
  var globalTheme = getGlobalTheme(scale, systemPallete);
4192
- return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
4198
+ return _objectSpread2(_objectSpread2({
4199
+ themeMode: systemPallete.themeMode
4200
+ }, globalTheme), {}, {
4193
4201
  __hd__: {
4194
4202
  accordion: getAccordionTheme(globalTheme),
4195
4203
  alert: getAlertTheme(globalTheme),
@@ -13272,6 +13280,7 @@ var CalendarRange = function CalendarRange(_ref) {
13272
13280
  isCurrentMonth: false
13273
13281
  });
13274
13282
  })), Platform.OS === 'android' && monthPickerVisible && /*#__PURE__*/React__default.createElement(MonthYearPickerDialogueAndroid, {
13283
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
13275
13284
  doneButtonLabel: monthPickerConfirmLabel,
13276
13285
  cancelButtonLabel: monthPickerCancelLabel,
13277
13286
  value: value === null || value === void 0 ? void 0 : value.startDate,
@@ -13407,6 +13416,7 @@ var Calendar = function Calendar(_ref) {
13407
13416
  minimumDate: minDate,
13408
13417
  maximumDate: maxDate,
13409
13418
  onChange: onMonthChange,
13419
+ textColor: theme.colors.onDefaultGlobalSurface,
13410
13420
  style: {
13411
13421
  height: contentHeight + theme.__hd__.calendar.space.iosPickerMarginVertical * 2,
13412
13422
  marginVertical: -theme.__hd__.calendar.space.iosPickerMarginVertical,
@@ -13470,6 +13480,7 @@ var Calendar = function Calendar(_ref) {
13470
13480
  testID: "calendar-disabled-cell"
13471
13481
  });
13472
13482
  })), Platform.OS === 'android' && monthPickerVisible && /*#__PURE__*/React__default.createElement(MonthYearPickerDialogueAndroid, {
13483
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
13473
13484
  doneButtonLabel: monthPickerConfirmLabel,
13474
13485
  cancelButtonLabel: monthPickerCancelLabel,
13475
13486
  value: value,
@@ -13493,7 +13504,8 @@ var StyledDataCard = index$a(View)(function (_ref) {
13493
13504
  return {
13494
13505
  borderRadius: theme.__hd__.card.radii["default"],
13495
13506
  overflow: 'hidden',
13496
- flexDirection: 'row'
13507
+ flexDirection: 'row',
13508
+ backgroundColor: theme.__hd__.card.colors.dataCardBackground
13497
13509
  };
13498
13510
  });
13499
13511
  var Indicator = index$a(View)(function (_ref2) {
@@ -13811,6 +13823,7 @@ var Image = function Image(_ref) {
13811
13823
  testID = _ref.testID,
13812
13824
  style = _ref.style,
13813
13825
  imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
13826
+ useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
13814
13827
  var theme = useTheme();
13815
13828
  var imageSize = theme.__hd__.image.sizes[size];
13816
13829
  return /*#__PURE__*/React__default.createElement(Image$1, _extends$1({
@@ -14841,6 +14854,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
14841
14854
  onChange: _onChange,
14842
14855
  value: value
14843
14856
  });
14857
+ var theme = useTheme();
14844
14858
  return /*#__PURE__*/React__default.createElement(TouchableOpacity, {
14845
14859
  onPress: function onPress() {
14846
14860
  return setOpen(true);
@@ -14861,6 +14875,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
14861
14875
  style: style,
14862
14876
  testID: testID
14863
14877
  })), open && variant === 'month-year' ? /*#__PURE__*/React__default.createElement(MonthYearPickerDialogueAndroid, {
14878
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
14864
14879
  value: value,
14865
14880
  minimumDate: minDate,
14866
14881
  maximumDate: maxDate,
@@ -15105,6 +15120,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
15105
15120
  value: value,
15106
15121
  locale: locale,
15107
15122
  minimumDate: minDate,
15123
+ textColor: theme.colors.onDefaultGlobalSurface,
15108
15124
  maximumDate: maxDate,
15109
15125
  onChange: function onChange(date) {
15110
15126
  if (date) {
package/lib/index.js CHANGED
@@ -2007,7 +2007,10 @@ var swagDarkBrandSystemPalette = {
2007
2007
  decorativePrimary: palette$2.maasstrichtBlue,
2008
2008
  decorativePrimarySurface: palette$2.maasstrichtBlueLight10
2009
2009
  };
2010
- var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette);
2010
+ var swagDarkSystemPalette = _objectSpread2(_objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette), {}, {
2011
+ // Theme Mode
2012
+ themeMode: 'dark'
2013
+ });
2011
2014
 
2012
2015
  var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1), {}, {
2013
2016
  onDefaultGlobalSurface: palette$3.offBlack,
@@ -2695,12 +2698,14 @@ var getCardTheme = function getCardTheme(theme) {
2695
2698
  var colors = {
2696
2699
  dataCardIndicator: theme.colors.primary,
2697
2700
  primary: theme.colors.primary,
2701
+ secondary: theme.colors.highlightedSurface,
2698
2702
  info: theme.colors.info,
2699
2703
  success: theme.colors.success,
2700
2704
  warning: theme.colors.warning,
2701
2705
  danger: theme.colors.error,
2702
2706
  archived: theme.colors.archived,
2703
- neutral: theme.colors.neutralGlobalSurface
2707
+ neutral: theme.colors.neutralGlobalSurface,
2708
+ dataCardBackground: theme.colors.neutralGlobalSurface
2704
2709
  };
2705
2710
  var sizes = {
2706
2711
  indicatorWidth: theme.sizes.medium
@@ -3069,6 +3074,7 @@ var getIconTheme = function getIconTheme(theme) {
3069
3074
  muted: theme.colors.mutedOnDefaultGlobalSurface
3070
3075
  };
3071
3076
  var sizes = {
3077
+ xxxsmall: theme.fontSizes.small,
3072
3078
  xsmall: theme.fontSizes.large,
3073
3079
  small: theme.fontSizes.xxlarge,
3074
3080
  medium: theme.fontSizes.xxxlarge,
@@ -4217,7 +4223,9 @@ var getTheme$1 = function getTheme() {
4217
4223
  var scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : scale$1;
4218
4224
  var systemPallete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : swagSystemPalette$1;
4219
4225
  var globalTheme = getGlobalTheme(scale, systemPallete);
4220
- return _objectSpread2(_objectSpread2({}, globalTheme), {}, {
4226
+ return _objectSpread2(_objectSpread2({
4227
+ themeMode: systemPallete.themeMode
4228
+ }, globalTheme), {}, {
4221
4229
  __hd__: {
4222
4230
  accordion: getAccordionTheme(globalTheme),
4223
4231
  alert: getAlertTheme(globalTheme),
@@ -13300,6 +13308,7 @@ var CalendarRange = function CalendarRange(_ref) {
13300
13308
  isCurrentMonth: false
13301
13309
  });
13302
13310
  })), reactNative.Platform.OS === 'android' && monthPickerVisible && /*#__PURE__*/React__namespace.default.createElement(reactNativeMonthYearPicker.MonthYearPickerDialogueAndroid, {
13311
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
13303
13312
  doneButtonLabel: monthPickerConfirmLabel,
13304
13313
  cancelButtonLabel: monthPickerCancelLabel,
13305
13314
  value: value === null || value === void 0 ? void 0 : value.startDate,
@@ -13435,6 +13444,7 @@ var Calendar = function Calendar(_ref) {
13435
13444
  minimumDate: minDate,
13436
13445
  maximumDate: maxDate,
13437
13446
  onChange: onMonthChange,
13447
+ textColor: theme.colors.onDefaultGlobalSurface,
13438
13448
  style: {
13439
13449
  height: contentHeight + theme.__hd__.calendar.space.iosPickerMarginVertical * 2,
13440
13450
  marginVertical: -theme.__hd__.calendar.space.iosPickerMarginVertical,
@@ -13498,6 +13508,7 @@ var Calendar = function Calendar(_ref) {
13498
13508
  testID: "calendar-disabled-cell"
13499
13509
  });
13500
13510
  })), reactNative.Platform.OS === 'android' && monthPickerVisible && /*#__PURE__*/React__namespace.default.createElement(reactNativeMonthYearPicker.MonthYearPickerDialogueAndroid, {
13511
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
13501
13512
  doneButtonLabel: monthPickerConfirmLabel,
13502
13513
  cancelButtonLabel: monthPickerCancelLabel,
13503
13514
  value: value,
@@ -13521,7 +13532,8 @@ var StyledDataCard = index$a(reactNative.View)(function (_ref) {
13521
13532
  return {
13522
13533
  borderRadius: theme.__hd__.card.radii["default"],
13523
13534
  overflow: 'hidden',
13524
- flexDirection: 'row'
13535
+ flexDirection: 'row',
13536
+ backgroundColor: theme.__hd__.card.colors.dataCardBackground
13525
13537
  };
13526
13538
  });
13527
13539
  var Indicator = index$a(reactNative.View)(function (_ref2) {
@@ -13839,6 +13851,7 @@ var Image = function Image(_ref) {
13839
13851
  testID = _ref.testID,
13840
13852
  style = _ref.style,
13841
13853
  imageNativeProps = _objectWithoutProperties(_ref, _excluded$u);
13854
+ useDeprecation('Image component will soon be deprecated. Please use `Image` from `react-native` instead.');
13842
13855
  var theme = useTheme();
13843
13856
  var imageSize = theme.__hd__.image.sizes[size];
13844
13857
  return /*#__PURE__*/React__namespace.default.createElement(reactNative.Image, _extends$1({
@@ -14869,6 +14882,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
14869
14882
  onChange: _onChange,
14870
14883
  value: value
14871
14884
  });
14885
+ var theme = useTheme();
14872
14886
  return /*#__PURE__*/React__namespace.default.createElement(reactNative.TouchableOpacity, {
14873
14887
  onPress: function onPress() {
14874
14888
  return setOpen(true);
@@ -14889,6 +14903,7 @@ var DatePickerAndroid = function DatePickerAndroid(_ref) {
14889
14903
  style: style,
14890
14904
  testID: testID
14891
14905
  })), open && variant === 'month-year' ? /*#__PURE__*/React__namespace.default.createElement(reactNativeMonthYearPicker.MonthYearPickerDialogueAndroid, {
14906
+ themeVariant: theme.themeMode === 'dark' ? 'dark' : 'light',
14892
14907
  value: value,
14893
14908
  minimumDate: minDate,
14894
14909
  maximumDate: maxDate,
@@ -15133,6 +15148,7 @@ var DatePickerIOS = function DatePickerIOS(_ref) {
15133
15148
  value: value,
15134
15149
  locale: locale,
15135
15150
  minimumDate: minDate,
15151
+ textColor: theme.colors.onDefaultGlobalSurface,
15136
15152
  maximumDate: maxDate,
15137
15153
  onChange: function onChange(date) {
15138
15154
  if (date) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.89.0",
3
+ "version": "8.90.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -28,7 +28,7 @@
28
28
  "nanoid": "^5.0.9"
29
29
  },
30
30
  "peerDependencies": {
31
- "@hero-design/react-native-month-year-picker": "^8.42.11",
31
+ "@hero-design/react-native-month-year-picker": "^8.43.1",
32
32
  "@ptomasroos/react-native-multi-slider": "^2.2.2",
33
33
  "@react-native-community/datetimepicker": "^3.5.2 || ^7.6.1",
34
34
  "@react-native-community/slider": "^4.5.1",
@@ -52,7 +52,7 @@
52
52
  "@eslint/eslintrc": "^3.1.0",
53
53
  "@eslint/js": "^9.8.0",
54
54
  "@hero-design/eslint-plugin": "9.2.0",
55
- "@hero-design/react-native-month-year-picker": "^8.42.11",
55
+ "@hero-design/react-native-month-year-picker": "^8.43.1",
56
56
  "@ptomasroos/react-native-multi-slider": "^2.2.2",
57
57
  "@react-native-community/datetimepicker": "7.6.1",
58
58
  "@react-native-community/slider": "^4.5.1",
@@ -313,6 +313,7 @@ const CalendarRange = ({
313
313
 
314
314
  {Platform.OS === 'android' && monthPickerVisible && (
315
315
  <MonthYearPickerDialogueAndroid
316
+ themeVariant={theme.themeMode === 'dark' ? 'dark' : 'light'}
316
317
  doneButtonLabel={monthPickerConfirmLabel}
317
318
  cancelButtonLabel={monthPickerCancelLabel}
318
319
  value={value?.startDate}
@@ -252,6 +252,7 @@ const Calendar = ({
252
252
  minimumDate={minDate}
253
253
  maximumDate={maxDate}
254
254
  onChange={onMonthChange}
255
+ textColor={theme.colors.onDefaultGlobalSurface}
255
256
  style={{
256
257
  height:
257
258
  contentHeight +
@@ -334,6 +335,7 @@ const Calendar = ({
334
335
 
335
336
  {Platform.OS === 'android' && monthPickerVisible && (
336
337
  <MonthYearPickerDialogueAndroid
338
+ themeVariant={theme.themeMode === 'dark' ? 'dark' : 'light'}
337
339
  doneButtonLabel={monthPickerConfirmLabel}
338
340
  cancelButtonLabel={monthPickerCancelLabel}
339
341
  value={value}
@@ -5,6 +5,7 @@ const StyledDataCard = styled(View)(({ theme }) => ({
5
5
  borderRadius: theme.__hd__.card.radii.default,
6
6
  overflow: 'hidden',
7
7
  flexDirection: 'row',
8
+ backgroundColor: theme.__hd__.card.colors.dataCardBackground,
8
9
  }));
9
10
 
10
11
  const Indicator = styled(View)<{
@@ -276,6 +276,7 @@ exports[`StyledDataCard renders correctly 1`] = `
276
276
  style={
277
277
  [
278
278
  {
279
+ "backgroundColor": "#f6f6f7",
279
280
  "borderRadius": 12,
280
281
  "flexDirection": "row",
281
282
  "overflow": "hidden",
@@ -12,6 +12,7 @@ exports[`DataCard renders correctly when intent is archived 1`] = `
12
12
  style={
13
13
  [
14
14
  {
15
+ "backgroundColor": "#f6f6f7",
15
16
  "borderRadius": 12,
16
17
  "flexDirection": "row",
17
18
  "overflow": "hidden",
@@ -70,6 +71,7 @@ exports[`DataCard renders correctly when intent is danger 1`] = `
70
71
  style={
71
72
  [
72
73
  {
74
+ "backgroundColor": "#f6f6f7",
73
75
  "borderRadius": 12,
74
76
  "flexDirection": "row",
75
77
  "overflow": "hidden",
@@ -128,6 +130,7 @@ exports[`DataCard renders correctly when intent is info 1`] = `
128
130
  style={
129
131
  [
130
132
  {
133
+ "backgroundColor": "#f6f6f7",
131
134
  "borderRadius": 12,
132
135
  "flexDirection": "row",
133
136
  "overflow": "hidden",
@@ -186,6 +189,7 @@ exports[`DataCard renders correctly when intent is success 1`] = `
186
189
  style={
187
190
  [
188
191
  {
192
+ "backgroundColor": "#f6f6f7",
189
193
  "borderRadius": 12,
190
194
  "flexDirection": "row",
191
195
  "overflow": "hidden",
@@ -244,6 +248,7 @@ exports[`DataCard renders correctly when intent is warning 1`] = `
244
248
  style={
245
249
  [
246
250
  {
251
+ "backgroundColor": "#f6f6f7",
247
252
  "borderRadius": 12,
248
253
  "flexDirection": "row",
249
254
  "overflow": "hidden",
@@ -4,6 +4,7 @@ import styled from '@emotion/native';
4
4
  const StyledCard = styled(View)<{
5
5
  themeIntent?:
6
6
  | 'primary'
7
+ | 'secondary'
7
8
  | 'success'
8
9
  | 'warning'
9
10
  | 'danger'
@@ -132,7 +132,7 @@ exports[`Card renders correctly when intent is danger 1`] = `
132
132
  </View>
133
133
  `;
134
134
 
135
- exports[`Card renders correctly when intent is info 1`] = `
135
+ exports[`Card renders correctly when intent is neutral 1`] = `
136
136
  <View
137
137
  style={
138
138
  {
@@ -144,14 +144,14 @@ exports[`Card renders correctly when intent is info 1`] = `
144
144
  style={
145
145
  [
146
146
  {
147
- "backgroundColor": "#b5c3fd",
147
+ "backgroundColor": "#f6f6f7",
148
148
  "borderRadius": 12,
149
149
  "overflow": "hidden",
150
150
  },
151
151
  undefined,
152
152
  ]
153
153
  }
154
- themeIntent="info"
154
+ themeIntent="neutral"
155
155
  themeVariant="basic"
156
156
  >
157
157
  <Text
@@ -264,7 +264,7 @@ exports[`Card renders correctly when intent is primary 1`] = `
264
264
  </View>
265
265
  `;
266
266
 
267
- exports[`Card renders correctly when intent is subdued 1`] = `
267
+ exports[`Card renders correctly when intent is secondary 1`] = `
268
268
  <View
269
269
  style={
270
270
  {
@@ -276,13 +276,14 @@ exports[`Card renders correctly when intent is subdued 1`] = `
276
276
  style={
277
277
  [
278
278
  {
279
+ "backgroundColor": "#ece8ef",
279
280
  "borderRadius": 12,
280
281
  "overflow": "hidden",
281
282
  },
282
283
  undefined,
283
284
  ]
284
285
  }
285
- themeIntent="subdued"
286
+ themeIntent="secondary"
286
287
  themeVariant="basic"
287
288
  >
288
289
  <Text
@@ -458,3 +459,69 @@ exports[`Card renders correctly when intent is undefined 1`] = `
458
459
  />
459
460
  </View>
460
461
  `;
462
+
463
+ exports[`Card renders correctly when intent is warning 1`] = `
464
+ <View
465
+ style={
466
+ {
467
+ "flex": 1,
468
+ }
469
+ }
470
+ >
471
+ <View
472
+ style={
473
+ [
474
+ {
475
+ "backgroundColor": "#ffbe71",
476
+ "borderRadius": 12,
477
+ "overflow": "hidden",
478
+ },
479
+ undefined,
480
+ ]
481
+ }
482
+ themeIntent="warning"
483
+ themeVariant="basic"
484
+ >
485
+ <Text
486
+ allowFontScaling={false}
487
+ style={
488
+ [
489
+ {
490
+ "color": "#001f23",
491
+ "fontFamily": "BeVietnamPro-Regular",
492
+ "fontSize": 14,
493
+ "letterSpacing": 0.48,
494
+ "lineHeight": 22,
495
+ },
496
+ undefined,
497
+ ]
498
+ }
499
+ themeIntent="body"
500
+ themeTypeface="neutral"
501
+ themeVariant="small"
502
+ >
503
+ Card Content
504
+ </Text>
505
+ </View>
506
+ <View
507
+ pointerEvents="box-none"
508
+ position="bottom"
509
+ style={
510
+ [
511
+ {
512
+ "bottom": 0,
513
+ "elevation": 9999,
514
+ "flexDirection": "column-reverse",
515
+ "left": 0,
516
+ "paddingHorizontal": 24,
517
+ "paddingVertical": 16,
518
+ "position": "absolute",
519
+ "right": 0,
520
+ "top": 0,
521
+ },
522
+ undefined,
523
+ ]
524
+ }
525
+ />
526
+ </View>
527
+ `;
@@ -33,11 +33,12 @@ describe('Card', () => {
33
33
  intent
34
34
  ${undefined}
35
35
  ${'primary'}
36
+ ${'secondary'}
36
37
  ${'success'}
37
- ${'info'}
38
+ ${'warning'}
38
39
  ${'danger'}
39
40
  ${'archived'}
40
- ${'subdued'}
41
+ ${'neutral'}
41
42
  `('renders correctly when intent is $intent', ({ intent }) => {
42
43
  const { toJSON, getByText } = renderWithTheme(
43
44
  <Card intent={intent}>
@@ -14,6 +14,7 @@ export interface CardProps extends ViewProps {
14
14
  */
15
15
  intent?:
16
16
  | 'primary'
17
+ | 'secondary'
17
18
  | 'success'
18
19
  | 'warning'
19
20
  | 'danger'
@@ -7,6 +7,7 @@ import { MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-
7
7
  import TextInput from '../TextInput';
8
8
  import type { DatePickerProps } from './types';
9
9
  import useCalculateDate from './useCalculateDate';
10
+ import { useTheme } from '../../theme';
10
11
 
11
12
  type DatePickerAndroidProps = Omit<
12
13
  DatePickerProps,
@@ -35,6 +36,7 @@ const DatePickerAndroid = ({
35
36
  const pickerInitValue = value || new Date();
36
37
 
37
38
  useCalculateDate({ minDate, maxDate, onChange, value });
39
+ const theme = useTheme();
38
40
 
39
41
  return (
40
42
  <TouchableOpacity onPress={() => setOpen(true)} disabled={disabled}>
@@ -54,6 +56,7 @@ const DatePickerAndroid = ({
54
56
  </View>
55
57
  {open && variant === 'month-year' ? (
56
58
  <MonthYearPickerDialogueAndroid
59
+ themeVariant={theme.themeMode === 'dark' ? 'dark' : 'light'}
57
60
  value={value}
58
61
  minimumDate={minDate}
59
62
  maximumDate={maxDate}
@@ -86,6 +86,7 @@ const DatePickerIOS = ({
86
86
  value={value}
87
87
  locale={locale}
88
88
  minimumDate={minDate}
89
+ textColor={theme.colors.onDefaultGlobalSurface}
89
90
  maximumDate={maxDate}
90
91
  onChange={(date: Date | undefined) => {
91
92
  if (date) {
@@ -81,4 +81,8 @@ export interface DatePickerProps {
81
81
  * Locale for the date picker, iOS only.
82
82
  */
83
83
  locale?: string;
84
+ /**
85
+ * [Android only] autoTheme will automatically set the theme based on the device's light mode or dark mode.
86
+ * */
87
+ autoTheme?: boolean;
84
88
  }
@@ -2,7 +2,13 @@ import { createIconSet } from 'react-native-vector-icons';
2
2
  import styled from '@emotion/native';
3
3
  import glyphMap from './glyphMap.json';
4
4
 
5
- type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
5
+ type ThemeSize =
6
+ | 'xxxsmall'
7
+ | 'xsmall'
8
+ | 'small'
9
+ | 'medium'
10
+ | 'large'
11
+ | 'xlarge';
6
12
  type ThemeIntent =
7
13
  | 'text'
8
14
  | 'primary'
@@ -29,7 +29,7 @@ export interface IconProps extends AccessibilityProps {
29
29
  /**
30
30
  * Size of the Icon.
31
31
  */
32
- size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
32
+ size?: 'xxxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
33
33
  /**
34
34
  * Rotate icon with animation.
35
35
  */
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Image as RNImage } from 'react-native';
3
3
  import type { ImageProps as RNImageProps } from 'react-native';
4
4
  import { useTheme } from '../../theme';
5
+ import { useDeprecation } from '../../utils/hooks';
5
6
 
6
7
  export interface ImageProps extends RNImageProps {
7
8
  /**
@@ -25,6 +26,10 @@ const Image = ({
25
26
  style,
26
27
  ...imageNativeProps
27
28
  }: ImageProps): JSX.Element => {
29
+ useDeprecation(
30
+ 'Image component will soon be deprecated. Please use `Image` from `react-native` instead.'
31
+ );
32
+
28
33
  const theme = useTheme();
29
34
  const imageSize = theme.__hd__.image.sizes[size];
30
35
  return (
@@ -348,10 +348,12 @@ exports[`theme returns correct theme object 1`] = `
348
348
  "colors": {
349
349
  "archived": "#abacaf",
350
350
  "danger": "#f46363",
351
+ "dataCardBackground": "#f6f6f7",
351
352
  "dataCardIndicator": "#401960",
352
353
  "info": "#b5c3fd",
353
354
  "neutral": "#f6f6f7",
354
355
  "primary": "#401960",
356
+ "secondary": "#ece8ef",
355
357
  "success": "#5ace7d",
356
358
  "warning": "#ffbe71",
357
359
  },
@@ -683,6 +685,7 @@ exports[`theme returns correct theme object 1`] = `
683
685
  "small": 20,
684
686
  "xlarge": 32,
685
687
  "xsmall": 16,
688
+ "xxxsmall": 12,
686
689
  },
687
690
  },
688
691
  "image": {
@@ -1745,5 +1748,6 @@ exports[`theme returns correct theme object 1`] = `
1745
1748
  "xxxlarge": 48,
1746
1749
  "xxxxlarge": 56,
1747
1750
  },
1751
+ "themeMode": undefined,
1748
1752
  }
1749
1753
  `;
@@ -4,12 +4,14 @@ const getCardTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  dataCardIndicator: theme.colors.primary,
6
6
  primary: theme.colors.primary,
7
+ secondary: theme.colors.highlightedSurface,
7
8
  info: theme.colors.info,
8
9
  success: theme.colors.success,
9
10
  warning: theme.colors.warning,
10
11
  danger: theme.colors.error,
11
12
  archived: theme.colors.archived,
12
13
  neutral: theme.colors.neutralGlobalSurface,
14
+ dataCardBackground: theme.colors.neutralGlobalSurface,
13
15
  };
14
16
 
15
17
  const sizes = {