@fountain-ui/core 3.0.0-alpha.10 → 3.0.0-alpha.11

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 (162) hide show
  1. package/build/commonjs/AppBar/AppBar.js +6 -1
  2. package/build/commonjs/AppBar/AppBar.js.map +1 -1
  3. package/build/commonjs/ButtonBase/index.js +2 -2
  4. package/build/commonjs/ButtonBase/index.js.map +1 -1
  5. package/build/commonjs/Chip/Chip.js +21 -14
  6. package/build/commonjs/Chip/Chip.js.map +1 -1
  7. package/build/commonjs/Chip/ChipProps.js +3 -1
  8. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  9. package/build/commonjs/Chip/index.js +6 -0
  10. package/build/commonjs/Chip/index.js.map +1 -1
  11. package/build/commonjs/Chip/useChipStyle.js +29 -19
  12. package/build/commonjs/Chip/useChipStyle.js.map +1 -1
  13. package/build/commonjs/Dialog/Dialog.js +7 -8
  14. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  15. package/build/commonjs/Dialog/DialogProps.js +1 -1
  16. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  17. package/build/commonjs/Dialog/useDialogSectionStyle.js +5 -5
  18. package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
  19. package/build/commonjs/Dialog/useDialogStyle.js +9 -8
  20. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
  21. package/build/commonjs/DialogTitle/BackButton.js +47 -0
  22. package/build/commonjs/DialogTitle/BackButton.js.map +1 -0
  23. package/build/commonjs/DialogTitle/CloseButton.js +45 -0
  24. package/build/commonjs/DialogTitle/CloseButton.js.map +1 -0
  25. package/build/commonjs/DialogTitle/DialogTitle.js +11 -4
  26. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  27. package/build/commonjs/Divider/Divider.js +17 -9
  28. package/build/commonjs/Divider/Divider.js.map +1 -1
  29. package/build/commonjs/Divider/DividerProps.js +1 -1
  30. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  31. package/build/commonjs/Pagination/Pagination.js +2 -0
  32. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  33. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  34. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  35. package/build/commonjs/Pagination/index.js +6 -0
  36. package/build/commonjs/Pagination/index.js.map +1 -1
  37. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  38. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  39. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  40. package/build/commonjs/Tabs/useTabsStyle.js +7 -4
  41. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -1
  42. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  43. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  44. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  45. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  46. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  47. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  48. package/build/commonjs/Toolbar/Toolbar.js +8 -4
  49. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  50. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  51. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  52. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  53. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  54. package/build/commonjs/internal/icons/Close.js +4 -2
  55. package/build/commonjs/internal/icons/Close.js.map +1 -1
  56. package/build/module/AppBar/AppBar.js +5 -1
  57. package/build/module/AppBar/AppBar.js.map +1 -1
  58. package/build/module/ButtonBase/index.js +1 -1
  59. package/build/module/ButtonBase/index.js.map +1 -1
  60. package/build/module/Chip/Chip.js +17 -13
  61. package/build/module/Chip/Chip.js.map +1 -1
  62. package/build/module/Chip/ChipProps.js +1 -0
  63. package/build/module/Chip/ChipProps.js.map +1 -1
  64. package/build/module/Chip/index.js +1 -1
  65. package/build/module/Chip/index.js.map +1 -1
  66. package/build/module/Chip/useChipStyle.js +29 -19
  67. package/build/module/Chip/useChipStyle.js.map +1 -1
  68. package/build/module/Dialog/Dialog.js +7 -8
  69. package/build/module/Dialog/Dialog.js.map +1 -1
  70. package/build/module/Dialog/DialogProps.js +1 -1
  71. package/build/module/Dialog/DialogProps.js.map +1 -1
  72. package/build/module/Dialog/useDialogSectionStyle.js +5 -5
  73. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  74. package/build/module/Dialog/useDialogStyle.js +9 -8
  75. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  76. package/build/module/DialogTitle/BackButton.js +32 -0
  77. package/build/module/DialogTitle/BackButton.js.map +1 -0
  78. package/build/module/DialogTitle/CloseButton.js +30 -0
  79. package/build/module/DialogTitle/CloseButton.js.map +1 -0
  80. package/build/module/DialogTitle/DialogTitle.js +8 -3
  81. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  82. package/build/module/Divider/Divider.js +7 -0
  83. package/build/module/Divider/Divider.js.map +1 -1
  84. package/build/module/Divider/DividerProps.js +1 -1
  85. package/build/module/Divider/DividerProps.js.map +1 -1
  86. package/build/module/Pagination/Pagination.js +2 -0
  87. package/build/module/Pagination/Pagination.js.map +1 -1
  88. package/build/module/Pagination/PaginationProps.js +1 -0
  89. package/build/module/Pagination/PaginationProps.js.map +1 -1
  90. package/build/module/Pagination/index.js +1 -1
  91. package/build/module/Pagination/index.js.map +1 -1
  92. package/build/module/PaginationItem/PaginationItem.js +28 -21
  93. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  94. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  95. package/build/module/Tabs/useTabsStyle.js +6 -4
  96. package/build/module/Tabs/useTabsStyle.js.map +1 -1
  97. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  98. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  99. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  100. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  101. package/build/module/Toolbar/BackButton/index.js +2 -0
  102. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  103. package/build/module/Toolbar/Toolbar.js +7 -3
  104. package/build/module/Toolbar/Toolbar.js.map +1 -1
  105. package/build/module/internal/icons/ChevronLeft.js +4 -2
  106. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  107. package/build/module/internal/icons/ChevronRight.js +4 -2
  108. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  109. package/build/module/internal/icons/Close.js +4 -2
  110. package/build/module/internal/icons/Close.js.map +1 -1
  111. package/build/typescript/ButtonBase/index.d.ts +1 -1
  112. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  113. package/build/typescript/Chip/index.d.ts +1 -1
  114. package/build/typescript/Chip/useChipStyle.d.ts +4 -3
  115. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  116. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  117. package/build/typescript/DialogTitle/BackButton.d.ts +6 -0
  118. package/build/typescript/DialogTitle/CloseButton.d.ts +6 -0
  119. package/build/typescript/DialogTitle/DialogTitle.d.ts +8 -1
  120. package/build/typescript/Divider/DividerProps.d.ts +1 -1
  121. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  122. package/build/typescript/Pagination/index.d.ts +2 -2
  123. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  124. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  125. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  126. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  127. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  128. package/package.json +2 -2
  129. package/src/AppBar/AppBar.tsx +4 -0
  130. package/src/ButtonBase/index.ts +1 -1
  131. package/src/Chip/Chip.tsx +20 -13
  132. package/src/Chip/ChipProps.ts +13 -4
  133. package/src/Chip/index.ts +1 -1
  134. package/src/Chip/useChipStyle.ts +34 -17
  135. package/src/Dialog/Dialog.tsx +7 -8
  136. package/src/Dialog/DialogProps.ts +1 -7
  137. package/src/Dialog/useDialogSectionStyle.ts +4 -4
  138. package/src/Dialog/useDialogStyle.ts +9 -7
  139. package/src/DialogTitle/BackButton.tsx +44 -0
  140. package/src/DialogTitle/CloseButton.tsx +42 -0
  141. package/src/DialogTitle/DialogTitle.tsx +9 -1
  142. package/src/Divider/Divider.tsx +5 -0
  143. package/src/Divider/DividerProps.ts +1 -1
  144. package/src/Pagination/Pagination.tsx +3 -2
  145. package/src/Pagination/PaginationProps.ts +15 -0
  146. package/src/Pagination/index.ts +2 -2
  147. package/src/PaginationItem/PaginationItem.tsx +31 -24
  148. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  149. package/src/Tabs/useTabsStyle.ts +7 -4
  150. package/src/Toolbar/BackButton/BackButton.tsx +42 -0
  151. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  152. package/src/Toolbar/BackButton/index.ts +2 -0
  153. package/src/Toolbar/Toolbar.tsx +6 -1
  154. package/src/internal/icons/ChevronLeft.tsx +4 -1
  155. package/src/internal/icons/ChevronRight.tsx +4 -1
  156. package/src/internal/icons/Close.tsx +4 -1
  157. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  158. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  159. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  160. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  161. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  162. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
