cozy-ui 70.2.1 → 70.2.2
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/react/SquareAppIcon/Readme.md +13 -0
- package/react/SquareAppIcon/SquareAppIcon.spec.js +11 -0
- package/react/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +4 -4
- package/react/SquareAppIcon/index.jsx +2 -2
- package/transpiled/react/SquareAppIcon/index.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [70.2.2](https://github.com/cozy/cozy-ui/compare/v70.2.1...v70.2.2) (2022-07-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Shortcut with IconContent ([a83c320](https://github.com/cozy/cozy-ui/commit/a83c320))
|
|
7
|
+
|
|
1
8
|
## [70.2.1](https://github.com/cozy/cozy-ui/compare/v70.2.0...v70.2.1) (2022-07-25)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -35,6 +35,19 @@ const app = { name: "Test App", slug: "testapp", type: "app" }
|
|
|
35
35
|
<Grid item>
|
|
36
36
|
<SquareAppIcon name="Shortcut" variant="shortcut" />
|
|
37
37
|
</Grid>
|
|
38
|
+
<Grid item>
|
|
39
|
+
<SquareAppIcon name="Shortcut" variant="shortcut" IconContent={<img
|
|
40
|
+
src={`data:image/svg+xml;base64,${window.btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
41
|
+
<g fill="none" fill-rule="evenodd" transform="translate(0 2)">
|
|
42
|
+
<rect width="32" height="26" y="2" fill="#B2D3FF" rx="2"/>
|
|
43
|
+
<path fill="#197BFF" d="M0,0.990777969 C0,0.443586406 0.449948758,0 1.00684547,0 L12.9931545,0 C13.5492199,0 14.3125,0.3125 14.7107565,0.71075654 L15.2892435,1.28924346 C15.6817835,1.68178346 16.4446309,2 17.0008717,2 L30.0059397,2 C31.1072288,2 32,2.89470506 32,4 L32,4 L17.0008717,4 C16.4481055,4 15.6875,4.3125 15.2892435,4.71075654 L14.7107565,5.28924346 C14.3182165,5.68178346 13.5500512,6 12.9931545,6 L1.00684547,6 C0.450780073,6 0,5.54902482 0,5.00922203 L0,0.990777969 Z"/>
|
|
44
|
+
</g>
|
|
45
|
+
</svg>`)}`}
|
|
46
|
+
width={32}
|
|
47
|
+
height={32}
|
|
48
|
+
alt={"Shortcut"}
|
|
49
|
+
/>}/>
|
|
50
|
+
</Grid>
|
|
38
51
|
<Grid item>
|
|
39
52
|
<SquareAppIcon name="Custom Icon" IconContent={<Icon icon={CozyIcon} size="48" />} />
|
|
40
53
|
</Grid>
|
|
@@ -69,6 +69,17 @@ describe('SquareAppIcon component', () => {
|
|
|
69
69
|
expect(root.getByTestId('square-app-icon')).toMatchSnapshot()
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
+
it('should display icon-content an app with icon content in shortcut state', () => {
|
|
73
|
+
const { queryByTestId } = render(
|
|
74
|
+
<Wrapper
|
|
75
|
+
variant="shortcut"
|
|
76
|
+
name="shortcut"
|
|
77
|
+
IconContent={<Icon data-testid="icon-content" icon={CozyIcon} />}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
expect(queryByTestId('icon-content')).toBeTruthy()
|
|
81
|
+
})
|
|
82
|
+
|
|
72
83
|
it('should render correctly an app with custom content', () => {
|
|
73
84
|
const root = render(
|
|
74
85
|
<Wrapper name="custom icon" IconContent={<Icon icon={CozyIcon} />} />
|
|
@@ -358,14 +358,14 @@ exports[`SquareAppIcon component should render correctly an app in shortcut stat
|
|
|
358
358
|
|
|
359
359
|
exports[`SquareAppIcon component should render correctly an app with custom content 1`] = `
|
|
360
360
|
<div
|
|
361
|
-
class="makeStyles-tileWrapper-
|
|
361
|
+
class="makeStyles-tileWrapper-59"
|
|
362
362
|
data-testid="square-app-icon"
|
|
363
363
|
>
|
|
364
364
|
<span
|
|
365
365
|
class="MuiBadge-root"
|
|
366
366
|
>
|
|
367
367
|
<span
|
|
368
|
-
class="MuiBadge-root styles__SquareAppIcon-wrapper___2SEuM makeStyles-shadow-
|
|
368
|
+
class="MuiBadge-root styles__SquareAppIcon-wrapper___2SEuM makeStyles-shadow-57"
|
|
369
369
|
>
|
|
370
370
|
<div
|
|
371
371
|
class="styles__SquareAppIcon-icon-container___39MRl"
|
|
@@ -388,11 +388,11 @@ exports[`SquareAppIcon component should render correctly an app with custom cont
|
|
|
388
388
|
/>
|
|
389
389
|
</span>
|
|
390
390
|
<span
|
|
391
|
-
class="MuiBadge-badge Component-qualifier-
|
|
391
|
+
class="MuiBadge-badge Component-qualifier-60 MuiBadge-anchorOriginBottomRightRectangular MuiBadge-invisible"
|
|
392
392
|
/>
|
|
393
393
|
</span>
|
|
394
394
|
<h6
|
|
395
|
-
class="MuiTypography-root makeStyles-name-
|
|
395
|
+
class="MuiTypography-root makeStyles-name-55 u-spacellipsis MuiTypography-h6 MuiTypography-colorTextPrimary MuiTypography-alignCenter"
|
|
396
396
|
>
|
|
397
397
|
custom icon
|
|
398
398
|
</h6>
|
|
@@ -109,12 +109,12 @@ export const SquareAppIcon = ({
|
|
|
109
109
|
size="large"
|
|
110
110
|
overlap="rectangular"
|
|
111
111
|
style={
|
|
112
|
-
variant === 'shortcut'
|
|
112
|
+
variant === 'shortcut' && !IconContent
|
|
113
113
|
? { backgroundColor: nameToColor(name) }
|
|
114
114
|
: null
|
|
115
115
|
}
|
|
116
116
|
>
|
|
117
|
-
{variant === 'shortcut' ? (
|
|
117
|
+
{variant === 'shortcut' && !IconContent ? (
|
|
118
118
|
<Typography className={classes.letter} variant="h2" align="center">
|
|
119
119
|
{letter.toUpperCase()}
|
|
120
120
|
</Typography>
|
|
@@ -105,10 +105,10 @@ export var SquareAppIcon = function SquareAppIcon(_ref) {
|
|
|
105
105
|
withBorder: false,
|
|
106
106
|
size: "large",
|
|
107
107
|
overlap: "rectangular",
|
|
108
|
-
style: variant === 'shortcut' ? {
|
|
108
|
+
style: variant === 'shortcut' && !IconContent ? {
|
|
109
109
|
backgroundColor: nameToColor(name)
|
|
110
110
|
} : null
|
|
111
|
-
}, variant === 'shortcut' ? /*#__PURE__*/React.createElement(Typography, {
|
|
111
|
+
}, variant === 'shortcut' && !IconContent ? /*#__PURE__*/React.createElement(Typography, {
|
|
112
112
|
className: classes.letter,
|
|
113
113
|
variant: "h2",
|
|
114
114
|
align: "center"
|