1.1.15 • Published 4 years ago

orca-design-system v1.1.15

Weekly downloads
569
License
-
Repository
-
Last release
4 years ago

orca - orchestrated design system with React Components

npm version GitHub license

FOSSA Status

Getting Started

Clone repo

git clone https://github.com/orchestrated-io/orca-design-system.git

Install dependencies

npm install or yarn

Run the style guide

Start development server

npm start or yarn start

View style guide

Open http://localhost:6060 to view it in the browser.

All library files are located inside /lib

Publish style guide

  • npm version patch

  • git push --follow-tags

Testing

npm run test or yarn test

Onboard your project to Orca design system

  • cd to your react app root folder

  • npm i orca-design-system

  • you will need to also use styled-components package to be able to use this design system

npm i styled-components or yarn add styled-components

then at top of file add import styled from 'styled-components';

  • Ensure the colours and theme provider is included in your application like below:
  import { colours } from "orca-design-system";
  import {ThemeProvider} from "styled-components";

  ...

  <ThemeProvider theme={colours}>
    <App/>
  </ThemeProvider>
  • You will also need to add the icon library that we are using (which is Font Awesome). To do this, add this to the top of your root app file:
import { library } from '@fortawesome/fontawesome-svg-core'
import {far} from '@fortawesome/free-regular-svg-icons'
import {fas} from '@fortawesome/free-solid-svg-icons'
library.add(far, fas);
  • Alternatively, you can use the full icon packages if you purchase Font Awesome Pro license.

Once you have purchased a license you need to add your Font Awesome NPM token as an environment variable in a .npmrc file at the root of your app in the following format:

@fortawesome:registry=https://npm.fontawesome.com
//npm.fontawesome.com/:_authToken=FONT_AWESOME_NPM_TOKEN_GOES_HERE

And then install and import the correct packages:

import { library } from '@fortawesome/fontawesome-svg-core'
import {fal} from '@fortawesome/pro-light-svg-icons'
import {far} from '@fortawesome/pro-regular-svg-icons'
import {fas} from '@fortawesome/pro-solid-svg-icons'
library.add(fal, far, fas);
  • If you want to use the app layout/navigation elements from the design system, like header, mobile nav and sidebar, you need to ensure you structure your app the following way so these all function correctly:
  <MobileNav>...</MobileNav>
  <Header>...</Header>
  <main>
    <Sidebar>...</Sidebar>
    <section>
      Put your main page content here
    </section>
  </main>

Upgrading your app to use the latest version of the design system

When you use the design system, it will use the particular git hash that has been added/installed. If you want to upgrade to the latest hash, you need to run the following command: npm update --save orca-design-system or yarn upgrade orca-design-system

How to use components from the design system

Simple components

  • Make sure you import that component e.g.:

import { Button } from 'orca-design-system';

  • Then you can use that component like so:

<Button>Click me</Button>

  • And you can customise the look using the props which you can see in the examples on the link above. For example the following will give you a large green button:

<Button large secondary>Click me</Button>

Sub-components

  • Some components are made up of multiple sub-components, for example, Typography. To use these typographic elements you need to reference the component and then sub-component, like so:

  • Import the component:

import { Typography } from 'orca-design-system';

  <Typography.H1>Page title</Typography.H1>
  <Typography.P>Page description</Typography.P>

Multi-components

  • Some components are made up of multiple components that are intended to work together. In this case you need to use exactly as specified in the design system; the markup structure and attributes should be the same.

  • One example is the tabs component input http://styleguide.orchestrated.io/#tabs, which if you refer to the design system example needs to be used like so:

  import { Tabs } from 'orca-design-system';

  <Tabs.Container>
    <Tabs.Tab active>Tab one</Tabs.Tab>
    <Tabs.Tab>Tab two</Tabs.Tab>
  </Tabs.Container>

  <Tabs.Content active>
    Place whatever child content you like here
  </Tabs.Content>

  <Tabs.Content>
    Place whatever child content you like here
  </Tabs.Content>
  • There are other more complicated components like the sidebar, but as long as examples are followed these should be easy enough to implement.

Icons

  • To use icons you need to ensure you are importing the library (as outlined above in onboarding section). Import the Icon component and then reference them like this:

import { Icon } from 'orca-design-system';

<Icon icon={["far", "user"]} />

<Icon icon={["far", "calendar"]} size="2x" color={colours.blue} />

Creating custom components or styles in your app

  • If you need to create a custom component that is specific for your app, this should be done and styled using the same method as this design system, which uses styled-components. For examples, view this design system's source code (have a look at various components in the /lib/components folder to see how they are constructed) and for documentation see: https://www.styled-components.com/.

  • To keep certain variables and colours consistent across your app, it is advised to use the ones defined in this design system. To view these, see /lib/colours.js and /lib/variables.js.

  • To implement these in your app you first need to import colours and variables like so: import {colours, variables} from "orca-design-system"; and then you can use like so in your styling:

const customComponent = styled.div`
  padding: ${variables.defaultSpacing};
  background-color: ${colours.primaryLight};
`

Browser/device support

This design system is intended to work correctly on all modern desktop and mobile browsers.


"A design system is a living, funded product with a roadmap and backlog, serving an ecosystem." — Nathan Curtis

1.1.14-alpha.451

4 years ago

1.1.14-alpha.408

4 years ago

1.1.14-alpha.380

4 years ago

1.1.14-alpha.346

4 years ago

1.1.14-alpha.228

4 years ago

1.1.14-alpha.221

4 years ago

1.1.14-alpha.199

4 years ago

1.1.14-alpha.107

4 years ago

1.1.14-alpha.95

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.121

5 years ago

1.0.120

5 years ago

1.0.119

5 years ago

1.0.118

5 years ago

1.0.117

5 years ago

1.0.116

5 years ago

1.0.115

5 years ago

1.0.113

5 years ago

1.0.112

5 years ago

1.0.111

5 years ago

1.0.110

5 years ago

1.0.109

5 years ago

1.0.108

5 years ago

1.0.107

5 years ago

1.0.106

5 years ago

1.0.105

5 years ago

1.0.104

5 years ago

1.0.103

5 years ago

1.0.102

5 years ago

1.0.101

5 years ago

1.0.100

5 years ago

1.0.99

5 years ago

1.0.98

5 years ago

1.0.97

5 years ago

1.0.96

5 years ago

1.0.95

5 years ago

1.0.94

5 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.91

5 years ago

1.0.90

5 years ago

1.0.89

5 years ago

1.0.88

5 years ago

1.0.87

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.80

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.77

5 years ago

1.0.76

5 years ago

1.0.75

5 years ago

1.0.74

5 years ago

1.0.73

5 years ago

1.0.72

5 years ago

1.0.71

5 years ago

1.0.70

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.66

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.60

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.56

5 years ago

1.0.55

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago