@pagopa/io-app-design-system 5.0.0-3 → 5.0.0-4
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 +23 -22
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +37 -65
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +50 -43
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +28 -26
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +26 -25
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -8
- 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 +7 -9
- 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 +24 -23
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +38 -66
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +53 -46
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +29 -27
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +27 -26
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -8
- 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 +8 -9
- 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 +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +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 +3 -4
- 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/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 +34 -32
- package/src/components/buttons/ButtonOutline.tsx +48 -79
- package/src/components/buttons/ButtonSolid.tsx +73 -55
- package/src/components/buttons/IconButton.tsx +47 -28
- package/src/components/buttons/IconButtonSolid.tsx +33 -36
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -8
- 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 +15 -9
- package/src/components/layout/HeaderSecondLevel.tsx +45 -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 +23 -2
- 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,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { createRef, useEffect, useLayoutEffect, useMemo } from "react";
|
|
3
3
|
import {
|
|
4
4
|
AccessibilityInfo,
|
|
5
5
|
ColorValue,
|
|
@@ -24,13 +24,14 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
|
24
24
|
import {
|
|
25
25
|
IOColors,
|
|
26
26
|
IOSpringValues,
|
|
27
|
+
IOThemeDark,
|
|
28
|
+
IOThemeLight,
|
|
27
29
|
IOVisualCostants,
|
|
28
30
|
alertEdgeToEdgeInsetTransitionConfig,
|
|
29
31
|
hexToRgba,
|
|
30
32
|
iconBtnSizeSmall,
|
|
31
33
|
useIONewTypeface,
|
|
32
|
-
useIOTheme
|
|
33
|
-
useIOThemeContext
|
|
34
|
+
useIOTheme
|
|
34
35
|
} from "../../core";
|
|
35
36
|
import type { IOSpacer, IOSpacingScale } from "../../core/IOSpacing";
|
|
36
37
|
import { WithTestID } from "../../utils/types";
|
|
@@ -48,7 +49,9 @@ type ScrollValues = {
|
|
|
48
49
|
type DiscreteTransitionProps =
|
|
49
50
|
| {
|
|
50
51
|
enableDiscreteTransition: true;
|
|
51
|
-
animatedRef:
|
|
52
|
+
animatedRef:
|
|
53
|
+
| AnimatedRef<Animated.ScrollView>
|
|
54
|
+
| AnimatedRef<Animated.FlatList<any>>;
|
|
52
55
|
}
|
|
53
56
|
| {
|
|
54
57
|
enableDiscreteTransition?: false;
|
|
@@ -139,7 +142,7 @@ export const HeaderSecondLevel = ({
|
|
|
139
142
|
backTestID,
|
|
140
143
|
title,
|
|
141
144
|
type,
|
|
142
|
-
variant
|
|
145
|
+
variant,
|
|
143
146
|
backgroundColor,
|
|
144
147
|
transparent = false,
|
|
145
148
|
ignoreSafeAreaMargin = false,
|
|
@@ -151,30 +154,36 @@ export const HeaderSecondLevel = ({
|
|
|
151
154
|
thirdAction
|
|
152
155
|
}: HeaderSecondLevel) => {
|
|
153
156
|
const scrollOffset = useScrollViewOffset(
|
|
154
|
-
animatedRef as AnimatedRef<Animated.ScrollView>
|
|
157
|
+
(animatedRef as AnimatedRef<Animated.ScrollView>) ||
|
|
158
|
+
(animatedRef as AnimatedRef<Animated.FlatList<any>>)
|
|
155
159
|
);
|
|
156
|
-
|
|
160
|
+
|
|
161
|
+
const titleRef = createRef<View>();
|
|
157
162
|
|
|
158
163
|
const { newTypefaceEnabled } = useIONewTypeface();
|
|
159
164
|
|
|
160
165
|
const theme = useIOTheme();
|
|
161
|
-
const { themeType } = useIOThemeContext();
|
|
162
166
|
const insets = useSafeAreaInsets();
|
|
163
|
-
const isTitleAccessible =
|
|
167
|
+
const isTitleAccessible = useMemo(() => !!title.trim(), [title]);
|
|
164
168
|
const paddingTop = useSharedValue(ignoreSafeAreaMargin ? 0 : insets.top);
|
|
165
169
|
|
|
166
170
|
const AnimatedIOText = Animated.createAnimatedComponent(IOText);
|
|
167
171
|
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
// If the variant is not set, set a fallback color
|
|
173
|
+
const defaultIconColor = variant ?? "neutral";
|
|
170
174
|
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
/* We apply the same logic of `persistentColorMode`
|
|
176
|
+
to the title color: if variant is set, the color will
|
|
177
|
+
be persistent, otherwise it will vary depending
|
|
178
|
+
on the color scheme. */
|
|
179
|
+
const titleColorVariant =
|
|
180
|
+
variant === "contrast"
|
|
181
|
+
? IOColors[IOThemeDark["textHeading-default"]]
|
|
182
|
+
: IOColors[IOThemeLight["textHeading-default"]];
|
|
173
183
|
|
|
174
|
-
const titleColor: ColorValue =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
: IOColors.white;
|
|
184
|
+
const titleColor: ColorValue = variant
|
|
185
|
+
? titleColorVariant
|
|
186
|
+
: IOColors[theme["textHeading-default"]];
|
|
178
187
|
|
|
179
188
|
/* Visual attributes when there are transitions between states */
|
|
180
189
|
const HEADER_DEFAULT_BG_COLOR: IOColors = theme["appBackground-primary"];
|
|
@@ -187,9 +196,7 @@ export const HeaderSecondLevel = ({
|
|
|
187
196
|
: headerBgColorSolidState;
|
|
188
197
|
|
|
189
198
|
const borderColorDefault = IOColors[theme["divider-default"]];
|
|
190
|
-
|
|
191
199
|
const borderColorSolidState = backgroundColor ?? borderColorDefault;
|
|
192
|
-
|
|
193
200
|
const borderColorTransparentState = hexToRgba(borderColorSolidState, 0);
|
|
194
201
|
|
|
195
202
|
useLayoutEffect(() => {
|
|
@@ -278,7 +285,10 @@ export const HeaderSecondLevel = ({
|
|
|
278
285
|
android: "backAndroid",
|
|
279
286
|
default: "backiOS"
|
|
280
287
|
})}
|
|
281
|
-
color={
|
|
288
|
+
color={defaultIconColor}
|
|
289
|
+
/* If we specify a variant, we probably want to
|
|
290
|
+
make it persistent in both light and dark modes. */
|
|
291
|
+
persistentColorMode={!!variant}
|
|
282
292
|
onPress={goBack}
|
|
283
293
|
accessibilityLabel={backAccessibilityLabel}
|
|
284
294
|
testID={backTestID}
|
|
@@ -313,13 +323,25 @@ export const HeaderSecondLevel = ({
|
|
|
313
323
|
</View>
|
|
314
324
|
<HStack allowScaleSpacing space={16} style={{ flexShrink: 0 }}>
|
|
315
325
|
{type === "threeActions" && (
|
|
316
|
-
<IconButton
|
|
326
|
+
<IconButton
|
|
327
|
+
{...thirdAction}
|
|
328
|
+
color={defaultIconColor}
|
|
329
|
+
persistentColorMode={!!variant}
|
|
330
|
+
/>
|
|
317
331
|
)}
|
|
318
332
|
{(type === "twoActions" || type === "threeActions") && (
|
|
319
|
-
<IconButton
|
|
333
|
+
<IconButton
|
|
334
|
+
{...secondAction}
|
|
335
|
+
color={defaultIconColor}
|
|
336
|
+
persistentColorMode={!!variant}
|
|
337
|
+
/>
|
|
320
338
|
)}
|
|
321
339
|
{type !== "base" ? (
|
|
322
|
-
<IconButton
|
|
340
|
+
<IconButton
|
|
341
|
+
{...firstAction}
|
|
342
|
+
color={defaultIconColor}
|
|
343
|
+
persistentColorMode={!!variant}
|
|
344
|
+
/>
|
|
323
345
|
) : (
|
|
324
346
|
<HSpacer size={iconBtnSizeSmall as IOSpacer} />
|
|
325
347
|
)}
|
|
@@ -81,7 +81,7 @@ export const ListItemNav = ({
|
|
|
81
81
|
description,
|
|
82
82
|
onPress,
|
|
83
83
|
icon,
|
|
84
|
-
iconColor
|
|
84
|
+
iconColor,
|
|
85
85
|
avatarProps: avatar,
|
|
86
86
|
paymentLogoUri,
|
|
87
87
|
accessibilityLabel,
|
|
@@ -96,6 +96,9 @@ export const ListItemNav = ({
|
|
|
96
96
|
useListItemAnimation();
|
|
97
97
|
const theme = useIOTheme();
|
|
98
98
|
|
|
99
|
+
const defaultIconColor = iconColor ?? theme["icon-decorative"];
|
|
100
|
+
const interactiveColor = theme["interactiveElem-default"];
|
|
101
|
+
|
|
99
102
|
const { dynamicFontScale, hugeFontEnabled } = useIOFontDynamicScale();
|
|
100
103
|
|
|
101
104
|
const listItemNavContent = (
|
|
@@ -151,8 +154,6 @@ export const ListItemNav = ({
|
|
|
151
154
|
</>
|
|
152
155
|
);
|
|
153
156
|
|
|
154
|
-
const interactiveColor = theme["interactiveElem-default"];
|
|
155
|
-
|
|
156
157
|
const handleOnPress = (event: GestureResponderEvent) => {
|
|
157
158
|
if (!loading) {
|
|
158
159
|
onPress(event);
|
|
@@ -188,7 +189,7 @@ export const ListItemNav = ({
|
|
|
188
189
|
<Icon
|
|
189
190
|
allowFontScaling
|
|
190
191
|
name={icon}
|
|
191
|
-
color={
|
|
192
|
+
color={defaultIconColor}
|
|
192
193
|
size={IOListItemVisualParams.iconSize}
|
|
193
194
|
/>
|
|
194
195
|
<HSpacer
|
package/src/core/IOColors.ts
CHANGED
|
@@ -205,6 +205,13 @@ const themeKeys = [
|
|
|
205
205
|
"appBackground-accent",
|
|
206
206
|
"interactiveElem-default",
|
|
207
207
|
"interactiveElem-pressed",
|
|
208
|
+
"interactiveElem-disabled",
|
|
209
|
+
"interactiveOutline-disabled",
|
|
210
|
+
"neutralButton-default",
|
|
211
|
+
"neutralButton-pressed",
|
|
212
|
+
"neutralButton-disabled",
|
|
213
|
+
"buttonText-default",
|
|
214
|
+
"buttonText-disabled",
|
|
208
215
|
"listItem-pressed",
|
|
209
216
|
// Typography
|
|
210
217
|
"textHeading-default",
|
|
@@ -254,6 +261,13 @@ export const IOThemeLight: IOTheme = {
|
|
|
254
261
|
"appBackground-accent": "blueIO-500",
|
|
255
262
|
"interactiveElem-default": "blueIO-500",
|
|
256
263
|
"interactiveElem-pressed": "blueIO-600",
|
|
264
|
+
"interactiveElem-disabled": "grey-300",
|
|
265
|
+
"interactiveOutline-disabled": "grey-650",
|
|
266
|
+
"neutralButton-default": "black",
|
|
267
|
+
"neutralButton-pressed": "grey-850",
|
|
268
|
+
"neutralButton-disabled": "grey-450",
|
|
269
|
+
"buttonText-default": "white",
|
|
270
|
+
"buttonText-disabled": "grey-700",
|
|
257
271
|
"listItem-pressed": "grey-50",
|
|
258
272
|
// Typography
|
|
259
273
|
"textHeading-default": "black",
|
|
@@ -297,10 +311,17 @@ export const IOThemeDark: IOTheme = {
|
|
|
297
311
|
"appBackground-secondary": "grey-850",
|
|
298
312
|
"appBackground-tertiary": "grey-700",
|
|
299
313
|
"interactiveElem-default": "blueIO-450",
|
|
300
|
-
"interactiveElem-pressed": "blueIO-
|
|
314
|
+
"interactiveElem-pressed": "blueIO-500",
|
|
315
|
+
"interactiveElem-disabled": "grey-700",
|
|
316
|
+
"interactiveOutline-disabled": "grey-450",
|
|
317
|
+
"neutralButton-default": "white",
|
|
318
|
+
"neutralButton-pressed": "grey-100",
|
|
319
|
+
"neutralButton-disabled": "grey-850",
|
|
320
|
+
"buttonText-default": "white",
|
|
321
|
+
"buttonText-disabled": "grey-300",
|
|
301
322
|
"listItem-pressed": "grey-850",
|
|
302
323
|
// Typography
|
|
303
|
-
"textHeading-default": "
|
|
324
|
+
"textHeading-default": "white",
|
|
304
325
|
"textHeading-secondary": "grey-300",
|
|
305
326
|
"textHeading-tertiary": "grey-450",
|
|
306
327
|
"textBody-default": "white",
|
|
@@ -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/layout/BlockButtons.tsx"],"mappings":";;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B,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,GAAGA,CAAA,KAAM;IAC5B,IAAIT,KAAK,CAACE,IAAI,KAAK,oBAAoB,EAAE;MACvC,OAAO,IAAI;IACb;IAEA,oBACEjB,KAAA,CAAAmB,aAAA,CAACnB,KAAK,CAACoB,QAAQ,qBACbpB,KAAA,CAAAmB,aAAA,CAAChB,OAAO;MAACkB,IAAI,EAAE;IAAG,CAAE,CAAC,EACpBC,YAAY,CAACP,KAAK,CAACU,KAAK,EAAElB,MAAM,CAACE,MAAM,CAC1B,CAAC;EAErB,CAAC;EAED,MAAMiB,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,MAAMC,kBAAkB,GACtBZ,KAAK,CAACE,IAAI,KAAK,+BAA+B,GAC1CV,MAAM,CAACM,eAAe,GACtBN,MAAM,CAACE,MAAM;IAEnB,OAAOa,YAAY,CAACP,KAAK,CAACa,OAAO,EAAED,kBAAkB,CAAC;EACxD,CAAC;EAED,MAAML,YAAY,GAAGA,CACnBP,KAAuB,EACvBc,KAAiD,kBAEjD7B,KAAA,CAAAmB,aAAA,CAAClB,IAAI;IAAC4B,KAAK,EAAEA;EAAM,GAChBd,KAAK,CAACE,IAAI,KAAK,OAAO,gBACrBjB,KAAA,CAAAmB,aAAA,CAACd,WAAW,EAAAyB,QAAA;IAACC,SAAS;EAAA,GAAKhB,KAAK,CAACiB,WAAW,CAAG,CAAC,gBAEhDhC,KAAA,CAAAmB,aAAA,CAACf,aAAa,EAAA0B,QAAA;IAACC,SAAS;EAAA,GAAKhB,KAAK,CAACiB,WAAW,CAAG,CAE/C,CACP;EAED,oBACEhC,KAAA,CAAAmB,aAAA,CAAClB,IAAI;IAAC4B,KAAK,EAAEvB,QAAQ,CAAC2B;EAAI,GACvBP,gBAAgB,CAAC,CAAC,EAClBF,eAAe,CAAC,CAAC,EACjBR,iBAAiB,CAAC,CACf,CAAC;AAEX,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { ButtonSolid } from "../buttons";
|
|
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
|
-
};
|