@carbon/type 11.60.0 → 11.61.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/es/index.js +87 -99
- package/lib/__tests__/exports-test.d.ts +1 -0
- package/lib/__tests__/fluid-test.d.ts +1 -0
- package/lib/__tests__/fontFamily-test.d.ts +1 -0
- package/lib/__tests__/fontWeight-test.d.ts +1 -0
- package/lib/__tests__/reset-test.d.ts +1 -0
- package/lib/__tests__/scale-test.d.ts +1 -0
- package/lib/__tests__/styles-test.d.ts +1 -0
- package/lib/__tests__/tokens-test.d.ts +1 -0
- package/lib/fluid.d.ts +15 -0
- package/lib/fontFamily.d.ts +16 -0
- package/lib/fontWeight.d.ts +14 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +87 -99
- package/lib/print.d.ts +9 -0
- package/lib/reset.d.ts +8 -0
- package/lib/scale.d.ts +16 -0
- package/lib/styles.d.ts +744 -0
- package/lib/tokens.d.ts +65 -0
- package/lib/types.d.ts +16 -0
- package/package.json +8 -5
- package/umd/index.js +87 -99
- package/src/__tests__/__snapshots__/fontFamily-test.js.snap +0 -13
- package/src/__tests__/__snapshots__/fontWeight-test.js.snap +0 -11
- package/src/__tests__/__snapshots__/reset-test.js.snap +0 -11
- package/src/__tests__/__snapshots__/scale-test.js.snap +0 -29
- package/src/__tests__/__snapshots__/styles-test.js.snap +0 -411
- package/src/__tests__/exports-test.js +0 -88
- package/src/__tests__/fluid-test.js +0 -71
- package/src/__tests__/fontFamily-test.js +0 -33
- package/src/__tests__/fontWeight-test.js +0 -33
- package/src/__tests__/reset-test.js +0 -23
- package/src/__tests__/scale-test.js +0 -31
- package/src/__tests__/styles-test.js +0 -18
- package/src/__tests__/tokens-test.js +0 -21
- package/src/fluid.js +0 -86
- package/src/fontFamily.js +0 -30
- package/src/fontWeight.js +0 -24
- package/src/index.js +0 -28
- package/src/print.js +0 -36
- package/src/reset.js +0 -29
- package/src/scale.js +0 -30
- package/src/styles.js +0 -488
- package/src/tokens.js +0 -129
package/lib/tokens.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2018, 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const caption01 = "caption01";
|
|
8
|
+
export declare const caption02 = "caption02";
|
|
9
|
+
export declare const label01 = "label01";
|
|
10
|
+
export declare const label02 = "label02";
|
|
11
|
+
export declare const helperText01 = "helperText01";
|
|
12
|
+
export declare const helperText02 = "helperText02";
|
|
13
|
+
export declare const bodyShort01 = "bodyShort01";
|
|
14
|
+
export declare const bodyLong01 = "bodyLong01";
|
|
15
|
+
export declare const bodyShort02 = "bodyShort02";
|
|
16
|
+
export declare const bodyLong02 = "bodyLong02";
|
|
17
|
+
export declare const code01 = "code01";
|
|
18
|
+
export declare const code02 = "code02";
|
|
19
|
+
export declare const heading01 = "heading01";
|
|
20
|
+
export declare const productiveHeading01 = "productiveHeading01";
|
|
21
|
+
export declare const heading02 = "heading02";
|
|
22
|
+
export declare const productiveHeading02 = "productiveHeading02";
|
|
23
|
+
export declare const productiveHeading03 = "productiveHeading03";
|
|
24
|
+
export declare const productiveHeading04 = "productiveHeading04";
|
|
25
|
+
export declare const productiveHeading05 = "productiveHeading05";
|
|
26
|
+
export declare const productiveHeading06 = "productiveHeading06";
|
|
27
|
+
export declare const productiveHeading07 = "productiveHeading07";
|
|
28
|
+
export declare const expressiveHeading01 = "expressiveHeading01";
|
|
29
|
+
export declare const expressiveHeading02 = "expressiveHeading02";
|
|
30
|
+
export declare const expressiveHeading03 = "expressiveHeading03";
|
|
31
|
+
export declare const expressiveHeading04 = "expressiveHeading04";
|
|
32
|
+
export declare const expressiveHeading05 = "expressiveHeading05";
|
|
33
|
+
export declare const expressiveHeading06 = "expressiveHeading06";
|
|
34
|
+
export declare const expressiveParagraph01 = "expressiveParagraph01";
|
|
35
|
+
export declare const quotation01 = "quotation01";
|
|
36
|
+
export declare const quotation02 = "quotation02";
|
|
37
|
+
export declare const display01 = "display01";
|
|
38
|
+
export declare const display02 = "display02";
|
|
39
|
+
export declare const display03 = "display03";
|
|
40
|
+
export declare const display04 = "display04";
|
|
41
|
+
export declare const legal01 = "legal01";
|
|
42
|
+
export declare const legal02 = "legal02";
|
|
43
|
+
export declare const bodyCompact01 = "bodyCompact01";
|
|
44
|
+
export declare const bodyCompact02 = "bodyCompact02";
|
|
45
|
+
export declare const body01 = "body01";
|
|
46
|
+
export declare const body02 = "body02";
|
|
47
|
+
export declare const headingCompact01 = "headingCompact01";
|
|
48
|
+
export declare const headingCompact02 = "headingCompact02";
|
|
49
|
+
export declare const heading03 = "heading03";
|
|
50
|
+
export declare const heading04 = "heading04";
|
|
51
|
+
export declare const heading05 = "heading05";
|
|
52
|
+
export declare const heading06 = "heading06";
|
|
53
|
+
export declare const heading07 = "heading07";
|
|
54
|
+
export declare const fluidHeading03 = "fluidHeading03";
|
|
55
|
+
export declare const fluidHeading04 = "fluidHeading04";
|
|
56
|
+
export declare const fluidHeading05 = "fluidHeading05";
|
|
57
|
+
export declare const fluidHeading06 = "fluidHeading06";
|
|
58
|
+
export declare const fluidParagraph01 = "fluidParagraph01";
|
|
59
|
+
export declare const fluidQuotation01 = "fluidQuotation01";
|
|
60
|
+
export declare const fluidQuotation02 = "fluidQuotation02";
|
|
61
|
+
export declare const fluidDisplay01 = "fluidDisplay01";
|
|
62
|
+
export declare const fluidDisplay02 = "fluidDisplay02";
|
|
63
|
+
export declare const fluidDisplay03 = "fluidDisplay03";
|
|
64
|
+
export declare const fluidDisplay04 = "fluidDisplay04";
|
|
65
|
+
export declare const unstable_tokens: string[];
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export type TypeStyle = {
|
|
8
|
+
'-moz-osx-font-smoothing'?: string;
|
|
9
|
+
'-webkit-font-smoothing'?: string;
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
fontSize?: string;
|
|
12
|
+
fontWeight?: number;
|
|
13
|
+
letterSpacing?: number | string;
|
|
14
|
+
lineHeight?: number;
|
|
15
|
+
textRendering?: string;
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/type",
|
|
3
3
|
"description": "Typography for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.61.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
7
8
|
"module": "es/index.js",
|
|
8
9
|
"sass": "index.scss",
|
|
9
10
|
"repository": {
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
"es",
|
|
17
18
|
"lib",
|
|
18
19
|
"scss",
|
|
19
|
-
"src",
|
|
20
20
|
"umd",
|
|
21
21
|
"index.scss",
|
|
22
22
|
"telemetry.yml"
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"provenance": true
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "
|
|
39
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
40
|
+
"build": "yarn clean && carbon-cli bundle src/index.ts --name CarbonType && yarn build:types && carbon-cli check \"scss/*.scss\"",
|
|
40
41
|
"clean": "rimraf css es lib umd",
|
|
41
42
|
"postinstall": "ibmtelemetry --config=telemetry.yml"
|
|
42
43
|
},
|
|
@@ -50,7 +51,9 @@
|
|
|
50
51
|
"@carbon/test-utils": "^10.41.0",
|
|
51
52
|
"change-case-all": "^2.1.0",
|
|
52
53
|
"css": "^3.0.0",
|
|
53
|
-
"rimraf": "^6.0.1"
|
|
54
|
+
"rimraf": "^6.0.1",
|
|
55
|
+
"typescript": "^5.7.3",
|
|
56
|
+
"typescript-config-carbon": "^0.10.0"
|
|
54
57
|
},
|
|
55
58
|
"eyeglass": {
|
|
56
59
|
"exports": false,
|
|
@@ -58,5 +61,5 @@
|
|
|
58
61
|
"sassDir": "scss",
|
|
59
62
|
"needs": "^1.3.0"
|
|
60
63
|
},
|
|
61
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "5bb41d341768785b898851fde30731cb31b981c2"
|
|
62
65
|
}
|
package/umd/index.js
CHANGED
|
@@ -14,9 +14,68 @@
|
|
|
14
14
|
return target;
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region src/
|
|
17
|
+
//#region src/fluid.ts
|
|
18
18
|
/**
|
|
19
|
-
* Copyright IBM Corp. 2018,
|
|
19
|
+
* Copyright IBM Corp. 2018, 2026
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/
|
|
24
|
+
const breakpointNames = Object.keys(_carbon_layout.breakpoints);
|
|
25
|
+
const next = (name) => {
|
|
26
|
+
return breakpointNames[breakpointNames.indexOf(name) + 1];
|
|
27
|
+
};
|
|
28
|
+
const fluid = (selector) => {
|
|
29
|
+
const { breakpoints: fluidBreakpoints, ...baseStyles } = selector;
|
|
30
|
+
const styles = { ...baseStyles };
|
|
31
|
+
if (typeof fluidBreakpoints !== "object" || fluidBreakpoints === null) return styles;
|
|
32
|
+
const fluidBreakpointNames = Object.keys(fluidBreakpoints);
|
|
33
|
+
if (fluidBreakpointNames.length === 0) return styles;
|
|
34
|
+
styles.fontSize = fluidTypeSize(styles, "sm", fluidBreakpoints);
|
|
35
|
+
fluidBreakpointNames.forEach((name) => {
|
|
36
|
+
styles[(0, _carbon_layout.breakpoint)(name)] = {
|
|
37
|
+
...fluidBreakpoints[name],
|
|
38
|
+
fontSize: fluidTypeSize(styles, name, fluidBreakpoints)
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return styles;
|
|
42
|
+
};
|
|
43
|
+
const fluidTypeSize = (defaultStyles, fluidBreakpointName, fluidBreakpoints) => {
|
|
44
|
+
const breakpoint = _carbon_layout.breakpoints[fluidBreakpointName];
|
|
45
|
+
const fluidBreakpoint = fluidBreakpointName === "sm" ? defaultStyles : fluidBreakpoints[fluidBreakpointName];
|
|
46
|
+
const defaultFontSize = defaultStyles.fontSize ?? "";
|
|
47
|
+
const breakpointFontSize = fluidBreakpoint?.fontSize;
|
|
48
|
+
let maxFontSize = defaultFontSize;
|
|
49
|
+
let minFontSize = defaultFontSize;
|
|
50
|
+
if (breakpointFontSize) minFontSize = breakpointFontSize;
|
|
51
|
+
let maxViewportWidth = breakpoint.width;
|
|
52
|
+
const minViewportWidth = breakpoint.width;
|
|
53
|
+
let nextBreakpointAvailable = next(fluidBreakpointName);
|
|
54
|
+
let nextFluidBreakpointName = null;
|
|
55
|
+
while (nextBreakpointAvailable) {
|
|
56
|
+
if (fluidBreakpoints[nextBreakpointAvailable]) {
|
|
57
|
+
nextFluidBreakpointName = nextBreakpointAvailable;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
nextBreakpointAvailable = next(nextBreakpointAvailable);
|
|
61
|
+
}
|
|
62
|
+
if (nextFluidBreakpointName) {
|
|
63
|
+
const nextFluidBreakpoint = _carbon_layout.breakpoints[nextFluidBreakpointName];
|
|
64
|
+
const nextFontSize = fluidBreakpoints[nextFluidBreakpointName]?.fontSize;
|
|
65
|
+
if (!nextFontSize) return minFontSize;
|
|
66
|
+
maxFontSize = nextFontSize;
|
|
67
|
+
maxViewportWidth = nextFluidBreakpoint.width;
|
|
68
|
+
return `calc(${minFontSize} + ${subtract(maxFontSize, minFontSize)} * ((100vw - ${minViewportWidth}) / ${subtract(maxViewportWidth, minViewportWidth)}))`;
|
|
69
|
+
}
|
|
70
|
+
return minFontSize;
|
|
71
|
+
};
|
|
72
|
+
const subtract = (a, b) => {
|
|
73
|
+
return parseFloat(String(a)) - parseFloat(String(b));
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/fontFamily.ts
|
|
77
|
+
/**
|
|
78
|
+
* Copyright IBM Corp. 2018, 2026
|
|
20
79
|
*
|
|
21
80
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
22
81
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -28,14 +87,14 @@
|
|
|
28
87
|
sansHebrew: "'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif",
|
|
29
88
|
serif: "'IBM Plex Serif', 'Georgia', Times, serif"
|
|
30
89
|
};
|
|
31
|
-
|
|
32
|
-
if (!fontFamilies
|
|
90
|
+
const fontFamily = (name) => {
|
|
91
|
+
if (!(name in fontFamilies)) throw new Error(`Unable to find font family: \`${name}\`. Expected one of: [${Object.keys(fontFamilies).join(", ")}]`);
|
|
33
92
|
return { fontFamily: fontFamilies[name] };
|
|
34
|
-
}
|
|
93
|
+
};
|
|
35
94
|
//#endregion
|
|
36
|
-
//#region src/fontWeight.
|
|
95
|
+
//#region src/fontWeight.ts
|
|
37
96
|
/**
|
|
38
|
-
* Copyright IBM Corp. 2018,
|
|
97
|
+
* Copyright IBM Corp. 2018, 2026
|
|
39
98
|
*
|
|
40
99
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
41
100
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -45,27 +104,21 @@
|
|
|
45
104
|
regular: 400,
|
|
46
105
|
semibold: 600
|
|
47
106
|
};
|
|
48
|
-
|
|
49
|
-
if (!fontWeights
|
|
107
|
+
const fontWeight = (weight) => {
|
|
108
|
+
if (!(weight in fontWeights)) throw new Error(`Unable to find font weight: \`${weight}\`. Expected one of: [${Object.keys(fontWeights).join(", ")}]`);
|
|
50
109
|
return { fontWeight: fontWeights[weight] };
|
|
51
|
-
}
|
|
110
|
+
};
|
|
52
111
|
//#endregion
|
|
53
|
-
//#region src/print.
|
|
54
|
-
|
|
55
|
-
* Copyright IBM Corp. 2018, 2023
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
58
|
-
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/
|
|
60
|
-
function print(block) {
|
|
112
|
+
//#region src/print.ts
|
|
113
|
+
const print = (block) => {
|
|
61
114
|
return Object.keys(block).reduce((acc, key, index) => {
|
|
62
115
|
if (key === "breakpoints") return acc;
|
|
63
116
|
const property = `${paramCase(key)}: ${block[key]};`;
|
|
64
117
|
if (index === 0) return property;
|
|
65
118
|
return acc + "\n" + property;
|
|
66
119
|
}, "");
|
|
67
|
-
}
|
|
68
|
-
|
|
120
|
+
};
|
|
121
|
+
const paramCase = (string) => {
|
|
69
122
|
let result = "";
|
|
70
123
|
for (let i = 0; i < string.length; i++) {
|
|
71
124
|
const character = string[i];
|
|
@@ -76,11 +129,11 @@
|
|
|
76
129
|
result += character;
|
|
77
130
|
}
|
|
78
131
|
return result;
|
|
79
|
-
}
|
|
132
|
+
};
|
|
80
133
|
//#endregion
|
|
81
|
-
//#region src/reset.
|
|
134
|
+
//#region src/reset.ts
|
|
82
135
|
/**
|
|
83
|
-
* Copyright IBM Corp. 2018,
|
|
136
|
+
* Copyright IBM Corp. 2018, 2026
|
|
84
137
|
*
|
|
85
138
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
86
139
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -98,27 +151,24 @@
|
|
|
98
151
|
code: { fontFamily: fontFamilies.mono }
|
|
99
152
|
};
|
|
100
153
|
//#endregion
|
|
101
|
-
//#region src/scale.
|
|
154
|
+
//#region src/scale.ts
|
|
102
155
|
/**
|
|
103
|
-
* Copyright IBM Corp. 2018,
|
|
156
|
+
* Copyright IBM Corp. 2018, 2026
|
|
104
157
|
*
|
|
105
158
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
106
159
|
* LICENSE file in the root directory of this source tree.
|
|
107
160
|
*/
|
|
108
|
-
|
|
109
|
-
* Get the type size for the given step
|
|
110
|
-
* @param {number} step
|
|
111
|
-
* @returns {number}
|
|
112
|
-
*/
|
|
113
|
-
function getTypeSize(step) {
|
|
161
|
+
const getTypeSize = (step) => {
|
|
114
162
|
if (step <= 1) return 12;
|
|
115
163
|
return getTypeSize(step - 1) + Math.floor((step - 2) / 4 + 1) * 2;
|
|
116
|
-
}
|
|
164
|
+
};
|
|
117
165
|
/**
|
|
118
|
-
*
|
|
119
|
-
* the follow step:
|
|
166
|
+
* Default type scale with 23 steps.
|
|
120
167
|
*
|
|
121
|
-
*
|
|
168
|
+
* Generated with:
|
|
169
|
+
* ```ts
|
|
170
|
+
* Array.from({ length: 23 }, (_, i) => getTypeSize(i + 1))
|
|
171
|
+
* ```
|
|
122
172
|
*/
|
|
123
173
|
const scale = [
|
|
124
174
|
12,
|
|
@@ -146,9 +196,9 @@
|
|
|
146
196
|
156
|
|
147
197
|
];
|
|
148
198
|
//#endregion
|
|
149
|
-
//#region src/styles.
|
|
199
|
+
//#region src/styles.ts
|
|
150
200
|
/**
|
|
151
|
-
* Copyright IBM Corp. 2018,
|
|
201
|
+
* Copyright IBM Corp. 2018, 2026
|
|
152
202
|
*
|
|
153
203
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
154
204
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -632,60 +682,6 @@
|
|
|
632
682
|
const fluidDisplay02 = display02;
|
|
633
683
|
const fluidDisplay03 = display03;
|
|
634
684
|
const fluidDisplay04 = display04;
|
|
635
|
-
//#endregion
|
|
636
|
-
//#region src/fluid.js
|
|
637
|
-
/**
|
|
638
|
-
* Copyright IBM Corp. 2018, 2023
|
|
639
|
-
*
|
|
640
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
641
|
-
* LICENSE file in the root directory of this source tree.
|
|
642
|
-
*/
|
|
643
|
-
const breakpointNames = Object.keys(_carbon_layout.breakpoints);
|
|
644
|
-
function next(name) {
|
|
645
|
-
return breakpointNames[breakpointNames.indexOf(name) + 1];
|
|
646
|
-
}
|
|
647
|
-
function fluid(selector) {
|
|
648
|
-
const { breakpoints: fluidBreakpoints, ...styles } = selector;
|
|
649
|
-
if (typeof fluidBreakpoints !== "object") return styles;
|
|
650
|
-
const fluidBreakpointNames = Object.keys(fluidBreakpoints);
|
|
651
|
-
if (fluidBreakpointNames.length === 0) return styles;
|
|
652
|
-
styles.fontSize = fluidTypeSize(styles, "sm", fluidBreakpoints);
|
|
653
|
-
fluidBreakpointNames.forEach((name) => {
|
|
654
|
-
styles[(0, _carbon_layout.breakpoint)(name)] = {
|
|
655
|
-
...fluidBreakpoints[name],
|
|
656
|
-
fontSize: fluidTypeSize(styles, name, fluidBreakpoints)
|
|
657
|
-
};
|
|
658
|
-
});
|
|
659
|
-
return styles;
|
|
660
|
-
}
|
|
661
|
-
function fluidTypeSize(defaultStyles, fluidBreakpointName, fluidBreakpoints) {
|
|
662
|
-
const breakpoint = _carbon_layout.breakpoints[fluidBreakpointName];
|
|
663
|
-
const fluidBreakpoint = fluidBreakpointName === "sm" ? defaultStyles : fluidBreakpoints[fluidBreakpointName];
|
|
664
|
-
let maxFontSize = defaultStyles.fontSize;
|
|
665
|
-
let minFontSize = defaultStyles.fontSize;
|
|
666
|
-
if (fluidBreakpoint.fontSize) minFontSize = fluidBreakpoint.fontSize;
|
|
667
|
-
let maxViewportWidth = breakpoint.width;
|
|
668
|
-
let minViewportWidth = breakpoint.width;
|
|
669
|
-
let nextBreakpointAvailable = next(fluidBreakpointName);
|
|
670
|
-
let nextFluidBreakpointName = null;
|
|
671
|
-
while (nextBreakpointAvailable) {
|
|
672
|
-
if (fluidBreakpoints[nextBreakpointAvailable]) {
|
|
673
|
-
nextFluidBreakpointName = nextBreakpointAvailable;
|
|
674
|
-
break;
|
|
675
|
-
}
|
|
676
|
-
nextBreakpointAvailable = next(nextBreakpointAvailable);
|
|
677
|
-
}
|
|
678
|
-
if (nextFluidBreakpointName) {
|
|
679
|
-
const nextFluidBreakpoint = _carbon_layout.breakpoints[nextFluidBreakpointName];
|
|
680
|
-
maxFontSize = fluidBreakpoints[nextFluidBreakpointName].fontSize;
|
|
681
|
-
maxViewportWidth = nextFluidBreakpoint.width;
|
|
682
|
-
return `calc(${minFontSize} + ${subtract(maxFontSize, minFontSize)} * ((100vw - ${minViewportWidth}) / ${subtract(maxViewportWidth, minViewportWidth)}))`;
|
|
683
|
-
}
|
|
684
|
-
return minFontSize;
|
|
685
|
-
}
|
|
686
|
-
function subtract(a, b) {
|
|
687
|
-
return parseFloat(a) - parseFloat(b);
|
|
688
|
-
}
|
|
689
685
|
const unstable_tokens = [
|
|
690
686
|
"caption01",
|
|
691
687
|
"caption02",
|
|
@@ -747,14 +743,6 @@
|
|
|
747
743
|
"fluidDisplay04"
|
|
748
744
|
];
|
|
749
745
|
//#endregion
|
|
750
|
-
//#region src/index.js
|
|
751
|
-
/**
|
|
752
|
-
* Copyright IBM Corp. 2018, 2023
|
|
753
|
-
*
|
|
754
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
755
|
-
* LICENSE file in the root directory of this source tree.
|
|
756
|
-
*/
|
|
757
|
-
//#endregion
|
|
758
746
|
exports.body01 = body01;
|
|
759
747
|
exports.body02 = body02;
|
|
760
748
|
exports.bodyCompact01 = bodyCompact01;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`fontFamily should be printable 1`] = `"font-family: 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace;"`;
|
|
4
|
-
|
|
5
|
-
exports[`fontFamily should export the supported font families 1`] = `
|
|
6
|
-
{
|
|
7
|
-
"mono": "'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace",
|
|
8
|
-
"sans": "'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif",
|
|
9
|
-
"sansCondensed": "'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif",
|
|
10
|
-
"sansHebrew": "'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif",
|
|
11
|
-
"serif": "'IBM Plex Serif', 'Georgia', Times, serif",
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`reset should be printable 1`] = `"font-size: 16px;"`;
|
|
4
|
-
|
|
5
|
-
exports[`reset should be printable 2`] = `
|
|
6
|
-
"font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif;
|
|
7
|
-
font-weight: 400;
|
|
8
|
-
text-rendering: optimizeLegibility;
|
|
9
|
-
--webkit--font--smoothing: antialiased;
|
|
10
|
-
--moz--osx--font--smoothing: grayscale;"
|
|
11
|
-
`;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`scale should export the type scale 1`] = `
|
|
4
|
-
[
|
|
5
|
-
12,
|
|
6
|
-
14,
|
|
7
|
-
16,
|
|
8
|
-
18,
|
|
9
|
-
20,
|
|
10
|
-
24,
|
|
11
|
-
28,
|
|
12
|
-
32,
|
|
13
|
-
36,
|
|
14
|
-
42,
|
|
15
|
-
48,
|
|
16
|
-
54,
|
|
17
|
-
60,
|
|
18
|
-
68,
|
|
19
|
-
76,
|
|
20
|
-
84,
|
|
21
|
-
92,
|
|
22
|
-
102,
|
|
23
|
-
112,
|
|
24
|
-
122,
|
|
25
|
-
132,
|
|
26
|
-
144,
|
|
27
|
-
156,
|
|
28
|
-
]
|
|
29
|
-
`;
|