0.2.90-autosavingHOC-3 โ€ข Published 3 months ago

workfinder-components v0.2.90-autosavingHOC-3

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

Workfinder Components

License: MIT npm version

Description ๐Ÿ“

Components library for Workfinder-related pages.

Table of Contents ๐Ÿ“š

Installation ๐Ÿš€

To install the workfinder-components library, you can use npm or yarn:

npm install workfinder-components

or

yarn add workfinder-components

Usage ๐Ÿš€

Once installed, you can import and use the components in your React project:

import { ComponentName } from 'workfinder-components';

Development ๐Ÿ‘จโ€๐Ÿ”ง

Storybook ๐Ÿ“–

To start the development environment and Storybook, use the following command:

npm run storybook

or

yarn storybook

This will start Storybook at http://localhost:6007.

Rollup ๐Ÿงฑ

Rollup is a popular JavaScript module bundler that focuses on creating efficient and optimized bundles for modern web applications and libraries. It is particularly well-suited for building JavaScript libraries and components due to its tree-shaking capabilities and support for ES modules.

Why Use Rollup? ๐Ÿค”

  • Tree-Shaking: Rollup analyzes the import and export statements in your code and removes unused code during the bundling process. This leads to smaller bundle sizes and better performance.

  • ES Modules (ESM) Support: Rollup natively supports ES modules, making it an excellent choice for creating packages that can be used by other modern tools and build systems.

  • Simplified Configuration: Rollup's configuration is straightforward and easy to understand, making it quick to set up and customize your build process.

  • Fast and Efficient: Rollup is designed to be fast and efficient, making it a great choice for large-scale projects where performance matters.

Rollup Configuration (rollup.config.js)

In the rollup.config.js file, you define how Rollup should bundle your library. Here are some key points to note in the provided configuration:

  • Input: The input field specifies the entry point of your library, where Rollup starts bundling.

  • Output: The output field defines the desired output format and location of the bundled files. In this case, it generates two output files, one for CommonJS (format: "cjs") and another for ES modules (format: "esm").

  • Plugins: The plugins field lists the Rollup plugins used in the build process. For example, peerDepsExternal() helps externalize peer dependencies, and resolve() enables resolving dependencies from node_modules.

  • PostCSS and Copy: Rollup is not limited to just JavaScript; it can handle other assets as well. In this configuration, the postcss and copy plugins are used to handle CSS files and copy assets, respectively.

  • External Dependencies: The external field contains the list of dependencies that should not be bundled but rather treated as external dependencies. In this case, "react" and "react-dom" are marked as external, as they are expected to be provided by the consumer of the library.

How to Build with Rollup ๐Ÿ“ฆ

To build your library using Rollup, simply run the following command:

npm run build

Color Palette ๐ŸŽจ

The Workfinder Components library defines a color palette to maintain consistency and branding across its components. Here are some key colors and their intended usage:

Primary Colors:

$wf-blue: This is the primary color used for buttons, links, and other primary components. $wf-blue-variant: A variant of the primary blue, used for elements that require a slightly different shade.

Secondary Colors:

$heliotrope, $maze-crayola, $sinopia, $iluminating-emerald: These colors are used for secondary elements like secondary buttons and icons.

Error, Warning, and Success Colors:

$error-1, $error-2, $error-3: Used to indicate error states in components. $warning-1, $warning-2, $warning-3: Used to indicate warning or caution states in components. $success-1, $success-2, $success-3: Used to indicate successful or positive states in components.

Shades:

$black, $white: Basic black and white colors for text and backgrounds. $grey-1 to $grey-8: Different shades of grey used for various elements.

Additional Colors:

$fair-pink, $buttercup, $jade, $clear-day, and others: Additional colors for specific use cases within the components.

To use these colors in your components, you can access them directly by importing the main SCSS file. For example:

@import "../../scss/main.scss"; // depending on the location of your file

