3.29.3 ā€¢ Published 2 days ago

@moebel.de/glue-ds v3.29.3

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
2 days ago

Glue Design System Logo

Glue Design System

A design system for Moebel.de products. Check our Confluence Page for more information and our playground on glue-ds.moebel.de.

šŸš€ How to use this library

Install the library

Either using yarn or npm will work. We recommend using an alias. For that, in your package.json add the following dependency:

"glue-ds": "npm:@moebel.de/glue-ds@latest",

Add the styles to your library

We recommend doing it in your main entry file, as it's minified already. We don't support (yet) on demand styles for each component or exporting the Tailwind configuration

import 'glue-ds/styles';

Import Component

All our components are located in our entry file, so you should be able to use directly. You can also import each component by itself.

import { Button } from 'glue-ds';
// Or
import { Button } from 'glue-ds/components/Button';

Define Theme

To define a theme for your components, you need to define a CSS class that matches the name of the theme you want to use. For example, portal or kitchen.

<div className="portal">
  <Button intent="primary" onClick={handleClick}>
    I'm an example
  </Button>
</div>

šŸ“š Concepts

  • Atom: Minimal unit of a Design System, usually a Design Token
  • Components: An independent and reusable bits of code that represents an element of a Design System
  • Layouts: A consumer of components in charge of providing position and sizing for components
  • Theme: A collection of styles that affect all components in a project. An example would be: "portal" or "kitchen or "portal-halloween"
  • Modes: Light & Dark. For our DS, each theme has two modes. Default is always Light. A theme nor a component is not required to have definitions for both modes.

šŸ–Œļø Themes

Themes are a combination of CSS Variables and Tailwindcss. Under the hood is using PostCSS. To add/build/update to a theme, you need first to have design tokens. You can declare those in the file called themes.css. Check the confluence page for information on how to name variables and what kind of token you should add. It (should) looks like this:

// src/styles/themes.css
:root {
  --base: #fff;
  --black: #000;

  &.theme-A {
    --glue-primary: var(--base);
  }
  &.theme-B {
    --glue-primary: var(--black);
  }
}

Once added, you can extend the Tailwind configuration using these tokens, and later consume in the components in the same way you would do with Tailwind:

  // {DS}/tailwind.config.js
  theme: {
    extend: {
      colors: {
        primary: 'var(--glue-primary)',
      },
    },
  },

Use Glue-DS Tailwind config in your app

After adding Glue DS to your dependencies, simply add this preset to your own Tailwind configuration. Important: You need to add our styles for this to work, else the variables imported won't have any effect.

  // {YOUR_APP}/tailwind.config.js
  presets: [require('@moebel.de/glue-ds/config/tailwind')],

šŸ”  Fonts

Inside of src/assets/fonts you can find the existing font files. Those are compressed and only holding Latin subsets of the following fonts:

  • Roboto: @moebel.de/glue-ds/fonts/roboto/<FontFile>
  • Roboto Slab: @moebel.de/glue-ds/fonts/roboto/slab/<FontFile>
  • Roboto Mono: @moebel.de/glue-ds/fonts/roboto/mono/<FontFile>

You can use it directly as a face-font (like we do inside of .storybook/style.css). Or with Next.js utilizing next/font/local, like this:

export const robotoFont = localFont({
  src: [
    {
      path: '@moebel.de/glue-ds/fonts/roboto/Roboto-Light.woff2',
      weight: '300',
      style: 'normal',
    },
    ...
  ],
  variable: '--font-roboto',
});

The important part is to set a variable and assign it for example on the html or body element. More about this in Next.js fonts and optimization.

šŸ’£ Icons

To add a new icon, add the svg file to assets/icons folder and then run npm run build to generate the component. The rest is done by the scripts. If failing, it's very likely that the SVG has an invalid attribute.

To check available ones check the Storybook page dedicated to them.

šŸ§± Tech Stack

  • React @Typescript
  • Tailwind (v3) extended with Animated Tailwindcss
  • Storybook (With a11y, dark mode and a theme picker)
  • CVA
  • Jest & React Testing Library
  • Commitlint, husky, ESLint Rules & Prettier for ease of formatting and ensuring proper versioning
  • Semantic-Release for versioning
  • AWS S3 for Deployment

