@fountain-ui/core 2.0.0-beta.94 → 2.0.0-beta.96

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 (141) hide show
  1. package/build/commonjs/Dialog/Dialog.js +26 -50
  2. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  3. package/build/commonjs/Dialog/DialogProps.js +7 -0
  4. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  5. package/build/commonjs/Dialog/LegacyDialog.js +181 -0
  6. package/build/commonjs/Dialog/LegacyDialog.js.map +1 -0
  7. package/build/commonjs/Dialog/LegacyDialogProps.js +2 -0
  8. package/build/commonjs/Dialog/LegacyDialogProps.js.map +1 -0
  9. package/build/commonjs/Dialog/index.js +2 -2
  10. package/build/commonjs/Dialog/index.js.map +1 -1
  11. package/build/commonjs/Dialog/useDialogStyle.js +81 -0
  12. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -0
  13. package/build/commonjs/DialogActions/DialogActions.js +2 -2
  14. package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
  15. package/build/commonjs/DialogActions/LegacyDialogActions.js +30 -0
  16. package/build/commonjs/DialogActions/LegacyDialogActions.js.map +1 -0
  17. package/build/commonjs/DialogActions/index.js +2 -2
  18. package/build/commonjs/DialogActions/index.js.map +1 -1
  19. package/build/commonjs/DialogContent/DialogContent.js +30 -11
  20. package/build/commonjs/DialogContent/DialogContent.js.map +1 -1
  21. package/build/commonjs/DialogContent/DialogContentProps.js.map +1 -1
  22. package/build/commonjs/DialogContent/LegacyDialogContent.js +36 -0
  23. package/build/commonjs/DialogContent/LegacyDialogContent.js.map +1 -0
  24. package/build/commonjs/DialogContent/LegacyDialogContentProps.js +2 -0
  25. package/build/commonjs/DialogContent/LegacyDialogContentProps.js.map +1 -0
  26. package/build/commonjs/DialogContent/index.js +2 -2
  27. package/build/commonjs/DialogContent/index.js.map +1 -1
  28. package/build/commonjs/DialogMedia/DialogMedia.js +24 -10
  29. package/build/commonjs/DialogMedia/DialogMedia.js.map +1 -1
  30. package/build/commonjs/DialogMedia/DialogMediaProps.js +7 -0
  31. package/build/commonjs/DialogMedia/DialogMediaProps.js.map +1 -1
  32. package/build/commonjs/DialogMedia/LegacyDialogMedia.js +33 -0
  33. package/build/commonjs/DialogMedia/LegacyDialogMedia.js.map +1 -0
  34. package/build/commonjs/DialogMedia/LegacyDialogMediaProps.js +2 -0
  35. package/build/commonjs/DialogMedia/LegacyDialogMediaProps.js.map +1 -0
  36. package/build/commonjs/DialogMedia/index.js +2 -2
  37. package/build/commonjs/DialogMedia/index.js.map +1 -1
  38. package/build/commonjs/DialogTitle/DialogTitle.js +27 -11
  39. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  40. package/build/commonjs/DialogTitle/DialogTitleProps.js.map +1 -1
  41. package/build/commonjs/DialogTitle/LegacyDialogTitle.js +36 -0
  42. package/build/commonjs/DialogTitle/LegacyDialogTitle.js.map +1 -0
  43. package/build/commonjs/DialogTitle/LegacyDialogTitleProps.js +2 -0
  44. package/build/commonjs/DialogTitle/LegacyDialogTitleProps.js.map +1 -0
  45. package/build/commonjs/DialogTitle/index.js +2 -2
  46. package/build/commonjs/DialogTitle/index.js.map +1 -1
  47. package/build/commonjs/hooks/useCollapsibleAppBar.js +3 -2
  48. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  49. package/build/module/Dialog/Dialog.js +23 -52
  50. package/build/module/Dialog/Dialog.js.map +1 -1
  51. package/build/module/Dialog/DialogProps.js +1 -1
  52. package/build/module/Dialog/DialogProps.js.map +1 -1
  53. package/build/module/Dialog/LegacyDialog.js +160 -0
  54. package/build/module/Dialog/LegacyDialog.js.map +1 -0
  55. package/build/module/Dialog/LegacyDialogProps.js +2 -0
  56. package/build/module/Dialog/LegacyDialogProps.js.map +1 -0
  57. package/build/module/Dialog/index.js +1 -1
  58. package/build/module/Dialog/index.js.map +1 -1
  59. package/build/module/Dialog/useDialogStyle.js +71 -0
  60. package/build/module/Dialog/useDialogStyle.js.map +1 -0
  61. package/build/module/DialogActions/DialogActions.js +2 -2
  62. package/build/module/DialogActions/DialogActions.js.map +1 -1
  63. package/build/module/DialogActions/LegacyDialogActions.js +17 -0
  64. package/build/module/DialogActions/LegacyDialogActions.js.map +1 -0
  65. package/build/module/DialogActions/index.js +1 -1
  66. package/build/module/DialogActions/index.js.map +1 -1
  67. package/build/module/DialogContent/DialogContent.js +32 -11
  68. package/build/module/DialogContent/DialogContent.js.map +1 -1
  69. package/build/module/DialogContent/DialogContentProps.js.map +1 -1
  70. package/build/module/DialogContent/LegacyDialogContent.js +22 -0
  71. package/build/module/DialogContent/LegacyDialogContent.js.map +1 -0
  72. package/build/module/DialogContent/LegacyDialogContentProps.js +2 -0
  73. package/build/module/DialogContent/LegacyDialogContentProps.js.map +1 -0
  74. package/build/module/DialogContent/index.js +1 -1
  75. package/build/module/DialogContent/index.js.map +1 -1
  76. package/build/module/DialogMedia/DialogMedia.js +24 -10
  77. package/build/module/DialogMedia/DialogMedia.js.map +1 -1
  78. package/build/module/DialogMedia/DialogMediaProps.js +1 -1
  79. package/build/module/DialogMedia/DialogMediaProps.js.map +1 -1
  80. package/build/module/DialogMedia/LegacyDialogMedia.js +21 -0
  81. package/build/module/DialogMedia/LegacyDialogMedia.js.map +1 -0
  82. package/build/module/DialogMedia/LegacyDialogMediaProps.js +2 -0
  83. package/build/module/DialogMedia/LegacyDialogMediaProps.js.map +1 -0
  84. package/build/module/DialogMedia/index.js +1 -1
  85. package/build/module/DialogMedia/index.js.map +1 -1
  86. package/build/module/DialogTitle/DialogTitle.js +29 -11
  87. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  88. package/build/module/DialogTitle/DialogTitleProps.js.map +1 -1
  89. package/build/module/DialogTitle/LegacyDialogTitle.js +22 -0
  90. package/build/module/DialogTitle/LegacyDialogTitle.js.map +1 -0
  91. package/build/module/DialogTitle/LegacyDialogTitleProps.js +2 -0
  92. package/build/module/DialogTitle/LegacyDialogTitleProps.js.map +1 -0
  93. package/build/module/DialogTitle/index.js +1 -1
  94. package/build/module/DialogTitle/index.js.map +1 -1
  95. package/build/module/hooks/useCollapsibleAppBar.js +3 -2
  96. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  97. package/build/typescript/Dialog/DialogProps.d.ts +7 -0
  98. package/build/typescript/Dialog/LegacyDialog.d.ts +3 -0
  99. package/build/typescript/Dialog/LegacyDialogProps.d.ts +25 -0
  100. package/build/typescript/Dialog/index.d.ts +2 -2
  101. package/build/typescript/Dialog/useDialogStyle.d.ts +6 -0
  102. package/build/typescript/DialogActions/LegacyDialogActions.d.ts +3 -0
  103. package/build/typescript/DialogActions/index.d.ts +1 -1
  104. package/build/typescript/DialogContent/DialogContentProps.d.ts +5 -5
  105. package/build/typescript/DialogContent/LegacyDialogContent.d.ts +3 -0
  106. package/build/typescript/DialogContent/LegacyDialogContentProps.d.ts +10 -0
  107. package/build/typescript/DialogContent/index.d.ts +2 -2
  108. package/build/typescript/DialogMedia/DialogMediaProps.d.ts +7 -10
  109. package/build/typescript/DialogMedia/LegacyDialogMedia.d.ts +3 -0
  110. package/build/typescript/DialogMedia/LegacyDialogMediaProps.d.ts +15 -0
  111. package/build/typescript/DialogMedia/index.d.ts +2 -2
  112. package/build/typescript/DialogTitle/DialogTitleProps.d.ts +2 -13
  113. package/build/typescript/DialogTitle/LegacyDialogTitle.d.ts +3 -0
  114. package/build/typescript/DialogTitle/LegacyDialogTitleProps.d.ts +15 -0
  115. package/build/typescript/DialogTitle/index.d.ts +2 -2
  116. package/package.json +3 -3
  117. package/src/Dialog/Dialog.tsx +27 -69
  118. package/src/Dialog/DialogProps.ts +9 -0
  119. package/src/Dialog/LegacyDialog.tsx +198 -0
  120. package/src/Dialog/LegacyDialogProps.ts +28 -0
  121. package/src/Dialog/index.ts +2 -2
  122. package/src/Dialog/useDialogStyle.ts +90 -0
  123. package/src/DialogActions/DialogActions.tsx +2 -4
  124. package/src/DialogActions/LegacyDialogActions.tsx +23 -0
  125. package/src/DialogActions/index.ts +2 -2
  126. package/src/DialogContent/DialogContent.tsx +47 -16
  127. package/src/DialogContent/DialogContentProps.ts +5 -5
  128. package/src/DialogContent/LegacyDialogContent.tsx +30 -0
  129. package/src/DialogContent/LegacyDialogContentProps.ts +10 -0
  130. package/src/DialogContent/index.ts +2 -2
  131. package/src/DialogMedia/DialogMedia.tsx +35 -8
  132. package/src/DialogMedia/DialogMediaProps.ts +7 -10
  133. package/src/DialogMedia/LegacyDialogMedia.tsx +21 -0
  134. package/src/DialogMedia/LegacyDialogMediaProps.ts +16 -0
  135. package/src/DialogMedia/index.ts +2 -2
  136. package/src/DialogTitle/DialogTitle.tsx +46 -16
  137. package/src/DialogTitle/DialogTitleProps.ts +2 -14
  138. package/src/DialogTitle/LegacyDialogTitle.tsx +30 -0
  139. package/src/DialogTitle/LegacyDialogTitleProps.ts +16 -0
  140. package/src/DialogTitle/index.ts +2 -2
  141. package/src/hooks/useCollapsibleAppBar.ts +14 -11
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Column","Typography","EdgeInsets","DialogContent","props","children","disableTypography","otherProps","fromVH"],"sources":["LegacyDialogContent.tsx"],"sourcesContent":["import React from 'react';\nimport Column from '../Column';\nimport Typography from '../Typography';\nimport { EdgeInsets } from '../styles';\nimport type DialogContentProps from './LegacyDialogContentProps';\n\nexport default function DialogContent(props: DialogContentProps) {\n const {\n children,\n disableTypography = false,\n ...otherProps\n } = props;\n\n return (\n <Column\n insets={EdgeInsets.fromVH(2, 6)}\n {...otherProps}\n >\n {disableTypography ? (\n children\n ) : (\n <Typography\n children={children}\n color={'textSecondary'}\n variant={'body2'}\n />\n )}\n </Column>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,UAAT,QAA2B,WAA3B;AAGA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,iBAAiB,GAAG,KAFlB;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,oBACI,oBAAC,MAAD;IACI,MAAM,EAAEF,UAAU,CAACM,MAAX,CAAkB,CAAlB,EAAqB,CAArB;EADZ,GAEQD,UAFR,GAIKD,iBAAiB,GACdD,QADc,gBAGd,oBAAC,UAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAE,eAFX;IAGI,OAAO,EAAE;EAHb,EAPR,CADJ;AAgBH;AAAA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=LegacyDialogContentProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyDialogContentProps.ts"],"sourcesContent":["import type { OverridableComponentProps } from '../types';\nimport type { ColumnProps } from '../Column';\n\nexport default interface DialogContentProps extends OverridableComponentProps<ColumnProps, {\n /**\n * If `true`, the children won't be wrapped by a typography component.\n * @default false\n */\n disableTypography?: boolean;\n}> {}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- export { default } from './DialogContent';
1
+ export { default } from './LegacyDialogContent';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './DialogContent';\nexport type { default as DialogContentProps } from './DialogContentProps';"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyDialogContent';\nexport type { default as DialogContentProps } from './LegacyDialogContentProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,uBAAxB"}
@@ -1,21 +1,35 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from 'react';
4
- import Image from '../Image';
4
+ import { View } from 'react-native';
5
+ import { css, useTheme } from '../styles';
6
+
7
+ const useStyles = function () {
8
+ const theme = useTheme();
9
+ return {
10
+ icon: {
11
+ alignItems: 'center',
12
+ justifyContent: 'center',
13
+ paddingTop: theme.spacing(8)
14
+ },
15
+ image: {
16
+ paddingTop: theme.spacing(4)
17
+ }
18
+ };
19
+ };
20
+
5
21
  export default function DialogMedia(props) {
6
22
  const {
7
23
  children,
8
- image,
24
+ variant = 'image',
25
+ style: styleProp,
9
26
  ...otherProps
10
27
  } = props;
11
- return /*#__PURE__*/React.createElement(Image, _extends({
12
- disableOutline: true,
13
- loading: 'eager',
14
- overlaidChildren: children,
15
- source: {
16
- uri: image
17
- }
18
- }, otherProps));
28
+ const styles = useStyles();
29
+ const rootStyle = css([styles[variant], styleProp]);
30
+ return /*#__PURE__*/React.createElement(View, _extends({
31
+ style: rootStyle
32
+ }, otherProps), children);
19
33
  }
20
34
  ;
21
35
  //# sourceMappingURL=DialogMedia.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Image","DialogMedia","props","children","image","otherProps","uri"],"sources":["DialogMedia.tsx"],"sourcesContent":["import React from 'react';\nimport Image from '../Image';\nimport type DialogMediaProps from './DialogMediaProps';\n\nexport default function DialogMedia(props: DialogMediaProps) {\n const {\n children,\n image,\n ...otherProps\n } = props;\n\n return (\n <Image\n disableOutline={true}\n loading={'eager'}\n overlaidChildren={children}\n source={{ uri: image }}\n {...otherProps}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AAGA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAFE;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,oBACI,oBAAC,KAAD;IACI,cAAc,EAAE,IADpB;IAEI,OAAO,EAAE,OAFb;IAGI,gBAAgB,EAAEC,QAHtB;IAII,MAAM,EAAE;MAAEG,GAAG,EAAEF;IAAP;EAJZ,GAKQC,UALR,EADJ;AASH;AAAA"}
1
+ {"version":3,"names":["React","View","css","useTheme","useStyles","theme","icon","alignItems","justifyContent","paddingTop","spacing","image","DialogMedia","props","children","variant","style","styleProp","otherProps","styles","rootStyle"],"sources":["DialogMedia.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type DialogMediaProps from './DialogMediaProps';\nimport type { DialogMediaVariant } from './DialogMediaProps';\n\ntype DialogMediaStyles = NamedStylesStringUnion<DialogMediaVariant>;\n\nconst useStyles: UseStyles<DialogMediaStyles> = function (): DialogMediaStyles {\n const theme = useTheme();\n\n return {\n icon: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingTop: theme.spacing(8),\n },\n image: {\n paddingTop: theme.spacing(4),\n },\n };\n};\n\nexport default function DialogMedia(props: DialogMediaProps) {\n const {\n children,\n variant = 'image',\n style: styleProp,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles[variant],\n styleProp,\n ]);\n\n return (\n <View\n style={rootStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;;AAMA,MAAMC,SAAuC,GAAG,YAA+B;EAC3E,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE,QAFd;MAGFC,UAAU,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd;IAHV,CADH;IAMHC,KAAK,EAAE;MACHF,UAAU,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd;IADT;EANJ,CAAP;AAUH,CAbD;;AAeA,eAAe,SAASE,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,OAAO,GAAG,OAFR;IAGFC,KAAK,EAAEC,SAHL;IAIF,GAAGC;EAJD,IAKFL,KALJ;EAOA,MAAMM,MAAM,GAAGf,SAAS,EAAxB;EAEA,MAAMgB,SAAS,GAAGlB,GAAG,CAAC,CAClBiB,MAAM,CAACJ,OAAD,CADY,EAElBE,SAFkB,CAAD,CAArB;EAKA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEG;EADX,GAEQF,UAFR,GAIKJ,QAJL,CADJ;AAQH;AAAA"}
@@ -1,2 +1,2 @@
1
-
1
+ export const dialogMediaVariants = ['image', 'icon'];
2
2
  //# sourceMappingURL=DialogMediaProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["DialogMediaProps.ts"],"sourcesContent":["import type { ImageProps } from '../Image';\nimport type { OverridableComponentProps } from '../types';\n\ntype BaseProps = Omit<ImageProps, 'source' | 'overlaidChildren'>;\n\nexport default interface DialogMediaProps extends OverridableComponentProps<BaseProps, {\n /**\n * The content of the component.\n */\n children?: ImageProps['overlaidChildren'];\n\n /**\n * Image to be displayed as a background image.\n */\n image: string;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":["dialogMediaVariants"],"sources":["DialogMediaProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const dialogMediaVariants = ['image', 'icon'] as const;\nexport type DialogMediaVariant = typeof dialogMediaVariants[number];\n\nexport default interface DialogMediaProps extends OverridableComponentProps<ViewProps, {\n /**\n * Determines design variations of the component.\n * @default 'image'\n */\n variant?: DialogMediaVariant;\n}> {}\n"],"mappings":"AAGA,OAAO,MAAMA,mBAAmB,GAAG,CAAC,OAAD,EAAU,MAAV,CAA5B"}
@@ -0,0 +1,21 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import Image from '../Image';
5
+ export default function DialogMedia(props) {
6
+ const {
7
+ children,
8
+ image,
9
+ ...otherProps
10
+ } = props;
11
+ return /*#__PURE__*/React.createElement(Image, _extends({
12
+ disableOutline: true,
13
+ loading: 'eager',
14
+ overlaidChildren: children,
15
+ source: {
16
+ uri: image
17
+ }
18
+ }, otherProps));
19
+ }
20
+ ;
21
+ //# sourceMappingURL=LegacyDialogMedia.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Image","DialogMedia","props","children","image","otherProps","uri"],"sources":["LegacyDialogMedia.tsx"],"sourcesContent":["import React from 'react';\nimport Image from '../Image';\nimport type DialogMediaProps from './LegacyDialogMediaProps';\n\nexport default function DialogMedia(props: DialogMediaProps) {\n const {\n children,\n image,\n ...otherProps\n } = props;\n\n return (\n <Image\n disableOutline={true}\n loading={'eager'}\n overlaidChildren={children}\n source={{ uri: image }}\n {...otherProps}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AAGA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAFE;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,oBACI,oBAAC,KAAD;IACI,cAAc,EAAE,IADpB;IAEI,OAAO,EAAE,OAFb;IAGI,gBAAgB,EAAEC,QAHtB;IAII,MAAM,EAAE;MAAEG,GAAG,EAAEF;IAAP;EAJZ,GAKQC,UALR,EADJ;AASH;AAAA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=LegacyDialogMediaProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyDialogMediaProps.ts"],"sourcesContent":["import type { ImageProps } from '../Image';\nimport type { OverridableComponentProps } from '../types';\n\ntype BaseProps = Omit<ImageProps, 'source' | 'overlaidChildren'>;\n\nexport default interface DialogMediaProps extends OverridableComponentProps<BaseProps, {\n /**\n * The content of the component.\n */\n children?: ImageProps['overlaidChildren'];\n\n /**\n * Image to be displayed as a background image.\n */\n image: string;\n}> {}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- export { default } from './DialogMedia';
1
+ export { default } from './LegacyDialogMedia';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './DialogMedia';\nexport type { default as DialogMediaProps } from './DialogMediaProps';"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyDialogMedia';\nexport type { default as DialogMediaProps } from './LegacyDialogMediaProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,qBAAxB"}
@@ -1,22 +1,40 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from 'react';
4
- import Row from '../Row';
5
- import Typography from '../Typography';
6
- import { EdgeInsets } from '../styles';
4
+ import { Text, View } from 'react-native';
5
+ import { createFontStyle, css, useTheme } from '../styles';
6
+
7
+ const useStyles = function () {
8
+ const theme = useTheme();
9
+ return {
10
+ root: {
11
+ paddingTop: theme.spacing(6.5)
12
+ },
13
+ title: {
14
+ textAlign: 'center'
15
+ }
16
+ };
17
+ };
18
+
7
19
  export default function DialogTitle(props) {
8
20
  const {
9
21
  children,
10
- disableTypography = false,
22
+ style: styleProp,
11
23
  ...otherProps
12
24
  } = props;
13
- return /*#__PURE__*/React.createElement(Row, _extends({
14
- insets: EdgeInsets.fromLTRB(6, 6, 6, 2)
15
- }, otherProps), disableTypography ? children : /*#__PURE__*/React.createElement(Typography, {
16
- children: children,
17
- color: 'textPrimary',
18
- variant: 'h2'
19
- }));
25
+ const theme = useTheme();
26
+ const styles = useStyles();
27
+ const rootStyle = css([styles.root, styleProp]);
28
+ const titleFontStyle = createFontStyle(theme, {
29
+ selector: typography => typography.header3.semiBold,
30
+ color: theme.palette.text.strong
31
+ });
32
+ const titleStyle = css([styles.title, titleFontStyle]);
33
+ return /*#__PURE__*/React.createElement(View, _extends({}, otherProps, {
34
+ style: rootStyle
35
+ }), typeof children === 'string' ? /*#__PURE__*/React.createElement(Text, {
36
+ style: titleStyle
37
+ }, children) : children);
20
38
  }
21
39
  ;
22
40
  //# sourceMappingURL=DialogTitle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Row","Typography","EdgeInsets","DialogTitle","props","children","disableTypography","otherProps","fromLTRB"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport Row from '../Row';\nimport Typography from '../Typography';\nimport { EdgeInsets } from '../styles';\nimport type DialogTitleProps from './DialogTitleProps';\n\nexport default function DialogTitle(props: DialogTitleProps) {\n const {\n children,\n disableTypography = false,\n ...otherProps\n } = props;\n\n return (\n <Row\n insets={EdgeInsets.fromLTRB(6, 6, 6, 2)}\n {...otherProps}\n >\n {disableTypography ? (\n children\n ) : (\n <Typography\n children={children}\n color={'textPrimary'}\n variant={'h2'}\n />\n )}\n </Row>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,UAAT,QAA2B,WAA3B;AAGA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,iBAAiB,GAAG,KAFlB;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,oBACI,oBAAC,GAAD;IACI,MAAM,EAAEF,UAAU,CAACM,QAAX,CAAoB,CAApB,EAAuB,CAAvB,EAA0B,CAA1B,EAA6B,CAA7B;EADZ,GAEQD,UAFR,GAIKD,iBAAiB,GACdD,QADc,gBAGd,oBAAC,UAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAE,aAFX;IAGI,OAAO,EAAE;EAHb,EAPR,CADJ;AAgBH;AAAA"}
1
+ {"version":3,"names":["React","Text","View","createFontStyle","css","useTheme","useStyles","theme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","rootStyle","titleFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type DialogTitleProps from './DialogTitleProps';\n\ntype DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;\n\nconst useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(6.5),\n },\n title: {\n textAlign: 'center',\n },\n };\n};\n\nexport default function DialogTitle(props: DialogTitleProps) {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <View\n {...otherProps}\n style={rootStyle}\n >\n {typeof children === 'string' ? (\n <Text style={titleStyle}>\n {children}\n </Text>\n ) : (children)}\n </View>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;;AAKA,MAAMC,SAAuC,GAAG,YAA+B;EAC3E,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAEF,KAAK,CAACG,OAAN,CAAc,GAAd;IADV,CADH;IAIHC,KAAK,EAAE;MACHC,SAAS,EAAE;IADR;EAJJ,CAAP;AAQH,CAXD;;AAaA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMP,KAAK,GAAGF,QAAQ,EAAtB;EAEA,MAAMc,MAAM,GAAGb,SAAS,EAAxB;EAEA,MAAMc,SAAS,GAAGhB,GAAG,CAAC,CAClBe,MAAM,CAACX,IADW,EAElBS,SAFkB,CAAD,CAArB;EAKA,MAAMI,cAAc,GAAGlB,eAAe,CAACI,KAAD,EAAQ;IAC1Ce,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAEnB,KAAK,CAACoB,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAR,CAAtC;EAKA,MAAMC,UAAU,GAAG1B,GAAG,CAAC,CACnBe,MAAM,CAACR,KADY,EAEnBU,cAFmB,CAAD,CAAtB;EAKA,oBACI,oBAAC,IAAD,eACQH,UADR;IAEI,KAAK,EAAEE;EAFX,IAIK,OAAOL,QAAP,KAAoB,QAApB,gBACG,oBAAC,IAAD;IAAM,KAAK,EAAEe;EAAb,GACKf,QADL,CADH,GAIIA,QART,CADJ;AAYH;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["DialogTitleProps.ts"],"sourcesContent":["import type { TypographyProps } from '../Typography';\nimport type { OverridableComponentProps } from '../types';\nimport type { RowProps } from '../Row';\n\nexport default interface DialogTitleProps extends OverridableComponentProps<RowProps, {\n /**\n * The content of the component.\n */\n children?: TypographyProps['children'];\n\n /**\n * If `true`, the children won't be wrapped by a typography component.\n * @default false\n */\n disableTypography?: boolean;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["DialogTitleProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport default interface DialogTitleProps extends OverridableComponentProps<ViewProps, {}> {}\n"],"mappings":""}
@@ -0,0 +1,22 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import Row from '../Row';
5
+ import Typography from '../Typography';
6
+ import { EdgeInsets } from '../styles';
7
+ export default function DialogTitle(props) {
8
+ const {
9
+ children,
10
+ disableTypography = false,
11
+ ...otherProps
12
+ } = props;
13
+ return /*#__PURE__*/React.createElement(Row, _extends({
14
+ insets: EdgeInsets.fromLTRB(6, 6, 6, 2)
15
+ }, otherProps), disableTypography ? children : /*#__PURE__*/React.createElement(Typography, {
16
+ children: children,
17
+ color: 'textPrimary',
18
+ variant: 'h2'
19
+ }));
20
+ }
21
+ ;
22
+ //# sourceMappingURL=LegacyDialogTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Row","Typography","EdgeInsets","DialogTitle","props","children","disableTypography","otherProps","fromLTRB"],"sources":["LegacyDialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport Row from '../Row';\nimport Typography from '../Typography';\nimport { EdgeInsets } from '../styles';\nimport type DialogTitleProps from './LegacyDialogTitleProps';\n\nexport default function DialogTitle(props: DialogTitleProps) {\n const {\n children,\n disableTypography = false,\n ...otherProps\n } = props;\n\n return (\n <Row\n insets={EdgeInsets.fromLTRB(6, 6, 6, 2)}\n {...otherProps}\n >\n {disableTypography ? (\n children\n ) : (\n <Typography\n children={children}\n color={'textPrimary'}\n variant={'h2'}\n />\n )}\n </Row>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,UAAT,QAA2B,WAA3B;AAGA,eAAe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,iBAAiB,GAAG,KAFlB;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,oBACI,oBAAC,GAAD;IACI,MAAM,EAAEF,UAAU,CAACM,QAAX,CAAoB,CAApB,EAAuB,CAAvB,EAA0B,CAA1B,EAA6B,CAA7B;EADZ,GAEQD,UAFR,GAIKD,iBAAiB,GACdD,QADc,gBAGd,oBAAC,UAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAE,aAFX;IAGI,OAAO,EAAE;EAHb,EAPR,CADJ;AAgBH;AAAA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=LegacyDialogTitleProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyDialogTitleProps.ts"],"sourcesContent":["import type { TypographyProps } from '../Typography';\nimport type { OverridableComponentProps } from '../types';\nimport type { RowProps } from '../Row';\n\nexport default interface DialogTitleProps extends OverridableComponentProps<RowProps, {\n /**\n * The content of the component.\n */\n children?: TypographyProps['children'];\n\n /**\n * If `true`, the children won't be wrapped by a typography component.\n * @default false\n */\n disableTypography?: boolean;\n}> {}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- export { default } from './DialogTitle';
1
+ export { default } from './LegacyDialogTitle';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './DialogTitle';\nexport type { default as DialogTitleProps } from './DialogTitleProps';"],"mappings":"AAAA,SAASA,OAAT,QAAwB,eAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyDialogTitle';\nexport type { default as DialogTitleProps } from './LegacyDialogTitleProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,qBAAxB"}
@@ -98,8 +98,9 @@ export default function useCollapsibleAppBar() {
98
98
  const minOffsetY = -maxTy;
99
99
  const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;
100
100
  const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);
101
- const dy = safeOffsetY - lastOffsetY.value;
102
- const newTranslateY = supportsReverseScroll ? dy === 0 ? lastTranslateY.value : dy > 0 ? maxTy : 0 : lastOffsetY.value === minOffsetY ? 0 : maxTy;
101
+ const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);
102
+ const dy = safeOffsetY - safeLastOffsetY;
103
+ const newTranslateY = safeOffsetY <= 0 ? 0 : supportsReverseScroll ? dy === 0 ? lastTranslateY.value : dy > 0 ? maxTy : 0 : safeLastOffsetY === minOffsetY ? 0 : maxTy;
103
104
  translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);
104
105
  lastTranslateY.value = newTranslateY;
105
106
  overlapped.value = offsetY > 0;
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useRef","useState","Keyboard","Platform","StyleSheet","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","useSafeAreaInsets","useTheme","useHeight","useAppbarStyles","defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","OS","dismissKeyboard","dismiss","useCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","translateY","lastTranslateY","lastOffsetY","overlapped","isScrolled","setIsScrolled","theme","animatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","hairlineWidth","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","current","savedOffsetY","scrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n isScrolled: boolean;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const [isScrolled, setIsScrolled] = useState<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n if (!isScrolled && offsetY > 0) {\n runOnJS(setIsScrolled)(true);\n } else if (isScrolled && offsetY <= 0) {\n runOnJS(setIsScrolled)(false);\n }\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - lastOffsetY.value;\n\n const newTranslateY = supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : lastOffsetY.value === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight, isScrolled]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n isScrolled,\n };\n};\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,MAAtB,EAA8BC,QAA9B,QAA8C,OAA9C;AACA,SAEIC,QAFJ,EAGIC,QAHJ,EAMIC,UANJ,QASO,cATP;AAWA,SACIC,OADJ,EAEIC,wBAFJ,EAGIC,gBAHJ,EAIIC,eAJJ,EAKIC,cALJ,EAMIC,UANJ,QAOO,yBAPP;AAQA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,SAAT,QAA0B,mBAA1B;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAiCA,MAAMC,cAAiC,GAAG;EACtCC,mBAAmB,EAAE,MADiB;EAEtCC,mBAAmB,EAAE,YAFiB;EAGtCC,qBAAqB,EAAE;AAHe,CAA1C;AAMA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,WAAW,GAAG,WAApB;AAEA,MAAMC,uBAAuB,GAAGnB,QAAQ,CAACoB,EAAT,KAAgB,KAAhD;;AACA,MAAMC,eAAe,GAAG,MAAMtB,QAAQ,CAACuB,OAAT,EAA9B;;AAEA,eAAe,SAASC,oBAAT,GAAwF;EAAA,IAA1DC,WAA0D,uEAAnCZ,cAAmC;EACnG,MAAM;IAAEC,mBAAF;IAAuBC,mBAAvB;IAA4CC;EAA5C,IAAyF,EAC3F,GAAGH,cADwF;IAE3F,GAAGY;EAFwF,CAA/F;EAKA,MAAMC,MAAM,GAAGd,eA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useRef","useState","Keyboard","Platform","StyleSheet","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","useSafeAreaInsets","useTheme","useHeight","useAppbarStyles","defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","OS","dismissKeyboard","dismiss","useCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","translateY","lastTranslateY","lastOffsetY","overlapped","isScrolled","setIsScrolled","theme","animatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","hairlineWidth","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","current","savedOffsetY","scrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","safeLastOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n isScrolled: boolean;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const [isScrolled, setIsScrolled] = useState<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n if (!isScrolled && offsetY > 0) {\n runOnJS(setIsScrolled)(true);\n } else if (isScrolled && offsetY <= 0) {\n runOnJS(setIsScrolled)(false);\n }\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - safeLastOffsetY;\n\n const newTranslateY = safeOffsetY <= 0\n ? 0\n : supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : safeLastOffsetY === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight, isScrolled]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n isScrolled,\n };\n};\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,MAAtB,EAA8BC,QAA9B,QAA8C,OAA9C;AACA,SAEIC,QAFJ,EAGIC,QAHJ,EAMIC,UANJ,QASO,cATP;AAWA,SACIC,OADJ,EAEIC,wBAFJ,EAGIC,gBAHJ,EAIIC,eAJJ,EAKIC,cALJ,EAMIC,UANJ,QAOO,yBAPP;AAQA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,SAAT,QAA0B,mBAA1B;AACA,OAAOC,eAAP,MAA4B,mBA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A7C,GAAiDmC,KAAxE;MAEA3B,UAAU,CAACM,KAAX,GAAmBkB,OAAO,GAAGoB,cAAV,GAA2B,CAA9C;MAEA/C,UAAU,CAACS,KAAX,GAAmBlC,UAAU,CAACwE,cAAD,EAAiB/D,gBAAjB,CAA7B;IACH;EA9E0C,CAAD,EA+E3C,CAACH,mBAAD,EAAsBc,YAAtB,EAAoCS,UAApC,CA/E2C,CAA9C;EAiFA,MAAM4C,cAAc,GAAGnD,wBAAwB,GAAG,CAAlD;EAEA,MAAMoD,WAAW,GAAG,CAChB1C,aADgB,EAEhB;IAAE2C,UAAU,EAAExD,cAAc,CAACyD;EAA7B,CAFgB,EAGhBH,cAAc,GAAGvD,MAAM,CAAC2D,QAAV,GAAqBC,SAHnB,CAApB;EAMA,OAAO;IACHJ,WADG;IAEHrD,cAFG;IAGHE,0BAHG;IAIH2B,QAAQ,EAAEH,aAJP;IAKHL,mBALG;IAMHqC,mBAAmB,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAGrD,YAAH,GAAkB;IAAvC,CANlB;IAOHS;EAPG,CAAP;AASH;AAAA"}
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  import type { ModalProps } from '../Modal';
3
3
  import type { OverridableComponentProps } from '../types';
