@hero-design/rn-work-uikit 1.6.5-alpha.0 → 1.6.5-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @hero-design/rn-work-uikit
2
2
 
3
+ ## 1.6.5-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4123](https://github.com/Thinkei/hero-design/pull/4123) [`ecc5905dec81783858f57595a0af4306ff3b0b89`](https://github.com/Thinkei/hero-design/commit/ecc5905dec81783858f57595a0af4306ff3b0b89) Thanks [@truongnguyen-eh](https://github.com/truongnguyen-eh)! - [ANG-3740] Resolve conflict between alpha and master-react-18
8
+
9
+ - Updated dependencies [[`e92d1dab57316441e7b5054debe823328e1a1083`](https://github.com/Thinkei/hero-design/commit/e92d1dab57316441e7b5054debe823328e1a1083), [`ecc5905dec81783858f57595a0af4306ff3b0b89`](https://github.com/Thinkei/hero-design/commit/ecc5905dec81783858f57595a0af4306ff3b0b89)]:
10
+ - @hero-design/rn@8.105.4-alpha.1
11
+
3
12
  ## 1.6.5-alpha.0
4
13
 
5
14
  ### Patch Changes
package/lib/index.js CHANGED
@@ -6397,14 +6397,15 @@ var getErrorTheme = function getErrorTheme(theme) {
6397
6397
  imageMarginBottom: theme.space.large,
6398
6398
  wrapperPadding: theme.space.large,
6399
6399
  button: {
6400
- wrapperHorizontalPadding: theme.space.medium,
6400
+ wrapperHorizontalPadding: theme.space.large,
6401
6401
  wrapperVerticalPadding: theme.space.xxxlarge,
6402
6402
  margin: theme.space.medium,
6403
6403
  padding: theme.space.medium
6404
6404
  }
6405
6405
  };
6406
6406
  var sizes = {
6407
- image: theme.sizes['19xlarge']
6407
+ image: theme.sizes['6xlarge'],
6408
+ icon: theme.sizes['6xlarge']
6408
6409
  };
6409
6410
  var colors = {
6410
6411
  title: theme.colors.onDefaultGlobalSurface,
@@ -6922,14 +6923,16 @@ var getSuccessTheme = function getSuccessTheme(theme) {
6922
6923
  imageMarginBottom: theme.space.xlarge,
6923
6924
  wrapperPadding: theme.space.large,
6924
6925
  button: {
6925
- wrapperHorizontalPadding: theme.space.medium,
6926
+ wrapperHorizontalPadding: theme.space.large,
6926
6927
  wrapperVerticalPadding: theme.space.xxxlarge,
6927
6928
  margin: theme.space.medium,
6928
- padding: theme.space.medium
6929
+ padding: theme.space.medium,
6930
+ secondaryCTAMarginTop: theme.space.medium
6929
6931
  }
6930
6932
  };
6931
6933
  var sizes = {
6932
- image: theme.sizes['19xlarge']
6934
+ image: theme.sizes['19xlarge'],
6935
+ icon: theme.sizes['6xlarge']
6933
6936
  };
6934
6937
  var colors = {
6935
6938
  title: theme.colors.onDefaultGlobalSurface,
@@ -23661,8 +23664,17 @@ var StyledErrorImageContainer = index$b(reactNative.View)(function (_ref6) {
23661
23664
  alignItems: 'center'
23662
23665
  };
23663
23666
  });
23664
- var StyledErrorImage = index$b(Image)(function (_ref7) {
23667
+ var StyledErrorIconContainer = index$b(reactNative.View)(function (_ref7) {
23665
23668
  var theme = _ref7.theme;
23669
+ return {
23670
+ marginBottom: theme.__hd__.error.space.imageMarginBottom,
23671
+ width: theme.__hd__.error.sizes.icon,
23672
+ height: theme.__hd__.error.sizes.icon,
23673
+ alignItems: 'center'
23674
+ };
23675
+ });
23676
+ var StyledErrorImage = index$b(Image)(function (_ref8) {
23677
+ var theme = _ref8.theme;
23666
23678
  return {
23667
23679
  marginBottom: theme.__hd__.error.space.imageMarginBottom,
23668
23680
  width: theme.__hd__.error.sizes.image,
@@ -23670,16 +23682,16 @@ var StyledErrorImage = index$b(Image)(function (_ref7) {
23670
23682
  resizeMode: 'contain'
23671
23683
  };
23672
23684
  });
23673
- var StyledErrorTitle = index$b(Typography.Title)(function (_ref8) {
23674
- var theme = _ref8.theme;
23685
+ var StyledErrorTitle = index$b(Typography.Title)(function (_ref9) {
23686
+ var theme = _ref9.theme;
23675
23687
  return {
23676
23688
  textAlign: 'center',
23677
23689
  marginBottom: theme.__hd__.error.space.titleMarginBottom,
23678
23690
  color: theme.__hd__.error.colors.title
23679
23691
  };
23680
23692
  });
23681
- var StyledErrorDescription = index$b(Typography.Body)(function (_ref9) {
23682
- var theme = _ref9.theme;
23693
+ var StyledErrorDescription = index$b(Typography.Body)(function (_ref10) {
23694
+ var theme = _ref10.theme;
23683
23695
  return {
23684
23696
  textAlign: 'center',
23685
23697
  color: theme.__hd__.error.colors.description
@@ -23705,7 +23717,7 @@ var renderImageOrIcon$1 = function renderImageOrIcon(_ref) {
23705
23717
  var image = _ref.image,
23706
23718
  icon = _ref.icon;
23707
23719
  if (icon) {
23708
- return /*#__PURE__*/React__namespace.default.createElement(StyledErrorImageContainer, null, /*#__PURE__*/React__namespace.default.createElement(StatusIcon, {
23720
+ return /*#__PURE__*/React__namespace.default.createElement(StyledErrorIconContainer, null, /*#__PURE__*/React__namespace.default.createElement(StatusIcon, {
23709
23721
  icon: icon,
23710
23722
  testID: "error-icon"
23711
23723
  }));
@@ -26198,23 +26210,32 @@ var StyledSuccessImageContainer = index$b(reactNative.View)(function (_ref4) {
26198
26210
  alignItems: 'center'
26199
26211
  };
26200
26212
  });
26201
- var StyledSuccessTitle = index$b(Typography.Title)(function (_ref5) {
26213
+ var StyledSuccessIconContainer = index$b(reactNative.View)(function (_ref5) {
26202
26214
  var theme = _ref5.theme;
26215
+ return {
26216
+ marginBottom: theme.__hd__.success.space.imageMarginBottom,
26217
+ width: theme.__hd__.success.sizes.icon,
26218
+ height: theme.__hd__.success.sizes.icon,
26219
+ alignItems: 'center'
26220
+ };
26221
+ });
26222
+ var StyledSuccessTitle = index$b(Typography.Title)(function (_ref6) {
26223
+ var theme = _ref6.theme;
26203
26224
  return {
26204
26225
  textAlign: 'center',
26205
26226
  marginBottom: theme.__hd__.success.space.titleMarginBottom,
26206
26227
  color: theme.__hd__.success.colors.title
26207
26228
  };
26208
26229
  });
26209
- var StyledSuccessDescription = index$b(Typography.Body)(function (_ref6) {
26210
- var theme = _ref6.theme;
26230
+ var StyledSuccessDescription = index$b(Typography.Body)(function (_ref7) {
26231
+ var theme = _ref7.theme;
26211
26232
  return {
26212
26233
  textAlign: 'center',
26213
26234
  color: theme.__hd__.success.colors.description
26214
26235
  };
26215
26236
  });
26216
- var StyledSuccessButtonContainer = index$b(reactNative.View)(function (_ref7) {
26217
- var theme = _ref7.theme;
26237
+ var StyledSuccessButtonContainer = index$b(reactNative.View)(function (_ref8) {
26238
+ var theme = _ref8.theme;
26218
26239
  return {
26219
26240
  display: 'flex',
26220
26241
  flexDirection: 'column',
@@ -26224,12 +26245,19 @@ var StyledSuccessButtonContainer = index$b(reactNative.View)(function (_ref7) {
26224
26245
  paddingVertical: theme.__hd__.success.space.button.wrapperVerticalPadding
26225
26246
  };
26226
26247
  });
26227
- var StyledSuccessButtonPrimary = index$b(CompoundButton)(function (_ref8) {
26228
- var theme = _ref8.theme;
26248
+ var StyledSuccessButtonPrimary = index$b(CompoundButton)(function (_ref9) {
26249
+ var theme = _ref9.theme;
26229
26250
  return {
26230
26251
  padding: theme.__hd__.success.space.button.padding
26231
26252
  };
26232
26253
  });
26254
+ var StyledSuccessButtonSecondary = index$b(CompoundButton)(function (_ref10) {
26255
+ var theme = _ref10.theme;
26256
+ return {
26257
+ padding: theme.__hd__.success.space.button.padding,
26258
+ marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop
26259
+ };
26260
+ });
26233
26261
  var StyledSuccessModal = index$b(ModalWrapper)({
26234
26262
  height: '100%',
26235
26263
  width: '100%'
@@ -26253,7 +26281,7 @@ var renderImageOrIcon = function renderImageOrIcon(_ref) {
26253
26281
  var image = _ref.image,
26254
26282
  icon = _ref.icon;
26255
26283
  if (icon) {
26256
- return /*#__PURE__*/React__namespace.default.createElement(StyledSuccessImageContainer, null, /*#__PURE__*/React__namespace.default.createElement(StatusIcon, {
26284
+ return /*#__PURE__*/React__namespace.default.createElement(StyledSuccessIconContainer, null, /*#__PURE__*/React__namespace.default.createElement(StatusIcon, {
26257
26285
  icon: icon,
26258
26286
  testID: "success-icon"
26259
26287
  }));
@@ -26290,7 +26318,7 @@ var SuccessPage = function SuccessPage(_ref2) {
26290
26318
  }, title), typeof description === 'string' ? /*#__PURE__*/React__namespace.default.createElement(StyledSuccessDescription, null, description) : description), !!ctaText && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonPrimary, {
26291
26319
  text: ctaText,
26292
26320
  onPress: onCtaPress
26293
- }), !!showSecondaryButton && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonPrimary, {
26321
+ }), !!showSecondaryButton && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonSecondary, {
26294
26322
  variant: "text",
26295
26323
  text: secondaryCtaText,
26296
26324
  onPress: onSecondaryCtaPress
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn-work-uikit",
3
- "version": "1.6.5-alpha.0",
3
+ "version": "1.6.5-alpha.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -23,7 +23,7 @@
23
23
  "@emotion/native": "^11.9.3",
24
24
  "@emotion/primitives-core": "11.0.0",
25
25
  "@emotion/react": "^11.9.3",
26
- "@hero-design/rn": "^8.105.4-alpha.0",
26
+ "@hero-design/rn": "^8.105.4-alpha.1",
27
27
  "hero-editor": "^1.15.5"
28
28
  },
29
29
  "peerDependencies": {
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import {
3
- DatePicker as InternalDatePicker,
4
- DatePickerProps,
5
- } from '@hero-design/rn';
2
+ import type { DatePickerProps } from '@hero-design/rn';
3
+ import { DatePicker as InternalDatePicker } from '@hero-design/rn';
6
4
  import TextInput from '../TextInput';
7
5
 
8
6
  const DatePicker = (props: DatePickerProps) => {
@@ -1,5 +1,7 @@
1
- import React, { ReactElement, ReactNode, useMemo } from 'react';
2
- import { StyleProp, StyleSheet, ViewProps, ViewStyle } from 'react-native';
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import React, { useMemo } from 'react';
3
+ import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
4
+ import { StyleSheet } from 'react-native';
3
5
  import { Box, useTheme } from '@hero-design/rn';
4
6
  import { generateBorderStyle, generateMarginStyle } from './utils';
5
7
 
@@ -1,5 +1,5 @@
1
- import { CSSProperties } from 'react';
2
- import { Theme } from '@hero-design/rn';
1
+ import type { CSSProperties } from 'react';
2
+ import type { Theme } from '@hero-design/rn';
3
3
 
4
4
  /**
5
5
  * Generates the border style for the TextInputGroup.
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import type { ComponentType } from 'react';
3
- import { Icon, IconProps } from '@hero-design/rn';
3
+ import type { IconProps } from '@hero-design/rn';
4
+ import { Icon } from '@hero-design/rn';
4
5
  import { ToolbarEvents } from './constants';
5
6
  import { emitter } from './EditorEvent';
6
7
  import {
@@ -8,7 +9,7 @@ import {
8
9
  StyledToolbar,
9
10
  StyledToolbarButton,
10
11
  } from './StyledToolbar';
11
- import { ToolbarButtonName } from './types';
12
+ import type { ToolbarButtonName } from './types';
12
13
  import * as Events from './utils/events';
13
14
 
14
15
  type ToolbarButtonProps = {
@@ -9,7 +9,7 @@ import React, {
9
9
  useState,
10
10
  } from 'react';
11
11
  import type { Ref } from 'react';
12
- import { WebView } from 'react-native-webview';
12
+ import type { WebView } from 'react-native-webview';
13
13
 
14
14
  import { View } from 'react-native';
15
15
  import { isAndroid } from '../../utils/helpers';
@@ -26,7 +26,7 @@ import {
26
26
  import type { WebViewEventMessage } from './utils/rnWebView';
27
27
  import { useTheme } from '../../theme';
28
28
  import { StyledWebView } from './StyledRichTextEditor';
29
- import { TextInputRef } from '../TextInput/types';
29
+ import type { TextInputRef } from '../TextInput/types';
30
30
 
31
31
  const RichTextEditorInput = forwardRef<
32
32
  TextInputRef,
@@ -1,5 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
- import RichTextEditor, { RichTextEditorRef } from './RichTextEditor';
2
+ import type { RichTextEditorRef } from './RichTextEditor';
3
+ import RichTextEditor from './RichTextEditor';
3
4
  import MentionList from './MentionList';
4
5
  import type { RichTextEditorProps } from './types';
5
6
 
@@ -1,6 +1,6 @@
1
1
  import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
2
2
 
3
- import { Ref } from 'react';
3
+ import type { Ref } from 'react';
4
4
  import type { TextInputProps } from '../TextInput';
5
5
 
6
6
  export type ToolbarButtonName =
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from 'events';
1
+ import type { EventEmitter } from 'events';
2
2
 
3
3
  export interface Listener<T> {
4
4
  (data: T): void;
@@ -1,4 +1,4 @@
1
- import WebView from 'react-native-webview';
1
+ import type WebView from 'react-native-webview';
2
2
 
3
3
  export const requestBlurEditor = (element: WebView): void => {
4
4
  element.injectJavaScript(
@@ -1,9 +1,9 @@
1
- import {
2
- Select as InternalSelect,
1
+ import type {
3
2
  MultiSelectProps,
4
3
  SelectOptionType,
5
4
  SingleSelectProps,
6
5
  } from '@hero-design/rn';
6
+ import { Select as InternalSelect } from '@hero-design/rn';
7
7
  import React from 'react';
8
8
  import TextInput from '../TextInput';
9
9
 
@@ -1,5 +1,5 @@
1
1
  import React, { useImperativeHandle, useRef } from 'react';
2
- import {
2
+ import type {
3
3
  TextInput as RNTextInput,
4
4
  TextInputProps as RNTextInputProps,
5
5
  } from 'react-native';
@@ -4,7 +4,7 @@ import type {
4
4
  NativeSyntheticEvent,
5
5
  TextInputFocusEventData,
6
6
  } from 'react-native';
7
- import { IconName } from '@hero-design/rn';
7
+ import type { IconName } from '@hero-design/rn';
8
8
  import { StyledInputRow } from './StyledTextInput';
9
9
  import PrefixComponent from './PrefixComponent';
10
10
  import InputComponent from './InputComponent';
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import { Icon, IconName } from '@hero-design/rn';
3
- import { View, ViewProps } from 'react-native';
2
+ import type { IconName } from '@hero-design/rn';
3
+ import { Icon } from '@hero-design/rn';
4
+ import type { ViewProps } from 'react-native';
5
+ import { View } from 'react-native';
4
6
  import { StyledPrefixComponentWrapper, type State } from './StyledTextInput';
5
7
 
6
8
  export interface PrefixComponentProps extends ViewProps {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { Icon, IconName } from '@hero-design/rn';
2
+ import type { IconName } from '@hero-design/rn';
3
+ import { Icon } from '@hero-design/rn';
3
4
  import type { State } from './StyledTextInput';
4
5
 
5
6
  export interface SuffixComponentProps {
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
- import { Text, TextInput as RNTextInput } from 'react-native';
3
- import type { TextInputProps as NativeTextInputProps } from 'react-native';
2
+ import { Text } from 'react-native';
3
+ import type {
4
+ TextInputProps as NativeTextInputProps,
5
+ TextInput as RNTextInput,
6
+ } from 'react-native';
4
7
  import { fireEvent, waitFor } from '@testing-library/react-native';
5
8
  // import { TextInput as RNTextInput } from 'react-native';
6
9
  import renderWithTheme from '../../../../testUtils/renderWithTheme';
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import { act, fireEvent, waitFor, within } from '@testing-library/react-native';
3
- import {
3
+ import type {
4
4
  TextInput as RNTextInput,
5
5
  ViewStyle,
6
6
  StyleProp,
7
- StyleSheet,
8
7
  } from 'react-native';
8
+ import { StyleSheet } from 'react-native';
9
9
  import { Icon } from '@hero-design/rn';
10
10
  import { theme } from '../../..';
11
11
  import renderWithTheme from '../../../../testUtils/renderWithTheme';
12
- import TextInput, { TextInputHandles } from '../index';
12
+ import type { TextInputHandles } from '../index';
13
+ import TextInput from '../index';
13
14
 
14
15
  describe('TextInput', () => {
15
16
  describe('when user sees an empty input field', () => {
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import {
3
- TimePicker as InternalTimePicker,
4
- TimePickerProps,
5
- } from '@hero-design/rn';
2
+ import type { TimePickerProps } from '@hero-design/rn';
3
+ import { TimePicker as InternalTimePicker } from '@hero-design/rn';
6
4
  import TextInput from '../TextInput';
7
5
 
8
6
  const TimePicker = (props: TimePickerProps) => {
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  import { ThemeProvider as BaseThemeProvider, useTheme } from '@hero-design/rn';
3
3
  import type { Theme } from './getTheme';
4
4
 
@@ -1,4 +1,5 @@
1
- import React, { PropsWithChildren, useMemo } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ import React, { useMemo } from 'react';
2
3
 
3
4
  import {
4
5
  eBensSystemPalette,
@@ -628,13 +628,14 @@ exports[`theme returns correct theme object 1`] = `
628
628
  "title": 31.53846153846154,
629
629
  },
630
630
  "sizes": {
631
- "image": 172.6153846153846,
631
+ "icon": 70.61538461538461,
632
+ "image": 70.61538461538461,
632
633
  },
633
634
  "space": {
634
635
  "button": {
635
636
  "margin": 15.692307692307693,
636
637
  "padding": 15.692307692307693,
637
- "wrapperHorizontalPadding": 15.692307692307693,
638
+ "wrapperHorizontalPadding": 23.53846153846154,
638
639
  "wrapperVerticalPadding": 47.07692307692308,
639
640
  },
640
641
  "imageMarginBottom": 23.53846153846154,
@@ -1307,13 +1308,15 @@ exports[`theme returns correct theme object 1`] = `
1307
1308
  "title": "Saiga-Medium",
1308
1309
  },
1309
1310
  "sizes": {
1311
+ "icon": 70.61538461538461,
1310
1312
  "image": 172.6153846153846,
1311
1313
  },
1312
1314
  "space": {
1313
1315
  "button": {
1314
1316
  "margin": 15.692307692307693,
1315
1317
  "padding": 15.692307692307693,
1316
- "wrapperHorizontalPadding": 15.692307692307693,
1318
+ "secondaryCTAMarginTop": 15.692307692307693,
1319
+ "wrapperHorizontalPadding": 23.53846153846154,
1317
1320
  "wrapperVerticalPadding": 47.07692307692308,
1318
1321
  },
1319
1322
  "imageMarginBottom": 31.384615384615387,
@@ -1,9 +1,5 @@
1
- import {
2
- getTheme as getBaseTheme,
3
- Theme as BaseTheme,
4
- swagSystemPalette,
5
- } from '@hero-design/rn';
6
- import type { Scale, SystemPalette } from '@hero-design/rn';
1
+ import { getTheme as getBaseTheme, swagSystemPalette } from '@hero-design/rn';
2
+ import type { Scale, SystemPalette, Theme as BaseTheme } from '@hero-design/rn';
7
3
  import getTextInputTheme from './components/textInput';
8
4
 
9
5
  // Work-specific theme type that includes textInput overrides