@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.
- package/build/commonjs/AppBar/AppBar.js +6 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/ButtonBase/index.js +2 -2
- package/build/commonjs/ButtonBase/index.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +21 -14
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +3 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/index.js +6 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +29 -19
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +7 -8
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js +1 -1
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Dialog/useDialogSectionStyle.js +5 -5
- package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +9 -8
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
- package/build/commonjs/DialogTitle/BackButton.js +47 -0
- package/build/commonjs/DialogTitle/BackButton.js.map +1 -0
- package/build/commonjs/DialogTitle/CloseButton.js +45 -0
- package/build/commonjs/DialogTitle/CloseButton.js.map +1 -0
- package/build/commonjs/DialogTitle/DialogTitle.js +11 -4
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +17 -9
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +1 -1
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Pagination/Pagination.js +2 -0
- package/build/commonjs/Pagination/Pagination.js.map +1 -1
- package/build/commonjs/Pagination/PaginationProps.js +3 -1
- package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
- package/build/commonjs/Pagination/index.js +6 -0
- package/build/commonjs/Pagination/index.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
- package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +7 -4
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -1
- package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
- package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/index.js +16 -0
- package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
- package/build/commonjs/Toolbar/Toolbar.js +8 -4
- package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
- package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js +4 -2
- package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
- package/build/commonjs/internal/icons/Close.js +4 -2
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/module/AppBar/AppBar.js +5 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/ButtonBase/index.js +1 -1
- package/build/module/ButtonBase/index.js.map +1 -1
- package/build/module/Chip/Chip.js +17 -13
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +1 -0
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/Chip/index.js +1 -1
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +29 -19
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +7 -8
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Dialog/useDialogSectionStyle.js +5 -5
- package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +9 -8
- package/build/module/Dialog/useDialogStyle.js.map +1 -1
- package/build/module/DialogTitle/BackButton.js +32 -0
- package/build/module/DialogTitle/BackButton.js.map +1 -0
- package/build/module/DialogTitle/CloseButton.js +30 -0
- package/build/module/DialogTitle/CloseButton.js.map +1 -0
- package/build/module/DialogTitle/DialogTitle.js +8 -3
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/Divider/Divider.js +7 -0
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +1 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Pagination/Pagination.js +2 -0
- package/build/module/Pagination/Pagination.js.map +1 -1
- package/build/module/Pagination/PaginationProps.js +1 -0
- package/build/module/Pagination/PaginationProps.js.map +1 -1
- package/build/module/Pagination/index.js +1 -1
- package/build/module/Pagination/index.js.map +1 -1
- package/build/module/PaginationItem/PaginationItem.js +28 -21
- package/build/module/PaginationItem/PaginationItem.js.map +1 -1
- package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +6 -4
- package/build/module/Tabs/useTabsStyle.js.map +1 -1
- package/build/module/Toolbar/BackButton/BackButton.js +32 -0
- package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/module/Toolbar/BackButton/index.js +2 -0
- package/build/module/Toolbar/BackButton/index.js.map +1 -0
- package/build/module/Toolbar/Toolbar.js +7 -3
- package/build/module/Toolbar/Toolbar.js.map +1 -1
- package/build/module/internal/icons/ChevronLeft.js +4 -2
- package/build/module/internal/icons/ChevronLeft.js.map +1 -1
- package/build/module/internal/icons/ChevronRight.js +4 -2
- package/build/module/internal/icons/ChevronRight.js.map +1 -1
- package/build/module/internal/icons/Close.js +4 -2
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Chip/ChipProps.d.ts +11 -4
- package/build/typescript/Chip/index.d.ts +1 -1
- package/build/typescript/Chip/useChipStyle.d.ts +4 -3
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogTitle/BackButton.d.ts +6 -0
- package/build/typescript/DialogTitle/CloseButton.d.ts +6 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +8 -1
- package/build/typescript/Divider/DividerProps.d.ts +1 -1
- package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
- package/build/typescript/Pagination/index.d.ts +2 -2
- package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
- package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
- package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
- package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
- package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
- package/package.json +2 -2
- package/src/AppBar/AppBar.tsx +4 -0
- package/src/ButtonBase/index.ts +1 -1
- package/src/Chip/Chip.tsx +20 -13
- package/src/Chip/ChipProps.ts +13 -4
- package/src/Chip/index.ts +1 -1
- package/src/Chip/useChipStyle.ts +34 -17
- package/src/Dialog/Dialog.tsx +7 -8
- package/src/Dialog/DialogProps.ts +1 -7
- package/src/Dialog/useDialogSectionStyle.ts +4 -4
- package/src/Dialog/useDialogStyle.ts +9 -7
- package/src/DialogTitle/BackButton.tsx +44 -0
- package/src/DialogTitle/CloseButton.tsx +42 -0
- package/src/DialogTitle/DialogTitle.tsx +9 -1
- package/src/Divider/Divider.tsx +5 -0
- package/src/Divider/DividerProps.ts +1 -1
- package/src/Pagination/Pagination.tsx +3 -2
- package/src/Pagination/PaginationProps.ts +15 -0
- package/src/Pagination/index.ts +2 -2
- package/src/PaginationItem/PaginationItem.tsx +31 -24
- package/src/PaginationItem/PaginationItemProps.ts +7 -0
- package/src/Tabs/useTabsStyle.ts +7 -4
- package/src/Toolbar/BackButton/BackButton.tsx +42 -0
- package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
- package/src/Toolbar/BackButton/index.ts +2 -0
- package/src/Toolbar/Toolbar.tsx +6 -1
- package/src/internal/icons/ChevronLeft.tsx +4 -1
- package/src/internal/icons/ChevronRight.tsx +4 -1
- package/src/internal/icons/Close.tsx +4 -1
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
- package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
- package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BackButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../internal");
|
|
15
|
+
|
|
16
|
+
var _styles = require("@fountain-ui/styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 20,
|
|
26
|
+
paddingLeft: 5,
|
|
27
|
+
paddingRight: 11,
|
|
28
|
+
paddingVertical: 8,
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
width: 40
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function BackButton(props) {
|
|
35
|
+
const {
|
|
36
|
+
style: styleProp,
|
|
37
|
+
...otherProps
|
|
38
|
+
} = props;
|
|
39
|
+
const rootStyle = (0, _styles.css)([styles.root, styleProp]);
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
41
|
+
style: rootStyle
|
|
42
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.ChevronLeft, {
|
|
43
|
+
color: 'strong',
|
|
44
|
+
size: 'large'
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=BackButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","height","left","paddingLeft","paddingRight","paddingVertical","position","width","BackButton","props","style","styleProp","otherProps","rootStyle","css"],"sources":["BackButton.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport type { IconButtonProps } from '../IconButton';\nimport IconButton from '../IconButton';\nimport { ChevronLeft } from '../internal';\nimport { css } from '@fountain-ui/styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 40,\n left: 20,\n paddingLeft: 5,\n paddingRight: 11,\n paddingVertical: 8,\n position: 'absolute',\n width: 40,\n },\n});\n\ninterface BackButtonProps extends Omit<IconButtonProps, 'children'> {}\n\nexport default function BackButton(props: BackButtonProps) {\n const {\n style: styleProp,\n ...otherProps\n } = props;\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <IconButton\n style={rootStyle}\n {...otherProps}\n >\n <ChevronLeft\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,MAAM,EAAE,EADN;IAEFC,IAAI,EAAE,EAFJ;IAGFC,WAAW,EAAE,CAHX;IAIFC,YAAY,EAAE,EAJZ;IAKFC,eAAe,EAAE,CALf;IAMFC,QAAQ,EAAE,UANR;IAOFC,KAAK,EAAE;EAPL;AADuB,CAAlB,CAAf;;AAce,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,KAAK,EAAEC,SADL;IAEF,GAAGC;EAFD,IAGFH,KAHJ;EAKA,MAAMI,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBjB,MAAM,CAACG,IADW,EAElBW,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,KAAK,EAAEE;EADX,GAEQD,UAFR,gBAII,6BAAC,qBAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CADJ;AAWH"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = CloseButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../internal");
|
|
15
|
+
|
|
16
|
+
var _styles = require("@fountain-ui/styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 20,
|
|
26
|
+
padding: 8,
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
width: 40
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function CloseButton(props) {
|
|
33
|
+
const {
|
|
34
|
+
style: styleProp,
|
|
35
|
+
...otherProps
|
|
36
|
+
} = props;
|
|
37
|
+
const rootStyle = (0, _styles.css)([styles.root, styleProp]);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
39
|
+
style: rootStyle
|
|
40
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.Close, {
|
|
41
|
+
color: 'strong',
|
|
42
|
+
size: 'large'
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=CloseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","height","left","padding","position","width","CloseButton","props","style","styleProp","otherProps","rootStyle","css"],"sources":["CloseButton.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport type { IconButtonProps } from '../IconButton';\nimport IconButton from '../IconButton';\nimport { Close } from '../internal';\nimport { css } from '@fountain-ui/styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 40,\n left: 20,\n padding: 8,\n position: 'absolute',\n width: 40,\n },\n});\n\ninterface CloseButtonProps extends Omit<IconButtonProps, 'children'> {}\n\nexport default function CloseButton(props: CloseButtonProps) {\n const {\n style: styleProp,\n ...otherProps\n } = props;\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <IconButton\n style={rootStyle}\n {...otherProps}\n >\n <Close\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,MAAM,EAAE,EADN;IAEFC,IAAI,EAAE,EAFJ;IAGFC,OAAO,EAAE,CAHP;IAIFC,QAAQ,EAAE,UAJR;IAKFC,KAAK,EAAE;EALL;AADuB,CAAlB,CAAf;;AAYe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,KAAK,EAAEC,SADL;IAEF,GAAGC;EAFD,IAGFH,KAHJ;EAKA,MAAMI,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBf,MAAM,CAACG,IADW,EAElBS,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,KAAK,EAAEE;EADX,GAEQD,UAFR,gBAII,6BAAC,eAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CADJ;AAWH"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -13,6 +13,10 @@ var _Dialog = require("../Dialog");
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _BackButton = _interopRequireDefault(require("./BackButton"));
|
|
17
|
+
|
|
18
|
+
var _CloseButton = _interopRequireDefault(require("./CloseButton"));
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
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); }
|
|
@@ -29,7 +33,7 @@ const useStyles = function () {
|
|
|
29
33
|
};
|
|
30
34
|
};
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
const DialogTitle = props => {
|
|
33
37
|
const {
|
|
34
38
|
children,
|
|
35
39
|
style: styleProp,
|
|
@@ -49,7 +53,10 @@ function DialogTitle(props) {
|
|
|
49
53
|
}), typeof children === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
50
54
|
style: titleStyle
|
|
51
55
|
}, children) : children);
|
|
52
|
-
}
|
|
56
|
+
};
|
|
53
57
|
|
|
54
|
-
;
|
|
58
|
+
DialogTitle.BackButton = _BackButton.default;
|
|
59
|
+
DialogTitle.CloseButton = _CloseButton.default;
|
|
60
|
+
var _default = DialogTitle;
|
|
61
|
+
exports.default = _default;
|
|
55
62
|
//# sourceMappingURL=DialogTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","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 { useDialogSectionStyle } from '../Dialog';\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\
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","BackButton","CloseButton"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport BackButton from './BackButton';\nimport CloseButton from './CloseButton';\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\nconst 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 sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\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\nDialogTitle.BackButton = BackButton;\n\nDialogTitle.CloseButton = CloseButton;\n\nexport default DialogTitle;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAKA,MAAM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 var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _styles = require("
|
|
12
|
+
var _styles = require("@fountain-ui/styles");
|
|
13
|
+
|
|
14
|
+
var _styles2 = require("../styles");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
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); }
|
|
17
19
|
|
|
18
|
-
const styles =
|
|
20
|
+
const styles = _styles2.StyleSheet.create({
|
|
19
21
|
container: {
|
|
20
22
|
alignSelf: 'stretch',
|
|
21
23
|
alignItems: 'center'
|
|
@@ -39,6 +41,12 @@ function selectBorderColor(theme, variant, vertical) {
|
|
|
39
41
|
|
|
40
42
|
case 'strong':
|
|
41
43
|
return vertical ? theme.palette.border.weak : theme.palette.border.base;
|
|
44
|
+
|
|
45
|
+
case 'strongStatic':
|
|
46
|
+
return _styles.commonColors.opacity.white['13'];
|
|
47
|
+
|
|
48
|
+
case 'baseStatic':
|
|
49
|
+
return _styles.commonColors.opacity.white['10'];
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
|
|
@@ -54,7 +62,7 @@ function Divider(props) {
|
|
|
54
62
|
vertical = false,
|
|
55
63
|
...otherProps
|
|
56
64
|
} = props;
|
|
57
|
-
const theme = (0,
|
|
65
|
+
const theme = (0, _styles2.useTheme)();
|
|
58
66
|
const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);
|
|
59
67
|
const fontColor = theme.palette.text.weak;
|
|
60
68
|
const borderColor = selectBorderColor(theme, variant, vertical);
|
|
@@ -86,8 +94,8 @@ function Divider(props) {
|
|
|
86
94
|
} : {
|
|
87
95
|
borderBottomWidth: borderWidth
|
|
88
96
|
};
|
|
89
|
-
const containerStyle = (0,
|
|
90
|
-
const dividerStyle = (0,
|
|
97
|
+
const containerStyle = (0, _styles2.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
|
|
98
|
+
const dividerStyle = (0, _styles2.css)([borderColorStyle, borderWidthStyle, styles.divider]);
|
|
91
99
|
const dividerMarginSize = theme.spacing(marginBetweenChildren);
|
|
92
100
|
const startDividerStyle = {
|
|
93
101
|
display: elementAlign !== 'start' ? 'flex' : 'none',
|
|
@@ -105,17 +113,17 @@ function Divider(props) {
|
|
|
105
113
|
marginLeft: dividerMarginSize
|
|
106
114
|
})
|
|
107
115
|
};
|
|
108
|
-
const fontStyle = (0,
|
|
116
|
+
const fontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
109
117
|
selector: typo => typo.caption2.medium,
|
|
110
118
|
color: fontColor
|
|
111
119
|
});
|
|
112
120
|
const element = typeof childrenProp === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
113
|
-
style: (0,
|
|
121
|
+
style: (0, _styles2.css)(fontStyle)
|
|
114
122
|
}, childrenProp) : childrenProp;
|
|
115
123
|
const children = childrenProp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
116
|
-
style: (0,
|
|
124
|
+
style: (0, _styles2.css)([dividerStyle, startDividerStyle])
|
|
117
125
|
}), element, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
118
|
-
style: (0,
|
|
126
|
+
style: (0, _styles2.css)([dividerStyle, endDividerStyle])
|
|
119
127
|
})) : null;
|
|
120
128
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
121
129
|
style: containerStyle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","container","alignSelf","alignItems","row","flexDirection","column","divider","flexGrow","selectBorderColor","theme","variant","vertical","palette","border","weaker","weak","base","Divider","props","borderWidth","borderWidthProp","children","childrenProp","elementAlign","inset","marginBetweenChildren","style","otherProps","useTheme","fontColor","text","borderColor","marginSize","spacing","insetSize","marginLeft","marginRight","marginTop","marginBottom","marginStyle","insetStyle","borderColorStyle","borderWidthStyle","borderRightWidth","borderBottomWidth","containerStyle","css","undefined","dividerStyle","dividerMarginSize","startDividerStyle","display","endDividerStyle","fontStyle","createFontStyle","selector","typo","caption2","medium","color","element"],"sources":["Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type DividerProps from './DividerProps';\nimport type { DividerVariant } from './DividerProps';\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n divider: {\n flexGrow: 1,\n },\n});\n\nfunction selectBorderColor(theme: Theme, variant: DividerVariant, vertical: boolean) {\n switch (variant) {\n default:\n case 'base':\n return vertical ? theme.palette.border.weaker : theme.palette.border.weak;\n case 'strong':\n return vertical ? theme.palette.border.weak : theme.palette.border.base;\n }\n}\n\nexport default function Divider(props: DividerProps) {\n const {\n borderWidth: borderWidthProp,\n children: childrenProp,\n elementAlign = 'center',\n inset = 0,\n marginBetweenChildren = 2,\n style,\n variant = 'base' as DividerVariant,\n vertical = false,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);\n const fontColor = theme.palette.text.weak;\n const borderColor = selectBorderColor(theme, variant, vertical);\n const marginSize = theme.spacing(1);\n const insetSize = theme.spacing(inset);\n\n const marginLeft = marginSize;\n const marginRight = marginSize;\n const marginTop = marginSize;\n const marginBottom = marginSize;\n\n const marginStyle = vertical\n ? { marginLeft, marginRight }\n : { marginTop, marginBottom };\n\n const insetStyle = vertical\n ? { marginTop: insetSize, marginBottom: insetSize }\n : { marginLeft: insetSize, marginRight: insetSize };\n\n const borderColorStyle = { borderColor };\n const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });\n\n const containerStyle = css([\n insetStyle,\n marginStyle,\n styles.container,\n vertical ? styles.column : styles.row,\n childrenProp ? undefined : borderColorStyle,\n childrenProp ? undefined : borderWidthStyle,\n style,\n ]);\n\n const dividerStyle = css([\n borderColorStyle,\n borderWidthStyle,\n styles.divider,\n ]);\n\n const dividerMarginSize = theme.spacing(marginBetweenChildren);\n const startDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'start' ? 'flex' : 'none',\n ...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),\n };\n const endDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'end' ? 'flex' : 'none',\n ...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),\n };\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2.medium,\n color: fontColor,\n });\n\n const element = typeof childrenProp === 'string'\n ? <Text style={css(fontStyle)}>{childrenProp}</Text>\n : childrenProp;\n\n const children = childrenProp ? (\n <React.Fragment>\n <View style={css([dividerStyle, startDividerStyle])}/>\n {element}\n <View style={css([dividerStyle, endDividerStyle])}/>\n </React.Fragment>\n ) : null;\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAKA,MAAMA,MAAM,GAAGC,
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","container","alignSelf","alignItems","row","flexDirection","column","divider","flexGrow","selectBorderColor","theme","variant","vertical","palette","border","weaker","weak","base","commonColors","opacity","white","Divider","props","borderWidth","borderWidthProp","children","childrenProp","elementAlign","inset","marginBetweenChildren","style","otherProps","useTheme","fontColor","text","borderColor","marginSize","spacing","insetSize","marginLeft","marginRight","marginTop","marginBottom","marginStyle","insetStyle","borderColorStyle","borderWidthStyle","borderRightWidth","borderBottomWidth","containerStyle","css","undefined","dividerStyle","dividerMarginSize","startDividerStyle","display","endDividerStyle","fontStyle","createFontStyle","selector","typo","caption2","medium","color","element"],"sources":["Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type DividerProps from './DividerProps';\nimport type { DividerVariant } from './DividerProps';\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n divider: {\n flexGrow: 1,\n },\n});\n\nfunction selectBorderColor(theme: Theme, variant: DividerVariant, vertical: boolean) {\n switch (variant) {\n default:\n case 'base':\n return vertical ? theme.palette.border.weaker : theme.palette.border.weak;\n case 'strong':\n return vertical ? theme.palette.border.weak : theme.palette.border.base;\n case 'strongStatic':\n return commonColors.opacity.white['13'];\n case 'baseStatic':\n return commonColors.opacity.white['10'];\n }\n}\n\nexport default function Divider(props: DividerProps) {\n const {\n borderWidth: borderWidthProp,\n children: childrenProp,\n elementAlign = 'center',\n inset = 0,\n marginBetweenChildren = 2,\n style,\n variant = 'base' as DividerVariant,\n vertical = false,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);\n const fontColor = theme.palette.text.weak;\n const borderColor = selectBorderColor(theme, variant, vertical);\n const marginSize = theme.spacing(1);\n const insetSize = theme.spacing(inset);\n\n const marginLeft = marginSize;\n const marginRight = marginSize;\n const marginTop = marginSize;\n const marginBottom = marginSize;\n\n const marginStyle = vertical\n ? { marginLeft, marginRight }\n : { marginTop, marginBottom };\n\n const insetStyle = vertical\n ? { marginTop: insetSize, marginBottom: insetSize }\n : { marginLeft: insetSize, marginRight: insetSize };\n\n const borderColorStyle = { borderColor };\n const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });\n\n const containerStyle = css([\n insetStyle,\n marginStyle,\n styles.container,\n vertical ? styles.column : styles.row,\n childrenProp ? undefined : borderColorStyle,\n childrenProp ? undefined : borderWidthStyle,\n style,\n ]);\n\n const dividerStyle = css([\n borderColorStyle,\n borderWidthStyle,\n styles.divider,\n ]);\n\n const dividerMarginSize = theme.spacing(marginBetweenChildren);\n const startDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'start' ? 'flex' : 'none',\n ...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),\n };\n const endDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'end' ? 'flex' : 'none',\n ...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),\n };\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2.medium,\n color: fontColor,\n });\n\n const element = typeof childrenProp === 'string'\n ? <Text style={css(fontStyle)}>{childrenProp}</Text>\n : childrenProp;\n\n const children = childrenProp ? (\n <React.Fragment>\n <View style={css([dividerStyle, startDividerStyle])}/>\n {element}\n <View style={css([dividerStyle, endDividerStyle])}/>\n </React.Fragment>\n ) : null;\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAKA,MAAMA,MAAM,GAAGC,mBAAA,CAAWC,MAAX,CAAkB;EAC7BC,SAAS,EAAE;IACPC,SAAS,EAAE,SADJ;IAEPC,UAAU,EAAE;EAFL,CADkB;EAK7BC,GAAG,EAAE;IACDC,aAAa,EAAE;EADd,CALwB;EAQ7BC,MAAM,EAAE;IACJD,aAAa,EAAE;EADX,CARqB;EAW7BE,OAAO,EAAE;IACLC,QAAQ,EAAE;EADL;AAXoB,CAAlB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AQ,GAAG;MAAE8B,YAAY,EAAEW;IAAhB,CAAH,GAAyC;MAAEb,WAAW,EAAEa;IAAf,CAArD;EAFqC,CAAzC;EAIA,MAAMG,eAA8B,GAAG;IACnCD,OAAO,EAAE5B,YAAY,KAAK,KAAjB,GAAyB,MAAzB,GAAkC,MADR;IAEnC,IAAIf,QAAQ,GAAG;MAAE6B,SAAS,EAAEY;IAAb,CAAH,GAAsC;MAAEd,UAAU,EAAEc;IAAd,CAAlD;EAFmC,CAAvC;EAKA,MAAMI,SAAS,GAAG,IAAAC,wBAAA,EAAgBhD,KAAhB,EAAuB;IACrCiD,QAAQ,EAAGC,IAAD,IAAUA,IAAI,CAACC,QAAL,CAAcC,MADG;IAErCC,KAAK,EAAE9B;EAF8B,CAAvB,CAAlB;EAKA,MAAM+B,OAAO,GAAG,OAAOtC,YAAP,KAAwB,QAAxB,gBACV,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAwB,YAAA,EAAIO,SAAJ;EAAb,GAA8B/B,YAA9B,CADU,GAEVA,YAFN;EAIA,MAAMD,QAAQ,GAAGC,YAAY,gBACzB,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAwB,YAAA,EAAI,CAACE,YAAD,EAAeE,iBAAf,CAAJ;EAAb,EADJ,EAEKU,OAFL,eAGI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAd,YAAA,EAAI,CAACE,YAAD,EAAeI,eAAf,CAAJ;EAAb,EAHJ,CADyB,GAMzB,IANJ;EAQA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEP;EADX,GAEQlB,UAFR,GAIKN,QAJL,CADJ;AAQH;;AAAA"}
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.dividerVariants = exports.dividerElementAligns = void 0;
|
|
7
7
|
const dividerElementAligns = ['start', 'center', 'end'];
|
|
8
8
|
exports.dividerElementAligns = dividerElementAligns;
|
|
9
|
-
const dividerVariants = ['base', 'strong'];
|
|
9
|
+
const dividerVariants = ['base', 'strong', 'baseStatic', 'strongStatic'];
|
|
10
10
|
exports.dividerVariants = dividerVariants;
|
|
11
11
|
//# sourceMappingURL=DividerProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dividerElementAligns","dividerVariants"],"sources":["DividerProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const dividerElementAligns = ['start', 'center', 'end'] as const;\nexport type DividerElementAlign = typeof dividerElementAligns[number];\n\nexport const dividerVariants = ['base', 'strong'] as const;\nexport type DividerVariant = typeof dividerVariants[number];\n\nexport default interface DividerProps extends OverridableComponentProps<ViewProps, {\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The size of the inset. It works as a multiplier factor based on spacing system.\n * @default 0\n */\n inset?: number;\n\n /**\n * If `true`, the divider orientation is set to vertical.\n * @default false\n */\n vertical?: boolean;\n\n /**\n * The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.\n * @default 2\n */\n marginBetweenChildren?: number;\n\n /**\n * The size of border width. It works as an actual pixel-based border width value of a divider.\n * @default if vertical is true 1, otherwise 0.5\n */\n borderWidth?: number;\n\n /**\n * Set position of children.\n * @default center\n */\n elementAlign?: DividerElementAlign;\n\n /**\n * Select the style of the divider based on this value.\n * @default base\n */\n variant?: DividerVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,oBAAoB,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAA7B;;AAGA,MAAMC,eAAe,GAAG,CAAC,MAAD,EAAS,QAAT,CAAxB"}
|
|
1
|
+
{"version":3,"names":["dividerElementAligns","dividerVariants"],"sources":["DividerProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const dividerElementAligns = ['start', 'center', 'end'] as const;\nexport type DividerElementAlign = typeof dividerElementAligns[number];\n\nexport const dividerVariants = ['base', 'strong', 'baseStatic', 'strongStatic'] as const;\nexport type DividerVariant = typeof dividerVariants[number];\n\nexport default interface DividerProps extends OverridableComponentProps<ViewProps, {\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The size of the inset. It works as a multiplier factor based on spacing system.\n * @default 0\n */\n inset?: number;\n\n /**\n * If `true`, the divider orientation is set to vertical.\n * @default false\n */\n vertical?: boolean;\n\n /**\n * The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.\n * @default 2\n */\n marginBetweenChildren?: number;\n\n /**\n * The size of border width. It works as an actual pixel-based border width value of a divider.\n * @default if vertical is true 1, otherwise 0.5\n */\n borderWidth?: number;\n\n /**\n * Set position of children.\n * @default center\n */\n elementAlign?: DividerElementAlign;\n\n /**\n * Select the style of the divider based on this value.\n * @default base\n */\n variant?: DividerVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,oBAAoB,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAA7B;;AAGA,MAAMC,eAAe,GAAG,CAAC,MAAD,EAAS,QAAT,EAAmB,YAAnB,EAAiC,cAAjC,CAAxB"}
|
|
@@ -66,6 +66,7 @@ function Pagination(props) {
|
|
|
66
66
|
const {
|
|
67
67
|
bundleSize = 1,
|
|
68
68
|
children,
|
|
69
|
+
color = 'base',
|
|
69
70
|
count,
|
|
70
71
|
disabled = false,
|
|
71
72
|
hideIndicator = false,
|
|
@@ -123,6 +124,7 @@ function Pagination(props) {
|
|
|
123
124
|
currentPage: page,
|
|
124
125
|
maxPage: count
|
|
125
126
|
}) : (0, _utils.times)(i => renderItem({
|
|
127
|
+
color,
|
|
126
128
|
index: i,
|
|
127
129
|
disabled,
|
|
128
130
|
selected: i === page
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","rootInline","flexDirection","alignItems","rootAnchor","items","justifyContent","marginTop","spacing","arrowContainer","prevInline","marginRight","prevAnchor","position","left","nextInline","marginLeft","nextAnchor","right","Pagination","props","bundleSize","children","count","disabled","hideIndicator","hideNextButton","hidePrevButton","infinite","onChange","page","renderItem","index","rest","style","variant","otherProps","styles","firstPage","lastPage","handleChange","nextPage","handlePrevPress","prevPage","handleNextPress","prevButton","nextButton","times","i","selected","containerProps","css"],"sources":["Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { times } from '@fountain-ui/utils';\nimport { ChevronLeft, ChevronRight } from '../internal/icons';\nimport { css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport PaginationItem from '../PaginationItem';\nimport NumberPagination from './NumberPagination';\nimport type PaginationProps from './PaginationProps';\nimport type { PaginationVariant } from './PaginationProps';\n\ntype PaginationStyleKeys =\n | 'root'\n | 'rootInline'\n | 'rootAnchor'\n | 'items'\n | 'arrowContainer'\n | 'prevInline'\n | 'prevAnchor'\n | 'nextInline'\n | 'nextAnchor';\n\ntype PaginationStyles = NamedStylesStringUnion<PaginationStyleKeys>;\n\nconst useStyles: UseStyles<PaginationStyles> = function (): PaginationStyles {\n const theme = useTheme();\n\n return {\n root: {},\n rootInline: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n rootAnchor: {\n flexDirection: 'column',\n },\n items: {\n flexDirection: 'row',\n justifyContent: 'center',\n marginTop: theme.spacing(2),\n },\n arrowContainer: {\n flexDirection: 'column',\n justifyContent: 'center',\n },\n prevInline: {\n marginRight: theme.spacing(1),\n },\n prevAnchor: {\n position: 'absolute',\n left: -24,\n },\n nextInline: {\n marginLeft: theme.spacing(1),\n },\n nextAnchor: {\n position: 'absolute',\n right: -24,\n },\n };\n};\n\nexport default function Pagination(props: PaginationProps) {\n const {\n bundleSize = 1,\n children,\n count,\n disabled = false,\n hideIndicator = false,\n hideNextButton = false,\n hidePrevButton = false,\n infinite = false,\n onChange,\n page,\n renderItem = ({ index, ...rest }) => <PaginationItem key={`${index}`} {...rest}/>,\n style,\n variant = 'dot' as PaginationVariant,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const firstPage = 0;\n const lastPage = count - 1;\n\n const handleChange = (nextPage: number) => {\n if (nextPage >= firstPage && nextPage <= lastPage) {\n if (onChange) {\n onChange(nextPage);\n }\n }\n };\n\n const handlePrevPress = () => {\n const prevPage = page - bundleSize >= firstPage\n ? page - bundleSize\n : (infinite ? count - bundleSize + page : firstPage);\n\n handleChange(prevPage);\n };\n\n const handleNextPress = () => {\n const nextPage = page + bundleSize <= lastPage\n ? page + bundleSize\n : (infinite ? page + bundleSize - count : lastPage);\n\n handleChange(nextPage);\n };\n\n const prevButton = !hidePrevButton ? (\n <IconButton\n disabled={disabled || (!infinite && page <= firstPage)}\n onPress={handlePrevPress}\n style={children ? styles.prevAnchor : styles.prevInline}\n >\n <ChevronLeft/>\n </IconButton>\n ) : null;\n\n const nextButton = !hideNextButton ? (\n <IconButton\n disabled={disabled || (!infinite && page + bundleSize > lastPage)}\n onPress={handleNextPress}\n style={children ? styles.nextAnchor : styles.nextInline}\n >\n <ChevronRight/>\n </IconButton>\n ) : null;\n\n const items = !hideIndicator ? (\n variant === 'number' ? (\n <NumberPagination\n currentPage={page}\n maxPage={count}\n />\n ) : times(i => renderItem({ index: i, disabled, selected: i === page }), count)\n ) : null;\n\n const containerProps = {\n style: css([\n styles.root,\n children ? styles.rootAnchor : styles.rootInline,\n style,\n ]),\n ...otherProps,\n };\n\n if (children) {\n return (\n <View {...containerProps}>\n <View style={css(styles.arrowContainer)}>\n {children}\n {prevButton}\n {nextButton}\n </View>\n\n <View style={css(styles.items)}>\n {items}\n </View>\n </View>\n );\n }\n\n return (\n <View {...containerProps}>\n {prevButton}\n {items}\n {nextButton}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAiBA,MAAMA,SAAsC,GAAG,YAA8B;EACzE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,UAAU,EAAE;MACRC,aAAa,EAAE,KADP;MAERC,UAAU,EAAE;IAFJ,CAFT;IAMHC,UAAU,EAAE;MACRF,aAAa,EAAE;IADP,CANT;IASHG,KAAK,EAAE;MACHH,aAAa,EAAE,KADZ;MAEHI,cAAc,EAAE,QAFb;MAGHC,SAAS,EAAET,KAAK,CAACU,OAAN,CAAc,CAAd;IAHR,CATJ;IAcHC,cAAc,EAAE;MACZP,aAAa,EAAE,QADH;MAEZI,cAAc,EAAE;IAFJ,CAdb;IAkBHI,UAAU,EAAE;MACRC,WAAW,EAAEb,KAAK,CAACU,OAAN,CAAc,CAAd;IADL,CAlBT;IAqBHI,UAAU,EAAE;MACRC,QAAQ,EAAE,UADF;MAERC,IAAI,EAAE,CAAC;IAFC,CArBT;IAyBHC,UAAU,EAAE;MACRC,UAAU,EAAElB,KAAK,CAACU,OAAN,CAAc,CAAd;IADJ,CAzBT;IA4BHS,UAAU,EAAE;MACRJ,QAAQ,EAAE,UADF;MAERK,KAAK,EAAE,CAAC;IAFA;EA5BT,CAAP;AAiCH,CApCD;;AAsCe,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,UAAU,GAAG,CADX;IAEFC,QAFE;IAGFC,
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","rootInline","flexDirection","alignItems","rootAnchor","items","justifyContent","marginTop","spacing","arrowContainer","prevInline","marginRight","prevAnchor","position","left","nextInline","marginLeft","nextAnchor","right","Pagination","props","bundleSize","children","color","count","disabled","hideIndicator","hideNextButton","hidePrevButton","infinite","onChange","page","renderItem","index","rest","style","variant","otherProps","styles","firstPage","lastPage","handleChange","nextPage","handlePrevPress","prevPage","handleNextPress","prevButton","nextButton","times","i","selected","containerProps","css"],"sources":["Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { times } from '@fountain-ui/utils';\nimport { ChevronLeft, ChevronRight } from '../internal/icons';\nimport { css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport PaginationItem from '../PaginationItem';\nimport NumberPagination from './NumberPagination';\nimport type PaginationProps from './PaginationProps';\nimport type { PaginationColor, PaginationVariant } from './PaginationProps';\n\ntype PaginationStyleKeys =\n | 'root'\n | 'rootInline'\n | 'rootAnchor'\n | 'items'\n | 'arrowContainer'\n | 'prevInline'\n | 'prevAnchor'\n | 'nextInline'\n | 'nextAnchor';\n\ntype PaginationStyles = NamedStylesStringUnion<PaginationStyleKeys>;\n\nconst useStyles: UseStyles<PaginationStyles> = function (): PaginationStyles {\n const theme = useTheme();\n\n return {\n root: {},\n rootInline: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n rootAnchor: {\n flexDirection: 'column',\n },\n items: {\n flexDirection: 'row',\n justifyContent: 'center',\n marginTop: theme.spacing(2),\n },\n arrowContainer: {\n flexDirection: 'column',\n justifyContent: 'center',\n },\n prevInline: {\n marginRight: theme.spacing(1),\n },\n prevAnchor: {\n position: 'absolute',\n left: -24,\n },\n nextInline: {\n marginLeft: theme.spacing(1),\n },\n nextAnchor: {\n position: 'absolute',\n right: -24,\n },\n };\n};\n\nexport default function Pagination(props: PaginationProps) {\n const {\n bundleSize = 1,\n children,\n color = 'base' as PaginationColor,\n count,\n disabled = false,\n hideIndicator = false,\n hideNextButton = false,\n hidePrevButton = false,\n infinite = false,\n onChange,\n page,\n renderItem = ({ index, ...rest }) => <PaginationItem key={`${index}`} {...rest}/>,\n style,\n variant = 'dot' as PaginationVariant,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const firstPage = 0;\n const lastPage = count - 1;\n\n const handleChange = (nextPage: number) => {\n if (nextPage >= firstPage && nextPage <= lastPage) {\n if (onChange) {\n onChange(nextPage);\n }\n }\n };\n\n const handlePrevPress = () => {\n const prevPage = page - bundleSize >= firstPage\n ? page - bundleSize\n : (infinite ? count - bundleSize + page : firstPage);\n\n handleChange(prevPage);\n };\n\n const handleNextPress = () => {\n const nextPage = page + bundleSize <= lastPage\n ? page + bundleSize\n : (infinite ? page + bundleSize - count : lastPage);\n\n handleChange(nextPage);\n };\n\n const prevButton = !hidePrevButton ? (\n <IconButton\n disabled={disabled || (!infinite && page <= firstPage)}\n onPress={handlePrevPress}\n style={children ? styles.prevAnchor : styles.prevInline}\n >\n <ChevronLeft/>\n </IconButton>\n ) : null;\n\n const nextButton = !hideNextButton ? (\n <IconButton\n disabled={disabled || (!infinite && page + bundleSize > lastPage)}\n onPress={handleNextPress}\n style={children ? styles.nextAnchor : styles.nextInline}\n >\n <ChevronRight/>\n </IconButton>\n ) : null;\n\n const items = !hideIndicator ? (\n variant === 'number' ? (\n <NumberPagination\n currentPage={page}\n maxPage={count}\n />\n ) : times(i => renderItem({ color, index: i, disabled, selected: i === page }), count)\n ) : null;\n\n const containerProps = {\n style: css([\n styles.root,\n children ? styles.rootAnchor : styles.rootInline,\n style,\n ]),\n ...otherProps,\n };\n\n if (children) {\n return (\n <View {...containerProps}>\n <View style={css(styles.arrowContainer)}>\n {children}\n {prevButton}\n {nextButton}\n </View>\n\n <View style={css(styles.items)}>\n {items}\n </View>\n </View>\n );\n }\n\n return (\n <View {...containerProps}>\n {prevButton}\n {items}\n {nextButton}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAiBA,MAAMA,SAAsC,GAAG,YAA8B;EACzE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,UAAU,EAAE;MACRC,aAAa,EAAE,KADP;MAERC,UAAU,EAAE;IAFJ,CAFT;IAMHC,UAAU,EAAE;MACRF,aAAa,EAAE;IADP,CANT;IASHG,KAAK,EAAE;MACHH,aAAa,EAAE,KADZ;MAEHI,cAAc,EAAE,QAFb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,6BAAC,yBAAD;IACI,WAAW,EAAEL,IADjB;IAEI,OAAO,EAAEP;EAFb,EADJ,GAKI,IAAAwB,YAAA,EAAMC,CAAC,IAAIjB,UAAU,CAAC;IAAET,KAAF;IAASU,KAAK,EAAEgB,CAAhB;IAAmBxB,QAAnB;IAA6ByB,QAAQ,EAAED,CAAC,KAAKlB;EAA7C,CAAD,CAArB,EAA4EP,KAA5E,CANM,GAOV,IAPJ;EASA,MAAM2B,cAAc,GAAG;IACnBhB,KAAK,EAAE,IAAAiB,WAAA,EAAI,CACPd,MAAM,CAACtC,IADA,EAEPsB,QAAQ,GAAGgB,MAAM,CAAClC,UAAV,GAAuBkC,MAAM,CAACrC,UAF/B,EAGPkC,KAHO,CAAJ,CADY;IAMnB,GAAGE;EANgB,CAAvB;;EASA,IAAIf,QAAJ,EAAc;IACV,oBACI,6BAAC,iBAAD,EAAU6B,cAAV,eACI,6BAAC,iBAAD;MAAM,KAAK,EAAE,IAAAC,WAAA,EAAId,MAAM,CAAC7B,cAAX;IAAb,GACKa,QADL,EAEKwB,UAFL,EAGKC,UAHL,CADJ,eAOI,6BAAC,iBAAD;MAAM,KAAK,EAAE,IAAAK,WAAA,EAAId,MAAM,CAACjC,KAAX;IAAb,GACKA,KADL,CAPJ,CADJ;EAaH;;EAED,oBACI,6BAAC,iBAAD,EAAU8C,cAAV,EACKL,UADL,EAEKzC,KAFL,EAGK0C,UAHL,CADJ;AAOH;;AAAA"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.paginationVariants = void 0;
|
|
6
|
+
exports.paginationVariants = exports.paginationColors = void 0;
|
|
7
|
+
const paginationColors = ['base', 'static'];
|
|
8
|
+
exports.paginationColors = paginationColors;
|
|
7
9
|
const paginationVariants = ['dot', 'number'];
|
|
8
10
|
exports.paginationVariants = paginationVariants;
|
|
9
11
|
//# sourceMappingURL=PaginationProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["paginationVariants"],"sources":["PaginationProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const paginationVariants = ['dot', 'number'] as const;\nexport type PaginationVariant = typeof paginationVariants[number];\n\nexport interface PaginationRenderItemParams {\n /**\n * Index of the pagination item.\n */\n index: number;\n\n /**\n * If `true`, the pagination item is disabled.\n */\n disabled: boolean;\n\n /**\n * If `true` the pagination item is selected.\n */\n selected: boolean;\n}\n\nexport default interface PaginationProps extends OverridableComponentProps<ViewProps, {\n /**\n * The Number of pages that change when the button is pressed\n * @default 1\n */\n bundleSize?: number,\n\n /**\n * The pagination will be added relative to this node.\n */\n children?: React.ReactNode;\n\n /**\n * The total number of pages.\n */\n count: number,\n\n /**\n * If `true`, the pagination is disabled.\n * @default false\n */\n disabled?: boolean;\n\n\n /**\n * If `true`, hide the page indicator.\n * @default false\n */\n hideIndicator?: boolean,\n\n /**\n * If `true`, hide the next-page button.\n * @default false\n */\n hideNextButton?: boolean,\n\n /**\n * If `true`, hide the previous-page button.\n * @default false\n */\n hidePrevButton?: boolean,\n\n /**\n * If `true`, pagination is infinite.\n * @default false\n */\n infinite?: boolean,\n\n /**\n * Callback fired when the page is changed.\n */\n onChange?: (page: number) => void,\n\n /**\n * The current page number.\n */\n page: number;\n\n /**\n * Render the item.\n * @default (item) => <PaginationItem {...item} />\n */\n renderItem?: (params: PaginationRenderItemParams) => React.ReactNode;\n\n /**\n * Determines design variations of the component.\n * @default 'dot'\n */\n variant?: PaginationVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,kBAAkB,GAAG,CAAC,KAAD,EAAQ,QAAR,CAA3B"}
|
|
1
|
+
{"version":3,"names":["paginationColors","paginationVariants"],"sources":["PaginationProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const paginationColors = ['base', 'static'] as const;\nexport type PaginationColor = typeof paginationColors[number];\n\nexport const paginationVariants = ['dot', 'number'] as const;\nexport type PaginationVariant = typeof paginationVariants[number];\n\nexport interface PaginationRenderItemParams {\n /**\n * Set color of dot.\n * @default 'base'\n */\n color?: PaginationColor;\n\n /**\n * Index of the pagination item.\n */\n index: number;\n\n /**\n * If `true`, the pagination item is disabled.\n */\n disabled: boolean;\n\n /**\n * If `true` the pagination item is selected.\n */\n selected: boolean;\n}\n\nexport default interface PaginationProps extends OverridableComponentProps<ViewProps, {\n /**\n * The Number of pages that change when the button is pressed\n * @default 1\n */\n bundleSize?: number,\n\n /**\n * The pagination will be added relative to this node.\n */\n children?: React.ReactNode;\n\n /**\n * Set color of dot.\n * @default 'base'\n */\n color?: PaginationColor;\n\n /**\n * The total number of pages.\n */\n count: number,\n\n /**\n * If `true`, the pagination is disabled.\n * @default false\n */\n disabled?: boolean;\n\n\n /**\n * If `true`, hide the page indicator.\n * @default false\n */\n hideIndicator?: boolean,\n\n /**\n * If `true`, hide the next-page button.\n * @default false\n */\n hideNextButton?: boolean,\n\n /**\n * If `true`, hide the previous-page button.\n * @default false\n */\n hidePrevButton?: boolean,\n\n /**\n * If `true`, pagination is infinite.\n * @default false\n */\n infinite?: boolean,\n\n /**\n * Callback fired when the page is changed.\n */\n onChange?: (page: number) => void,\n\n /**\n * The current page number.\n */\n page: number;\n\n /**\n * Render the item.\n * @default (item) => <PaginationItem {...item} />\n */\n renderItem?: (params: PaginationRenderItemParams) => React.ReactNode;\n\n /**\n * Determines design variations of the component.\n * @default 'dot'\n */\n variant?: PaginationVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,gBAAgB,GAAG,CAAC,MAAD,EAAS,QAAT,CAAzB;;AAGA,MAAMC,kBAAkB,GAAG,CAAC,KAAD,EAAQ,QAAR,CAA3B"}
|
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
return _Pagination.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "paginationColors", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _PaginationProps.paginationColors;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "paginationVariants", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Pagination';\nexport type { default as PaginationProps } from './PaginationProps';\nexport { paginationVariants } from './PaginationProps';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Pagination';\nexport type { default as PaginationProps, PaginationColor, PaginationVariant } from './PaginationProps';\nexport { paginationColors, paginationVariants } from './PaginationProps';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA"}
|
|
@@ -9,41 +9,51 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _styles = require("
|
|
12
|
+
var _styles = require("@fountain-ui/styles");
|
|
13
|
+
|
|
14
|
+
var _styles2 = require("../styles");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
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); }
|
|
17
19
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
const DEFAULT_SIZE = 6;
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
width: DEFAULT_SIZE,
|
|
25
|
+
height: DEFAULT_SIZE,
|
|
26
|
+
borderRadius: DEFAULT_SIZE * 0.5,
|
|
27
|
+
marginHorizontal: 4
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function getBackgroundColor(color, selected) {
|
|
32
|
+
const theme = (0, _styles2.useTheme)();
|
|
33
|
+
|
|
34
|
+
switch (color) {
|
|
35
|
+
case 'static':
|
|
36
|
+
return selected ? _styles.commonColors.static.strongInverse : _styles.commonColors.static.weakOpacityInverse;
|
|
37
|
+
|
|
38
|
+
case 'base':
|
|
39
|
+
default:
|
|
40
|
+
return selected ? theme.palette.fill.base : theme.palette.status.disabled;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
36
43
|
|
|
37
44
|
function PaginationItem(props) {
|
|
38
45
|
const {
|
|
46
|
+
color = 'base',
|
|
39
47
|
disabled,
|
|
40
|
-
selected,
|
|
48
|
+
selected = false,
|
|
41
49
|
style,
|
|
42
50
|
...otherProps
|
|
43
51
|
} = props;
|
|
44
|
-
const
|
|
52
|
+
const backgroundColor = getBackgroundColor(color, selected);
|
|
45
53
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
46
|
-
style: (0,
|
|
54
|
+
style: (0, _styles2.css)([styles.root, {
|
|
55
|
+
backgroundColor
|
|
56
|
+
}, style])
|
|
47
57
|
}, otherProps));
|
|
48
58
|
}
|
|
49
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["DEFAULT_SIZE","styles","StyleSheet","create","root","width","height","borderRadius","marginHorizontal","getBackgroundColor","color","selected","theme","useTheme","commonColors","static","strongInverse","weakOpacityInverse","palette","fill","base","status","disabled","PaginationItem","props","style","otherProps","backgroundColor","css","React","memo"],"sources":["PaginationItem.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, View, ViewStyle } from 'react-native';\nimport { commonColors, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { PaginationColor } from '../Pagination';\nimport { css, useTheme } from '../styles';\nimport type PaginationItemProps from './PaginationItemProps';\n\nconst DEFAULT_SIZE = 6;\n\nconst styles = StyleSheet.create({\n root: {\n width: DEFAULT_SIZE,\n height: DEFAULT_SIZE,\n borderRadius: DEFAULT_SIZE * 0.5,\n marginHorizontal: 4,\n },\n});\n\nfunction getBackgroundColor(color: PaginationColor, selected: boolean): ViewStyle['backgroundColor'] {\n const theme = useTheme();\n\n switch (color) {\n case 'static':\n return selected\n ? commonColors.static.strongInverse\n : commonColors.static.weakOpacityInverse;\n case 'base':\n default:\n return selected\n ? theme.palette.fill.base\n : theme.palette.status.disabled;\n\n }\n}\n\nfunction PaginationItem(props: PaginationItemProps) {\n const {\n color = 'base' as PaginationColor,\n disabled,\n selected = false,\n style,\n ...otherProps\n } = props;\n\n const backgroundColor = getBackgroundColor(color, selected);\n\n return (\n <View\n style={css([\n styles.root,\n { backgroundColor },\n style,\n ])}\n {...otherProps}\n />\n );\n}\n\nexport default React.memo(PaginationItem);\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;;;AAGA,MAAMA,YAAY,GAAG,CAArB;;AAEA,MAAMC,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,KAAK,EAAEL,YADL;IAEFM,MAAM,EAAEN,YAFN;IAGFO,YAAY,EAAEP,YAAY,GAAG,GAH3B;IAIFQ,gBAAgB,EAAE;EAJhB;AADuB,CAAlB,CAAf;;AASA,SAASC,kBAAT,CAA4BC,KAA5B,EAAoDC,QAApD,EAAqG;EACjG,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;;EAEA,QAAQH,KAAR;IACI,KAAK,QAAL;MACI,OAAOC,QAAQ,GACTG,oBAAA,CAAaC,MAAb,CAAoBC,aADX,GAETF,oBAAA,CAAaC,MAAb,CAAoBE,kBAF1B;;IAGJ,KAAK,MAAL;IACA;MACI,OAAON,QAAQ,GACTC,KAAK,CAACM,OAAN,CAAcC,IAAd,CAAmBC,IADV,GAETR,KAAK,CAACM,OAAN,CAAcG,MAAd,CAAqBC,QAF3B;EAPR;AAYH;;AAED,SAASC,cAAT,CAAwBC,KAAxB,EAAoD;EAChD,MAAM;IACFd,KAAK,GAAG,MADN;IAEFY,QAFE;IAGFX,QAAQ,GAAG,KAHT;IAIFc,KAJE;IAKF,GAAGC;EALD,IAMFF,KANJ;EAQA,MAAMG,eAAe,GAAGlB,kBAAkB,CAACC,KAAD,EAAQC,QAAR,CAA1C;EAEA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAE,IAAAiB,YAAA,EAAI,CACP3B,MAAM,CAACG,IADA,EAEP;MAAEuB;IAAF,CAFO,EAGPF,KAHO,CAAJ;EADX,GAMQC,UANR,EADJ;AAUH;;4BAEcG,cAAA,CAAMC,IAAN,CAAWP,cAAX,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["PaginationItemProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport default interface PaginationItemProps extends OverridableComponentProps<ViewProps, {\n /**\n * If `true`, the pagination item is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * If `true` the pagination item is selected.\n * @default false\n */\n selected?: boolean;\n}> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["PaginationItemProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport { PaginationColor } from '../Pagination';\n\nexport default interface PaginationItemProps extends OverridableComponentProps<ViewProps, {\n /**\n * Set color of dot.\n * @default 'base'\n */\n color?: PaginationColor;\n\n /**\n * If `true`, the pagination item is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * If `true` the pagination item is selected.\n * @default false\n */\n selected?: boolean;\n}> {}\n"],"mappings":""}
|
|
@@ -7,17 +7,20 @@ exports.default = useTabsStyle;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
+
var _hooks = require("../hooks");
|
|
11
|
+
|
|
10
12
|
var _styles = require("../styles");
|
|
11
13
|
|
|
12
14
|
function useTabsStyle(variant) {
|
|
13
15
|
const theme = (0, _styles.useTheme)();
|
|
16
|
+
const isDesktop = (0, _hooks.useBreakpointUp)('md', true, false);
|
|
14
17
|
return (0, _react.useMemo)(() => {
|
|
15
18
|
switch (variant) {
|
|
16
19
|
case 'circular':
|
|
17
20
|
return {
|
|
18
21
|
container: {
|
|
19
|
-
paddingBottom:
|
|
20
|
-
paddingHorizontal:
|
|
22
|
+
paddingBottom: 8,
|
|
23
|
+
paddingHorizontal: isDesktop ? 20 : 12
|
|
21
24
|
}
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -30,10 +33,10 @@ function useTabsStyle(variant) {
|
|
|
30
33
|
default:
|
|
31
34
|
return {
|
|
32
35
|
container: {
|
|
33
|
-
paddingHorizontal:
|
|
36
|
+
paddingHorizontal: isDesktop ? 14 : 6
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
}, [theme, variant]);
|
|
40
|
+
}, [theme, variant, isDesktop]);
|
|
38
41
|
}
|
|
39
42
|
//# sourceMappingURL=useTabsStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTabsStyle","variant","theme","useTheme","useMemo","container","paddingBottom","
|
|
1
|
+
{"version":3,"names":["useTabsStyle","variant","theme","useTheme","isDesktop","useBreakpointUp","useMemo","container","paddingBottom","paddingHorizontal"],"sources":["useTabsStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { useBreakpointUp } from '../hooks';\nimport { useTheme } from '../styles';\nimport type { TabVariant } from '../Tab';\n\ninterface TabsStyle {\n container: FountainUiStyle;\n}\n\nexport default function useTabsStyle(variant: TabVariant) {\n const theme = useTheme();\n\n const isDesktop = useBreakpointUp('md', true, false);\n\n return useMemo<TabsStyle>(() => {\n switch (variant) {\n case 'circular':\n return {\n container: {\n paddingBottom: 8,\n paddingHorizontal: isDesktop ? 20 : 12,\n },\n };\n case 'bottom-navigation':\n return {\n container: {},\n };\n case 'default':\n default:\n return {\n container: {\n paddingHorizontal: isDesktop ? 14 : 6,\n },\n };\n }\n }, [theme, variant, isDesktop]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAOe,SAASA,YAAT,CAAsBC,OAAtB,EAA2C;EACtD,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMC,SAAS,GAAG,IAAAC,sBAAA,EAAgB,IAAhB,EAAsB,IAAtB,EAA4B,KAA5B,CAAlB;EAEA,OAAO,IAAAC,cAAA,EAAmB,MAAM;IAC5B,QAAQL,OAAR;MACI,KAAK,UAAL;QACI,OAAO;UACHM,SAAS,EAAE;YACPC,aAAa,EAAE,CADR;YAEPC,iBAAiB,EAAEL,SAAS,GAAG,EAAH,GAAQ;UAF7B;QADR,CAAP;;MAMJ,KAAK,mBAAL;QACI,OAAO;UACHG,SAAS,EAAE;QADR,CAAP;;MAGJ,KAAK,SAAL;MACA;QACI,OAAO;UACHA,SAAS,EAAE;YACPE,iBAAiB,EAAEL,SAAS,GAAG,EAAH,GAAQ;UAD7B;QADR,CAAP;IAdR;EAoBH,CArBM,EAqBJ,CAACF,KAAD,EAAQD,OAAR,EAAiBG,SAAjB,CArBI,CAAP;AAsBH"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BackButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../../internal");
|
|
15
|
+
|
|
16
|
+
var _styles = require("@fountain-ui/styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 4,
|
|
26
|
+
paddingLeft: 5,
|
|
27
|
+
paddingRight: 11,
|
|
28
|
+
paddingVertical: 8,
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
width: 40
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function BackButton(props) {
|
|
35
|
+
const {
|
|
36
|
+
style: styleProp,
|
|
37
|
+
...otherProps
|
|
38
|
+
} = props;
|
|
39
|
+
const rootStyle = (0, _styles.css)([styles.root, styleProp]);
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
41
|
+
style: rootStyle
|
|
42
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.ChevronLeft, {
|
|
43
|
+
color: 'strong',
|
|
44
|
+
size: 'large'
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=BackButton.js.map
|