4
4
  import { ANIMATION_TYPE } from '../Modal';
5
+ export declare const dialogSizes: readonly ["small", "medium", "large"];
6
+ export declare type DialogSize = typeof dialogSizes[number];
5
7
  export default interface DialogProps extends OverridableComponentProps<ModalProps, {
6
8
  /**
7
9
  * Type of animation used when the dialog opens and closes.
@@ -17,6 +19,11 @@ export default interface DialogProps extends OverridableComponentProps<ModalProp
17
19
  * @default false
18
20
  */
19
21
  fullScreen?: boolean;
22
+ /**
23
+ * Determines the minWidth of the Dialog.
24
+ * @default 'medium'
25
+ */
26
+ size?: DialogSize;
20
27
  /**
21
28
  * Top element for displaying additional information on the dialog.
22
29
  */
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type DialogProps from './LegacyDialogProps';
3
+ export default function Dialog(props: DialogProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import type { ModalProps } from '../Modal';
3
+ import type { OverridableComponentProps } from '../types';
4
+ import { ANIMATION_TYPE } from '../Modal';
5
+ export default interface DialogProps extends OverridableComponentProps<ModalProps, {
6
+ /**
7
+ * Type of animation used when the dialog opens and closes.
8
+ * @default 'slide'
9
+ */
10
+ animationType?: ANIMATION_TYPE;
11
+ /**
12
+ * Dialog children, usually the included sub-components.
13
+ */
14
+ children?: React.ReactNode;
15
+ /**
16
+ * If `true`, the dialog is full-screen.
17
+ * @default false
18
+ */
19
+ fullScreen?: boolean;
20
+ /**
21
+ * Top element for displaying additional information on the dialog.
22
+ */
23
+ topElement?: React.ReactNode;
24
+ }> {
25
+ }
@@ -1,2 +1,2 @@
1
- export { default } from './Dialog';
2
- export type { default as DialogProps } from './DialogProps';
1
+ export { default } from './LegacyDialog';
2
+ export type { default as DialogProps } from './LegacyDialogProps';
@@ -0,0 +1,6 @@
1
+ import type { NamedStylesStringUnion } from '@fountain-ui/styles';
2
+ import type { DialogSize } from './DialogProps';
3
+ declare type DialogStyleKeys = 'root' | 'container' | 'paper' | 'topElementContainer' | 'topElementContent' | 'mediaWrapper';
4
+ declare type DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;
5
+ export default function useDialogStyle(size: DialogSize, fullScreen: boolean): DialogStyles;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type DialogActionsProps from './DialogActionsProps';
3
+ export default function DialogActions(props: DialogActionsProps): JSX.Element;
@@ -1,2 +1,2 @@
1
- export { default } from './DialogActions';
1
+ export { default } from './LegacyDialogActions';
2
2
  export type { default as DialogActionsProps } from './DialogActionsProps';
@@ -1,10 +1,10 @@
1
+ import type { ScrollViewProps, TextStyle } from 'react-native';
1
2
  import type { OverridableComponentProps } from '../types';
2
- import type { ColumnProps } from '../Column';
3
- export default interface DialogContentProps extends OverridableComponentProps<ColumnProps, {
3
+ export default interface DialogContentProps extends OverridableComponentProps<ScrollViewProps, {
4
4
  /**
5
- * If `true`, the children won't be wrapped by a typography component.
6
- * @default false
5
+ * Sets the horizontal alignment of the text inside the dialog content.
6
+ * @default 'left'
7
7
  */
8
- disableTypography?: boolean;
8
+ textAlign?: TextStyle['textAlign'];
9
9
  }> {
10
10
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type DialogContentProps from './LegacyDialogContentProps';
3
+ export default function DialogContent(props: DialogContentProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { OverridableComponentProps } from '../types';
2
+ import type { ColumnProps } from '../Column';
3
+ export default interface DialogContentProps extends OverridableComponentProps<ColumnProps, {
4
+ /**
5
+ * If `true`, the children won't be wrapped by a typography component.
6
+ * @default false
7
+ */
8
+ disableTypography?: boolean;
9
+ }> {
10
+ }
@@ -1,2 +1,2 @@
1
- export { default } from './DialogContent';
2
- export type { default as DialogContentProps } from './DialogContentProps';
1
+ export { default } from './LegacyDialogContent';
2
+ export type { default as DialogContentProps } from './LegacyDialogContentProps';
@@ -1,15 +1,12 @@
1
- import type { ImageProps } from '../Image';
1
+ import type { ViewProps } from 'react-native';
2
2
  import type { OverridableComponentProps } from '../types';
3
- declare type BaseProps = Omit<ImageProps, 'source' | 'overlaidChildren'>;
4
- export default interface DialogMediaProps extends OverridableComponentProps<BaseProps, {
3
+ export declare const dialogMediaVariants: readonly ["image", "icon"];
4
+ export declare type DialogMediaVariant = typeof dialogMediaVariants[number];
5
+ export default interface DialogMediaProps extends OverridableComponentProps<ViewProps, {
5
6
  /**
6
- * The content of the component.
7
+ * Determines design variations of the component.
8
+ * @default 'image'
7
9
  */
8
- children?: ImageProps['overlaidChildren'];
9
- /**
10
- * Image to be displayed as a background image.
11
- */
12
- image: string;
10
+ variant?: DialogMediaVariant;
13
11
  }> {
14
12
  }
15
- export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type DialogMediaProps from './LegacyDialogMediaProps';
3
+ export default function DialogMedia(props: DialogMediaProps): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { ImageProps } from '../Image';
2
+ import type { OverridableComponentProps } from '../types';
3
+ declare type BaseProps = Omit<ImageProps, 'source' | 'overlaidChildren'>;
4
+ export default interface DialogMediaProps extends OverridableComponentProps<BaseProps, {
5
+ /**
6
+ * The content of the component.
7
+ */
8
+ children?: ImageProps['overlaidChildren'];
9
+ /**
10
+ * Image to be displayed as a background image.
11
+ */
12
+ image: string;
13
+ }> {
14
+ }
15
+ export {};
@@ -1,2 +1,2 @@
1
- export { default } from './DialogMedia';
2
- export type { default as DialogMediaProps } from './DialogMediaProps';
1
+ export { default } from './LegacyDialogMedia';
2
+ export type { default as DialogMediaProps } from './LegacyDialogMediaProps';
@@ -1,15 +1,4 @@
1
- import type { TypographyProps } from '../Typography';
1
+ import type { ViewProps } from 'react-native';
2
2
  import type { OverridableComponentProps } from '../types';
3
- import type { RowProps } from '../Row';
4
- export default interface DialogTitleProps extends OverridableComponentProps<RowProps, {
5
- /**
6
- * The content of the component.
7
- */
8
- children?: TypographyProps['children'];
9
- /**
10
- * If `true`, the children won't be wrapped by a typography component.
11
- * @default false
12
- */
13
- disableTypography?: boolean;
14
- }> {
3
+ export default interface DialogTitleProps extends OverridableComponentProps<ViewProps, {}> {
15
4
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type DialogTitleProps from './LegacyDialogTitleProps';
3
+ export default function DialogTitle(props: DialogTitleProps): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { TypographyProps } from '../Typography';
2
+ import type { OverridableComponentProps } from '../types';
3
+ import type { RowProps } from '../Row';
4
+ export default interface DialogTitleProps extends OverridableComponentProps<RowProps, {
5
+ /**
6
+ * The content of the component.
7
+ */
8
+ children?: TypographyProps['children'];
9
+ /**
10
+ * If `true`, the children won't be wrapped by a typography component.
11
+ * @default false
12
+ */
13
+ disableTypography?: boolean;
14
+ }> {
15
+ }
@@ -1,2 +1,2 @@
1
- export { default } from './DialogTitle';
2
- export type { default as DialogTitleProps } from './DialogTitleProps';
1
+ export { default } from './LegacyDialogTitle';
2
+ export type { default as DialogTitleProps } from './LegacyDialogTitleProps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fountain-ui/core",
3
- "version": "2.0.0-beta.94",
3
+ "version": "2.0.0-beta.96",
4
4
  "author": "Fountain-UI Team",
5
5
  "description": "React components that implement Tappytoon's Fountain Design.",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "prepare": "bob build"
15
15
  },
16
16
  "dependencies": {
17
- "@fountain-ui/styles": "^2.0.0-beta.12",
17
+ "@fountain-ui/styles": "^2.0.0-beta.13",
18
18
  "@fountain-ui/utils": "^2.0.0-beta.4"
19
19
  },
20
20
  "peerDependencies": {
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "2fa43d7feb0eaaa7f6bfa459b93e0f9ccd71ab86"
70
+ "gitHead": "8e0cb2b6f982d859b016d904fec45b9918620fb3"
71
71
  }