.primary-button {
  background-color: $wf-blue;
  color: $white;
}

.secondary-button {
  background-color: $heliotrope;
  color: $black;
}

.error-message {
  color: $error-1;
}

Testing ๐Ÿงช

Running Tests ๐Ÿƒ

To run tests, use the following command:

npm test

or

yarn test

To run tests in watch mode, use:

npm run test:watch

or

yarn test:watch

Chromatic Testing and Publishing ๐ŸŽจ๐Ÿ“š

Chromatic is used for testing and publishing components in this library. It ensures that visual UI components are consistent across different environments and showcases interactive component demos.

Automated Testing with Chromatic ๐Ÿค–

Chromatic tests are automatically triggered in the CI/CD pipeline for every push to the repository's main branch. It checks for visual changes and provides a visual diff report.

Manual Testing with Chromatic ๐Ÿ‘ฉโ€๐Ÿ’ป

To run Chromatic tests manually, use the following command:

npm run chromatic

or

yarn chromatic

Contributing ๐Ÿ‘ฅ

We welcome contributions! If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch with a descriptive name.
  3. Make your changes and commit them.
  4. Push the changes to your forked repository.
  5. Submit a pull request to the main repository.

Please ensure your code adheres to the project's coding standards and passes all tests.

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE file for details.

0.2.90

3 months ago

0.2.89

3 months ago

0.2.88

3 months ago

0.2.87

3 months ago

0.2.85

3 months ago

0.2.86

3 months ago

0.2.84

4 months ago

0.2.83

4 months ago

0.2.82

4 months ago

0.2.81

4 months ago

0.2.80

4 months ago

0.2.79

4 months ago

0.2.79-richtext

4 months ago

0.2.78

4 months ago

0.2.77

4 months ago

0.2.76

4 months ago

0.2.74

4 months ago

0.2.75

4 months ago

0.2.73

4 months ago

0.2.72

6 months ago

0.2.71

6 months ago

0.2.70

6 months ago

0.2.71-checkbox

6 months ago

0.2.69

7 months ago

0.2.68

7 months ago

0.2.71-checkbox-6

6 months ago

0.2.71-checkbox-5

6 months ago

0.2.71-checkbox-7

6 months ago

0.2.71-checkbox-2

6 months ago

0.2.71-checkbox-4

6 months ago

0.2.71-checkbox-3

6 months ago

0.1.118

10 months ago

0.1.117

10 months ago

0.1.119

10 months ago

0.1.114

10 months ago

0.1.113

10 months ago

0.1.116

10 months ago

0.1.115

10 months ago

0.1.110

10 months ago

0.1.112

10 months ago

0.1.111

10 months ago

0.1.129

10 months ago

0.1.128

10 months ago

0.1.125

10 months ago

0.1.124

10 months ago

0.1.127

10 months ago

0.1.121

10 months ago

0.1.120

10 months ago

0.1.123

10 months ago

0.1.122

10 months ago

0.1.139

10 months ago

0.1.136

10 months ago

0.1.135

10 months ago

0.1.138

10 months ago

0.1.137

10 months ago

0.1.132

10 months ago

0.1.131

10 months ago

0.1.134

10 months ago

0.1.133

10 months ago

0.1.130

10 months ago

0.1.147

10 months ago

0.1.146

10 months ago

0.1.149

10 months ago

0.1.148

10 months ago

0.1.143

10 months ago

0.1.142

10 months ago

0.1.145

10 months ago

0.1.144

10 months ago

0.1.141

10 months ago

0.1.140

10 months ago

0.1.107

10 months ago

0.1.106

10 months ago

0.1.109

10 months ago

0.1.108

10 months ago

0.1.103

11 months ago

0.1.102

11 months ago

0.1.105

10 months ago

0.1.104

11 months ago

0.1.101

11 months ago

0.1.100

11 months ago

0.2.27

9 months ago

0.2.26

9 months ago

0.2.25

9 months ago

0.2.24

