akeneo-design-system 0.1.220 → 0.1.221
Sign up to get free protection for your applications and to get access to all the features.
- package/.storybook/preview-head.html +7 -0
- package/lib/components/Locale/Locale.js +1 -1
- package/lib/components/Locale/Locale.js.map +1 -1
- package/package.json +1 -1
- package/public/fonts/twemoji/LICENCE.txt +7 -0
- package/public/fonts/twemoji/TwemojiCountryFlags.woff2 +0 -0
- package/src/components/Locale/Locale.stories.mdx +1 -1
- package/src/components/Locale/Locale.tsx +2 -1
- package/src/components/SwitcherButton/SwitcherButton.stories.mdx +1 -0
@@ -1 +1,8 @@
|
|
1
1
|
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700&display=swap" rel="stylesheet" />
|
2
|
+
<style>
|
3
|
+
@font-face {
|
4
|
+
font-family: 'Flag Emoji';
|
5
|
+
unicode-range: U+1F1E6-1F1FF;
|
6
|
+
src: url('./fonts/twemoji/TwemojiCountryFlags.woff2') format('woff2');
|
7
|
+
}
|
8
|
+
</style>
|
@@ -54,7 +54,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
54
|
var shared_1 = require("../../shared");
|
55
55
|
var theme_1 = require("../../theme");
|
56
56
|
var LocaleContainer = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n"], ["\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n"])));
|
57
|
-
var Emoji = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n margin-right: 3px;\n"], ["\n font-size: ", ";\n margin-right: 3px;\n"])), (0, theme_1.getFontSize)('bigger'));
|
57
|
+
var Emoji = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n margin-right: 3px;\n font-family: 'Flag Emoji', ", ";\n"], ["\n font-size: ", ";\n margin-right: 3px;\n font-family: 'Flag Emoji', ", ";\n"])), (0, theme_1.getFontSize)('bigger'), (0, theme_1.getFontFamily)('default'));
|
58
58
|
var Locale = (0, react_1.forwardRef)(function (_a, forwardedRef) {
|
59
59
|
var code = _a.code, languageLabel = _a.languageLabel, rest = __rest(_a, ["code", "languageLabel"]);
|
60
60
|
var _b = code.split('_'), languageCode = _b[0], length = _b.length, _c = length - 1, countryCode = _b[_c];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Locale.js","sourceRoot":"","sources":["../../../src/components/Locale/Locale.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,wEAAuC;AACvC,uCAAsC;AACtC,
|
1
|
+
{"version":3,"file":"Locale.js","sourceRoot":"","sources":["../../../src/components/Locale/Locale.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,wEAAuC;AACvC,uCAAsC;AACtC,qCAAuD;AAEvD,IAAM,eAAe,GAAG,2BAAM,CAAC,IAAI,gJAAA,6EAIlC,IAAA,CAAC;AAEF,IAAM,KAAK,GAAG,2BAAM,CAAC,IAAI,qJAAA,iBACV,EAAqB,wDAEL,EAAwB,KACtD,KAHc,IAAA,mBAAW,EAAC,QAAQ,CAAC,EAEL,IAAA,qBAAa,EAAC,SAAS,CAAC,CACtD,CAAC;AAiBF,IAAM,MAAM,GAAG,IAAA,kBAAU,EACvB,UAAC,EAA2C,EAAE,YAAkC;IAA9E,IAAA,IAAI,UAAA,EAAE,aAAa,mBAAA,EAAK,IAAI,cAA7B,yBAA8B,CAAD;IACrB,IAAsD,KAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAlE,YAAY,QAAA,EAAE,MAAM,YAAA,EAAE,KAAC,MAAM,GAAG,CAAE,EAAE,WAAW,SAAmB,CAAC;IAE7E,OAAO,CACL,8BAAC,eAAe,aAAC,GAAG,EAAE,YAAY,IAAM,IAAI;QAC1C,8BAAC,KAAK,IAAC,IAAI,EAAC,KAAK,gBAAa,WAAW,IACtC,IAAA,iBAAQ,EAAC,WAAW,CAAC,CAChB;QACP,aAAa,IAAI,YAAY,CACd,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEM,wBAAM"}
|
package/package.json
CHANGED
@@ -0,0 +1,7 @@
|
|
1
|
+
Twemoji (c) by Twitter, Inc and other contributors
|
2
|
+
|
3
|
+
Twemoji is licensed under a
|
4
|
+
Creative Commons Attribution 4.0 International License.
|
5
|
+
|
6
|
+
You should have received a copy of the license along with this
|
7
|
+
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
|
Binary file
|
@@ -8,7 +8,7 @@ import {Locale} from './Locale.tsx';
|
|
8
8
|
## Usage
|
9
9
|
|
10
10
|
Component to display a locale (country and language) in Akeneo products.
|
11
|
-
|
11
|
+
To display correctly the flag on windows clients, you can use an external font like TwemojiCountryFlags or use one of your own.
|
12
12
|
## Playground
|
13
13
|
|
14
14
|
<Canvas>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, {forwardRef, Ref} from 'react';
|
2
2
|
import styled from 'styled-components';
|
3
3
|
import {getEmoji} from '../../shared';
|
4
|
-
import {getFontSize} from '../../theme';
|
4
|
+
import {getFontFamily, getFontSize} from '../../theme';
|
5
5
|
|
6
6
|
const LocaleContainer = styled.span`
|
7
7
|
display: inline-flex;
|
@@ -12,6 +12,7 @@ const LocaleContainer = styled.span`
|
|
12
12
|
const Emoji = styled.span`
|
13
13
|
font-size: ${getFontSize('bigger')};
|
14
14
|
margin-right: 3px;
|
15
|
+
font-family: 'Flag Emoji', ${getFontFamily('default')};
|
15
16
|
`;
|
16
17
|
|
17
18
|
type LocaleProps = {
|
@@ -76,6 +76,7 @@ Most of the time, when you click on a switcher, a dropdown appears.
|
|
76
76
|
</Canvas>
|
77
77
|
|
78
78
|
## Example with flag
|
79
|
+
To display correctly the flag on windows clients, you can use an external font like TwemojiCountryFlags or use one of your own.
|
79
80
|
|
80
81
|
<Canvas>
|
81
82
|
<Story name="Flag">
|