@carbon/layout 11.59.0-rc.0 → 11.60.0-rc.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 +62 -60
- package/js/generated/layout-tokens.d.ts +51 -0
- package/js/generated/layout-tokens.js +51 -0
- package/lib/index.d.ts +1 -38
- package/lib/index.js +67 -59
- package/package.json +7 -5
- package/src/dtcg/README.md +266 -0
- package/src/dtcg/layout.json +432 -0
- package/src/index.ts +74 -60
- package/style-dictionary/formats/js-layout.js +104 -0
- package/style-dictionary/formats/scss-layout.js +188 -0
- package/style-dictionary/sd.config.js +104 -0
- package/umd/index.js +67 -59
package/es/index.js
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
//#region js/generated/layout-tokens.js
|
|
2
|
+
const spacing01 = "0.125rem";
|
|
3
|
+
const spacing02 = "0.25rem";
|
|
4
|
+
const spacing03 = "0.5rem";
|
|
5
|
+
const spacing04 = "0.75rem";
|
|
6
|
+
const spacing05 = "1rem";
|
|
7
|
+
const spacing06 = "1.5rem";
|
|
8
|
+
const spacing07 = "2rem";
|
|
9
|
+
const spacing08 = "2.5rem";
|
|
10
|
+
const spacing09 = "3rem";
|
|
11
|
+
const spacing10 = "4rem";
|
|
12
|
+
const spacing11 = "5rem";
|
|
13
|
+
const spacing12 = "6rem";
|
|
14
|
+
const spacing13 = "10rem";
|
|
15
|
+
const fluidSpacing01 = 0;
|
|
16
|
+
const fluidSpacing02 = "2vw";
|
|
17
|
+
const fluidSpacing03 = "5vw";
|
|
18
|
+
const fluidSpacing04 = "10vw";
|
|
19
|
+
const container01 = "1.5rem";
|
|
20
|
+
const container02 = "2rem";
|
|
21
|
+
const container03 = "2.5rem";
|
|
22
|
+
const container04 = "3rem";
|
|
23
|
+
const container05 = "4rem";
|
|
24
|
+
const sizeXs = "1.5rem";
|
|
25
|
+
const sizeSm = "2rem";
|
|
26
|
+
const sizeMd = "2.5rem";
|
|
27
|
+
const sizeLg = "3rem";
|
|
28
|
+
const sizeXl = "4rem";
|
|
29
|
+
const size2xl = "5rem";
|
|
30
|
+
const iconSize01 = "1rem";
|
|
31
|
+
const iconSize02 = "1.25rem";
|
|
32
|
+
const borderRadius00 = "0px";
|
|
33
|
+
const borderRadius02 = "0.125rem";
|
|
34
|
+
const borderRadius04 = "0.25rem";
|
|
35
|
+
const borderRadius08 = "0.5rem";
|
|
36
|
+
const borderRadius16 = "1rem";
|
|
37
|
+
const borderRadius24 = "1.5rem";
|
|
38
|
+
const borderRadiusMax = "999999px";
|
|
39
|
+
const layout01 = "1rem";
|
|
40
|
+
const layout02 = "1.5rem";
|
|
41
|
+
const layout03 = "2rem";
|
|
42
|
+
const layout04 = "3rem";
|
|
43
|
+
const layout05 = "4rem";
|
|
44
|
+
const layout06 = "6rem";
|
|
45
|
+
const layout07 = "10rem";
|
|
46
|
+
//#endregion
|
|
1
47
|
//#region src/tokens.ts
|
|
2
48
|
/**
|
|
3
49
|
* Copyright IBM Corp. 2018, 2026
|
|
@@ -46,12 +92,6 @@ const unstable_tokens = [
|
|
|
46
92
|
];
|
|
47
93
|
//#endregion
|
|
48
94
|
//#region src/index.ts
|
|
49
|
-
/**
|
|
50
|
-
* Copyright IBM Corp. 2018, 2026
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
53
|
-
* LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/
|
|
55
95
|
const baseFontSize = 16;
|
|
56
96
|
const rem = (px) => {
|
|
57
97
|
return `${px / 16}rem`;
|
|
@@ -64,29 +104,29 @@ const px = (value) => {
|
|
|
64
104
|
};
|
|
65
105
|
const breakpoints = {
|
|
66
106
|
sm: {
|
|
67
|
-
width:
|
|
107
|
+
width: rem(320),
|
|
68
108
|
columns: 4,
|
|
69
109
|
margin: "0"
|
|
70
110
|
},
|
|
71
111
|
md: {
|
|
72
|
-
width:
|
|
112
|
+
width: rem(672),
|
|
73
113
|
columns: 8,
|
|
74
|
-
margin:
|
|
114
|
+
margin: rem(16)
|
|
75
115
|
},
|
|
76
116
|
lg: {
|
|
77
|
-
width:
|
|
117
|
+
width: rem(1056),
|
|
78
118
|
columns: 16,
|
|
79
|
-
margin:
|
|
119
|
+
margin: rem(16)
|
|
80
120
|
},
|
|
81
121
|
xlg: {
|
|
82
|
-
width:
|
|
122
|
+
width: rem(1312),
|
|
83
123
|
columns: 16,
|
|
84
|
-
margin:
|
|
124
|
+
margin: rem(16)
|
|
85
125
|
},
|
|
86
126
|
max: {
|
|
87
|
-
width:
|
|
127
|
+
width: rem(1584),
|
|
88
128
|
columns: 16,
|
|
89
|
-
margin:
|
|
129
|
+
margin: rem(24)
|
|
90
130
|
}
|
|
91
131
|
};
|
|
92
132
|
const breakpointUp = (name) => {
|
|
@@ -100,19 +140,6 @@ const miniUnit = 8;
|
|
|
100
140
|
const miniUnits = (count) => {
|
|
101
141
|
return rem(8 * count);
|
|
102
142
|
};
|
|
103
|
-
const spacing01 = /*#__PURE__*/ miniUnits(.25);
|
|
104
|
-
const spacing02 = /*#__PURE__*/ miniUnits(.5);
|
|
105
|
-
const spacing03 = /*#__PURE__*/ miniUnits(1);
|
|
106
|
-
const spacing04 = /*#__PURE__*/ miniUnits(1.5);
|
|
107
|
-
const spacing05 = /*#__PURE__*/ miniUnits(2);
|
|
108
|
-
const spacing06 = /*#__PURE__*/ miniUnits(3);
|
|
109
|
-
const spacing07 = /*#__PURE__*/ miniUnits(4);
|
|
110
|
-
const spacing08 = /*#__PURE__*/ miniUnits(5);
|
|
111
|
-
const spacing09 = /*#__PURE__*/ miniUnits(6);
|
|
112
|
-
const spacing10 = /*#__PURE__*/ miniUnits(8);
|
|
113
|
-
const spacing11 = /*#__PURE__*/ miniUnits(10);
|
|
114
|
-
const spacing12 = /*#__PURE__*/ miniUnits(12);
|
|
115
|
-
const spacing13 = /*#__PURE__*/ miniUnits(20);
|
|
116
143
|
const spacing = [
|
|
117
144
|
spacing01,
|
|
118
145
|
spacing02,
|
|
@@ -128,23 +155,12 @@ const spacing = [
|
|
|
128
155
|
spacing12,
|
|
129
156
|
spacing13
|
|
130
157
|
];
|
|
131
|
-
const fluidSpacing01 = 0;
|
|
132
|
-
const fluidSpacing02 = "2vw";
|
|
133
|
-
const fluidSpacing03 = "5vw";
|
|
134
|
-
const fluidSpacing04 = "10vw";
|
|
135
158
|
const fluidSpacing = [
|
|
136
159
|
0,
|
|
137
160
|
"2vw",
|
|
138
161
|
"5vw",
|
|
139
162
|
fluidSpacing04
|
|
140
163
|
];
|
|
141
|
-
const layout01 = /*#__PURE__*/ miniUnits(2);
|
|
142
|
-
const layout02 = /*#__PURE__*/ miniUnits(3);
|
|
143
|
-
const layout03 = /*#__PURE__*/ miniUnits(4);
|
|
144
|
-
const layout04 = /*#__PURE__*/ miniUnits(6);
|
|
145
|
-
const layout05 = /*#__PURE__*/ miniUnits(8);
|
|
146
|
-
const layout06 = /*#__PURE__*/ miniUnits(12);
|
|
147
|
-
const layout07 = /*#__PURE__*/ miniUnits(20);
|
|
148
164
|
const layout = [
|
|
149
165
|
layout01,
|
|
150
166
|
layout02,
|
|
@@ -154,11 +170,6 @@ const layout = [
|
|
|
154
170
|
layout06,
|
|
155
171
|
layout07
|
|
156
172
|
];
|
|
157
|
-
const container01 = /*#__PURE__*/ miniUnits(3);
|
|
158
|
-
const container02 = /*#__PURE__*/ miniUnits(4);
|
|
159
|
-
const container03 = /*#__PURE__*/ miniUnits(5);
|
|
160
|
-
const container04 = /*#__PURE__*/ miniUnits(6);
|
|
161
|
-
const container05 = /*#__PURE__*/ miniUnits(8);
|
|
162
173
|
const container = [
|
|
163
174
|
container01,
|
|
164
175
|
container02,
|
|
@@ -166,12 +177,12 @@ const container = [
|
|
|
166
177
|
container04,
|
|
167
178
|
container05
|
|
168
179
|
];
|
|
169
|
-
const sizeXSmall =
|
|
170
|
-
const sizeSmall =
|
|
171
|
-
const sizeMedium =
|
|
172
|
-
const sizeLarge =
|
|
173
|
-
const sizeXLarge =
|
|
174
|
-
const size2XLarge =
|
|
180
|
+
const sizeXSmall = sizeXs;
|
|
181
|
+
const sizeSmall = sizeSm;
|
|
182
|
+
const sizeMedium = sizeMd;
|
|
183
|
+
const sizeLarge = sizeLg;
|
|
184
|
+
const sizeXLarge = sizeXl;
|
|
185
|
+
const size2XLarge = size2xl;
|
|
175
186
|
const sizes = {
|
|
176
187
|
XSmall: sizeXSmall,
|
|
177
188
|
Small: sizeSmall,
|
|
@@ -180,16 +191,7 @@ const sizes = {
|
|
|
180
191
|
XLarge: sizeXLarge,
|
|
181
192
|
"2XLarge": size2XLarge
|
|
182
193
|
};
|
|
183
|
-
const iconSize01 = "1rem";
|
|
184
|
-
const iconSize02 = "1.25rem";
|
|
185
194
|
const iconSize = [iconSize01, iconSize02];
|
|
186
|
-
const borderRadius00 = "0px";
|
|
187
|
-
const borderRadius02 = rem(2);
|
|
188
|
-
const borderRadius04 = rem(4);
|
|
189
|
-
const borderRadius08 = rem(8);
|
|
190
|
-
const borderRadius16 = rem(16);
|
|
191
|
-
const borderRadius24 = rem(24);
|
|
192
|
-
const borderRadiusMax = "999999px";
|
|
193
195
|
const borderRadius = {
|
|
194
196
|
"border-radius-00": "0px",
|
|
195
197
|
"border-radius-02": borderRadius02,
|
|
@@ -200,4 +202,4 @@ const borderRadius = {
|
|
|
200
202
|
"border-radius-max": borderRadiusMax
|
|
201
203
|
};
|
|
202
204
|
//#endregion
|
|
203
|
-
export { baseFontSize, borderRadius, borderRadius00, borderRadius02, borderRadius04, borderRadius08, borderRadius16, borderRadius24, borderRadiusMax, breakpoint, breakpointDown, breakpointUp, breakpoints, container, container01, container02, container03, container04, container05, em, fluidSpacing, fluidSpacing01, fluidSpacing02, fluidSpacing03, fluidSpacing04, iconSize, iconSize01, iconSize02, layout, layout01, layout02, layout03, layout04, layout05, layout06, layout07, miniUnit, miniUnits, px, rem, size2XLarge, sizeLarge, sizeMedium, sizeSmall, sizeXLarge, sizeXSmall, sizes, spacing, spacing01, spacing02, spacing03, spacing04, spacing05, spacing06, spacing07, spacing08, spacing09, spacing10, spacing11, spacing12, spacing13, unstable_tokens };
|
|
205
|
+
export { baseFontSize, borderRadius, borderRadius00, borderRadius02, borderRadius04, borderRadius08, borderRadius16, borderRadius24, borderRadiusMax, breakpoint, breakpointDown, breakpointUp, breakpoints, container, container01, container02, container03, container04, container05, em, fluidSpacing, fluidSpacing01, fluidSpacing02, fluidSpacing03, fluidSpacing04, iconSize, iconSize01, iconSize02, layout, layout01, layout02, layout03, layout04, layout05, layout06, layout07, miniUnit, miniUnits, px, rem, size2XLarge, size2xl, sizeLarge, sizeLg, sizeMd, sizeMedium, sizeSm, sizeSmall, sizeXLarge, sizeXSmall, sizeXl, sizeXs, sizes, spacing, spacing01, spacing02, spacing03, spacing04, spacing05, spacing06, spacing07, spacing08, spacing09, spacing10, spacing11, spacing12, spacing13, unstable_tokens };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Code generated by @carbon/layout. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2026
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
|
|
8
|
+
export declare const spacing01: string;
|
|
9
|
+
export declare const spacing02: string;
|
|
10
|
+
export declare const spacing03: string;
|
|
11
|
+
export declare const spacing04: string;
|
|
12
|
+
export declare const spacing05: string;
|
|
13
|
+
export declare const spacing06: string;
|
|
14
|
+
export declare const spacing07: string;
|
|
15
|
+
export declare const spacing08: string;
|
|
16
|
+
export declare const spacing09: string;
|
|
17
|
+
export declare const spacing10: string;
|
|
18
|
+
export declare const spacing11: string;
|
|
19
|
+
export declare const spacing12: string;
|
|
20
|
+
export declare const spacing13: string;
|
|
21
|
+
export declare const fluidSpacing01: number;
|
|
22
|
+
export declare const fluidSpacing02: string;
|
|
23
|
+
export declare const fluidSpacing03: string;
|
|
24
|
+
export declare const fluidSpacing04: string;
|
|
25
|
+
export declare const container01: string;
|
|
26
|
+
export declare const container02: string;
|
|
27
|
+
export declare const container03: string;
|
|
28
|
+
export declare const container04: string;
|
|
29
|
+
export declare const container05: string;
|
|
30
|
+
export declare const sizeXs: string;
|
|
31
|
+
export declare const sizeSm: string;
|
|
32
|
+
export declare const sizeMd: string;
|
|
33
|
+
export declare const sizeLg: string;
|
|
34
|
+
export declare const sizeXl: string;
|
|
35
|
+
export declare const size2xl: string;
|
|
36
|
+
export declare const iconSize01: string;
|
|
37
|
+
export declare const iconSize02: string;
|
|
38
|
+
export declare const borderRadius00: string;
|
|
39
|
+
export declare const borderRadius02: string;
|
|
40
|
+
export declare const borderRadius04: string;
|
|
41
|
+
export declare const borderRadius08: string;
|
|
42
|
+
export declare const borderRadius16: string;
|
|
43
|
+
export declare const borderRadius24: string;
|
|
44
|
+
export declare const borderRadiusMax: string;
|
|
45
|
+
export declare const layout01: string;
|
|
46
|
+
export declare const layout02: string;
|
|
47
|
+
export declare const layout03: string;
|
|
48
|
+
export declare const layout04: string;
|
|
49
|
+
export declare const layout05: string;
|
|
50
|
+
export declare const layout06: string;
|
|
51
|
+
export declare const layout07: string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Code generated by @carbon/layout. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2026
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
|
|
8
|
+
export const spacing01 = '0.125rem';
|
|
9
|
+
export const spacing02 = '0.25rem';
|
|
10
|
+
export const spacing03 = '0.5rem';
|
|
11
|
+
export const spacing04 = '0.75rem';
|
|
12
|
+
export const spacing05 = '1rem';
|
|
13
|
+
export const spacing06 = '1.5rem';
|
|
14
|
+
export const spacing07 = '2rem';
|
|
15
|
+
export const spacing08 = '2.5rem';
|
|
16
|
+
export const spacing09 = '3rem';
|
|
17
|
+
export const spacing10 = '4rem';
|
|
18
|
+
export const spacing11 = '5rem';
|
|
19
|
+
export const spacing12 = '6rem';
|
|
20
|
+
export const spacing13 = '10rem';
|
|
21
|
+
export const fluidSpacing01 = 0;
|
|
22
|
+
export const fluidSpacing02 = '2vw';
|
|
23
|
+
export const fluidSpacing03 = '5vw';
|
|
24
|
+
export const fluidSpacing04 = '10vw';
|
|
25
|
+
export const container01 = '1.5rem';
|
|
26
|
+
export const container02 = '2rem';
|
|
27
|
+
export const container03 = '2.5rem';
|
|
28
|
+
export const container04 = '3rem';
|
|
29
|
+
export const container05 = '4rem';
|
|
30
|
+
export const sizeXs = '1.5rem';
|
|
31
|
+
export const sizeSm = '2rem';
|
|
32
|
+
export const sizeMd = '2.5rem';
|
|
33
|
+
export const sizeLg = '3rem';
|
|
34
|
+
export const sizeXl = '4rem';
|
|
35
|
+
export const size2xl = '5rem';
|
|
36
|
+
export const iconSize01 = '1rem';
|
|
37
|
+
export const iconSize02 = '1.25rem';
|
|
38
|
+
export const borderRadius00 = '0px';
|
|
39
|
+
export const borderRadius02 = '0.125rem';
|
|
40
|
+
export const borderRadius04 = '0.25rem';
|
|
41
|
+
export const borderRadius08 = '0.5rem';
|
|
42
|
+
export const borderRadius16 = '1rem';
|
|
43
|
+
export const borderRadius24 = '1.5rem';
|
|
44
|
+
export const borderRadiusMax = '999999px';
|
|
45
|
+
export const layout01 = '1rem';
|
|
46
|
+
export const layout02 = '1.5rem';
|
|
47
|
+
export const layout03 = '2rem';
|
|
48
|
+
export const layout04 = '3rem';
|
|
49
|
+
export const layout05 = '4rem';
|
|
50
|
+
export const layout06 = '6rem';
|
|
51
|
+
export const layout07 = '10rem';
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
export * from '../js/generated/layout-tokens';
|
|
7
8
|
import { unstable_tokens } from './tokens';
|
|
8
9
|
export { unstable_tokens };
|
|
9
10
|
export type BreakpointName = 'sm' | 'md' | 'lg' | 'xlg' | 'max';
|
|
@@ -24,38 +25,9 @@ export declare const breakpointDown: (name: BreakpointName) => string;
|
|
|
24
25
|
export declare const breakpoint: (name: BreakpointName) => string;
|
|
25
26
|
export declare const miniUnit = 8;
|
|
26
27
|
export declare const miniUnits: (count: number) => string;
|
|
27
|
-
export declare const spacing01: string;
|
|
28
|
-
export declare const spacing02: string;
|
|
29
|
-
export declare const spacing03: string;
|
|
30
|
-
export declare const spacing04: string;
|
|
31
|
-
export declare const spacing05: string;
|
|
32
|
-
export declare const spacing06: string;
|
|
33
|
-
export declare const spacing07: string;
|
|
34
|
-
export declare const spacing08: string;
|
|
35
|
-
export declare const spacing09: string;
|
|
36
|
-
export declare const spacing10: string;
|
|
37
|
-
export declare const spacing11: string;
|
|
38
|
-
export declare const spacing12: string;
|
|
39
|
-
export declare const spacing13: string;
|
|
40
28
|
export declare const spacing: string[];
|
|
41
|
-
export declare const fluidSpacing01 = 0;
|
|
42
|
-
export declare const fluidSpacing02 = "2vw";
|
|
43
|
-
export declare const fluidSpacing03 = "5vw";
|
|
44
|
-
export declare const fluidSpacing04 = "10vw";
|
|
45
29
|
export declare const fluidSpacing: (string | number)[];
|
|
46
|
-
export declare const layout01: string;
|
|
47
|
-
export declare const layout02: string;
|
|
48
|
-
export declare const layout03: string;
|
|
49
|
-
export declare const layout04: string;
|
|
50
|
-
export declare const layout05: string;
|
|
51
|
-
export declare const layout06: string;
|
|
52
|
-
export declare const layout07: string;
|
|
53
30
|
export declare const layout: string[];
|
|
54
|
-
export declare const container01: string;
|
|
55
|
-
export declare const container02: string;
|
|
56
|
-
export declare const container03: string;
|
|
57
|
-
export declare const container04: string;
|
|
58
|
-
export declare const container05: string;
|
|
59
31
|
export declare const container: string[];
|
|
60
32
|
export declare const sizeXSmall: string;
|
|
61
33
|
export declare const sizeSmall: string;
|
|
@@ -64,14 +36,5 @@ export declare const sizeLarge: string;
|
|
|
64
36
|
export declare const sizeXLarge: string;
|
|
65
37
|
export declare const size2XLarge: string;
|
|
66
38
|
export declare const sizes: Record<SizeName, string>;
|
|
67
|
-
export declare const iconSize01 = "1rem";
|
|
68
|
-
export declare const iconSize02 = "1.25rem";
|
|
69
39
|
export declare const iconSize: string[];
|
|
70
|
-
export declare const borderRadius00 = "0px";
|
|
71
|
-
export declare const borderRadius02: string;
|
|
72
|
-
export declare const borderRadius04: string;
|
|
73
|
-
export declare const borderRadius08: string;
|
|
74
|
-
export declare const borderRadius16: string;
|
|
75
|
-
export declare const borderRadius24: string;
|
|
76
|
-
export declare const borderRadiusMax = "999999px";
|
|
77
40
|
export declare const borderRadius: Record<BorderRadiusToken, string>;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region js/generated/layout-tokens.js
|
|
3
|
+
const spacing01 = "0.125rem";
|
|
4
|
+
const spacing02 = "0.25rem";
|
|
5
|
+
const spacing03 = "0.5rem";
|
|
6
|
+
const spacing04 = "0.75rem";
|
|
7
|
+
const spacing05 = "1rem";
|
|
8
|
+
const spacing06 = "1.5rem";
|
|
9
|
+
const spacing07 = "2rem";
|
|
10
|
+
const spacing08 = "2.5rem";
|
|
11
|
+
const spacing09 = "3rem";
|
|
12
|
+
const spacing10 = "4rem";
|
|
13
|
+
const spacing11 = "5rem";
|
|
14
|
+
const spacing12 = "6rem";
|
|
15
|
+
const spacing13 = "10rem";
|
|
16
|
+
const fluidSpacing01 = 0;
|
|
17
|
+
const fluidSpacing02 = "2vw";
|
|
18
|
+
const fluidSpacing03 = "5vw";
|
|
19
|
+
const fluidSpacing04 = "10vw";
|
|
20
|
+
const container01 = "1.5rem";
|
|
21
|
+
const container02 = "2rem";
|
|
22
|
+
const container03 = "2.5rem";
|
|
23
|
+
const container04 = "3rem";
|
|
24
|
+
const container05 = "4rem";
|
|
25
|
+
const sizeXs = "1.5rem";
|
|
26
|
+
const sizeSm = "2rem";
|
|
27
|
+
const sizeMd = "2.5rem";
|
|
28
|
+
const sizeLg = "3rem";
|
|
29
|
+
const sizeXl = "4rem";
|
|
30
|
+
const size2xl = "5rem";
|
|
31
|
+
const iconSize01 = "1rem";
|
|
32
|
+
const iconSize02 = "1.25rem";
|
|
33
|
+
const borderRadius00 = "0px";
|
|
34
|
+
const borderRadius02 = "0.125rem";
|
|
35
|
+
const borderRadius04 = "0.25rem";
|
|
36
|
+
const borderRadius08 = "0.5rem";
|
|
37
|
+
const borderRadius16 = "1rem";
|
|
38
|
+
const borderRadius24 = "1.5rem";
|
|
39
|
+
const borderRadiusMax = "999999px";
|
|
40
|
+
const layout01 = "1rem";
|
|
41
|
+
const layout02 = "1.5rem";
|
|
42
|
+
const layout03 = "2rem";
|
|
43
|
+
const layout04 = "3rem";
|
|
44
|
+
const layout05 = "4rem";
|
|
45
|
+
const layout06 = "6rem";
|
|
46
|
+
const layout07 = "10rem";
|
|
47
|
+
//#endregion
|
|
2
48
|
//#region src/tokens.ts
|
|
3
49
|
/**
|
|
4
50
|
* Copyright IBM Corp. 2018, 2026
|
|
@@ -47,12 +93,6 @@ const unstable_tokens = [
|
|
|
47
93
|
];
|
|
48
94
|
//#endregion
|
|
49
95
|
//#region src/index.ts
|
|
50
|
-
/**
|
|
51
|
-
* Copyright IBM Corp. 2018, 2026
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
54
|
-
* LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/
|
|
56
96
|
const baseFontSize = 16;
|
|
57
97
|
const rem = (px) => {
|
|
58
98
|
return `${px / 16}rem`;
|
|
@@ -65,29 +105,29 @@ const px = (value) => {
|
|
|
65
105
|
};
|
|
66
106
|
const breakpoints = {
|
|
67
107
|
sm: {
|
|
68
|
-
width:
|
|
108
|
+
width: rem(320),
|
|
69
109
|
columns: 4,
|
|
70
110
|
margin: "0"
|
|
71
111
|
},
|
|
72
112
|
md: {
|
|
73
|
-
width:
|
|
113
|
+
width: rem(672),
|
|
74
114
|
columns: 8,
|
|
75
|
-
margin:
|
|
115
|
+
margin: rem(16)
|
|
76
116
|
},
|
|
77
117
|
lg: {
|
|
78
|
-
width:
|
|
118
|
+
width: rem(1056),
|
|
79
119
|
columns: 16,
|
|
80
|
-
margin:
|
|
120
|
+
margin: rem(16)
|
|
81
121
|
},
|
|
82
122
|
xlg: {
|
|
83
|
-
width:
|
|
123
|
+
width: rem(1312),
|
|
84
124
|
columns: 16,
|
|
85
|
-
margin:
|
|
125
|
+
margin: rem(16)
|
|
86
126
|
},
|
|
87
127
|
max: {
|
|
88
|
-
width:
|
|
128
|
+
width: rem(1584),
|
|
89
129
|
columns: 16,
|
|
90
|
-
margin:
|
|
130
|
+
margin: rem(24)
|
|
91
131
|
}
|
|
92
132
|
};
|
|
93
133
|
const breakpointUp = (name) => {
|
|
@@ -101,19 +141,6 @@ const miniUnit = 8;
|
|
|
101
141
|
const miniUnits = (count) => {
|
|
102
142
|
return rem(8 * count);
|
|
103
143
|
};
|
|
104
|
-
const spacing01 = /*#__PURE__*/ miniUnits(.25);
|
|
105
|
-
const spacing02 = /*#__PURE__*/ miniUnits(.5);
|
|
106
|
-
const spacing03 = /*#__PURE__*/ miniUnits(1);
|
|
107
|
-
const spacing04 = /*#__PURE__*/ miniUnits(1.5);
|
|
108
|
-
const spacing05 = /*#__PURE__*/ miniUnits(2);
|
|
109
|
-
const spacing06 = /*#__PURE__*/ miniUnits(3);
|
|
110
|
-
const spacing07 = /*#__PURE__*/ miniUnits(4);
|
|
111
|
-
const spacing08 = /*#__PURE__*/ miniUnits(5);
|
|
112
|
-
const spacing09 = /*#__PURE__*/ miniUnits(6);
|
|
113
|
-
const spacing10 = /*#__PURE__*/ miniUnits(8);
|
|
114
|
-
const spacing11 = /*#__PURE__*/ miniUnits(10);
|
|
115
|
-
const spacing12 = /*#__PURE__*/ miniUnits(12);
|
|
116
|
-
const spacing13 = /*#__PURE__*/ miniUnits(20);
|
|
117
144
|
const spacing = [
|
|
118
145
|
spacing01,
|
|
119
146
|
spacing02,
|
|
@@ -129,23 +156,12 @@ const spacing = [
|
|
|
129
156
|
spacing12,
|
|
130
157
|
spacing13
|
|
131
158
|
];
|
|
132
|
-
const fluidSpacing01 = 0;
|
|
133
|
-
const fluidSpacing02 = "2vw";
|
|
134
|
-
const fluidSpacing03 = "5vw";
|
|
135
|
-
const fluidSpacing04 = "10vw";
|
|
136
159
|
const fluidSpacing = [
|
|
137
160
|
0,
|
|
138
161
|
"2vw",
|
|
139
162
|
"5vw",
|
|
140
163
|
fluidSpacing04
|
|
141
164
|
];
|
|
142
|
-
const layout01 = /*#__PURE__*/ miniUnits(2);
|
|
143
|
-
const layout02 = /*#__PURE__*/ miniUnits(3);
|
|
144
|
-
const layout03 = /*#__PURE__*/ miniUnits(4);
|
|
145
|
-
const layout04 = /*#__PURE__*/ miniUnits(6);
|
|
146
|
-
const layout05 = /*#__PURE__*/ miniUnits(8);
|
|
147
|
-
const layout06 = /*#__PURE__*/ miniUnits(12);
|
|
148
|
-
const layout07 = /*#__PURE__*/ miniUnits(20);
|
|
149
165
|
const layout = [
|
|
150
166
|
layout01,
|
|
151
167
|
layout02,
|
|
@@ -155,11 +171,6 @@ const layout = [
|
|
|
155
171
|
layout06,
|
|
156
172
|
layout07
|
|
157
173
|
];
|
|
158
|
-
const container01 = /*#__PURE__*/ miniUnits(3);
|
|
159
|
-
const container02 = /*#__PURE__*/ miniUnits(4);
|
|
160
|
-
const container03 = /*#__PURE__*/ miniUnits(5);
|
|
161
|
-
const container04 = /*#__PURE__*/ miniUnits(6);
|
|
162
|
-
const container05 = /*#__PURE__*/ miniUnits(8);
|
|
163
174
|
const container = [
|
|
164
175
|
container01,
|
|
165
176
|
container02,
|
|
@@ -167,12 +178,12 @@ const container = [
|
|
|
167
178
|
container04,
|
|
168
179
|
container05
|
|
169
180
|
];
|
|
170
|
-
const sizeXSmall =
|
|
171
|
-
const sizeSmall =
|
|
172
|
-
const sizeMedium =
|
|
173
|
-
const sizeLarge =
|
|
174
|
-
const sizeXLarge =
|
|
175
|
-
const size2XLarge =
|
|
181
|
+
const sizeXSmall = sizeXs;
|
|
182
|
+
const sizeSmall = sizeSm;
|
|
183
|
+
const sizeMedium = sizeMd;
|
|
184
|
+
const sizeLarge = sizeLg;
|
|
185
|
+
const sizeXLarge = sizeXl;
|
|
186
|
+
const size2XLarge = size2xl;
|
|
176
187
|
const sizes = {
|
|
177
188
|
XSmall: sizeXSmall,
|
|
178
189
|
Small: sizeSmall,
|
|
@@ -181,16 +192,7 @@ const sizes = {
|
|
|
181
192
|
XLarge: sizeXLarge,
|
|
182
193
|
"2XLarge": size2XLarge
|
|
183
194
|
};
|
|
184
|
-
const iconSize01 = "1rem";
|
|
185
|
-
const iconSize02 = "1.25rem";
|
|
186
195
|
const iconSize = [iconSize01, iconSize02];
|
|
187
|
-
const borderRadius00 = "0px";
|
|
188
|
-
const borderRadius02 = rem(2);
|
|
189
|
-
const borderRadius04 = rem(4);
|
|
190
|
-
const borderRadius08 = rem(8);
|
|
191
|
-
const borderRadius16 = rem(16);
|
|
192
|
-
const borderRadius24 = rem(24);
|
|
193
|
-
const borderRadiusMax = "999999px";
|
|
194
196
|
const borderRadius = {
|
|
195
197
|
"border-radius-00": "0px",
|
|
196
198
|
"border-radius-02": borderRadius02,
|
|
@@ -242,11 +244,17 @@ exports.miniUnits = miniUnits;
|
|
|
242
244
|
exports.px = px;
|
|
243
245
|
exports.rem = rem;
|
|
244
246
|
exports.size2XLarge = size2XLarge;
|
|
247
|
+
exports.size2xl = size2xl;
|
|
245
248
|
exports.sizeLarge = sizeLarge;
|
|
249
|
+
exports.sizeLg = sizeLg;
|
|
250
|
+
exports.sizeMd = sizeMd;
|
|
246
251
|
exports.sizeMedium = sizeMedium;
|
|
252
|
+
exports.sizeSm = sizeSm;
|
|
247
253
|
exports.sizeSmall = sizeSmall;
|
|
248
254
|
exports.sizeXLarge = sizeXLarge;
|
|
249
255
|
exports.sizeXSmall = sizeXSmall;
|
|
256
|
+
exports.sizeXl = sizeXl;
|
|
257
|
+
exports.sizeXs = sizeXs;
|
|
250
258
|
exports.sizes = sizes;
|
|
251
259
|
exports.spacing = spacing;
|
|
252
260
|
exports.spacing01 = spacing01;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/layout",
|
|
3
3
|
"description": "Layout helpers for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.60.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"index.scss",
|
|
@@ -32,22 +32,24 @@
|
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build:types": "tsc -p tsconfig.types.json",
|
|
35
|
-
"build": "
|
|
36
|
-
"
|
|
35
|
+
"build:dtcg": "node -e \"require('./style-dictionary/sd.config.js').run()\"",
|
|
36
|
+
"build": "yarn clean && yarn build:dtcg && carbon-cli bundle src/index.ts --name CarbonLayout && yarn build:types",
|
|
37
|
+
"clean": "rimraf es lib umd scss/generated js/generated",
|
|
37
38
|
"postinstall": "ibmtelemetry --config=telemetry.yml"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@carbon/cli": "^11.
|
|
41
|
+
"@carbon/cli": "^11.51.0-rc.0",
|
|
41
42
|
"@carbon/cli-reporter": "^10.9.0",
|
|
42
43
|
"@carbon/scss-generator": "^10.20.0",
|
|
43
44
|
"@carbon/test-utils": "^10.41.0",
|
|
44
45
|
"core-js": "^3.16.0",
|
|
45
46
|
"rimraf": "^6.0.1",
|
|
47
|
+
"style-dictionary": "^5.5.0",
|
|
46
48
|
"typescript": "^6.0.3",
|
|
47
49
|
"typescript-config-carbon": "^0.11.0"
|
|
48
50
|
},
|
|
49
51
|
"dependencies": {
|
|
50
52
|
"@ibm/telemetry-js": "^1.5.0"
|
|
51
53
|
},
|
|
52
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4386a9633013fd0d44298541b1603d428b04c15c"
|
|
53
55
|
}
|