1.0.0 • Published 4 months ago

ui-framework-v2 v1.0.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
4 months ago

Bob Group UI framework

A custom set of React UI components used by Bob Group, based on TailwindCSS and Headless UI

To add the framework to your project (assuming that your project is using Create React App):

  1. yarn add bob-group-ui-framework
  2. yarn add -D @craco/craco
  3. Add the following to the top of your main SCSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;

html {
  font-size: 0.875rem;
}
  1. Add the following to your index.js file
import "bob-group-ui-framework/build/index.css";
  1. Replace your npm scripts (in package.json) with:
"start": "craco start",
"build": "craco build",
  1. Add a file named craco.config.js to the root of your project containing:
module.exports = {
  style: {
    postcss: {
      plugins: [require("tailwindcss"), require("autoprefixer")]
    }
  }
};
  1. Add a file named tailwind.config.js to the root of your project containing:
const colors = require("tailwindcss/colors");

module.exports = {
  purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"],
  darkMode: false, // or 'media' or 'class'
  theme: {
    screens: {
      xs: "475px",
      sm: "640px",
      md: "768px",
      lg: "1024px",
      xl: "1280px",
      "2xl": "1536px"
    },
    boxShadow: {
      sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
      DEFAULT: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
      md: "0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03)",
      lg: "0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03)",
      xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
      "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
      "3xl": "0 35px 60px -15px rgba(0, 0, 0, 0.3)",
      inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)",
      none: "none"
    },
    extend: {
      spacing: {
        120: "30rem"
      },
      transitionProperty: {
        width: "width"
      }
    },
    fontFamily: {
      sans: ["Montserrat"]
    },
    borderWidth: {
      DEFAULT: "1px",
      0: "0",
      2: "2px",
      3: "3px",
      4: "4px",
      6: "6px",
      8: "8px"
    },
    colors: {
      transparent: "transparent",
      current: "currentColor",
      black: colors.black,
      white: colors.white,
      gray: colors.trueGray,
      indigo: colors.indigo,
      red: { ...colors.red, light: "#FCA5A5", DEFAULT: "#DC2626", dark: "#991B1B" },
      green: {
        ...colors.green,
        100: "rgb(231, 255, 209)",
        500: "#06b73d",
        DEFAULT: "#06b73d"
      },
      pink: {
        ...colors.pink,
        100: "#FFDFDC",
        500: "#FF024E",
        DEFAULT: "#FF024E"
      },
      yellow: {
        ...colors.yellow,
        100: "#FFFBD3",
        500: "#FFB600",
        DEFAULT: "#FFB600"
      },
      blue: {
        ...colors.blue,
        light: "#D6ECFF",
        DEFAULT: "#007BFF",
        dark: "#0060C7",
        100: "rgb(214, 236, 255)",
        500: "#0076fa"
      },
      primary: {
        ...colors.primary,
        light: "#D6ECFF",
        DEFAULT: "#007BFF",
        dark: "#0060C7",
        100: "rgb(214, 236, 255)",
        500: "#0076fa"
      }
    }
  },
  variants: {
    extend: {
      opacity: ["disabled"]
    }
  },
  plugins: [require("@tailwindcss/forms")]
};
  1. Change the colors of primary to your appropriate primary color

For some background on how it was compiled follow https://www.pluralsight.com/guides/react-typescript-module-create

Additional documentation

CustomTable

Pagination

Developing the framework

In order to test your changes, navigate to the project you want to test it in e.g. Bob Pay. Then in the bobpay-frontend, copy the ui-framework folder to the src folder of Bob Pay and import the framework like this: import { Map } from "ui-framework/src";

1.0.0

4 months ago

0.1.62

4 months ago

0.1.60

4 months ago

0.1.61

4 months ago

0.1.58

4 months ago

0.1.59

4 months ago

0.1.56

4 months ago

0.1.57

4 months ago

0.1.55

4 months ago

0.1.53

5 months ago

0.1.54

5 months ago

0.1.52

5 months ago

0.1.50

5 months ago

0.1.51

5 months ago

0.1.49

5 months ago

0.1.42

6 months ago

0.1.43

6 months ago

0.1.44

5 months ago

0.1.45

5 months ago

0.1.46

5 months ago

0.1.47

5 months ago

0.1.48

5 months ago

0.1.41

6 months ago

0.1.40

6 months ago

0.1.39

6 months ago

0.1.38

8 months ago

0.1.37

8 months ago

0.1.36

8 months ago

0.1.35

8 months ago

0.1.34

8 months ago

0.1.33

8 months ago

0.1.32

8 months ago

0.1.31

8 months ago

0.1.30

8 months ago

0.1.29

8 months ago

0.1.28

8 months ago

0.1.27

8 months ago

0.1.26

8 months ago

0.1.25

8 months ago

0.1.24

8 months ago

0.1.23

8 months ago

0.1.22

8 months ago

0.1.21

9 months ago

0.1.20

9 months ago

0.1.19

9 months ago

0.1.18

9 months ago

0.1.17

9 months ago

0.1.16

9 months ago

0.1.15

9 months ago

0.1.14

9 months ago

0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago