Skip to content

Commit 0ff1d4d

Browse files
authored
Merge branch 'main' into HCM-updates
2 parents ffa8f0c + 19cd709 commit 0ff1d4d

File tree

79 files changed

+1122
-527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1122
-527
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

codemods/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
],
2020
"dependencies": {
2121
"@babel/preset-env": "^7.12.13",
22-
"jscodeshift": "^0.11.0"
22+
"jscodeshift": "^0.12.0"
2323
}
2424
}

packages/carbon-react/icons/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2018
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+
8+
export * from '@carbon/icons-react';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"main": "lib/index.js",
3+
"module": "es/index.js"
4+
}

packages/carbon-react/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
"license": "Apache-2.0",
77
"main": "lib/index.js",
88
"module": "es/index.js",
9-
"type": "module",
10-
"exports": {
11-
"import": "./es/index.js",
12-
"require": "./lib/index.js"
13-
},
149
"repository": {
1510
"type": "git",
1611
"url": "https://github.com/carbon-design-system/carbon.git",
@@ -21,7 +16,10 @@
2116
"es",
2217
"lib",
2318
"scss",
24-
"index.scss"
19+
"index.scss",
20+
"icons/es",
21+
"icons/lib",
22+
"icons/package.json"
2523
],
2624
"keywords": [
2725
"ibm",
@@ -31,17 +29,19 @@
3129
"react"
3230
],
3331
"scripts": {
34-
"build": "yarn clean && rollup -c",
32+
"build": "yarn clean && node tasks/build.js",
3533
"clean": "rimraf es lib",
36-
"watch": "yarn clean && rollup -c -w"
34+
"postinstall": "carbon-telemetry collect --install"
3735
},
3836
"peerDependencies": {
3937
"react": "^16.8.6 || ^17.0.1",
4038
"react-dom": "^16.8.6 || ^17.0.1"
4139
},
4240
"dependencies": {
4341
"@carbon/feature-flags": "^0.3.0",
42+
"@carbon/icons-react": "^10.30.0",
4443
"@carbon/styles": "^0.4.0",
44+
"@carbon/telemetry": "0.0.0-alpha.6",
4545
"carbon-components-react": "^7.33.0"
4646
},
4747
"devDependencies": {
@@ -56,6 +56,7 @@
5656
"@rollup/plugin-commonjs": "^18.0.0",
5757
"@rollup/plugin-node-resolve": "^11.2.1",
5858
"babel-plugin-dev-expression": "^0.2.2",
59+
"browserslist-config-carbon": "^10.6.1",
5960
"prop-types": "^15.7.2",
6061
"react": "^16.8.6",
6162
"react-dom": "^16.8.6",

packages/carbon-react/rollup.config.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

packages/carbon-react/tasks/build.js

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2018
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+
8+
'use strict';
9+
10+
const { babel } = require('@rollup/plugin-babel');
11+
const commonjs = require('@rollup/plugin-commonjs');
12+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
13+
const path = require('path');
14+
const { rollup } = require('rollup');
15+
const stripBanner = require('rollup-plugin-strip-banner');
16+
const packageJson = require('../package.json');
17+
18+
async function build() {
19+
const entrypoints = [
20+
{
21+
filepath: path.resolve(__dirname, '..', 'src', 'index.js'),
22+
outputDirectory: path.resolve(__dirname, '..'),
23+
},
24+
{
25+
filepath: path.resolve(__dirname, '..', 'icons', 'index.js'),
26+
outputDirectory: path.resolve(__dirname, '..', 'icons'),
27+
},
28+
];
29+
const formats = [
30+
{
31+
type: 'esm',
32+
directory: 'es',
33+
},
34+
{
35+
type: 'commonjs',
36+
directory: 'lib',
37+
},
38+
];
39+
40+
for (const entrypoint of entrypoints) {
41+
const inputConfig = getRollupConfig(entrypoint.filepath);
42+
const bundle = await rollup(inputConfig);
43+
44+
for (const format of formats) {
45+
await bundle.write({
46+
dir: path.join(entrypoint.outputDirectory, format.directory),
47+
format: format.type,
48+
preserveModules: true,
49+
preserveModulesRoot: path.dirname(entrypoint.filepath),
50+
banner,
51+
exports: 'auto',
52+
});
53+
}
54+
}
55+
}
56+
57+
const banner = `/**
58+
* Copyright IBM Corp. 2016, 2021
59+
*
60+
* This source code is licensed under the Apache-2.0 license found in the
61+
* LICENSE file in the root directory of this source tree.
62+
*/
63+
`;
64+
65+
function getRollupConfig(input) {
66+
return {
67+
input,
68+
external: [
69+
...Object.keys(packageJson.peerDependencies),
70+
...Object.keys(packageJson.dependencies),
71+
...Object.keys(packageJson.devDependencies),
72+
],
73+
plugins: [
74+
nodeResolve(),
75+
commonjs({
76+
include: /node_modules/,
77+
}),
78+
babel({
79+
babelrc: false,
80+
exclude: ['node_modules/**'],
81+
presets: [
82+
[
83+
'@babel/preset-env',
84+
{
85+
modules: false,
86+
targets: {
87+
browsers: ['extends browserslist-config-carbon'],
88+
},
89+
},
90+
],
91+
'@babel/preset-react',
92+
],
93+
plugins: [
94+
'dev-expression',
95+
'@babel/plugin-proposal-class-properties',
96+
'@babel/plugin-proposal-export-namespace-from',
97+
'@babel/plugin-proposal-export-default-from',
98+
'@babel/plugin-transform-react-constant-elements',
99+
],
100+
babelHelpers: 'bundled',
101+
}),
102+
stripBanner(),
103+
{
104+
transform(_code, id) {
105+
// Make sure to mark feature-flags.js as having side-effects to make
106+
// sure it gets included in the final bundle
107+
if (id === path.join(__dirname, 'src', 'feature-flags.js')) {
108+
return {
109+
moduleSideEffects: true,
110+
};
111+
}
112+
},
113+
},
114+
],
115+
};
116+
}
117+
118+
build().catch((error) => {
119+
console.log(error);
120+
process.exit(1);
121+
});

packages/components/src/components/accordion/_accordion.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
width: 1rem;
116116
height: 1rem;
117117
margin: $accordion-arrow-margin;
118-
transform: rotate(90deg) #{'/*rtl:ignore*/'};
118+
transform: rotate(-270deg) #{'/*rtl:ignore*/'};
119119
transition: all $duration--fast-02 motion(standard, productive);
120120
fill: $ui-05;
121121
}

