Skip to content

Commit

Permalink
Merge pull request #501 from layer5io/500-fix-exports
Browse files Browse the repository at this point in the history
fix: fix missing exports, omit others as they are not needed now
  • Loading branch information
nebula-aac authored Feb 9, 2024
2 parents b35d8f0 + d977660 commit f71f14c
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 42 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layer5/sistent",
"version": "0.14.9",
"version": "0.14.10",
"description": "Reusable React Components and SVG Icons library",
"repository": {
"type": "git",
Expand Down
16 changes: 15 additions & 1 deletion src/custom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { ErrorBoundary, WithErrorBoundary, withSuppressedErrorBoundary } from '.
import { FlipCard } from './FlipCard';
import { useWindowDimensions } from './Helpers/Dimension';
import { useNotificationHandler } from './Helpers/Notification';
import PopperListener, { IPopperListener } from './PopperListener';
import ResponsiveDataTable from './ResponsiveDataTable';
import SearchBar, { SearchBarProps } from './SearchBar';
import { StyledTooltip } from './Tooltip';
import UniversalFilter, { UniversalFilterProps } from './UniversalFilter';

export { StyledChartDialog } from './ChartDialog';
export { StyledSearchBar } from './StyledSearchBar';
Expand All @@ -19,10 +23,20 @@ export {
EmptyState,
ErrorBoundary,
FlipCard,
PopperListener,
ResponsiveDataTable,
SearchBar,
StyledTooltip,
UniversalFilter,
WithErrorBoundary,
useNotificationHandler,
useWindowDimensions,
withSuppressedErrorBoundary
};
export type { CustomColumn, CustomColumnVisibilityControlProps };
export type {
CustomColumn,
CustomColumnVisibilityControlProps,
IPopperListener,
SearchBarProps,
UniversalFilterProps
};
37 changes: 37 additions & 0 deletions src/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { EmotionCache } from '@emotion/react';
import { CssBaseline, PaletteMode, Theme, ThemeProvider } from '@mui/material';
import React from 'react';
import { createCustomTheme } from './theme';

interface SistentProviderContextType {
emotionCache?: EmotionCache;
}

export const SistentThemeProviderContext = React.createContext<SistentProviderContextType>({});

export interface SistentThemeProviderProps {
children: React.ReactNode;
emotionCache?: EmotionCache;
initialMode?: PaletteMode;
}

function SistentThemeProvider({
children,
emotionCache,
initialMode = 'light'
}: SistentThemeProviderProps): JSX.Element {
const theme = React.useMemo<Theme>(() => createCustomTheme(initialMode), [initialMode]);

return (
<SistentThemeProviderContext.Provider value={{ emotionCache }}>
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
</SistentThemeProviderContext.Provider>
);
}

export default SistentThemeProvider;

export { SistentThemeProvider };
2 changes: 1 addition & 1 deletion src/theme/colors.ts → src/theme/colors/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const actionIcon = {
hover: darkTeal.dark
};

export const tabeMenu = {
export const tabMenu = {
main: darkTeal.main,
hover: darkTeal.dark
};
Expand Down
64 changes: 64 additions & 0 deletions src/theme/colors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
export {
ALICE_BLUE,
ANAKIWA,
BLACK,
CARIBBEAN_GREEN,
CASPER,
CHARCOAL,
CHINESE_SILVER,
CONNECTED,
CULTURED,
DARK_BLUE_GRAY,
DARK_PRIMARY_COLOR,
DARK_SHADE_GRAY,
DARK_SLATE_GRAY,
DARK_TEAL,
DELETED,
DISCONNECTED,
DISCOVERED,
EERIE_BLACK,
GRAY,
GRAY97,
GREEN,
IGNORED,
KEPPEL,
LIGHT_GRAY,
LIGHT_TEAL,
LIMED_SPRUCE,
MAINTAINENCE,
NOT_FOUND,
PATTERNS_BLUE,
PRIMARY_COLOR,
REGISTERED,
SAFFRON,
TEAL_BLUE,
WHITE,
WHITESMOKE,
YELLOW_SEA,
accentGrey,
actionIcon,
anakiwa,
black,
blue,
buttonDelete,
buttonDisabled,
casper,
charcoal,
common,
connected,
cultured,
darkSlateGray,
darkTeal,
eerieBlack,
green,
jungleGreen,
notificationColors,
patternsBlue,
primaryColor,
red,
redDelete,
tabMenu,
tableBackgroundHover,
white,
yellow
} from './colors';
39 changes: 2 additions & 37 deletions src/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
import { EmotionCache } from '@emotion/react';
import { CssBaseline, PaletteMode, Theme, ThemeProvider } from '@mui/material';
import React from 'react';
import { createCustomTheme } from './theme';

interface SistentProviderContextType {
emotionCache?: EmotionCache;
}

export const SistentThemeProviderContext = React.createContext<SistentProviderContextType>({});

export interface SistentThemeProviderProps {
children: React.ReactNode;
emotionCache?: EmotionCache;
initialMode?: PaletteMode;
}

function SistentThemeProvider({
children,
emotionCache,
initialMode = 'light'
}: SistentThemeProviderProps): JSX.Element {
const theme = React.useMemo<Theme>(() => createCustomTheme(initialMode), [initialMode]);

return (
<SistentThemeProviderContext.Provider value={{ emotionCache }}>
<ThemeProvider theme={theme}>
<CssBaseline />
{children}
</ThemeProvider>
</SistentThemeProviderContext.Provider>
);
}

export default SistentThemeProvider;

export { SistentThemeProvider };
export { default as SistentThemeProvider } from './ThemeProvider';
export * from './colors';

0 comments on commit f71f14c

Please sign in to comment.