Skip to content

Commit

Permalink
Merge branch 'master' into 5002-open-filterable-multiselect-when-sear…
Browse files Browse the repository at this point in the history
…ching
  • Loading branch information
tw15egan authored Jan 28, 2020
2 parents 4d8299d + 5408899 commit 08b3b65
Show file tree
Hide file tree
Showing 10 changed files with 191 additions and 135 deletions.
Binary file added .yarn/offline-mirror/magic-string-0.25.4.tgz
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -20476,10 +20476,12 @@ Progress indicator styles
}

.#{$prefix}--progress-step--current svg {
width: 14px;
height: 14px;
stroke: $interactive-01;
fill: $interactive-01;
margin-top: rem(9.5px);

path:last-of-type {
stroke-width: 40%;
}
}

//INCOMPLETE STYLING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@
}

.#{$prefix}--progress-step--current svg {
width: 14px;
height: 14px;
stroke: $interactive-01;
fill: $interactive-01;
margin-top: rem(9.5px);

path:last-of-type {
stroke-width: 40%;
}
}

//INCOMPLETE STYLING
Expand Down
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"access": "public"
},
"scripts": {
"build": "yarn clean && node scripts/build.js",
"build": "yarn clean && node scripts/build.js && rollup -c",
"build-storybook": "cross-env NODE_ENV=production build-storybook",
"clean": "rimraf es lib umd storybook-static build react-docgen.json",
"prepublish": "yarn build",
Expand Down Expand Up @@ -107,6 +107,7 @@
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-sizes": "^0.5.0",
"rollup-plugin-strip-banner": "^1.0.0",
"rollup-plugin-terser": "^4.0.0",
"rtlcss": "^2.4.0",
"sass-loader": "^8.0.2",
Expand Down
146 changes: 146 additions & 0 deletions packages/react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const resolve = require('rollup-plugin-node-resolve');
const replace = require('rollup-plugin-replace');
const stripBanner = require('rollup-plugin-strip-banner');
const { terser } = require('rollup-plugin-terser');
const packageJson = require('./package.json');

const baseConfig = {
input: './src/index.js',
external: [
...Object.keys(packageJson.peerDependencies),
...Object.keys(packageJson.dependencies),
'prop-types',
],
plugins: [
resolve(),
commonjs({
include: /node_modules/,
namedExports: {
'react/index.js': [
'Children',
'Component',
'PureComponent',
'Fragment',
'PropTypes',
'createElement',
],
'react-dom/index.js': ['render'],
'react-is/index.js': ['isForwardRef'],
},
}),
babel({
babelrc: false,
exclude: ['node_modules/**'],
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
browsers: ['extends browserslist-config-carbon'],
},
},
],
'@babel/preset-react',
],
plugins: [
'dev-expression',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-export-default-from',
],
}),
stripBanner(),
],
};

const umdExternalDependencies = Object.keys(
packageJson.peerDependencies
).filter(dependency => dependency !== 'carbon-components');

const umdBundleConfig = {
input: baseConfig.input,
external: [...umdExternalDependencies, 'prop-types'],
output: {
name: 'CarbonComponentsReact',
format: 'umd',
globals: {
classnames: 'classNames',
'prop-types': 'PropTypes',
react: 'React',
'react-dom': 'ReactDOM',
'carbon-icons': 'CarbonIcons',
},
},
};

module.exports = [
// Generates the following bundles:
// ESM: es/index.js
// CommonJS: lib/index.js
{
...baseConfig,
plugins: [
...baseConfig.plugins,
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
output: [
{
format: 'esm',
file: 'es/index.js',
},
{
format: 'cjs',
file: 'lib/index.js',
},
],
},

// Generate the development UMD bundle:
// UMD: umd/carbon-components-react.js
{
...umdBundleConfig,
plugins: [
...baseConfig.plugins,
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
output: {
...umdBundleConfig.output,
file: 'umd/carbon-components-react.js',
},
},

// Generate the production UMD bundle:
// UMD: umd/carbon-components-react.min.js
{
...umdBundleConfig,
plugins: [
...baseConfig.plugins,
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
terser(),
],
output: {
...umdBundleConfig.output,
file: 'umd/carbon-components-react.min.js',
},
},
];
16 changes: 0 additions & 16 deletions packages/react/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ if (inInstall()) {
const babelPath = path
.resolve(__dirname, '../node_modules/.bin/babel')
.replace(/ /g, '\\ ');
const rollupPath = path
.resolve(__dirname, '../node_modules/.bin/rollup')
.replace(/ /g, '\\ ');

const exec = (command, extraEnv) =>
execSync(command, {
Expand Down Expand Up @@ -43,19 +40,6 @@ try {
'react-docgen.json',
JSON.stringify(mapValues(require(`../build/docgen`), '__docgenInfo'))
);

exec(
`${rollupPath} -c scripts/rollup.config.js -o umd/carbon-components-react.js`,
{
NODE_ENV: 'development',
}
);
exec(
`${rollupPath} -c scripts/rollup.config.js -o umd/carbon-components-react.min.js`,
{
NODE_ENV: 'production',
}
);
} catch (error) {
console.error('One of the commands failed:', error.stack); // eslint-disable-line no-console
process.exit(1);
Expand Down
105 changes: 0 additions & 105 deletions packages/react/scripts/rollup.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import classnames from 'classnames';
import { settings } from 'carbon-components';
import { CheckmarkOutline16, Warning16 } from '@carbon/icons-react';
import {
CheckmarkOutline16,
Warning16,
RadioButtonChecked16,
RadioButton16,
} from '@carbon/icons-react';
import { keys, matches } from '../../internal/keyboard';

const { prefix } = settings;
Expand Down Expand Up @@ -61,10 +66,9 @@ export function ProgressStep({
}
if (current) {
return (
<svg>
<path d="M 7, 7 m -7, 0 a 7,7 0 1,0 14,0 a 7,7 0 1,0 -14,0" />
<RadioButtonChecked16>
<title>{description}</title>
</svg>
</RadioButtonChecked16>
);
}
if (complete) {
Expand All @@ -75,10 +79,9 @@ export function ProgressStep({
);
}
return (
<svg>
<RadioButton16>
<title>{description}</title>
<path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm0 13c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6z" />
</svg>
</RadioButton16>
);
};

Expand Down
Loading

0 comments on commit 08b3b65

Please sign in to comment.