9 months ago

0.2.23

9 months ago

0.2.22

9 months ago

0.2.21

9 months ago

0.2.20

9 months ago

0.2.19

9 months ago

0.2.18

9 months ago

0.2.17

9 months ago

0.2.16

9 months ago

0.2.15

9 months ago

0.2.14

9 months ago

0.2.13

9 months ago

0.2.12

9 months ago

0.2.11

9 months ago

0.2.10

9 months ago

0.2.63

7 months ago

0.1.96

11 months ago

0.2.62

7 months ago

0.1.97

11 months ago

0.2.61

8 months ago

0.1.98

11 months ago

0.2.60

8 months ago

0.1.99

11 months ago

0.1.90

12 months ago

0.1.91

12 months ago

0.2.67

7 months ago

0.1.92

12 months ago

0.2.66

7 months ago

0.1.93

12 months ago

0.2.65

7 months ago

0.2.64

7 months ago

0.1.95

12 months ago

0.2.52

8 months ago

0.2.51

8 months ago

0.2.50

8 months ago

0.2.59

8 months ago

0.2.58

8 months ago

0.2.57

8 months ago

0.2.56

8 months ago

0.2.55

8 months ago

0.2.54

8 months ago

0.2.53

8 months ago

0.2.41

9 months ago

0.2.40

9 months ago

0.2.49

8 months ago

0.2.48

9 months ago

0.2.47

9 months ago

0.2.46

9 months ago

0.2.45

9 months ago

0.2.44

9 months ago

0.2.43

9 months ago

0.2.42

9 months ago

0.2.39

9 months ago

0.2.30

9 months ago

0.2.38

9 months ago

0.2.37

9 months ago

0.2.36

9 months ago

0.2.35

9 months ago

0.2.34

9 months ago

0.2.33

9 months ago

0.2.32

9 months ago

0.2.31

9 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.2.29

9 months ago

0.2.28

9 months ago

0.2.7

10 months ago

0.2.6

10 months ago

0.2.9

9 months ago

0.2.8

9 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.1.86

12 months ago

0.1.87

12 months ago

0.1.88

12 months ago

0.1.89

12 months ago

0.1.80

1 year ago

0.1.81

1 year ago

0.1.82

1 year ago

0.1.83

1 year ago

0.1.84

1 year ago

0.1.74

1 year ago

0.1.75

1 year ago

0.1.76

1 year ago

0.1.77

1 year ago

0.1.78

1 year ago

0.1.79

1 year ago

0.1.70

1 year ago

0.1.71

1 year ago

0.1.72

1 year ago

0.1.73

1 year ago

0.1.66

1 year ago

0.1.67

1 year ago

0.1.68

1 year ago

0.1.69

1 year ago

0.1.65

1 year ago

0.1.64

1 year ago

0.1.63

1 year ago

0.1.62

1 year ago

0.1.61

1 year ago

0.1.60

1 year ago

0.1.59

1 year ago

0.1.58

1 year ago

0.1.57

1 year ago

0.1.56

1 year ago

0.1.55

1 year ago

0.1.54

1 year ago

0.1.53

1 year ago

0.1.52

1 year ago

0.1.51

1 year ago

0.1.50

1 year ago

0.1.49

1 year ago

0.1.48

1 year ago

0.1.47

1 year ago

0.1.46

1 year ago

0.1.45

1 year ago

0.1.44

1 year ago

0.1.43

1 year ago

0.1.42

1 year ago

0.1.41

1 year ago

0.1.40

1 year ago

0.1.39

1 year ago

0.1.38

1 year ago

0.1.37

1 year ago

0.1.36

1 year ago

0.1.35

1 year ago

0.1.34

1 year ago

0.1.33

1 year ago

0.1.32

1 year ago

0.1.31

1 year ago

0.1.30

1 year ago

0.1.28

1 year ago

0.1.27

1 year ago

0.1.26

1 year ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago