1.43.0 • Published 8 months ago

@preamp/rev v1.43.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

PreAmp Rev

PreAmp components built on material-ui.

Using in another project

The exposed ThemeProvider component should be used at the top level of your project in order to ensure that the Rev components used within are styled correctly.

// App.tsx
import { ThemeProvider } from '@preamp/rev';

export const App = () => (
    <ThemeProvider>
        <Component />
    <ThemeProvider/>
);
// Component.tsx
import { Button } from '@preamp/rev';

export const Component = () => <Button>Text</Button>;

Adding a component to this package

All that is needed is a file to export the corresponding material-ui component.

// packages/rev/components/components/Button/Button.tsx
export { default as Button } from '@mui/material/Button';
export * from '@mui/material/Button';

Styling to match our design language should be done through the theme (packages/rev/theme.tsx).

See: https://next.material-ui.com/customization/theme-components/

Note: Colors may need to be added to the palette used by the theme (packages/rev/colors.ts).

Examples can also be created in the Documentation package.

// packages/documentation/src/rev/examples/components/Button/Button.tsx
import React, { ReactElement } from 'react';

import { Button, ThemeProvider } from '@preamp/rev';

const ButtonExample = (): ReactElement => (
    <ThemeProvider>
        <Button data-ui="button">Text</Button>
    </ThemeProvider>
);

export default ButtonExample;

Note: Tailwind classes and CSS variables (other than font-familys) should not be used within the Rev package.

Adding an icon to this package

The SVG content should be exported within a SvgIcon. The default viewBox for a SvgIcon is 24x24, so all icons should be scaled to this size and should not specify their own viewBox value.

// packages/rev/components/icons/VideoAmp/VideoAmp.tsx
import React, { ReactElement } from 'react';

import { SvgIcon, SvgIconProps } from '../../components/SvgIcon';

export function VideoAmp(props: SvgIconProps): ReactElement {
    return <SvgIcon {...props}>…</SvgIcon>;
}

Note: Colors should not be defined within the SVG. The current font color should be inheritable instead.

Examples should also be created in the Documentation package.

// packages/documentation/src/rev/examples/icons/VideoAmp/VideoAmp.tsx
import React, { ReactElement } from 'react';

import { VideoAmp } from '@preamp/rev';

const VideoAmpExample = (): ReactElement => <VideoAmp />;

export default VideoAmpExample;
1.37.0

10 months ago

1.39.0

9 months ago

1.40.0

9 months ago

1.42.0

9 months ago

1.42.1

9 months ago

1.36.1

10 months ago

1.38.0

10 months ago

1.36.2

10 months ago

1.36.3

10 months ago

1.41.0

9 months ago

1.43.0

8 months ago

1.35.1

11 months ago

1.35.0

11 months ago

1.36.0

11 months ago

1.7.10

2 years ago

1.7.11

2 years ago

1.7.12

2 years ago

1.7.13

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.9

2 years ago

1.6.8

2 years ago

1.6.7

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.14

2 years ago

1.5.13

3 years ago

1.5.16

2 years ago

1.5.15

2 years ago

1.5.17

2 years ago

1.5.12

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.5

3 years ago

1.5.6

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.1.0-beta.6.0

3 years ago

1.1.0-beta.5

3 years ago

1.1.0-beta.4

3 years ago

1.1.0-beta.3

3 years ago

1.1.0-beta.2

3 years ago

1.1.0-beta.1

3 years ago

0.1.0

3 years ago