Skip to content

Commit

Permalink
fix: add missing navigation components exports
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieuh authored Nov 8, 2021
1 parent fb5108c commit 9b4293e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
6 changes: 4 additions & 2 deletions components/Elevation/Elevation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { styled } from '../../stitches.config';
import { styled, CSS } from '../../stitches.config';

export const elevationVariant = {
type ElevationVariant = Record<number, CSS>;

export const elevationVariant: ElevationVariant = {
0: {
boxShadow: 'none',
},
Expand Down
3 changes: 0 additions & 3 deletions components/Navigation/Navigation.themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Property } from '@stitches/react/types/css';
import { ColorInfo } from '../../utils/getPrimaryColorInfo';
export namespace Theme {
type Colors = {
navBg: Property.Color;
navButtonBg: Property.Color;
navButtonHoverBg: Property.Color;
navButtonHoverBg2: Property.Color;
Expand All @@ -19,7 +18,6 @@ export namespace Theme {
type Factory = (primaryColor: ColorInfo) => Colors;

export const getLight: Factory = (primaryColor) => ({
navBg: 'white',
navButtonBg: 'transparent',
navButtonHoverBg: tinycolor('black').setAlpha(0.04).toHslString(),
navButtonHoverBg2: 'transparent',
Expand All @@ -35,7 +33,6 @@ export namespace Theme {
});

export const getDark: Factory = (primaryColor) => ({
navBg: '$deepBlue2',
navButtonBg: 'transparent',
navButtonHoverBg: tinycolor('white').setAlpha(0.05).toHslString(),
navButtonHoverBg2: '$primary',
Expand Down
20 changes: 10 additions & 10 deletions components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from 'react';
import React, { useMemo, ReactNode } from 'react';
import { styled, css, VariantProps } from '../../stitches.config';
import { elevationVariant } from '../Elevation';
import { Flex } from '../Flex';
Expand Down Expand Up @@ -110,19 +110,19 @@ export const NavigationContainer = styled('div', {
export type NavigationContainerVariants = VariantProps<typeof NavigationContainer>;
export type NavigationContainerProps = NavigationContainerVariants & {};

const elevation = Object.keys(elevationVariant).map((elevationKey) => ({
...elevationVariant[Number(elevationKey)],
bc: `$${Number(elevationKey) < 10 ? '0' : ''}${elevationKey}dp`,
})) as any;

export const NavigationDrawer = styled('nav', {
display: 'flex',
boxSizing: 'border-box',
padding: '$3',
backgroundColor: '$navBg',
maxWidth: '240px',
flexDirection: 'column',

variants: {
elevation: Object.keys(elevationVariant).map((_, index) => ({
...elevationVariant[index],
bc: `$${index < 10 ? '0' : ''}${index}dp`,
})) as any,
elevation,
},
defaultVariants: {
elevation: 1,
Expand All @@ -144,9 +144,9 @@ type StyledButtonVariants = VariantProps<typeof StyledButton>;

export type NavigationItemProps = {
as?: 'button' | 'a';
startAdornment?: React.ReactNode;
endAdornment?: React.ReactNode;
children: React.ReactNode;
startAdornment?: ReactNode;
endAdornment?: ReactNode;
children: ReactNode;
href?: string;
} & StyledLinkVariants &
StyledButtonVariants;
Expand Down
6 changes: 6 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export { Link } from './components/Link';
// MenuRadioItem,
// MenuSeparator,
// } from './components/Menu';
export {
NavigationContainer,
NavigationDrawer,
NavigationItem,
NavigationLink,
} from './components/Navigation';
export { Overlay } from './components/Overlay';
// export { Paragraph } from './components/Paragraph';
// export { Panel } from './components/Panel';
Expand Down

0 comments on commit 9b4293e

Please sign in to comment.