@hero-design/rn 8.34.2-alpha.0 → 8.35.0-alpha.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.
Files changed (33) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +18 -7
  3. package/es/index.js +11417 -2305
  4. package/lib/index.js +11418 -2305
  5. package/package.json +6 -6
  6. package/rollup.config.js +3 -7
  7. package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  8. package/src/components/FAB/ActionGroup/FABModal.tsx +63 -0
  9. package/src/components/FAB/ActionGroup/FABModalContentWrapper.tsx +31 -0
  10. package/src/components/FAB/ActionGroup/ModalPresenter/ModalPresenter.tsx +133 -0
  11. package/src/components/FAB/ActionGroup/ModalPresenter/index.tsx +13 -0
  12. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  13. package/src/components/FAB/ActionGroup/index.tsx +49 -47
  14. package/src/components/FAB/FAB.tsx +1 -0
  15. package/src/components/FAB/StyledFAB.tsx +20 -16
  16. package/src/components/FAB/__tests__/StyledFAB.spec.tsx +11 -1
  17. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +57 -0
  18. package/src/components/List/StyledListItem.tsx +1 -1
  19. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +4 -0
  20. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -0
  21. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -1
  22. package/src/theme/components/fab.ts +1 -0
  23. package/src/theme/components/list.ts +1 -1
  24. package/src/theme/global/colors/__tests__/__snapshots__/work.spec.ts.snap +4 -4
  25. package/src/theme/global/colors/work.ts +4 -4
  26. package/types/components/FAB/ActionGroup/FABModal.d.ts +21 -0
  27. package/types/components/FAB/ActionGroup/FABModalContentWrapper.d.ts +18 -0
  28. package/types/components/FAB/ActionGroup/FABProvider.d.ts +5 -0
  29. package/types/components/FAB/ActionGroup/ModalPresenter/ModalPresenter.d.ts +34 -0
  30. package/types/components/FAB/ActionGroup/ModalPresenter/index.d.ts +3 -0
  31. package/types/components/FAB/StyledFAB.d.ts +2 -0
  32. package/types/theme/components/fab.d.ts +1 -0
  33. package/types/theme/components/list.d.ts +1 -1
@@ -19,6 +19,7 @@ const StyledListItemContainer = styled(TouchableHighlight)<{
19
19
  ? theme.__hd__.list.colors.checkedListItemContainerBackground
20
20
  : theme.__hd__.list.colors.listItemContainerBackground,
21
21
  padding: theme.__hd__.list.space.listItemContainerPadding,
22
+ borderRadius: theme.__hd__.list.radii.item,
22
23
  };
23
24
 
24
25
  switch (themeVariant) {
@@ -28,7 +29,6 @@ const StyledListItemContainer = styled(TouchableHighlight)<{
28
29
  return {
29
30
  ...sharedStyles,
30
31
  alignItems: 'center',
31
- borderRadius: theme.__hd__.list.radii.card,
32
32
  shadowColor: theme.colors.secondaryOutline,
33
33
  shadowRadius: theme.__hd__.list.radii.cardShadow,
34
34
  shadowOffset: theme.__hd__.list.shadows.cardOffset,
@@ -20,6 +20,7 @@ exports[`ListItem renders correctly ListItem with children 1`] = `
20
20
  Array [
21
21
  Object {
22
22
  "backgroundColor": "#ffffff",
23
+ "borderRadius": 8,
23
24
  "flexDirection": "row",
24
25
  "padding": 16,
25
26
  },
@@ -346,6 +347,7 @@ exports[`ListItem renders correctly ListItem with icon 1`] = `
346
347
  Array [
347
348
  Object {
348
349
  "backgroundColor": "#ffffff",
350
+ "borderRadius": 8,
349
351
  "flexDirection": "row",
350
352
  "padding": 16,
351
353
  },
@@ -474,6 +476,7 @@ exports[`ListItem renders correctly ListItem with leading status 1`] = `
474
476
  Array [
475
477
  Object {
476
478
  "backgroundColor": "#ffffff",
479
+ "borderRadius": 8,
477
480
  "flexDirection": "row",
478
481
  "padding": 16,
479
482
  },
@@ -597,6 +600,7 @@ exports[`ListItem renders correctly ListItem with prefix suffix is React.Element
597
600
  Array [
598
601
  Object {
599
602
  "backgroundColor": "#ffffff",
603
+ "borderRadius": 8,
600
604
  "flexDirection": "row",
601
605
  "padding": 16,
602
606
  },
@@ -155,6 +155,7 @@ exports[`ListItemContainer renders correctly themeSelected false themeVariant fu
155
155
  Array [
156
156
  Object {
157
157
  "backgroundColor": "#ffffff",
158
+ "borderRadius": 8,
158
159
  "flexDirection": "row",
159
160
  "padding": 16,
160
161
  },
@@ -255,6 +256,7 @@ exports[`ListItemContainer renders correctly themeSelected true themeVariant ful
255
256
  Array [
256
257
  Object {
257
258
  "backgroundColor": "#ece8ef",
259
+ "borderRadius": 8,
258
260
  "flexDirection": "row",
259
261
  "padding": 16,
260
262
  },
@@ -467,6 +467,7 @@ Object {
467
467
  "actionItemPressedBackground": "#664780",
468
468
  "actionItemText": "#ffffff",
469
469
  "backdropBackground": "#000000",
470
+ "buttonActiveBackground": "#664780",
470
471
  "buttonBackground": "#401960",
471
472
  "buttonPressedBackground": "#664780",
472
473
  "headerText": "#001f23",
@@ -566,8 +567,8 @@ Object {
566
567
  },
567
568
  "radii": Object {
568
569
  "basicItem": 4,
569
- "card": 8,
570
570
  "cardShadow": 4,
571
+ "item": 8,
571
572
  "leadingStatus": 999,
572
573
  },
573
574
  "shadows": Object {
@@ -4,6 +4,7 @@ const getFABTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  buttonBackground: theme.colors.primary,
6
6
  buttonPressedBackground: theme.colors.pressedSurface,
7
+ buttonActiveBackground: theme.colors.pressedSurface,
7
8
  icon: theme.colors.onPrimary,
8
9
  headerText: theme.colors.onDefaultGlobalSurface,
9
10
  actionItemBackground: theme.colors.secondary,
@@ -21,7 +21,7 @@ const getListTheme = (theme: GlobalTheme) => {
21
21
  };
22
22
 
23
23
  const radii = {
24
- card: theme.radii.medium,
24
+ item: theme.radii.medium,
25
25
  basicItem: theme.radii.base,
26
26
  cardShadow: theme.radii.base,
27
27
  leadingStatus: theme.radii.rounded,
@@ -13,7 +13,7 @@ Object {
13
13
  "disabledOutline": "#bfc1c5",
14
14
  "error": "#f46363",
15
15
  "errorSurface": "#fcebe7",
16
- "highlightedSurface": "#eaecf0",
16
+ "highlightedSurface": "#e6e6e6",
17
17
  "inactiveOnDefaultGlobalSurface": "#808f91",
18
18
  "inactiveOutline": "#808f91",
19
19
  "info": "#b5c3fd",
@@ -35,10 +35,10 @@ Object {
35
35
  "onSuccessSurface": "#017d6d",
36
36
  "onWarningSurface": "#ffa234",
37
37
  "overlayGlobalSurface": "#000000",
38
- "pressedSurface": "#586a8a",
39
- "primary": "#2e456d",
38
+ "pressedSurface": "#000000",
39
+ "primary": "#000000",
40
40
  "primaryOutline": "#001f23",
41
- "secondary": "#627492",
41
+ "secondary": "#4d4d4d",
42
42
  "secondaryOutline": "#e8e9ea",
43
43
  "success": "#5ace7d",
44
44
  "successSurface": "#f0fef4",
@@ -3,13 +3,13 @@ import swag from './swag';
3
3
  import type { SystemPalette, BrandSystemPalette } from './types';
4
4
 
5
5
  const workBrandSystemPallete: BrandSystemPalette = {
6
- primary: palette.policeBlue,
6
+ primary: palette.black,
7
7
  onPrimary: palette.white,
8
- secondary: palette.policeBlueLight25,
8
+ secondary: palette.blackLight30,
9
9
  onSecondary: palette.white,
10
10
  defaultSurface: palette.white,
11
- highlightedSurface: palette.policeBlueLight90,
12
- pressedSurface: palette.policeBlueLight20,
11
+ highlightedSurface: palette.blackLight90,
12
+ pressedSurface: palette.black,
13
13
 
14
14
  decorativePrimary: palette.gold,
15
15
  decorativePrimarySurface: palette.goldLight80,
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface ModalProps {
3
+ /**
4
+ * Content of the modal.
5
+ */
6
+ children: React.ReactElement;
7
+ /**
8
+ * Visibility of the modal
9
+ */
10
+ visible?: boolean;
11
+ /**
12
+ * Callback when the modal is shown.
13
+ */
14
+ onShow?: () => void;
15
+ /**
16
+ * TestID of the modal.
17
+ */
18
+ testID?: string;
19
+ }
20
+ declare const fABModal: ({ children, onShow, testID, visible }: ModalProps) => null;
21
+ export default fABModal;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ type ModalContentWrapperProps = {
4
+ children: React.ReactElement;
5
+ visible?: boolean;
6
+ testID?: string;
7
+ style?: StyleProp<ViewStyle>;
8
+ animated?: boolean;
9
+ pointerEvents: 'box-none' | 'none' | 'box-only' | 'auto';
10
+ };
11
+ export type ModalContentWrapperHandler = {
12
+ hide: (callback?: () => void) => void;
13
+ };
14
+ declare const FABModalContentWrapper: {
15
+ ({ children, testID, pointerEvents, }: ModalContentWrapperProps): JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export default FABModalContentWrapper;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ declare const ModalProvider: ({ children }: {
3
+ children: ReactNode;
4
+ }) => JSX.Element;
5
+ export default ModalProvider;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ export type ModalPresenterHandles = {
4
+ animatedOut: (completion?: () => void) => void;
5
+ };
6
+ export type FABModalDismissFunc = (onDismiss?: () => void) => void;
7
+ export type FABModalUpdateFunc = (content: React.ReactNode) => void;
8
+ /**
9
+ * Modal handler is returned by `showModal` function.
10
+ */
11
+ export type FABModalHandler = {
12
+ /**
13
+ * Same `dismiss` function as in `ModalContentProps`.
14
+ */
15
+ dismiss: FABModalDismissFunc;
16
+ /**
17
+ * Same `update` function as in `ModalContentProps`.
18
+ */
19
+ update: FABModalUpdateFunc;
20
+ };
21
+ declare const FABModalPresenter: React.ForwardRefExoticComponent<ViewProps & React.RefAttributes<ModalPresenterHandles>>;
22
+ /**
23
+ * Present a modal on screen immediately.
24
+ *
25
+ * The new presented modal will be on top of existing modals if there are any.
26
+ *
27
+ * @param Content A component to be presented as a modal on screen.
28
+ * This component will be centered horizontally and vertically on screen with
29
+ * a semitransparent black overlay underneath.
30
+ * @param contentProps Props for this modal component.
31
+ * @returns A `ModalHandler` you can use to dismiss the modal.
32
+ */
33
+ export declare const showFABModal: (content: React.ReactNode) => FABModalHandler;
34
+ export default FABModalPresenter;
@@ -0,0 +1,3 @@
1
+ import { FABModalDismissFunc, FABModalHandler, showFABModal, ModalPresenterHandles } from './ModalPresenter';
2
+ export type { FABModalDismissFunc as ModalDismissFunc, FABModalHandler as ModalHandler, ModalPresenterHandles, };
3
+ export { showFABModal };
@@ -5,6 +5,8 @@ import type { IconProps } from '../Icon';
5
5
  declare const StyledFAB: import("@emotion/native").StyledComponent<TouchableHighlightProps & {
6
6
  theme?: import("@emotion/react").Theme | undefined;
7
7
  as?: import("react").ElementType<any> | undefined;
8
+ } & {
9
+ themeActive?: boolean | undefined;
8
10
  }, {}, {
9
11
  ref?: import("react").Ref<TouchableHighlight> | undefined;
10
12
  }>;
@@ -16,6 +16,7 @@ declare const getFABTheme: (theme: GlobalTheme) => {
16
16
  colors: {
17
17
  buttonBackground: string;
18
18
  buttonPressedBackground: string;
19
+ buttonActiveBackground: string;
19
20
  icon: string;
20
21
  headerText: string;
21
22
  actionItemBackground: string;
@@ -18,7 +18,7 @@ declare const getListTheme: (theme: GlobalTheme) => {
18
18
  suffixContainerMarginLeft: number;
19
19
  };
20
20
  radii: {
21
- card: number;
21
+ item: number;
22
22
  basicItem: number;
23
23
  cardShadow: number;
24
24
  leadingStatus: number;