šŸ’” Contribution

Instead of listing what could be a very large list of advices, refer to this very interesting read. It may take some time, so grab yourself a coffee. ā˜•ļø

IMPORTANT

  • Do not forget to add Documentation
  • Do not forget to add Tests
  • Do not forget to make it Dev-Friendly (meaning: write simple code)
  • When creating a component, do not forget to add it to src/index.ts
  • We use conventional commits messages. Do not forget to add a prefix to your merge request.

šŸ Development

npm install
npm run storybook

ā›“ļø Testing your changes locally

We use yalc to be able to consume the package in other repositories without publishing to a remote registry first. This is useful for testing small changes. Run npm run push:local to make your changes available.

šŸ¦„ And that's it. šŸ¦„

3.29.3

2 days ago

3.29.2

8 days ago

3.29.1

10 days ago

3.28.0

12 days ago

3.28.2

12 days ago

3.28.1

12 days ago

3.29.0

12 days ago

3.26.1

24 days ago

3.27.0

24 days ago

3.26.0

25 days ago

3.25.2

1 month ago

3.25.1

1 month ago

3.25.0

1 month ago

3.24.2

2 months ago

3.24.4

1 month ago

3.24.3

2 months ago

3.24.1

2 months ago

3.24.0

2 months ago

3.23.4

2 months ago

3.23.3

2 months ago

3.23.2

2 months ago

3.22.0

2 months ago

3.23.1

2 months ago

3.23.0

2 months ago

3.20.0

2 months ago

3.21.1

2 months ago

3.21.0

2 months ago

3.19.4

3 months ago

3.19.3

3 months ago

3.19.2

3 months ago

3.19.1

3 months ago

3.18.11

3 months ago

3.19.0

3 months ago

3.18.10

3 months ago

3.18.9

3 months ago

3.18.7

3 months ago

3.18.8

3 months ago

3.18.5

3 months ago

3.17.1

3 months ago

3.18.4

3 months ago

3.18.1

3 months ago

3.18.0

3 months ago

3.18.3

3 months ago

3.18.2

3 months ago

3.17.0

3 months ago

3.16.4

3 months ago

3.16.1

3 months ago

3.16.3

3 months ago

3.16.2

3 months ago

3.15.3

3 months ago

3.16.0

3 months ago

3.15.0

4 months ago

3.15.2

4 months ago

3.15.1

4 months ago

3.14.0

4 months ago

3.13.1

4 months ago

3.12.0

4 months ago

3.11.0

4 months ago

3.10.3

4 months ago

3.10.2

4 months ago

3.10.1

4 months ago

3.10.0

5 months ago

3.9.0

5 months ago

3.8.0

5 months ago

3.7.4

5 months ago

3.7.3

6 months ago

2.4.0

9 months ago

1.21.0

10 months ago

1.21.1

10 months ago

3.2.2

8 months ago

3.2.1

8 months ago

3.2.0

8 months ago

1.21.2

10 months ago

1.21.3

10 months ago

1.29.0

9 months ago

3.2.5

8 months ago

1.29.1

9 months ago

3.2.4

8 months ago

3.2.3

8 months ago

1.29.4

9 months ago

1.29.5

9 months ago

1.29.2

9 months ago

1.29.3

9 months ago

1.29.6

9 months ago

1.29.7

9 months ago

1.32.0

9 months ago

1.32.1

9 months ago

1.19.0

11 months ago

1.19.4

11 months ago

1.19.3

11 months ago

1.19.2

11 months ago

1.19.1

11 months ago

1.19.5

11 months ago

2.3.0

9 months ago

1.22.0

10 months ago

1.28.10

9 months ago

3.1.3

8 months ago

1.22.3

10 months ago

3.1.2

8 months ago

3.1.1

8 months ago

1.22.1

10 months ago

3.1.0

8 months ago

1.22.2

10 months ago

3.1.4

8 months ago

2.2.1

9 months ago

2.2.0

9 months ago

3.0.3

8 months ago

3.0.2

8 months ago

1.23.0

10 months ago

3.0.1

8 months ago

1.23.1

10 months ago

