Skip to content

Commit

Permalink
Merge branch 'main' into actionable-notification-close-layout-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Oct 4, 2021
2 parents faba2a2 + ec433dc commit d6c3ece
Show file tree
Hide file tree
Showing 36 changed files with 383 additions and 283 deletions.
2 changes: 1 addition & 1 deletion config/jest-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jest-config-carbon",
"private": true,
"description": "Jest configuration and preset for Carbon",
"version": "0.9.0-rc.0",
"version": "0.9.0",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
Expand Down
12 changes: 6 additions & 6 deletions packages/carbon-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/react",
"description": "React components for the Carbon Design System",
"version": "0.6.0-rc.0",
"version": "0.6.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -43,11 +43,11 @@
},
"dependencies": {
"@carbon/feature-flags": "^0.6.0",
"@carbon/icons-react": "^10.39.0",
"@carbon/styles": "^0.6.0-rc.0",
"@carbon/icons-react": "^10.40.0",
"@carbon/styles": "^0.6.0",
"@carbon/telemetry": "0.0.0-alpha.6",
"carbon-components": "^10.45.0-rc.0",
"carbon-components-react": "^7.45.0-rc.0",
"carbon-components": "^10.45.0",
"carbon-components-react": "^7.45.0",
"carbon-icons": "^7.0.7"
},
"devDependencies": {
Expand All @@ -58,7 +58,7 @@
"@babel/plugin-transform-react-constant-elements": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@carbon/themes": "^10.44.0-rc.0",
"@carbon/themes": "^10.44.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
Expand Down
24 changes: 24 additions & 0 deletions packages/carbon-react/src/components/Tag/Tag.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ export const Default = () => {
<Tag className="some-class" type="gray" size="sm" title="Clear Filter">
{'Tag content'}
</Tag>
<Tag
className="some-class"
type="cool-gray"
size="sm"
title="Clear Filter">
{'Tag content'}
</Tag>
<Tag
className="some-class"
type="warm-gray"
size="sm"
title="Clear Filter">
{'Tag content'}
</Tag>
<Tag
className="some-class"
type="high-contrast"
size="sm"
title="Clear Filter">
{'Tag content'}
</Tag>
<Tag className="some-class" type="outline" size="sm" title="Clear Filter">
{'Tag content'}
</Tag>
</>
);
};
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/cli",
"description": "Task automation for working with the Carbon Design System",
"version": "10.29.0",
"version": "10.30.0",
"license": "Apache-2.0",
"bin": {
"carbon-cli": "./bin/carbon-cli.js"
Expand Down
84 changes: 67 additions & 17 deletions packages/cli/src/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@ const execa = require('execa');
const fs = require('fs-extra');
const glob = require('fast-glob');
const path = require('path');
const packageJson = require('../../../package.json');

const WORKSPACE_ROOT = path.resolve(__dirname, '../../../');
const packagePaths = glob
.sync(packageJson.workspaces.map((pattern) => `${pattern}/package.json`))
.map((match) => {
const packageJsonPath = path.join(WORKSPACE_ROOT, match);
return {
packageJsonPath,
packageJson: fs.readJsonSync(packageJsonPath),
packagePath: path.dirname(packageJsonPath),
packageFolder: path.relative(
WORKSPACE_ROOT,
path.dirname(packageJsonPath)
),
};
});

const { root: ROOT_DIR } = path.parse(__dirname);
const WORKSPACE_ROOT = getProjectRoot(__dirname);
const packageJson = fs.readJsonSync(path.join(WORKSPACE_ROOT, 'package.json'));
const packagePaths = Array.isArray(packageJson.workspaces)
? glob
.sync(packageJson.workspaces.map((pattern) => `${pattern}/package.json`))
.map((match) => {
const packageJsonPath = path.join(WORKSPACE_ROOT, match);
return {
packageJsonPath,
packageJson: fs.readJsonSync(packageJsonPath),
packagePath: path.dirname(packageJsonPath),
packageFolder: path.relative(
WORKSPACE_ROOT,
path.dirname(packageJsonPath)
),
};
})
: [];

const env = {
root: {
Expand All @@ -54,6 +57,53 @@ async function getPackages() {
return JSON.parse(lernaListOutput).filter((pkg) => !pkg.private);
}

/**
* Returns the root directory of a project, either as a workspace root with a
* collection of packages or a single project with a `package.json`
* @param {string} directory
* @returns {string}
*/
function getProjectRoot(directory) {
const packageJsonPaths = ancestors(directory).filter((directory) => {
return fs.existsSync(path.join(directory, 'package.json'));
});

const rootDirectory =
packageJsonPaths.length > 0
? packageJsonPaths[packageJsonPaths.length - 1]
: null;

if (!rootDirectory) {
throw new Error(
`Unable to find a \`package.json\` file from directory: ${directory}`
);
}

return rootDirectory;
}

/**
* Returns an array of the the directory and its ancestors
* @param {string} directory
* @returns {Array<string>}
*/
function ancestors(directory) {
const result = [directory];
let current = directory;

while (current !== '') {
result.push(current);

if (current !== ROOT_DIR) {
current = path.dirname(current);
} else {
current = '';
}
}

return result;
}

module.exports = {
workspace,
getPackages,
Expand Down
4 changes: 2 additions & 2 deletions packages/colors/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/colors",
"description": "Colors for digital and software products using the Carbon Design System",
"version": "10.32.0",
"version": "10.33.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"clean": "rimraf css es lib umd scss index.scss"
},
"devDependencies": {
"@carbon/cli": "^10.29.0",
"@carbon/cli": "^10.30.0",
"@carbon/cli-reporter": "^10.5.0",
"@carbon/scss-generator": "^10.13.0",
"@carbon/test-utils": "^10.19.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "carbon-components",
"description": "The Carbon Design System is IBM’s open-source design system for products and experiences.",
"version": "10.45.0-rc.0",
"version": "10.45.0",
"license": "Apache-2.0",
"main": "umd/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -80,10 +80,10 @@
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@carbon/cli": "^10.29.0",
"@carbon/elements": "^10.44.0-rc.0",
"@carbon/icons-handlebars": "^10.39.0",
"@carbon/icons-react": "^10.39.0",
"@carbon/cli": "^10.30.0",
"@carbon/elements": "^10.44.0",
"@carbon/icons-handlebars": "^10.40.0",
"@carbon/icons-react": "^10.40.0",
"@carbon/test-utils": "^10.19.0",
"@frctl/fractal": "^1.1.0",
"@rollup/plugin-babel": "^5.3.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/components/src/components/accordion/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@

.#{$prefix}--accordion--start .#{$prefix}--accordion__arrow {
// Alters `$accordion-arrow-margin` token:
margin: 2px 0 0 $carbon--spacing-03;
margin: 2px 0 0 $carbon--spacing-05;
}

.#{$prefix}--accordion--start .#{$prefix}--accordion__title {
margin-right: $carbon--spacing-05;
}

.#{$prefix}--accordion--start .#{$prefix}--accordion__content {
margin-left: $carbon--spacing-06;
margin-left: $carbon--spacing-07;
}

.#{$prefix}--accordion__item--collapsing .#{$prefix}--accordion__content,
Expand Down
Loading

0 comments on commit d6c3ece

Please sign in to comment.