@openfin/ui-library 0.1.8-alpha.1618009013 → 0.1.8-alpha.1618538299
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/dist/assets/fonts/Inter-Italic.woff2 +0 -0
- package/dist/assets/fonts/Inter-Regular.woff2 +0 -0
- package/dist/assets/fonts/Inter-SemiBold.woff2 +0 -0
- package/dist/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/dist/assets/fonts/index.d.ts +6 -0
- package/dist/assets/fonts/index.js +11 -0
- package/dist/assets/fonts/index.ts +6 -0
- package/dist/components/system/ThemeProvider/index.d.ts +1 -0
- package/dist/components/system/ThemeProvider/index.js +1 -0
- package/dist/components/system/ThemeProvider/lib/config.d.ts +15 -3
- package/dist/components/system/ThemeProvider/lib/config.js +0 -3
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +5 -0
- package/dist/components/system/ThemeProvider/lib/constants.js +12 -1
- package/dist/components/system/ThemeProvider/lib/createFontFaceCss.d.ts +11 -0
- package/dist/components/system/ThemeProvider/lib/createFontFaceCss.js +43 -0
- package/dist/components/system/ThemeProvider/lib/fonts.d.js +1 -0
- package/dist/components/system/ThemeProvider/lib/helpers.js +4 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +5 -4
- package/dist/components/system/ThemeProvider/lib/font-face-base64.d.ts +0 -2
- package/dist/components/system/ThemeProvider/lib/font-face-base64.js +0 -71
- package/dist/components/system/ThemeProvider/lib/font-face-cdn.d.ts +0 -2
- package/dist/components/system/ThemeProvider/lib/font-face-cdn.js +0 -48
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Fonts = void 0;
|
|
7
|
+
const Inter_Regular_woff2_1 = __importDefault(require("./Inter-Regular.woff2"));
|
|
8
|
+
const Inter_Italic_woff2_1 = __importDefault(require("./Inter-Italic.woff2"));
|
|
9
|
+
const Inter_SemiBold_woff2_1 = __importDefault(require("./Inter-SemiBold.woff2"));
|
|
10
|
+
const Inter_SemiBoldItalic_woff2_1 = __importDefault(require("./Inter-SemiBoldItalic.woff2"));
|
|
11
|
+
exports.Fonts = { regular: Inter_Regular_woff2_1.default, italic: Inter_Italic_woff2_1.default, semiBold: Inter_SemiBold_woff2_1.default, semiBoldItalic: Inter_SemiBoldItalic_woff2_1.default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import regular from './Inter-Regular.woff2';
|
|
2
|
+
import italic from './Inter-Italic.woff2';
|
|
3
|
+
import semiBold from './Inter-SemiBold.woff2';
|
|
4
|
+
import semiBoldItalic from './Inter-SemiBoldItalic.woff2';
|
|
5
|
+
|
|
6
|
+
export const Fonts = { regular, italic, semiBold, semiBoldItalic };
|
|
@@ -12,6 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./lib/constants"), exports);
|
|
14
14
|
__exportStar(require("./lib/createTheme"), exports);
|
|
15
|
+
__exportStar(require("./lib/createFontFaceCss"), exports);
|
|
15
16
|
__exportStar(require("./lib/helpers"), exports);
|
|
16
17
|
__exportStar(require("./lib/interface"), exports);
|
|
17
18
|
__exportStar(require("./lib/mixins"), exports);
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { FlattenSimpleInterpolation } from 'styled-components';
|
|
1
2
|
/**
|
|
2
|
-
* Configuration
|
|
3
|
+
* ThemeProvider Configuration
|
|
3
4
|
*/
|
|
4
|
-
export declare type ConfigurationType =
|
|
5
|
-
|
|
5
|
+
export declare type ConfigurationType = CDNFontConfig | ImportFontConfig;
|
|
6
|
+
/**
|
|
7
|
+
* Custom import and handling for font loading.
|
|
8
|
+
*/
|
|
9
|
+
export declare type ImportFontConfig = {
|
|
10
|
+
fontLoading: 'import';
|
|
11
|
+
fontCss: FlattenSimpleInterpolation;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Use fonts from the Openfin CDN.
|
|
15
|
+
*/
|
|
16
|
+
export declare type CDNFontConfig = {
|
|
17
|
+
fontLoading: 'cdn';
|
|
6
18
|
};
|
|
7
19
|
export declare const Configuration: ConfigurationType;
|
|
@@ -517,3 +517,8 @@ export declare const IconSize: {
|
|
|
517
517
|
readonly xxlarge: "32px";
|
|
518
518
|
readonly xxxlarge: "48px";
|
|
519
519
|
};
|
|
520
|
+
/**
|
|
521
|
+
* @font-face --
|
|
522
|
+
* Generate @font-face CSS for CDN Loaded fonts
|
|
523
|
+
*/
|
|
524
|
+
export declare const cdnFontFaceCss: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -19,9 +19,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.IconSize = exports.IconSet = exports.Transition = exports.Typography = exports.LineHeight = exports.FontWeight = exports.FontSize = exports.FontStack = exports.Shadow = exports.Radius = exports.UnitPx = exports.Unit = exports.SizeName = exports.Size = exports.Color = void 0;
|
|
22
|
+
exports.cdnFontFaceCss = exports.IconSize = exports.IconSet = exports.Transition = exports.Typography = exports.LineHeight = exports.FontWeight = exports.FontSize = exports.FontStack = exports.Shadow = exports.Radius = exports.UnitPx = exports.Unit = exports.SizeName = exports.Size = exports.Color = void 0;
|
|
23
23
|
const RadixIcons = __importStar(require("@modulz/radix-icons"));
|
|
24
24
|
const OpenFinIcons = __importStar(require("../../../elements/Icon/openfin"));
|
|
25
|
+
const createFontFaceCss_1 = require("./createFontFaceCss");
|
|
25
26
|
/**
|
|
26
27
|
* Color --
|
|
27
28
|
* Color maps names to values.
|
|
@@ -253,3 +254,13 @@ exports.IconSize = {
|
|
|
253
254
|
[exports.Size.xxlarge]: exports.UnitPx.xxxlarge,
|
|
254
255
|
[exports.Size.xxxlarge]: exports.UnitPx.xxxxlarge,
|
|
255
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* @font-face --
|
|
259
|
+
* Generate @font-face CSS for CDN Loaded fonts
|
|
260
|
+
*/
|
|
261
|
+
exports.cdnFontFaceCss = createFontFaceCss_1.createFontFaceCss({
|
|
262
|
+
regular: '//cdn.openfin.co/fonts/inter/Inter-Regular.woff2?v3.15',
|
|
263
|
+
italic: '//cdn.openfin.co/fonts/inter/Inter-Italic.woff2?v3.15',
|
|
264
|
+
semiBold: '//cdn.openfin.co/fonts/inter/Inter-SemiBold.woff2?v3.15',
|
|
265
|
+
semiBoldItalic: '//cdn.openfin.co/fonts/inter/Inter-SemiBoldItalic.woff2?v3.15',
|
|
266
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlattenSimpleInterpolation } from 'styled-components';
|
|
2
|
+
export interface ImportFonts {
|
|
3
|
+
regular: string;
|
|
4
|
+
italic: string;
|
|
5
|
+
semiBold: string;
|
|
6
|
+
semiBoldItalic: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Import global fonts using your own config.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createFontFaceCss(fonts: ImportFonts): FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFontFaceCss = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
/**
|
|
7
|
+
* Import global fonts using your own config.
|
|
8
|
+
*/
|
|
9
|
+
function createFontFaceCss(fonts) {
|
|
10
|
+
return styled_components_1.css `
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'Inter';
|
|
13
|
+
src: url(${fonts.regular}) format('woff2');
|
|
14
|
+
font-weight: ${constants_1.FontWeight.normal};
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-display: swap;
|
|
17
|
+
}
|
|
18
|
+
@font-face {
|
|
19
|
+
font-family: 'Inter';
|
|
20
|
+
src: url(${fonts.italic}) format('woff2');
|
|
21
|
+
font-weight: ${constants_1.FontWeight.normal};
|
|
22
|
+
font-style: italic;
|
|
23
|
+
font-display: swap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@font-face {
|
|
27
|
+
font-family: 'Inter';
|
|
28
|
+
src: url(${fonts.semiBold}) format('woff2');
|
|
29
|
+
font-weight: ${constants_1.FontWeight.bold};
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-display: swap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'Inter';
|
|
36
|
+
src: url(${fonts.semiBoldItalic}) format('woff2');
|
|
37
|
+
font-weight: ${constants_1.FontWeight.bold};
|
|
38
|
+
font-style: italic;
|
|
39
|
+
font-display: swap;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
exports.createFontFaceCss = createFontFaceCss;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getStatusColor = exports.getFontFaces = exports.getRootCssVars = exports.getVariantCSS = void 0;
|
|
7
|
-
const
|
|
8
|
-
const font_face_cdn_1 = __importDefault(require("./font-face-cdn"));
|
|
4
|
+
const constants_1 = require("./constants");
|
|
9
5
|
const palette_1 = require("./palette");
|
|
10
6
|
/**
|
|
11
7
|
* Get the CSS associated with a variant key
|
|
@@ -29,11 +25,11 @@ exports.getRootCssVars = getRootCssVars;
|
|
|
29
25
|
*/
|
|
30
26
|
const getFontFaces = ({ theme }) => {
|
|
31
27
|
switch (theme._config.fontLoading) {
|
|
32
|
-
case '
|
|
33
|
-
return
|
|
28
|
+
case 'import':
|
|
29
|
+
return theme._config.fontCss;
|
|
34
30
|
case 'cdn':
|
|
35
31
|
default:
|
|
36
|
-
return
|
|
32
|
+
return constants_1.cdnFontFaceCss;
|
|
37
33
|
}
|
|
38
34
|
};
|
|
39
35
|
exports.getFontFaces = getFontFaces;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ export * from './components/typography/Heading';
|
|
|
12
12
|
export * from './components/typography/Text';
|
|
13
13
|
export * from './hooks/useColorScheme';
|
|
14
14
|
export * from './hooks/useMediaQuery';
|
|
15
|
+
export * from './assets/fonts';
|
|
15
16
|
export * as StoryHelpers from './storybookHelpers';
|
package/dist/index.js
CHANGED
|
@@ -37,4 +37,5 @@ __exportStar(require("./components/typography/Heading"), exports);
|
|
|
37
37
|
__exportStar(require("./components/typography/Text"), exports);
|
|
38
38
|
__exportStar(require("./hooks/useColorScheme"), exports);
|
|
39
39
|
__exportStar(require("./hooks/useMediaQuery"), exports);
|
|
40
|
+
__exportStar(require("./assets/fonts"), exports);
|
|
40
41
|
exports.StoryHelpers = __importStar(require("./storybookHelpers"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/ui-library",
|
|
3
3
|
"description": "OpenFin UI Component Library",
|
|
4
|
-
"version": "0.1.8-alpha.
|
|
4
|
+
"version": "0.1.8-alpha.1618538299",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"repository": "github:openfin/ui-library",
|
|
@@ -72,17 +72,18 @@
|
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"start": "yarn storybook",
|
|
75
|
-
"build": "yarn build:clean && yarn build:bundle",
|
|
75
|
+
"build": "yarn build:clean && yarn build:bundle && yarn build:copy",
|
|
76
76
|
"build:bundle": "yarn build:scripts && yarn build:types",
|
|
77
77
|
"build:clean": "rimraf dist",
|
|
78
|
+
"build:copy": "node scripts/copy src/assets dist/assets",
|
|
78
79
|
"build:dev": "yarn build && yalc push",
|
|
79
80
|
"build:scripts": "cross-env NODE_ENV=production babel src -d dist --extensions '.ts,.tsx'",
|
|
80
81
|
"build:types": "tsc -p tsconfig.bundle.json",
|
|
81
82
|
"test": "react-scripts test",
|
|
82
83
|
"eject": "react-scripts eject",
|
|
83
84
|
"lint": "yarn lint:typescript && yarn lint:styles",
|
|
84
|
-
"lint:typescript": "eslint
|
|
85
|
-
"lint:styles": "stylelint
|
|
85
|
+
"lint:typescript": "eslint \"./src/**/*.{ts,tsx}\"",
|
|
86
|
+
"lint:styles": "stylelint \"./src/**/*.{ts,tsx}\"",
|
|
86
87
|
"storybook": "yarn storybook:cache-clear && start-storybook -p 6006 -s public",
|
|
87
88
|
"storybook:build": "build-storybook -s public",
|
|
88
89
|
"storybook:cache-clear": "rimraf ./node_modules/.cache/storybook",
|