packages/components/src/components/button/_button.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@
138138
padding: $button-padding-ghost-sm;
139139
}
140140

141-
&.#{$prefix}--btn--field {
141+
// V11: remove field
142+
&.#{$prefix}--btn--field,
143+
&.#{$prefix}--btn--md {
142144
padding: $button-padding-ghost-field;
143145
}
144146
}
@@ -299,7 +301,9 @@
299301
cursor: not-allowed;
300302
}
301303

302-
.#{$prefix}--btn--field.#{$prefix}--btn--icon-only {
304+
// V11: remove field
305+
.#{$prefix}--btn--field.#{$prefix}--btn--icon-only,
306+
.#{$prefix}--btn--md.#{$prefix}--btn--icon-only {
303307
padding-right: rem(11px);
304308
padding-left: rem(11px);
305309
}
@@ -402,7 +406,9 @@
402406
padding: $button-padding-ghost-sm;
403407
}
404408

405-
&.#{$prefix}--btn--field {
409+
// V11: Remove field
410+
&.#{$prefix}--btn--field,
411+
&.#{$prefix}--btn--md {
406412
padding: $button-padding-ghost-field;
407413
}
408414
}
@@ -413,19 +419,23 @@
413419
padding: $button-padding-sm;
414420
}
415421

422+
// V11: change xl to 2xl
416423
.#{$prefix}--btn--xl:not(.#{$prefix}--btn--icon-only) {
417424
@include button-padding-large;
418425

419426
min-height: rem(80px);
420427
}
421428

429+
// V11: change lg to xl
422430
.#{$prefix}--btn--lg:not(.#{$prefix}--btn--icon-only) {
423431
@include button-padding-large;
424432

425433
min-height: rem(64px);
426434
}
427435

428-
.#{$prefix}--btn--field {
436+
// V11: Remove field
437+
.#{$prefix}--btn--field,
438+
.#{$prefix}--btn--md {
429439
min-height: rem(40px);
430440
padding: $button-padding-field;
431441
}

0 commit comments

Comments
 (0)