Skip to content

Mdi icons instead of fontastic icons #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,032 changes: 13,032 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,28 @@
"url": "https://github.com/plotly/react-plotly.js-editor/issues"
},
"scripts": {
"make:combined-translation-keys": "babel-node utils/findTranslationKeys.js && babel-node utils/combineTranslationKeys.js",
"make:combined-translation-keys":
"babel-node utils/findTranslationKeys.js && babel-node utils/combineTranslationKeys.js",
"make:translation-keys": "babel-node utils/findTranslationKeys.js",
"make:lib": "mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps && npm run make:lib:css",
"make:lib:css": "mkdirp lib && node-sass src/styles/main.scss > lib/react-plotly.js-editor.css",
"make:dist": "mkdirp dist && browserify src/PlotlyEditor.js -o ./dist/PlotlyEditor.js -t [ babelify --presets [ es2015 react ] ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/PlotlyEditor.js --compress --mangle --output ./dist/PlotlyEditor.min.js --source-map filename=dist/PlotlyEditor.min.js.map && make:dist:css",
"make:dist:css": "mkdirp dist && node-sass --output-style compressed src/styles/main.scss > dist/react-plotly.js-editor.css",
"prepublishOnly": "npm run make:lib && npm run make:combined-translation-keys",
"make:lib":
"mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps && npm run make:lib:css",
"make:lib:css":
"mkdirp lib && node-sass src/styles/main.scss > lib/react-plotly.js-editor.css",
"make:dist":
"mkdirp dist && browserify src/PlotlyEditor.js -o ./dist/PlotlyEditor.js -t [ babelify --presets [ es2015 react ] ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/PlotlyEditor.js --compress --mangle --output ./dist/PlotlyEditor.min.js --source-map filename=dist/PlotlyEditor.min.js.map && make:dist:css",
"make:dist:css":
"mkdirp dist && node-sass --output-style compressed src/styles/main.scss > dist/react-plotly.js-editor.css",
"prepublishOnly":
"npm run make:lib && npm run make:combined-translation-keys",
"lint": "prettier --write \"src/**/*.js\"",
"test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'",
"test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'",
"test:lint":
"eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'",
"test:pretty":
"prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'",
"test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill",
"test": "npm run test:lint && npm run test:pretty && npm run test:js",
"watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-plotly.js-editor.css",
"watch":
"babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-plotly.js-editor.css",
"watch-test": "jest --watch"
},
"keywords": [
Expand Down Expand Up @@ -77,6 +86,7 @@
"draft-js-import-html": "^1.2.1",
"draft-js-utils": "^1.2.0",
"fast-isnumeric": "^1.1.1",
"plotly-icons": "^1.0.1",
"plotly.js": "^1.31.2",
"prop-types": "^15.5.10",
"raf": "^3.4.0",
Expand All @@ -90,9 +100,7 @@
"react": "React"
},
"jest": {
"roots": [
"<rootDir>/src/"
],
"roots": ["<rootDir>/src/"],
"moduleNameMapper": {
"^.+\\.css$": "<rootDir>/config/CSSStub.js"
}
Expand Down
17 changes: 12 additions & 5 deletions src/components/containers/Fold.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import classnames from 'classnames';
import {CloseIcon, AngleDownIcon} from 'plotly-icons';

export default class Fold extends Component {
constructor() {
Expand All @@ -27,18 +28,24 @@ export default class Fold extends Component {
'fold__top--active': !folded,
});

const arrowClass = classnames('icon-angle-down', 'fold__top__arrow', {
const arrowClass = classnames('fold__top__arrow', {
'fold__top__arrow--active': !folded,
});

const arrowIcon = <i className={arrowClass} />;
const arrowIcon = (
<div className={arrowClass}>
<AngleDownIcon />
</div>
);

const deleteButton = handleClick =>
doDelete && (
<i
className="icon-cancel fold__top__delete js-fold__delete"
<div
className="fold__top__delete js-fold__delete"
onClick={handleClick}
/>
>
<CloseIcon />
</div>
);

const foldHeader = !hideHeader && (
Expand Down
22 changes: 9 additions & 13 deletions src/components/containers/MenuPanel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {Component} from 'react';
import ModalBox from './ModalBox';
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import classnames from 'classnames';
import ModalBox from './ModalBox';
import {QuestionIcon, CogIcon} from 'plotly-icons';

export default class MenuPanel extends Component {
constructor() {
Expand All @@ -11,20 +12,15 @@ export default class MenuPanel extends Component {
this.togglePanel = this.togglePanel.bind(this);
}

menupanelClasses() {
if (this.props.iconClass) {
return {
iconClass: `menupanel__icon ${this.props.iconClass}`,
spanClass: 'menupanel__icon-span',
};
} else if (this.props.question) {
getIcon() {
if (this.props.question) {
return {
iconClass: 'menupanel__icon icon-question-circle',
icon: <QuestionIcon className="menupanel__icon" />,
spanClass: `menupanel__icon-span menupanel__icon-span--question`,
};
}
return {
iconClass: 'menupanel__icon icon-cog',
icon: <CogIcon className="menupanel__icon" />,
spanClass: 'menupanel__icon-span menupanel__icon-span--cog',
};
}
Expand All @@ -39,13 +35,13 @@ export default class MenuPanel extends Component {
'menupanel--ownline': this.props.ownline,
});

const {iconClass, spanClass} = this.menupanelClasses();
const {icon, spanClass} = this.getIcon();

return (
<div className={containerClass}>
<span className={spanClass}>
<span>{this.props.label}</span>
<i className={iconClass} onClick={this.togglePanel} />
<span onClick={this.togglePanel}>{icon}</span>
</span>
{isOpen ? (
<ModalBox onClose={this.togglePanel}>{this.props.children}</ModalBox>
Expand Down
5 changes: 3 additions & 2 deletions src/components/widgets/NumericInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import EditableText from './EditableText';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import isNumeric from 'fast-isnumeric';
import {CarretDownIcon, CarretUpIcon} from 'plotly-icons';

export const UP_ARROW = 38;
export const DOWN_ARROW = 40;
Expand Down Expand Up @@ -102,13 +103,13 @@ export default class NumericInput extends Component {
className="numeric-input__caret js-numeric-increase"
onClick={this.incrementValue.bind(this, 'increase')}
>
<i className="icon-caret-up numeric-top-caret-modifier" />
<CarretUpIcon className="numeric-top-caret-modifier" />
</div>
<div
className="numeric-input__caret js-numeric-decrease"
onClick={this.incrementValue.bind(this, 'decrease')}
>
<i className="icon-caret-down numeric-bottom-caret-modifier" />
<CarretDownIcon className="numeric-bottom-caret-modifier" />
</div>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions src/components/widgets/SymbolSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {Component} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import ModalBox from '../containers/ModalBox';
import {CarretDownIcon} from 'plotly-icons';

export default class SymbolSelector extends Component {
constructor(props) {
Expand Down Expand Up @@ -109,8 +110,8 @@ export default class SymbolSelector extends Component {
<span className="symbol-selector__toggle_option">
{this.renderActiveOption()}
</span>
<span className="symbol-selector__toggle__caret">
<i className="icon-caret-down" />
<span>
<CarretDownIcon className="symbol-selector__toggle__caret" />
</span>
</div>
{isOpen ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {INLINE_STYLE} from 'draft-js-utils';
import {LinkIcon} from 'plotly-icons';

export const SUPERSCRIPT = 'SUPERSCRIPT';
export const SUBSCRIPT = 'SUBSCRIPT';
Expand Down Expand Up @@ -79,7 +80,7 @@ export const INLINE_STYLES = [
{
label: (
<span>
<i className="icon-link" />
<LinkIcon className="icon-link" />
</span>
),
value: LINK,
Expand Down
4 changes: 0 additions & 4 deletions src/lib/bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@ export default function bem(block, element, modifiers) {

return out.join(' ');
}

export function icon(iconName) {
return `icon-${iconName}`;
}
3 changes: 1 addition & 2 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bem, {icon} from './bem';
import bem from './bem';
import connectAnnotationToLayout from './connectAnnotationToLayout';
import connectAxesToLayout from './connectAxesToLayout';
import connectLayoutToPlot, {getLayoutContext} from './connectLayoutToPlot';
Expand Down Expand Up @@ -42,7 +42,6 @@ export {
findFullTraceIndex,
getDisplayName,
getLayoutContext,
icon,
isPlainObject,
localize,
localizeString,
Expand Down
25 changes: 0 additions & 25 deletions src/styles/_shame.scss

This file was deleted.

4 changes: 4 additions & 0 deletions src/styles/components/containers/_menupanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
padding-left: 6px;
padding-right: 6px;
vertical-align: middle;
// gets overridden by user agent stylesheet otherwise
width: 15px !important;
height: 15px !important;
fill: $color-link-light !important;
}
10 changes: 7 additions & 3 deletions src/styles/components/fields/_symbolselector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
border-radius: 4px;
width: 80px;
cursor: pointer;
padding: $quarter-spacing-unit 10px;
padding: 6px 6px 3px 6px;
@include clearfix();
}

Expand All @@ -17,13 +17,17 @@

.symbol-selector__toggle__caret {
float: right;
color: $color-secondary-text;
fill: $color-secondary-text;
padding-top: 3px;
// prevent user agent override
width: 13px !important;
height: 13px !important;
}

.symbol-selector__menu {
max-width: 225px;
position: absolute;
@include z-index("orbit");
@include z-index('orbit');
border: 1px solid $color-border;
padding: $font-size;
box-shadow: 2px 2px $font-size $color-border-secondary;
Expand Down
9 changes: 6 additions & 3 deletions src/styles/components/widgets/_multi-format-text-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$multi-format-editor-background: #fafbfd;

.multi-format-editor {

* {
box-sizing: border-box;
}
Expand Down Expand Up @@ -53,6 +52,10 @@ $multi-format-editor-background: #fafbfd;
.icon-link {
transform: translateY(3px);
display: inline-block;
fill: $color-text;
// prevent user agent override
width: 15px !important;
height: 15px !important;
}
}
}
Expand Down Expand Up @@ -95,7 +98,7 @@ $multi-format-editor-background: #fafbfd;
border-top: 1px solid $color-border;
width: 100%;
display: block;
color:$color-text;
color: $color-text;
}

&.selected {
Expand Down Expand Up @@ -124,7 +127,7 @@ $multi-format-editor-background: #fafbfd;

.confirmation-panel__message {
line-height: 20px;
&-primary{
&-primary {
font-weight: $font-weight-semibold;
color: $color-text;
}
Expand Down
16 changes: 14 additions & 2 deletions src/styles/components/widgets/_numeric-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@
background-color: #f8f8f9;
border: 1px solid #bec8d9;
border-radius: 1px;
width: $font-size;
height: $font-size;
line-height: 12px;
text-align: center;
}

.numeric-top-caret-modifier {
// to prevent user agent override
width: 13px !important;
height: 13px !important;
fill: $color-text !important;
}

.numeric-bottom-caret-modifier {
// to prevent user agent override
width: 13px !important;
height: 13px !important;
fill: $color-text !important;
}
21 changes: 0 additions & 21 deletions src/styles/icons/_icons.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/styles/icons/_main.scss

This file was deleted.

7 changes: 2 additions & 5 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@
.plotly-editor {
position: relative;
width: $layout-panel-width;
flex-shrink:0;
flex-shrink: 0;
overflow: hidden;
display: flex;
font-family: $ff-default;
@import 'components/main';
@import 'icons/main';
@include font-smoothing;
&__wrapper{
&__wrapper {
display: flex;
flex-grow: 1;
}
}

@import 'shame';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Loading