0.4.44 • Published 4 months ago

@vchasno/ui-kit v0.4.44

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

UI-Kit library for Vchasno web applications

📦 Install

npm install @vchasno/ui-kit
yarn add @vchasno/ui-kit

🔨 Usage

  1. Before consuming components, you need to import required CSS into your project. Preferable way is to use global css import or postcss imports:
  • import directly into your project if your bundler supports it
// index.tsx
// optional reset styles
import '@vchasno/ui-kit/dist/css/_base.css';
import '@vchasno/ui-kit/dist/css/_reset.css';
// required main css which includes variables and styles
import '@vchasno/ui-kit/dist/css/vchasno-ui.css';
// override theme if needed (more info in "Styling and customization" section)
import 'src/styles/_theme-override.css';
  • using postcss @import statement
/* globals.css */
// optional reset styles
@import '@vchasno/ui-kit/dist/css/_base.css';
@import '@vchasno/ui-kit/dist/css/_reset.css';
// required main css which includes variables and styles
@import '@vchasno/ui-kit/dist/css/vchasno-ui.css';
// override theme if needed (more info in "Styling and customization" section)
@import './styles/_theme-override.css';

Configure webpack to import vchasno-ui.css file in global mode if needed. For example:

module.exports = {
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    {
                        loader: 'css-loader',
                        options: {
                            import: true,
                            modules: {
                                mode: (resourcePath) => {
                                    if (/\/node_modules\//i.test(resourcePath)) {
                                        return 'global';
                                    }

                                    return 'local';
                                },
                                localIdentName: '[name]__[local]__[hash:base64:5]',
                            },
                            importLoaders: 2,
                        },
                    },
                ],
            },
        ],
    },
};
  1. Now you can import react components based on your needs
import React from 'react';

import { Button } from '@vchasno/ui-kit';

const App = () => (
    <>
        <Button type="primary">PRESS ME</Button>
    </>
);

Styling and customization

vchasno-ui is using global styles with prefix vchasno-ui- css variables start with the prefix --vchasno-ui-

To customize styles you can use CSS variables and override them

/* theme-override.css */
:root {
  --vchasno-ui-transition-duration-sec: 0.5s; // default 0.3s
}

... or more specific styles

/* button-override.css */
:global(.vchasno-ui-button.--sm) {
  padding: 0 20px; // default 0 15px
}

TypeScript

vchasno-ui is written in TypeScript with complete definitions

🌍 Internationalization

Supports only Ukrainian language

🔗 Links

Development

Install dependencies

npm install

Add new component

npm run storybook
npm run generate-component <ComponentName>

Go to http://localhost:6006/ and start developing

To create story see Storybook docs or other components

Build storybook

npm run build-storybook

Build

npm run build

Publish new version

0.2 versions

Should develop in v0.2 branch. All merge requests should be merged to v0.2 branch

0.3 version

Should develop in v0.3 branch. All merge requests should be merged to v0.3 branch

0.4 version - latest

Should develop in master branch. All merge requests should be merged to master branch

Publish version to npm registry

Publish new version to npm registry can only be done with CI/CD

To publish new version:

  1. Make changes in new branch (e.g. feature/new-component)
  2. Add changes to CHANGELOG.md (see Keep a Changelog)
  3. Commit changes
  4. Create tag with version (e.g. v0.1.2) run npm version patch|minor|major
  5. Push tag to remote repository
  6. Publish job will be started in CI/CD pipeline (only for master branch or version tag)
  7. Confirm (CI/CD prepared manual stage) publish - new version will be published to npm registry
0.4.43

4 months ago

0.4.44

4 months ago

0.4.42

5 months ago

0.4.40

5 months ago

0.4.41

5 months ago

0.4.39

6 months ago

0.4.37

6 months ago

0.4.38

6 months ago

0.4.36

6 months ago

0.4.35

7 months ago

0.4.33

7 months ago

0.4.34

7 months ago

0.4.32

7 months ago

0.4.30

7 months ago

0.4.28

8 months ago

0.4.29

8 months ago

0.4.26

8 months ago

0.4.24

8 months ago

0.4.25

8 months ago

0.4.23

8 months ago

0.4.22

9 months ago

0.4.20

9 months ago

0.4.19

9 months ago

0.4.17

10 months ago

0.4.18

9 months ago

0.4.15

10 months ago

0.4.16

10 months ago

0.4.13

10 months ago

0.4.14

10 months ago

0.4.9

11 months ago

0.4.8

11 months ago

0.4.10

10 months ago

0.4.11

10 months ago

0.4.12

10 months ago

0.4.5

11 months ago

0.4.4

11 months ago

0.4.7

11 months ago

0.4.6

11 months ago

0.4.3

11 months ago

0.4.2

11 months ago

0.3.35

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.31

11 months ago

0.3.30

11 months ago

0.3.34

11 months ago

0.3.33

11 months ago

0.3.32

11 months ago

0.3.29

11 months ago

0.3.28

11 months ago

0.3.27

11 months ago

0.3.26

11 months ago

0.3.25

11 months ago

0.3.24

11 months ago

0.3.20

11 months ago

0.3.23

11 months ago

0.3.22

11 months ago

0.3.21

11 months ago

0.3.19

11 months ago

0.3.18

11 months ago

0.3.17

11 months ago

0.3.16

11 months ago

0.3.15

11 months ago

0.3.14

11 months ago

0.3.13

11 months ago

0.3.12

11 months ago

0.3.11

11 months ago

0.3.9

12 months ago

0.2.21

12 months ago

0.3.10

12 months ago

0.2.20

12 months ago

0.2.19

12 months ago

0.3.8

12 months ago

0.2.18

1 year ago

0.2.17

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.3.2

1 year ago

0.3.0

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.7

1 year ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago