Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
refactor: move superset-ui/style to core
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Aug 26, 2020
1 parent 86334b0 commit 37f565a
Show file tree
Hide file tree
Showing 60 changed files with 28 additions and 200 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ Current master: https://superset-ui.now.sh/
| [@superset-ui/superset-ui](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-superset-ui) | [![Version](https://img.shields.io/npm/v/@superset-ui/superset-ui.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/superset-ui.svg?style=flat-square) |
| [@superset-ui/chart](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-chart) | [![Version](https://img.shields.io/npm/v/@superset-ui/chart.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/chart.svg?style=flat-square) |
| [@superset-ui/chart-composition](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-chart-composition) | [![Version](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square) |
| [@superset-ui/color](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-color) | [![Version](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square) |
| [@superset-ui/core](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-core) | [![Version](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square) |
| [@superset-ui/generator-superset](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-generator-superset) | [![Version](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square) |
| [@superset-ui/number-format](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-number-format) | [![Version](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square) |
| [@superset-ui/style](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-style) | [![Version](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square) |
| [@superset-ui/time-format](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-time-format) | [![Version](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/time-format.svg?style=flat-square) |

### Chart plugin packages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"@superset-ui/chart": "^0.14.1",
"@superset-ui/core": "^0.15.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/validator": "^0.14.1",
"@superset-ui/style": "^0.14.0",
"@superset-ui/validator": "^0.14.1"
},
"peerDependencies": {
"react": "^16.13.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { <%if (componentType == 'class') { %>PureComponent<% } %><%if (componentType == 'function') { %>useEffect<% } %>, createRef } from 'react';
import styled, { supersetTheme } from '@superset-ui/style';
import { styled, supersetTheme } from '@superset-ui/core';

interface <%= packageLabel %>StylesProps {
height: number;
Expand All @@ -41,8 +41,8 @@ export type <%= packageLabel %>Props = {
// For docs, visit https://emotion.sh/docs/styled

// Theming variables are provided for your use via a ThemeProvider
// imported from @superset-ui/style. For variables available, please visit
// https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-style/src/index.ts
// imported from @superset-ui/core. For variables available, please visit
// https://github.com/apache-superset/superset-ui/blob/master/packages/superset-ui-core/src/style/index.ts

const Styles = styled.div<<%= packageLabel %>StylesProps>`
background-color: ${({ theme }) => theme.colors.secondary.light2};
Expand Down
1 change: 0 additions & 1 deletion packages/superset-ui-chart-controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"dependencies": {
"@types/react-bootstrap": "0.32.21",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
"lodash": "^4.17.15",
"prop-types": "^15.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* under the License.
*/
import React from 'react';
import { t } from '@superset-ui/core';
import { supersetTheme } from '@superset-ui/style';
import { t, supersetTheme } from '@superset-ui/core';
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
import { kebabCase } from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
/* eslint-disable camelcase */
import React from 'react';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
import { ColumnTypeLabel } from './ColumnTypeLabel';
import CertifiedIconWithTooltip from './CertifiedIconWithTooltip';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React, { ReactText, ReactNode, MouseEvent, useCallback } from 'react';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from './InfoTooltipWithTrigger';

export interface RadioButtonOption {
Expand Down
3 changes: 0 additions & 3 deletions packages/superset-ui-chart-controls/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
{
"path": "../superset-ui-core"
},
{
"path": "../superset-ui-style"
},
{
"path": "../superset-ui-validator"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/superset-ui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
},
"dependencies": {
"@babel/runtime": "^7.1.2",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@types/d3-format": "^1.3.0",
"@types/lodash": "^4.14.149",
"@types/d3-time": "^1.0.9",
Expand All @@ -43,6 +45,7 @@
"d3-format": "^1.3.2",
"d3-time": "^1.0.10",
"d3-time-format": "^2.2.0",
"emotion-theming": "^10.0.27",
"jed": "^1.1.1",
"lodash": "^4.17.11",
"fetch-retry": "^4.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/superset-ui-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ export * from './number-format';
export * from './time-format';
export * from './dimension';
export * from './color';
export * from './style';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { supersetTheme, SupersetThemeProps } from '../src';
import { styled, supersetTheme, SupersetThemeProps } from '@superset-ui/core/src/style';

describe('@superset-ui/style package', () => {
it('exports a theme', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/superset-ui-demo/.storybook/themeDecorator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// themeDecorator.js
import React from "react"
import { supersetTheme, ThemeProvider } from '@superset-ui/style';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';

const ThemeDecorator = storyFn => (
<ThemeProvider theme={supersetTheme}>{storyFn()}</ThemeProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@superset-ui/style';
import React, { useState, ReactNode } from 'react';
import { styled } from '@superset-ui/core';
import { DecoratorFunction } from '@storybook/addons';
import ResizablePanel, { Size } from './ResizablePanel';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { supersetTheme } from '@superset-ui/style/src/';
import { supersetTheme } from '@superset-ui/core';

export default {
title: 'Core Packages|@superset-ui/style',
Expand Down
30 changes: 0 additions & 30 deletions packages/superset-ui-style/README.md

This file was deleted.

36 changes: 0 additions & 36 deletions packages/superset-ui-style/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions packages/superset-ui-style/test/tsconfig.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/superset-ui-style/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
"react": "^16.13.1"
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import Component from './Calendar';

const ReactComponent = reactify(Component);
Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-plugin-chart-calendar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-style"
},
{
"path": "../../packages/superset-ui-validator"
}
Expand Down
1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-chord/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"access": "public"
},
"dependencies": {
"@superset-ui/style": "0.14.20",
"@superset-ui/core": "^0.15.0",
"@superset-ui/chart": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/legacy-plugin-chart-chord/src/ReactChord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import PropTypes from 'prop-types';
import Component from './Chord';

Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-plugin-chart-chord/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"../../types/**/*"
],
"references": [
{
"path": "../../packages/superset-ui-style"
},
{
"path": "../../packages/superset-ui-core"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-force-directed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.3",
"d3": "^3.5.17",
"prop-types": "^15.7.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import PropTypes from 'prop-types';
import Component from './ForceDirected';

Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-plugin-chart-force-directed/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
},
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-style"
}
]
}
1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-histogram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
"@vx/legend": "^0.0.198",
"@vx/responsive": "^0.0.197",
Expand Down
3 changes: 1 addition & 2 deletions plugins/legacy-plugin-chart-histogram/src/Histogram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { Histogram, BarSeries, XAxis, YAxis } from '@data-ui/histogram';
import { chartTheme } from '@data-ui/theme';
import { LegendOrdinal } from '@vx/legend';
import { scaleOrdinal } from '@vx/scale';
import styled from '@superset-ui/style';
import { CategoricalColorNamespace } from '@superset-ui/core';
import { CategoricalColorNamespace, styled } from '@superset-ui/core';
import WithLegend from './WithLegend';

const propTypes = {
Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-plugin-chart-histogram/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-style"
},
{
"path": "../../packages/superset-ui-validator"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"dependencies": {
"@superset-ui/chart": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.3",
"d3": "^3.5.17",
"prop-types": "^15.7.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
import styled from '@superset-ui/style';
import { styled } from '@superset-ui/core';
import { reactify } from '@superset-ui/chart';
import PropTypes from 'prop-types';
import Component from './ParallelCoordinates';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
},
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-style"
}
]
}
1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-sankey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"dependencies": {
"@superset-ui/chart": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/style": "^0.14.3",
"prop-types": "^15.6.2",
"d3": "^3.5.17",
"d3-sankey": "^0.4.2"
Expand Down
Loading

0 comments on commit 37f565a

Please sign in to comment.