0.1.8 • Published 4 months ago

asma-ui-richeditor v0.1.8

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
4 months ago

How to create and use the Design System

Component composition.

  • When creating components that consists of several components, each component should be styled.
  • Each components that is used to create a "composed" component should be styled, and remember to check if the component alread is styled.
  • When creating a "composed component" evalute if it's really needed to create a composed component, or just document how to use the styled components.
    • MUI often has documentation on how to create composed components.

Documentation and testing

  • All components shall be documented and tested in Storybook before PR is created.

Changelog

The project uses "changesets" to automatically bump version and create a changelog.

For each new feature or change run "npx changeset". Choose patch for a change or bug fix, minor for a new feature or major version for a breaking change. This creates a markdown file in .changeset folder. Commit to brach/PR as normal.

A PR can have several changesets.

The pipeline will automatically bump version and create changelog after merge to master.

Index file

  • Index files shall not be edited manually.
  • ctix is used for automatically create index files for exporting componens. Run "npm run create-index"
  • 'src/styles/index.ccss' is imported to 'src/theme/customMuiColors.ts' so exporting works with ctix.

Using MUI theme in App

import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
import { defaultTheme, customPalettes } from 'asma-ui-richeditor';

const dataTheme = window.document.body.attributes.getNamedItem('data-theme');

const getTheme = () => {
  switch (dataTheme?.value) {
    case 'fretex':
      return customPalettes.fretex.primary;
    default:
      return null;
  }
};

const theme = createTheme(defaultTheme, {
  palette: {
    ...defaultTheme.palette,
    primary: {
      ...getTheme(),
    },
    role: customPalettes.role,
  },
});

<React.Fragment>
  <ThemeProvider theme={createMuiTheme(theme)}>
    <... />
  </ThemeProvider>
</React.Fragment>

Using Components in App

import { StyledButton } from 'asma-ui-richeditor';

...

<>
  <StyledButton>
    Text
  </StyledButton>
</>
0.1.8

4 months ago

0.1.7

4 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.3-alpha2

7 months ago

0.1.3-alpha1

7 months ago

0.1.3-alpha3

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2-alpha-9

7 months ago

0.1.2-alpha-6

7 months ago

0.1.2-alpha-5

7 months ago

0.1.2-alpha-8

7 months ago

0.1.2-alpha-7

7 months ago

0.1.2-aplha

7 months ago

0.1.2-alpha-2

7 months ago

0.1.2-alpha-1

7 months ago

0.1.2-alpha

7 months ago

0.1.2-alpha-4

7 months ago

0.1.2-alpha-3

7 months ago

0.1.2-alpha-stable

7 months ago

0.1.2-alpha-12

7 months ago

0.1.2-alpha-10

7 months ago

0.1.2-alpha-11

7 months ago

0.1.2-beta-19

7 months ago

0.1.2-beta17

7 months ago

0.1.2-beta18

7 months ago

0.1.2-beta-20

7 months ago

0.1.2-beta-21

7 months ago

0.1.2-beta15

8 months ago

0.1.2-beta16

8 months ago

0.1.2-beta-stable

8 months ago

0.1.2-beta01

8 months ago

0.1.2-beta13

8 months ago

0.1.2-beta14

8 months ago

0.1.2-beta4

8 months ago

0.1.2-beta5

8 months ago

0.1.2-beta0

8 months ago

0.1.2-beta11

8 months ago

0.1.2-beta12

8 months ago

0.1.2-beta10

8 months ago

0.1.2-alpha2

8 months ago

0.1.2-beta8

8 months ago

0.1.2-beta9

8 months ago

0.1.2-beta6

8 months ago

0.1.2-beta7

8 months ago

0.1.2-beta2

8 months ago

0.1.2-beta3

8 months ago

0.1.2-beta1

8 months ago

0.1.2-alpha1

8 months ago

0.1.2-beta

8 months ago

0.1.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.2

12 months ago

0.0.1

12 months ago

0.0.0

12 months ago