Skip to content

Commit

Permalink
Merge branch 'main' into 8091-listbox-translatewithid
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 17, 2021
2 parents d232cc2 + 322ca4d commit ea91eda
Show file tree
Hide file tree
Showing 31 changed files with 321 additions and 119 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function fetchLatestFromUpstream() {
'[email protected]:carbon-design-system/carbon.git',
]);
}
await execa('git', ['fetch', 'upstream', 'master', '--tags']);
await execa('git', ['fetch', 'upstream', 'main', '--tags']);
}

module.exports = {
Expand Down
8 changes: 4 additions & 4 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.30.0",
"version": "10.31.0-rc.0",
"license": "Apache-2.0",
"main": "umd/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -85,9 +85,9 @@
"@babel/preset-react": "^7.10.0",
"@babel/runtime": "^7.10.0",
"@carbon/cli": "^10.20.0",
"@carbon/elements": "^10.29.0",
"@carbon/icons-handlebars": "^10.27.0",
"@carbon/icons-react": "^10.27.0",
"@carbon/elements": "^10.30.0-rc.0",
"@carbon/icons-handlebars": "^10.28.0-rc.0",
"@carbon/icons-react": "^10.28.0-rc.0",
"@carbon/test-utils": "^10.15.0",
"@frctl/fractal": "^1.1.0",
"@rollup/plugin-babel": "^5.2.2",
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/components/form/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
.#{$prefix}--text-input__field-wrapper--warning > .#{$prefix}--text-input,
.#{$prefix}--text-area__wrapper[data-invalid],
.#{$prefix}--select-input__wrapper[data-invalid],
.#{$prefix}--select--warning .#{$prefix}--select-input__wrapper,
.#{$prefix}--time-picker[data-invalid],
.#{$prefix}--list-box[data-invalid],
.#{$prefix}--list-box--warning {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
margin-right: $carbon--spacing-03;
}

.#{$prefix}--inline-loading__checkmark-container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
<div data-inline-loading class="{{@root.prefix}}--inline-loading" role="alert" aria-live="assertive">
<div class="{{@root.prefix}}--inline-loading__animation">
<div data-inline-loading-spinner class="{{@root.prefix}}--loading {{@root.prefix}}--loading--small">
<svg class="{{@root.prefix}}--loading__svg" viewBox="-75 -75 150 150">
<circle class="{{@root.prefix}}--loading__background" cx="0" cy="0" r="26.8125" />
<circle class="{{@root.prefix}}--loading__stroke" cx="0" cy="0" r="26.8125"/>
<svg class="{{@root.prefix}}--loading__svg" viewBox="0 0 100 100">
<circle class="{{@root.prefix}}--loading__background" cx="50%" cy="50%" r="42" />
<circle class="{{@root.prefix}}--loading__stroke" cx="50%" cy="50%" r="42" />
</svg>
</div>
{{ carbon-icon "CheckmarkFilled16" data-inline-loading-finished='' hidden='' class=(add @root.prefix '--inline-loading__checkmark-container') }}
{{ carbon-icon "Error20" data-inline-loading-error='' hidden='' class=(add @root.prefix '--inline-loading--error') }}
{{ carbon-icon "CheckmarkFilled16" data-inline-loading-finished='' hidden='' class=(add @root.prefix
'--inline-loading__checkmark-container') }}
{{ carbon-icon "Error20" data-inline-loading-error='' hidden='' class=(add @root.prefix '--inline-loading--error')
}}
</div>
<p data-inline-loading-text-active class="{{@root.prefix}}--inline-loading__text">Loading data...</p>
<p data-inline-loading-text-finished hidden class="{{@root.prefix}}--inline-loading__text">Data loaded.</p>
Expand All @@ -24,4 +26,4 @@
{{#if showToggleButton}}
<button data-inline-loading-demo-button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary">Toggle
state</button>
{{/if}}
{{/if}}
3 changes: 1 addition & 2 deletions packages/components/src/components/list-box/_list-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ $list-box-menu-width: rem(300px);
fill: $support-03;
}

.#{$prefix}--list-box__invalid-icon--warning
path[data-icon-path='inner-path'] {
.#{$prefix}--list-box__invalid-icon--warning path[fill] {
opacity: 1;
fill: $carbon__black-100;
}
Expand Down
27 changes: 14 additions & 13 deletions packages/components/src/components/loading/loading.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<!--
<!--
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.
-->

{{#if overlay}}<div class="{{@root.prefix}}--loading-overlay">{{/if}}
<div data-loading class="{{@root.prefix}}--loading{{#if small}} {{@root.prefix}}--loading--small{{/if}}">
<svg class="{{@root.prefix}}--loading__svg" viewBox="-75 -75 150 150">
<title>Loading</title>
{{#if small}}
<circle class="{{@root.prefix}}--loading__background" cx="0" cy="0" r="26.8125" />
<circle class="{{@root.prefix}}--loading__stroke" cx="0" cy="0" r="26.8125" />
{{else}}
<circle class="{{@root.prefix}}--loading__stroke" cx="0" cy="0" r="37.5" />
{{/if}}
</svg>
</div>
{{#if overlay}}</div>{{/if}}
<div data-loading class="{{@root.prefix}}--loading{{#if small}} {{@root.prefix}}--loading--small{{/if}}">
<svg class="{{@root.prefix}}--loading__svg" viewBox="0 0 100 100">
<title>Loading</title>
{{#if small}}
<circle class="{{@root.prefix}}--loading__background" cx="50%" cy="50%" r="42" />
<circle class="{{@root.prefix}}--loading__stroke" cx="50%" cy="50%" r="42" />
{{else}}
<circle class="{{@root.prefix}}--loading__stroke" cx="50%" cy="50%" r="44" />
{{/if}}
</svg>
</div>
{{#if overlay}}
</div>{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,6 @@
background-color: $hover-ui;
}

.#{$prefix}--overflow-menu-options__option--danger {
border-top: 1px solid $ui-03;
}

.#{$prefix}--overflow-menu--light
.#{$prefix}--overflow-menu-options__option--danger {
border-top: 1px solid $decorative-01;
}

.#{$prefix}--overflow-menu-options__option--danger
.#{$prefix}--overflow-menu-options__btn:hover,
.#{$prefix}--overflow-menu-options__option--danger
Expand Down
21 changes: 17 additions & 4 deletions packages/components/src/components/select/_select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@
color: $disabled-02;
}

.#{$prefix}--select-input__wrapper[data-invalid] .#{$prefix}--select-input {
padding-right: carbon--mini-units(10);
.#{$prefix}--select-input__wrapper[data-invalid] .#{$prefix}--select-input,
.#{$prefix}--select--warning .#{$prefix}--select-input {
padding-right: carbon--mini-units(9);
}

.#{$prefix}--select-input:disabled ~ .#{$prefix}--select__arrow {
Expand Down Expand Up @@ -149,14 +150,26 @@
}
}

.#{$prefix}--select__invalid-icon {
position: absolute;
right: $spacing-08;
}

.#{$prefix}--select-input__wrapper[data-invalid]
.#{$prefix}--select-input
~ .#{$prefix}--select__invalid-icon {
position: absolute;
right: $spacing-09;
fill: $support-01;
}

.#{$prefix}--select__invalid-icon--warning {
fill: $support-03;
}

.#{$prefix}--select__invalid-icon--warning path[fill] {
opacity: 1;
fill: $carbon__black-100;
}

.#{$prefix}--select-optgroup,
.#{$prefix}--select-option {
// For the options to show in IE11
Expand Down
4 changes: 2 additions & 2 deletions packages/elements/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/elements",
"description": "A collection of design elements in code for the IBM Design Language",
"version": "10.29.0",
"version": "10.30.0-rc.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@carbon/colors": "^10.21.0",
"@carbon/grid": "^10.22.0",
"@carbon/icons": "^10.27.0",
"@carbon/icons": "^10.28.0-rc.0",
"@carbon/import-once": "^10.6.0",
"@carbon/layout": "^10.20.0",
"@carbon/motion": "^10.14.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/feature-flags/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/feature-flags",
"description": "Build with feature flags in Carbon",
"version": "0.1.0",
"version": "0.2.0-rc.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand All @@ -28,6 +28,7 @@
},
"devDependencies": {
"@babel/generator": "^7.10.2",
"@babel/template": "^7.12.13",
"@babel/types": "^7.10.2",
"@carbon/scss-generator": "^10.13.0",
"change-case": "^4.1.2",
Expand Down
54 changes: 43 additions & 11 deletions packages/feature-flags/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
'use strict';

const { default: babelGenerate } = require('@babel/generator');
const { default: template } = require('@babel/template');
const babelTypes = require('@babel/types');
const { types: t, generate } = require('@carbon/scss-generator');
const { constantCase } = require('change-case');
const { camelCase, constantCase } = require('change-case');
const fs = require('fs-extra');
const yaml = require('js-yaml');
const path = require('path');
Expand Down Expand Up @@ -78,8 +79,46 @@ const javascriptBanner = `/**
`;
function buildJavaScriptModule(featureFlags) {
const t = babelTypes;
const tmpl = template(`
if (process.env.%%env%%) {
if (process.env.%%env%% === 'true') {
enabled.%%key%% = true;
} else {
enabled.%%key%% = false;
}
} else {
enabled.%%key%% = %%defaultEnabled%%;
}
`);
const fallback = template(`enabled.%%key%% = %%enabled%%;`);

const file = t.file(
t.program([
t.variableDeclaration('const', [
t.variableDeclarator(t.identifier('enabled'), t.objectExpression([])),
]),
t.tryStatement(
t.blockStatement(
featureFlags.flatMap((featureFlag) => {
return tmpl({
env: t.identifier(constantCase(`CARBON_${featureFlag.name}`)),
key: t.identifier(camelCase(featureFlag.name)),
defaultEnabled: t.booleanLiteral(featureFlag.enabled),
});
})
),
t.catchClause(
t.identifier('error'),
t.blockStatement(
featureFlags.flatMap((featureFlag) => {
return fallback({
key: t.identifier(camelCase(featureFlag.name)),
enabled: t.booleanLiteral(featureFlag.enabled),
});
})
)
)
),
t.exportNamedDeclaration(
t.variableDeclaration('const', [
t.variableDeclarator(
Expand All @@ -97,16 +136,9 @@ function buildJavaScriptModule(featureFlags) {
),
t.objectProperty(
t.identifier('enabled'),
t.logicalExpression(
'||',
t.memberExpression(
t.memberExpression(
t.identifier('process'),
t.identifier('env')
),
t.identifier(constantCase(`CARBON_${featureFlag.name}`))
),
t.booleanLiteral(featureFlag.enabled)
t.memberExpression(
t.identifier('enabled'),
t.identifier(camelCase(featureFlag.name))
)
),
]);
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-handlebars/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons-handlebars",
"description": "Handlebars helpers for IBM Design Language icons in digital and software products using the Carbon Design System",
"version": "10.27.0",
"version": "10.28.0-rc.0",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@carbon/icon-helpers": "^10.14.0",
"@carbon/icons": "^10.27.0"
"@carbon/icons": "^10.28.0-rc.0"
},
"devDependencies": {
"handlebars": "^4.0.12"
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons-react",
"description": "React components for icons in digital and software products using the Carbon Design System",
"version": "10.27.0",
"version": "10.28.0-rc.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@carbon/icon-build-helpers": "^0.17.0",
"@carbon/icons": "^10.27.0"
"@carbon/icons": "^10.28.0-rc.0"
},
"sideEffects": false
}
4 changes: 2 additions & 2 deletions packages/icons-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons-vue",
"description": "Vue components for icons in digital and software products using the Carbon Design System",
"version": "10.27.0",
"version": "10.28.0-rc.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@carbon/cli-reporter": "^10.4.0",
"@carbon/icons": "^10.27.0",
"@carbon/icons": "^10.28.0-rc.0",
"fs-extra": "^8.1.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons",
"description": "Icons for digital and software products using the Carbon Design System",
"version": "10.27.0",
"version": "10.28.0-rc.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
15 changes: 15 additions & 0 deletions packages/react/.storybook/Welcome/Welcome.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Welcome

- [Carbon Website](https://www.carbondesignsystem.com/)
- [IBM Design Language](https://www.ibm.com/design/language/)

## Other Frameworks

- [Carbon Angular](https://angular.carbondesignsystem.com)
- [Carbon Vue](http://vue.carbondesignsystem.com)

## Feedback

Help us improve the documentation by providing feedback, asking questions on
Slack, or updating the mdx files file on
[GitHub](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components).
6 changes: 6 additions & 0 deletions packages/react/.storybook/Welcome/Welcome.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@

import React from 'react';
import { Welcome as Intro } from './Welcome';
import mdx from './Welcome.mdx';

export default {
title: ' Getting Started/ Welcome',
component: Intro,
parameters: {
docs: {
page: mdx,
},
},
};

export const Welcome = () => <Intro />;
Loading

0 comments on commit ea91eda

Please sign in to comment.