@shopgate/pwa-ui-ios 7.32.0-beta.2 → 7.32.0-beta.20
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/AppBar/index.js +3 -2
- package/BaseDialog/components/Buttons/index.js +27 -15
- package/package.json +2 -2
- package/BaseDialog/components/Buttons/spec.js +0 -29
- package/BaseDialog/components/Content/spec.js +0 -18
- package/BaseDialog/components/Title/spec.js +0 -18
- package/BaseDialog/spec.js +0 -44
- package/tsconfig.build.json +0 -16
- package/tsconfig.json +0 -3
package/AppBar/index.js
CHANGED
|
@@ -20,6 +20,7 @@ const useStyles = makeStyles()(theme => ({
|
|
|
20
20
|
},
|
|
21
21
|
inner: {
|
|
22
22
|
display: 'flex',
|
|
23
|
+
alignItems: 'center',
|
|
23
24
|
justifyContent: 'space-between',
|
|
24
25
|
position: 'relative',
|
|
25
26
|
zIndex: 1
|
|
@@ -99,7 +100,7 @@ const AppBar = ({
|
|
|
99
100
|
};
|
|
100
101
|
AppBar.defaultProps = {
|
|
101
102
|
'aria-hidden': null,
|
|
102
|
-
backgroundColor: 'var(--sg-
|
|
103
|
+
backgroundColor: 'var(--sg-components-appBar-background)',
|
|
103
104
|
below: null,
|
|
104
105
|
center: null,
|
|
105
106
|
classes: {
|
|
@@ -108,7 +109,7 @@ AppBar.defaultProps = {
|
|
|
108
109
|
},
|
|
109
110
|
left: null,
|
|
110
111
|
right: null,
|
|
111
|
-
textColor: 'var(--sg-
|
|
112
|
+
textColor: 'var(--sg-components-appBar-color)'
|
|
112
113
|
};
|
|
113
114
|
AppBar.Field = Field;
|
|
114
115
|
AppBar.Icon = Icon;
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { I18n
|
|
3
|
+
import { I18n } from '@shopgate/engage/components';
|
|
4
|
+
import { Button } from '@shopgate/engage/components/v2';
|
|
4
5
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const borderColor = 'rgba(0,0,0,0.2)';
|
|
8
|
+
const pressedColor = 'rgba(0,0,0,0.08)';
|
|
9
|
+
const hoverColor = 'rgba(0,0,0,0.04)';
|
|
7
10
|
const useStyles = makeStyles()(theme => ({
|
|
8
11
|
button: {
|
|
9
|
-
'
|
|
12
|
+
'& > *': {
|
|
10
13
|
color: 'var(--color-button-dialog-ios, #1a73e8)'
|
|
11
14
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
15
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
16
|
+
minWidth: '50%',
|
|
17
|
+
flexGrow: 1,
|
|
18
|
+
lineHeight: 1.2,
|
|
19
|
+
paddingTop: 11,
|
|
20
|
+
paddingBottom: 11,
|
|
19
21
|
marginBottom: -1,
|
|
20
22
|
marginRight: theme.spacing(-0.5),
|
|
23
|
+
'&:active': {
|
|
24
|
+
background: pressedColor
|
|
25
|
+
},
|
|
26
|
+
'&:focus-visible': {
|
|
27
|
+
background: pressedColor
|
|
28
|
+
},
|
|
29
|
+
'@media (hover: hover)': {
|
|
30
|
+
'&:hover': {
|
|
31
|
+
background: hoverColor
|
|
32
|
+
}
|
|
33
|
+
},
|
|
21
34
|
'&:not(:last-child)': {
|
|
22
|
-
borderRadius:
|
|
35
|
+
borderRadius: 0,
|
|
23
36
|
borderRight: `0.5px solid ${borderColor}`,
|
|
24
37
|
borderBottom: `0.5px solid ${borderColor}`
|
|
25
38
|
}
|
|
26
39
|
},
|
|
27
40
|
buttonPrimary: {
|
|
28
|
-
|
|
29
|
-
fontWeight: theme.typography.fontWeightRegular
|
|
30
|
-
}
|
|
41
|
+
fontWeight: theme.typography.fontWeightRegular
|
|
31
42
|
},
|
|
32
43
|
buttonText: {
|
|
33
44
|
overflow: 'hidden',
|
|
@@ -54,10 +65,11 @@ const Buttons = ({
|
|
|
54
65
|
disabled = false
|
|
55
66
|
}) => /*#__PURE__*/_jsx(Button, {
|
|
56
67
|
className: cx(classes.button, type === 'primary' && classes.buttonPrimary),
|
|
57
|
-
|
|
68
|
+
variant: "link",
|
|
69
|
+
color: "secondary",
|
|
58
70
|
onClick: action,
|
|
59
71
|
disabled: disabled,
|
|
60
|
-
|
|
72
|
+
disableRipple: true,
|
|
61
73
|
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
62
74
|
className: classes.buttonText,
|
|
63
75
|
string: label
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-ios",
|
|
3
|
-
"version": "7.32.0-beta.
|
|
3
|
+
"version": "7.32.0-beta.20",
|
|
4
4
|
"description": "Shopgate's iOS UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@shopgate/pwa-common": "7.32.0-beta.
|
|
8
|
+
"@shopgate/pwa-common": "7.32.0-beta.20",
|
|
9
9
|
"react": "^17.0.2"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import Button from '@shopgate/pwa-ui-shared/Button';
|
|
4
|
-
import Buttons from "./index";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const actions = [{
|
|
7
|
-
label: 'action0',
|
|
8
|
-
action: jest.fn()
|
|
9
|
-
}, {
|
|
10
|
-
label: 'action1',
|
|
11
|
-
action: jest.fn()
|
|
12
|
-
}, {
|
|
13
|
-
label: 'action2',
|
|
14
|
-
action: jest.fn()
|
|
15
|
-
}];
|
|
16
|
-
describe('<Buttons />', () => {
|
|
17
|
-
it('should not render if no actions are passed', () => {
|
|
18
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Buttons, {}));
|
|
19
|
-
expect(wrapper).toMatchSnapshot();
|
|
20
|
-
expect(wrapper.instance()).toEqual(null);
|
|
21
|
-
});
|
|
22
|
-
it('should render buttons', () => {
|
|
23
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Buttons, {
|
|
24
|
-
actions: actions
|
|
25
|
-
}));
|
|
26
|
-
expect(wrapper).toMatchSnapshot();
|
|
27
|
-
expect(wrapper.find(Button).length).toBe(actions.length);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import Content from "./index";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
describe('<Content />', () => {
|
|
6
|
-
it('should not render if no content is passed', () => {
|
|
7
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Content, {}));
|
|
8
|
-
expect(wrapper).toMatchSnapshot();
|
|
9
|
-
expect(wrapper.instance()).toEqual(null);
|
|
10
|
-
});
|
|
11
|
-
it('should render content components', () => {
|
|
12
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Content, {
|
|
13
|
-
content: "Hello World"
|
|
14
|
-
}));
|
|
15
|
-
expect(wrapper).toMatchSnapshot();
|
|
16
|
-
expect(wrapper.find('[id="basicDialogDesc"]').length).toBe(1);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import Title from "./index";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
describe('<Title />', () => {
|
|
6
|
-
it('should not render without a title', () => {
|
|
7
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Title, {}));
|
|
8
|
-
expect(wrapper).toMatchSnapshot();
|
|
9
|
-
expect(wrapper.instance()).toEqual(null);
|
|
10
|
-
});
|
|
11
|
-
it('should render with a title', () => {
|
|
12
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Title, {
|
|
13
|
-
title: "Some test title"
|
|
14
|
-
}));
|
|
15
|
-
expect(wrapper).toMatchSnapshot();
|
|
16
|
-
expect(wrapper.find('[id="basicDialogTitle"]').length).toBe(1);
|
|
17
|
-
});
|
|
18
|
-
});
|
package/BaseDialog/spec.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import Title from "./components/Title";
|
|
4
|
-
import Content from "./components/Content";
|
|
5
|
-
import Buttons from "./components/Buttons";
|
|
6
|
-
import BasicDialog from "./index";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const props = {
|
|
9
|
-
title: 'Hello World',
|
|
10
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
11
|
-
children: "Hello World"
|
|
12
|
-
}),
|
|
13
|
-
actions: [{
|
|
14
|
-
label: 'action0',
|
|
15
|
-
action: jest.fn()
|
|
16
|
-
}, {
|
|
17
|
-
label: 'action1',
|
|
18
|
-
action: jest.fn()
|
|
19
|
-
}, {
|
|
20
|
-
label: 'action2',
|
|
21
|
-
action: jest.fn()
|
|
22
|
-
}]
|
|
23
|
-
};
|
|
24
|
-
jest.mock('@shopgate/engage/a11y/components');
|
|
25
|
-
describe('<BasicDialog />', () => {
|
|
26
|
-
it('should render with minimal props', () => {
|
|
27
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(BasicDialog, {
|
|
28
|
-
actions: []
|
|
29
|
-
}));
|
|
30
|
-
expect(wrapper).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
it('should render as expected', () => {
|
|
33
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(BasicDialog, {
|
|
34
|
-
...props
|
|
35
|
-
}));
|
|
36
|
-
expect(wrapper).toMatchSnapshot();
|
|
37
|
-
expect(wrapper.find(Title).length).toBe(1);
|
|
38
|
-
expect(wrapper.find(Title).props().title).toEqual(props.title);
|
|
39
|
-
expect(wrapper.find(Content).length).toBe(1);
|
|
40
|
-
expect(wrapper.find(Content).props().content).toEqual(props.children);
|
|
41
|
-
expect(wrapper.find(Buttons).length).toBe(1);
|
|
42
|
-
expect(wrapper.find(Buttons).props().actions).toEqual(props.actions);
|
|
43
|
-
});
|
|
44
|
-
});
|
package/tsconfig.build.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@shopgate/engage/tsconfig.build.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"rootDir": "."
|
|
6
|
-
},
|
|
7
|
-
"include": ["**/*.ts", "**/*.tsx"],
|
|
8
|
-
"exclude": [
|
|
9
|
-
"dist",
|
|
10
|
-
"node_modules",
|
|
11
|
-
"**/*.spec.*",
|
|
12
|
-
"**/__tests__/**",
|
|
13
|
-
"**/__snapshots__/**",
|
|
14
|
-
"coverage"
|
|
15
|
-
]
|
|
16
|
-
}
|
package/tsconfig.json
DELETED