@hero-design/rn 8.65.1 → 8.66.0

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.
@@ -1,8 +1,8 @@
1
- (node:2923) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
1
+ (node:2991) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
- (node:2923) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
3
+ (node:2991) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
4
4
  
5
5
  src/index.ts → lib/index.js, es/index.js...
6
6
  (!) [plugin replace] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
7
  (!) [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.
8
- created lib/index.js, es/index.js in 51.3s
8
+ created lib/index.js, es/index.js in 50.1s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hero-design/rn
2
2
 
3
+ ## 8.66.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3385](https://github.com/Thinkei/hero-design/pull/3385) [`e056fd3ba0867e2879153306e5b9d10a935a590f`](https://github.com/Thinkei/hero-design/commit/e056fd3ba0867e2879153306e5b9d10a935a590f) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Card] Add neutral intent
8
+
3
9
  ## 8.65.1
4
10
 
5
11
  ### Patch Changes
package/es/index.js CHANGED
@@ -2466,7 +2466,8 @@ var getCardTheme = function getCardTheme(theme) {
2466
2466
  success: theme.colors.success,
2467
2467
  warning: theme.colors.warning,
2468
2468
  danger: theme.colors.error,
2469
- archived: theme.colors.archived
2469
+ archived: theme.colors.archived,
2470
+ neutral: theme.colors.neutralGlobalSurface
2470
2471
  };
2471
2472
  var sizes = {
2472
2473
  indicatorWidth: theme.sizes.medium
package/lib/index.js CHANGED
@@ -2493,7 +2493,8 @@ var getCardTheme = function getCardTheme(theme) {
2493
2493
  success: theme.colors.success,
2494
2494
  warning: theme.colors.warning,
2495
2495
  danger: theme.colors.error,
2496
- archived: theme.colors.archived
2496
+ archived: theme.colors.archived,
2497
+ neutral: theme.colors.neutralGlobalSurface
2497
2498
  };
2498
2499
  var sizes = {
2499
2500
  indicatorWidth: theme.sizes.medium
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.65.1",
3
+ "version": "8.66.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -2,7 +2,13 @@ import { View } from 'react-native';
2
2
  import styled from '@emotion/native';
3
3
 
4
4
  const StyledCard = styled(View)<{
5
- themeIntent?: 'primary' | 'success' | 'warning' | 'danger' | 'archived';
5
+ themeIntent?:
6
+ | 'primary'
7
+ | 'success'
8
+ | 'warning'
9
+ | 'danger'
10
+ | 'archived'
11
+ | 'neutral';
6
12
  }>(({ theme, themeIntent }) => ({
7
13
  ...(themeIntent !== undefined && {
8
14
  backgroundColor: theme.__hd__.card.colors[themeIntent],
@@ -260,6 +260,70 @@ exports[`Card renders correctly when intent is primary 1`] = `
260
260
  </View>
261
261
  `;
262
262
 
263
+ exports[`Card renders correctly when intent is subdued 1`] = `
264
+ <View
265
+ style={
266
+ {
267
+ "flex": 1,
268
+ }
269
+ }
270
+ >
271
+ <View
272
+ style={
273
+ [
274
+ {
275
+ "borderRadius": 12,
276
+ "overflow": "hidden",
277
+ },
278
+ undefined,
279
+ ]
280
+ }
281
+ themeIntent="subdued"
282
+ >
283
+ <Text
284
+ allowFontScaling={false}
285
+ style={
286
+ [
287
+ {
288
+ "color": "#001f23",
289
+ "fontFamily": "BeVietnamPro-Regular",
290
+ "fontSize": 14,
291
+ "letterSpacing": 0.48,
292
+ "lineHeight": 22,
293
+ },
294
+ undefined,
295
+ ]
296
+ }
297
+ themeIntent="body"
298
+ themeTypeface="neutral"
299
+ themeVariant="small"
300
+ >
301
+ Card Content
302
+ </Text>
303
+ </View>
304
+ <View
305
+ pointerEvents="box-none"
306
+ position="bottom"
307
+ style={
308
+ [
309
+ {
310
+ "bottom": 0,
311
+ "elevation": 9999,
312
+ "flexDirection": "column-reverse",
313
+ "left": 0,
314
+ "paddingHorizontal": 24,
315
+ "paddingVertical": 16,
316
+ "position": "absolute",
317
+ "right": 0,
318
+ "top": 0,
319
+ },
320
+ undefined,
321
+ ]
322
+ }
323
+ />
324
+ </View>
325
+ `;
326
+
263
327
  exports[`Card renders correctly when intent is success 1`] = `
264
328
  <View
265
329
  style={
@@ -25,6 +25,7 @@ describe('Card', () => {
25
25
  ${'info'}
26
26
  ${'danger'}
27
27
  ${'archived'}
28
+ ${'subdued'}
28
29
  `('renders correctly when intent is $intent', ({ intent }) => {
29
30
  const { toJSON, getByText } = renderWithTheme(
30
31
  <Card intent={intent}>
@@ -12,7 +12,13 @@ export interface CardProps extends ViewProps {
12
12
  /**
13
13
  * Visual intent color to apply to card.
14
14
  */
15
- intent?: 'primary' | 'success' | 'warning' | 'danger' | 'archived';
15
+ intent?:
16
+ | 'primary'
17
+ | 'success'
18
+ | 'warning'
19
+ | 'danger'
20
+ | 'archived'
21
+ | 'neutral';
16
22
  /**
17
23
  * Additional style.
18
24
  */
@@ -273,6 +273,7 @@ exports[`theme returns correct theme object 1`] = `
273
273
  "danger": "#f46363",
274
274
  "dataCardIndicator": "#401960",
275
275
  "info": "#b5c3fd",
276
+ "neutral": "#f6f6f7",
276
277
  "primary": "#401960",
277
278
  "success": "#5ace7d",
278
279
  "warning": "#ffbe71",
@@ -9,6 +9,7 @@ const getCardTheme = (theme: GlobalTheme) => {
9
9
  warning: theme.colors.warning,
10
10
  danger: theme.colors.error,
11
11
  archived: theme.colors.archived,
12
+ neutral: theme.colors.neutralGlobalSurface,
12
13
  };
13
14
 
14
15
  const sizes = {