cozy-ui 122.8.0 → 122.10.0
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 +14 -0
- package/package.json +1 -1
- package/react/BarTitle/index.jsx +6 -1
- package/react/Icon/Sprite.jsx +8 -2
- package/scripts/make-icon-sprite.sh +22 -4
- package/transpiled/react/BarTitle/index.js +2 -1
- package/transpiled/react/Icon/Sprite.js +5 -2
- package/transpiled/react/Icon/icons-sprite-twake.d.ts +2 -0
- package/transpiled/react/Icon/icons-sprite-twake.js +3 -0
- package/transpiled/react/Icon/icons-sprite.d.ts +1 -1
- package/transpiled/react/Icon/icons-sprite.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [122.10.0](https://github.com/cozy/cozy-ui/compare/v122.9.0...v122.10.0) (2025-04-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Sprite:** Add Twake icons ([8caa508](https://github.com/cozy/cozy-ui/commit/8caa508))
|
|
7
|
+
|
|
8
|
+
# [122.9.0](https://github.com/cozy/cozy-ui/compare/v122.8.0...v122.9.0) (2025-04-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **BarTitle:** Adjust font size for Twake theme ([cba1b13](https://github.com/cozy/cozy-ui/commit/cba1b13))
|
|
14
|
+
|
|
1
15
|
# [122.8.0](https://github.com/cozy/cozy-ui/compare/v122.7.0...v122.8.0) (2025-04-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/react/BarTitle/index.jsx
CHANGED
|
@@ -3,11 +3,16 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import styles from './styles.styl'
|
|
5
5
|
import Typography from '../Typography'
|
|
6
|
+
import { isTwakeTheme } from '../helpers/isTwakeTheme'
|
|
6
7
|
|
|
7
8
|
const BarTitle = ({ noWrap, children }) => {
|
|
8
9
|
return (
|
|
9
10
|
<div className={styles.BarTitle}>
|
|
10
|
-
<Typography
|
|
11
|
+
<Typography
|
|
12
|
+
variant={isTwakeTheme() ? 'h4' : 'h5'}
|
|
13
|
+
component="h1"
|
|
14
|
+
noWrap={noWrap}
|
|
15
|
+
>
|
|
11
16
|
{children}
|
|
12
17
|
</Typography>
|
|
13
18
|
</div>
|
package/react/Icon/Sprite.jsx
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import IconSpriteContent from './icons-sprite'
|
|
4
|
+
import IconSpriteContentTwake from './icons-sprite-twake'
|
|
5
|
+
import { isTwakeTheme } from '../helpers/isTwakeTheme'
|
|
4
6
|
|
|
5
7
|
const displayNone = { display: 'none' }
|
|
6
8
|
|
|
7
9
|
const Sprite = () => {
|
|
10
|
+
const SpriteContent = isTwakeTheme()
|
|
11
|
+
? IconSpriteContentTwake
|
|
12
|
+
: IconSpriteContent
|
|
13
|
+
|
|
8
14
|
return (
|
|
9
15
|
<div
|
|
10
16
|
style={displayNone}
|
|
11
|
-
dangerouslySetInnerHTML={{ __html:
|
|
17
|
+
dangerouslySetInnerHTML={{ __html: SpriteContent }}
|
|
12
18
|
/>
|
|
13
19
|
)
|
|
14
20
|
}
|
|
@@ -2,12 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
set -eu
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
streamEditor=$([[ $(uname -s) == "Linux" ]] && echo sed || echo gsed)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# generates Cozy sprites
|
|
8
|
+
|
|
9
|
+
outfileCozy="react/Icon/icons-sprite.js"
|
|
10
|
+
|
|
11
|
+
iconsCozy="$(ls assets/icons/*/*.svg | grep -v 'assets/icons/twake/' | sort -d)"
|
|
12
|
+
|
|
13
|
+
echo "Making icon sprite, output file : ${outfileCozy}..."
|
|
14
|
+
echo $iconsCozy | xargs yarn svgstore --inline -o /tmp/icons-sprite.svg
|
|
15
|
+
echo "// GENERATED FILE, DO NOT EDIT THIS FILE BY HAND" > $outfileCozy
|
|
16
|
+
echo "// Use yarn sprite to regenerate" >> $outfileCozy
|
|
17
|
+
echo "export default \``cat /tmp/icons-sprite.svg`\`" >> $outfileCozy
|
|
18
|
+
|
|
19
|
+
# generates Twake sprites
|
|
20
|
+
|
|
21
|
+
outfile="react/Icon/icons-sprite-twake.js"
|
|
22
|
+
|
|
23
|
+
icons="$(find assets/icons/twake -type f -name '*.svg' | sort -d)"
|
|
8
24
|
|
|
9
25
|
echo "Making icon sprite, output file : ${outfile}..."
|
|
10
|
-
echo $icons | xargs yarn svgstore --inline -o /tmp/icons-sprite.svg
|
|
26
|
+
echo $icons | xargs yarn svgstore --inline -o /tmp/icons-sprite-twake.svg
|
|
27
|
+
# Edit IDs to remove "_twake" suffixe
|
|
28
|
+
$streamEditor -i 's/id="\([^"]*\)_twake"/id="\1"/g' /tmp/icons-sprite-twake.svg
|
|
11
29
|
echo "// GENERATED FILE, DO NOT EDIT THIS FILE BY HAND" > $outfile
|
|
12
30
|
echo "// Use yarn sprite to regenerate" >> $outfile
|
|
13
|
-
echo "export default \``cat /tmp/icons-sprite.svg`\`" >> $outfile
|
|
31
|
+
echo "export default \``cat /tmp/icons-sprite-twake.svg`\`" >> $outfile
|
|
@@ -4,6 +4,7 @@ var styles = {
|
|
|
4
4
|
"BarTitle": "styles__BarTitle___I5r2e"
|
|
5
5
|
};
|
|
6
6
|
import Typography from "cozy-ui/transpiled/react/Typography";
|
|
7
|
+
import { isTwakeTheme } from "cozy-ui/transpiled/react/helpers/isTwakeTheme";
|
|
7
8
|
|
|
8
9
|
var BarTitle = function BarTitle(_ref) {
|
|
9
10
|
var noWrap = _ref.noWrap,
|
|
@@ -11,7 +12,7 @@ var BarTitle = function BarTitle(_ref) {
|
|
|
11
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
13
|
className: styles.BarTitle
|
|
13
14
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
14
|
-
variant:
|
|
15
|
+
variant: isTwakeTheme() ? 'h4' : 'h5',
|
|
15
16
|
component: "h1",
|
|
16
17
|
noWrap: noWrap
|
|
17
18
|
}, children));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import IconSpriteContent from "cozy-ui/transpiled/react/Icon/icons-sprite";
|
|
3
|
+
import IconSpriteContentTwake from "cozy-ui/transpiled/react/Icon/icons-sprite-twake";
|
|
4
|
+
import { isTwakeTheme } from "cozy-ui/transpiled/react/helpers/isTwakeTheme";
|
|
3
5
|
var displayNone = {
|
|
4
6
|
display: 'none'
|
|
5
7
|
};
|
|
6
8
|
|
|
7
9
|
var Sprite = function Sprite() {
|
|
10
|
+
var SpriteContent = isTwakeTheme() ? IconSpriteContentTwake : IconSpriteContent;
|
|
8
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
12
|
style: displayNone,
|
|
10
13
|
dangerouslySetInnerHTML: {
|
|
11
|
-
__html:
|
|
14
|
+
__html: SpriteContent
|
|
12
15
|
}
|
|
13
16
|
});
|
|
14
17
|
};
|