1.4.6 • Published 3 years ago

@appbuckets/react-bucket v1.4.6

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

An Old School React UI Framework based on TypeScript and SCSS, fully customizable, with a dedicated CreateReactApp template. Check it out here

license npm latest package npm downloads Dependabot Status

Installation

ReactBucket is a npm package, available through NPM or Yarn.

Latest stable release could be downloaded using your preferred package manager

// with yarn
yarn install @appbuckets/react-bucket

// with npm
npm install -S @appbuckets/react-bucket

Base Usage

A quick example of how can you use ReactBucket is the following:

import * as React from "react";
import * as ReactDOM from "react-dom";

// Import the base CSS file
// using SCSS could be done to, check documentation below
import "@appbuckets/react-bucket/build/styles/build.css";

// BucketTheme is the Theme Provider, use this to change the
// default prop of each single component.
// This Provider is not required, and it's optional
import { BucketTheme, Button, Box } from "@appbuckets/react-bucket";


function App() {
  return (
    <Box textAlign="center" mt="8">
      <Button
        primary
        icon={"rocket"}
        content={"Launch to the Moon"}
        tooltip={"Write wonderful Code"}
      />
    </Box>
  );
}

ReactDOM.render(
  <BucketTheme>
    <App />
  </BucketTheme>,
  document.getElementById("root")
);

Edit Button

Docs

Components Demo and Examples

Full documentation is still to write.

Storybook

To view Storybook download repo and launch yarn start:storybook.

Storybook has been used to check the develop process, it is not fully documented and components doesn't have all style and props.

Use with create-react-app template

A new template has been released. It won't contain only @appbuckets/react-bucket package (fully configured to work out of the box), but it contains also two additional module called @appbuckets/app-router and @appbuckets/react-app-client. Unfortunately they are not documented yet, but are two powerful tools to help you build new WebApp with routing and Auth Client.

To create a new React App using create-react-app and this template open the terminal and write

npx create-react-app <my-app-name> --template appbuckets-app

This template will replace react-script with @craco to use SCSS style instead CSS, as described below.

Using SCSS Styles

The source files that define the style of ReactBucket can be used in any project, but with some tweaks. PostCSS must be used to recompile the style correctly without errors. ReactBucket uses a number of plugins, which are essential primarily for redefining and repositioning media queries.

PAY ATTENTION You cannot use postcss@^8 with this methods.

The plugins used by ReactBucket are:

  • postcss-import
  • postcss-momentum-scrolling
  • postcss-merge-rules
  • postcss-import-url
  • postcss-discard-duplicates
  • postcss-sort-media-queries
  • postcss-single-charset
  • postcss-discard-comments in production mode only
  • postcss-single-line in production mode only
  • autoprefixer
  • css-declaration-sorter in production mode only
  • cssnano in production mode only

Instead of having to manually include individual plugins within the postcss.config.js file, you can download an additional repository that includes the configuration necessary to build the stylesheet.

# Using YARN
yarn add -D @appbuckets/postcss-react-bucket

# Using NPM
npm install -D @appbuckets/postcss-react-bucket

and used the getPostCSSPlugins function in your postcss.config.js:

const { getPostCSSPlugins } = require('@appbuckets/postcss-react-bucket');

module.exports = {
  plugins: [
    ...getPostCSSPlugins()
  ]
}

A configuration object could be passed to the function to adjust settings or exclude some plugins. Don't exclude plugins from compiling unless you really need them.

The configuration object can have one or more of the following options:

PropertyTypeDescription
browserslist{ development: string[], production: string[] }Override default BrowsersList in development or production mode
cssDeclarationSorteralphabetical - smacss - concentric-cssSet declaration sort order. Default is alphabetical
excludestring[]Exclude some plugin from build
mediaQueriesSortingmobile-first - desktop-firstSet media queries order. Default is mobile-first
modedevelopment - productionSet the build mode. If none the NODE_ENV variable will be used

Use Style in combination with Create React App

Unfortunately react-script does not allow you to override or change the app creation settings until you use the eject function. If you don't want to use the eject function you will have to use an external dependency, called craco to add the necessary plugins

1. Install Craco Package

# Using YARN
yarn add -D @craco/craco

# Using NPM
npm install -D @craco/craco

2. Replace package.json Scripts

{
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test"
  }
}

3. Add the craco.config.js

const { getPostCSSPlugins } = require('@appbuckets/postcss-react-bucket');

module.exports = {
  /** Extends PostCSS Plugins to Build ReactBucket Style */
  style: {
    postcss: {
      mode   : 'extends',
      plugins: [
        ...getPostCSSPlugins()
      ]
    }
  }
};

TODO

  • Write Docs and Demos
  • Complete Tests
  • Refactor Storybook

Contributing

Read the contributing guide to learn about our development process, how to propose bugfixes and improvements.

License

This project is licensed under the terms of the MIT license.

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.3.56

3 years ago

0.3.55

3 years ago

0.3.53

3 years ago

0.3.51

3 years ago

0.3.50

3 years ago

0.3.49

3 years ago

0.3.48

3 years ago

0.3.46

3 years ago

0.3.45

3 years ago

0.3.44

3 years ago

0.3.43

3 years ago

0.3.42

3 years ago

0.3.41

3 years ago

0.3.4

3 years ago

0.3.34

3 years ago

0.3.33

3 years ago

0.3.32

3 years ago

0.3.31

3 years ago

0.3.3

3 years ago

0.3.21

3 years ago

0.3.2

3 years ago

0.3.1-beta.5

3 years ago

0.3.1-beta.4

3 years ago

0.3.1-beta.2

4 years ago

0.3.1-beta.3

4 years ago

0.3.1-beta.1

4 years ago

0.3.0-alpha.30

4 years ago

0.3.0-alpha.23

4 years ago

0.3.0-alpha.22

4 years ago

0.3.0-alpha.21

4 years ago

0.3.0-alpha.20

4 years ago

0.3.0-alpha.12

4 years ago

0.3.0-alpha.11

4 years ago

0.3.0-alpha.10

4 years ago

0.3.0-alpha.9

4 years ago

0.3.0-alpha.8

4 years ago

0.3.0-alpha.7

4 years ago

0.3.0-alpha.6

4 years ago

0.3.0-alpha.4

4 years ago

0.3.0-alpha.5

4 years ago

0.3.0-alpha.2

4 years ago

0.3.0-alpha.3

4 years ago

0.3.0-alpha.1

4 years ago

0.2.262

4 years ago

0.2.261

4 years ago

0.2.26

4 years ago

0.2.253

4 years ago

0.2.252

4 years ago

0.2.251

4 years ago

0.2.25

4 years ago

0.2.24

4 years ago

0.2.101

4 years ago

0.2.1

4 years ago

0.1.0

4 years ago