@@ -2,13 +2,14 @@ import { useMemo } from 'react';
2
2
  import type { TextStyle } from 'react-native';
3
3
  import type { FountainUiStyle } from '@fountain-ui/styles';
4
4
  import { createFontStyle, useTheme } from '../styles';
5
- import type { ChipSize, ChipStartElementVariant } from './ChipProps';
5
+ import type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';
6
6
 
7
7
  interface ChipStyle {
8
8
  container: FountainUiStyle;
9
- endElement?: FountainUiStyle;
9
+ closeButton?: FountainUiStyle;
10
10
  label: TextStyle;
11
11
  startElement?: FountainUiStyle;
12
+ startElementContainer?: FountainUiStyle;
12
13
  }
13
14
 
14
15
  type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
@@ -17,7 +18,8 @@ type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
17
18
  export default function useChipStyle(
18
19
  size: ChipSize,
19
20
  startElementVariant: ChipStartElementVariant,
20
- isEndElement: boolean,
21
+ color: ChipColor,
22
+ selected: boolean,
21
23
  ): ChipStyle {
22
24
  const theme = useTheme();
23
25
 
@@ -25,22 +27,22 @@ export default function useChipStyle(
25
27
  const fontStyleMap: Record<ChipSize, TextStyle> = {
26
28
  small: createFontStyle(theme, {
27
29
  selector: (typography) => typography.caption1.medium,
28
- color: theme.palette.text.strong,
30
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,
29
31
  }),
30
32
  large: createFontStyle(theme, {
31
33
  selector: (typography) => typography.body2.medium,
32
- color: theme.palette.text.strong,
34
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,
33
35
  }),
34
36
  };
35
37
 
36
- const endElementStyleMap: Record<ChipSize, FountainUiStyle> = {
38
+ const closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {
37
39
  small: {
38
40
  height: 14,
39
41
  marginLeft: theme.spacing(2),
40
42
  width: 8.17,
41
43
  },
42
44
  large: {
43
- height: 16,
45
+ height: 17,
44
46
  marginLeft: theme.spacing(2.5),
45
47
  width: 9,
46
48
  },
@@ -48,7 +50,10 @@ export default function useChipStyle(
48
50
 
49
51
  const baseContainerStyle: FountainUiStyle = {
50
52
  alignItems: 'center',
51
- backgroundColor: theme.palette.fill.weaker,
53
+ backgroundColor: selected ? theme.palette.fill.base
54
+ : color === 'white'
55
+ ? theme.palette.surface.base
56
+ : theme.palette.fill.weaker,
52
57
  borderRadius: theme.shape.radius.full,
53
58
  flexDirection: 'row',
54
59
  overflow: 'hidden',
@@ -65,9 +70,11 @@ export default function useChipStyle(
65
70
  },
66
71
  startElement: {
67
72
  borderRadius: theme.shape.radius.full,
68
- height: isLarge ? 24 : 22,
73
+ height: isLarge ? 26 : 23,
74
+ width: isLarge ? 26 : 23,
75
+ },
76
+ startElementContainer: {
69
77
  marginRight: theme.spacing(isLarge ? 1.5 : 1.25),
70
- width: isLarge ? 24 : 22,
71
78
  },
72
79
  },
73
80
  icon: {
@@ -77,11 +84,18 @@ export default function useChipStyle(
77
84
  paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),
78
85
  },
79
86
  startElement: {
87
+ color: selected
88
+ ? theme.palette.icon.strongInverse
89
+ : theme.palette.icon.strong,
90
+ height: isLarge ? 17 : 16,
91
+ width: isLarge ? 17 : 16,
92
+ },
93
+ startElementContainer: {
80
94
  alignItems: 'center',
81
- height: isLarge ? 22 : 20,
95
+ height: isLarge ? 24 : 21,
82
96
  justifyContent: 'center',
83
97
  marginRight: theme.spacing(isLarge ? 1 : 0.75),
84
- width: isLarge ? 22 : 20,
98
+ width: isLarge ? 24 : 21,
85
99
  },
86
100
  },
87
101
  image: {
@@ -91,9 +105,11 @@ export default function useChipStyle(
91
105
  },
92
106
  startElement: {
93
107
  borderRadius: theme.shape.radius.full,
94
- height: isLarge ? 34 : 30,
108
+ height: isLarge ? 36 : 31,
109
+ width: isLarge ? 48 : 40,
110
+ },
111
+ startElementContainer: {
95
112
  marginRight: theme.spacing(1.5),
96
- width: isLarge ? 45 : 40,
97
113
  },
98
114
  },
99
115
  default: {
@@ -109,11 +125,12 @@ export default function useChipStyle(
109
125
  container: {
110
126
  ...baseContainerStyle,
111
127
  ...variantStyleMap[startElementVariant]?.container,
112
- ...(isEndElement ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),
128
+ ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),
113
129
  },
114
- endElement: endElementStyleMap[size],
130
+ closeButton: closeButtonStyleMap[size],
115
131
  label: fontStyleMap[size],
116
132
  startElement: variantStyleMap[startElementVariant]?.startElement,
133
+ startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,
117
134
  };
118
- }, [theme, size, startElementVariant]);
135
+ }, [theme, size, startElementVariant, color, selected]);
119
136
  }
@@ -14,7 +14,6 @@ export default function Dialog(props: DialogProps) {
14
14
  const {
15
15
  animationType = ANIMATION_TYPE.SLIDE,
16
16
  children,
17
- fullScreen = false,
18
17
  hideBackdrop,
19
18
  onClose,
20
19
  style: styleProp,
@@ -24,7 +23,7 @@ export default function Dialog(props: DialogProps) {
24
23
  ...otherProps
25
24
  } = props;
26
25
 
27
- const styles = useDialogStyle(size, fullScreen);
26
+ const styles = useDialogStyle(size);
28
27
 
29
28
  const { height: screenHeight } = useWindowDimensions();
30
29
 
@@ -51,7 +50,7 @@ export default function Dialog(props: DialogProps) {
51
50
  toValue: 0,
52
51
  type: ANIMATION_TYPE.FADE,
53
52
  }];
54
- } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
53
+ } else if (animationType === ANIMATION_TYPE.SLIDE) {
55
54
  return [
56
55
  {
57
56
  toValue: screenHeight,
@@ -70,7 +69,7 @@ export default function Dialog(props: DialogProps) {
70
69
  toValue: screenHeight,
71
70
  type: ANIMATION_TYPE.SLIDE,
72
71
  }];
73
- }, [animationType, fullScreen, screenHeight]);
72
+ }, [animationType, screenHeight]);
74
73
 
75
74
  const openAnimation = useMemo<AnimationUnit[]>(() => {
76
75
  if (animationType === ANIMATION_TYPE.FADE) {
@@ -78,7 +77,7 @@ export default function Dialog(props: DialogProps) {
78
77
  toValue: 1,
79
78
  type: ANIMATION_TYPE.FADE,
80
79
  }];
81
- } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
80
+ } else if (animationType === ANIMATION_TYPE.SLIDE) {
82
81
  return [
83
82
  {
84
83
  toValue: 0,
@@ -97,9 +96,9 @@ export default function Dialog(props: DialogProps) {
97
96
  toValue: 0,
98
97
  type: ANIMATION_TYPE.SLIDE,
99
98
  }];
100
- }, [animationType, fullScreen]);
99
+ }, [animationType]);
101
100
 
102
- const initialOpacity = animationType === ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;
101
+ const initialOpacity = animationType === ANIMATION_TYPE.SLIDE ? 1 : undefined;
103
102
 
104
103
  const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;
105
104
 
@@ -124,7 +123,7 @@ export default function Dialog(props: DialogProps) {
124
123
  >
125
124
  <DialogProvider value={{ size }}>
126
125
  {topElement ? (
127
- <Column style={fullScreen ? undefined : styles.topElementContainer}>
126
+ <Column style={styles.topElementContainer}>
128
127
  <Column
129
128
  style={styles.topElementContent}
130
129
  onLayout={handleTopElementLayout}
@@ -3,7 +3,7 @@ import type { ModalProps } from '../Modal';
3
3
  import type { OverridableComponentProps } from '../types';
4
4
  import { ANIMATION_TYPE } from '../Modal';
5
5
 
6
- export const dialogSizes = ['small', 'medium', 'large'] as const;
6
+ export const dialogSizes = ['small', 'medium', 'large', 'full'] as const;
7
7
  export type DialogSize = typeof dialogSizes[number];
8
8
 
9
9
  export default interface DialogProps extends OverridableComponentProps<ModalProps, {
@@ -18,12 +18,6 @@ export default interface DialogProps extends OverridableComponentProps<ModalProp
18
18
  */
19
19
  children?: React.ReactNode;
20
20
 
21
- /**
22
- * If `true`, the dialog is full-screen.
23
- * @default false
24
- */
25
- fullScreen?: boolean;
26
-
27
21
  /**
28
22
  * Determines the minWidth of the Dialog.
29
23
  * @default 'medium'
@@ -15,15 +15,15 @@ export default function useDialogSectionStyle() {
15
15
  return useMemo<FountainUiStyle>(() => {
16
16
  const sizePaddingHorizontalMap: Record<DialogSize, FountainUiStyle> = {
17
17
  small: {
18
- paddingHorizontal: theme.spacing(6),
18
+ paddingHorizontal: 24,
19
19
  },
20
20
  medium: {
21
- // TODO: need to refactor breakpoints.
22
- paddingHorizontal: theme.spacing(windowWidth >= 448 ? 8 : 6),
21
+ paddingHorizontal: windowWidth >= 448 ? 32 : 24,
23
22
  },
24
23
  large: {
25
- paddingHorizontal: theme.spacing(8),
24
+ paddingHorizontal: 32,
26
25
  },
26
+ full: {},
27
27
  };
28
28
 
29
29
  return sizePaddingHorizontalMap[size];
@@ -13,7 +13,7 @@ type DialogStyleKeys =
13
13
 
14
14
  type DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;
15
15
 
16
- export default function useDialogStyle(size: DialogSize, fullScreen: boolean): DialogStyles {
16
+ export default function useDialogStyle(size: DialogSize): DialogStyles {
17
17
  const theme = useTheme();
18
18
 
19
19
  const {
@@ -34,29 +34,31 @@ export default function useDialogStyle(size: DialogSize, fullScreen: boolean): D
34
34
  minHeight: 360,
35
35
  width: 512,
36
36
  },
37
+ full: {},
37
38
  };
38
39
 
39
- const containerPaddingVertical = theme.spacing(6);
40
+ const containerPaddingVertical = 24;
40
41
  const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;
41
42
  const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;
42
43
 
44
+ const isFullScreen = size === 'full';
45
+
43
46
  return {
44
47
  root: {
45
48
  alignItems: 'center',
46
49
  justifyContent: 'center',
47
50
  zIndex: theme.zIndex.dialog,
48
51
  },
49
- container: fullScreen ? {
52
+ container: isFullScreen ? {
50
53
  height: '100%',
51
54
  width: '100%',
52
55
  } : {
53
56
  alignItems: 'center',
54
- // TODO: need to refactor breakpoints.
55
- paddingHorizontal: theme.spacing(windowWidth > 320 ? 6 : 4),
57
+ paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,
56
58
  paddingVertical: containerPaddingVertical,
57
59
  width: '100%',
58
60
  },
59
- paper: fullScreen ? {
61
+ paper: isFullScreen ? {
60
62
  backgroundColor: theme.palette.surface.base,
61
63
  height: '100%',
62
64
  width: '100%',
@@ -78,5 +80,5 @@ export default function useDialogStyle(size: DialogSize, fullScreen: boolean): D
78
80
  width: '100%',
79
81
  },
80
82
  };
81
- }, [theme, windowHeight, windowWidth, size, fullScreen]);
83
+ }, [theme, windowHeight, windowWidth, size]);
82
84
  }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import type { IconButtonProps } from '../IconButton';
4
+ import IconButton from '../IconButton';
5
+ import { ChevronLeft } from '../internal';
6
+ import { css } from '@fountain-ui/styles';
7
+
8
+ const styles = StyleSheet.create({
9
+ root: {
10
+ height: 40,
11
+ left: 20,
12
+ paddingLeft: 5,
13
+ paddingRight: 11,
14
+ paddingVertical: 8,
15
+ position: 'absolute',
16
+ width: 40,
17
+ },
18
+ });
19
+
20
+ interface BackButtonProps extends Omit<IconButtonProps, 'children'> {}
21
+
22
+ export default function BackButton(props: BackButtonProps) {
23
+ const {
24
+ style: styleProp,
25
+ ...otherProps
26
+ } = props;
27
+
28
+ const rootStyle = css([
29
+ styles.root,
30
+ styleProp,
31
+ ]);
32
+
33
+ return (
34
+ <IconButton
35
+ style={rootStyle}
36
+ {...otherProps}
37
+ >
38
+ <ChevronLeft
39
+ color={'strong'}
40
+ size={'large'}
41
+ />
42
+ </IconButton>
43
+ );
44
+ }
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import type { IconButtonProps } from '../IconButton';
4
+ import IconButton from '../IconButton';
5
+ import { Close } from '../internal';
6
+ import { css } from '@fountain-ui/styles';
7
+
8
+ const styles = StyleSheet.create({
9
+ root: {
10
+ height: 40,
11
+ left: 20,
12
+ padding: 8,
13
+ position: 'absolute',
14
+ width: 40,
15
+ },
16
+ });
17
+
18
+ interface CloseButtonProps extends Omit<IconButtonProps, 'children'> {}
19
+
20
+ export default function CloseButton(props: CloseButtonProps) {
21
+ const {
22
+ style: styleProp,
23
+ ...otherProps
24
+ } = props;
25
+
26
+ const rootStyle = css([
27
+ styles.root,
28
+ styleProp,
29
+ ]);
30
+
31
+ return (
32
+ <IconButton
33
+ style={rootStyle}
34
+ {...otherProps}
35
+ >
36
+ <Close
37
+ color={'strong'}
38
+ size={'large'}
39
+ />
40
+ </IconButton>
41
+ );
42
+ }
@@ -3,6 +3,8 @@ import { Text, View } from 'react-native';
3
3
  import type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
4
4
  import { useDialogSectionStyle } from '../Dialog';
5
5
  import { createFontStyle, css, useTheme } from '../styles';
6
+ import BackButton from './BackButton';
7
+ import CloseButton from './CloseButton';
6
8
  import type DialogTitleProps from './DialogTitleProps';
7
9
 
8
10
  type DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;
@@ -20,7 +22,7 @@ const useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {
20
22
  };
21
23
  };
22
24
 
23
- export default function DialogTitle(props: DialogTitleProps) {
25
+ const DialogTitle = (props: DialogTitleProps) => {
24
26
  const {
25
27
  children,
26
28
  style: styleProp,
@@ -62,3 +64,9 @@ export default function DialogTitle(props: DialogTitleProps) {
62
64
  </View>
63
65
  );
64
66
  };
67
+
68
+ DialogTitle.BackButton = BackButton;
69
+
70
+ DialogTitle.CloseButton = CloseButton;
71
+
72
+ export default DialogTitle;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Text, View } from 'react-native';
3
3
  import type { Theme } from '@fountain-ui/styles';
4
+ import { commonColors } from '@fountain-ui/styles';
4
5
  import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
5
6
  import { ExtendedStyle } from '../types';
6
7
  import type DividerProps from './DividerProps';
@@ -29,6 +30,10 @@ function selectBorderColor(theme: Theme, variant: DividerVariant, vertical: bool
29
30
  return vertical ? theme.palette.border.weaker : theme.palette.border.weak;
30
31
  case 'strong':
31
32
  return vertical ? theme.palette.border.weak : theme.palette.border.base;
33
+ case 'strongStatic':
34
+ return commonColors.opacity.white['13'];
35
+ case 'baseStatic':
36
+ return commonColors.opacity.white['10'];
32
37
  }
33
38
  }
34
39
 
@@ -5,7 +5,7 @@ import type { OverridableComponentProps } from '../types';
5
5
  export const dividerElementAligns = ['start', 'center', 'end'] as const;
6
6
  export type DividerElementAlign = typeof dividerElementAligns[number];
7
7
 
8
- export const dividerVariants = ['base', 'strong'] as const;
8
+ export const dividerVariants = ['base', 'strong', 'baseStatic', 'strongStatic'] as const;
9
9
  export type DividerVariant = typeof dividerVariants[number];
10
10
 
11
11
  export default interface DividerProps extends OverridableComponentProps<ViewProps, {
@@ -8,7 +8,7 @@ import IconButton from '../IconButton';
8
8
  import PaginationItem from '../PaginationItem';
9
9
  import NumberPagination from './NumberPagination';
10
10
  import type PaginationProps from './PaginationProps';
11
- import type { PaginationVariant } from './PaginationProps';
11
+ import type { PaginationColor, PaginationVariant } from './PaginationProps';
12
12
 
13
13
  type PaginationStyleKeys =
14
14
  | 'root'
@@ -65,6 +65,7 @@ export default function Pagination(props: PaginationProps) {
65
65
  const {
66
66
  bundleSize = 1,
67
67
  children,
68
+ color = 'base' as PaginationColor,
68
69
  count,
69
70
  disabled = false,
70
71
  hideIndicator = false,
@@ -134,7 +135,7 @@ export default function Pagination(props: PaginationProps) {
134
135
  currentPage={page}
135
136
  maxPage={count}
136
137
  />
137
- ) : times(i => renderItem({ index: i, disabled, selected: i === page }), count)
138
+ ) : times(i => renderItem({ color, index: i, disabled, selected: i === page }), count)
138
139
  ) : null;
139
140
 
140
141
  const containerProps = {
@@ -2,10 +2,19 @@ import React from 'react';
2
2
  import type { ViewProps } from 'react-native';
3
3
  import type { OverridableComponentProps } from '../types';
4
4
 
5
+ export const paginationColors = ['base', 'static'] as const;
6
+ export type PaginationColor = typeof paginationColors[number];
7
+
5
8
  export const paginationVariants = ['dot', 'number'] as const;
6
9
  export type PaginationVariant = typeof paginationVariants[number];
7
10
 
8
11
  export interface PaginationRenderItemParams {
12
+ /**
13
+ * Set color of dot.
14
+ * @default 'base'
15
+ */
16
+ color?: PaginationColor;
17
+
9
18
  /**
10
19
  * Index of the pagination item.
11
20
  */
@@ -34,6 +43,12 @@ export default interface PaginationProps extends OverridableComponentProps<ViewP
34
43
  */
35
44
  children?: React.ReactNode;
36
45
 
46
+ /**
47
+ * Set color of dot.
48
+ * @default 'base'
49
+ */
50
+ color?: PaginationColor;
51
+
37
52
  /**
38
53
  * The total number of pages.
39
54
  */
@@ -1,3 +1,3 @@
1
1
  export { default } from './Pagination';
2
- export type { default as PaginationProps } from './PaginationProps';
3
- export { paginationVariants } from './PaginationProps';
2
+ export type { default as PaginationProps, PaginationColor, PaginationVariant } from './PaginationProps';
3
+ export { paginationColors, paginationVariants } from './PaginationProps';
@@ -1,47 +1,54 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
- import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
2
+ import { StyleSheet, View, ViewStyle } from 'react-native';
3
+ import { commonColors, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
4
+ import { PaginationColor } from '../Pagination';
4
5
  import { css, useTheme } from '../styles';
5
6
  import type PaginationItemProps from './PaginationItemProps';
6
7
 
7
- type PaginationItemStyles = NamedStylesStringUnion<'root' | 'selected' | 'unselected'>;
8
+ const DEFAULT_SIZE = 6;
8
9
 
9
- const useStyles: UseStyles<PaginationItemStyles> = function (): PaginationItemStyles {
10
+ const styles = StyleSheet.create({
11
+ root: {
12
+ width: DEFAULT_SIZE,
13
+ height: DEFAULT_SIZE,
14
+ borderRadius: DEFAULT_SIZE * 0.5,
15
+ marginHorizontal: 4,
16
+ },
17
+ });
18
+
19
+ function getBackgroundColor(color: PaginationColor, selected: boolean): ViewStyle['backgroundColor'] {
10
20
  const theme = useTheme();
11
21
 
12
- const size = 6;
13
-
14
- return {
15
- root: {
16
- width: size,
17
- height: size,
18
- borderRadius: size * 0.5,
19
- marginHorizontal: theme.spacing(1),
20
- },
21
- selected: {
22
- backgroundColor: theme.palette.fill.base,
23
- },
24
- unselected: {
25
- backgroundColor: theme.palette.status.disabled,
26
- },
27
- };
28
- };
22
+ switch (color) {
23
+ case 'static':
24
+ return selected
25
+ ? commonColors.static.strongInverse
26
+ : commonColors.static.weakOpacityInverse;
27
+ case 'base':
28
+ default:
29
+ return selected
30
+ ? theme.palette.fill.base
31
+ : theme.palette.status.disabled;
32
+
33
+ }
34
+ }
29
35
 
30
36
  function PaginationItem(props: PaginationItemProps) {
31
37
  const {
38
+ color = 'base' as PaginationColor,
32
39
  disabled,
33
- selected,
40
+ selected = false,
34
41
  style,
35
42
  ...otherProps
36
43
  } = props;
37
44
 
38
- const styles = useStyles();
45
+ const backgroundColor = getBackgroundColor(color, selected);
39
46
 
40
47
  return (
41
48
  <View
42
49
  style={css([
43
50
  styles.root,
44
- selected ? styles.selected : styles.unselected,
51
+ { backgroundColor },
45
52
  style,
46
53
  ])}
47
54
  {...otherProps}
@@ -1,7 +1,14 @@
1
1
  import type { ViewProps } from 'react-native';
2
2
  import type { OverridableComponentProps } from '../types';
3
+ import { PaginationColor } from '../Pagination';
3
4
 
4
5
  export default interface PaginationItemProps extends OverridableComponentProps<ViewProps, {
6
+ /**
7
+ * Set color of dot.
8
+ * @default 'base'
9
+ */
10
+ color?: PaginationColor;
11
+
5
12
  /**
6
13
  * If `true`, the pagination item is disabled.
7
14
  * @default false
@@ -1,5 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import type { FountainUiStyle } from '@fountain-ui/styles';
3
+ import { useBreakpointUp } from '../hooks';
3
4
  import { useTheme } from '../styles';
4
5
  import type { TabVariant } from '../Tab';
5
6
 
@@ -10,13 +11,15 @@ interface TabsStyle {
10
11
  export default function useTabsStyle(variant: TabVariant) {
11
12
  const theme = useTheme();
12
13
 
14
+ const isDesktop = useBreakpointUp('md', true, false);
15
+
13
16
  return useMemo<TabsStyle>(() => {
14
17
  switch (variant) {
15
18
  case 'circular':
16
19
  return {
17
20
  container: {
18
- paddingBottom: theme.spacing(2),
19
- paddingHorizontal: theme.spacing(3),
21
+ paddingBottom: 8,
22
+ paddingHorizontal: isDesktop ? 20 : 12,
20
23
  },
21
24
  };
22
25
  case 'bottom-navigation':
@@ -27,9 +30,9 @@ export default function useTabsStyle(variant: TabVariant) {
27
30
  default:
28
31
  return {
29
32
  container: {
30
- paddingHorizontal: theme.spacing(1.5),
33
+ paddingHorizontal: isDesktop ? 14 : 6,
31
34
  },
32
35
  };
33
36
  }
34
- }, [theme, variant]);
37
+ }, [theme, variant, isDesktop]);
35
38
  }
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import IconButton from '../../IconButton';
4
+ import { ChevronLeft } from '../../internal';
5
+ import type BackButtonProps from './BackButtonProps';
6
+ import { css } from '@fountain-ui/styles';
7
+
8
+ const styles = StyleSheet.create({
9
+ root: {
10
+ height: 40,
11
+ left: 4,
12
+ paddingLeft: 5,
13
+ paddingRight: 11,
14
+ paddingVertical: 8,
15
+ position: 'absolute',
16
+ width: 40,
17
+ },
18
+ });
19
+
20
+ export default function BackButton(props: BackButtonProps) {
21
+ const {
22
+ style: styleProp,
23
+ ...otherProps
24
+ } = props;
25
+
26
+ const rootStyle = css([
27
+ styles.root,
28
+ styleProp,
29
+ ]);
30
+
31
+ return (
32
+ <IconButton
33
+ style={rootStyle}
34
+ {...otherProps}
35
+ >
36
+ <ChevronLeft
37
+ color={'strong'}
38
+ size={'large'}
39
+ />
40
+ </IconButton>
41
+ );
42
+ }