@pagopa/io-app-design-system 4.5.1 → 4.5.3
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/lib/commonjs/components/accordion/AccordionItem.js +1 -1
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +25 -25
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +41 -97
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +70 -63
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +29 -27
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +27 -27
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +5 -7
- package/lib/commonjs/components/icons/svg/IconProductIOAppBlueBg.js +8 -20
- package/lib/commonjs/components/icons/svg/IconProductIOAppBlueBg.js.map +1 -1
- package/lib/commonjs/components/icons/svg/originals/IconProductIOAppBlueBg.svg +12 -9
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +2 -2
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +24 -14
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +4 -3
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +17 -3
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/module/components/accordion/AccordionItem.js +1 -1
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +26 -26
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +42 -98
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +73 -66
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +30 -28
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +28 -28
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +5 -7
- package/lib/module/components/icons/svg/IconProductIOAppBlueBg.js +9 -21
- package/lib/module/components/icons/svg/IconProductIOAppBlueBg.js.map +1 -1
- package/lib/module/components/icons/svg/originals/IconProductIOAppBlueBg.svg +12 -9
- package/lib/module/components/layout/HeaderFirstLevel.js +2 -2
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +26 -16
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +1 -1
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +4 -3
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/core/IOColors.js +17 -3
- package/lib/module/core/IOColors.js.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +2 -2
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButton.d.ts +2 -1
- package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconProductIOAppBlueBg.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts +2 -2
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/core/IOColors.d.ts +1 -1
- package/lib/typescript/core/IOColors.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +2 -2
- package/lib/typescript/utils/fonts.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/accordion/AccordionItem.tsx +1 -1
- package/src/components/buttons/ButtonLink.tsx +37 -30
- package/src/components/buttons/ButtonOutline.tsx +51 -108
- package/src/components/buttons/ButtonSolid.tsx +94 -78
- package/src/components/buttons/IconButton.tsx +45 -29
- package/src/components/buttons/IconButtonSolid.tsx +35 -31
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +5 -7
- package/src/components/icons/svg/IconProductIOAppBlueBg.tsx +12 -13
- package/src/components/icons/svg/originals/IconProductIOAppBlueBg.svg +12 -9
- package/src/components/layout/HeaderFirstLevel.tsx +4 -4
- package/src/components/layout/HeaderSecondLevel.tsx +43 -23
- package/src/components/listitems/ListItemInfo.tsx +1 -1
- package/src/components/listitems/ListItemInfoCopy.tsx +1 -1
- package/src/components/listitems/ListItemNav.tsx +5 -4
- package/src/core/IOColors.ts +25 -4
- package/lib/commonjs/components/layout/BlockButtons.js +0 -85
- package/lib/commonjs/components/layout/BlockButtons.js.map +0 -1
- package/lib/module/components/layout/BlockButtons.js +0 -76
- package/lib/module/components/layout/BlockButtons.js.map +0 -1
- package/lib/typescript/components/layout/BlockButtons.d.ts +0 -54
- package/lib/typescript/components/layout/BlockButtons.d.ts.map +0 -1
- package/src/components/layout/BlockButtons.tsx +0 -143
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BlockButtons = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _Spacer = require("../spacer/Spacer");
|
|
10
|
-
var _buttons = require("../buttons");
|
|
11
|
-
var _core = require("../../core");
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
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); }
|
|
15
|
-
const styles = _reactNative.StyleSheet.create({
|
|
16
|
-
button: {
|
|
17
|
-
alignContent: "center",
|
|
18
|
-
justifyContent: "center",
|
|
19
|
-
flex: 1
|
|
20
|
-
},
|
|
21
|
-
buttonTwoThirds: {
|
|
22
|
-
alignContent: "center",
|
|
23
|
-
flex: 2
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* | single button |
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* | left | right |
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* | left | right |
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* | left | right |
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* | left | mid | right |
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Implements a component that show buttons on a line on 1, 2 or 3 buttons
|
|
49
|
-
* @deprecated This component is deprecated. Use `FooterActionsInline` instead.
|
|
50
|
-
*/
|
|
51
|
-
const BlockButtons = props => {
|
|
52
|
-
const renderRightButton = () => {
|
|
53
|
-
if (props.type === "SingleButton") {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
const secondaryButtonStyle = props.type === "TwoButtonsInlineThird" ? styles.buttonTwoThirds : styles.button;
|
|
57
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Spacer.HSpacer, {
|
|
58
|
-
size: 16
|
|
59
|
-
}), renderButton(props.secondary, secondaryButtonStyle));
|
|
60
|
-
};
|
|
61
|
-
const renderMidButton = () => {
|
|
62
|
-
if (props.type !== "ThreeButtonsInLine") {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Spacer.HSpacer, {
|
|
66
|
-
size: 16
|
|
67
|
-
}), renderButton(props.third, styles.button));
|
|
68
|
-
};
|
|
69
|
-
const renderLeftButton = () => {
|
|
70
|
-
const primaryButtonStyle = props.type === "TwoButtonsInlineThirdInverted" ? styles.buttonTwoThirds : styles.button;
|
|
71
|
-
return renderButton(props.primary, primaryButtonStyle);
|
|
72
|
-
};
|
|
73
|
-
const renderButton = (props, style) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
74
|
-
style: style
|
|
75
|
-
}, props.type === "Solid" ? /*#__PURE__*/React.createElement(_buttons.ButtonSolid, _extends({
|
|
76
|
-
fullWidth: true
|
|
77
|
-
}, props.buttonProps)) : /*#__PURE__*/React.createElement(_buttons.ButtonOutline, _extends({
|
|
78
|
-
fullWidth: true
|
|
79
|
-
}, props.buttonProps)));
|
|
80
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
81
|
-
style: _core.IOStyles.row
|
|
82
|
-
}, renderLeftButton(), renderMidButton(), renderRightButton());
|
|
83
|
-
};
|
|
84
|
-
exports.BlockButtons = BlockButtons;
|
|
85
|
-
//# sourceMappingURL=BlockButtons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_Spacer","_buttons","_core","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","styles","StyleSheet","create","button","alignContent","justifyContent","flex","buttonTwoThirds","BlockButtons","props","renderRightButton","type","secondaryButtonStyle","createElement","Fragment","HSpacer","size","renderButton","secondary","renderMidButton","third","renderLeftButton","primaryButtonStyle","primary","style","View","ButtonSolid","fullWidth","buttonProps","ButtonOutline","IOStyles","row","exports"],"sourceRoot":"../../../../src","sources":["components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,CAACC;EAAI,GACvBV,gBAAgB,CAAC,CAAC,EAClBF,eAAe,CAAC,CAAC,EACjBT,iBAAiB,CAAC,CACf,CAAC;AAEX,CAAC;AAACsB,OAAA,CAAAxB,YAAA,GAAAA,YAAA"}
|
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
import * as React from "react";
|
|
3
|
-
import { View, StyleSheet } from "react-native";
|
|
4
|
-
import { HSpacer } from "../spacer/Spacer";
|
|
5
|
-
import { ButtonOutline, ButtonSolid } from "../buttons";
|
|
6
|
-
import { IOStyles } from "../../core";
|
|
7
|
-
const styles = StyleSheet.create({
|
|
8
|
-
button: {
|
|
9
|
-
alignContent: "center",
|
|
10
|
-
justifyContent: "center",
|
|
11
|
-
flex: 1
|
|
12
|
-
},
|
|
13
|
-
buttonTwoThirds: {
|
|
14
|
-
alignContent: "center",
|
|
15
|
-
flex: 2
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* | single button |
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* | left | right |
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* | left | right |
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* | left | right |
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* | left | mid | right |
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Implements a component that show buttons on a line on 1, 2 or 3 buttons
|
|
41
|
-
* @deprecated This component is deprecated. Use `FooterActionsInline` instead.
|
|
42
|
-
*/
|
|
43
|
-
export const BlockButtons = props => {
|
|
44
|
-
const renderRightButton = () => {
|
|
45
|
-
if (props.type === "SingleButton") {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
const secondaryButtonStyle = props.type === "TwoButtonsInlineThird" ? styles.buttonTwoThirds : styles.button;
|
|
49
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HSpacer, {
|
|
50
|
-
size: 16
|
|
51
|
-
}), renderButton(props.secondary, secondaryButtonStyle));
|
|
52
|
-
};
|
|
53
|
-
const renderMidButton = () => {
|
|
54
|
-
if (props.type !== "ThreeButtonsInLine") {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HSpacer, {
|
|
58
|
-
size: 16
|
|
59
|
-
}), renderButton(props.third, styles.button));
|
|
60
|
-
};
|
|
61
|
-
const renderLeftButton = () => {
|
|
62
|
-
const primaryButtonStyle = props.type === "TwoButtonsInlineThirdInverted" ? styles.buttonTwoThirds : styles.button;
|
|
63
|
-
return renderButton(props.primary, primaryButtonStyle);
|
|
64
|
-
};
|
|
65
|
-
const renderButton = (props, style) => /*#__PURE__*/React.createElement(View, {
|
|
66
|
-
style: style
|
|
67
|
-
}, props.type === "Solid" ? /*#__PURE__*/React.createElement(ButtonSolid, _extends({
|
|
68
|
-
fullWidth: true
|
|
69
|
-
}, props.buttonProps)) : /*#__PURE__*/React.createElement(ButtonOutline, _extends({
|
|
70
|
-
fullWidth: true
|
|
71
|
-
}, props.buttonProps)));
|
|
72
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
73
|
-
style: IOStyles.row
|
|
74
|
-
}, renderLeftButton(), renderMidButton(), renderRightButton());
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=BlockButtons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","HSpacer","ButtonOutline","ButtonSolid","IOStyles","styles","create","button","alignContent","justifyContent","flex","buttonTwoThirds","BlockButtons","props","renderRightButton","type","secondaryButtonStyle","createElement","Fragment","size","renderButton","secondary","renderMidButton","third","renderLeftButton","primaryButtonStyle","primary","style","_extends","fullWidth","buttonProps","row"],"sourceRoot":"../../../../src","sources":["components/layout/BlockButtons.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,aAAa,EAAEC,WAAW,QAAQ,YAAY;AACvD,SAASC,QAAQ,QAAQ,YAAY;AAErC,MAAMC,MAAM,GAAGL,UAAU,CAACM,MAAM,CAAC;EAC/BC,MAAM,EAAE;IACNC,YAAY,EAAE,QAAQ;IACtBC,cAAc,EAAE,QAAQ;IACxBC,IAAI,EAAE;EACR,CAAC;EACDC,eAAe,EAAE;IACfH,YAAY,EAAE,QAAQ;IACtBE,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAYF;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA,OAAO,MAAME,YAAY,GAAIC,KAAY,IAAK;EAC5C,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;IAC9B,IAAID,KAAK,CAACE,IAAI,KAAK,cAAc,EAAE;MACjC,OAAO,IAAI;IACb;IAEA,MAAMC,oBAAoB,GACxBH,KAAK,CAACE,IAAI,KAAK,uBAAuB,GAClCV,MAAM,CAACM,eAAe,GACtBN,MAAM,CAACE,MAAM;IAEnB,oBACET,KAAA,CAAAmB,aAAA,CAACnB,KAAK,CAACoB,QAAQ,qBACbpB,KAAA,CAAAmB,aAAA,CAAChB,OAAO;MAACkB,IAAI,EAAE;IAAG,CAAE,CAAC,EACpBC,YAAY,CAACP,KAAK,CAACQ,SAAS,EAAEL,oBAAoB,CACrC,CAAC;EAErB,CAAC;EAED,MAAMM,eAAe,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
|
3
|
-
type CommonProps = Readonly<{
|
|
4
|
-
primary: BlockButtonProps;
|
|
5
|
-
accessible?: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
export type BlockButtonProps = {
|
|
8
|
-
type: "Solid" | "Outline";
|
|
9
|
-
buttonProps: Omit<React.ComponentProps<typeof ButtonSolid>, "fullWidth">;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* | single button |
|
|
13
|
-
*/
|
|
14
|
-
export interface SingleButton extends CommonProps {
|
|
15
|
-
type: "SingleButton";
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* | left | right |
|
|
19
|
-
*/
|
|
20
|
-
export interface TwoButtonsInlineHalf extends CommonProps {
|
|
21
|
-
type: "TwoButtonsInlineHalf";
|
|
22
|
-
secondary: BlockButtonProps;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* | left | right |
|
|
26
|
-
*/
|
|
27
|
-
interface TwoButtonsInlineThird extends CommonProps {
|
|
28
|
-
type: "TwoButtonsInlineThird";
|
|
29
|
-
secondary: BlockButtonProps;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* | left | right |
|
|
33
|
-
*/
|
|
34
|
-
interface TwoButtonsInlineThirdInverted extends CommonProps {
|
|
35
|
-
type: "TwoButtonsInlineThirdInverted";
|
|
36
|
-
secondary: BlockButtonProps;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* | left | mid | right |
|
|
40
|
-
*/
|
|
41
|
-
interface ThreeButtonsInLine extends CommonProps {
|
|
42
|
-
type: "ThreeButtonsInLine";
|
|
43
|
-
secondary: BlockButtonProps;
|
|
44
|
-
third: BlockButtonProps;
|
|
45
|
-
}
|
|
46
|
-
type Props = SingleButton | TwoButtonsInlineHalf | TwoButtonsInlineThird | TwoButtonsInlineThirdInverted | ThreeButtonsInLine;
|
|
47
|
-
export type BlockButtonsProps = Props;
|
|
48
|
-
/**
|
|
49
|
-
* Implements a component that show buttons on a line on 1, 2 or 3 buttons
|
|
50
|
-
* @deprecated This component is deprecated. Use `FooterActionsInline` instead.
|
|
51
|
-
*/
|
|
52
|
-
export declare const BlockButtons: (props: Props) => React.JSX.Element;
|
|
53
|
-
export {};
|
|
54
|
-
//# sourceMappingURL=BlockButtons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/BlockButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAexD,KAAK,WAAW,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;CAC1E,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,IAAI,EAAE,sBAAsB,CAAC;IAC7B,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,qBAAsB,SAAQ,WAAW;IACjD,IAAI,EAAE,uBAAuB,CAAC;IAC9B,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,6BAA8B,SAAQ,WAAW;IACzD,IAAI,EAAE,+BAA+B,CAAC;IACtC,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,kBAAmB,SAAQ,WAAW;IAC9C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,KAAK,KAAK,GACN,YAAY,GACZ,oBAAoB,GACpB,qBAAqB,GACrB,6BAA6B,GAC7B,kBAAkB,CAAC;AAEvB,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,YAAY,UAAW,KAAK,sBA6DxC,CAAC"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { HSpacer } from "../spacer/Spacer";
|
|
4
|
-
import { ButtonOutline, ButtonSolid } from "../buttons";
|
|
5
|
-
import { IOStyles } from "../../core";
|
|
6
|
-
|
|
7
|
-
const styles = StyleSheet.create({
|
|
8
|
-
button: {
|
|
9
|
-
alignContent: "center",
|
|
10
|
-
justifyContent: "center",
|
|
11
|
-
flex: 1
|
|
12
|
-
},
|
|
13
|
-
buttonTwoThirds: {
|
|
14
|
-
alignContent: "center",
|
|
15
|
-
flex: 2
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
type CommonProps = Readonly<{
|
|
20
|
-
primary: BlockButtonProps;
|
|
21
|
-
accessible?: boolean;
|
|
22
|
-
}>;
|
|
23
|
-
|
|
24
|
-
export type BlockButtonProps = {
|
|
25
|
-
type: "Solid" | "Outline";
|
|
26
|
-
buttonProps: Omit<React.ComponentProps<typeof ButtonSolid>, "fullWidth">;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* | single button |
|
|
31
|
-
*/
|
|
32
|
-
export interface SingleButton extends CommonProps {
|
|
33
|
-
type: "SingleButton";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* | left | right |
|
|
38
|
-
*/
|
|
39
|
-
export interface TwoButtonsInlineHalf extends CommonProps {
|
|
40
|
-
type: "TwoButtonsInlineHalf";
|
|
41
|
-
secondary: BlockButtonProps;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* | left | right |
|
|
46
|
-
*/
|
|
47
|
-
interface TwoButtonsInlineThird extends CommonProps {
|
|
48
|
-
type: "TwoButtonsInlineThird";
|
|
49
|
-
secondary: BlockButtonProps;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* | left | right |
|
|
54
|
-
*/
|
|
55
|
-
interface TwoButtonsInlineThirdInverted extends CommonProps {
|
|
56
|
-
type: "TwoButtonsInlineThirdInverted";
|
|
57
|
-
secondary: BlockButtonProps;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* | left | mid | right |
|
|
62
|
-
*/
|
|
63
|
-
interface ThreeButtonsInLine extends CommonProps {
|
|
64
|
-
type: "ThreeButtonsInLine";
|
|
65
|
-
secondary: BlockButtonProps;
|
|
66
|
-
third: BlockButtonProps;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
type Props =
|
|
70
|
-
| SingleButton
|
|
71
|
-
| TwoButtonsInlineHalf
|
|
72
|
-
| TwoButtonsInlineThird
|
|
73
|
-
| TwoButtonsInlineThirdInverted
|
|
74
|
-
| ThreeButtonsInLine;
|
|
75
|
-
|
|
76
|
-
export type BlockButtonsProps = Props;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Implements a component that show buttons on a line on 1, 2 or 3 buttons
|
|
80
|
-
* @deprecated This component is deprecated. Use `FooterActionsInline` instead.
|
|
81
|
-
*/
|
|
82
|
-
export const BlockButtons = (props: Props) => {
|
|
83
|
-
const renderRightButton = () => {
|
|
84
|
-
if (props.type === "SingleButton") {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const secondaryButtonStyle =
|
|
89
|
-
props.type === "TwoButtonsInlineThird"
|
|
90
|
-
? styles.buttonTwoThirds
|
|
91
|
-
: styles.button;
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<React.Fragment>
|
|
95
|
-
<HSpacer size={16} />
|
|
96
|
-
{renderButton(props.secondary, secondaryButtonStyle)}
|
|
97
|
-
</React.Fragment>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const renderMidButton = () => {
|
|
102
|
-
if (props.type !== "ThreeButtonsInLine") {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<React.Fragment>
|
|
108
|
-
<HSpacer size={16} />
|
|
109
|
-
{renderButton(props.third, styles.button)}
|
|
110
|
-
</React.Fragment>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const renderLeftButton = () => {
|
|
115
|
-
const primaryButtonStyle =
|
|
116
|
-
props.type === "TwoButtonsInlineThirdInverted"
|
|
117
|
-
? styles.buttonTwoThirds
|
|
118
|
-
: styles.button;
|
|
119
|
-
|
|
120
|
-
return renderButton(props.primary, primaryButtonStyle);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const renderButton = (
|
|
124
|
-
props: BlockButtonProps,
|
|
125
|
-
style: React.ComponentProps<typeof View>["style"]
|
|
126
|
-
) => (
|
|
127
|
-
<View style={style}>
|
|
128
|
-
{props.type === "Solid" ? (
|
|
129
|
-
<ButtonSolid fullWidth {...props.buttonProps} />
|
|
130
|
-
) : (
|
|
131
|
-
<ButtonOutline fullWidth {...props.buttonProps} />
|
|
132
|
-
)}
|
|
133
|
-
</View>
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<View style={IOStyles.row}>
|
|
138
|
-
{renderLeftButton()}
|
|
139
|
-
{renderMidButton()}
|
|
140
|
-
{renderRightButton()}
|
|
141
|
-
</View>
|
|
142
|
-
);
|
|
143
|
-
};
|