3.0.0

8 months ago

2.1.1

9 months ago

2.1.0

9 months ago

1.24.0

10 months ago

3.7.1

6 months ago

3.7.0

6 months ago

2.8.1

9 months ago

2.8.0

9 months ago

3.7.2

6 months ago

2.0.0

9 months ago

1.25.0

10 months ago

1.25.1

10 months ago

3.6.0

6 months ago

1.25.2

10 months ago

2.7.0

9 months ago

2.7.2

9 months ago

2.7.1

9 months ago

1.26.0

10 months ago

3.5.3

6 months ago

3.5.2

6 months ago

3.5.1

6 months ago

3.5.0

7 months ago

2.8.3

9 months ago

2.8.2

9 months ago

2.8.5

9 months ago

2.8.4

9 months ago

2.8.7

9 months ago

2.8.6

9 months ago

2.8.9

8 months ago

2.8.8

8 months ago

2.6.1

9 months ago

2.6.0

9 months ago

3.5.5

6 months ago

3.5.4

6 months ago

3.4.0

7 months ago

1.27.2

10 months ago

1.27.3

10 months ago

3.4.2

7 months ago

1.27.0

10 months ago

3.4.1

7 months ago

1.27.1

10 months ago

1.27.6

10 months ago

2.7.3

9 months ago

1.27.4

10 months ago

1.27.5

10 months ago

1.30.0

9 months ago

1.30.1

9 months ago

1.32.2

9 months ago

1.32.3

9 months ago

2.5.0

9 months ago

2.8.12

8 months ago

2.8.11

8 months ago

2.8.10

8 months ago

1.20.1

10 months ago

2.8.15

8 months ago

1.20.2

10 months ago

2.8.14

8 months ago

2.8.13

8 months ago

1.20.0

10 months ago

3.3.1

7 months ago

3.3.0

7 months ago

1.20.3

10 months ago

1.28.1

10 months ago

1.28.2

10 months ago

3.3.3

7 months ago

3.3.2

7 months ago

1.28.0

10 months ago

1.28.5

9 months ago

1.28.6

9 months ago

1.28.3

10 months ago

1.28.4

10 months ago

1.28.9

9 months ago

1.28.7

9 months ago

1.28.8

9 months ago

1.31.0

9 months ago

1.18.0

11 months ago

1.16.10

11 months ago

1.17.0

11 months ago

1.16.9

11 months ago

1.16.8

11 months ago

1.12.3

12 months ago

1.14.0

11 months ago

1.12.2

12 months ago

1.12.1

12 months ago

1.12.0

12 months ago

1.10.2

1 year ago

1.16.3

11 months ago

1.12.7

11 months ago

1.16.2

11 months ago

1.12.6

11 months ago

1.16.1

11 months ago

1.12.5

11 months ago

1.16.0

11 months ago

1.12.4

12 months ago

1.16.7

11 months ago

1.16.6

11 months ago

1.16.5

11 months ago

1.12.9

11 months ago

1.16.4

11 months ago

1.12.8

11 months ago

1.12.10

11 months ago

1.12.11

11 months ago

1.11.0

12 months ago

1.15.0

11 months ago

1.13.2

11 months ago

1.11.4

12 months ago

1.13.1

11 months ago

1.11.3

12 months ago

1.13.0

11 months ago

1.11.2

12 months ago

1.11.1

12 months ago

1.15.4

11 months ago

1.13.6

11 months ago

1.15.3

11 months ago

1.13.5

11 months ago

1.15.2

11 months ago

1.13.4

11 months ago

1.15.1

11 months ago

1.13.3

11 months ago

1.13.8

11 months ago

1.13.7

11 months ago

1.10.1

1 year ago

1.10.0

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.10

1 year ago

1.3.13

1 year ago

1.3.14

1 year ago

1.3.11

1 year ago

1.3.12

1 year ago

1.3.17

1 year ago

1.3.18

1 year ago

1.3.15

1 year ago

1.3.16

1 year ago

1.3.19

1 year ago

1.3.20

1 year ago

1.3.21

1 year ago

1.3.24

1 year ago

1.3.25

1 year ago

1.3.22

1 year ago

1.3.23

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago