diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index 3d407191c72..a2540290881 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -17,7 +17,8 @@ * under the License. */ import { withJsx } from '@mihkeleidast/storybook-addon-source'; -import { themeObject, css, exampleThemes } from '@superset-ui/core'; +import { exampleThemes } from '@superset-ui/core'; +import { themeObject, css } from '@apache-superset/core/ui'; import { combineReducers, createStore, applyMiddleware, compose } from 'redux'; import thunk from 'redux-thunk'; import { Provider } from 'react-redux'; diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 720162eca0a..5c41f4afbfc 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -5324,6 +5324,15 @@ "fast-deep-equal": "^3.1.3" } }, + "node_modules/@fontsource/fira-code": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@fontsource/fira-code/-/fira-code-5.2.7.tgz", + "integrity": "sha512-tnB9NNund9TwIym8/7DMJe573nlPEQb+fKUV5GL8TBYXjIhDvL0D7mgmNVNQUPhXp+R7RylQeiBdkA4EbOHPGQ==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@fontsource/inter": { "version": "5.2.6", "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.2.6.tgz", @@ -61918,12 +61927,27 @@ "name": "@apache-superset/core", "version": "0.0.1-rc5", "license": "ISC", + "dependencies": { + "@emotion/cache": "^11.4.0", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@fontsource/fira-code": "^5.2.6", + "@fontsource/inter": "^5.2.6", + "lodash": "^4.17.21" + }, "devDependencies": { "@babel/cli": "^7.28.3", "@babel/core": "^7.28.3", "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@babel/preset-typescript": "^7.26.0", + "@emotion/styled": "^11.14.1", + "@testing-library/dom": "^8.20.1", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^12.1.5", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^12.8.3", + "@types/lodash": "^4.17.20", "@types/react": "^17.0.83", "install": "^0.13.0", "npm": "^11.1.0", @@ -61934,6 +61958,13 @@ "react": "^17.0.2" } }, + "packages/superset-core/node_modules/@types/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA==", + "dev": true, + "license": "MIT" + }, "packages/superset-core/node_modules/npm": { "version": "11.5.2", "resolved": "https://registry.npmjs.org/npm/-/npm-11.5.2.tgz", diff --git a/superset-frontend/packages/superset-core/package.json b/superset-frontend/packages/superset-core/package.json index a7449278352..9eb41d37311 100644 --- a/superset-frontend/packages/superset-core/package.json +++ b/superset-frontend/packages/superset-core/package.json @@ -16,14 +16,34 @@ "@babel/preset-env": "^7.26.9", "@babel/preset-react": "^7.26.3", "@babel/preset-typescript": "^7.26.0", - "@types/react": "^17.0.83", "install": "^0.13.0", "npm": "^11.1.0", - "typescript": "^5.0.0" + "typescript": "^5.0.0", + "@emotion/styled": "^11.14.1", + "@types/lodash": "^4.17.20", + "@testing-library/dom": "^8.20.1", + "@testing-library/jest-dom": "*", + "@testing-library/react": "^12.1.5", + "@testing-library/react-hooks": "*", + "@testing-library/user-event": "*", + "@types/react": "*", + "@types/react-loadable": "*", + "@types/react-window": "^1.8.8", + "@types/tinycolor2": "*" }, "peerDependencies": { - "antd": "^5.26.0", - "react": "^17.0.2" + "@emotion/cache": "^11.4.0", + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.14.1", + "nanoid": "^5.0.9", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-loadable": "^5.5.0", + "tinycolor2": "*", + "@fontsource/fira-code": "^5.2.6", + "@fontsource/inter": "^5.2.6", + "lodash": "^4.17.21", + "antd": "^5.26.0" }, "scripts": { "build": "babel src --out-dir lib --extensions \".ts,.tsx\" && tsc --emitDeclarationOnly", diff --git a/superset-frontend/packages/superset-core/src/index.ts b/superset-frontend/packages/superset-core/src/index.ts index 74c1aea3d6a..e570f52292a 100644 --- a/superset-frontend/packages/superset-core/src/index.ts +++ b/superset-frontend/packages/superset-core/src/index.ts @@ -17,3 +17,4 @@ * under the License. */ export * from './api'; +export * from './ui'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Alert/Alert.stories.tsx b/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.stories.tsx similarity index 81% rename from superset-frontend/packages/superset-ui-core/src/components/Alert/Alert.stories.tsx rename to superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.stories.tsx index 97241e10580..7ccf6737a40 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Alert/Alert.stories.tsx +++ b/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.stories.tsx @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { Alert } from '.'; -import type { AlertProps } from './types'; +import { Alert, type AlertProps } from '.'; type AlertType = Required>; type AlertTypeValue = AlertType['type']; @@ -54,25 +53,10 @@ export const AlertGallery = () => ( ); -export const InteractiveAlert = (args: AlertProps) => ( - <> - -
- Content below the Alert to test the `roomBelow` property -
- -); +export const InteractiveAlert = (args: AlertProps) => ; InteractiveAlert.args = { closable: true, - roomBelow: false, type: 'info', message: 'This is a sample alert message.', description: 'Sample description for additional context.', @@ -94,8 +78,4 @@ InteractiveAlert.argTypes = { control: { type: 'boolean' }, description: 'Whether to display an icon in the Alert.', }, - roomBelow: { - control: { type: 'boolean' }, - description: 'Adds margin below the Alert for layout spacing.', - }, }; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Alert/index.tsx b/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.test.tsx similarity index 58% rename from superset-frontend/packages/superset-ui-core/src/components/Alert/index.tsx rename to superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.test.tsx index 512f83b22d6..cb0e8092f7d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Alert/index.tsx +++ b/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.test.tsx @@ -16,31 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -import { Alert as AntdAlert } from 'antd'; -import type { AlertProps } from './types'; -export const Alert = (props: AlertProps) => { - const { - type = 'info', - description, - showIcon = true, - closable = true, - children, - ...rest - } = props; +import { render } from '../../testing'; +import { Alert } from '.'; - return ( - - ); -}; - -export type { AlertProps }; +test('renders Alert with default props', async () => { + const { container } = render(); + expect(container).toHaveTextContent('Default message'); +}); diff --git a/superset-frontend/packages/superset-core/src/ui/components/Alert/index.tsx b/superset-frontend/packages/superset-core/src/ui/components/Alert/index.tsx new file mode 100644 index 00000000000..c79f9980270 --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/components/Alert/index.tsx @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Alert as AntdAlert } from 'antd'; +import type { PropsWithChildren } from 'react'; +import type { AlertProps as AntdAlertProps } from 'antd/es/alert'; + +/** + * Props for the Alert component, extending Ant Design's AlertProps + * with support for children instead of the message prop. + */ +export type AlertProps = PropsWithChildren>; + +/** + * Alert component for displaying important messages to users. + * + * Wraps Ant Design's Alert component with sensible defaults and improved accessibility. + * Supports four severity levels: success, info, warning, and error. + * + * @param props - Alert configuration props + * + * @example + * // Basic usage with default info type + * This is an informational message + * + * @example + * // Error alert with description + * + * Operation failed + * + * + * @example + * // Success alert without close button or icon + * + * Settings saved successfully + * + * + * @example + * // Warning alert with custom close handler + * console.log('Alert closed')}> + * Your session will expire in 5 minutes + * + * + * @returns Rendered Alert component with proper ARIA attributes + */ +export const Alert = (props: AlertProps) => { + const { + type = 'info', + description, + showIcon = true, + closable = true, + children, + ...rest + } = props; + return ( + + ); +}; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Alert/types.ts b/superset-frontend/packages/superset-core/src/ui/components/index.ts similarity index 78% rename from superset-frontend/packages/superset-ui-core/src/components/Alert/types.ts rename to superset-frontend/packages/superset-core/src/ui/components/index.ts index 37bf8751be1..a03f2672261 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Alert/types.ts +++ b/superset-frontend/packages/superset-core/src/ui/components/index.ts @@ -16,9 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -import type { PropsWithChildren } from 'react'; -import type { AlertProps as AntdAlertProps } from 'antd/es/alert'; - -export type AlertProps = PropsWithChildren< - Omit & { roomBelow?: boolean } ->; +export * from './Alert'; diff --git a/superset-frontend/packages/superset-core/src/ui/index.ts b/superset-frontend/packages/superset-core/src/ui/index.ts new file mode 100644 index 00000000000..82cb0634d5e --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/index.ts @@ -0,0 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export * from './theme'; +export * from './components'; diff --git a/superset-frontend/packages/superset-core/src/ui/testing.tsx b/superset-frontend/packages/superset-core/src/ui/testing.tsx new file mode 100644 index 00000000000..e68186343c9 --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/testing.tsx @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import userEvent from '@testing-library/user-event'; +import { ReactElement } from 'react'; +import { render, RenderOptions } from '@testing-library/react'; +import '@testing-library/jest-dom'; +import { themeObject } from './theme'; + +// Define the wrapper component outside +const Providers = ({ children }: { children: React.ReactNode }) => ( + + {children} + +); + +// Follow the exact pattern from RTL docs +const customRender = ( + ui: ReactElement, + options?: Omit, +) => render(ui, { wrapper: Providers, ...options }); + +export { + createEvent, + fireEvent, + screen, + waitFor, + cleanup, + within, + act, +} from '@testing-library/react'; +export { customRender as render, userEvent }; diff --git a/superset-frontend/packages/superset-ui-core/src/theme/GlobalStyles.tsx b/superset-frontend/packages/superset-core/src/ui/theme/GlobalStyles.tsx similarity index 100% rename from superset-frontend/packages/superset-ui-core/src/theme/GlobalStyles.tsx rename to superset-frontend/packages/superset-core/src/ui/theme/GlobalStyles.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/theme/Theme.test.tsx b/superset-frontend/packages/superset-core/src/ui/theme/Theme.test.tsx new file mode 100644 index 00000000000..e9b1612f15c --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/theme/Theme.test.tsx @@ -0,0 +1,768 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { theme as antdThemeImport } from 'antd'; +import { Theme } from './Theme'; +import { AnyThemeConfig, ThemeAlgorithm } from './types'; + +// Mock emotion's cache to avoid actual DOM operations +jest.mock('@emotion/cache', () => ({ + __esModule: true, + default: jest.fn().mockReturnValue({}), +})); + +beforeEach(() => { + jest.clearAllMocks(); +}); + +test('Theme.json serializes the theme configuration to a JSON string', () => { + const theme = Theme.fromConfig({ + token: { + colorPrimary: '#ff0000', + }, + algorithm: antdThemeImport.darkAlgorithm, + }); + + const jsonString = theme.json(); + const parsedJson = JSON.parse(jsonString); + + expect(parsedJson.token?.colorPrimary).toBe('#ff0000'); + expect(parsedJson.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.fromConfig creates a theme with Ant Design defaults when no config is provided', () => { + const theme = Theme.fromConfig(); + + // Verify Ant Design default tokens are set + expect(theme.theme.colorPrimary).toBeDefined(); + expect(theme.theme.fontFamily).toBeDefined(); + + // Verify the theme is initialized with semantic color tokens + expect(theme.theme.colorText).toBeDefined(); + expect(theme.theme.colorBgBase).toBeDefined(); +}); + +test('Theme.fromConfig creates a theme with custom tokens when provided', () => { + const customConfig: AnyThemeConfig = { + token: { + colorPrimary: '#ff0000', + fontFamily: 'CustomFont, sans-serif', + }, + }; + + const theme = Theme.fromConfig(customConfig); + + // Verify custom primary color is set + expect(theme.theme.colorPrimary).toBe('#ff0000'); + + // Verify custom font family is set + expect(theme.theme.fontFamily).toBe('CustomFont, sans-serif'); + + // Unspecified values will use Ant Design defaults + expect(theme.theme.colorError).toBeDefined(); +}); + +test('Theme.fromConfig creates a theme with dark mode when dark algorithm is specified', () => { + const darkConfig: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + }; + + const theme = Theme.fromConfig(darkConfig); + + // Verify dark mode by using the serialized config from the public method + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.setConfig updates theme with a new configuration', () => { + const theme = Theme.fromConfig(); + const initialPrimaryColor = theme.theme.colorPrimary; + + // Update with new config + theme.setConfig({ + token: { + colorPrimary: '#0000ff', + }, + }); + + // Verify the theme was updated + expect(theme.theme.colorPrimary).toBe('#0000ff'); + expect(theme.theme.colorPrimary).not.toBe(initialPrimaryColor); +}); + +test('Theme.setConfig preserves default tokens when updating with partial config', () => { + const theme = Theme.fromConfig(); + const initialErrorColor = theme.theme.colorError; + + // Update with new config that doesn't specify error color + theme.setConfig({ + token: { + colorPrimary: '#0000ff', + }, + }); + + // Verify the error color is preserved + expect(theme.theme.colorError).toBe(initialErrorColor); +}); + +test('Theme.setConfig correctly applies algorithm changes', () => { + const theme = Theme.fromConfig(); + + // Change to dark mode via config + theme.setConfig({ + algorithm: antdThemeImport.darkAlgorithm, + }); + + // Verify the algorithm was updated + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.toggleDarkMode switches to dark algorithm when toggling dark mode on', () => { + const theme = Theme.fromConfig(); + + // Toggle dark mode on + theme.toggleDarkMode(true); + + // Verify dark algorithm is used + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.toggleDarkMode switches to default algorithm when toggling dark mode off', () => { + // Start with dark theme + const theme = Theme.fromConfig({ + algorithm: antdThemeImport.darkAlgorithm, + }); + + // Toggle dark mode off + theme.toggleDarkMode(false); + + // Verify default algorithm is used + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); +}); + +test('Theme.toggleDarkMode preserves other algorithms when toggling dark mode', () => { + // Start with compact and dark algorithms + const theme = Theme.fromConfig({ + algorithm: [ + antdThemeImport.compactAlgorithm, + antdThemeImport.darkAlgorithm, + ], + }); + + // Toggle dark mode off + theme.toggleDarkMode(false); + + // Verify default algorithm replaces dark but compact is preserved + const serialized = theme.toSerializedConfig(); + + expect(Array.isArray(serialized.algorithm)).toBe(true); + expect(serialized.algorithm).toContain(ThemeAlgorithm.DEFAULT); + expect(serialized.algorithm).toContain(ThemeAlgorithm.COMPACT); + expect(serialized.algorithm).not.toContain(ThemeAlgorithm.DARK); +}); + +test('Theme.toSerializedConfig serializes theme config correctly', () => { + const theme = Theme.fromConfig({ + token: { + colorPrimary: '#ff0000', + }, + algorithm: antdThemeImport.darkAlgorithm, + }); + + const serialized = theme.toSerializedConfig(); + + expect(serialized.token?.colorPrimary).toBe('#ff0000'); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.fromConfig with baseTheme applies base theme tokens under the main config', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#ff0000', + colorError: '#00ff00', + fontFamily: 'BaseFont', + }, + }; + + const userConfig: AnyThemeConfig = { + token: { + colorPrimary: '#0000ff', + }, + }; + + const theme = Theme.fromConfig(userConfig, baseTheme); + + // User config overrides base theme + expect(theme.theme.colorPrimary).toBe('#0000ff'); + + // Base theme tokens are preserved when not overridden + expect(theme.theme.colorError).toBe('#00ff00'); + expect(theme.theme.fontFamily).toBe('BaseFont'); +}); + +test('Theme.fromConfig with baseTheme applies base theme when no user config is provided', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#ff0000', + fontFamily: 'TestFont', + }, + algorithm: antdThemeImport.darkAlgorithm, + }; + + const theme = Theme.fromConfig(undefined, baseTheme); + + // Color may be transformed by dark algorithm, check fontFamily instead + expect(theme.theme.fontFamily).toBe('TestFont'); + + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.fromConfig with baseTheme handles empty config with base theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#ff0000', + }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const emptyConfig: AnyThemeConfig = {}; + + const theme = Theme.fromConfig(emptyConfig, baseTheme); + + // Base theme tokens should be applied + expect(theme.theme.colorPrimary).toBe('#ff0000'); + + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); +}); + +test('Theme.fromConfig with baseTheme merges algorithms correctly with base theme', () => { + const baseTheme: AnyThemeConfig = { + algorithm: antdThemeImport.compactAlgorithm, + }; + + const userConfig: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + }; + + const theme = Theme.fromConfig(userConfig, baseTheme); + + // User algorithm should override base algorithm + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme.fromConfig with baseTheme merges component overrides with base theme', () => { + const baseTheme: AnyThemeConfig = { + components: { + Button: { + colorPrimary: '#basebutton', + }, + Input: { + colorBorder: '#baseinput', + }, + }, + }; + + const userConfig: AnyThemeConfig = { + components: { + Button: { + colorPrimary: '#userbutton', + }, + }, + }; + + const theme = Theme.fromConfig(userConfig, baseTheme); + const serialized = theme.toSerializedConfig(); + + // User component config overrides base + expect(serialized.components?.Button?.colorPrimary).toBe('#userbutton'); + + // Base component config preserved when not overridden + expect(serialized.components?.Input?.colorBorder).toBe('#baseinput'); +}); + +test('Theme.fromConfig with baseTheme handles undefined config and undefined base theme', () => { + const theme = Theme.fromConfig(undefined, undefined); + + // Should get Ant Design defaults + expect(theme.theme.colorPrimary).toBeDefined(); + expect(theme.theme.fontFamily).toBeDefined(); +}); + +test('Theme.fromConfig with baseTheme preserves custom tokens in base theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#ff0000', + // Custom superset-specific tokens + brandLogoAlt: 'CustomLogo', + menuHoverBackgroundColor: '#00ff00', + } as Record, + }; + + const theme = Theme.fromConfig({}, baseTheme); + + // Standard token + expect(theme.theme.colorPrimary).toBe('#ff0000'); + + // Custom tokens should be preserved + expect((theme.theme as any).brandLogoAlt).toBe('CustomLogo'); + expect((theme.theme as any).menuHoverBackgroundColor).toBe('#00ff00'); +}); + +test('Theme edge cases correctly applies base theme tokens in dark mode', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#1890ff', + fontFamily: 'TestFont', + }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const baseThemeDark: AnyThemeConfig = { + ...baseTheme, + algorithm: antdThemeImport.darkAlgorithm, + }; + + // Simulate light mode with base theme + const lightTheme = Theme.fromConfig({}, baseTheme); + expect(lightTheme.theme.colorPrimary).toBe('#1890ff'); + expect(lightTheme.theme.fontFamily).toBe('TestFont'); + + // Simulate dark mode with base theme dark + const darkTheme = Theme.fromConfig({}, baseThemeDark); + // Dark algorithm transforms colors, but fontFamily should be preserved + expect(darkTheme.theme.fontFamily).toBe('TestFont'); + + // Verify the algorithm is different + const lightSerialized = lightTheme.toSerializedConfig(); + const darkSerialized = darkTheme.toSerializedConfig(); + expect(lightSerialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); + expect(darkSerialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme edge cases handles switching from custom theme back to base theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#1890ff', + }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + // First apply custom theme + const customConfig: AnyThemeConfig = { + token: { + colorPrimary: '#52c41a', + }, + }; + const themeWithCustom = Theme.fromConfig(customConfig, baseTheme); + expect(themeWithCustom.theme.colorPrimary).toBe('#52c41a'); + + // Then switch back to empty config (simulating removal of custom theme) + const themeWithEmpty = Theme.fromConfig({}, baseTheme); + expect(themeWithEmpty.theme.colorPrimary).toBe('#1890ff'); + + // Verify they produce different outputs + expect(themeWithCustom.theme.colorPrimary).not.toBe( + themeWithEmpty.theme.colorPrimary, + ); +}); + +test('Theme edge cases handles algorithm-only config with base theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + fontFamily: 'TestFont', + borderRadius: 8, + }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + // Config that only specifies algorithm (common for THEME_DARK) + const algorithmOnlyConfig: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + }; + + const theme = Theme.fromConfig(algorithmOnlyConfig, baseTheme); + + // Should have base theme tokens + expect(theme.theme.fontFamily).toBe('TestFont'); + expect(theme.theme.borderRadius).toBe(8); + + // Should have user's algorithm + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme base theme integration merges base theme tokens with empty user theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + colorError: '#e04355', + fontFamily: 'Inter, Helvetica', + }, + }; + + const userTheme: AnyThemeConfig = { + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + + expect(theme.theme.colorPrimary).toBe('#2893B3'); + expect(theme.theme.colorError).toBe('#e04355'); + expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); + + // Should have user's algorithm + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); +}); + +test('Theme base theme integration allows user theme to override specific base theme tokens', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + colorError: '#e04355', + fontFamily: 'Inter, Helvetica', + borderRadius: 4, + }, + }; + + const userTheme: AnyThemeConfig = { + algorithm: antdThemeImport.defaultAlgorithm, + token: { + colorPrimary: '#123456', // Override primary color + // Leave other tokens from base + }, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + + // User override should win + expect(theme.theme.colorPrimary).toBe('#123456'); + + // Base theme tokens should be preserved + expect(theme.theme.colorError).toBe('#e04355'); + expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); + expect(theme.theme.borderRadius).toBe(4); +}); + +test('Theme base theme integration handles base theme with dark algorithm correctly', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + fontFamily: 'Inter, Helvetica', + }, + }; + + const baseThemeDark: AnyThemeConfig = { + ...baseTheme, + algorithm: antdThemeImport.darkAlgorithm, + }; + + const userDarkTheme: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + }; + + const theme = Theme.fromConfig(userDarkTheme, baseThemeDark); + + // Should have base tokens + expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); + + // Should be in dark mode + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme base theme integration works with real-world Superset base theme configuration', () => { + // Simulate actual Superset base theme (THEME_DEFAULT/THEME_DARK from config) + const supersetBaseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + colorError: '#e04355', + colorWarning: '#fcc700', + colorSuccess: '#5ac189', + colorInfo: '#66bcfe', + fontFamily: "'Inter', Helvetica, Arial", + fontFamilyCode: "'Fira Code', 'Courier New', monospace", + }, + }; + + // Simulate THEME_DEFAULT from config + const themeDefault: AnyThemeConfig = { + algorithm: antdThemeImport.defaultAlgorithm, + }; + + // Simulate THEME_DARK from config + const themeDark: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + }; + + // Test light mode + const lightTheme = Theme.fromConfig(themeDefault, supersetBaseTheme); + expect(lightTheme.theme.colorPrimary).toBe('#2893B3'); + expect(lightTheme.theme.fontFamily).toBe("'Inter', Helvetica, Arial"); + + // Test dark mode + const darkTheme = Theme.fromConfig(themeDark, { + ...supersetBaseTheme, + algorithm: antdThemeImport.darkAlgorithm, + }); + expect(darkTheme.theme.fontFamily).toBe("'Inter', Helvetica, Arial"); + + const darkSerialized = darkTheme.toSerializedConfig(); + expect(darkSerialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme base theme integration handles component overrides in base theme', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + }, + components: { + Button: { + primaryColor: '#custom-button', + borderRadius: 8, + }, + }, + }; + + const userTheme: AnyThemeConfig = { + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + + // Should preserve component overrides + const serialized = theme.toSerializedConfig(); + expect(serialized.components?.Button?.primaryColor).toBe('#custom-button'); + expect(serialized.components?.Button?.borderRadius).toBe(8); +}); + +test('Theme base theme integration properly handles algorithm property override', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const userTheme: AnyThemeConfig = { + algorithm: antdThemeImport.darkAlgorithm, + token: { + borderRadius: 8, + }, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + const serialized = theme.toSerializedConfig(); + + // User algorithm should override base algorithm + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); + + // Both base and user tokens should be merged + expect(serialized.token?.colorPrimary).toBeTruthy(); + expect(serialized.token?.borderRadius).toBe(8); +}); + +test('Theme base theme integration handles cssVar, hashed and inherit properties correctly', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + }, + cssVar: true, + hashed: false, + }; + + const userTheme: AnyThemeConfig = { + token: { + borderRadius: 8, + }, + inherit: true, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + const serialized = theme.toSerializedConfig(); + + // User properties override/add to base + expect(serialized.inherit).toBe(true); + expect(serialized.cssVar).toBe(true); + expect(serialized.hashed).toBe(false); + + // Tokens are still merged + expect(serialized.token?.colorPrimary).toBeTruthy(); + expect(serialized.token?.borderRadius).toBe(8); +}); + +test('Theme base theme integration merges nested component styles correctly', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + fontFamily: 'BaseFont', + }, + components: { + Button: { + colorPrimary: '#basebutton', + fontSize: 14, + }, + Input: { + colorBorder: '#baseinput', + }, + }, + }; + + const userTheme: AnyThemeConfig = { + token: { + borderRadius: 8, + }, + components: { + Button: { + fontSize: 16, // Override Button fontSize + }, + Select: { + colorBorder: '#userselect', // Add new component + }, + }, + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + const serialized = theme.toSerializedConfig(); + + // Tokens should be merged + // Note: components present may affect color transformation + expect(serialized.token?.colorPrimary).toBeTruthy(); + expect(serialized.token?.borderRadius).toBe(8); + expect(serialized.token?.fontFamily).toBe('BaseFont'); + + // Components should be merged (shallow merge per component) + expect(serialized.components?.Button?.colorPrimary).toBe('#basebutton'); + expect(serialized.components?.Button?.fontSize).toBe(16); // User override + expect(serialized.components?.Input?.colorBorder).toBe('#baseinput'); + expect(serialized.components?.Select?.colorBorder).toBe('#userselect'); +}); + +test('Theme base theme integration setConfig replaces theme config entirely (does not preserve base theme)', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + fontFamily: 'Inter', + }, + }; + + const theme = Theme.fromConfig({}, baseTheme); + + expect(theme.theme.colorPrimary).toBe('#2893B3'); + expect(theme.theme.fontFamily).toBe('Inter'); + + // Update config (simulating theme change) + theme.setConfig({ + token: { + colorPrimary: '#654321', + }, + algorithm: antdThemeImport.darkAlgorithm, + }); + + // setConfig replaces the entire config, so base theme is NOT preserved + // This is expected behavior - setConfig is for complete replacement + expect(theme.theme.colorPrimary).toBeTruthy(); + // fontFamily reverts to Ant Design default since base theme is not reapplied + expect(theme.theme.fontFamily).not.toBe('Inter'); +}); + +test('Theme base theme integration minimal theme preserves ALL base theme tokens except overridden ones', () => { + // Simulate a comprehensive base theme with many tokens + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + colorError: '#e04355', + colorWarning: '#fcc700', + colorSuccess: '#5ac189', + colorInfo: '#66bcfe', + fontFamily: 'Inter, Helvetica', + fontSize: 14, + borderRadius: 4, + lineWidth: 1, + controlHeight: 32, + // Custom Superset tokens + brandLogoAlt: 'CustomLogo', + menuHoverBackgroundColor: '#eeeeee', + } as Record, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + // Minimal theme that only overrides primary color and algorithm + const minimalTheme: AnyThemeConfig = { + token: { + colorPrimary: '#ff05dd', // Only override this + }, + algorithm: antdThemeImport.darkAlgorithm, // Change to dark + }; + + const theme = Theme.fromConfig(minimalTheme, baseTheme); + + // User's override should apply + expect(theme.theme.colorPrimary).toBe('#ff05dd'); + + // ALL base theme tokens should be preserved + expect(theme.theme.colorError).toBe('#e04355'); + expect(theme.theme.colorWarning).toBe('#fcc700'); + expect(theme.theme.colorSuccess).toBe('#5ac189'); + expect(theme.theme.colorInfo).toBe('#66bcfe'); + expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); + expect(theme.theme.fontSize).toBe(14); + expect(theme.theme.borderRadius).toBe(4); + expect(theme.theme.lineWidth).toBe(1); + expect(theme.theme.controlHeight).toBe(32); + + // Custom tokens should also be preserved + expect((theme.theme as any).brandLogoAlt).toBe('CustomLogo'); + expect((theme.theme as any).menuHoverBackgroundColor).toBe('#eeeeee'); + + // Algorithm should be updated + const serialized = theme.toSerializedConfig(); + expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('Theme base theme integration arrays in themes are replaced entirely, not merged by index', () => { + const baseTheme: AnyThemeConfig = { + token: { + colorPrimary: '#2893B3', + }, + algorithm: [ + antdThemeImport.compactAlgorithm, + antdThemeImport.defaultAlgorithm, + ], + }; + + const userTheme: AnyThemeConfig = { + algorithm: [antdThemeImport.darkAlgorithm], // Replace with single item array + }; + + const theme = Theme.fromConfig(userTheme, baseTheme); + const serialized = theme.toSerializedConfig(); + + // User's array should completely replace base array + expect(Array.isArray(serialized.algorithm)).toBe(true); + expect(serialized.algorithm).toHaveLength(1); + expect(serialized.algorithm).toContain(ThemeAlgorithm.DARK); + expect(serialized.algorithm).not.toContain(ThemeAlgorithm.COMPACT); + expect(serialized.algorithm).not.toContain(ThemeAlgorithm.DEFAULT); +}); diff --git a/superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx b/superset-frontend/packages/superset-core/src/ui/theme/Theme.tsx similarity index 100% rename from superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx rename to superset-frontend/packages/superset-core/src/ui/theme/Theme.tsx diff --git a/superset-frontend/packages/superset-ui-core/src/theme/exampleThemes.ts b/superset-frontend/packages/superset-core/src/ui/theme/exampleThemes.ts similarity index 100% rename from superset-frontend/packages/superset-ui-core/src/theme/exampleThemes.ts rename to superset-frontend/packages/superset-core/src/ui/theme/exampleThemes.ts diff --git a/superset-frontend/packages/superset-ui-core/src/theme/index.tsx b/superset-frontend/packages/superset-core/src/ui/theme/index.tsx similarity index 99% rename from superset-frontend/packages/superset-ui-core/src/theme/index.tsx rename to superset-frontend/packages/superset-core/src/ui/theme/index.tsx index a2bcf24976c..c1dca943596 100644 --- a/superset-frontend/packages/superset-ui-core/src/theme/index.tsx +++ b/superset-frontend/packages/superset-core/src/ui/theme/index.tsx @@ -87,3 +87,4 @@ export type { // Export theme utility functions export * from './utils/themeUtils'; +export * from './utils'; diff --git a/superset-frontend/packages/superset-ui-core/src/theme/types.ts b/superset-frontend/packages/superset-core/src/ui/theme/types.ts similarity index 100% rename from superset-frontend/packages/superset-ui-core/src/theme/types.ts rename to superset-frontend/packages/superset-core/src/ui/theme/types.ts diff --git a/superset-frontend/packages/superset-ui-core/src/theme/utils.ts b/superset-frontend/packages/superset-core/src/ui/theme/utils/index.ts similarity index 99% rename from superset-frontend/packages/superset-ui-core/src/theme/utils.ts rename to superset-frontend/packages/superset-core/src/ui/theme/utils/index.ts index b8ce580ea7b..f5a8555567a 100644 --- a/superset-frontend/packages/superset-ui-core/src/theme/utils.ts +++ b/superset-frontend/packages/superset-core/src/ui/theme/utils/index.ts @@ -24,7 +24,7 @@ import { type SystemColors, type SupersetTheme, ThemeAlgorithm, -} from './types'; +} from '../types'; /** * Check if a theme config is serializable by detecting string-based algorithm diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.test.ts b/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.test.ts new file mode 100644 index 00000000000..76b8922668f --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.test.ts @@ -0,0 +1,236 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { theme as antdTheme } from 'antd'; +import { + getFontSize, + getColorVariants, + isThemeDark, + isThemeConfigDark, +} from './themeUtils'; +import { Theme } from '../Theme'; +import { ThemeAlgorithm } from '../types'; + +// Mock emotion's cache to avoid actual DOM operations +jest.mock('@emotion/cache', () => ({ + __esModule: true, + default: jest.fn().mockReturnValue({}), +})); + +let lightTheme: Theme; +let darkTheme: Theme; + +beforeEach(() => { + jest.clearAllMocks(); + + // Create actual theme instances for testing + lightTheme = Theme.fromConfig({ + token: { + colorPrimary: '#1890ff', + fontSizeXS: '8', + fontSize: '14', + fontSizeLG: '16', + }, + }); + + darkTheme = Theme.fromConfig({ + algorithm: ThemeAlgorithm.DARK, + token: { + colorPrimary: '#1890ff', + fontSizeXS: '8', + fontSize: '14', + fontSizeLG: '16', + }, + }); +}); + +test('getFontSize returns correct font size for given key', () => { + expect(getFontSize(lightTheme.theme, 'xs')).toBe('8'); + expect(getFontSize(lightTheme.theme, 'm')).toBe('14'); + expect(getFontSize(lightTheme.theme, 'l')).toBe('16'); +}); + +test('getFontSize defaults to medium font size when no key is provided', () => { + expect(getFontSize(lightTheme.theme)).toBe('14'); +}); + +test('getFontSize uses antd default when specific size not overridden', () => { + // Create theme with minimal config - antd will provide defaults + const minimalTheme = Theme.fromConfig({ + token: { fontSize: '14' }, + }); + + expect(getFontSize(minimalTheme.theme, 'xs')).toBe('14'); + expect(getFontSize(minimalTheme.theme, 'm')).toBe('14'); +}); + +test('isThemeDark returns false for light theme', () => { + expect(isThemeDark(lightTheme.theme)).toBe(false); +}); + +test('isThemeDark returns true for dark theme', () => { + expect(isThemeDark(darkTheme.theme)).toBe(true); +}); + +test('getColorVariants returns correct variants for primary color', () => { + const variants = getColorVariants(lightTheme.theme, 'primary'); + + expect(variants.text).toBeDefined(); + expect(variants.bg).toBeDefined(); + expect(variants.border).toBeDefined(); + expect(variants.active).toBeDefined(); +}); + +test('getColorVariants returns grayscale variants for default color in light theme', () => { + const variants = getColorVariants(lightTheme.theme, 'default'); + + expect(variants.active).toBe('#222'); + expect(variants.textActive).toBe('#444'); + expect(variants.text).toBe('#555'); + expect(variants.bg).toBe('#F4F4F4'); +}); + +test('getColorVariants returns inverted grayscale variants for default color in dark theme', () => { + const variants = getColorVariants(darkTheme.theme, 'default'); + + // In dark theme, colors should be inverted + expect(variants.active).toBe('#dddddd'); // Inverted #222 + expect(variants.textActive).toBe('#bbbbbb'); // Inverted #444 + expect(variants.text).toBe('#aaaaaa'); // Inverted #555 +}); + +test('getColorVariants returns same variants for grayscale color as default', () => { + const defaultVariants = getColorVariants(lightTheme.theme, 'default'); + const grayscaleVariants = getColorVariants(lightTheme.theme, 'grayscale'); + + expect(defaultVariants).toEqual(grayscaleVariants); +}); + +test('getColorVariants handles missing color tokens gracefully', () => { + const variants = getColorVariants(lightTheme.theme, 'nonexistent'); + + // Should return undefined for missing tokens + expect(variants.active).toBeUndefined(); + expect(variants.text).toBeUndefined(); + expect(variants.bg).toBeUndefined(); +}); + +test('isThemeConfigDark returns true for config with dark algorithm', () => { + const config = { + algorithm: antdTheme.darkAlgorithm, + }; + expect(isThemeConfigDark(config)).toBe(true); +}); + +test('isThemeConfigDark returns true for config with dark algorithm in array', () => { + const config = { + algorithm: [antdTheme.darkAlgorithm, antdTheme.compactAlgorithm], + }; + expect(isThemeConfigDark(config)).toBe(true); +}); + +test('isThemeConfigDark returns false for config without dark algorithm', () => { + const config = { + algorithm: antdTheme.defaultAlgorithm, + }; + expect(isThemeConfigDark(config)).toBe(false); +}); + +test('isThemeConfigDark returns false for config with no algorithm', () => { + const config = { + token: { + colorPrimary: '#1890ff', + }, + }; + expect(isThemeConfigDark(config)).toBe(false); +}); + +test('isThemeConfigDark detects manually-created dark theme without dark algorithm', () => { + // This is the edge case: dark colors without dark algorithm + const config = { + token: { + colorBgContainer: '#1a1a1a', // Dark background + colorBgBase: '#0a0a0a', // Dark base + colorText: '#ffffff', // Light text + }, + }; + expect(isThemeConfigDark(config)).toBe(true); +}); + +test('isThemeConfigDark does not false-positive on light theme with custom colors', () => { + const config = { + token: { + colorBgContainer: '#ffffff', // Light background + colorBgBase: '#f5f5f5', // Light base + colorText: '#000000', // Dark text + }, + }; + expect(isThemeConfigDark(config)).toBe(false); +}); + +test('isThemeConfigDark handles partial color tokens gracefully', () => { + // With actual theme computation, a dark colorBgContainer results in a dark theme + const config = { + token: { + colorBgContainer: '#1a1a1a', // Dark background + // Missing other color tokens + }, + }; + expect(isThemeConfigDark(config)).toBe(true); +}); + +test('isThemeConfigDark respects colorBgContainer as the primary indicator', () => { + // The computed theme uses colorBgContainer as the main background + const darkConfig = { + token: { + colorBgContainer: '#1a1a1a', // Dark background + colorText: '#000000', // Dark text (unusual but doesn't override) + }, + }; + expect(isThemeConfigDark(darkConfig)).toBe(true); + + const lightConfig = { + token: { + colorBgContainer: '#ffffff', // Light background + colorText: '#ffffff', // Light text (unusual but doesn't override) + }, + }; + expect(isThemeConfigDark(lightConfig)).toBe(false); +}); + +test('isThemeConfigDark handles non-string color tokens gracefully', () => { + const config = { + token: { + colorBgContainer: undefined, + colorText: null, + colorBgBase: 123, // Invalid type + }, + }; + expect(isThemeConfigDark(config)).toBe(false); +}); + +test('isThemeConfigDark returns false for empty config', () => { + expect(isThemeConfigDark({})).toBe(false); +}); + +test('isThemeConfigDark returns false for config with empty token object', () => { + const config = { + token: {}, + }; + expect(isThemeConfigDark(config)).toBe(false); +}); diff --git a/superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.ts b/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.ts similarity index 98% rename from superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.ts rename to superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.ts index a896a7b5fad..041f9a72844 100644 --- a/superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.ts +++ b/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.ts @@ -25,7 +25,7 @@ import type { ColorVariants, AnyThemeConfig, } from '../types'; -import { normalizeThemeConfig } from '../utils'; +import { normalizeThemeConfig } from '.'; const fontSizeMap: Record = { xs: 'fontSizeXS', diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/utils.test.ts b/superset-frontend/packages/superset-core/src/ui/theme/utils/utils.test.ts new file mode 100644 index 00000000000..20603d81a1d --- /dev/null +++ b/superset-frontend/packages/superset-core/src/ui/theme/utils/utils.test.ts @@ -0,0 +1,338 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { theme as antdThemeImport } from 'antd'; +import { + isSerializableConfig, + deserializeThemeConfig, + serializeThemeConfig, + normalizeThemeConfig, + getAntdConfig, + getSystemColors, +} from '.'; +import { + type AnyThemeConfig, + type SerializableThemeConfig, + type AntdThemeConfig, + ThemeAlgorithm, +} from '../types'; + +test('isSerializableConfig returns true when algorithm is undefined', () => { + const config: AnyThemeConfig = { + token: { colorPrimary: '#ff0000' }, + }; + + expect(isSerializableConfig(config)).toBe(true); +}); + +test('isSerializableConfig returns true when algorithm is a string', () => { + const config: AnyThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.DARK, + }; + + expect(isSerializableConfig(config)).toBe(true); +}); + +test('isSerializableConfig returns true when algorithm is an array of strings', () => { + const config: AnyThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: [ThemeAlgorithm.DARK, ThemeAlgorithm.COMPACT], + }; + + expect(isSerializableConfig(config)).toBe(true); +}); + +test('isSerializableConfig returns false when algorithm is a function', () => { + const config: AnyThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.darkAlgorithm, + }; + + expect(isSerializableConfig(config)).toBe(false); +}); + +test('isSerializableConfig returns false when algorithm is an array containing a function', () => { + const config: AnyThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: [ + antdThemeImport.darkAlgorithm, + antdThemeImport.compactAlgorithm, + ], + }; + + expect(isSerializableConfig(config)).toBe(false); +}); + +test('deserializeThemeConfig converts string algorithm to function reference', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.DARK, + }; + + const result = deserializeThemeConfig(config); + + expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); +}); + +test('deserializeThemeConfig converts array of string algorithms to function references', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: [ThemeAlgorithm.DARK, ThemeAlgorithm.COMPACT], + }; + + const result = deserializeThemeConfig(config); + + expect(Array.isArray(result.algorithm)).toBe(true); + expect(result.algorithm).toContain(antdThemeImport.darkAlgorithm); + expect(result.algorithm).toContain(antdThemeImport.compactAlgorithm); +}); + +test('deserializeThemeConfig preserves other configuration properties', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.DARK, + hashed: true, + }; + + const result = deserializeThemeConfig(config); + + expect(result.token).toEqual({ colorPrimary: '#ff0000' }); + expect(result.hashed).toBe(true); +}); + +test('deserializeThemeConfig handles undefined algorithm', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + }; + + const result = deserializeThemeConfig(config); + + expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); +}); + +test('deserializeThemeConfig converts default algorithm string to function reference', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.DEFAULT, + }; + + const result = deserializeThemeConfig(config); + + expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); +}); + +test('deserializeThemeConfig converts compact algorithm string to function reference', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.COMPACT, + }; + + const result = deserializeThemeConfig(config); + + expect(result.algorithm).toBe(antdThemeImport.compactAlgorithm); +}); + +test('serializeThemeConfig converts function algorithm to string', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.darkAlgorithm, + }; + + const result = serializeThemeConfig(config); + + expect(result.algorithm).toBe(ThemeAlgorithm.DARK); +}); + +test('serializeThemeConfig converts array of function algorithms to strings', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: [ + antdThemeImport.darkAlgorithm, + antdThemeImport.compactAlgorithm, + ], + }; + + const result = serializeThemeConfig(config); + + expect(Array.isArray(result.algorithm)).toBe(true); + expect(result.algorithm).toContain(ThemeAlgorithm.DARK); + expect(result.algorithm).toContain(ThemeAlgorithm.COMPACT); +}); + +test('serializeThemeConfig preserves other configuration properties', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.darkAlgorithm, + hashed: true, + }; + + const result = serializeThemeConfig(config); + + expect(result.token).toEqual({ colorPrimary: '#ff0000' }); + expect(result.hashed).toBe(true); +}); + +test('serializeThemeConfig handles undefined algorithm', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + }; + + const result = serializeThemeConfig(config); + + expect(result.algorithm).toBeUndefined(); +}); + +test('serializeThemeConfig defaults to "default" for unknown algorithms', () => { + const unknownAlgorithm = () => ({}); + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + // @ts-ignore + algorithm: unknownAlgorithm, + }; + + const result = serializeThemeConfig(config); + + expect(result.algorithm).toBe(ThemeAlgorithm.DEFAULT); +}); + +test('serializeThemeConfig converts default algorithm function to string', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.defaultAlgorithm, + }; + + const result = serializeThemeConfig(config); + + expect(result.algorithm).toBe(ThemeAlgorithm.DEFAULT); +}); + +test('serializeThemeConfig converts compact algorithm function to string', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.compactAlgorithm, + }; + + const result = serializeThemeConfig(config); + + expect(result.algorithm).toBe(ThemeAlgorithm.COMPACT); +}); + +test('serializeThemeConfig defaults each unknown algorithm in array to "default"', () => { + const unknownAlgorithm = () => ({}); + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + // @ts-ignore + algorithm: [antdThemeImport.darkAlgorithm, unknownAlgorithm], + }; + + const result = serializeThemeConfig(config); + + expect(Array.isArray(result.algorithm)).toBe(true); + expect(result.algorithm).toEqual([ + ThemeAlgorithm.DARK, + ThemeAlgorithm.DEFAULT, + ]); +}); + +test('serializeThemeConfig handles mixed known and unknown algorithms in array', () => { + const unknownAlgorithm1 = () => ({}); + const unknownAlgorithm2 = () => ({}); + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: [ + antdThemeImport.darkAlgorithm, + // @ts-ignore + unknownAlgorithm1, + antdThemeImport.compactAlgorithm, + // @ts-ignore + unknownAlgorithm2, + ], + }; + + const result = serializeThemeConfig(config); + + expect(Array.isArray(result.algorithm)).toBe(true); + expect(result.algorithm).toEqual([ + ThemeAlgorithm.DARK, + ThemeAlgorithm.DEFAULT, + ThemeAlgorithm.COMPACT, + ThemeAlgorithm.DEFAULT, + ]); +}); + +test('normalizeThemeConfig returns the same config for non-serializable configs', () => { + const config: AntdThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: antdThemeImport.darkAlgorithm, + }; + + const result = normalizeThemeConfig(config); + + expect(result).toBe(config); +}); + +test('normalizeThemeConfig deserializes serializable configs', () => { + const config: SerializableThemeConfig = { + token: { colorPrimary: '#ff0000' }, + algorithm: ThemeAlgorithm.DARK, + }; + + const result = normalizeThemeConfig(config); + + expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); +}); + +test('getAntdConfig returns config with default algorithm for light mode', () => { + const seed = { colorPrimary: '#ff0000' }; + + const result = getAntdConfig(seed, false); + + expect(result.token).toBe(seed); + expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); +}); + +test('getAntdConfig returns config with dark algorithm for dark mode', () => { + const seed = { colorPrimary: '#ff0000' }; + + const result = getAntdConfig(seed, true); + + expect(result.token).toBe(seed); + expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); +}); + +test('getSystemColors extracts system colors from tokens', () => { + const tokens = { + colorPrimary: '#primary', + colorError: '#error', + colorWarning: '#warning', + colorSuccess: '#success', + colorInfo: '#info', + otherToken: 'ignore-me', + }; + + const result = getSystemColors(tokens); + + expect(result).toEqual({ + colorPrimary: '#primary', + colorError: '#error', + colorWarning: '#warning', + colorSuccess: '#success', + colorInfo: '#info', + }); +}); diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx index 18cedfbca9a..55ddae91e9c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx @@ -17,7 +17,8 @@ * under the License. */ import { kebabCase } from 'lodash'; -import { t, useTheme, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme, styled } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; interface CertifiedIconWithTooltipProps { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx index 763bf0a7d11..1fc55b7b09b 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; -import { css, styled, SupersetTheme } from '@superset-ui/core'; +import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; import { SafeMarkdown, Tooltip, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx index 93c967a2ca3..94984be4888 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx @@ -18,7 +18,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { ClockCircleOutlined, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx index 2779c01aa6b..d725dcb9efb 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { InfoTooltip, Tooltip, Icons } from '@superset-ui/core/components'; type ValidationError = string; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx index 39d6a3b6a5d..456faf6ba01 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; export const ControlSubSectionHeader = styled.div` ${({ theme }) => css` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx index e33c3b73e0e..bf24d1279f5 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx @@ -18,7 +18,8 @@ */ import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; -import { css, styled, Metric, SupersetTheme } from '@superset-ui/core'; +import { Metric } from '@superset-ui/core'; +import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; import { SafeMarkdown, Typography, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx index 42d88901c72..09cbc387723 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx @@ -22,7 +22,8 @@ import { SQLEditor, } from '@superset-ui/core/components'; import { CalculatorOutlined } from '@ant-design/icons'; -import { css, styled, useTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; const StyledCalculatorIcon = styled(CalculatorOutlined)` ${({ theme }) => css` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx index 6d371afcc4e..edf17053380 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx @@ -18,7 +18,8 @@ */ import { ReactNode, RefObject } from 'react'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { ColumnMeta, Metric } from '@superset-ui/chart-controls'; const TooltipSectionWrapper = styled.div` diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx index 9f704f3c362..ece0f3879fe 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx @@ -18,7 +18,7 @@ */ import { t } from '@superset-ui/core'; -import { SupersetTheme } from '../..'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { FallbackPropsWithDimension } from './SuperChart'; export type Props = FallbackPropsWithDimension; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx index 08205c0b9b0..1528680cb44 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx @@ -19,7 +19,7 @@ import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { ThemeProvider, supersetTheme } from '../../..'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; import MatrixifyGridCell from './MatrixifyGridCell'; import { MatrixifyGridCell as MatrixifyGridCellType } from '../../types/matrixify'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx index 838460d2c35..4232b102918 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx @@ -18,7 +18,7 @@ */ import { memo, useMemo } from 'react'; -import { styled, useTheme } from '../../../theme'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { MatrixifyGridCell as GridCellData } from '../../types/matrixify'; import StatefulChart from '../StatefulChart'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx index d56bf8f6926..1ba393f122f 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx @@ -19,10 +19,10 @@ import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { ThemeProvider } from '@superset-ui/core'; +import { ThemeProvider } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core'; import MatrixifyGridRenderer from './MatrixifyGridRenderer'; import { generateMatrixifyGrid } from './MatrixifyGridGenerator'; -import { supersetTheme } from '../../../theme'; // Mock the MatrixifyGridGenerator jest.mock('./MatrixifyGridGenerator', () => ({ diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx index 58939477ee1..6d6e53b9031 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; -import { styled } from '../../../theme'; +import { styled } from '@apache-superset/core/ui'; import { MatrixifyFormData } from '../../types/matrixify'; import { generateMatrixifyGrid } from './MatrixifyGridGenerator'; import MatrixifyGridCell from './MatrixifyGridCell'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx index 3bcb3e3a89a..63c33638c4f 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx @@ -18,7 +18,7 @@ */ import { CSSProperties } from 'react'; -import { css, styled } from '../../theme'; +import { css, styled } from '@apache-superset/core/ui'; import { t } from '../../translation'; const MESSAGE_STYLES: CSSProperties = { maxWidth: 800 }; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts b/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts index c9bc2bea669..77727e471fd 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts +++ b/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts @@ -19,6 +19,7 @@ import { RefObject } from 'react'; import { createSelector, lruMemoize } from 'reselect'; +import { supersetTheme, SupersetTheme } from '@apache-superset/core/ui'; import { AppSection, Behavior, @@ -34,7 +35,6 @@ import { SetDataMaskHook, } from '../types/Base'; import { QueryData, DataRecordFilters } from '..'; -import { supersetTheme, SupersetTheme } from '../../theme'; // TODO: more specific typing for these fields of ChartProps type AnnotationData = PlainObject; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx index 38ccdda399f..4d2d19c01c5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx @@ -23,7 +23,7 @@ import { type TooltipPlacement, type IconType, } from '@superset-ui/core/components'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; export interface ActionProps { label: string; diff --git a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx index bdd9df81046..7609ab75274 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx @@ -31,7 +31,7 @@ import { AsyncEsmComponent, PlaceholderProps, } from '@superset-ui/core/components/AsyncEsmComponent'; -import { useTheme, css } from '@superset-ui/core'; +import { useTheme, css } from '@apache-superset/core/ui'; import { Global } from '@emotion/react'; export { getTooltipHTML } from './Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx index b20a05e8224..adf0011627a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Badge as AntdBadge } from 'antd'; import type { BadgeProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx index e4bf6a0c30f..6d90ef2fd08 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx @@ -19,7 +19,7 @@ import { Children, ReactElement, Fragment } from 'react'; import cx from 'classnames'; import { Button as AntdButton } from 'antd'; -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '../Tooltip'; import type { ButtonColorType, diff --git a/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx index cc2242ca530..5a34f1a4880 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Card as AntdCard } from 'antd'; import type { CardProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx index 4eff6bf4d50..03413e906d4 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; import type { CertifiedBadgeProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx b/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx index d6c7e2a7fb1..77dd457397f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; export const CheckboxChecked = () => { const theme = useTheme(); diff --git a/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx index 9235a3e9e12..0ca6f6c590f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx @@ -20,7 +20,7 @@ import { useEffect, useState } from 'react'; import SyntaxHighlighterBase from 'react-syntax-highlighter/dist/cjs/light'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import tomorrow from 'react-syntax-highlighter/dist/cjs/styles/hljs/tomorrow-night'; -import { useTheme, isThemeDark } from '@superset-ui/core'; +import { isThemeDark, useTheme } from '@apache-superset/core/ui'; export type SupportedLanguage = 'sql' | 'htmlbars' | 'markdown' | 'json'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx b/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx index 9d823707880..bcb00f7abc5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Collapse as AntdCollapse } from 'antd'; import type { CollapseProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx index 6d605a639b1..d0a5d39cd34 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme, css } from '@superset-ui/core'; +import { useTheme, css } from '@apache-superset/core/ui'; import { Typography } from '@superset-ui/core/components/Typography'; import { Icons } from '@superset-ui/core/components'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx index 9a153a08990..65df48b1400 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import { render, screen, userEvent } from '@superset-ui/core/spec'; -import { ThemeProvider, supersetTheme } from '@superset-ui/core'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; import { ConfirmModal } from '.'; const defaultProps = { diff --git a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx index ee26403ee5e..51fb11395b6 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; +import { t } from '@superset-ui/core'; import { Icons, Modal, Typography, Button } from '@superset-ui/core/components'; import type { FC, ReactElement, ReactNode } from 'react'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx index 71f4545eba8..15df60cb250 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import ReactCronPicker from 'react-js-cron'; import type { Locale, CronProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx index efcdad155c1..e26c6140437 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { DatePicker as AntdDatePicker } from 'antd'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import type { DatePickerProps, RangePickerProps } from './types'; export const DatePicker = (props: DatePickerProps) => ( diff --git a/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx index 9bbe0213d0d..2c5efd2f873 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useState, useRef, useEffect, ChangeEvent } from 'react'; import { FormLabel } from '../Form'; import { Input, InputRef } from '../Input'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx index 74b5b85f737..c8e6a85b263 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Divider as AntdDivider } from 'antd'; import type { DividerProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx index 11741bed6f0..19ef2d74bf2 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx @@ -19,7 +19,7 @@ import { ReactElement, cloneElement } from 'react'; import { Dropdown as AntdDropdown, DropdownProps } from 'antd'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { IconOrientation, diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx index 7ad8d3867c4..e3ac5aa9b6f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx @@ -18,7 +18,7 @@ */ import { Dropdown } from 'antd'; import { kebabCase } from 'lodash'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '../Tooltip'; import type { DropdownButtonProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx index ad99b6b00f7..7a92df392df 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx @@ -18,7 +18,7 @@ */ import { useRef, useCallback, useState } from 'react'; import { isEqual } from 'lodash'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Button } from '../Button'; import { Select } from '../Select'; import type { DropdownContainerProps, DropdownRef } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx index 7429abc8d10..475a58d9fe2 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx @@ -30,7 +30,8 @@ import { } from 'react'; import { Global } from '@emotion/react'; -import { css, t, useTheme, usePrevious } from '@superset-ui/core'; +import { t, usePrevious } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { useResizeDetector } from 'react-resize-detector'; import { Badge, Icons, Button, Tooltip, Popover } from '..'; import { DropdownContainerProps, DropdownItem, DropdownRef } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx index dff597f3fa1..7a6ac61669f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx @@ -25,7 +25,8 @@ import { useLayoutEffect, useState, } from 'react'; -import { css, SupersetTheme, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { useResizeDetector } from 'react-resize-detector'; import { Tooltip } from '../Tooltip'; import { Input } from '../Input'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx index 04888923be1..a73c935de31 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { useEffect, useState, useRef } from 'react'; import cx from 'classnames'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx index c8251be11a7..3d8d3d43a73 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode, SyntheticEvent } from 'react'; -import { styled, css, SupersetTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; // Importing svg images import FilterResultsImage from './svgs/filter-results.svg'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx index 24aba3d5c00..b3c3e379460 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx @@ -19,7 +19,8 @@ import { useCallback, useEffect, MouseEvent } from 'react'; -import { css, t, styled, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; import type { FaveStarProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx index d666ee920d0..553a6603b7d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Flex } from '.'; import type { FlexProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx index 31e8b740a64..77f59d90463 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Form } from 'antd'; -import { styled } from '../../theme'; +import { styled } from '@apache-superset/core/ui'; export const FormItem = styled(Form.Item)` ${({ theme }) => ` diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx index f6b3fcbdfd3..209312ae652 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; export type FormLabelProps = { children: ReactNode; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx index b768c764cce..b8f1dc1ef49 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Button, Icons, InfoTooltip, Tooltip, Flex } from '..'; import { Input } from '../Input'; import { FormLabel } from './FormLabel'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx index b8b8a66f3bc..e2cef0ae681 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx @@ -18,7 +18,7 @@ */ // eslint-disable-next-line -import { SupersetTheme, css } from '@superset-ui/core'; +import { SupersetTheme, css } from '@apache-superset/core/ui'; import { Typography } from '../Typography'; import { Icons } from '../Icons'; import { Card } from '../Card'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx index b350c8c24ae..d254c8c4cc2 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { IconTooltip } from '.'; import type { IconTooltipProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx b/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx index 18250f454b1..99374dfcc7c 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css, useTheme, getFontSize } from '../..'; +import { css, useTheme, getFontSize } from '@apache-superset/core/ui'; import { AntdIconType, BaseIconProps, CustomIconType, IconType } from './types'; const genAriaLabel = (fileName: string) => { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx index b008f776064..061c2609c63 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState } from 'react'; -import { styled, supersetTheme } from '@superset-ui/core'; +import { styled, supersetTheme } from '@apache-superset/core/ui'; import { Input } from '../Input'; import { Icons, IconNameType } from '.'; import type { IconType } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx index 9f8dd617907..b2268c22e23 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx @@ -19,7 +19,8 @@ import { KeyboardEvent, useMemo } from 'react'; import { SerializedStyles, CSSObject } from '@emotion/react'; import { kebabCase } from 'lodash'; -import { css, t, useTheme, getFontSize } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme, getFontSize } from '@apache-superset/core/ui'; import { CloseCircleOutlined, InfoCircleOutlined, diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx index 6c37e1d637d..6b311e8808a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx @@ -18,7 +18,7 @@ */ import { Tag } from '@superset-ui/core/components/Tag'; import { css } from '@emotion/react'; -import { useTheme, getColorVariants } from '@superset-ui/core'; +import { useTheme, getColorVariants } from '@apache-superset/core/ui'; import { DatasetTypeLabel } from './reusable/DatasetTypeLabel'; import { PublishedLabel } from './reusable/PublishedLabel'; import type { LabelProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx index a7d96921f6a..eb3866aa73c 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx @@ -17,7 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Label } from '..'; // Define the prop types for DatasetTypeLabel diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx index ffe9fed5313..ecb0977f1d1 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx @@ -17,7 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Label } from '..'; // Define props for the PublishedLabel component diff --git a/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx index 555378ca125..b989b1ad66f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx @@ -18,7 +18,8 @@ */ import { useEffect, useState, FunctionComponent } from 'react'; -import { t, styled, css, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { Dayjs } from 'dayjs'; import { extendedDayjs } from '../../utils/dates'; import 'dayjs/plugin/updateLocale'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/List/index.ts b/superset-frontend/packages/superset-ui-core/src/components/List/index.ts index 7eaccbb8c58..1927d288f75 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/List/index.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/List/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { List as AntdList } from 'antd'; import type { ListProps, ListItemProps, ListItemMetaProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx index 94919dd054c..80520414873 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx @@ -18,7 +18,8 @@ */ import { useEffect, useState, DetailedHTMLProps, HTMLAttributes } from 'react'; -import { styled, logging } from '@superset-ui/core'; +import { logging } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; export type BackgroundPosition = 'top' | 'bottom'; interface ImageContainerProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx index 197659535f8..098aeb210fb 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC } from 'react'; -import { styled, useTheme, css } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { Skeleton } from '../Skeleton'; import { Card } from '../Card'; import { CertifiedBadge } from '../CertifiedBadge'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx index 6b0449a4424..e43a59bed66 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx @@ -18,7 +18,7 @@ */ import { render, screen } from '@superset-ui/core/spec'; -import * as themeModule from '../../theme'; +import * as themeModule from '@apache-superset/core/ui/theme'; import { Loading } from '.'; // Mock the loading SVG import since it's a file stub in tests diff --git a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx index d37e39a5227..92028672942 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx @@ -18,7 +18,7 @@ */ import cls from 'classnames'; -import { styled, useTheme } from '../../theme'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Loading as LoaderSvg } from '../assets'; import type { LoadingProps, SizeOption } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx index f37bc8dd95e..9bdbcd34f67 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { ReactElement } from 'react'; import { Menu as AntdMenu } from 'antd'; import { MenuProps as AntdMenuProps } from 'antd/es/menu'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx index 06ef9170745..e4328578e8e 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; const MetadataWrapper = styled.div` display: flex; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx index 3216ceab80b..6a88d811362 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ensureIsArray, styled, t } from '@superset-ui/core'; +import { ensureIsArray, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { ContentType, MetadataType } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx index 5da711270d6..8f7d0d700dc 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { useResizeDetector } from 'react-resize-detector'; import MetadataBar, { MetadataBarProps, MetadataType } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx index 778df92a276..1a42c264ffa 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx @@ -18,7 +18,8 @@ */ import { render, screen, userEvent, within } from '@superset-ui/core/spec'; import * as resizeDetector from 'react-resize-detector'; -import { supersetTheme, hexToRgb } from '@superset-ui/core'; +import { hexToRgb } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import MetadataBar, { MIN_NUMBER_ITEMS, MAX_NUMBER_ITEMS, diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx index e09e8ba56af..3f0f0e3a07b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx @@ -19,7 +19,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useResizeDetector } from 'react-resize-detector'; import { uniqWith } from 'lodash'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Tooltip } from '../Tooltip'; import { TooltipPlacement } from '../Tooltip/types'; import { ContentType } from './ContentType'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx index 4b63a098c5b..1788dc95b24 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx @@ -18,7 +18,8 @@ */ import { isValidElement, cloneElement, useMemo, useRef, useState } from 'react'; import { isNil } from 'lodash'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Modal as AntdModal, ModalProps as AntdModalProps } from 'antd'; import { Resizable } from 're-resizable'; import Draggable, { diff --git a/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx index 07b608aa8e8..cd523ea6eae 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode, ReactElement } from 'react'; -import { css, SupersetTheme, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import type { DropdownProps } from '../Dropdown/types'; import type { TooltipPlacement } from '../Tooltip/types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx index a6ea94b77b6..927e38399f5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx @@ -18,7 +18,7 @@ */ import { Key } from 'react'; import cx from 'classnames'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Dropdown } from '../Dropdown'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx index 488778905e2..200705247d7 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler, ReactNode } from 'react'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx index 34ed3bcb265..b08caada3f6 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Progress as AntdProgress } from 'antd'; import { ProgressProps } from 'antd/es/progress/progress'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx index 65ba411f1c2..c0453ed038f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Space } from '../Space'; import { Radio, type RadioProps, type RadioGroupWrapperProps } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx index f7a89c5bc3c..0489fad65d6 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler, forwardRef } from 'react'; -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import type { IconType } from '@superset-ui/core/components/Icons/types'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx index 0f83fd8d603..8eaa5d1eeff 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Select } from 'antd'; import { Icons } from '@superset-ui/core/components/Icons'; import { Spin } from '../Spin'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx index cdaee0f35e9..bbf94a1c476 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx @@ -26,7 +26,8 @@ import classNames from 'classnames'; import { useResizeDetector } from 'react-resize-detector'; import { useEffect, useRef, useState, useCallback, CSSProperties } from 'react'; import { VariableSizeGrid as Grid } from 'react-window'; -import { useTheme, styled, safeHtmlSpan } from '@superset-ui/core'; +import { safeHtmlSpan } from '@superset-ui/core'; +import { useTheme, styled } from '@apache-superset/core/ui'; import { TableSize, ETableAction } from './index'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx index b1017f6df8a..e14852255d3 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { MenuDotsDropdown } from '../../../Dropdown'; import { IconOrientation } from '../../../Dropdown/types'; import { Menu, MenuProps } from '../../../Menu'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx index a9ef5d640b6..1e30e9f3523 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '../../../..'; +import { styled } from '@apache-superset/core/ui'; import { Constants } from '../../..'; const GrayCell = styled.span` diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx index 4b48f2bf465..80c1cb7d4ca 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState } from 'react'; -import { css, useTheme } from '../../..'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Icons, Radio, Popover } from '../..'; export interface HeaderWithRadioGroupProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx index 1e2782be27f..ce6b01d1ecd 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx @@ -21,7 +21,8 @@ import { useState, useEffect, useRef, Key, FC } from 'react'; import { Table as AntTable } from 'antd'; import { ColumnsType, TableProps as AntTableProps } from 'antd/es/table'; import { PaginationProps } from 'antd/es/pagination'; -import { t, useTheme, logging, styled } from '@superset-ui/core'; +import { t, logging } from '@superset-ui/core'; +import { useTheme, styled } from '@apache-superset/core/ui'; import { Loading } from '@superset-ui/core/components'; import { RowSelectionType } from 'antd/es/table/interface'; import InteractiveTableUtils from './utils/InteractiveTableUtils'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx index ef0e58a6ea1..e52de1450fa 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx @@ -25,7 +25,7 @@ import { TableBodyPropGetter, TablePropGetter, } from 'react-table'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Table, TableSize } from '@superset-ui/core/components/Table'; import { TableRowSelection, SorterResult } from 'antd/es/table/interface'; import { mapColumns, mapRows } from './utils'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx b/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx index a3d87f7a16f..4544013b34c 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx @@ -18,7 +18,7 @@ */ import { memo, useEffect, useRef, useMemo, useCallback } from 'react'; import { isEqual } from 'lodash'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useFilters, usePagination, useSortBy, useTable } from 'react-table'; import { Empty } from '@superset-ui/core/components'; import TableCollection from '@superset-ui/core/components/TableCollection'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx index edc50623f75..2d99a0593bf 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled, useTheme } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; // eslint-disable-next-line no-restricted-imports import { Tabs as AntdTabs, TabsProps as AntdTabsProps } from 'antd'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx index e534f920e5e..21622b6d796 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx @@ -19,13 +19,13 @@ import { render, screen } from '@superset-ui/core/spec'; import { AgGridReact } from 'ag-grid-react'; import { createRef } from 'react'; -import { ThemeProvider, supersetTheme } from '../../theme'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core'; +import * as themeUtils from '@apache-superset/core/ui/theme/utils/themeUtils'; import { ThemedAgGridReact } from './index'; -import * as themeUtils from '../../theme/utils/themeUtils'; // Mock useThemeMode hook -jest.mock('../../theme/utils/themeUtils', () => ({ - ...jest.requireActual('../../theme/utils/themeUtils'), +jest.mock('@apache-superset/core/ui/theme/utils/themeUtils', () => ({ + ...jest.requireActual('@apache-superset/core/ui/theme/utils/themeUtils'), useThemeMode: jest.fn(() => false), // Default to light mode })); diff --git a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx index b6eb12f9340..7767fbaf037 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx @@ -24,8 +24,7 @@ import { colorSchemeDark, colorSchemeLight, } from 'ag-grid-community'; -import { useTheme } from '../../theme'; -import { useThemeMode } from '../../theme/utils/themeUtils'; +import { useTheme, useThemeMode } from '@apache-superset/core/ui'; // Note: With ag-grid v34's new theming API, CSS files are injected automatically // Do NOT import 'ag-grid-community/styles/ag-grid.css' or theme CSS files diff --git a/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx index 0eaa8e456b6..f9d9a42ed45 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useEffect, useRef, useState } from 'react'; +import { useTheme } from '@apache-superset/core/ui'; import { now, fDuration } from '../../utils/dates'; -import { useTheme } from '../..'; import { Label, Icons, type LabelType } from '..'; export interface TimerProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx index 3d4251aeb85..22622ff9750 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx @@ -19,7 +19,8 @@ import { ReactNode, Key, useMemo } from 'react'; -import { styled, t, useTruncation } from '@superset-ui/core'; +import { t, useTruncation } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; export type TruncatedListProps = { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx index 47fd0f90e3a..7b5a1bfe45a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Typography as AntdTypography } from 'antd'; export type { TitleProps } from 'antd/es/typography/Title'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx index 607eed6f7c0..cb90977e035 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Icons, type IconType, SafeMarkdown, Tooltip } from '..'; export interface WarningIconWithTooltipProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/index.ts b/superset-frontend/packages/superset-ui-core/src/components/index.ts index 55829c0b1c6..64c0a6db1d7 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/index.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/index.ts @@ -28,7 +28,6 @@ export { ConfirmStatusChange, type ConfirmStatusChangeProps, } from './ConfirmStatusChange'; -export { Alert, type AlertProps } from './Alert'; export { CertifiedBadge } from './CertifiedBadge'; export * from './Icons'; export * from './Timer'; diff --git a/superset-frontend/packages/superset-ui-core/src/index.ts b/superset-frontend/packages/superset-ui-core/src/index.ts index ceb5d08c90e..5c0e70e31f4 100644 --- a/superset-frontend/packages/superset-ui-core/src/index.ts +++ b/superset-frontend/packages/superset-ui-core/src/index.ts @@ -28,7 +28,6 @@ export * from './number-format'; export * from './time-format'; export * from './dimension'; export * from './color'; -export * from './theme'; export * from './validator'; export * from './chart'; export * from './chart-composition'; diff --git a/superset-frontend/packages/superset-ui-core/src/spec/index.tsx b/superset-frontend/packages/superset-ui-core/src/spec/index.tsx index 13e280b47b8..34d0d7a03d2 100644 --- a/superset-frontend/packages/superset-ui-core/src/spec/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/spec/index.tsx @@ -20,7 +20,7 @@ import userEvent from '@testing-library/user-event'; import { ReactElement } from 'react'; import { render, RenderOptions } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { themeObject } from '@superset-ui/core'; +import { themeObject } from '@apache-superset/core/ui'; // Define the wrapper component outside const AllTheProviders = ({ children }: { children: React.ReactNode }) => ( diff --git a/superset-frontend/packages/superset-ui-core/src/theme/Theme.test.tsx b/superset-frontend/packages/superset-ui-core/src/theme/Theme.test.tsx deleted file mode 100644 index 7b16e59289a..00000000000 --- a/superset-frontend/packages/superset-ui-core/src/theme/Theme.test.tsx +++ /dev/null @@ -1,788 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { theme as antdThemeImport } from 'antd'; -import { Theme } from './Theme'; -import { AnyThemeConfig, ThemeAlgorithm } from './types'; - -// Mock emotion's cache to avoid actual DOM operations -jest.mock('@emotion/cache', () => ({ - __esModule: true, - default: jest.fn().mockReturnValue({}), -})); - -describe('Theme', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('json', () => { - it('serializes the theme configuration to a JSON string', () => { - const theme = Theme.fromConfig({ - token: { - colorPrimary: '#ff0000', - }, - algorithm: antdThemeImport.darkAlgorithm, - }); - - const jsonString = theme.json(); - const parsedJson = JSON.parse(jsonString); - - expect(parsedJson.token?.colorPrimary).toBe('#ff0000'); - expect(parsedJson.algorithm).toBe(ThemeAlgorithm.DARK); - }); - }); - - describe('fromConfig', () => { - it('creates a theme with Ant Design defaults when no config is provided', () => { - const theme = Theme.fromConfig(); - - // Verify Ant Design default tokens are set - expect(theme.theme.colorPrimary).toBeDefined(); - expect(theme.theme.fontFamily).toBeDefined(); - - // Verify the theme is initialized with semantic color tokens - expect(theme.theme.colorText).toBeDefined(); - expect(theme.theme.colorBgBase).toBeDefined(); - }); - - it('creates a theme with custom tokens when provided', () => { - const customConfig: AnyThemeConfig = { - token: { - colorPrimary: '#ff0000', - fontFamily: 'CustomFont, sans-serif', - }, - }; - - const theme = Theme.fromConfig(customConfig); - - // Verify custom primary color is set - expect(theme.theme.colorPrimary).toBe('#ff0000'); - - // Verify custom font family is set - expect(theme.theme.fontFamily).toBe('CustomFont, sans-serif'); - - // Unspecified values will use Ant Design defaults - expect(theme.theme.colorError).toBeDefined(); - }); - - it('creates a theme with dark mode when dark algorithm is specified', () => { - const darkConfig: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - }; - - const theme = Theme.fromConfig(darkConfig); - - // Verify dark mode by using the serialized config from the public method - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - }); - - describe('setConfig', () => { - it('updates theme with a new configuration', () => { - const theme = Theme.fromConfig(); - const initialPrimaryColor = theme.theme.colorPrimary; - - // Update with new config - theme.setConfig({ - token: { - colorPrimary: '#0000ff', - }, - }); - - // Verify the theme was updated - expect(theme.theme.colorPrimary).toBe('#0000ff'); - expect(theme.theme.colorPrimary).not.toBe(initialPrimaryColor); - }); - - it('preserves default tokens when updating with partial config', () => { - const theme = Theme.fromConfig(); - const initialErrorColor = theme.theme.colorError; - - // Update with new config that doesn't specify error color - theme.setConfig({ - token: { - colorPrimary: '#0000ff', - }, - }); - - // Verify the error color is preserved - expect(theme.theme.colorError).toBe(initialErrorColor); - }); - - it('correctly applies algorithm changes', () => { - const theme = Theme.fromConfig(); - - // Change to dark mode via config - theme.setConfig({ - algorithm: antdThemeImport.darkAlgorithm, - }); - - // Verify the algorithm was updated - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - }); - - describe('toggleDarkMode', () => { - it('switches to dark algorithm when toggling dark mode on', () => { - const theme = Theme.fromConfig(); - - // Toggle dark mode on - theme.toggleDarkMode(true); - - // Verify dark algorithm is used - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('switches to default algorithm when toggling dark mode off', () => { - // Start with dark theme - const theme = Theme.fromConfig({ - algorithm: antdThemeImport.darkAlgorithm, - }); - - // Toggle dark mode off - theme.toggleDarkMode(false); - - // Verify default algorithm is used - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); - }); - - it('preserves other algorithms when toggling dark mode', () => { - // Start with compact and dark algorithms - const theme = Theme.fromConfig({ - algorithm: [ - antdThemeImport.compactAlgorithm, - antdThemeImport.darkAlgorithm, - ], - }); - - // Toggle dark mode off - theme.toggleDarkMode(false); - - // Verify default algorithm replaces dark but compact is preserved - const serialized = theme.toSerializedConfig(); - - expect(Array.isArray(serialized.algorithm)).toBe(true); - expect(serialized.algorithm).toContain(ThemeAlgorithm.DEFAULT); - expect(serialized.algorithm).toContain(ThemeAlgorithm.COMPACT); - expect(serialized.algorithm).not.toContain(ThemeAlgorithm.DARK); - }); - }); - - describe('toSerializedConfig', () => { - it('serializes theme config correctly', () => { - const theme = Theme.fromConfig({ - token: { - colorPrimary: '#ff0000', - }, - algorithm: antdThemeImport.darkAlgorithm, - }); - - const serialized = theme.toSerializedConfig(); - - expect(serialized.token?.colorPrimary).toBe('#ff0000'); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - }); - - describe('fromConfig with baseTheme', () => { - it('applies base theme tokens under the main config', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#ff0000', - colorError: '#00ff00', - fontFamily: 'BaseFont', - }, - }; - - const userConfig: AnyThemeConfig = { - token: { - colorPrimary: '#0000ff', - }, - }; - - const theme = Theme.fromConfig(userConfig, baseTheme); - - // User config overrides base theme - expect(theme.theme.colorPrimary).toBe('#0000ff'); - - // Base theme tokens are preserved when not overridden - expect(theme.theme.colorError).toBe('#00ff00'); - expect(theme.theme.fontFamily).toBe('BaseFont'); - }); - - it('applies base theme when no user config is provided', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#ff0000', - fontFamily: 'TestFont', - }, - algorithm: antdThemeImport.darkAlgorithm, - }; - - const theme = Theme.fromConfig(undefined, baseTheme); - - // Color may be transformed by dark algorithm, check fontFamily instead - expect(theme.theme.fontFamily).toBe('TestFont'); - - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('handles empty config with base theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#ff0000', - }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const emptyConfig: AnyThemeConfig = {}; - - const theme = Theme.fromConfig(emptyConfig, baseTheme); - - // Base theme tokens should be applied - expect(theme.theme.colorPrimary).toBe('#ff0000'); - - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); - }); - - it('merges algorithms correctly with base theme', () => { - const baseTheme: AnyThemeConfig = { - algorithm: antdThemeImport.compactAlgorithm, - }; - - const userConfig: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - }; - - const theme = Theme.fromConfig(userConfig, baseTheme); - - // User algorithm should override base algorithm - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('merges component overrides with base theme', () => { - const baseTheme: AnyThemeConfig = { - components: { - Button: { - colorPrimary: '#basebutton', - }, - Input: { - colorBorder: '#baseinput', - }, - }, - }; - - const userConfig: AnyThemeConfig = { - components: { - Button: { - colorPrimary: '#userbutton', - }, - }, - }; - - const theme = Theme.fromConfig(userConfig, baseTheme); - const serialized = theme.toSerializedConfig(); - - // User component config overrides base - expect(serialized.components?.Button?.colorPrimary).toBe('#userbutton'); - - // Base component config preserved when not overridden - expect(serialized.components?.Input?.colorBorder).toBe('#baseinput'); - }); - - it('handles undefined config and undefined base theme', () => { - const theme = Theme.fromConfig(undefined, undefined); - - // Should get Ant Design defaults - expect(theme.theme.colorPrimary).toBeDefined(); - expect(theme.theme.fontFamily).toBeDefined(); - }); - - it('preserves custom tokens in base theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#ff0000', - // Custom superset-specific tokens - brandLogoAlt: 'CustomLogo', - menuHoverBackgroundColor: '#00ff00', - } as Record, - }; - - const theme = Theme.fromConfig({}, baseTheme); - - // Standard token - expect(theme.theme.colorPrimary).toBe('#ff0000'); - - // Custom tokens should be preserved - expect((theme.theme as any).brandLogoAlt).toBe('CustomLogo'); - expect((theme.theme as any).menuHoverBackgroundColor).toBe('#00ff00'); - }); - }); - - describe('edge cases with base theme and dark mode', () => { - it('correctly applies base theme tokens in dark mode', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#1890ff', - fontFamily: 'TestFont', - }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const baseThemeDark: AnyThemeConfig = { - ...baseTheme, - algorithm: antdThemeImport.darkAlgorithm, - }; - - // Simulate light mode with base theme - const lightTheme = Theme.fromConfig({}, baseTheme); - expect(lightTheme.theme.colorPrimary).toBe('#1890ff'); - expect(lightTheme.theme.fontFamily).toBe('TestFont'); - - // Simulate dark mode with base theme dark - const darkTheme = Theme.fromConfig({}, baseThemeDark); - // Dark algorithm transforms colors, but fontFamily should be preserved - expect(darkTheme.theme.fontFamily).toBe('TestFont'); - - // Verify the algorithm is different - const lightSerialized = lightTheme.toSerializedConfig(); - const darkSerialized = darkTheme.toSerializedConfig(); - expect(lightSerialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); - expect(darkSerialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('handles switching from custom theme back to base theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#1890ff', - }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - // First apply custom theme - const customConfig: AnyThemeConfig = { - token: { - colorPrimary: '#52c41a', - }, - }; - const themeWithCustom = Theme.fromConfig(customConfig, baseTheme); - expect(themeWithCustom.theme.colorPrimary).toBe('#52c41a'); - - // Then switch back to empty config (simulating removal of custom theme) - const themeWithEmpty = Theme.fromConfig({}, baseTheme); - expect(themeWithEmpty.theme.colorPrimary).toBe('#1890ff'); - - // Verify they produce different outputs - expect(themeWithCustom.theme.colorPrimary).not.toBe( - themeWithEmpty.theme.colorPrimary, - ); - }); - - it('handles algorithm-only config with base theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - fontFamily: 'TestFont', - borderRadius: 8, - }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - // Config that only specifies algorithm (common for THEME_DARK) - const algorithmOnlyConfig: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - }; - - const theme = Theme.fromConfig(algorithmOnlyConfig, baseTheme); - - // Should have base theme tokens - expect(theme.theme.fontFamily).toBe('TestFont'); - expect(theme.theme.borderRadius).toBe(8); - - // Should have user's algorithm - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - }); - - describe('base theme integration tests', () => { - it('merges base theme tokens with empty user theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - colorError: '#e04355', - fontFamily: 'Inter, Helvetica', - }, - }; - - const userTheme: AnyThemeConfig = { - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - - expect(theme.theme.colorPrimary).toBe('#2893B3'); - expect(theme.theme.colorError).toBe('#e04355'); - expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); - - // Should have user's algorithm - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DEFAULT); - }); - - it('allows user theme to override specific base theme tokens', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - colorError: '#e04355', - fontFamily: 'Inter, Helvetica', - borderRadius: 4, - }, - }; - - const userTheme: AnyThemeConfig = { - algorithm: antdThemeImport.defaultAlgorithm, - token: { - colorPrimary: '#123456', // Override primary color - // Leave other tokens from base - }, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - - // User override should win - expect(theme.theme.colorPrimary).toBe('#123456'); - - // Base theme tokens should be preserved - expect(theme.theme.colorError).toBe('#e04355'); - expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); - expect(theme.theme.borderRadius).toBe(4); - }); - - it('handles base theme with dark algorithm correctly', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - fontFamily: 'Inter, Helvetica', - }, - }; - - const baseThemeDark: AnyThemeConfig = { - ...baseTheme, - algorithm: antdThemeImport.darkAlgorithm, - }; - - const userDarkTheme: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - }; - - const theme = Theme.fromConfig(userDarkTheme, baseThemeDark); - - // Should have base tokens - expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); - - // Should be in dark mode - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('works with real-world Superset base theme configuration', () => { - // Simulate actual Superset base theme (THEME_DEFAULT/THEME_DARK from config) - const supersetBaseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - colorError: '#e04355', - colorWarning: '#fcc700', - colorSuccess: '#5ac189', - colorInfo: '#66bcfe', - fontFamily: "'Inter', Helvetica, Arial", - fontFamilyCode: "'Fira Code', 'Courier New', monospace", - }, - }; - - // Simulate THEME_DEFAULT from config - const themeDefault: AnyThemeConfig = { - algorithm: antdThemeImport.defaultAlgorithm, - }; - - // Simulate THEME_DARK from config - const themeDark: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - }; - - // Test light mode - const lightTheme = Theme.fromConfig(themeDefault, supersetBaseTheme); - expect(lightTheme.theme.colorPrimary).toBe('#2893B3'); - expect(lightTheme.theme.fontFamily).toBe("'Inter', Helvetica, Arial"); - - // Test dark mode - const darkTheme = Theme.fromConfig(themeDark, { - ...supersetBaseTheme, - algorithm: antdThemeImport.darkAlgorithm, - }); - expect(darkTheme.theme.fontFamily).toBe("'Inter', Helvetica, Arial"); - - const darkSerialized = darkTheme.toSerializedConfig(); - expect(darkSerialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('handles component overrides in base theme', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - }, - components: { - Button: { - primaryColor: '#custom-button', - borderRadius: 8, - }, - }, - }; - - const userTheme: AnyThemeConfig = { - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - - // Should preserve component overrides - const serialized = theme.toSerializedConfig(); - expect(serialized.components?.Button?.primaryColor).toBe( - '#custom-button', - ); - expect(serialized.components?.Button?.borderRadius).toBe(8); - }); - - it('properly handles algorithm property override', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const userTheme: AnyThemeConfig = { - algorithm: antdThemeImport.darkAlgorithm, - token: { - borderRadius: 8, - }, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - const serialized = theme.toSerializedConfig(); - - // User algorithm should override base algorithm - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - - // Both base and user tokens should be merged - expect(serialized.token?.colorPrimary).toBeTruthy(); - expect(serialized.token?.borderRadius).toBe(8); - }); - - it('handles cssVar, hashed and inherit properties correctly', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - }, - cssVar: true, - hashed: false, - }; - - const userTheme: AnyThemeConfig = { - token: { - borderRadius: 8, - }, - inherit: true, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - const serialized = theme.toSerializedConfig(); - - // User properties override/add to base - expect(serialized.inherit).toBe(true); - expect(serialized.cssVar).toBe(true); - expect(serialized.hashed).toBe(false); - - // Tokens are still merged - expect(serialized.token?.colorPrimary).toBeTruthy(); - expect(serialized.token?.borderRadius).toBe(8); - }); - - it('merges nested component styles correctly', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - fontFamily: 'BaseFont', - }, - components: { - Button: { - colorPrimary: '#basebutton', - fontSize: 14, - }, - Input: { - colorBorder: '#baseinput', - }, - }, - }; - - const userTheme: AnyThemeConfig = { - token: { - borderRadius: 8, - }, - components: { - Button: { - fontSize: 16, // Override Button fontSize - }, - Select: { - colorBorder: '#userselect', // Add new component - }, - }, - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - const serialized = theme.toSerializedConfig(); - - // Tokens should be merged - // Note: components present may affect color transformation - expect(serialized.token?.colorPrimary).toBeTruthy(); - expect(serialized.token?.borderRadius).toBe(8); - expect(serialized.token?.fontFamily).toBe('BaseFont'); - - // Components should be merged (shallow merge per component) - expect(serialized.components?.Button?.colorPrimary).toBe('#basebutton'); - expect(serialized.components?.Button?.fontSize).toBe(16); // User override - expect(serialized.components?.Input?.colorBorder).toBe('#baseinput'); - expect(serialized.components?.Select?.colorBorder).toBe('#userselect'); - }); - - it('setConfig replaces theme config entirely (does not preserve base theme)', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - fontFamily: 'Inter', - }, - }; - - const theme = Theme.fromConfig({}, baseTheme); - - expect(theme.theme.colorPrimary).toBe('#2893B3'); - expect(theme.theme.fontFamily).toBe('Inter'); - - // Update config (simulating theme change) - theme.setConfig({ - token: { - colorPrimary: '#654321', - }, - algorithm: antdThemeImport.darkAlgorithm, - }); - - // setConfig replaces the entire config, so base theme is NOT preserved - // This is expected behavior - setConfig is for complete replacement - expect(theme.theme.colorPrimary).toBeTruthy(); - // fontFamily reverts to Ant Design default since base theme is not reapplied - expect(theme.theme.fontFamily).not.toBe('Inter'); - }); - - it('minimal theme preserves ALL base theme tokens except overridden ones', () => { - // Simulate a comprehensive base theme with many tokens - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - colorError: '#e04355', - colorWarning: '#fcc700', - colorSuccess: '#5ac189', - colorInfo: '#66bcfe', - fontFamily: 'Inter, Helvetica', - fontSize: 14, - borderRadius: 4, - lineWidth: 1, - controlHeight: 32, - // Custom Superset tokens - brandLogoAlt: 'CustomLogo', - menuHoverBackgroundColor: '#eeeeee', - } as Record, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - // Minimal theme that only overrides primary color and algorithm - const minimalTheme: AnyThemeConfig = { - token: { - colorPrimary: '#ff05dd', // Only override this - }, - algorithm: antdThemeImport.darkAlgorithm, // Change to dark - }; - - const theme = Theme.fromConfig(minimalTheme, baseTheme); - - // User's override should apply - expect(theme.theme.colorPrimary).toBe('#ff05dd'); - - // ALL base theme tokens should be preserved - expect(theme.theme.colorError).toBe('#e04355'); - expect(theme.theme.colorWarning).toBe('#fcc700'); - expect(theme.theme.colorSuccess).toBe('#5ac189'); - expect(theme.theme.colorInfo).toBe('#66bcfe'); - expect(theme.theme.fontFamily).toBe('Inter, Helvetica'); - expect(theme.theme.fontSize).toBe(14); - expect(theme.theme.borderRadius).toBe(4); - expect(theme.theme.lineWidth).toBe(1); - expect(theme.theme.controlHeight).toBe(32); - - // Custom tokens should also be preserved - expect((theme.theme as any).brandLogoAlt).toBe('CustomLogo'); - expect((theme.theme as any).menuHoverBackgroundColor).toBe('#eeeeee'); - - // Algorithm should be updated - const serialized = theme.toSerializedConfig(); - expect(serialized.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('arrays in themes are replaced entirely, not merged by index', () => { - const baseTheme: AnyThemeConfig = { - token: { - colorPrimary: '#2893B3', - }, - algorithm: [ - antdThemeImport.compactAlgorithm, - antdThemeImport.defaultAlgorithm, - ], - }; - - const userTheme: AnyThemeConfig = { - algorithm: [antdThemeImport.darkAlgorithm], // Replace with single item array - }; - - const theme = Theme.fromConfig(userTheme, baseTheme); - const serialized = theme.toSerializedConfig(); - - // User's array should completely replace base array - expect(Array.isArray(serialized.algorithm)).toBe(true); - expect(serialized.algorithm).toHaveLength(1); - expect(serialized.algorithm).toContain(ThemeAlgorithm.DARK); - expect(serialized.algorithm).not.toContain(ThemeAlgorithm.COMPACT); - expect(serialized.algorithm).not.toContain(ThemeAlgorithm.DEFAULT); - }); - }); -}); diff --git a/superset-frontend/packages/superset-ui-core/src/theme/utils.test.ts b/superset-frontend/packages/superset-ui-core/src/theme/utils.test.ts deleted file mode 100644 index dc9e1b938b7..00000000000 --- a/superset-frontend/packages/superset-ui-core/src/theme/utils.test.ts +++ /dev/null @@ -1,352 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { theme as antdThemeImport } from 'antd'; -import { - isSerializableConfig, - deserializeThemeConfig, - serializeThemeConfig, - normalizeThemeConfig, - getAntdConfig, - getSystemColors, -} from './utils'; -import { - type AnyThemeConfig, - type SerializableThemeConfig, - type AntdThemeConfig, - ThemeAlgorithm, -} from './types'; - -describe('Theme utilities', () => { - describe('isSerializableConfig', () => { - it('returns true when algorithm is undefined', () => { - const config: AnyThemeConfig = { - token: { colorPrimary: '#ff0000' }, - }; - - expect(isSerializableConfig(config)).toBe(true); - }); - - it('returns true when algorithm is a string', () => { - const config: AnyThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.DARK, - }; - - expect(isSerializableConfig(config)).toBe(true); - }); - - it('returns true when algorithm is an array of strings', () => { - const config: AnyThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: [ThemeAlgorithm.DARK, ThemeAlgorithm.COMPACT], - }; - - expect(isSerializableConfig(config)).toBe(true); - }); - - it('returns false when algorithm is a function', () => { - const config: AnyThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.darkAlgorithm, - }; - - expect(isSerializableConfig(config)).toBe(false); - }); - - it('returns false when algorithm is an array containing a function', () => { - const config: AnyThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: [ - antdThemeImport.darkAlgorithm, - antdThemeImport.compactAlgorithm, - ], - }; - - expect(isSerializableConfig(config)).toBe(false); - }); - }); - - describe('deserializeThemeConfig', () => { - it('converts string algorithm to function reference', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.DARK, - }; - - const result = deserializeThemeConfig(config); - - expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); - }); - - it('converts array of string algorithms to function references', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: [ThemeAlgorithm.DARK, ThemeAlgorithm.COMPACT], - }; - - const result = deserializeThemeConfig(config); - - expect(Array.isArray(result.algorithm)).toBe(true); - expect(result.algorithm).toContain(antdThemeImport.darkAlgorithm); - expect(result.algorithm).toContain(antdThemeImport.compactAlgorithm); - }); - - it('preserves other configuration properties', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.DARK, - hashed: true, - }; - - const result = deserializeThemeConfig(config); - - expect(result.token).toEqual({ colorPrimary: '#ff0000' }); - expect(result.hashed).toBe(true); - }); - - it('handles undefined algorithm', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - }; - - const result = deserializeThemeConfig(config); - - expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); - }); - - it('converts default algorithm string to function reference', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.DEFAULT, - }; - - const result = deserializeThemeConfig(config); - - expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); - }); - - it('converts compact algorithm string to function reference', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.COMPACT, - }; - - const result = deserializeThemeConfig(config); - - expect(result.algorithm).toBe(antdThemeImport.compactAlgorithm); - }); - }); - - describe('serializeThemeConfig', () => { - it('converts function algorithm to string', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.darkAlgorithm, - }; - - const result = serializeThemeConfig(config); - - expect(result.algorithm).toBe(ThemeAlgorithm.DARK); - }); - - it('converts array of function algorithms to strings', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: [ - antdThemeImport.darkAlgorithm, - antdThemeImport.compactAlgorithm, - ], - }; - - const result = serializeThemeConfig(config); - - expect(Array.isArray(result.algorithm)).toBe(true); - expect(result.algorithm).toContain(ThemeAlgorithm.DARK); - expect(result.algorithm).toContain(ThemeAlgorithm.COMPACT); - }); - - it('preserves other configuration properties', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.darkAlgorithm, - hashed: true, - }; - - const result = serializeThemeConfig(config); - - expect(result.token).toEqual({ colorPrimary: '#ff0000' }); - expect(result.hashed).toBe(true); - }); - - it('handles undefined algorithm', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - }; - - const result = serializeThemeConfig(config); - - expect(result.algorithm).toBeUndefined(); - }); - - it('defaults to "default" for unknown algorithms', () => { - const unknownAlgorithm = () => ({}); - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - // @ts-ignore - algorithm: unknownAlgorithm, - }; - - const result = serializeThemeConfig(config); - - expect(result.algorithm).toBe(ThemeAlgorithm.DEFAULT); - }); - - it('converts default algorithm function to string', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.defaultAlgorithm, - }; - - const result = serializeThemeConfig(config); - - expect(result.algorithm).toBe(ThemeAlgorithm.DEFAULT); - }); - - it('converts compact algorithm function to string', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.compactAlgorithm, - }; - - const result = serializeThemeConfig(config); - - expect(result.algorithm).toBe(ThemeAlgorithm.COMPACT); - }); - - it('defaults each unknown algorithm in array to "default"', () => { - const unknownAlgorithm = () => ({}); - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - // @ts-ignore - algorithm: [antdThemeImport.darkAlgorithm, unknownAlgorithm], - }; - - const result = serializeThemeConfig(config); - - expect(Array.isArray(result.algorithm)).toBe(true); - expect(result.algorithm).toEqual([ - ThemeAlgorithm.DARK, - ThemeAlgorithm.DEFAULT, - ]); - }); - - it('handles mixed known and unknown algorithms in array', () => { - const unknownAlgorithm1 = () => ({}); - const unknownAlgorithm2 = () => ({}); - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: [ - antdThemeImport.darkAlgorithm, - // @ts-ignore - unknownAlgorithm1, - antdThemeImport.compactAlgorithm, - // @ts-ignore - unknownAlgorithm2, - ], - }; - - const result = serializeThemeConfig(config); - - expect(Array.isArray(result.algorithm)).toBe(true); - expect(result.algorithm).toEqual([ - ThemeAlgorithm.DARK, - ThemeAlgorithm.DEFAULT, - ThemeAlgorithm.COMPACT, - ThemeAlgorithm.DEFAULT, - ]); - }); - }); - - describe('normalizeThemeConfig', () => { - it('returns the same config for non-serializable configs', () => { - const config: AntdThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: antdThemeImport.darkAlgorithm, - }; - - const result = normalizeThemeConfig(config); - - expect(result).toBe(config); - }); - - it('deserializes serializable configs', () => { - const config: SerializableThemeConfig = { - token: { colorPrimary: '#ff0000' }, - algorithm: ThemeAlgorithm.DARK, - }; - - const result = normalizeThemeConfig(config); - - expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); - }); - }); - - describe('getAntdConfig', () => { - it('returns config with default algorithm for light mode', () => { - const seed = { colorPrimary: '#ff0000' }; - - const result = getAntdConfig(seed, false); - - expect(result.token).toBe(seed); - expect(result.algorithm).toBe(antdThemeImport.defaultAlgorithm); - }); - - it('returns config with dark algorithm for dark mode', () => { - const seed = { colorPrimary: '#ff0000' }; - - const result = getAntdConfig(seed, true); - - expect(result.token).toBe(seed); - expect(result.algorithm).toBe(antdThemeImport.darkAlgorithm); - }); - }); - - describe('getSystemColors', () => { - it('extracts system colors from tokens', () => { - const tokens = { - colorPrimary: '#primary', - colorError: '#error', - colorWarning: '#warning', - colorSuccess: '#success', - colorInfo: '#info', - otherToken: 'ignore-me', - }; - - const result = getSystemColors(tokens); - - expect(result).toEqual({ - colorPrimary: '#primary', - colorError: '#error', - colorWarning: '#warning', - colorSuccess: '#success', - colorInfo: '#info', - }); - }); - }); -}); diff --git a/superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.test.ts b/superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.test.ts deleted file mode 100644 index da48a93c797..00000000000 --- a/superset-frontend/packages/superset-ui-core/src/theme/utils/themeUtils.test.ts +++ /dev/null @@ -1,246 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { theme as antdTheme } from 'antd'; -import { - getFontSize, - getColorVariants, - isThemeDark, - isThemeConfigDark, -} from './themeUtils'; -import { Theme } from '../Theme'; -import { ThemeAlgorithm } from '../types'; - -// Mock emotion's cache to avoid actual DOM operations -jest.mock('@emotion/cache', () => ({ - __esModule: true, - default: jest.fn().mockReturnValue({}), -})); - -describe('themeUtils', () => { - let lightTheme: Theme; - let darkTheme: Theme; - - beforeEach(() => { - jest.clearAllMocks(); - - // Create actual theme instances for testing - lightTheme = Theme.fromConfig({ - token: { - colorPrimary: '#1890ff', - fontSizeXS: '8', - fontSize: '14', - fontSizeLG: '16', - }, - }); - - darkTheme = Theme.fromConfig({ - algorithm: ThemeAlgorithm.DARK, - token: { - colorPrimary: '#1890ff', - fontSizeXS: '8', - fontSize: '14', - fontSizeLG: '16', - }, - }); - }); - - describe('getFontSize', () => { - it('returns correct font size for given key', () => { - expect(getFontSize(lightTheme.theme, 'xs')).toBe('8'); - expect(getFontSize(lightTheme.theme, 'm')).toBe('14'); - expect(getFontSize(lightTheme.theme, 'l')).toBe('16'); - }); - - it('defaults to medium font size when no key is provided', () => { - expect(getFontSize(lightTheme.theme)).toBe('14'); - }); - - it('uses antd default when specific size not overridden', () => { - // Create theme with minimal config - antd will provide defaults - const minimalTheme = Theme.fromConfig({ - token: { fontSize: '14' }, - }); - - expect(getFontSize(minimalTheme.theme, 'xs')).toBe('14'); - expect(getFontSize(minimalTheme.theme, 'm')).toBe('14'); - }); - }); - - describe('isThemeDark', () => { - it('returns false for light theme', () => { - expect(isThemeDark(lightTheme.theme)).toBe(false); - }); - - it('returns true for dark theme', () => { - expect(isThemeDark(darkTheme.theme)).toBe(true); - }); - }); - - describe('getColorVariants', () => { - it('returns correct variants for primary color', () => { - const variants = getColorVariants(lightTheme.theme, 'primary'); - - expect(variants.text).toBeDefined(); - expect(variants.bg).toBeDefined(); - expect(variants.border).toBeDefined(); - expect(variants.active).toBeDefined(); - }); - - it('returns grayscale variants for default color in light theme', () => { - const variants = getColorVariants(lightTheme.theme, 'default'); - - expect(variants.active).toBe('#222'); - expect(variants.textActive).toBe('#444'); - expect(variants.text).toBe('#555'); - expect(variants.bg).toBe('#F4F4F4'); - }); - - it('returns inverted grayscale variants for default color in dark theme', () => { - const variants = getColorVariants(darkTheme.theme, 'default'); - - // In dark theme, colors should be inverted - expect(variants.active).toBe('#dddddd'); // Inverted #222 - expect(variants.textActive).toBe('#bbbbbb'); // Inverted #444 - expect(variants.text).toBe('#aaaaaa'); // Inverted #555 - }); - - it('returns same variants for grayscale color as default', () => { - const defaultVariants = getColorVariants(lightTheme.theme, 'default'); - const grayscaleVariants = getColorVariants(lightTheme.theme, 'grayscale'); - - expect(defaultVariants).toEqual(grayscaleVariants); - }); - - it('handles missing color tokens gracefully', () => { - const variants = getColorVariants(lightTheme.theme, 'nonexistent'); - - // Should return undefined for missing tokens - expect(variants.active).toBeUndefined(); - expect(variants.text).toBeUndefined(); - expect(variants.bg).toBeUndefined(); - }); - }); - - describe('isThemeConfigDark', () => { - it('returns true for config with dark algorithm', () => { - const config = { - algorithm: antdTheme.darkAlgorithm, - }; - expect(isThemeConfigDark(config)).toBe(true); - }); - - it('returns true for config with dark algorithm in array', () => { - const config = { - algorithm: [antdTheme.darkAlgorithm, antdTheme.compactAlgorithm], - }; - expect(isThemeConfigDark(config)).toBe(true); - }); - - it('returns false for config without dark algorithm', () => { - const config = { - algorithm: antdTheme.defaultAlgorithm, - }; - expect(isThemeConfigDark(config)).toBe(false); - }); - - it('returns false for config with no algorithm', () => { - const config = { - token: { - colorPrimary: '#1890ff', - }, - }; - expect(isThemeConfigDark(config)).toBe(false); - }); - - it('detects manually-created dark theme without dark algorithm', () => { - // This is the edge case: dark colors without dark algorithm - const config = { - token: { - colorBgContainer: '#1a1a1a', // Dark background - colorBgBase: '#0a0a0a', // Dark base - colorText: '#ffffff', // Light text - }, - }; - expect(isThemeConfigDark(config)).toBe(true); - }); - - it('does not false-positive on light theme with custom colors', () => { - const config = { - token: { - colorBgContainer: '#ffffff', // Light background - colorBgBase: '#f5f5f5', // Light base - colorText: '#000000', // Dark text - }, - }; - expect(isThemeConfigDark(config)).toBe(false); - }); - - it('handles partial color tokens gracefully', () => { - // With actual theme computation, a dark colorBgContainer results in a dark theme - const config = { - token: { - colorBgContainer: '#1a1a1a', // Dark background - // Missing other color tokens - }, - }; - expect(isThemeConfigDark(config)).toBe(true); - }); - - it('respects colorBgContainer as the primary indicator', () => { - // The computed theme uses colorBgContainer as the main background - const darkConfig = { - token: { - colorBgContainer: '#1a1a1a', // Dark background - colorText: '#000000', // Dark text (unusual but doesn't override) - }, - }; - expect(isThemeConfigDark(darkConfig)).toBe(true); - - const lightConfig = { - token: { - colorBgContainer: '#ffffff', // Light background - colorText: '#ffffff', // Light text (unusual but doesn't override) - }, - }; - expect(isThemeConfigDark(lightConfig)).toBe(false); - }); - - it('handles non-string color tokens gracefully', () => { - const config = { - token: { - colorBgContainer: undefined, - colorText: null, - colorBgBase: 123, // Invalid type - }, - }; - expect(isThemeConfigDark(config)).toBe(false); - }); - - it('returns false for empty config', () => { - expect(isThemeConfigDark({})).toBe(false); - }); - - it('returns false for config with empty token object', () => { - const config = { - token: {}, - }; - expect(isThemeConfigDark(config)).toBe(false); - }); - }); -}); diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx index 768fed2d0ba..d89d7d53879 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx @@ -18,12 +18,8 @@ */ /* eslint-disable max-classes-per-file */ -import { - QueryFormData, - ChartMetadata, - ChartPlugin, - useTheme, -} from '@superset-ui/core'; +import { QueryFormData, ChartMetadata, ChartPlugin } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; const DIMENSION_STYLE = { fontSize: 36, diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx index c026099d13a..201a5fccdfd 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx @@ -19,7 +19,8 @@ import '@testing-library/jest-dom'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; -import { ChartProps, supersetTheme } from '@superset-ui/core'; +import { ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { render, screen, waitFor } from '@superset-ui/core/spec'; import SuperChartCore from '../../../src/chart/components/SuperChartCore'; import { diff --git a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx index 8e1210b64eb..7805322ea75 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx @@ -30,9 +30,9 @@ import { getChartControlPanelRegistry, QueryFormData, DatasourceType, - supersetTheme, VizType, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; describe('ChartPlugin', () => { const FakeChart = () => test; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts index a487b797a3e..c9301b56f66 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts @@ -17,7 +17,8 @@ * under the License. */ -import { Behavior, ChartProps, supersetTheme } from '@superset-ui/core'; +import { Behavior, ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; const RAW_FORM_DATA = { some_field: 1, diff --git a/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx b/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx index 8ecd9f8b47e..2651f730b54 100644 --- a/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx @@ -19,7 +19,7 @@ import '@testing-library/jest-dom'; import { render, fireEvent } from '@testing-library/react'; -import { SupersetTheme, ThemeProvider } from '@superset-ui/core'; +import { SupersetTheme, ThemeProvider } from '@apache-superset/core/ui'; // CRITICAL: Don't import from the mocked path - import directly to avoid global mocks import AsyncIcon from '../../../src/components/Icons/AsyncIcon'; diff --git a/superset-frontend/packages/superset-ui-core/tsconfig.json b/superset-frontend/packages/superset-ui-core/tsconfig.json index 559e1008253..c3cf99b320f 100644 --- a/superset-frontend/packages/superset-ui-core/tsconfig.json +++ b/superset-frontend/packages/superset-ui-core/tsconfig.json @@ -4,14 +4,23 @@ // Path Resolution: Override baseUrl to maintain correct path mappings from parent config // (e.g., "@apache-superset/core" -> "./packages/superset-core/src") "baseUrl": "../..", - // Directory Overrides: Parent config paths are relative to frontend root, // but packages need paths relative to their own directory "outDir": "lib", "rootDir": "src", "declarationDir": "lib" }, - "include": ["src/**/*", "types/**/*"], - "exclude": ["src/**/*.test.*", "src/**/*.stories.*"], - "references": [{ "path": "../superset-core" }] + "include": [ + "src/**/*", + "types/**/*" + ], + "exclude": [ + "src/**/*.test.*", + "src/**/*.stories.*" + ], + "references": [ + { + "path": "../superset-core" + } + ] } diff --git a/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.jsx b/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.jsx index 60851f55d03..c456e2b38cf 100644 --- a/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.jsx +++ b/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.jsx @@ -1,5 +1,5 @@ // themeDecorator.js -import { supersetTheme, ThemeProvider } from '@superset-ui/core'; +import { supersetTheme, ThemeProvider } from '@apache-superset/core/ui'; const ThemeDecorator = Story => ( diff --git a/superset-frontend/packages/superset-ui-demo/package.json b/superset-frontend/packages/superset-ui-demo/package.json index 934e9b84dee..736d6ee3e87 100644 --- a/superset-frontend/packages/superset-ui-demo/package.json +++ b/superset-frontend/packages/superset-ui-demo/package.json @@ -65,6 +65,7 @@ "peerDependencies": { "@encodable/color": "=1.1.1", "@superset-ui/core": "*", + "@apache-superset/core": "*", "@superset-ui/legacy-plugin-chart-calendar": "*", "@superset-ui/legacy-plugin-chart-chord": "*", "@superset-ui/legacy-plugin-chart-country-map": "*", diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx index 24d33277031..4c33e9bbb5a 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx @@ -18,7 +18,7 @@ */ import { useState, ReactNode, SyntheticEvent } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import type { Decorator } from '@storybook/react'; import { ResizeCallbackData } from 'react-resizable'; import ResizablePanel, { Size } from './ResizablePanel'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx index 31f26840db7..38b2b009df1 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx @@ -18,13 +18,8 @@ */ import { useEffect, useState } from 'react'; -import { - JsonObject, - seed, - SuperChart, - SequentialD3, - useTheme, -} from '@superset-ui/core'; +import { JsonObject, seed, SuperChart, SequentialD3 } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import CountryMapChartPlugin, { countries, } from '@superset-ui/legacy-plugin-chart-country-map'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx index 7a1fb7a19a3..120ba166006 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx @@ -18,7 +18,8 @@ */ /* eslint-disable no-magic-numbers */ -import { SuperChart, useTheme } from '@superset-ui/core'; +import { SuperChart } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import MapBoxChartPlugin from '@superset-ui/legacy-plugin-chart-map-box'; import { generateData } from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts index b138443942c..589fcc69e34 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/data.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; /* eslint-disable sort-keys, no-magic-numbers */ export const generateData = (theme: SupersetTheme) => ({ diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx index 79a089c94bc..20456eea041 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx @@ -19,7 +19,8 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import { SuperChart, useTheme } from '@superset-ui/core'; +import { SuperChart } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { PathChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import { payload } from './payload'; import dummyDatasource from '../../../../shared/dummyDatasource'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-theme/Theme.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-theme/Theme.stories.tsx index ce3f6d41112..71b0a8d9f99 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-theme/Theme.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-theme/Theme.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { supersetTheme } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; const colorTypes = ['primary', 'error', 'warning', 'success', 'info']; diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/package.json b/superset-frontend/plugins/legacy-plugin-chart-calendar/package.json index f4107ccfa0e..5e6c092f9a6 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/package.json @@ -32,6 +32,7 @@ "@emotion/react": "^11.4.1", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" }, "publishConfig": { diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx index 7c6f684e663..f028b94b116 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx @@ -17,7 +17,8 @@ * under the License. */ import PropTypes from 'prop-types'; -import { reactify, styled, css, useTheme } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { Global } from '@emotion/react'; import Component from './Calendar'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/package.json b/superset-frontend/plugins/legacy-plugin-chart-chord/package.json index 64cbc61bc46..3db9620bb1d 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/package.json @@ -35,6 +35,7 @@ }, "peerDependencies": { "@superset-ui/chart-controls": "*", - "@superset-ui/core": "*" + "@superset-ui/core": "*", + "@apache-superset/core": "*" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx index d413a795370..fbefe58e3f7 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify, styled } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import PropTypes from 'prop-types'; import Component from './Chord'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/package.json b/superset-frontend/plugins/legacy-plugin-chart-country-map/package.json index 6f3385ae045..a0613181941 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/package.json @@ -33,6 +33,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx index 9d8413b4275..7a8ade2a642 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify, styled } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Component from './CountryMap'; const ReactComponent = reactify(Component); diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/package.json b/superset-frontend/plugins/legacy-plugin-chart-horizon/package.json index 22eb16060f8..6e5033e4f06 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/package.json @@ -30,6 +30,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" }, "publishConfig": { diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx index e78dafd509b..d3ebde9bd5e 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx @@ -20,7 +20,8 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { extent as d3Extent } from 'd3-array'; -import { ensureIsArray, styled } from '@superset-ui/core'; +import { ensureIsArray } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import HorizonRow, { DEFAULT_COLORS } from './HorizonRow'; const propTypes = { diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/package.json b/superset-frontend/plugins/legacy-plugin-chart-map-box/package.json index 0765e7596b2..90b77fece55 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/package.json @@ -34,6 +34,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "mapbox-gl": "*", "react": "^17.0.2" }, diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json index a01e4b934fd..3272f943d62 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/package.json @@ -30,6 +30,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" }, "publishConfig": { diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx index 8d716043918..e3c4812a609 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx @@ -19,7 +19,7 @@ /* eslint-disable react/no-array-index-key */ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import TTestTable, { dataPropType } from './TTestTable'; const propTypes = { diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/package.json b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/package.json index 4101769139d..42900f5382e 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/package.json @@ -35,6 +35,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx index f6e4ba890f4..7bd02eed42f 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, reactify, addAlpha } from '@superset-ui/core'; +import { reactify, addAlpha } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import PropTypes from 'prop-types'; import Component from './ParallelCoordinates'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/package.json b/superset-frontend/plugins/legacy-plugin-chart-partition/package.json index 74ffd716108..ce7d12ebf9e 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/package.json @@ -30,6 +30,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "@testing-library/jest-dom": "*", "@testing-library/react": "^12.1.5", "react": "^17.0.2", diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx index c55d00b4a94..77a15ffe5a0 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify, styled } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Component from './Partition'; const ReactComponent = reactify(Component); diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/package.json b/superset-frontend/plugins/legacy-plugin-chart-rose/package.json index ce007a118ef..c6607a37951 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/package.json @@ -31,6 +31,7 @@ "@emotion/react": "^11.4.1", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" }, "publishConfig": { diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx index 2a9a1fc590d..824897d26e0 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify, styled, css } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Global } from '@emotion/react'; import Component from './Rose'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/package.json b/superset-frontend/plugins/legacy-plugin-chart-world-map/package.json index 251a165cd06..a8662064e88 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/package.json +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/package.json @@ -38,6 +38,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" } } diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx index 6343e59fb5d..ef972bb039e 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx @@ -17,7 +17,8 @@ * under the License. */ import PropTypes from 'prop-types'; -import { styled, reactify, useTheme } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import WorldMap from './WorldMap'; const ReactWorldMap = reactify(WorldMap); diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json index ae1995892ba..022a70a0967 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json @@ -62,6 +62,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "mapbox-gl": "*", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx index ad1ed4953ab..7a929d506fa 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx @@ -36,7 +36,8 @@ import { isEqual } from 'lodash'; import { StaticMap } from 'react-map-gl'; import DeckGL from '@deck.gl/react'; import type { Layer } from '@deck.gl/core'; -import { JsonObject, JsonValue, styled, usePrevious } from '@superset-ui/core'; +import { JsonObject, JsonValue, usePrevious } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Tooltip, { TooltipProps } from './components/Tooltip'; import 'mapbox-gl/dist/mapbox-gl.css'; import { Viewport } from './utils/fitViewport'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx index 07c979e4210..05e048a5995 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx @@ -20,7 +20,8 @@ * under the License. */ import { memo } from 'react'; -import { formatNumber, styled } from '@superset-ui/core'; +import { formatNumber } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Color } from '@deck.gl/core'; const StyledLegend = styled.div` diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx index 670e44e81d5..a73c16e2b93 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { styled, safeHtmlSpan } from '@superset-ui/core'; +import { safeHtmlSpan } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ReactNode } from 'react'; export type TooltipProps = { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx index 23512663b68..a4de1e8f817 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx @@ -20,7 +20,7 @@ import { render, screen } from '@testing-library/react'; // eslint-disable-next-line import/no-extraneous-dependencies import '@testing-library/jest-dom'; -import { supersetTheme, ThemeProvider } from '@superset-ui/core'; +import { supersetTheme, ThemeProvider } from '@apache-superset/core/ui'; import DeckGLPolygon, { getPoints } from './Polygon'; import { COLOR_SCHEME_TYPES } from '../../utilities/utils'; import * as utils from '../../utils'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx index bbade670445..c2facd80242 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx @@ -22,10 +22,10 @@ import { Color } from '@deck.gl/core'; import { JsonObject, QueryFormData, - styled, CategoricalColorNamespace, t, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { COLOR_SCHEME_TYPES, ColorSchemeType, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts index fbe222f78f3..f996cb22710 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts @@ -20,8 +20,8 @@ import { ChartProps, DatasourceType, QueryObjectFilterClause, - SupersetTheme, } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { decode } from 'ngeohash'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx index 3466107ed35..805ed682672 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useEffect, useState, memo, useMemo } from 'react'; -import { styled, t, sanitizeHtml } from '@superset-ui/core'; +import { t, sanitizeHtml } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import Handlebars from 'handlebars'; import { isPlainObject } from 'lodash'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx index 163f078179b..dd3e39040f8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx @@ -19,7 +19,8 @@ import { useCallback } from 'react'; import { debounce } from 'lodash'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { InfoTooltip, Constants } from '@superset-ui/core/components'; import { ControlHeader } from '@superset-ui/chart-controls'; import { TooltipTemplateEditor } from './TooltipTemplateEditor'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx index f7a1a166f12..32ea0a2613b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useEffect, useState } from 'react'; -import { styled, css, useThemeMode } from '@superset-ui/core'; +import { styled, css, useThemeMode } from '@apache-superset/core/ui'; import { CodeEditor } from '@superset-ui/core/components'; const EditorContainer = styled.div` diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json b/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json index d3662d34d7c..4387a4b29b4 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/package.json @@ -42,6 +42,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "react": "^17.0.2" } } diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx index c7111e393c6..d1f5e64edc1 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { reactify, styled } from '@superset-ui/core'; +import { reactify } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import PropTypes from 'prop-types'; import Component from './NVD3Vis'; import { hideTooltips, removeTooltip } from './utils'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx index d30f0a2fe2a..cd1f8564bfe 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, useTheme } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { CustomCellRendererProps } from '@superset-ui/core/components/ThemedAgGridReact'; import { BasicColorFormatterType, InputColumn } from '../types'; import { useIsDark } from '../utils/useTableTheme'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx index c67829cb5e2..4d7f4f3c8ed 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Select } from '@superset-ui/core/components'; /* Components for AgGridTable */ diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts index 136ce00a1e0..f37bcf4dc51 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { colorSchemeDark, colorSchemeLight, diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/package.json b/superset-frontend/plugins/plugin-chart-cartodiagram/package.json index fdba9a9a54d..3fde837abf6 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/package.json +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/package.json @@ -38,6 +38,7 @@ "@reduxjs/toolkit": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "@types/react-redux": "*", "geostyler": "^14.1.3", "geostyler-data": "^1.0.0", diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx index 0fc87191716..15d7ca53e57 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx @@ -17,7 +17,7 @@ * under the License. */ import { createRef, useState } from 'react'; -import { styled, useTheme } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import OlMap from 'ol/Map'; import { CartodiagramPluginProps, diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx index 875ef5c4c02..33e3573f974 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx @@ -20,7 +20,7 @@ import Layer from 'ol/layer/Layer'; import { FrameState } from 'ol/Map'; import { apply as applyTransform } from 'ol/transform'; import ReactDOM from 'react-dom'; -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { ChartConfig, ChartLayerOptions, ChartSizeValues } from '../types'; import { createChartComponent } from '../util/chartUtil'; import { getProjectedCoordinateFromPointGeoJson } from '../util/geometryUtil'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx index e4d087dccaf..bcdcbec4fc6 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx @@ -17,7 +17,8 @@ * under the License. */ import { configureStore } from '@reduxjs/toolkit'; -import { getChartComponentRegistry, ThemeProvider } from '@superset-ui/core'; +import { getChartComponentRegistry } from '@superset-ui/core'; +import { ThemeProvider } from '@apache-superset/core/ui'; import { FC, useEffect, useState } from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import { ChartWrapperProps } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts index 62db443c88b..3e5528f86ec 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts @@ -16,11 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - DataRecord, - SupersetTheme, - TimeseriesDataRecord, -} from '@superset-ui/core'; +import { DataRecord, TimeseriesDataRecord } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { RenderFunction } from 'ol/layer/Layer'; import { Extent } from 'ol/extent'; import Source from 'ol/source/Source'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx index ecdef6c6e2e..9932b9bab96 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { ChartConfig, ChartConfigFeature } from '../types'; import ChartWrapper from '../components/ChartWrapper'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts index 98cfc4977ef..ce3575c67a1 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts @@ -16,11 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - ChartProps, - getChartTransformPropsRegistry, - supersetTheme, -} from '@superset-ui/core'; +import { ChartProps, getChartTransformPropsRegistry } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { LayerConf, MapViewConfigs, ZoomConfigs } from '../../src/types'; import transformProps from '../../src/plugin/transformProps'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx index 8df356fdfd5..22bc336402b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx @@ -18,14 +18,12 @@ */ import { useEffect, useMemo, useState } from 'react'; import { - css, ensureIsArray, fetchTimeRange, getTimeOffset, - styled, t, - useTheme, } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; import { DEFAULT_DATE_PATTERN } from '@superset-ui/chart-controls'; import { isEmpty } from 'lodash'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx index a07ea02f755..9d2b14efe04 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -24,10 +24,9 @@ import { SMART_DATE_VERBOSE_ID, computeMaxFontSize, BRAND_COLOR, - styled, BinaryQueryObjectFilterClause, - useTheme, } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import Echart from '../components/Echart'; import { BigNumberVizProps } from './types'; import { EventHandlers } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts index 597e0ff9b1b..5e7a23545f0 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import type { GaugeSeriesOption } from 'echarts/charts'; export const defaultGaugeSeriesOption = ( diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts index a5e4d8b1b5c..33e8fc446ea 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -25,13 +25,12 @@ import { FilterState, FormulaAnnotationLayer, IntervalAnnotationLayer, - isThemeDark, LegendState, - SupersetTheme, TimeseriesAnnotationLayer, TimeseriesDataRecord, ValueFormatter, } from '@superset-ui/core'; +import { SupersetTheme, isThemeDark } from '@apache-superset/core/ui'; import type { CallbackDataParams, DefaultStatesMixin, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx index c91dafe3b4b..c62f5535a30 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx @@ -29,7 +29,8 @@ import { } from 'react'; import { useSelector } from 'react-redux'; -import { styled, useTheme, mergeReplaceArrays } from '@superset-ui/core'; +import { mergeReplaceArrays } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { use, init, EChartsType, registerLocale } from 'echarts/core'; import { SankeyChart, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx index d3492a657cc..2e997b85583 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback } from 'react'; -import { HandlerFunction, JsonValue, styled } from '@superset-ui/core'; +import { HandlerFunction, JsonValue } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { RadioButtonOption, sharedControlComponents, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts index 5788977c584..68ff394e1bf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts @@ -28,10 +28,10 @@ import { normalizeTimestamp, NumberFormats, NumberFormatter, - SupersetTheme, TimeFormatter, ValueFormatter, } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { SortSeriesType, LegendPaddingType } from '@superset-ui/chart-controls'; import { format } from 'echarts/core'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts index 0b54271afd7..93ecf5df3d9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - DatasourceType, - supersetTheme, - TimeGranularity, - VizType, -} from '@superset-ui/core'; +import { DatasourceType, TimeGranularity, VizType } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps from '../../src/BigNumber/BigNumberWithTrendline/transformProps'; import { BigNumberDatum, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts index db814cc1092..95f997d3976 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, SqlaFormData, supersetTheme } from '@superset-ui/core'; +import { ChartProps, SqlaFormData } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsBoxPlotChartProps } from '../../src/BoxPlot/types'; import transformProps from '../../src/BoxPlot/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts index 9433948bfa9..8ff8306d4cc 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts @@ -21,8 +21,8 @@ import { ChartPropsConfig, getNumberFormatter, SqlaFormData, - supersetTheme, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsBubbleChartProps } from '../../src/Bubble/types'; import transformProps, { formatTooltip } from '../../src/Bubble/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts index 9e6a5a10b77..4e3990230a9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts @@ -16,11 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - ChartProps, - getNumberFormatter, - supersetTheme, -} from '@superset-ui/core'; +import { ChartProps, getNumberFormatter } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps, { parseParams } from '../../src/Funnel/transformProps'; import { EchartsFunnelChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts index e6626bd53c8..cbda465210e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { AxisType, ChartProps, supersetTheme } from '@superset-ui/core'; +import { AxisType, ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { LegendOrientation, LegendType, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts index a07977af66d..78298ef72b6 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts @@ -20,9 +20,9 @@ import { CategoricalColorNamespace, ChartProps, SqlaFormData, - supersetTheme, VizType, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps, { getIntervalBoundsAndColors, } from '../../src/Gauge/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts index 5c3937342c6..e7c8b3ada99 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, SqlaFormData, supersetTheme } from '@superset-ui/core'; +import { ChartProps, SqlaFormData } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps from '../../src/Graph/transformProps'; import { DEFAULT_GRAPH_SERIES_OPTION } from '../../src/Graph/constants'; import { EchartsGraphChartProps } from '../../src/Graph/types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts index 2ececa1a877..ece226e319a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, supersetTheme, VizType } from '@superset-ui/core'; +import { ChartProps, VizType } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { LegendOrientation, LegendType, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts index 9a0017114b0..26de27dd352 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts @@ -20,8 +20,8 @@ import { ChartProps, getNumberFormatter, SqlaFormData, - supersetTheme, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import type { PieSeriesOption } from 'echarts/charts'; import type { LabelFormatterCallback, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts index 8cf43c9317d..cc7ba86f9b1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, supersetTheme } from '@superset-ui/core'; +import { ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { RadarSeriesOption } from 'echarts/charts'; import transformProps from '../../src/Radar/transformProps'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts index d32f35ff589..425759ca17a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, SqlaFormData, supersetTheme } from '@superset-ui/core'; +import { ChartProps, SqlaFormData } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsTimeseriesChartProps } from '../../../src/types'; import transformProps from '../../../src/Timeseries/transformProps'; import { DEFAULT_FORM_DATA } from '../../../src/Timeseries/constants'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts index 01f71c0b09c..42ecb1803d3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts @@ -25,9 +25,9 @@ import { FormulaAnnotationLayer, IntervalAnnotationLayer, SqlaFormData, - supersetTheme, TimeseriesAnnotationLayer, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsTimeseriesChartProps } from '../../src/types'; import transformProps from '../../src/Timeseries/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts index 6a56c997c22..e878dcf6b72 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, supersetTheme } from '@superset-ui/core'; +import { ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps from '../../src/Tree/transformProps'; import { EchartsTreeChartProps } from '../../src/Tree/types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts index f18caea6861..d076f5a8a76 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, supersetTheme } from '@superset-ui/core'; +import { ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsTreemapChartProps } from '../../src/Treemap/types'; import transformProps from '../../src/Treemap/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts index 98906752f61..271bb746b6d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { ChartProps, supersetTheme } from '@superset-ui/core'; +import { ChartProps } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { EchartsWaterfallChartProps, WaterfallChartTransformedProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts index 28ce567b063..57704662f56 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts @@ -22,8 +22,8 @@ import { DataRecord, getNumberFormatter, getTimeFormatter, - supersetTheme as theme, } from '@superset-ui/core'; +import { supersetTheme as theme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { calculateLowerLogTick, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts index 0a07650f8d4..7e2008753c2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts @@ -27,10 +27,10 @@ import { EventAnnotationLayer, FormulaAnnotationLayer, IntervalAnnotationLayer, - supersetTheme, TimeseriesAnnotationLayer, TimeseriesDataRecord, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { OrientationType } from '../../src'; import { transformEventAnnotation, diff --git a/superset-frontend/plugins/plugin-chart-handlebars/package.json b/superset-frontend/plugins/plugin-chart-handlebars/package.json index e7cd057db5c..901b4684473 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/package.json +++ b/superset-frontend/plugins/plugin-chart-handlebars/package.json @@ -32,6 +32,7 @@ }, "peerDependencies": { "@superset-ui/chart-controls": "*", + "@apache-superset/core": "*", "@superset-ui/core": "*", "ace-builds": "^1.4.14", "handlebars": "^4.7.8", diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx index 2e7e27ae1eb..82c1c069af2 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { createRef } from 'react'; import { HandlebarsViewer } from './components/Handlebars/HandlebarsViewer'; import { HandlebarsProps, HandlebarsStylesProps } from './types'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx index a1e9c661899..771fbb95a76 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { SafeMarkdown } from '@superset-ui/core/components'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import Handlebars from 'handlebars'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx index e09f7f5aba9..8e810e4c265 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx @@ -21,7 +21,8 @@ import { CustomControlConfig, sharedControls, } from '@superset-ui/chart-controls'; -import { t, validateNonEmpty, useTheme } from '@superset-ui/core'; +import { t, validateNonEmpty } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { InfoTooltip, SafeMarkdown } from '@superset-ui/core/components'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx index b69b2ea0424..e2aade89af7 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx @@ -21,7 +21,8 @@ import { CustomControlConfig, sharedControls, } from '@superset-ui/chart-controls'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { InfoTooltip } from '@superset-ui/core/components'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts index d6ab2a60dca..4c0c1fe8525 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - ChartProps, - QueryFormData, - supersetTheme, - VizType, -} from '@superset-ui/core'; +import { ChartProps, QueryFormData, VizType } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { HandlebarsQueryFormData } from '../../src/types'; import transformProps from '../../src/plugin/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx index 454badec2c5..a08f96a8ad9 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx @@ -31,10 +31,9 @@ import { isFeatureEnabled, isPhysicalColumn, NumberFormatter, - styled, t, - useTheme, } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { aggregatorTemplates, PivotTable, sortAs } from './react-pivottable'; import { FilterType, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.js b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.js index 86dd63f4f6e..327104c6b22 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.js +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.js @@ -17,7 +17,7 @@ * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; export const Styles = styled.div` ${({ theme, isDashboardEditMode }) => css` diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts index c639140abe1..9327dcffe80 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts @@ -17,7 +17,8 @@ * under the License. */ -import { ChartProps, QueryFormData, supersetTheme } from '@superset-ui/core'; +import { ChartProps, QueryFormData } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import transformProps from '../../src/plugin/transformProps'; import { MetricsLayoutEnum } from '../../src/types'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx index d4cc33e6181..54b69b60187 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-disable import/no-extraneous-dependencies */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { RawAntdSelect } from '@superset-ui/core/components'; import { SearchOption } from '../../types'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx index a3323c2e205..0434a6c22e6 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx @@ -17,7 +17,8 @@ * under the License. */ import { memo } from 'react'; -import { css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { formatSelectOptions } from '@superset-ui/chart-controls'; import { RawAntdSelect } from '@superset-ui/core/components'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx index df8849c482e..75097569fbd 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx @@ -30,7 +30,7 @@ import { UIEventHandler, } from 'react'; import { TableInstance, Hooks } from 'react-table'; -import { useTheme, css } from '@superset-ui/core'; +import { useTheme, css } from '@apache-superset/core/ui'; import getScrollBarSize from '../utils/getScrollBarSize'; import needScrollBar from '../utils/needScrollBar'; import useMountedMemo from '../utils/useMountedMemo'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx b/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx index 14b3e4f2d2a..4d7a61af6f5 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; export default styled.div` ${({ theme }) => css` diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index 784e33de288..40091834d03 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -46,14 +46,11 @@ import { getSelectedText, getTimeFormatterForGranularity, BinaryQueryObjectFilterClause, - styled, - css, t, tn, - useTheme, - SupersetTheme, extractTextFromHTML, } from '@superset-ui/core'; +import { styled, css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { Input, diff --git a/superset-frontend/plugins/plugin-chart-table/test/testData.ts b/superset-frontend/plugins/plugin-chart-table/test/testData.ts index 752b045ba4d..02d88e021e2 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/testData.ts +++ b/superset-frontend/plugins/plugin-chart-table/test/testData.ts @@ -21,10 +21,10 @@ import { ChartProps, DatasourceType, QueryMode, - supersetTheme, ComparisonType, VizType, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { TableChartProps, TableChartFormData } from '../src/types'; diff --git a/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx b/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx index 95ee707abbd..ebb0db9bd7f 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx @@ -17,11 +17,11 @@ * under the License. */ import { - EmotionCacheProvider, - createEmotionCache, supersetTheme, ThemeProvider, -} from '@superset-ui/core'; + EmotionCacheProvider, + createEmotionCache, +} from '@apache-superset/core/ui'; const emotionCache = createEmotionCache({ key: 'test', diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/package.json b/superset-frontend/plugins/plugin-chart-word-cloud/package.json index 6a970307991..65a95696b64 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/package.json +++ b/superset-frontend/plugins/plugin-chart-word-cloud/package.json @@ -37,6 +37,7 @@ "peerDependencies": { "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", + "@apache-superset/core": "*", "@types/lodash": "*", "@types/react": "*", "react": "^17.0.2" diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx index 11b2fe2179b..5818b3e7bc4 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx @@ -24,12 +24,8 @@ import { DeriveEncoding, Encoder, } from 'encodable'; -import { - SupersetTheme, - withTheme, - seed, - CategoricalColorNamespace, -} from '@superset-ui/core'; +import { seed, CategoricalColorNamespace } from '@superset-ui/core'; +import { SupersetTheme, withTheme } from '@apache-superset/core/ui'; import { isEqual } from 'lodash'; const seedRandom = seed('superset-ui'); diff --git a/superset-frontend/spec/helpers/ProviderWrapper.tsx b/superset-frontend/spec/helpers/ProviderWrapper.tsx index 144d75401a3..d8d63cf3de6 100644 --- a/superset-frontend/spec/helpers/ProviderWrapper.tsx +++ b/superset-frontend/spec/helpers/ProviderWrapper.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { ThemeProvider } from '@superset-ui/core'; +import { ThemeProvider } from '@apache-superset/core/ui'; import { BrowserRouter as Router, Route } from 'react-router-dom'; import { QueryParamProvider } from 'use-query-params'; diff --git a/superset-frontend/spec/helpers/testing-library.tsx b/superset-frontend/spec/helpers/testing-library.tsx index ea14a8e17b6..f7fbf44b20a 100644 --- a/superset-frontend/spec/helpers/testing-library.tsx +++ b/superset-frontend/spec/helpers/testing-library.tsx @@ -28,10 +28,9 @@ import { } from '@testing-library/react'; import { ThemeProvider, - // eslint-disable-next-line no-restricted-imports - supersetTheme, themeObject, -} from '@superset-ui/core'; + supersetTheme, +} from '@apache-superset/core/ui'; import { SupersetThemeProvider } from 'src/theme/ThemeProvider'; import { ThemeController } from 'src/theme/ThemeController'; import { BrowserRouter } from 'react-router-dom'; diff --git a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx index 5fa75de1bfd..648067cbab9 100644 --- a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx +++ b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx @@ -18,7 +18,7 @@ */ import { Global } from '@emotion/react'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; export const SqlLabGlobalStyles = () => ( { diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx index 88fca28e97a..242cd3dfa68 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx @@ -18,10 +18,10 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, Alert } from '@apache-superset/core/ui'; import { - Alert, Button, Loading, ModalTrigger, diff --git a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx index e9749a56187..b17d8e15dee 100644 --- a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC } from 'react'; -import { styled, t, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { ModalTrigger } from '@superset-ui/core/components'; import { detectOS } from 'src/utils/common'; diff --git a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx index 0ae67caa365..9e1c46c9559 100644 --- a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx @@ -21,14 +21,8 @@ import { shallowEqual, useSelector } from 'react-redux'; import { useInView } from 'react-intersection-observer'; import { omit } from 'lodash'; import { EmptyState, Skeleton } from '@superset-ui/core/components'; -import { - t, - styled, - css, - FeatureFlag, - isFeatureEnabled, - useTheme, -} from '@superset-ui/core'; +import { t, FeatureFlag, isFeatureEnabled } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import QueryTable from 'src/SqlLab/components/QueryTable'; import { SqlLabRootState } from 'src/SqlLab/types'; import { useEditorQueriesQuery } from 'src/hooks/apiResources/queries'; diff --git a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx index 5d2625dbc78..1a56ce9b461 100644 --- a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx @@ -18,7 +18,8 @@ */ import { Label } from '@superset-ui/core/components'; import { STATE_TYPE_MAP, STATE_TYPE_MAP_LOCALIZED } from 'src/SqlLab/constants'; -import { styled, Query } from '@superset-ui/core'; +import { Query } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; interface QueryStateLabelProps { query: Pick; diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index 38333ab88ef..a0b03e9ccc4 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -27,7 +27,8 @@ import { TableView, } from '@superset-ui/core/components'; import ProgressBar from '@superset-ui/core/components/ProgressBar'; -import { t, useTheme, QueryResponse } from '@superset-ui/core'; +import { t, QueryResponse } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { diff --git a/superset-frontend/src/SqlLab/components/QueryTable/styles.ts b/superset-frontend/src/SqlLab/components/QueryTable/styles.ts index 198733de44d..bf6623af3fd 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/styles.ts +++ b/superset-frontend/src/SqlLab/components/QueryTable/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { IconTooltip } from '@superset-ui/core/components'; export const StaticPosition = css` diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index 7132defd92e..3297aa7b946 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -30,7 +30,6 @@ import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { pick } from 'lodash'; import { - Alert, Button, ButtonGroup, Tooltip, @@ -47,16 +46,14 @@ import { import { nanoid } from 'nanoid'; import { QueryState, - styled, t, tn, - useTheme, usePrevious, - css, getNumberFormatter, getExtensionsRegistry, ErrorTypeEnum, } from '@superset-ui/core'; +import { styled, useTheme, css, Alert } from '@apache-superset/core/ui'; import { ISaveableDatasource, ISimpleColumn, diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx index cc1103699bc..5b86830e9fc 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx @@ -18,7 +18,8 @@ */ import { useMemo, FC, ReactElement } from 'react'; -import { t, styled, useTheme, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme, SupersetTheme } from '@apache-superset/core/ui'; import { Button, DropdownButton } from '@superset-ui/core/components'; import { IconType, Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx index d65e1f90a76..ada65239f8f 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Button, DropdownButton } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx index 9a8d98ef86b..721b9081873 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx @@ -31,7 +31,6 @@ import { Flex, } from '@superset-ui/core/components'; import { - styled, t, SupersetClient, JsonResponse, @@ -43,6 +42,7 @@ import { isFeatureEnabled, getClientErrorObject, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import { useSelector, useDispatch } from 'react-redux'; import rison from 'rison'; diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx index 7d45bd351e8..bdaa4fa3407 100644 --- a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx @@ -18,7 +18,8 @@ */ import { useState, useEffect, useMemo, ChangeEvent } from 'react'; import type { DatabaseObject } from 'src/features/databases/types'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Input, Button, diff --git a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx index 7c68662cf60..48c0a51a25f 100644 --- a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx @@ -21,7 +21,8 @@ import { FunctionComponent, useState, useRef, ChangeEvent } from 'react'; import SchemaForm, { FormProps } from '@rjsf/core'; import { FormValidation } from '@rjsf/utils'; import validator from '@rjsf/validator-ajv8'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { parseDate } from 'chrono-node'; import { ModalTrigger, diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx index 7249d5909fb..97f25e67a96 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - t, - getClientErrorObject, - SupersetClient, - css, -} from '@superset-ui/core'; +import { t, getClientErrorObject, SupersetClient } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Button } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx index e64dd74be8c..d7a2b0c44f6 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx @@ -18,8 +18,9 @@ */ import { FC } from 'react'; import { shallowEqual, useSelector } from 'react-redux'; -import { Alert, EmptyState } from '@superset-ui/core/components'; -import { FeatureFlag, styled, t, isFeatureEnabled } from '@superset-ui/core'; +import { EmptyState } from '@superset-ui/core/components'; +import { FeatureFlag, t, isFeatureEnabled } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; import { SqlLabRootState } from 'src/SqlLab/types'; import ResultSet from '../ResultSet'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index 27567be6ac6..0747c5b86a4 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -20,7 +20,8 @@ import { createRef, useCallback, useMemo } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { nanoid } from 'nanoid'; import Tabs from '@superset-ui/core/components/Tabs'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { removeTables, setActiveSouthPaneTab } from 'src/SqlLab/actions/sqlLab'; diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx index 4585ed09cdf..9c3795e29ce 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx @@ -33,16 +33,14 @@ import useEffectEvent from 'src/hooks/useEffectEvent'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import AutoSizer from 'react-virtualized-auto-sizer'; import { - css, FeatureFlag, isFeatureEnabled, - styled, t, - useTheme, getExtensionsRegistry, QueryResponse, Query, } from '@superset-ui/core'; +import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; import type { QueryEditor, SqlLabRootState, @@ -52,7 +50,6 @@ import type { DatabaseObject } from 'src/features/databases/types'; import { debounce, isEmpty, noop } from 'lodash'; import Mousetrap from 'mousetrap'; import { - Alert, Button, Dropdown, EmptyState, diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx index a6667270ec3..32232363719 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx @@ -34,7 +34,8 @@ import { } from 'src/SqlLab/actions/sqlLab'; import { Button, EmptyState, Icons } from '@superset-ui/core/components'; import { type DatabaseObject } from 'src/components'; -import { t, styled, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { TableSelectorMultiple } from 'src/components/TableSelector'; import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; import { diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx index e78977d1aca..84b46884e87 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx @@ -22,14 +22,8 @@ import { bindActionCreators } from 'redux'; import { useSelector, useDispatch, shallowEqual } from 'react-redux'; import { MenuDotsDropdown } from '@superset-ui/core/components'; import { Menu, MenuItemType } from '@superset-ui/core/components/Menu'; -import { - styled, - css, - t, - QueryState, - SupersetTheme, - useTheme, -} from '@superset-ui/core'; +import { t, QueryState } from '@superset-ui/core'; +import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { removeQueryEditor, removeAllOtherQueryEditors, diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx index 91f6c5960ef..9fa47a93fd0 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx @@ -22,13 +22,8 @@ import { EditableTabs } from '@superset-ui/core/components/Tabs'; import { connect } from 'react-redux'; import URI from 'urijs'; import type { QueryEditor, SqlLabRootState } from 'src/SqlLab/types'; -import { - FeatureFlag, - styled, - t, - isFeatureEnabled, - css, -} from '@superset-ui/core'; +import { FeatureFlag, t, isFeatureEnabled } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Logger } from 'src/logger/LogUtils'; import { EmptyState, Tooltip } from '@superset-ui/core/components'; import { detectOS } from 'src/utils/common'; diff --git a/superset-frontend/src/SqlLab/components/TableElement/index.tsx b/superset-frontend/src/SqlLab/components/TableElement/index.tsx index 309c74d8b96..251c3cb7dcc 100644 --- a/superset-frontend/src/SqlLab/components/TableElement/index.tsx +++ b/superset-frontend/src/SqlLab/components/TableElement/index.tsx @@ -31,7 +31,8 @@ import { type CollapseProps, } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; -import { t, styled, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import { diff --git a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx index 2cad2baea6a..d52b1406907 100644 --- a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx +++ b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx @@ -19,17 +19,10 @@ import { type FC, useCallback, useMemo, useRef, useState } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { nanoid } from 'nanoid'; -import { - ClientErrorObject, - css, - getExtensionsRegistry, - styled, - t, - useTheme, -} from '@superset-ui/core'; +import { ClientErrorObject, getExtensionsRegistry, t } from '@superset-ui/core'; +import { css, styled, Alert, useTheme } from '@apache-superset/core/ui'; import { SafeMarkdown, - Alert, Breadcrumb, Card, Skeleton, diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx index e10e0c78e40..03717f41048 100644 --- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import { Badge, diff --git a/superset-frontend/src/components/Chart/Chart.tsx b/superset-frontend/src/components/Chart/Chart.tsx index 02808d465f2..12522b53149 100644 --- a/superset-frontend/src/components/Chart/Chart.tsx +++ b/superset-frontend/src/components/Chart/Chart.tsx @@ -23,13 +23,13 @@ import { isFeatureEnabled, logging, QueryFormData, - styled, t, SqlaFormData, ClientErrorObject, type JsonObject, type AgGridChartState, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import type { ChartState, Datasource, ChartStatus } from 'src/explore/types'; import { PLACEHOLDER_DATASOURCE } from 'src/dashboard/constants'; import { EmptyState, Loading } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx b/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx index 2606a1cba7d..172f5c60681 100644 --- a/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx +++ b/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx @@ -40,8 +40,8 @@ import { isFeatureEnabled, QueryFormData, t, - useTheme, } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { RootState } from 'src/dashboard/types'; import { MenuItem } from '@superset-ui/core/components/Menu'; import { usePermissions } from 'src/hooks/usePermissions'; diff --git a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx index b74ccb7e172..8e47d36ddcb 100644 --- a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx +++ b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx @@ -18,7 +18,7 @@ */ import { ReactNode } from 'react'; -import { css, SupersetTheme } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx index 389f1373880..6463948827e 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx @@ -21,9 +21,9 @@ import { BaseFormData, QueryData, SuperChart, - css, ContextMenuFilters, } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Dataset } from '../types'; interface DrillByChartProps { diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx index f118d34c7de..eec8fd8ce5b 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx @@ -23,19 +23,17 @@ import { BaseFormData, Column, QueryData, - css, ensureIsArray, isDefined, t, - useTheme, ContextMenuFilters, AdhocFilter, } from '@superset-ui/core'; +import { css, useTheme, Alert } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; import { Button, - Alert, Modal, Loading, Breadcrumb, diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx index 08c23001db1..642fb42ab38 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx @@ -31,12 +31,11 @@ import { Behavior, Column, ContextMenuFilters, - css, ensureIsArray, getChartMetadataRegistry, t, - useTheme, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Constants, Input, diff --git a/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx b/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx index e8fb13e0163..38c38ca2d0d 100644 --- a/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx @@ -18,7 +18,8 @@ */ import { useMemo, useState } from 'react'; -import { css, SupersetTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { Radio } from '@superset-ui/core/components/Radio'; import { DrillByType } from '../types'; diff --git a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx index bda96d35aa8..7b2b85052c6 100644 --- a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled, isDefined, QueryData, t } from '@superset-ui/core'; +import { isDefined, QueryData, t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { SingleQueryResultPane } from 'src/explore/components/DataTablesPane/components/SingleQueryResultPane'; import Tabs from '@superset-ui/core/components/Tabs'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx index 6f627fc6c6c..faea69a624f 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx @@ -21,11 +21,10 @@ import { useCallback, useContext, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; import { BinaryQueryObjectFilterClause, - css, QueryFormData, t, - useTheme, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Button, Modal } from '@superset-ui/core/components'; import { useSelector } from 'react-redux'; import { DashboardPageIdContext } from 'src/dashboard/containers/DashboardPage'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx index 94d63afa1ef..bcc05abb304 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx @@ -28,13 +28,12 @@ import { import { useSelector } from 'react-redux'; import { BinaryQueryObjectFilterClause, - css, ensureIsArray, JsonObject, QueryFormData, t, - useTheme, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { useResizeDetector } from 'react-resize-detector'; import BooleanCell from '@superset-ui/core/components/Table/cell-renderers/BooleanCell'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx index ef2e06148ad..0e0f0f93468 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx @@ -21,11 +21,10 @@ import { useCallback, useMemo } from 'react'; import { Tag } from 'src/components/Tag'; import { BinaryQueryObjectFilterClause, - css, isAdhocColumn, t, - useTheme, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import RowCountLabel from 'src/components/RowCountLabel'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx b/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx index d766ee780bc..45fb77ad2da 100644 --- a/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx +++ b/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx @@ -18,12 +18,8 @@ */ import { ReactNode, CSSProperties, useCallback } from 'react'; -import { - css, - truncationCSS, - useCSSTextTruncation, - useTheme, -} from '@superset-ui/core'; +import { truncationCSS, useCSSTextTruncation } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Menu, type ItemType } from '@superset-ui/core/components/Menu'; import { Flex, Tooltip } from '@superset-ui/core/components'; import { MenuItemProps } from 'antd'; diff --git a/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx b/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx index e8c47054dcb..02988969e92 100644 --- a/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx +++ b/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx @@ -28,14 +28,13 @@ import { isEmpty } from 'lodash'; import { Behavior, BinaryQueryObjectFilterClause, - css, extractQueryFields, getChartMetadataRegistry, QueryFormData, removeHTMLTags, - styled, t, } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; import { type ItemType } from '@superset-ui/core/components/Menu'; import { RootState } from 'src/dashboard/types'; diff --git a/superset-frontend/src/components/CopyToClipboard/index.tsx b/superset-frontend/src/components/CopyToClipboard/index.tsx index d790fd05a8a..d822fee9f88 100644 --- a/superset-frontend/src/components/CopyToClipboard/index.tsx +++ b/superset-frontend/src/components/CopyToClipboard/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { Component, cloneElement, ReactElement } from 'react'; -import { t, css, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import copyTextToClipboard from 'src/utils/copy'; import { Tooltip } from '@superset-ui/core/components'; import withToasts from '../MessageToasts/withToasts'; diff --git a/superset-frontend/src/components/CrudThemeProvider.tsx b/superset-frontend/src/components/CrudThemeProvider.tsx index eafebf0f829..4ecc1c68ce2 100644 --- a/superset-frontend/src/components/CrudThemeProvider.tsx +++ b/superset-frontend/src/components/CrudThemeProvider.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, useEffect, useState } from 'react'; import { useThemeContext } from 'src/theme/ThemeProvider'; -import { Theme } from '@superset-ui/core'; +import { Theme } from '@apache-superset/core/ui'; import { Loading } from '@superset-ui/core/components'; interface CrudThemeProviderProps { diff --git a/superset-frontend/src/components/DatabaseSelector/index.tsx b/superset-frontend/src/components/DatabaseSelector/index.tsx index ccb1e1a22e1..6fc50b3e557 100644 --- a/superset-frontend/src/components/DatabaseSelector/index.tsx +++ b/superset-frontend/src/components/DatabaseSelector/index.tsx @@ -24,7 +24,8 @@ import { useRef, useCallback, } from 'react'; -import { styled, SupersetClient, SupersetError, t } from '@superset-ui/core'; +import { SupersetClient, SupersetError, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import rison from 'rison'; import RefreshLabel from '@superset-ui/core/components/RefreshLabel'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/components/DatabaseSelector/styles.ts b/superset-frontend/src/components/DatabaseSelector/styles.ts index db1ca766ca0..5b6b576aa1f 100644 --- a/superset-frontend/src/components/DatabaseSelector/styles.ts +++ b/superset-frontend/src/components/DatabaseSelector/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { FormLabel } from '@superset-ui/core/components'; export const StyledFormLabel = styled(FormLabel)` diff --git a/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx b/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx index 8ec8d560b61..3f95a756ad2 100644 --- a/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx +++ b/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx @@ -25,14 +25,9 @@ import { ChangeEvent, } from 'react'; +import { SupersetClient, t, getClientErrorObject } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; import { - SupersetClient, - t, - styled, - getClientErrorObject, -} from '@superset-ui/core'; -import { - Alert, Button, Constants, EmptyWrapperType, @@ -285,7 +280,6 @@ const ChangeDatasourceModal: FunctionComponent = ({ {!confirmChange && ( <> ({ marginBottom: theme.sizeUnit * 4 })} message={ diff --git a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx index 598aca2484d..32fcf6f977d 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx @@ -19,18 +19,15 @@ import { FunctionComponent, useState, useEffect, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { - styled, SupersetClient, getClientErrorObject, t, SupersetError, - useTheme, - css, } from '@superset-ui/core'; +import { styled, useTheme, css, Alert } from '@apache-superset/core/ui'; import { Icons, - Alert, Button, Checkbox, Modal, diff --git a/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx b/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx index 01887b3adde..2f010b02a32 100644 --- a/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx +++ b/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx @@ -18,7 +18,8 @@ */ import { PureComponent, ReactNode } from 'react'; import { nanoid } from 'nanoid'; -import { t, styled, css, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; import { Icons, Button, InfoTooltip } from '@superset-ui/core/components'; import { FilterValue } from 'react-table'; import Table, { diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx index 22ede5c41de..d5a9b26dcce 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.jsx @@ -22,19 +22,22 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Radio } from '@superset-ui/core/components/Radio'; import { - css, isFeatureEnabled, getCurrencySymbol, ensureIsArray, FeatureFlag, - styled, SupersetClient, - themeObject, t, - withTheme, getClientErrorObject, getExtensionsRegistry, } from '@superset-ui/core'; +import { + css, + styled, + themeObject, + Alert, + withTheme, +} from '@apache-superset/core/ui'; import Tabs from '@superset-ui/core/components/Tabs'; import WarningIconWithTooltip from '@superset-ui/core/components/WarningIconWithTooltip'; import TableSelector from 'src/components/TableSelector'; @@ -45,7 +48,6 @@ import SpatialControl from 'src/explore/components/controls/SpatialControl'; import withToasts from 'src/components/MessageToasts/withToasts'; import CurrencyControl from 'src/explore/components/controls/CurrencyControl'; import { - Alert, AsyncSelect, Badge, Button, diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx index 48a1b6e0447..5f6e4d15485 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { GenericLink } from 'src/components'; const DashboardLinksWrapper = styled.span` diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx index a3a1244895e..ee8cff11a86 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback, useRef } from 'react'; -import { styled, t, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { CertifiedBadge, InfoTooltip } from '@superset-ui/core/components'; import Table, { TableSize, diff --git a/superset-frontend/src/components/Datasource/components/Field/index.tsx b/superset-frontend/src/components/Datasource/components/Field/index.tsx index c663d50ae80..9af9e55c55a 100644 --- a/superset-frontend/src/components/Datasource/components/Field/index.tsx +++ b/superset-frontend/src/components/Datasource/components/Field/index.tsx @@ -18,7 +18,7 @@ */ import { useCallback, ReactNode, ReactElement, cloneElement } from 'react'; -import { css, SupersetTheme, useTheme } from '@superset-ui/core'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { Icons, Tooltip, diff --git a/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx b/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx index 44ac4be0b9c..50cd747c958 100644 --- a/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx +++ b/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, useCallback } from 'react'; import { Divider, Form, Typography } from '@superset-ui/core/components'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { recurseReactClone } from '../../utils'; import Field from '../Field'; diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx index 17048e1e53a..804612b8911 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx @@ -18,7 +18,8 @@ */ import { render, screen } from 'spec/helpers/testing-library'; -import { ErrorLevel, supersetTheme } from '@superset-ui/core'; +import { ErrorLevel } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { BasicErrorAlert } from './BasicErrorAlert'; jest.mock( diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index c8454e39982..92ce75e0806 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - ErrorLevel, - styled, - useTheme, - getColorVariants, -} from '@superset-ui/core'; +import { ErrorLevel } from '@superset-ui/core'; +import { styled, useTheme, getColorVariants } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components'; const StyledContent = styled.div` diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index 6a99b63ccb3..f907d4837fc 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useState } from 'react'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme, Alert } from '@apache-superset/core/ui'; import { - Alert, Icons, Modal, Tooltip, diff --git a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx index f964f0907d1..cdb68e29418 100644 --- a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx +++ b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Icons } from '@superset-ui/core/components'; -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; interface IssueCodeProps { code: number; diff --git a/superset-frontend/src/components/GridTable/Header.tsx b/superset-frontend/src/components/GridTable/Header.tsx index 456a7ddb22c..afbb7e6d2e5 100644 --- a/superset-frontend/src/components/GridTable/Header.tsx +++ b/superset-frontend/src/components/GridTable/Header.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useEffect, useRef, useState } from 'react'; -import { styled, useTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import type { Column, GridApi } from 'ag-grid-community'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/GridTable/HeaderMenu.tsx b/superset-frontend/src/components/GridTable/HeaderMenu.tsx index 3149fa2738b..c9425ef3de9 100644 --- a/superset-frontend/src/components/GridTable/HeaderMenu.tsx +++ b/superset-frontend/src/components/GridTable/HeaderMenu.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import type { Column, ColumnPinnedType, GridApi } from 'ag-grid-community'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/GridTable/index.tsx b/superset-frontend/src/components/GridTable/index.tsx index e8b260f28ff..2860847df62 100644 --- a/superset-frontend/src/components/GridTable/index.tsx +++ b/superset-frontend/src/components/GridTable/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useCallback, useMemo } from 'react'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { ThemedAgGridReact } from '@superset-ui/core/components'; import type { Column, GridOptions } from 'ag-grid-community'; import type { AgGridReactProps } from 'ag-grid-react'; diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx index 0d81b818e94..a7eecee14c7 100644 --- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx @@ -18,10 +18,10 @@ */ import { FunctionComponent } from 'react'; -import { t, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme, Alert } from '@apache-superset/core/ui'; import { getDatabaseDocumentationLinks } from 'src/views/CRUD/hooks'; -import { Alert } from '@superset-ui/core/components'; import { antdWarningAlertStyles } from './styles'; const supersetTextDocs = getDatabaseDocumentationLinks(); diff --git a/superset-frontend/src/components/ImportModal/index.tsx b/superset-frontend/src/components/ImportModal/index.tsx index ae6e4447cfc..6418d40b6a8 100644 --- a/superset-frontend/src/components/ImportModal/index.tsx +++ b/superset-frontend/src/components/ImportModal/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FunctionComponent, useEffect, useState, ChangeEvent } from 'react'; -import { styled, t, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { useImportResource } from 'src/views/CRUD/hooks'; import { Upload, diff --git a/superset-frontend/src/components/ImportModal/styles.ts b/superset-frontend/src/components/ImportModal/styles.ts index 07d22b080ff..99b660512d0 100644 --- a/superset-frontend/src/components/ImportModal/styles.ts +++ b/superset-frontend/src/components/ImportModal/styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css, SupersetTheme } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; export const antdWarningAlertStyles = (theme: SupersetTheme) => css` margin: ${theme.sizeUnit * 4}px 0; diff --git a/superset-frontend/src/components/ListView/ActionsBar.tsx b/superset-frontend/src/components/ListView/ActionsBar.tsx index 40959e8f363..8d798eb81fc 100644 --- a/superset-frontend/src/components/ListView/ActionsBar.tsx +++ b/superset-frontend/src/components/ListView/ActionsBar.tsx @@ -36,7 +36,7 @@ * under the License. */ import { ReactElement } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { IconNameType, Icons, diff --git a/superset-frontend/src/components/ListView/CardCollection.tsx b/superset-frontend/src/components/ListView/CardCollection.tsx index 14e22efa0ab..7fe7d4505e4 100644 --- a/superset-frontend/src/components/ListView/CardCollection.tsx +++ b/superset-frontend/src/components/ListView/CardCollection.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, MouseEvent as ReactMouseEvent } from 'react'; import { TableInstance, Row, UseRowSelectRowProps } from 'react-table'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import cx from 'classnames'; interface CardCollectionProps { diff --git a/superset-frontend/src/components/ListView/CardSortSelect.tsx b/superset-frontend/src/components/ListView/CardSortSelect.tsx index 9be9b7cc1bb..2dfb6c50444 100644 --- a/superset-frontend/src/components/ListView/CardSortSelect.tsx +++ b/superset-frontend/src/components/ListView/CardSortSelect.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useMemo } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { FormLabel, Select } from '@superset-ui/core/components'; import { SELECT_WIDTH } from './utils'; import { CardSortSelectOption, SortColumn } from './types'; diff --git a/superset-frontend/src/components/ListView/CrossLinks.tsx b/superset-frontend/src/components/ListView/CrossLinks.tsx index c78d6a8b184..05c5cee227b 100644 --- a/superset-frontend/src/components/ListView/CrossLinks.tsx +++ b/superset-frontend/src/components/ListView/CrossLinks.tsx @@ -17,7 +17,8 @@ * under the License. */ import { memo, useMemo } from 'react'; -import { styled, useTruncation } from '@superset-ui/core'; +import { useTruncation } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Link } from 'react-router-dom'; import CrossLinksTooltip from './CrossLinksTooltip'; diff --git a/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx b/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx index ffde1da90cb..069f9c56388 100644 --- a/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx +++ b/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Link } from 'react-router-dom'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/ListView/Filters/Base.ts b/superset-frontend/src/components/ListView/Filters/Base.ts index 3c8c32521a4..7f5fd9d05e3 100644 --- a/superset-frontend/src/components/ListView/Filters/Base.ts +++ b/superset-frontend/src/components/ListView/Filters/Base.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Flex } from '@superset-ui/core/components'; interface FilterContainerProps { diff --git a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx index 3023fd896d4..40cc0b961af 100644 --- a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx +++ b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, forwardRef, useImperativeHandle, RefObject } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { InputNumber } from '@superset-ui/core/components/Input'; import { FormLabel } from '@superset-ui/core/components/Form'; import type { BaseFilter, FilterHandler } from './types'; diff --git a/superset-frontend/src/components/ListView/Filters/Search.tsx b/superset-frontend/src/components/ListView/Filters/Search.tsx index cad88f97407..25df6632d08 100644 --- a/superset-frontend/src/components/ListView/Filters/Search.tsx +++ b/superset-frontend/src/components/ListView/Filters/Search.tsx @@ -24,7 +24,8 @@ import { ChangeEvent, } from 'react'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Input, InfoTooltip, diff --git a/superset-frontend/src/components/ListView/Filters/index.tsx b/superset-frontend/src/components/ListView/Filters/index.tsx index 391f2cba2e4..abac7d54e1d 100644 --- a/superset-frontend/src/components/ListView/Filters/index.tsx +++ b/superset-frontend/src/components/ListView/Filters/index.tsx @@ -24,7 +24,7 @@ import { RefObject, } from 'react'; -import { withTheme } from '@superset-ui/core'; +import { withTheme } from '@apache-superset/core/ui'; import type { ListViewFilterValue as FilterValue, diff --git a/superset-frontend/src/components/ListView/ListView.tsx b/superset-frontend/src/components/ListView/ListView.tsx index 100ac943777..80d49516806 100644 --- a/superset-frontend/src/components/ListView/ListView.tsx +++ b/superset-frontend/src/components/ListView/ListView.tsx @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; import { useCallback, useEffect, useRef, useState, ReactNode } from 'react'; import cx from 'classnames'; import TableCollection from '@superset-ui/core/components/TableCollection'; import BulkTagModal from 'src/features/tags/BulkTagModal'; import { - Alert, Button, Checkbox, Icons, diff --git a/superset-frontend/src/components/MessageToasts/Toast.tsx b/superset-frontend/src/components/MessageToasts/Toast.tsx index a187abf2fb6..6370b7002af 100644 --- a/superset-frontend/src/components/MessageToasts/Toast.tsx +++ b/superset-frontend/src/components/MessageToasts/Toast.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css, SupersetTheme, useTheme } from '@superset-ui/core'; +import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import cx from 'classnames'; import { Interweave } from 'interweave'; import { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx index 1de0e159786..3fba4dcb5bc 100644 --- a/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx +++ b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ToastMeta } from 'src/components/MessageToasts/types'; import Toast from './Toast'; diff --git a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx index a18131c2454..a83114ba947 100644 --- a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx +++ b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx @@ -18,7 +18,7 @@ */ import { ReactNode } from 'react'; import { Collapse, CollapseLabelInModal } from '@superset-ui/core/components'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; interface CollapsibleModalSectionProps { sectionKey: string; diff --git a/superset-frontend/src/components/Modal/ModalFormField.tsx b/superset-frontend/src/components/Modal/ModalFormField.tsx index db2293a4e54..14e71e245e1 100644 --- a/superset-frontend/src/components/Modal/ModalFormField.tsx +++ b/superset-frontend/src/components/Modal/ModalFormField.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { InfoTooltip } from '@superset-ui/core/components'; interface ModalFormFieldProps { diff --git a/superset-frontend/src/components/Modal/StandardModal.tsx b/superset-frontend/src/components/Modal/StandardModal.tsx index 49e0d31433a..dd60ee97d34 100644 --- a/superset-frontend/src/components/Modal/StandardModal.tsx +++ b/superset-frontend/src/components/Modal/StandardModal.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Modal, Loading, Flex } from '@superset-ui/core/components'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; diff --git a/superset-frontend/src/components/Modal/useModalValidation.tsx b/superset-frontend/src/components/Modal/useModalValidation.tsx index 0197574af03..5d62901bfb3 100644 --- a/superset-frontend/src/components/Modal/useModalValidation.tsx +++ b/superset-frontend/src/components/Modal/useModalValidation.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useCallback, useMemo, ReactNode } from 'react'; -import { css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { List } from '@superset-ui/core/components'; export interface SectionValidationObject { diff --git a/superset-frontend/src/components/ModalTitleWithIcon/index.tsx b/superset-frontend/src/components/ModalTitleWithIcon/index.tsx index 085ae5990cb..037e24159a5 100644 --- a/superset-frontend/src/components/ModalTitleWithIcon/index.tsx +++ b/superset-frontend/src/components/ModalTitleWithIcon/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { isValidElement, cloneElement } from 'react'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Typography, Icons, TitleProps } from '@superset-ui/core/components'; import type { IconType } from '@superset-ui/core/components/Icons/types'; diff --git a/superset-frontend/src/components/ResizableSidebar/index.tsx b/superset-frontend/src/components/ResizableSidebar/index.tsx index f19bae62b9b..500283a436e 100644 --- a/superset-frontend/src/components/ResizableSidebar/index.tsx +++ b/superset-frontend/src/components/ResizableSidebar/index.tsx @@ -18,7 +18,7 @@ */ import { FC, ReactNode } from 'react'; import { Resizable } from 're-resizable'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import useStoredSidebarWidth from './useStoredSidebarWidth'; const ResizableWrapper = styled.div` diff --git a/superset-frontend/src/components/SQLEditorWithValidation/index.tsx b/superset-frontend/src/components/SQLEditorWithValidation/index.tsx index 912e91d25fa..9885370e7f1 100644 --- a/superset-frontend/src/components/SQLEditorWithValidation/index.tsx +++ b/superset-frontend/src/components/SQLEditorWithValidation/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useState, useEffect, forwardRef } from 'react'; -import { styled, t, SupersetClient } from '@superset-ui/core'; +import { t, SupersetClient } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { SQLEditor, Button, diff --git a/superset-frontend/src/components/TableSelector/index.tsx b/superset-frontend/src/components/TableSelector/index.tsx index d3057d1a720..f9e0482b8f9 100644 --- a/superset-frontend/src/components/TableSelector/index.tsx +++ b/superset-frontend/src/components/TableSelector/index.tsx @@ -26,11 +26,11 @@ import { import type { SelectValue } from '@superset-ui/core/components'; import { - styled, t, getClientErrorMessage, getClientErrorObject, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { CertifiedBadge, Select } from '@superset-ui/core/components'; import { DatabaseSelector } from 'src/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/Tag/index.tsx b/superset-frontend/src/components/Tag/index.tsx index 308a5ff6e0d..385338e5fc1 100644 --- a/superset-frontend/src/components/Tag/index.tsx +++ b/superset-frontend/src/components/Tag/index.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Link } from 'react-router-dom'; import type { TagType } from 'src/types/TagType'; import { Tag as AntdTag } from '@superset-ui/core/components/Tag'; diff --git a/superset-frontend/src/components/TagsList/index.tsx b/superset-frontend/src/components/TagsList/index.tsx index a83861f26be..4cc3c9e39ab 100644 --- a/superset-frontend/src/components/TagsList/index.tsx +++ b/superset-frontend/src/components/TagsList/index.tsx @@ -18,7 +18,7 @@ */ import { useMemo, useState } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import type { TagType } from 'src/types/TagType'; import { Tag } from 'src/components/Tag'; diff --git a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx index c913424e6db..a677e1a64eb 100644 --- a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx +++ b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx @@ -29,7 +29,8 @@ import { FC, } from 'react'; -import { t, isFeatureEnabled, FeatureFlag, css } from '@superset-ui/core'; +import { t, isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Tooltip, ImageLoader } from '@superset-ui/core/components'; import { GenericLink, usePluginContext } from 'src/components'; import { assetUrl } from 'src/utils/assetUrl'; diff --git a/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx b/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx index d61bde28b31..be5ecd076ea 100644 --- a/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx +++ b/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx @@ -19,7 +19,8 @@ /* eslint-env browser */ import tinycolor from 'tinycolor2'; import Tabs from '@superset-ui/core/components/Tabs'; -import { t, css, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import SliceAdder from 'src/dashboard/containers/SliceAdder'; import dashboardComponents from 'src/visualizations/presets/dashboardComponents'; import NewColumn from '../gridComponents/new/NewColumn'; diff --git a/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx b/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx index f5e2ff2966f..357957a916c 100644 --- a/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx +++ b/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx @@ -18,14 +18,13 @@ */ import { ReactNode, useMemo } from 'react'; import { - css, ColorScheme, ColorSchemeGroup, t, - useTheme, getCategoricalSchemeRegistry, CategoricalScheme, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { sortBy } from 'lodash'; import { Select, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 880d5c7fbe8..f4a75bb405c 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -19,15 +19,8 @@ /* eslint-env browser */ import cx from 'classnames'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { - addAlpha, - css, - JsonObject, - styled, - t, - useTheme, - useElementOnScreen, -} from '@superset-ui/core'; +import { addAlpha, JsonObject, t, useElementOnScreen } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { EmptyState, Loading } from '@superset-ui/core/components'; import { ErrorBoundary, BasicErrorAlert } from 'src/components'; diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardWrapper.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardWrapper.tsx index f73fe36e9ae..ec423b7bb03 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardWrapper.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardWrapper.tsx @@ -18,7 +18,7 @@ */ import { FC, PropsWithChildren, useEffect, useState } from 'react'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Constants } from '@superset-ui/core/components'; import { RootState } from 'src/dashboard/types'; import { useSelector } from 'react-redux'; diff --git a/superset-frontend/src/dashboard/components/DashboardGrid.jsx b/superset-frontend/src/dashboard/components/DashboardGrid.jsx index 0f4997d24e1..a344ab5d0bc 100644 --- a/superset-frontend/src/dashboard/components/DashboardGrid.jsx +++ b/superset-frontend/src/dashboard/components/DashboardGrid.jsx @@ -20,7 +20,8 @@ import { PureComponent, Fragment } from 'react'; import { withTheme } from '@emotion/react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { addAlpha, css, styled, t } from '@superset-ui/core'; +import { addAlpha, t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { EmptyState } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { navigateTo } from 'src/utils/navigationUtils'; diff --git a/superset-frontend/src/dashboard/components/EmbeddedModal/index.tsx b/superset-frontend/src/dashboard/components/EmbeddedModal/index.tsx index 1ad5fec6ad4..c9c88ded8a1 100644 --- a/superset-frontend/src/dashboard/components/EmbeddedModal/index.tsx +++ b/superset-frontend/src/dashboard/components/EmbeddedModal/index.tsx @@ -19,12 +19,11 @@ import { useCallback, useEffect, useState } from 'react'; import { makeApi, - styled, SupersetApiError, t, - css, getExtensionsRegistry, } from '@superset-ui/core'; +import { styled, css, Alert } from '@apache-superset/core/ui'; import { Button, FormItem, @@ -33,7 +32,6 @@ import { Modal, Loading, Form, - Alert, Space, } from '@superset-ui/core/components'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx index 18081ca2cb5..efaca53d51c 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx @@ -19,7 +19,8 @@ import { RefObject, useEffect, useRef, KeyboardEvent } from 'react'; import { useSelector } from 'react-redux'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { List, Popover } from '@superset-ui/core/components'; import { FiltersContainer, diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx index 37ab2ef5590..374de9630ac 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/FilterIndicator/index.tsx @@ -18,7 +18,7 @@ */ import { forwardRef } from 'react'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { getFilterValueForDisplay } from 'src/dashboard/components/nativeFilters/utils'; import { diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx index 9c67f1f7f87..cff149e4281 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; export const Pill = styled.div` ${({ theme }) => css` diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx index f9d845e094d..aad60240336 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx @@ -33,10 +33,10 @@ import { DataMaskStateWithId, Filters, JsonObject, - styled, t, usePrevious, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; diff --git a/superset-frontend/src/dashboard/components/GroupByBadge/index.tsx b/superset-frontend/src/dashboard/components/GroupByBadge/index.tsx index 6c21d033ae8..8c1af0aecaa 100644 --- a/superset-frontend/src/dashboard/components/GroupByBadge/index.tsx +++ b/superset-frontend/src/dashboard/components/GroupByBadge/index.tsx @@ -18,7 +18,8 @@ */ import { memo, useMemo, useState, useRef } from 'react'; import { useSelector } from 'react-redux'; -import { styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Icons, Badge, Tooltip, Tag } from '@superset-ui/core/components'; import { getFilterValueForDisplay } from '../nativeFilters/utils'; import { ChartCustomizationItem } from '../nativeFilters/ChartCustomization/types'; diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index 1a4f3b43bf1..17f37440b5d 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -20,13 +20,12 @@ import { extendedDayjs } from '@superset-ui/core/utils/dates'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { - styled, - css, isFeatureEnabled, FeatureFlag, t, getExtensionsRegistry, } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Global } from '@emotion/react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { bindActionCreators } from 'redux'; diff --git a/superset-frontend/src/dashboard/components/IconButton.tsx b/superset-frontend/src/dashboard/components/IconButton.tsx index 9e5b9c96e4e..df1298097ca 100644 --- a/superset-frontend/src/dashboard/components/IconButton.tsx +++ b/superset-frontend/src/dashboard/components/IconButton.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; interface IconButtonProps { icon: JSX.Element; diff --git a/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx b/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx index 77f6e2d3ccd..42d88d6643c 100644 --- a/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx +++ b/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx @@ -27,7 +27,8 @@ import { saveDashboardRequest, setOverrideConfirm, } from 'src/dashboard/actions/dashboardState'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { SAVE_TYPE_OVERWRITE_CONFIRMED } from 'src/dashboard/util/constants'; const STICKY_HEADER_TOP = 16; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx index 499cf27de3d..970d584cdef 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { JsonEditor } from '@superset-ui/core/components'; import { ModalFormField } from 'src/components/Modal'; import { ValidationObject } from 'src/components/Modal/useModalValidation'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx index 1931fc692b0..95e16def768 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx @@ -19,12 +19,12 @@ import { useCallback, useEffect, useState } from 'react'; import { t, - styled, SupersetClient, isFeatureEnabled, FeatureFlag, } from '@superset-ui/core'; -import { CssEditor, Select, Alert } from '@superset-ui/core/components'; +import { styled, Alert } from '@apache-superset/core/ui'; +import { CssEditor, Select } from '@superset-ui/core/components'; import rison from 'rison'; import ColorSchemeSelect from 'src/dashboard/components/ColorSchemeSelect'; import { ModalFormField } from 'src/components/Modal'; diff --git a/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx b/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx index 5f0352a0750..6accfe10060 100644 --- a/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx +++ b/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState } from 'react'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Radio, Input } from '@superset-ui/core/components'; // Minimum safe refresh interval to prevent server overload diff --git a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx index c4573768d52..0478246becf 100644 --- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx +++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx @@ -17,8 +17,9 @@ * under the License. */ import { useState } from 'react'; -import { t, styled } from '@superset-ui/core'; -import { Alert, Form } from '@superset-ui/core/components'; +import { t } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; +import { Form } from '@superset-ui/core/components'; import { StandardModal } from 'src/components/Modal'; import { RefreshFrequencySelect, diff --git a/superset-frontend/src/dashboard/components/SaveModal.tsx b/superset-frontend/src/dashboard/components/SaveModal.tsx index 99bad3e48f6..a449b3bf109 100644 --- a/superset-frontend/src/dashboard/components/SaveModal.tsx +++ b/superset-frontend/src/dashboard/components/SaveModal.tsx @@ -27,7 +27,8 @@ import { Divider, Flex, } from '@superset-ui/core/components'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { ModalTrigger, diff --git a/superset-frontend/src/dashboard/components/SliceAdder.tsx b/superset-frontend/src/dashboard/components/SliceAdder.tsx index 8a53da645fa..650521b0baa 100644 --- a/superset-frontend/src/dashboard/components/SliceAdder.tsx +++ b/superset-frontend/src/dashboard/components/SliceAdder.tsx @@ -22,7 +22,8 @@ import AutoSizer from 'react-virtualized-auto-sizer'; import { FixedSizeList as List } from 'react-window'; // @ts-ignore import { createFilter } from 'react-search-input'; -import { t, styled, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Button, Checkbox, diff --git a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx index f79529f0803..b9c0293534f 100644 --- a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx @@ -24,15 +24,8 @@ import { useRef, useState, } from 'react'; -import { - css, - getExtensionsRegistry, - QueryData, - styled, - SupersetTheme, - t, - useTheme, -} from '@superset-ui/core'; +import { getExtensionsRegistry, QueryData, t } from '@superset-ui/core'; +import { css, styled, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { useUiConfig } from 'src/components/UiConfigContext'; import { isEmbedded } from 'src/dashboard/util/isEmbedded'; import { Tooltip, EditableTitle, Icons } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx index 61e6364a7e3..849522e7e19 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx @@ -18,7 +18,8 @@ */ import { ReactChild, RefObject, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; -import { css, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Button, ModalTrigger } from '@superset-ui/core/components'; export const ViewResultsModalTrigger = ({ diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index 5844730edb7..aaa9b9ceb70 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -29,17 +29,15 @@ import { RouteComponentProps, useHistory } from 'react-router-dom'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; import { Behavior, - css, isFeatureEnabled, FeatureFlag, - useTheme, getChartMetadataRegistry, - styled, t, VizType, BinaryQueryObjectFilterClause, QueryFormData, } from '@superset-ui/core'; +import { css, useTheme, styled } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; import { Menu, MenuItem } from '@superset-ui/core/components/Menu'; import { diff --git a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx index e6c798f673b..152a514a4df 100644 --- a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx +++ b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState } from 'react'; -import { getClientErrorObject, t, useTheme } from '@superset-ui/core'; +import { getClientErrorObject, t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Button, Icons, diff --git a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx index 8581c69c25c..460f38c6b9f 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx +++ b/superset-frontend/src/dashboard/components/dnd/DragDroppable.jsx @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { TAB_TYPE } from 'src/dashboard/util/componentTypes'; import { DragSource, DropTarget } from 'react-dnd'; import cx from 'classnames'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { componentShape } from '../../util/propShapes'; import { dragConfig, dropConfig } from './dragDroppableConfig'; diff --git a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx index f12d173f957..caa947d902a 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx +++ b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx @@ -17,7 +17,7 @@ * under the License. */ import { LegacyRef } from 'react'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; interface DragHandleProps { diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx b/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx index 7261fbfa01f..a06364dbe4b 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { supersetTheme } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { cleanup, render, diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx b/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx index 0695bb125ff..428daf4ec33 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx @@ -17,7 +17,7 @@ * under the License. */ import { createRef, PureComponent } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ModalTrigger, ModalTriggerRef, diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx index 7f1e6022f97..14b9c211851 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.jsx @@ -20,7 +20,8 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { Button, Input } from '@superset-ui/core/components'; -import { css, t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import buildFilterScopeTreeEntry from 'src/dashboard/util/buildFilterScopeTreeEntry'; import getFilterScopeNodesTree from 'src/dashboard/util/getFilterScopeNodesTree'; diff --git a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx index bb52ef24402..da7ce57f2fb 100644 --- a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx +++ b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.jsx @@ -17,7 +17,7 @@ * under the License. */ import cx from 'classnames'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx index f30bcfa4e9f..353ae007726 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx @@ -19,7 +19,8 @@ import cx from 'classnames'; import { useCallback, useEffect, useRef, useMemo, useState, memo } from 'react'; import PropTypes from 'prop-types'; -import { styled, t, logging } from '@superset-ui/core'; +import { t, logging } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import { useHistory } from 'react-router-dom'; import { bindActionCreators } from 'redux'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx index 2d975f99454..7d68c8ceaec 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx @@ -21,7 +21,7 @@ import { useState, useMemo, useCallback, useEffect, memo } from 'react'; import { ResizeCallback, ResizeStartCallback } from 're-resizable'; import cx from 'classnames'; import { useSelector } from 'react-redux'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { LayoutItem, RootState } from 'src/dashboard/types'; import AnchorLink from 'src/dashboard/components/AnchorLink'; import Chart from 'src/dashboard/components/gridComponents/Chart'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Column/Column.jsx b/superset-frontend/src/dashboard/components/gridComponents/Column/Column.jsx index 62112fed5fd..acdd5cbb3e4 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Column/Column.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Column/Column.jsx @@ -19,7 +19,8 @@ import { Fragment, useCallback, useState, useMemo, memo } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import DashboardComponent from 'src/dashboard/containers/DashboardComponent'; import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.jsx b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.jsx index 3247cf794d6..7ee829f6767 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.jsx @@ -18,7 +18,7 @@ */ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Draggable } from '../../dnd/DragDroppable'; import HoverMenu from '../../menu/HoverMenu'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.jsx b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.jsx index b9e7e71a6c2..37ddae5e347 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.jsx @@ -19,7 +19,7 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import PopoverDropdown from '@superset-ui/core/components/PopoverDropdown'; import { EditableTitle } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx index c8de3aa722b..87628dfde66 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.jsx @@ -21,7 +21,8 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import cx from 'classnames'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { SafeMarkdown, MarkdownEditor } from '@superset-ui/core/components'; import { Logger, LOG_ACTIONS_RENDER_CHART } from 'src/logger/LogUtils'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx index 5f298b192d1..14fc956d88f 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx @@ -25,7 +25,7 @@ import { userEvent, RenderResult, } from 'spec/helpers/testing-library'; -import { supersetTheme } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { mockStore } from 'spec/fixtures/mockStore'; import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout'; import MarkdownConnected from './Markdown'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Row/Row.jsx b/superset-frontend/src/dashboard/components/gridComponents/Row/Row.jsx index 917cdfc9654..ce361c29827 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Row/Row.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Row/Row.jsx @@ -27,13 +27,8 @@ import { } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; -import { - css, - FeatureFlag, - isFeatureEnabled, - styled, - t, -} from '@superset-ui/core'; +import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Icons, Constants } from '@superset-ui/core/components'; import { diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.jsx index 900d658ccad..87011ae4c73 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.jsx @@ -20,7 +20,8 @@ import { Fragment, useCallback, memo } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { EditableTitle, EmptyState } from '@superset-ui/core/components'; import { setEditMode } from 'src/dashboard/actions/dashboardState'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.jsx index c59b38609c7..665977e9c83 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.jsx @@ -18,7 +18,8 @@ */ import { useCallback, useEffect, useMemo, useState, memo } from 'react'; import PropTypes from 'prop-types'; -import { t, usePrevious, useTheme, styled } from '@superset-ui/core'; +import { t, usePrevious } from '@superset-ui/core'; +import { useTheme, styled } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; import { Icons } from '@superset-ui/core/components/Icons'; import { LOG_ACTIONS_SELECT_DASHBOARD_TAB } from 'src/logger/LogUtils'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx index 52e34638f75..b1bb5a48e7e 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx @@ -17,7 +17,7 @@ * under the License. */ import { memo, ReactElement, RefObject } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { LineEditableTabs, TabsProps as AntdTabsProps, diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx index 3ceda794425..542de90040e 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx @@ -18,7 +18,7 @@ */ import { PureComponent } from 'react'; import cx from 'classnames'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { DragDroppable } from 'src/dashboard/components/dnd/DragDroppable'; import type { ConnectDragSource } from 'react-dnd'; import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants'; diff --git a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx index eb00e072a57..ed032b39863 100644 --- a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx +++ b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx @@ -18,7 +18,8 @@ */ import { PureComponent } from 'react'; import cx from 'classnames'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import backgroundStyleOptions from 'src/dashboard/util/backgroundStyleOptions'; import PopoverDropdown, { diff --git a/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx b/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx index b34917b4e2f..4ee784fd2ba 100644 --- a/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx +++ b/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx @@ -19,7 +19,7 @@ */ import { RefObject, ReactNode, PureComponent } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import cx from 'classnames'; interface HoverMenuProps { diff --git a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx index 3b8ba9215e4..4644bc3a7d8 100644 --- a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx +++ b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx @@ -18,7 +18,8 @@ */ import { ReactNode, CSSProperties, PureComponent } from 'react'; import cx from 'classnames'; -import { addAlpha, css, styled } from '@superset-ui/core'; +import { addAlpha } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; type ShouldFocusContainer = HTMLDivElement & { contains: (event_target: EventTarget & HTMLElement) => boolean; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationForm.tsx index 2b621d5a8bb..ffd13db9084 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationForm.tsx @@ -26,7 +26,8 @@ import { ReactNode, } from 'react'; import { useSelector } from 'react-redux'; -import { t, styled, css, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import { DatasourcesState, ChartsState, RootState } from 'src/dashboard/types'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationModal.tsx index 7ac0ab075d8..fc19e7ffdf8 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationModal.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback, memo } from 'react'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; import { isEmpty, isEqual, sortBy, debounce } from 'lodash'; import { Form } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitleContainer.tsx index bb8dba204fd..ca6e0bf6730 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitleContainer.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, forwardRef, MouseEvent } from 'react'; -import { styled, t, css, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { Icons, Flex } from '@superset-ui/core/components'; import { ChartCustomizationItem } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitlePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitlePane.tsx index a5eabae1547..cd6488a58be 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitlePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/ChartCustomizationTitlePane.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, useRef } from 'react'; -import { styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Button, Icons } from '@superset-ui/core/components'; import ChartCustomizationTitleContainer from './ChartCustomizationTitleContainer'; import { ChartCustomizationItem } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/GroupByFilterCard.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/GroupByFilterCard.tsx index 10ea7c74bef..e465a5eb78d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/GroupByFilterCard.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ChartCustomization/GroupByFilterCard.tsx @@ -17,14 +17,8 @@ * under the License. */ import { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { - styled, - t, - css, - DataMaskStateWithId, - useTheme, - useTruncation, -} from '@superset-ui/core'; +import { t, DataMaskStateWithId, useTruncation } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { Typography, Select, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx index 350e9591dd0..a1baa96c1bc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx @@ -20,11 +20,11 @@ import { FC, ReactNode } from 'react'; import { Button, type OnClickHandler, - Alert, Icons, Flex, } from '@superset-ui/core/components'; -import { t, useTheme, styled, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, useTheme, Alert } from '@apache-superset/core/ui'; import { BaseExpandButtonWrapper } from './SharedStyles'; const StyledAlert = styled(Alert)` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx index 2d79551a144..84a0181fe52 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Form, StyledModal } from '@superset-ui/core/components'; const MODAL_MARGIN = 16; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx index 6b28aa72f23..7d2db7dec63 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx @@ -18,14 +18,12 @@ */ import { useMemo } from 'react'; import { - css, DataMaskState, DataMaskStateWithId, t, isDefined, - SupersetTheme, - styled, } from '@superset-ui/core'; +import { css, SupersetTheme, styled } from '@apache-superset/core/ui'; import { Button } from '@superset-ui/core/components'; import { OPEN_FILTER_BAR_WIDTH } from 'src/dashboard/constants'; import tinycolor from 'tinycolor2'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx index 0620f3a6479..dfc40e11b80 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx @@ -18,7 +18,7 @@ */ import { useCallback } from 'react'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { CrossFilterIndicator } from 'src/dashboard/components/nativeFilters/selectors'; import { useDispatch } from 'react-redux'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx index d8745dd22ba..eb81cd13b87 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx @@ -17,13 +17,8 @@ * under the License. */ -import { - styled, - css, - useTheme, - getColumnLabel, - useCSSTextTruncation, -} from '@superset-ui/core'; +import { getColumnLabel, useCSSTextTruncation } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { CrossFilterIndicator } from 'src/dashboard/components/nativeFilters/selectors'; import { Tag } from 'src/components/Tag'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx index 7cf19545654..429c36e9ac0 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx @@ -17,13 +17,8 @@ * under the License. */ -import { - t, - css, - styled, - useTheme, - useCSSTextTruncation, -} from '@superset-ui/core'; +import { t, useCSSTextTruncation } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; import { FilterBarOrientation } from 'src/dashboard/types'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx index da1da7e8433..a58f3c2888a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx @@ -18,7 +18,8 @@ */ import { ReactNode, useMemo } from 'react'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { ChartConfiguration, DashboardLayout, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx index d2e56685fc6..374a35690ab 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, NativeFilterScope, styled, useTheme } from '@superset-ui/core'; +import { NativeFilterScope } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { ChartConfiguration } from 'src/dashboard/types'; import { ScopingTreePanel } from './ScopingTreePanel'; import { ChartsScopingListPanel } from './ChartsScopingListPanel'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx index 9af2fbae2c0..34ac3c06613 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx @@ -18,15 +18,9 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { - css, - isDefined, - NativeFilterScope, - styled, - t, - useTheme, -} from '@superset-ui/core'; -import { Select, Tooltip, Alert } from '@superset-ui/core/components'; +import { isDefined, NativeFilterScope, t } from '@superset-ui/core'; +import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; +import { Select, Tooltip } from '@superset-ui/core/components'; import { noOp } from 'src/utils/common'; import ScopingTree from 'src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx index 76f1a8c5ac5..938a56c760f 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx @@ -18,7 +18,8 @@ */ import { useMemo, useState, useCallback } from 'react'; -import { t, css, useTheme, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { FilterBarOrientation } from 'src/dashboard/types'; import CrossFilter from './CrossFilter'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts index 0eee141c100..ccd7e2c5f45 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; export const ellipsisCss = css` white-space: nowrap; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx index 8e8aa610003..1262e5bcd75 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx @@ -19,7 +19,8 @@ import { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { styled, t, useTheme, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { MenuProps } from '@superset-ui/core/components/Menu'; import { FilterBarOrientation, RootState } from 'src/dashboard/types'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl.tsx index 99a94c88d28..0e1af5ade96 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl.tsx @@ -22,7 +22,8 @@ import { InPortal, OutPortal, } from 'react-reverse-portal'; -import { styled, SupersetTheme, truncationCSS } from '@superset-ui/core'; +import { truncationCSS } from '@superset-ui/core'; +import { styled, SupersetTheme } from '@apache-superset/core/ui'; import { FormItem as StyledFormItem, Form, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx index 0aab10a8622..6c2d391c491 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx @@ -31,13 +31,10 @@ import { DataMaskStateWithId, Filter, Divider, - css, - SupersetTheme, t, isNativeFilterWithDataMask, - useTheme, - styled, } from '@superset-ui/core'; +import { css, SupersetTheme, useTheme, styled } from '@apache-superset/core/ui'; import { createHtmlPortalNode, InPortal, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx index 2c4c92d8896..f80a74f0463 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { FilterBarOrientation } from 'src/dashboard/types'; import FilterDivider from './FilterDivider'; import { FilterDividerProps } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx index 2201794f0da..52ac346264d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx @@ -17,12 +17,8 @@ * under the License. */ -import { - css, - useTheme, - useCSSTextTruncation, - truncationCSS, -} from '@superset-ui/core'; +import { useCSSTextTruncation, truncationCSS } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components'; import { FilterBarOrientation } from 'src/dashboard/types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx index 4e0d3a45fd2..b08ded73cdc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx @@ -35,12 +35,12 @@ import { getChartMetadataRegistry, JsonObject, QueryFormData, - styled, SuperChart, t, ClientErrorObject, getClientErrorObject, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { isEqual, isEqualWith } from 'lodash'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx index b52f7dfb0f3..c09e4d77833 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx @@ -18,7 +18,8 @@ */ import { ReactNode } from 'react'; -import { css, Divider, Filter, SupersetTheme } from '@superset-ui/core'; +import { Divider, Filter } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { FilterBarOrientation } from 'src/dashboard/types'; import { FiltersOutOfScopeCollapsible } from '../FiltersOutOfScopeCollapsible'; import { CrossFilterIndicator } from '../../selectors'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx index a0d6dccc9cf..b8eb7da9b56 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { css, Divider, Filter, SupersetTheme, t } from '@superset-ui/core'; +import { Divider, Filter, t } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { Collapse } from '@superset-ui/core/components'; export interface FiltersOutOfScopeCollapsibleProps { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx index dfee04a1b0d..47c192d655e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx @@ -17,7 +17,8 @@ * under the License. */ /* eslint-disable no-param-reassign */ -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { memo, FC } from 'react'; import { Icons } from '@superset-ui/core/components/Icons'; import { Button } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx index 469bc29d70d..3af13459fba 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx @@ -18,7 +18,8 @@ */ import { FC, memo, useMemo } from 'react'; -import { DataMaskStateWithId, styled, t } from '@superset-ui/core'; +import { DataMaskStateWithId, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Loading } from '@superset-ui/core/components'; import { RootState } from 'src/dashboard/types'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx index af8961c813a..76adfdfb4eb 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx @@ -31,8 +31,10 @@ import { } from 'react'; import { useSelector } from 'react-redux'; import cx from 'classnames'; -import { styled, t, useTheme, DataMaskStateWithId } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { RootState } from 'src/dashboard/types'; +import { DataMaskStateWithId } from '@superset-ui/core'; import { Icons } from '@superset-ui/core/components/Icons'; import { EmptyState, Loading } from '@superset-ui/core/components'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx index 121090a89e3..74d90cbb992 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx @@ -36,8 +36,8 @@ import { DataMask, isNativeFilter, usePrevious, - styled, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Constants } from '@superset-ui/core/components'; import { useHistory } from 'react-router-dom'; import { updateDataMask } from 'src/dataMask/actions'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx index 53c4d893a1d..70c8f23ffe7 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx @@ -18,7 +18,8 @@ */ import { memo, useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; -import { css, t, useTheme, useTruncation } from '@superset-ui/core'; +import { t, useTruncation } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { List } from '@superset-ui/core/components/List'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx index 7f16a57a24a..08a2e684c89 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useSelector } from 'react-redux'; -import { css, SupersetTheme, useTheme, useTruncation } from '@superset-ui/core'; +import { useTruncation } from '@superset-ui/core'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { useFilterConfigModal } from 'src/dashboard/components/nativeFilters/FilterBar/FilterConfigurationLink/useFilterConfigModal'; import { RootState } from 'src/dashboard/types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx index e816f50013a..95326b186f9 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx @@ -17,7 +17,8 @@ * under the License. */ import { memo, useMemo } from 'react'; -import { t, useTruncation, css } from '@superset-ui/core'; +import { t, useTruncation } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { List } from '@superset-ui/core/components/List'; import { useFilterScope } from './useFilterScope'; import { Row, RowLabel, RowTruncationCount, RowValue } from './Styles'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts index c949f8e7c08..618937dbbee 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; export const Row = styled.div` ${({ theme }) => css` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx index 84a2ba8d619..62bc0f8f9e3 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx @@ -18,7 +18,8 @@ */ import { FC } from 'react'; import { FormItem, Input } from '@superset-ui/core/components'; -import { NativeFilterType, styled, t } from '@superset-ui/core'; +import { NativeFilterType, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; interface Props { componentId: string; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx index 117e5545c2d..c311d372969 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useRef, FC } from 'react'; import { DragSourceMonitor, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx index b17c36634b9..74567b95f76 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, ReactNode } from 'react'; -import { NativeFilterType, styled } from '@superset-ui/core'; +import { NativeFilterType } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import FilterTitlePane from './FilterTitlePane'; import { FilterRemoval } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx index ab4bff10c80..2932a5e7455 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx @@ -18,7 +18,8 @@ */ import { forwardRef, ReactNode } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { FilterRemoval } from './types'; import DraggableFilter from './DraggableFilter'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx index f78bcfbc64a..3c49ededfff 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx @@ -18,7 +18,8 @@ */ import { useRef, FC } from 'react'; -import { NativeFilterType, styled, t, useTheme } from '@superset-ui/core'; +import { NativeFilterType, t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Button } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx index cecba58bdde..e96203fea4e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode, useEffect, useState } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Checkbox, InfoTooltip } from '@superset-ui/core/components'; interface CollapsibleControlProps { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx index 4dc368881bf..347809f7471 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Select } from '@superset-ui/core/components'; import { CollapsibleControl } from './CollapsibleControl'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx index a8f6d7c7935..3423fd46322 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx @@ -18,7 +18,8 @@ */ import { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { NativeFilterScope, styled } from '@superset-ui/core'; +import { NativeFilterScope } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { FormItem } from '@superset-ui/core/components'; import ScopingTree from './ScopingTree'; import { getDefaultScopeValue } from './utils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx index 72aa515e094..019c2da8cb0 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx @@ -18,7 +18,8 @@ */ import { FC, useMemo, useState, memo } from 'react'; -import { NativeFilterScope, styled, css } from '@superset-ui/core'; +import { NativeFilterScope } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import Tree from '@superset-ui/core/components/Tree'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index 20f0e83138a..2c740d771ea 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -29,15 +29,13 @@ import { getChartMetadataRegistry, JsonResponse, NativeFilterType, - styled, SupersetApiError, t, ClientErrorObject, getClientErrorObject, - useTheme, - css, getExtensionsRegistry, } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { debounce, isEqual } from 'lodash'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx index 499b571e0cd..680d09f009e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx @@ -18,7 +18,8 @@ */ import { Button, type OnClickHandler } from '@superset-ui/core/components'; import { FC } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; const RemovedContent = styled.div` display: flex; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx index 640b795f9af..441ae95902e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx @@ -25,12 +25,8 @@ import { Tooltip, type FormInstance, } from '@superset-ui/core/components'; -import { - Filter, - getChartControlPanelRegistry, - styled, - t, -} from '@superset-ui/core'; +import { Filter, getChartControlPanelRegistry, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { doesColumnMatchFilterType, getControlItems, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx index 68a151eca80..85a4b6c2d94 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx @@ -18,15 +18,8 @@ */ import { memo, useEffect, useCallback, useMemo, useState, useRef } from 'react'; import { uniq, isEqual, sortBy, debounce, isEmpty } from 'lodash'; -import { - Filter, - NativeFilterType, - Divider, - styled, - t, - css, - useTheme, -} from '@superset-ui/core'; +import { Filter, NativeFilterType, Divider, t } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { useDispatch } from 'react-redux'; import { Constants, Form, Icons } from '@superset-ui/core/components'; import { ErrorBoundary } from 'src/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx index b11457105c6..5ed3b2302f1 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx @@ -18,11 +18,8 @@ */ import { ReactNode } from 'react'; import { t } from '@superset-ui/core'; -import { - Alert, - Button, - type OnClickHandler, -} from '@superset-ui/core/components'; +import { Button, type OnClickHandler } from '@superset-ui/core/components'; +import { Alert } from '@apache-superset/core/ui'; export interface ConfirmationAlertProps { title: string; diff --git a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx index f4d48cf2080..43f83690288 100644 --- a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx +++ b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx @@ -19,7 +19,7 @@ import { useState, useCallback, useMemo } from 'react'; import { ResizeCallback, ResizeStartCallback, Resizable } from 're-resizable'; import cx from 'classnames'; -import { css, styled } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { RightResizeHandle, diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index e9e8b65afe9..92e4714a257 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -19,7 +19,8 @@ import { createContext, lazy, FC, useEffect, useMemo, useRef } from 'react'; import { Global } from '@emotion/react'; import { useHistory } from 'react-router-dom'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { createSelector } from '@reduxjs/toolkit'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/dashboard/styles.ts b/superset-frontend/src/dashboard/styles.ts index 68000ebada1..e281094a3bf 100644 --- a/superset-frontend/src/dashboard/styles.ts +++ b/superset-frontend/src/dashboard/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, SupersetTheme } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; export const headerStyles = (theme: SupersetTheme) => css` body { diff --git a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts index 9487f86dea6..551e013666d 100644 --- a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts +++ b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts @@ -17,8 +17,9 @@ * under the License. */ import { useMemo } from 'react'; +import { Filter } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; -import { useTheme, Filter } from '@superset-ui/core'; import { RootState } from 'src/dashboard/types'; import { selectChartCustomizationItems } from 'src/dashboard/components/nativeFilters/ChartCustomization/selectors'; import { diff --git a/superset-frontend/src/embedded/EmbeddedContextProviders.tsx b/superset-frontend/src/embedded/EmbeddedContextProviders.tsx index 34d1070e864..c7b2b48ae8e 100644 --- a/superset-frontend/src/embedded/EmbeddedContextProviders.tsx +++ b/superset-frontend/src/embedded/EmbeddedContextProviders.tsx @@ -26,7 +26,7 @@ import { DynamicPluginProvider } from 'src/components'; import { EmbeddedUiConfigProvider } from 'src/components/UiConfigContext'; import { SupersetThemeProvider } from 'src/theme/ThemeProvider'; import { ThemeController } from 'src/theme/ThemeController'; -import type { ThemeStorage } from '@superset-ui/core'; +import type { ThemeStorage } from '@apache-superset/core/ui'; import { store } from 'src/views/store'; /** diff --git a/superset-frontend/src/embedded/index.tsx b/superset-frontend/src/embedded/index.tsx index cc56b84db5e..794cca051d0 100644 --- a/superset-frontend/src/embedded/index.tsx +++ b/superset-frontend/src/embedded/index.tsx @@ -21,12 +21,8 @@ import 'src/public-path'; import { lazy, Suspense } from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router, Route } from 'react-router-dom'; -import { - type SupersetThemeConfig, - makeApi, - t, - logging, -} from '@superset-ui/core'; +import { makeApi, t, logging } from '@superset-ui/core'; +import { type SupersetThemeConfig } from '@apache-superset/core/ui'; import Switchboard from '@superset-ui/switchboard'; import getBootstrapData, { applicationRoot } from 'src/utils/getBootstrapData'; import setupClient from 'src/setup/setupClient'; diff --git a/superset-frontend/src/explore/components/ChartPills.tsx b/superset-frontend/src/explore/components/ChartPills.tsx index cabbc4c5616..42b337cfd71 100644 --- a/superset-frontend/src/explore/components/ChartPills.tsx +++ b/superset-frontend/src/explore/components/ChartPills.tsx @@ -17,7 +17,8 @@ * under the License. */ import { forwardRef, RefObject } from 'react'; -import { css, QueryData, SupersetTheme } from '@superset-ui/core'; +import { QueryData } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { CachedLabel, type LabelType, diff --git a/superset-frontend/src/explore/components/Control.tsx b/superset-frontend/src/explore/components/Control.tsx index 08947d52e9c..f6eed7623f4 100644 --- a/superset-frontend/src/explore/components/Control.tsx +++ b/superset-frontend/src/explore/components/Control.tsx @@ -22,12 +22,8 @@ import { ControlType, ControlComponentProps as BaseControlComponentProps, } from '@superset-ui/chart-controls'; -import { - styled, - JsonValue, - QueryFormData, - usePrevious, -} from '@superset-ui/core'; +import { JsonValue, QueryFormData, usePrevious } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ErrorBoundary } from 'src/components'; import { ExploreActions } from 'src/explore/actions/exploreActions'; import controlMap from './controls'; diff --git a/superset-frontend/src/explore/components/ControlHeader.tsx b/superset-frontend/src/explore/components/ControlHeader.tsx index 5de910e5d1f..a240107084f 100644 --- a/superset-frontend/src/explore/components/ControlHeader.tsx +++ b/superset-frontend/src/explore/components/ControlHeader.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, ReactNode } from 'react'; -import { t, css, useTheme, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; import { FormLabel, InfoTooltip, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx index 2a0502a1763..6526201ac8d 100644 --- a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx +++ b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx @@ -30,13 +30,9 @@ import { import { ensureIsArray, t, - styled, getChartControlPanelRegistry, QueryFormData, DatasourceType, - css, - SupersetTheme, - useTheme, isDefined, JsonValue, NO_TIME_RANGE, @@ -44,6 +40,7 @@ import { isFeatureEnabled, FeatureFlag, } from '@superset-ui/core'; +import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { ControlPanelSectionConfig, ControlState, diff --git a/superset-frontend/src/explore/components/DataTableControl/index.tsx b/superset-frontend/src/explore/components/DataTableControl/index.tsx index ae83ac2160f..3c6cc551d00 100644 --- a/superset-frontend/src/explore/components/DataTableControl/index.tsx +++ b/superset-frontend/src/explore/components/DataTableControl/index.tsx @@ -18,14 +18,12 @@ */ import { useMemo, useState, useEffect, useRef, RefObject } from 'react'; import { - css, getTimeFormatter, safeHtmlSpan, - styled, t, TimeFormats, - useTheme, } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { Column } from 'react-table'; import { debounce } from 'lodash'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx index df9c21d9e15..517d519f697 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useEffect, useMemo, useState, MouseEvent } from 'react'; -import { isFeatureEnabled, FeatureFlag, styled, t } from '@superset-ui/core'; +import { isFeatureEnabled, FeatureFlag, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import Tabs from '@superset-ui/core/components/Tabs'; import { diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx index f5e952ee30b..30a03769b88 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { useMemo } from 'react'; import { zip } from 'lodash'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx index 57dadb3a7b8..66895941a99 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Tabs from '@superset-ui/core/components/Tabs'; import { ResultTypes, ResultsPaneProps } from '../types'; import { useResultsPane } from './useResultsPane'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx index 6b54c6709aa..d442860eb2d 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback } from 'react'; -import { ensureIsArray, styled, t } from '@superset-ui/core'; +import { ensureIsArray, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { TableView, TableSize, diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx index cf7bc096990..6afc1babeb2 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx @@ -20,11 +20,11 @@ import { useState, useEffect, ReactElement, useCallback } from 'react'; import { ensureIsArray, - styled, t, getChartMetadataRegistry, getClientErrorObject, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { EmptyState, Loading } from '@superset-ui/core/components'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; import { ResultsPaneProps, QueryResultInterface } from '../types'; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx index bb8aa83cfc0..7540b235513 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx @@ -18,7 +18,8 @@ */ import { RefObject } from 'react'; import { useDrag } from 'react-dnd'; -import { css, Metric, styled, useTheme } from '@superset-ui/core'; +import { Metric } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { ColumnMeta } from '@superset-ui/chart-controls'; import { DndItemType } from 'src/explore/components/DndItemType'; import { diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx index 7ee6908d5dc..8740fbf0d09 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx @@ -18,13 +18,8 @@ */ import { CSSProperties, ReactNode, useCallback } from 'react'; -import { - css, - styled, - t, - useCSSTextTruncation, - useTheme, -} from '@superset-ui/core'; +import { t, useCSSTextTruncation } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components/Tooltip'; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx index 7f71633c3ce..ad56f01626b 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx @@ -17,21 +17,14 @@ * under the License. */ import { useContext, useMemo, useState } from 'react'; -import { - css, - DatasourceType, - Metric, - QueryFormData, - styled, - t, - useTheme, -} from '@superset-ui/core'; +import { DatasourceType, Metric, QueryFormData, t } from '@superset-ui/core'; +import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; import { ControlConfig } from '@superset-ui/chart-controls'; import AutoSizer from 'react-virtualized-auto-sizer'; import { matchSorter, rankings } from 'match-sorter'; -import { Alert, Constants, Input } from '@superset-ui/core/components'; +import { Constants, Input } from '@superset-ui/core/components'; import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal'; import { getDatasourceAsSaveableDataset } from 'src/utils/datasourceUtils'; import { ExploreActions } from 'src/explore/actions/exploreActions'; diff --git a/superset-frontend/src/explore/components/EmbedCodeContent.jsx b/superset-frontend/src/explore/components/EmbedCodeContent.jsx index 05350ce1535..1625f3b76ec 100644 --- a/superset-frontend/src/explore/components/EmbedCodeContent.jsx +++ b/superset-frontend/src/explore/components/EmbedCodeContent.jsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useEffect, useMemo, useState } from 'react'; -import { css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Input, Space, Typography } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; import { URL_PARAMS } from 'src/constants'; diff --git a/superset-frontend/src/explore/components/ExploreAlert.tsx b/superset-frontend/src/explore/components/ExploreAlert.tsx index 8af4bef9d70..6afbb056198 100644 --- a/superset-frontend/src/explore/components/ExploreAlert.tsx +++ b/superset-frontend/src/explore/components/ExploreAlert.tsx @@ -20,7 +20,7 @@ import { forwardRef, RefObject, MouseEvent } from 'react'; import { Button } from '@superset-ui/core/components'; import { ErrorAlert } from 'src/components'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; interface ControlPanelAlertProps { title: string; diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx index 18b24bfc6d9..2bd18b35ac2 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx @@ -27,7 +27,8 @@ import { UnsavedChangesModal, } from '@superset-ui/core/components'; import { AlteredSliceTag } from 'src/components'; -import { css, logging, SupersetClient, t } from '@superset-ui/core'; +import { logging, SupersetClient, t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { chartPropShape } from 'src/dashboard/util/propShapes'; import { Icons } from '@superset-ui/core/components/Icons'; import PropertiesModal from 'src/explore/components/PropertiesModal'; diff --git a/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx b/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx index b1710f1a2b3..ab11f2a5bf4 100644 --- a/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx +++ b/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx @@ -19,27 +19,24 @@ import { useState, useEffect, useCallback, useMemo, ReactNode } from 'react'; import Split from 'react-split'; import { - css, DatasourceType, ensureIsArray, isFeatureEnabled, FeatureFlag, getChartMetadataRegistry, - styled, SupersetClient, t, - useTheme, QueryFormData, JsonObject, getExtensionsRegistry, } from '@superset-ui/core'; +import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; import ChartContainer from 'src/components/Chart/ChartContainer'; import { getItem, setItem, LocalStorageKeys, } from 'src/utils/localStorageHelpers'; -import { Alert } from '@superset-ui/core/components'; import { SaveDatasetModal } from 'src/SqlLab/components/SaveDatasetModal'; import { getDatasourceAsSaveableDataset } from 'src/utils/datasourceUtils'; import { buildV1ChartDataPayload } from 'src/explore/exploreUtils'; diff --git a/superset-frontend/src/explore/components/ExploreContainer/index.tsx b/superset-frontend/src/explore/components/ExploreContainer/index.tsx index b5c324e370c..5cf714ea740 100644 --- a/superset-frontend/src/explore/components/ExploreContainer/index.tsx +++ b/superset-frontend/src/explore/components/ExploreContainer/index.tsx @@ -25,7 +25,7 @@ import { useReducer, } from 'react'; -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useDragDropManager } from 'react-dnd'; import { DatasourcePanelDndItem } from '../DatasourcePanel/types'; diff --git a/superset-frontend/src/explore/components/ExploreContentPopover.tsx b/superset-frontend/src/explore/components/ExploreContentPopover.tsx index bbf9e0c1a3a..3a006601cc7 100644 --- a/superset-frontend/src/explore/components/ExploreContentPopover.tsx +++ b/superset-frontend/src/explore/components/ExploreContentPopover.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; export const ExplorePopoverContent = styled.div` .edit-popover-resize { diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx index 42aea646238..c4372862778 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx @@ -22,16 +22,14 @@ import PropTypes from 'prop-types'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { - styled, t, - css, - useTheme, logging, useChangeEffect, useComponentDidMount, usePrevious, isMatrixifyEnabled, } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { debounce, isEqual, isObjectLike, omit, pick } from 'lodash'; import { Resizable } from 're-resizable'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx index 71be72fc352..b07d8e6c50f 100644 --- a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx +++ b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx @@ -18,7 +18,8 @@ */ import { ReactChild, useCallback, Key } from 'react'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Dropdown } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/RunQueryButton/index.tsx b/superset-frontend/src/explore/components/RunQueryButton/index.tsx index d8b3c4c3e58..eb1b4e82181 100644 --- a/superset-frontend/src/explore/components/RunQueryButton/index.tsx +++ b/superset-frontend/src/explore/components/RunQueryButton/index.tsx @@ -18,7 +18,8 @@ */ import { ReactNode } from 'react'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Button } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/SaveModal.tsx b/superset-frontend/src/explore/components/SaveModal.tsx index ac3572f2881..759241224d8 100644 --- a/superset-frontend/src/explore/components/SaveModal.tsx +++ b/superset-frontend/src/explore/components/SaveModal.tsx @@ -24,7 +24,6 @@ import { connect } from 'react-redux'; import { withRouter, RouteComponentProps } from 'react-router-dom'; import { InfoTooltip, - Alert, Button, AsyncSelect, Form, @@ -35,14 +34,13 @@ import { Divider, } from '@superset-ui/core/components'; import { - css, DatasourceType, isDefined, logging, - styled, SupersetClient, t, } from '@superset-ui/core'; +import { css, styled, Alert } from '@apache-superset/core/ui'; import { Radio } from '@superset-ui/core/components/Radio'; import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils'; import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions'; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx index 0d095cd74b4..f520267d130 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx @@ -32,11 +32,10 @@ import { getChartMetadataRegistry, validateNonEmpty, isValidExpression, - styled, getColumnLabel, - withTheme, VizType, } from '@superset-ui/core'; +import { styled, withTheme } from '@apache-superset/core/ui'; import SelectControl from 'src/explore/components/controls/SelectControl'; import TextControl from 'src/explore/components/controls/TextControl'; import CheckboxControl from 'src/explore/components/controls/CheckboxControl'; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx index 6a39f78214f..b4670fd3ce3 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx @@ -23,10 +23,9 @@ import { JsonObject, Payload, QueryFormData, - SupersetTheme, t, - withTheme, } from '@superset-ui/core'; +import { SupersetTheme, withTheme } from '@apache-superset/core/ui'; import { AsyncEsmComponent, List, diff --git a/superset-frontend/src/explore/components/controls/BoundsControl.tsx b/superset-frontend/src/explore/components/controls/BoundsControl.tsx index b7621733f9b..3cda5ebb877 100644 --- a/superset-frontend/src/explore/components/controls/BoundsControl.tsx +++ b/superset-frontend/src/explore/components/controls/BoundsControl.tsx @@ -18,7 +18,8 @@ */ import { useEffect, useRef, useState } from 'react'; import { InputNumber } from '@superset-ui/core/components'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/CheckboxControl.jsx b/superset-frontend/src/explore/components/controls/CheckboxControl.jsx index a991c73e2b9..dd551dd996c 100644 --- a/superset-frontend/src/explore/components/controls/CheckboxControl.jsx +++ b/superset-frontend/src/explore/components/controls/CheckboxControl.jsx @@ -18,7 +18,7 @@ */ import { Component } from 'react'; import PropTypes from 'prop-types'; -import { styled, css } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Checkbox } from '@superset-ui/core/components'; import ControlHeader from '../ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx b/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx index 2dfb69551de..04d91a8dde0 100644 --- a/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/CollectionControl/index.jsx @@ -20,7 +20,8 @@ import { Component } from 'react'; import PropTypes from 'prop-types'; import { IconTooltip, List } from '@superset-ui/core/components'; import { nanoid } from 'nanoid'; -import { t, withTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { withTheme } from '@apache-superset/core/ui'; import { SortableContainer, SortableHandle, diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx index b280248cfa3..afe467dda9b 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ColorBreakpointOptionProps } from './types'; import ColorBreakpointPopoverTrigger from './ColorBreakpointPopoverTrigger'; import { DragContainer } from '../OptionControls'; diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx index 6abd319dcbc..9c20732858e 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx @@ -18,7 +18,8 @@ */ import { useState, useMemo } from 'react'; import { Button, Row, Col, InputNumber } from '@superset-ui/core/components'; -import { styled, t, validateNumber } from '@superset-ui/core'; +import { t, validateNumber } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import ControlHeader from '../../ControlHeader'; import ColorPickerControl from '../ColorPickerControl'; import { diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx index a33ee21f50f..f3bb1e13ad7 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx @@ -18,7 +18,8 @@ */ import { useState, useEffect } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import ColorBreakpointOption from './ColorBreakpointOption'; import { ColorBreakpointType, ColorBreakpointsControlProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx index 55b439e24f2..46538f81817 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css, SupersetTheme } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { useRef, useState } from 'react'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx index 1cede6ba4d7..f5e6b8c187b 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx @@ -19,15 +19,14 @@ import { useMemo, ReactNode } from 'react'; import { - css, ColorScheme, ColorSchemeGroup, SequentialScheme, t, - useTheme, getLabelsColorMap, CategoricalColorNamespace, } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { sortBy } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; import { diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx index bed610a0939..1086e6f05fb 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useMemo, useState } from 'react'; -import { useTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { COLUMN_NAME_ALIASES, diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx index f71d1584d87..fac850c5cfd 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx @@ -17,7 +17,7 @@ * under the License. */ import { memo } from 'react'; -import { css, useTheme } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Popover } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { ColumnTypeLabel } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx index 7a2308a72cc..f6a150cf011 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, FunctionComponentElement, ChangeEvent } from 'react'; -import { JsonValue, useTheme } from '@superset-ui/core'; +import { JsonValue } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { ControlFormItemComponents } from './controls'; import ControlHeader, { ControlHeaderProps } from '../../../ControlHeader'; import { ControlFormItemDefaultSpec } from '../types'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx index 9ae7b37b66d..f8d60b375c7 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx @@ -22,7 +22,8 @@ import { FunctionComponentElement, useMemo, } from 'react'; -import { JsonObject, JsonValue, useTheme } from '@superset-ui/core'; +import { JsonObject, JsonValue } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Constants } from '@superset-ui/core/components'; import { debounce } from 'lodash'; import { ControlFormItemNode } from './ControlFormItem'; diff --git a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx index 4d79fda76cb..9dd45d18fdc 100644 --- a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx +++ b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx @@ -22,7 +22,6 @@ import { useSelector } from 'react-redux'; import { isEmpty, isEqual, noop } from 'lodash'; import { BinaryAdhocFilter, - css, ensureIsArray, fetchTimeRange, getTimeOffset, @@ -30,6 +29,7 @@ import { SimpleAdhocFilter, t, } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import ControlHeader, { ControlHeaderProps, } from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx index a9c0fe15f64..ebfcabd26da 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useEffect, useState } from 'react'; -import { styled, css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Comparator } from '@superset-ui/chart-controls'; import { Icons } from '@superset-ui/core/components/Icons'; import ControlHeader from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx index 0401f315a52..aa63c778a18 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useMemo, useState, useEffect } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { Comparator, diff --git a/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx b/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx index d0c8437d785..002cc629cc4 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ContourOptionProps } from './types'; import ContourPopoverTrigger from './ContourPopoverTrigger'; import OptionWrapper from '../DndColumnSelectControl/OptionWrapper'; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx b/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx index 4b4632d2786..03f7097a643 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx @@ -19,7 +19,8 @@ import { useState, useEffect } from 'react'; import { Button, Row, Col } from '@superset-ui/core/components'; import Tabs from '@superset-ui/core/components/Tabs'; -import { legacyValidateInteger, styled, t } from '@superset-ui/core'; +import { legacyValidateInteger, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import ControlHeader from '../../ControlHeader'; import TextControl from '../TextControl'; import ColorPickerControl from '../ColorPickerControl'; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/index.tsx b/superset-frontend/src/explore/components/controls/ContourControl/index.tsx index 2e372b98a4a..6e5d5f8c261 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/index.tsx @@ -18,7 +18,8 @@ */ import { useState, useEffect } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import ContourPopoverTrigger from './ContourPopoverTrigger'; import ContourOption from './ContourOption'; diff --git a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx index 2829be3686a..9b80777e228 100644 --- a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx +++ b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx @@ -19,13 +19,12 @@ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; import { - css, Currency, ensureIsArray, getCurrencySymbol, - styled, t, } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { CSSObject } from '@emotion/react'; import { Select, type SelectProps } from '@superset-ui/core/components'; import { ViewState } from 'src/views/types'; diff --git a/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx b/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx index ba0fe7abcb1..a3c824aadbc 100644 --- a/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx +++ b/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { List, type ListItemProps } from '@superset-ui/core/components'; export interface CustomListItemProps extends ListItemProps { diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx index 9a48cbe1384..ed582b088eb 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx @@ -20,14 +20,8 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { - css, - DatasourceType, - SupersetClient, - styled, - t, - withTheme, -} from '@superset-ui/core'; +import { DatasourceType, SupersetClient, t } from '@superset-ui/core'; +import { css, styled, withTheme } from '@apache-superset/core/ui'; import { getTemporalColumns } from '@superset-ui/chart-controls'; import { getUrlParam } from 'src/utils/urlUtils'; import { diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx index 9229c42453f..cb47f906d27 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx @@ -18,15 +18,12 @@ */ import { ReactNode, useState, useEffect, useMemo } from 'react'; import { - css, - styled, t, - useTheme, NO_TIME_RANGE, - SupersetTheme, useCSSTextTruncation, fetchTimeRange, } from '@superset-ui/core'; +import { css, styled, useTheme, SupersetTheme } from '@apache-superset/core/ui'; import { Button, Constants, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx index 02c7e9009ae..8e69cc0d2c3 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; import { ClassNames } from '@emotion/react'; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx index 67d076e60ee..338c3e06485 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx @@ -19,7 +19,8 @@ import { forwardRef, MouseEvent, ReactNode, RefObject } from 'react'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; export type DateLabelProps = { diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx index 2d8b19812e0..175b0572130 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx @@ -31,13 +31,11 @@ import { AdhocColumn, isAdhocColumn, t, - styled, - css, DatasourceType, Metric, QueryFormMetric, - // useTheme, } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { ColumnMeta, isSavedExpression } from '@superset-ui/chart-controls'; import Tabs from '@superset-ui/core/components/Tabs'; import { diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx index 972f54bd465..005bc74e9d5 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.jsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useState } from 'react'; -import { t, styled, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Input, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx index 228e92c6829..a460ad926d8 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback } from 'react'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Icons, InfoTooltip } from '@superset-ui/core/components'; import { CaretContainer, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx index 172364e582b..a34046f9d5e 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx @@ -30,7 +30,8 @@ import { } from 'src/explore/components/controls/DndColumnSelectControl/types'; import { Tooltip } from '@superset-ui/core/components'; import { StyledColumnOption } from 'src/explore/components/optionRenderers'; -import { styled, isAdhocColumn } from '@superset-ui/core'; +import { isAdhocColumn } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { ColumnMeta } from '@superset-ui/chart-controls'; import Option from './Option'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx index 095ba00d737..315babb3bfd 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.jsx @@ -18,13 +18,8 @@ */ import { Component } from 'react'; import PropTypes from 'prop-types'; -import { - t, - logging, - SupersetClient, - withTheme, - ensureIsArray, -} from '@superset-ui/core'; +import { t, logging, SupersetClient, ensureIsArray } from '@superset-ui/core'; +import { withTheme } from '@apache-superset/core/ui'; import ControlHeader from 'src/explore/components/ControlHeader'; import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.jsx index ea79c6b391c..3d5741420af 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.jsx @@ -20,7 +20,8 @@ import { createRef, Component } from 'react'; import PropTypes from 'prop-types'; import { Button, Icons, Select } from '@superset-ui/core/components'; import { ErrorBoundary } from 'src/components'; -import { styled, t, SupersetClient } from '@superset-ui/core'; +import { t, SupersetClient } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Tabs from '@superset-ui/core/components/Tabs'; import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx index 3871a23d0c1..bd8c7cb30da 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx @@ -23,12 +23,10 @@ import { isFeatureEnabled, FeatureFlag, isDefined, - styled, SupersetClient, - useTheme, t, - css, } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { Operators, OPERATORS_OPTIONS, diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx index 3a3d941461b..328a3e6e479 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx @@ -18,7 +18,8 @@ */ import { useEffect, useRef, useMemo } from 'react'; import { Select } from '@superset-ui/core/components'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import sqlKeywords from 'src/SqlLab/utils/sqlKeywords'; import { getColumnKeywords } from 'src/explore/controlUtils/getColumnKeywords'; import AdhocFilter from 'src/explore/components/controls/FilterControl/AdhocFilter'; diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx index a218189ece6..61ce55a817b 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx @@ -17,7 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Button } from '@superset-ui/core/components'; import Tree, { TreeProps } from '@superset-ui/core/components/Tree'; import { forwardRef } from 'react'; diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.tsx index 03ea65cf975..64309c9334d 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsControl.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ControlHeader } from '@superset-ui/chart-controls'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Popover } from '@superset-ui/core/components'; import { FC, useState } from 'react'; import { EditItem, LayerConf, LayerConfigsControlProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx index 0d0c120cc2f..2d9d299d8d9 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, JsonValue, styled, t, useTheme } from '@superset-ui/core'; +import { JsonValue, t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; // eslint-disable-next-line no-restricted-imports import { Button } from '@superset-ui/core/components/Button'; import { Form } from '@superset-ui/core/components/Form'; diff --git a/superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.tsx b/superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.tsx index 8c7416be69d..2e8477bf77f 100644 --- a/superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.tsx +++ b/superset-frontend/src/explore/components/controls/MapViewControl/MapViewControl.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ControlHeader } from '@superset-ui/chart-controls'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Button, Popover } from '@superset-ui/core/components'; import { FC, useState } from 'react'; import { MapViewConfigs, MapViewConfigsControlProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx b/superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx index c08104ec1c2..f7c456da186 100644 --- a/superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Button, Form } from '@superset-ui/core/components'; import { FC, useEffect, useState } from 'react'; import { MapViewConfigs, MapViewPopoverContentProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx index 1d223fb2c99..3ae9b7b035d 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx @@ -19,13 +19,8 @@ /* eslint-disable camelcase */ import { PureComponent, createRef } from 'react'; import PropTypes from 'prop-types'; -import { - isDefined, - t, - styled, - ensureIsArray, - DatasourceType, -} from '@superset-ui/core'; +import { isDefined, t, ensureIsArray, DatasourceType } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Tabs from '@superset-ui/core/components/Tabs'; import { Button, diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx index 136b7a4e9ca..f4a57534f99 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle.tsx @@ -25,7 +25,8 @@ import { FC, } from 'react'; -import { t, styled, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Input, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/controls/NumberControl/index.tsx b/superset-frontend/src/explore/components/controls/NumberControl/index.tsx index 02edc658670..2519881efa2 100644 --- a/superset-frontend/src/explore/components/controls/NumberControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/NumberControl/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { InputNumber } from '@superset-ui/core/components/Input'; import ControlHeader, { ControlHeaderProps } from '../../ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx index 5b2d9d7001b..55771bf567b 100644 --- a/superset-frontend/src/explore/components/controls/OptionControls/index.tsx +++ b/superset-frontend/src/explore/components/controls/OptionControls/index.tsx @@ -19,7 +19,8 @@ import { useRef, ReactNode } from 'react'; import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; -import { styled, t, useTheme, keyframes, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, useTheme, css, keyframes } from '@apache-superset/core/ui'; import { InfoTooltip, Icons, Tooltip } from '@superset-ui/core/components'; import { savedMetricType } from 'src/explore/components/controls/MetricControl/types'; import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric'; diff --git a/superset-frontend/src/explore/components/controls/SelectControl.jsx b/superset-frontend/src/explore/components/controls/SelectControl.jsx index e220fdec78f..5ac1166847a 100644 --- a/superset-frontend/src/explore/components/controls/SelectControl.jsx +++ b/superset-frontend/src/explore/components/controls/SelectControl.jsx @@ -18,7 +18,8 @@ */ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { css, isEqualArray, t } from '@superset-ui/core'; +import { isEqualArray, t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Select } from '@superset-ui/core/components'; import ControlHeader from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/TextAreaControl.jsx b/superset-frontend/src/explore/components/controls/TextAreaControl.jsx index 7c4c006219a..076fa1174ed 100644 --- a/superset-frontend/src/explore/components/controls/TextAreaControl.jsx +++ b/superset-frontend/src/explore/components/controls/TextAreaControl.jsx @@ -26,7 +26,8 @@ import { TextAreaEditor, ModalTrigger, } from '@superset-ui/core/components'; -import { t, withTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { withTheme } from '@apache-superset/core/ui'; import 'ace-builds/src-min-noconflict/mode-handlebars'; diff --git a/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx b/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx index 7a116911fc5..c10922b0e2c 100644 --- a/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx +++ b/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx @@ -27,7 +27,8 @@ import { Row, Select, } from '@superset-ui/core/components'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import BoundsControl from '../BoundsControl'; import CheckboxControl from '../CheckboxControl'; diff --git a/superset-frontend/src/explore/components/controls/ViewQuery.tsx b/superset-frontend/src/explore/components/controls/ViewQuery.tsx index 0d2dc7b685d..20ef5450e06 100644 --- a/superset-frontend/src/explore/components/controls/ViewQuery.tsx +++ b/superset-frontend/src/explore/components/controls/ViewQuery.tsx @@ -26,7 +26,8 @@ import { } from 'react'; import { useSelector } from 'react-redux'; import rison from 'rison'; -import { styled, SupersetClient, t, useTheme } from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Icons, Switch, diff --git a/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx b/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx index d84e1671b73..94c78e14c95 100644 --- a/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx +++ b/superset-frontend/src/explore/components/controls/ViewQueryModal.tsx @@ -19,12 +19,12 @@ import { FC, useEffect, useState } from 'react'; import { - styled, ensureIsArray, t, getClientErrorObject, QueryFormData, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Loading } from '@superset-ui/core/components'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; import ViewQuery from 'src/explore/components/controls/ViewQuery'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx index cd7203350c2..78556970f4c 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/FastVizSwitcher.tsx @@ -18,7 +18,7 @@ */ import { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { css, SupersetTheme } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { Flex, Icons } from '@superset-ui/core/components'; import { getChartKey } from 'src/explore/exploreUtils'; import { ExplorePageState } from 'src/explore/types'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx index b1d0de5f6b4..d94c86035c2 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { css, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; import { usePluginContext } from 'src/components'; import { VizTileProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx index a9feb694432..52f8a99be33 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx @@ -31,15 +31,17 @@ import Fuse from 'fuse.js'; import cx from 'classnames'; import { t, - styled, - css, ChartMetadata, - SupersetTheme, - useTheme, chartLabelWeight, chartLabelExplanations, - isThemeDark, } from '@superset-ui/core'; +import { + styled, + css, + SupersetTheme, + useTheme, + isThemeDark, +} from '@apache-superset/core/ui'; import { Input, Collapse, Tooltip, Label } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx index 75907090e3a..930928f8ed4 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/constants.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { VizType, css } from '@superset-ui/core'; +import { VizType } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { VizMeta } from './types'; diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx index 253ba331a99..f82fca79b23 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx @@ -17,13 +17,8 @@ * under the License. */ import { useCallback, useState } from 'react'; -import { - css, - t, - getChartMetadataRegistry, - styled, - SupersetTheme, -} from '@superset-ui/core'; +import { t, getChartMetadataRegistry } from '@superset-ui/core'; +import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; import { usePluginContext } from 'src/components'; import { Icons, Modal } from '@superset-ui/core/components'; import { noOp } from 'src/utils/common'; diff --git a/superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx b/superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx index 146cf035025..c7913fac8e3 100644 --- a/superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx +++ b/superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ControlHeader } from '@superset-ui/chart-controls'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { Form } from '@superset-ui/core/components'; import { Tag } from 'src/components'; import { FC, useState } from 'react'; diff --git a/superset-frontend/src/explore/components/optionRenderers.tsx b/superset-frontend/src/explore/components/optionRenderers.tsx index 1db3850881e..7a35bdf20f3 100644 --- a/superset-frontend/src/explore/components/optionRenderers.tsx +++ b/superset-frontend/src/explore/components/optionRenderers.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { MetricOption, ColumnOption, diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx index b0a66095082..8112c309b60 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useMemo } from 'react'; -import { css, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { MenuItem } from '@superset-ui/core/components/Menu'; import { Icons } from '@superset-ui/core/components/Icons'; import { Link } from 'react-router-dom'; diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx index a6e91e9a646..56762424cb9 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx @@ -19,15 +19,8 @@ import { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useDebounceValue } from 'src/hooks/useDebounceValue'; -import { - css, - isFeatureEnabled, - FeatureFlag, - styled, - t, - useTheme, - VizType, -} from '@superset-ui/core'; +import { isFeatureEnabled, FeatureFlag, t, VizType } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { Icons, ModalTrigger, diff --git a/superset-frontend/src/extensions/ExtensionsList.tsx b/superset-frontend/src/extensions/ExtensionsList.tsx index 5e7aeddacab..894b6e85583 100644 --- a/superset-frontend/src/extensions/ExtensionsList.tsx +++ b/superset-frontend/src/extensions/ExtensionsList.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme, css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme, css } from '@apache-superset/core/ui'; import { FunctionComponent, useMemo } from 'react'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { ListView } from 'src/components'; diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index cd923b64a39..69ab65796d9 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -27,16 +27,13 @@ import { } from 'react'; import { - css, isFeatureEnabled, FeatureFlag, - styled, SupersetClient, - SupersetTheme, t, VizType, - useTheme, } from '@superset-ui/core'; +import { css, styled, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import rison from 'rison'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/features/alerts/buildErrorTooltipMessage.tsx b/superset-frontend/src/features/alerts/buildErrorTooltipMessage.tsx index b6d1694311e..c20ee92cfe8 100644 --- a/superset-frontend/src/features/alerts/buildErrorTooltipMessage.tsx +++ b/superset-frontend/src/features/alerts/buildErrorTooltipMessage.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { List } from '@superset-ui/core/components'; import { ValidationObject } from './types'; import { TRANSLATIONS } from './AlertReportModal'; diff --git a/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx b/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx index 2ea0971e5b3..261edf8d2e0 100644 --- a/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx +++ b/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx @@ -18,7 +18,8 @@ */ import { useState, useCallback, FocusEvent, FC } from 'react'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Input, diff --git a/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx b/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx index ccec4ddf5c5..04bd225c4ad 100644 --- a/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx +++ b/superset-frontend/src/features/alerts/components/AlertStatusIcon.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t, SupersetTheme, useTheme, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme, useTheme, css } from '@apache-superset/core/ui'; import { Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { AlertState } from '../types'; diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx index 4c53cce544e..228130b32e5 100644 --- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx +++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx @@ -30,10 +30,9 @@ import { JsonResponse, SupersetClient, isFeatureEnabled, - styled, t, - useTheme, } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Input, Select } from '@superset-ui/core/components'; import RefreshLabel from '@superset-ui/core/components/RefreshLabel'; diff --git a/superset-frontend/src/features/alerts/components/RecipientIcon.tsx b/superset-frontend/src/features/alerts/components/RecipientIcon.tsx index 229194f4431..9bb6ba2ba0e 100644 --- a/superset-frontend/src/features/alerts/components/RecipientIcon.tsx +++ b/superset-frontend/src/features/alerts/components/RecipientIcon.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme, css } from '@superset-ui/core'; +import { SupersetTheme, css } from '@apache-superset/core/ui'; import { ReactElement } from 'react'; import { Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx b/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx index 88be0b0ca33..4e1e1303f0f 100644 --- a/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx +++ b/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx @@ -17,7 +17,8 @@ * under the License. */ import { extendedDayjs } from '@superset-ui/core/utils/dates'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { TableView, EmptyWrapperType, diff --git a/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx b/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx index 6df2e6173b5..d4a82e3ee21 100644 --- a/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx +++ b/superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx @@ -18,7 +18,8 @@ */ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; import { Typography } from '@superset-ui/core/components/Typography'; diff --git a/superset-frontend/src/features/annotations/AnnotationModal.tsx b/superset-frontend/src/features/annotations/AnnotationModal.tsx index 11b1542b2f4..6896825031d 100644 --- a/superset-frontend/src/features/annotations/AnnotationModal.tsx +++ b/superset-frontend/src/features/annotations/AnnotationModal.tsx @@ -18,7 +18,8 @@ */ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/features/charts/ChartCard.tsx b/superset-frontend/src/features/charts/ChartCard.tsx index 84c08d8e6fb..a833b477e2c 100644 --- a/superset-frontend/src/features/charts/ChartCard.tsx +++ b/superset-frontend/src/features/charts/ChartCard.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { isFeatureEnabled, FeatureFlag, t, css } from '@superset-ui/core'; +import { isFeatureEnabled, FeatureFlag, t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Link, useHistory } from 'react-router-dom'; import { ConfirmStatusChange, diff --git a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx index 56547a1065f..b733016c265 100644 --- a/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx +++ b/superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FunctionComponent, useState, useEffect, ChangeEvent } from 'react'; -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; import withToasts from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx index e40a1dcd12a..1f2993a1345 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Switch } from '@superset-ui/core/components/Switch'; import { InfoTooltip, diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx index 53020018ab7..3ca76039a2f 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { SupersetTheme, css, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme, css } from '@apache-superset/core/ui'; import { Input, Button, diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx index 37940d3683f..4798f5f3c02 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, SupersetTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, SupersetTheme } from '@apache-superset/core/ui'; import { FormLabel, LabeledErrorBoundInput as ValidatedInput, diff --git a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/index.tsx b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/index.tsx index 423427354db..f33210dc91b 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/index.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Form } from '@superset-ui/core/components'; import { FormFieldOrder, FORM_FIELD_MAP } from './constants'; import { formScrollableStyles, validatedFormStyles } from '../styles'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx b/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx index 221dcdaf9c1..df57bf2eba3 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/ExtraOptions.tsx @@ -22,9 +22,9 @@ import { t, DatabaseConnectionExtension, isFeatureEnabled, - useTheme, FeatureFlag, } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Input, Checkbox, diff --git a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx index fa073b8a0f1..79e2a6fab7d 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState } from 'react'; -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Form, FormLabel, diff --git a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelSwitch.tsx b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelSwitch.tsx index a58c96d23a0..4c122c0c681 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelSwitch.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelSwitch.tsx @@ -17,12 +17,8 @@ * under the License. */ import { useEffect, useState } from 'react'; -import { - t, - SupersetTheme, - isFeatureEnabled, - FeatureFlag, -} from '@superset-ui/core'; +import { t, isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Switch } from '@superset-ui/core/components/Switch'; import { InfoTooltip } from '@superset-ui/core/components'; import { isEmpty } from 'lodash'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/SqlAlchemyForm.tsx b/superset-frontend/src/features/databases/DatabaseModal/SqlAlchemyForm.tsx index 45e2e34024d..8463a1fa692 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/SqlAlchemyForm.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/SqlAlchemyForm.tsx @@ -17,7 +17,8 @@ * under the License. */ import { EventHandler, ChangeEvent, MouseEvent, ReactNode } from 'react'; -import { t, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import SupersetText from 'src/utils/textUtils'; import { Input, Button } from '@superset-ui/core/components'; import { StyledInputContainer, wideButton } from './styles'; diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.tsx index 93476a53b75..ee713591de8 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/index.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/index.tsx @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - t, - styled, - SupersetTheme, - getExtensionsRegistry, -} from '@superset-ui/core'; +import { t, getExtensionsRegistry } from '@superset-ui/core'; +import { styled, SupersetTheme, Alert } from '@apache-superset/core/ui'; import { FunctionComponent, @@ -39,7 +35,6 @@ import { useHistory } from 'react-router-dom'; import { setItem, LocalStorageKeys } from 'src/utils/localStorageHelpers'; import Tabs from '@superset-ui/core/components/Tabs'; import { - Alert, Button, Icons, LabeledErrorBoundInput as ValidatedInput, diff --git a/superset-frontend/src/features/databases/DatabaseModal/styles.ts b/superset-frontend/src/features/databases/DatabaseModal/styles.ts index e9bd68750f0..d4c78679611 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/styles.ts +++ b/superset-frontend/src/features/databases/DatabaseModal/styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css, styled, SupersetTheme } from '@superset-ui/core'; +import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; import { Button, JsonEditor } from '@superset-ui/core/components'; const CTAS_CVAS_SCHEMA_FORM_HEIGHT = 108; diff --git a/superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx b/superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx index fbd59fe213e..adcd70b405c 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/ColumnsPreview.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Typography } from '@superset-ui/core/components'; import { type TagType, TagsList } from 'src/components'; diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx b/superset-frontend/src/features/databases/UploadDataModel/index.tsx index 1fd81ffe20f..67122178dc1 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx @@ -25,12 +25,8 @@ import { FC, } from 'react'; -import { - getClientErrorObject, - SupersetClient, - SupersetTheme, - t, -} from '@superset-ui/core'; +import { getClientErrorObject, SupersetClient, t } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { Button, Collapse, diff --git a/superset-frontend/src/features/databases/UploadDataModel/styles.ts b/superset-frontend/src/features/databases/UploadDataModel/styles.ts index 8d303e8ebea..bb841d61516 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/styles.ts +++ b/superset-frontend/src/features/databases/UploadDataModel/styles.ts @@ -17,7 +17,7 @@ * under the License. */ import { FormItem } from '@superset-ui/core/components'; -import { css, styled, SupersetTheme } from '@superset-ui/core'; +import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; const MODAL_BODY_HEIGHT = 180.5; diff --git a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx index c1f33053568..38de6ebf143 100644 --- a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/DatasetPanel.tsx @@ -16,9 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; -import { Alert, Loading } from '@superset-ui/core/components'; +import { Loading } from '@superset-ui/core/components'; import Table, { ColumnsType, TableSize, diff --git a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/MessageContent.tsx b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/MessageContent.tsx index d691a4c9527..e6b4186fb45 100644 --- a/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/MessageContent.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/DatasetPanel/MessageContent.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { t, styled } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { EmptyState } from '@superset-ui/core/components'; import { Link } from 'react-router-dom'; diff --git a/superset-frontend/src/features/datasets/AddDataset/EditDataset/index.tsx b/superset-frontend/src/features/datasets/AddDataset/EditDataset/index.tsx index 264e0ad0a74..8998a75941c 100644 --- a/superset-frontend/src/features/datasets/AddDataset/EditDataset/index.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/EditDataset/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import useGetDatasetRelatedCounts from 'src/features/datasets/hooks/useGetDatasetRelatedCounts'; import { Badge } from '@superset-ui/core/components'; import Tabs from '@superset-ui/core/components/Tabs'; diff --git a/superset-frontend/src/features/datasets/AddDataset/Footer/index.tsx b/superset-frontend/src/features/datasets/AddDataset/Footer/index.tsx index 632a3f9ead4..2b23b728ee4 100644 --- a/superset-frontend/src/features/datasets/AddDataset/Footer/index.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/Footer/index.tsx @@ -23,7 +23,8 @@ import { Menu, Flex, } from '@superset-ui/core/components'; -import { t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { logEvent } from 'src/logger/actions'; diff --git a/superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx b/superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx index 8906c0915f9..40b8a2ed52b 100644 --- a/superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx +++ b/superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useEffect, SetStateAction, Dispatch, useCallback } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import TableSelector, { TableOption } from 'src/components/TableSelector'; import { EmptyState } from '@superset-ui/core/components'; import { type DatabaseObject } from 'src/components'; diff --git a/superset-frontend/src/features/datasets/DatasetLayout/index.tsx b/superset-frontend/src/features/datasets/DatasetLayout/index.tsx index 68f7f1d0c71..2e126c43311 100644 --- a/superset-frontend/src/features/datasets/DatasetLayout/index.tsx +++ b/superset-frontend/src/features/datasets/DatasetLayout/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactElement, JSXElementConstructor } from 'react'; -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import ResizableSidebar from 'src/components/ResizableSidebar'; import { diff --git a/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx b/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx index b354e76f1d3..07490bcdb4d 100644 --- a/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx +++ b/superset-frontend/src/features/datasets/DatasetSelectLabel/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { Tooltip } from '@superset-ui/core/components'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; type Database = { database_name: string; diff --git a/superset-frontend/src/features/datasets/metadataBar/DatasetMetadataBar.skipped-stories.tsx b/superset-frontend/src/features/datasets/metadataBar/DatasetMetadataBar.skipped-stories.tsx index cc63b64a0ce..7fd8240ce6d 100644 --- a/superset-frontend/src/features/datasets/metadataBar/DatasetMetadataBar.skipped-stories.tsx +++ b/superset-frontend/src/features/datasets/metadataBar/DatasetMetadataBar.skipped-stories.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useResizeDetector } from 'react-resize-detector'; -import { css, SupersetClient } from '@superset-ui/core'; +import { SupersetClient } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { useDatasetMetadataBar } from './useDatasetMetadataBar'; export default { diff --git a/superset-frontend/src/features/datasets/metadataBar/useDatasetMetadataBar.tsx b/superset-frontend/src/features/datasets/metadataBar/useDatasetMetadataBar.tsx index 75ea53b4349..fedbd63828a 100644 --- a/superset-frontend/src/features/datasets/metadataBar/useDatasetMetadataBar.tsx +++ b/superset-frontend/src/features/datasets/metadataBar/useDatasetMetadataBar.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useMemo } from 'react'; -import { css, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, useTheme } from '@apache-superset/core/ui'; import { Dataset } from 'src/components/Chart/types'; import MetadataBar from '@superset-ui/core/components/MetadataBar'; import { diff --git a/superset-frontend/src/features/datasets/styles.ts b/superset-frontend/src/features/datasets/styles.ts index df3055d25e3..cd66aad0971 100644 --- a/superset-frontend/src/features/datasets/styles.ts +++ b/superset-frontend/src/features/datasets/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css, SupersetTheme } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; export const StyledLayoutWrapper = styled.div` flex-grow: 1; diff --git a/superset-frontend/src/features/home/ActivityTable.tsx b/superset-frontend/src/features/home/ActivityTable.tsx index 7e709b57f82..d77e924276e 100644 --- a/superset-frontend/src/features/home/ActivityTable.tsx +++ b/superset-frontend/src/features/home/ActivityTable.tsx @@ -18,7 +18,8 @@ */ import { useEffect, useState } from 'react'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { setItem, LocalStorageKeys } from 'src/utils/localStorageHelpers'; import { Link } from 'react-router-dom'; import { ListViewCard } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/features/home/EmptyState.tsx b/superset-frontend/src/features/home/EmptyState.tsx index 09c8c233cb7..573851fede3 100644 --- a/superset-frontend/src/features/home/EmptyState.tsx +++ b/superset-frontend/src/features/home/EmptyState.tsx @@ -21,7 +21,8 @@ import { EmptyState as EmptyStateComponent, } from '@superset-ui/core/components'; import { TableTab } from 'src/views/CRUD/types'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { navigateTo } from 'src/utils/navigationUtils'; import { WelcomeTable } from './types'; diff --git a/superset-frontend/src/features/home/LanguagePicker.tsx b/superset-frontend/src/features/home/LanguagePicker.tsx index 7988b09ed40..2b8dec6b41b 100644 --- a/superset-frontend/src/features/home/LanguagePicker.tsx +++ b/superset-frontend/src/features/home/LanguagePicker.tsx @@ -18,7 +18,8 @@ */ import { useMemo } from 'react'; import { MenuItem } from '@superset-ui/core/components/Menu'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Icons } from '@superset-ui/core/components/Icons'; import { Typography } from '@superset-ui/core/components/Typography'; diff --git a/superset-frontend/src/features/home/Menu.tsx b/superset-frontend/src/features/home/Menu.tsx index 92589f81f8c..6f0e725c16e 100644 --- a/superset-frontend/src/features/home/Menu.tsx +++ b/superset-frontend/src/features/home/Menu.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { styled, css, useTheme } from '@superset-ui/core'; +import { styled, css, useTheme } from '@apache-superset/core/ui'; import { debounce } from 'lodash'; import { getUrlParam } from 'src/utils/urlUtils'; import { MainNav, MenuMode } from '@superset-ui/core/components/Menu'; diff --git a/superset-frontend/src/features/home/RightMenu.tsx b/superset-frontend/src/features/home/RightMenu.tsx index 315ad304e5a..a4df314ccc7 100644 --- a/superset-frontend/src/features/home/RightMenu.tsx +++ b/superset-frontend/src/features/home/RightMenu.tsx @@ -22,15 +22,8 @@ import { useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; import { useQueryParams, BooleanParam } from 'use-query-params'; import { isEmpty } from 'lodash'; -import { - t, - styled, - css, - SupersetTheme, - SupersetClient, - getExtensionsRegistry, - useTheme, -} from '@superset-ui/core'; +import { t, SupersetClient, getExtensionsRegistry } from '@superset-ui/core'; +import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; import { Tag, Tooltip, diff --git a/superset-frontend/src/features/home/SavedQueries.tsx b/superset-frontend/src/features/home/SavedQueries.tsx index 61c0fb64457..a6634382e71 100644 --- a/superset-frontend/src/features/home/SavedQueries.tsx +++ b/superset-frontend/src/features/home/SavedQueries.tsx @@ -18,7 +18,8 @@ */ import { useCallback, useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; -import { styled, SupersetClient, t, useTheme, css } from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import CodeSyntaxHighlighter, { preloadLanguages, } from '@superset-ui/core/components/CodeSyntaxHighlighter'; diff --git a/superset-frontend/src/features/home/SubMenu.tsx b/superset-frontend/src/features/home/SubMenu.tsx index 1d39f8ef64d..3af4e5df9ac 100644 --- a/superset-frontend/src/features/home/SubMenu.tsx +++ b/superset-frontend/src/features/home/SubMenu.tsx @@ -19,7 +19,8 @@ import { ReactNode, useState, useEffect, FunctionComponent } from 'react'; import { Link, useHistory } from 'react-router-dom'; -import { styled, SupersetTheme, css, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, SupersetTheme, css, useTheme } from '@apache-superset/core/ui'; import cx from 'classnames'; import { debounce } from 'lodash'; import { Menu, MenuMode, MainNav } from '@superset-ui/core/components/Menu'; diff --git a/superset-frontend/src/features/queries/QueryPreviewModal.tsx b/superset-frontend/src/features/queries/QueryPreviewModal.tsx index 1f7f7a0db98..92d6eb3bba6 100644 --- a/superset-frontend/src/features/queries/QueryPreviewModal.tsx +++ b/superset-frontend/src/features/queries/QueryPreviewModal.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useState } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import cx from 'classnames'; import { Button, Modal } from '@superset-ui/core/components'; import withToasts, { diff --git a/superset-frontend/src/features/queries/SavedQueryPreviewModal.tsx b/superset-frontend/src/features/queries/SavedQueryPreviewModal.tsx index 9e6b69a6d6d..03650c8965d 100644 --- a/superset-frontend/src/features/queries/SavedQueryPreviewModal.tsx +++ b/superset-frontend/src/features/queries/SavedQueryPreviewModal.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FunctionComponent } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { Button, Modal } from '@superset-ui/core/components'; import SyntaxHighlighterCopy from 'src/features/queries/SyntaxHighlighterCopy'; import withToasts, { diff --git a/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx b/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx index 5262548f480..cd54e823f12 100644 --- a/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx +++ b/superset-frontend/src/features/queries/SyntaxHighlighterCopy.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useEffect } from 'react'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import CodeSyntaxHighlighter, { SupportedLanguage, CodeSyntaxHighlighterProps, diff --git a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx index 5fe02bb347e..35e18fc6adb 100644 --- a/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx +++ b/superset-frontend/src/features/reports/ReportModal/HeaderReportDropdown/index.tsx @@ -20,13 +20,12 @@ import { useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { t, - styled, FeatureFlag, isFeatureEnabled, getExtensionsRegistry, usePrevious, - css, } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { MenuItem } from '@superset-ui/core/components/Menu'; import { Checkbox } from '@superset-ui/core/components'; import { AlertObject } from 'src/features/alerts/types'; diff --git a/superset-frontend/src/features/reports/ReportModal/index.tsx b/superset-frontend/src/features/reports/ReportModal/index.tsx index 24f534e2ff0..ce1de76eafd 100644 --- a/superset-frontend/src/features/reports/ReportModal/index.tsx +++ b/superset-frontend/src/features/reports/ReportModal/index.tsx @@ -25,19 +25,14 @@ import { ChangeEvent, } from 'react'; -import { - t, - SupersetTheme, - getClientErrorObject, - VizType, -} from '@superset-ui/core'; +import { t, getClientErrorObject, VizType } from '@superset-ui/core'; +import { SupersetTheme, Alert } from '@apache-superset/core/ui'; import { useDispatch, useSelector } from 'react-redux'; import { addReport, editReport, } from 'src/features/reports/ReportModal/actions'; import { - Alert, Input, LabeledErrorBoundInput, type CronError, diff --git a/superset-frontend/src/features/reports/ReportModal/styles.tsx b/superset-frontend/src/features/reports/ReportModal/styles.tsx index 2b158c5cfae..1bc6a37febb 100644 --- a/superset-frontend/src/features/reports/ReportModal/styles.tsx +++ b/superset-frontend/src/features/reports/ReportModal/styles.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled, css, SupersetTheme } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; import { Button, CronPicker, Modal } from '@superset-ui/core/components'; import { Radio } from '@superset-ui/core/components/Radio'; diff --git a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx index be28ea3c649..5235430a4ff 100644 --- a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx +++ b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { css, styled, SupersetClient, t } from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; import { diff --git a/superset-frontend/src/features/tags/BulkTagModal.tsx b/superset-frontend/src/features/tags/BulkTagModal.tsx index 60b398978f9..d62f37973ec 100644 --- a/superset-frontend/src/features/tags/BulkTagModal.tsx +++ b/superset-frontend/src/features/tags/BulkTagModal.tsx @@ -18,7 +18,8 @@ */ import { useState, useEffect, FC } from 'react'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; -import { t, styled, SupersetClient } from '@superset-ui/core'; +import { t, SupersetClient } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { FormLabel, AsyncSelect, diff --git a/superset-frontend/src/features/tags/TagModal.tsx b/superset-frontend/src/features/tags/TagModal.tsx index 59ab8ee1b5c..324a10292cb 100644 --- a/superset-frontend/src/features/tags/TagModal.tsx +++ b/superset-frontend/src/features/tags/TagModal.tsx @@ -28,7 +28,8 @@ import { Input, Modal, } from '@superset-ui/core/components'; -import { t, styled, SupersetClient, useTheme } from '@superset-ui/core'; +import { t, SupersetClient } from '@superset-ui/core'; +import { styled, useTheme } from '@apache-superset/core/ui'; import { Tag } from 'src/views/CRUD/types'; import { fetchObjectsByTagIds } from 'src/features/tags/tags'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; diff --git a/superset-frontend/src/features/themes/ThemeModal.tsx b/superset-frontend/src/features/themes/ThemeModal.tsx index 7971f5d4c5f..6b578cb650e 100644 --- a/superset-frontend/src/features/themes/ThemeModal.tsx +++ b/superset-frontend/src/features/themes/ThemeModal.tsx @@ -26,7 +26,8 @@ import { } from 'react'; import { omit } from 'lodash'; -import { css, styled, t, useTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; import { useSingleViewResource } from 'src/views/CRUD/hooks'; import { useThemeContext } from 'src/theme/ThemeProvider'; import { useBeforeUnload } from 'src/hooks/useBeforeUnload'; @@ -35,7 +36,6 @@ import SupersetText from 'src/utils/textUtils'; import { Icons } from '@superset-ui/core/components/Icons'; import withToasts from 'src/components/MessageToasts/withToasts'; import { - Alert, Button, Form, Input, diff --git a/superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx b/superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx index a1c22bd20df..60add20e7ef 100644 --- a/superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx @@ -22,11 +22,9 @@ import { getNumberFormatter, isEqualArray, NumberFormats, - styled, - useTheme, t, - css, } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { useCallback, useEffect, useMemo, useState, useRef } from 'react'; import { FilterBarOrientation } from 'src/dashboard/types'; // import Metadata from '@superset-ui/core/components/Metadata'; diff --git a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx index 494ae49d8f0..5a20a4a6ceb 100644 --- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx @@ -28,8 +28,8 @@ import { finestTemporalGrainFormatter, t, tn, - styled, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { GenericDataType } from '@apache-superset/core/api/core'; import { debounce, isUndefined } from 'lodash'; import { useImmerReducer } from 'use-immer'; diff --git a/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx b/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx index be49e2eba2e..9b6543678bd 100644 --- a/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx +++ b/superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx @@ -16,11 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - styled, - NO_TIME_RANGE, - getExtensionsRegistry, -} from '@superset-ui/core'; +import { NO_TIME_RANGE, getExtensionsRegistry } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useCallback, useEffect } from 'react'; import DateFilterControl from 'src/explore/components/controls/DateFilterControl'; import { PluginFilterTimeProps } from './types'; diff --git a/superset-frontend/src/filters/components/common.ts b/superset-frontend/src/filters/components/common.ts index 87b7b08221c..38d98a5ae09 100644 --- a/superset-frontend/src/filters/components/common.ts +++ b/superset-frontend/src/filters/components/common.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { FormItem } from '@superset-ui/core/components'; import { PluginFilterStylesProps } from './types'; diff --git a/superset-frontend/src/hooks/useConfirmModal/useConfirmModal.test.tsx b/superset-frontend/src/hooks/useConfirmModal/useConfirmModal.test.tsx index 351e0af2ecc..b2c88d00606 100644 --- a/superset-frontend/src/hooks/useConfirmModal/useConfirmModal.test.tsx +++ b/superset-frontend/src/hooks/useConfirmModal/useConfirmModal.test.tsx @@ -18,7 +18,7 @@ */ import { render, screen, userEvent, waitFor } from '@superset-ui/core/spec'; import { renderHook } from '@testing-library/react-hooks'; -import { ThemeProvider, supersetTheme } from '@superset-ui/core'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; import { useConfirmModal } from '.'; const renderWithTheme = (component: React.ReactElement) => diff --git a/superset-frontend/src/hooks/useJsonTreeTheme.ts b/superset-frontend/src/hooks/useJsonTreeTheme.ts index d9145a6c77a..f74baa79cc1 100644 --- a/superset-frontend/src/hooks/useJsonTreeTheme.ts +++ b/superset-frontend/src/hooks/useJsonTreeTheme.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; export const useJsonTreeTheme = () => { const theme = useTheme(); diff --git a/superset-frontend/src/hooks/useThemeMenuItems.test.tsx b/superset-frontend/src/hooks/useThemeMenuItems.test.tsx index bdbceec89b8..6e1a3f48eed 100644 --- a/superset-frontend/src/hooks/useThemeMenuItems.test.tsx +++ b/superset-frontend/src/hooks/useThemeMenuItems.test.tsx @@ -23,7 +23,7 @@ import { waitFor, within, } from 'spec/helpers/testing-library'; -import { ThemeMode } from '@superset-ui/core'; +import { ThemeMode } from '@apache-superset/core/ui'; import { Menu } from '@superset-ui/core/components'; import { ThemeSubMenuProps, useThemeMenuItems } from './useThemeMenuItems'; diff --git a/superset-frontend/src/hooks/useThemeMenuItems.tsx b/superset-frontend/src/hooks/useThemeMenuItems.tsx index 25c5e56068d..3e4b7fc1970 100644 --- a/superset-frontend/src/hooks/useThemeMenuItems.tsx +++ b/superset-frontend/src/hooks/useThemeMenuItems.tsx @@ -19,7 +19,8 @@ import { useMemo } from 'react'; import { Icons, Tooltip } from '@superset-ui/core/components'; import type { MenuItem } from '@superset-ui/core/components/Menu'; -import { t, ThemeMode, ThemeAlgorithm } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { ThemeMode, ThemeAlgorithm } from '@apache-superset/core/ui'; export interface ThemeSubMenuOption { key: ThemeMode; diff --git a/superset-frontend/src/pages/ActionLog/index.tsx b/superset-frontend/src/pages/ActionLog/index.tsx index 1087c192911..01f9a518f21 100644 --- a/superset-frontend/src/pages/ActionLog/index.tsx +++ b/superset-frontend/src/pages/ActionLog/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useMemo } from 'react'; -import { t, css } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import SubMenu, { SubMenuProps } from 'src/features/home/SubMenu'; import { useListViewResource } from 'src/views/CRUD/hooks'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/pages/AlertReportList/index.tsx b/superset-frontend/src/pages/AlertReportList/index.tsx index c77433e1f5e..532c97fd1e3 100644 --- a/superset-frontend/src/pages/AlertReportList/index.tsx +++ b/superset-frontend/src/pages/AlertReportList/index.tsx @@ -21,12 +21,11 @@ import { useState, useMemo, useEffect, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import { t, - css, SupersetClient, makeApi, - styled, getExtensionsRegistry, } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; import { Tooltip, diff --git a/superset-frontend/src/pages/AllEntities/index.tsx b/superset-frontend/src/pages/AllEntities/index.tsx index f29f4e0bffc..fa7356085a9 100644 --- a/superset-frontend/src/pages/AllEntities/index.tsx +++ b/superset-frontend/src/pages/AllEntities/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useEffect, useState } from 'react'; -import { styled, t, css, SupersetTheme } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; import { NumberParam, useQueryParam } from 'use-query-params'; import AllEntitiesTable from 'src/features/allEntities/AllEntitiesTable'; import { Button, Loading } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/pages/AnnotationList/index.tsx b/superset-frontend/src/pages/AnnotationList/index.tsx index 898af7f523c..4284b427fb6 100644 --- a/superset-frontend/src/pages/AnnotationList/index.tsx +++ b/superset-frontend/src/pages/AnnotationList/index.tsx @@ -19,13 +19,8 @@ import { useMemo, useState, useEffect, useCallback } from 'react'; import { useParams, Link, useHistory } from 'react-router-dom'; -import { - css, - t, - styled, - SupersetClient, - getClientErrorObject, -} from '@superset-ui/core'; +import { t, SupersetClient, getClientErrorObject } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import rison from 'rison'; diff --git a/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx b/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx index 4f0c8117c8c..5caea4df88e 100644 --- a/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx +++ b/superset-frontend/src/pages/ChartCreation/ChartCreation.test.tsx @@ -27,7 +27,7 @@ import fetchMock from 'fetch-mock'; import { createMemoryHistory } from 'history'; import { ChartCreation } from 'src/pages/ChartCreation'; import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes'; -import { supersetTheme } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; jest.mock('src/components/DynamicPlugins', () => ({ usePluginContext: () => ({ diff --git a/superset-frontend/src/pages/ChartCreation/index.tsx b/superset-frontend/src/pages/ChartCreation/index.tsx index 2650e73f3f9..118c78c3b74 100644 --- a/superset-frontend/src/pages/ChartCreation/index.tsx +++ b/superset-frontend/src/pages/ChartCreation/index.tsx @@ -18,13 +18,8 @@ */ import { PureComponent, ReactNode } from 'react'; import rison from 'rison'; -import { - isDefined, - JsonResponse, - styled, - SupersetClient, - t, -} from '@superset-ui/core'; +import { isDefined, JsonResponse, SupersetClient, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { withTheme, Theme } from '@emotion/react'; import { getUrlParam } from 'src/utils/urlUtils'; import { FilterPlugins, URL_PARAMS } from 'src/constants'; diff --git a/superset-frontend/src/pages/ChartList/index.tsx b/superset-frontend/src/pages/ChartList/index.tsx index 2fa2a0c4fc8..00dfb26c10c 100644 --- a/superset-frontend/src/pages/ChartList/index.tsx +++ b/superset-frontend/src/pages/ChartList/index.tsx @@ -21,10 +21,10 @@ import { FeatureFlag, getChartMetadataRegistry, JsonResponse, - styled, SupersetClient, t, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useState, useMemo, useCallback } from 'react'; import rison from 'rison'; import { uniqBy } from 'lodash'; diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx index 04881e72206..799055dddb8 100644 --- a/superset-frontend/src/pages/DashboardList/index.tsx +++ b/superset-frontend/src/pages/DashboardList/index.tsx @@ -19,10 +19,10 @@ import { isFeatureEnabled, FeatureFlag, - styled, SupersetClient, t, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useSelector } from 'react-redux'; import { useState, useMemo, useCallback } from 'react'; import { Link } from 'react-router-dom'; diff --git a/superset-frontend/src/pages/DatabaseList/index.tsx b/superset-frontend/src/pages/DatabaseList/index.tsx index 74b9dd94709..09c7640da44 100644 --- a/superset-frontend/src/pages/DatabaseList/index.tsx +++ b/superset-frontend/src/pages/DatabaseList/index.tsx @@ -16,12 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - getExtensionsRegistry, - styled, - SupersetClient, - t, -} from '@superset-ui/core'; +import { getExtensionsRegistry, SupersetClient, t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useState, useMemo, useEffect } from 'react'; import rison from 'rison'; import { useSelector } from 'react-redux'; diff --git a/superset-frontend/src/pages/DatasetList/index.tsx b/superset-frontend/src/pages/DatasetList/index.tsx index ddfa6a12e4e..80c3691b02e 100644 --- a/superset-frontend/src/pages/DatasetList/index.tsx +++ b/superset-frontend/src/pages/DatasetList/index.tsx @@ -16,14 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { - getExtensionsRegistry, - styled, - SupersetClient, - useTheme, - css, - t, -} from '@superset-ui/core'; +import { getExtensionsRegistry, SupersetClient, t } from '@superset-ui/core'; +import { styled, useTheme, css } from '@apache-superset/core/ui'; import { FunctionComponent, useState, useMemo, useCallback, Key } from 'react'; import { Link, useHistory } from 'react-router-dom'; import rison from 'rison'; diff --git a/superset-frontend/src/pages/ExecutionLogList/index.tsx b/superset-frontend/src/pages/ExecutionLogList/index.tsx index 86a9012f0de..32fe554a245 100644 --- a/superset-frontend/src/pages/ExecutionLogList/index.tsx +++ b/superset-frontend/src/pages/ExecutionLogList/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { css, styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { css, styled } from '@apache-superset/core/ui'; import { extendedDayjs as dayjs, fDuration, diff --git a/superset-frontend/src/pages/Home/index.tsx b/superset-frontend/src/pages/Home/index.tsx index 1855fc5d6d8..7596e34564f 100644 --- a/superset-frontend/src/pages/Home/index.tsx +++ b/superset-frontend/src/pages/Home/index.tsx @@ -22,9 +22,9 @@ import { FeatureFlag, getExtensionsRegistry, JsonObject, - styled, t, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import rison from 'rison'; import { Collapse, ListViewCard } from '@superset-ui/core/components'; import { User } from 'src/types/bootstrapTypes'; diff --git a/superset-frontend/src/pages/Login/index.tsx b/superset-frontend/src/pages/Login/index.tsx index 67552a316de..9162bb0e155 100644 --- a/superset-frontend/src/pages/Login/index.tsx +++ b/superset-frontend/src/pages/Login/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { SupersetClient, styled, t, css } from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Button, Card, diff --git a/superset-frontend/src/pages/QueryHistoryList/index.tsx b/superset-frontend/src/pages/QueryHistoryList/index.tsx index a72cc760dae..5825ea6bed5 100644 --- a/superset-frontend/src/pages/QueryHistoryList/index.tsx +++ b/superset-frontend/src/pages/QueryHistoryList/index.tsx @@ -18,14 +18,8 @@ */ import { useMemo, useState, useCallback, ReactElement, useEffect } from 'react'; import { Link, useHistory } from 'react-router-dom'; -import { - css, - QueryState, - styled, - SupersetClient, - t, - useTheme, -} from '@superset-ui/core'; +import { QueryState, SupersetClient, t } from '@superset-ui/core'; +import { css, styled, useTheme } from '@apache-superset/core/ui'; import { createFetchRelated, createFetchDistinct, diff --git a/superset-frontend/src/pages/Register/index.tsx b/superset-frontend/src/pages/Register/index.tsx index 4697417811f..9d8add2df92 100644 --- a/superset-frontend/src/pages/Register/index.tsx +++ b/superset-frontend/src/pages/Register/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import { SupersetClient, styled, t, css } from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; +import { styled, css } from '@apache-superset/core/ui'; import { Button, Card, diff --git a/superset-frontend/src/pages/SavedQueryList/index.tsx b/superset-frontend/src/pages/SavedQueryList/index.tsx index 26c5971e723..a66848c46cf 100644 --- a/superset-frontend/src/pages/SavedQueryList/index.tsx +++ b/superset-frontend/src/pages/SavedQueryList/index.tsx @@ -20,10 +20,10 @@ import { FeatureFlag, isFeatureEnabled, - styled, SupersetClient, t, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { useCallback, useMemo, useState, MouseEvent } from 'react'; import { Link, useHistory } from 'react-router-dom'; import rison from 'rison'; diff --git a/superset-frontend/src/pages/SqlLab/index.tsx b/superset-frontend/src/pages/SqlLab/index.tsx index 4be0b45a00c..e3637547b54 100644 --- a/superset-frontend/src/pages/SqlLab/index.tsx +++ b/superset-frontend/src/pages/SqlLab/index.tsx @@ -18,7 +18,8 @@ */ import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { css, isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; +import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { useSqlLabInitialState } from 'src/hooks/apiResources/sqlLab'; import type { InitialState } from 'src/hooks/apiResources/sqlLab'; import { resetState } from 'src/SqlLab/actions/sqlLab'; diff --git a/superset-frontend/src/pages/ThemeList/index.tsx b/superset-frontend/src/pages/ThemeList/index.tsx index 9e708fb2ff0..630bc779502 100644 --- a/superset-frontend/src/pages/ThemeList/index.tsx +++ b/superset-frontend/src/pages/ThemeList/index.tsx @@ -17,14 +17,14 @@ * under the License. */ -import { useCallback, useEffect, useMemo, useState } from 'react'; -import { t, SupersetClient, styled } from '@superset-ui/core'; +import { useCallback, useMemo, useState, useEffect } from 'react'; +import { t, SupersetClient } from '@superset-ui/core'; +import { styled, Alert } from '@apache-superset/core/ui'; import { Tag, DeleteModal, ConfirmStatusChange, Loading, - Alert, Tooltip, Space, } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/pages/UserInfo/index.tsx b/superset-frontend/src/pages/UserInfo/index.tsx index 8c96cb79582..367e5c98470 100644 --- a/superset-frontend/src/pages/UserInfo/index.tsx +++ b/superset-frontend/src/pages/UserInfo/index.tsx @@ -18,7 +18,8 @@ */ import { useCallback, useEffect, useState } from 'react'; -import { css, t, SupersetClient, useTheme, styled } from '@superset-ui/core'; +import { t, SupersetClient } from '@superset-ui/core'; +import { css, useTheme, styled } from '@apache-superset/core/ui'; import SubMenu, { SubMenuProps } from 'src/features/home/SubMenu'; import { useToasts } from 'src/components/MessageToasts/withToasts'; import { Descriptions } from 'src/components/Descriptions'; diff --git a/superset-frontend/src/theme/ThemeController.ts b/superset-frontend/src/theme/ThemeController.ts index 22e2bd02c5a..32035744378 100644 --- a/superset-frontend/src/theme/ThemeController.ts +++ b/superset-frontend/src/theme/ThemeController.ts @@ -22,12 +22,12 @@ import { type ThemeControllerOptions, type ThemeStorage, isThemeConfigDark, - makeApi, Theme, ThemeMode, themeObject as supersetThemeObject, -} from '@superset-ui/core'; -import { normalizeThemeConfig } from '@superset-ui/core/theme/utils'; + normalizeThemeConfig, +} from '@apache-superset/core/ui'; +import { makeApi } from '@superset-ui/core'; import type { BootstrapThemeData, BootstrapThemeDataConfig, @@ -237,7 +237,7 @@ export class ThemeController { if (themeConfig) { // Controller creates and owns the dashboard theme - const { Theme } = await import('@superset-ui/core'); + const { Theme } = await import('@apache-superset/core/ui'); const normalizedConfig = this.normalizeTheme(themeConfig); // Determine if this is a dark theme and get appropriate base diff --git a/superset-frontend/src/theme/ThemeProvider.tsx b/superset-frontend/src/theme/ThemeProvider.tsx index 0f3b8dd3a4f..68dae34635b 100644 --- a/superset-frontend/src/theme/ThemeProvider.tsx +++ b/superset-frontend/src/theme/ThemeProvider.tsx @@ -24,12 +24,13 @@ import { useMemo, useState, } from 'react'; +import {} from '@superset-ui/core'; import { type AnyThemeConfig, type ThemeContextType, Theme, ThemeMode, -} from '@superset-ui/core'; +} from '@apache-superset/core/ui'; import { ThemeController } from './ThemeController'; const ThemeContext = createContext(null); diff --git a/superset-frontend/src/theme/tests/ThemeController.test.ts b/superset-frontend/src/theme/tests/ThemeController.test.ts index 0b3a5a25b8b..0939c3cc500 100644 --- a/superset-frontend/src/theme/tests/ThemeController.test.ts +++ b/superset-frontend/src/theme/tests/ThemeController.test.ts @@ -17,13 +17,14 @@ * under the License. */ import { theme as antdThemeImport } from 'antd'; +import {} from '@superset-ui/core'; import { type AnyThemeConfig, type SupersetThemeConfig, Theme, ThemeAlgorithm, ThemeMode, -} from '@superset-ui/core'; +} from '@apache-superset/core/ui'; import type { BootstrapThemeDataConfig, CommonBootstrapData, diff --git a/superset-frontend/src/theme/tests/ThemeProvider.test.tsx b/superset-frontend/src/theme/tests/ThemeProvider.test.tsx index 3568c225b37..7f45e64dfbd 100644 --- a/superset-frontend/src/theme/tests/ThemeProvider.test.tsx +++ b/superset-frontend/src/theme/tests/ThemeProvider.test.tsx @@ -17,7 +17,11 @@ * under the License. */ import { ReactNode } from 'react'; -import { type ThemeContextType, Theme, ThemeMode } from '@superset-ui/core'; +import { + type ThemeContextType, + Theme, + ThemeMode, +} from '@apache-superset/core/ui'; import { act, render, screen } from '@superset-ui/core/spec'; import { renderHook } from '@testing-library/react-hooks'; import { SupersetThemeProvider, useThemeContext } from '../ThemeProvider'; diff --git a/superset-frontend/src/types/bootstrapTypes.ts b/superset-frontend/src/types/bootstrapTypes.ts index 54af340cb74..f51df08c2cf 100644 --- a/superset-frontend/src/types/bootstrapTypes.ts +++ b/superset-frontend/src/types/bootstrapTypes.ts @@ -22,13 +22,15 @@ import { isPlainObject } from 'lodash'; import { Languages } from 'src/features/home/LanguagePicker'; import type { AnyThemeConfig, + SerializableThemeConfig, +} from '@apache-superset/core/ui'; +import type { ColorSchemeConfig, FeatureFlagMap, JsonObject, LanguagePack, Locale, SequentialSchemeConfig, - SerializableThemeConfig, } from '@superset-ui/core'; export type User = { diff --git a/superset-frontend/src/utils/downloadAsImage.tsx b/superset-frontend/src/utils/downloadAsImage.tsx index e10c034b522..95a2c5e67b7 100644 --- a/superset-frontend/src/utils/downloadAsImage.tsx +++ b/superset-frontend/src/utils/downloadAsImage.tsx @@ -20,7 +20,8 @@ import { SyntheticEvent } from 'react'; import domToImage from 'dom-to-image-more'; import { kebabCase } from 'lodash'; // eslint-disable-next-line no-restricted-imports -import { SupersetTheme, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; import { addWarningToast } from 'src/components/MessageToasts/actions'; const IMAGE_DOWNLOAD_QUALITY = 0.95; diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx index 48120d510c6..f4d301558a8 100644 --- a/superset-frontend/src/views/App.tsx +++ b/superset-frontend/src/views/App.tsx @@ -25,7 +25,7 @@ import { useLocation, } from 'react-router-dom'; import { bindActionCreators } from 'redux'; -import { css } from '@superset-ui/core'; +import { css } from '@apache-superset/core/ui'; import { Layout, Loading } from '@superset-ui/core/components'; import { setupAGGridModules } from '@superset-ui/core/components/ThemedAgGridReact'; import { ErrorBoundary } from 'src/components'; diff --git a/superset-frontend/src/views/CRUD/utils.tsx b/superset-frontend/src/views/CRUD/utils.tsx index f7e4082cfb7..45c2824347a 100644 --- a/superset-frontend/src/views/CRUD/utils.tsx +++ b/superset-frontend/src/views/CRUD/utils.tsx @@ -19,13 +19,13 @@ import { logging, - styled, SupersetClient, SupersetClientResponse, getClientErrorObject, t, lruCache, } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import Chart from 'src/types/Chart'; import { intersection } from 'lodash'; import rison from 'rison'; diff --git a/superset-frontend/src/views/menu.tsx b/superset-frontend/src/views/menu.tsx index 1eefb78b006..fd72529bee2 100644 --- a/superset-frontend/src/views/menu.tsx +++ b/superset-frontend/src/views/menu.tsx @@ -26,7 +26,7 @@ import { Route, BrowserRouter } from 'react-router-dom'; import { CacheProvider } from '@emotion/react'; import { QueryParamProvider } from 'use-query-params'; import createCache from '@emotion/cache'; -import { ThemeProvider, theme } from '@superset-ui/core'; +import { ThemeProvider, theme } from '@apache-superset/core/ui'; import Menu from 'src/features/home/Menu'; import getBootstrapData from 'src/utils/getBootstrapData'; import { setupStore } from './store'; diff --git a/superset-frontend/src/visualizations/TimeTable/TimeTable.tsx b/superset-frontend/src/visualizations/TimeTable/TimeTable.tsx index 0e5093d3b05..1877bf7547f 100644 --- a/superset-frontend/src/visualizations/TimeTable/TimeTable.tsx +++ b/superset-frontend/src/visualizations/TimeTable/TimeTable.tsx @@ -18,7 +18,8 @@ */ import { useMemo, ReactNode } from 'react'; import { InfoTooltip, TableView } from '@superset-ui/core/components'; -import { styled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; +import { styled } from '@apache-superset/core/ui'; import { sortNumberWithMixedTypes, processTimeTableData } from './utils'; import { ValueCell, LeftCell, Sparkline } from './components'; import type { TimeTableProps } from './types'; diff --git a/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx b/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx index 0c8766b3a42..e5d358d6523 100644 --- a/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx +++ b/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx @@ -17,7 +17,8 @@ * under the License. */ import { ReactElement, useMemo } from 'react'; -import { formatNumber, formatTime, useTheme } from '@superset-ui/core'; +import { formatNumber, formatTime } from '@superset-ui/core'; +import { useTheme } from '@apache-superset/core/ui'; import { GridRows } from '@visx/grid'; import { scaleLinear } from '@visx/scale'; import { diff --git a/superset-frontend/src/visualizations/TimeTable/config/transformProps/transformProps.test.ts b/superset-frontend/src/visualizations/TimeTable/config/transformProps/transformProps.test.ts index ff795effd4d..a0dce74dbc1 100644 --- a/superset-frontend/src/visualizations/TimeTable/config/transformProps/transformProps.test.ts +++ b/superset-frontend/src/visualizations/TimeTable/config/transformProps/transformProps.test.ts @@ -20,9 +20,9 @@ import { DatasourceType, ChartProps, Behavior, - supersetTheme, Metric, } from '@superset-ui/core'; +import { supersetTheme } from '@apache-superset/core/ui'; import { transformProps, TableChartProps } from './transformProps'; interface ExtendedMetric extends Omit { diff --git a/superset-frontend/src/visualizations/TimeTable/constants.ts b/superset-frontend/src/visualizations/TimeTable/constants.ts index 137eb45be7c..71b966478a3 100644 --- a/superset-frontend/src/visualizations/TimeTable/constants.ts +++ b/superset-frontend/src/visualizations/TimeTable/constants.ts @@ -17,7 +17,7 @@ * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; +import { SupersetTheme } from '@apache-superset/core/ui'; export const getAccessibleColorBounds = (theme: SupersetTheme): string[] => [ theme.colorError, // Red variant for negative/danger