Skip to content

NotAnmol/placebo-docs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Placebo

This is an image

Our design system helps us work together to build a great experience for all.

Colours

Primary

Use primary colors for primary actions like buttons, icons and text on navigation and tabs, and for the background in navigation and tab interactive states.

#EDF0FE#DAE0FD#B5C2FB#90A3FA#6B85F8#4666F6#3852C5#2A3D94#1C2962#0E1431

Secondary

Use secondary colors for secondary and tertiary buttons and the background of form elements.

#F8FAFC#F1F5F9#E2E8F0#CBD5E1#94A3B8#64748B#475569#334155#1E293B#0F172A

Surface

Surface colors affect surfaces of components, such as page, card, sheet, and popover.

#FFFFFF#F8FAFC#F1F5F9#E2E8F0#CBD5E1

On Surface

Apply on-surface colors to elements that appear on neutral surfaces, usually borders, secondary icons, and text elements.

#F8FAFC#F1F5F9#E2E8F0#CBD5E1#94A3B8#64748B#475569#334155#1E293B#0F172A

Interactive

Use interactive colors for things like links, focus indicators, and selected interactive states.

#EFF6FF#DBEAFE#BFDBFE#93C5FD#60A5FA#3B82F6#2563EB#1D4ED8#1E40AF#1E3A8A

Highlight

Highlight colors indicate important elements that don’t require immediate action. They’re used with informational banners and badges, indicators that draw attention to new information, loading or progress bars, and data visualization.

#EFF6FF#DBEAFE#BFDBFE#93C5FD#60A5FA#3B82F6#2563EB#1D4ED8#1E40AF#1E3A8A

Success

Success colors indicate something positive, like the success of a merchant action or to illustrate growth.

#ECF6F4#DAEDE9#AAD6CD#70BAAC#42A491#138D75#0F715E#0B5446#094338#1E3A8A

Warning

Warning colors let the merchant know they need to take action and are applied to badges, banners, and exception lists.

#FDF9EC#FCF3D8#F7E4A6#F2D16A#EEC239#EAB308#BB8F06#8B6B05#705604#544103

Critical

Critical colors are for destructive interactive elements, errors, and critical events that require immediate action.

#FBF0F0#F7E1E1#EDB9B9#E18A8A#D86565#CE3E3E#A53232#7B2525#631E1E#4A1616

Iconography

Placebo uses simple and informative icons that draw on the visual language of the Placebo design system.

Icons from Iconoir Icons from Iconoir

We source the majority of our UI icons from Luca Burgio's Iconoir Icon Library. This helps us move quickly and maintain visual consistency.

Iconoir | SVG Icons Library

Guidelines

Use SVGs instead of raster images for fast loading & better quality.

Iconography%20664a446b5df046daa0d1126330253e2d/Screenshot_2021-07-28_at_7.28.33_PM.png

Typography

Typography is a major part of Suraasa's brand. We've taken care to select a family of fonts that promote legibility and accessibility in both English & Arabic languages.

Font Stack

We utilize system fonts at Suraasa, which allow for optimized performance. This design decision takes advantage of retina screens, dynamic kerning, additional font-weights, and improved readability.

Inter, Noto Sans Arabic, sans-serif

Add this to your CSS to preload system fonts and set up browsers for legibility:

/* Load system fonts */
font-family: "Inter", "Noto Sans Arabic", Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

/* Make type rendering look crisper */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

/* Enable kerning and optional ligatures */
text-rendering: optimizeLegibility;

Fonts

Inter

Typography%204647c771946544ab9f2aea572004aea0/TypographyInter.png

Web Embed

Copy this code into the <head> of your HTML document:

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

Copy this code into the CSS document or <script> of your HTML document:

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
Licensing

Inter is available as an open source font through Google Fonts. It is licensed under the Open Font License.


Arabic (العربية) is a Middle Eastern abjad, written right-to-left (660 million users). 2nd- or 3rd-most used script in the world. Used for the Arabic language since the 4th century, and for many other languages, often in Islamic countries or communities in Asia, Africa and the Middle East, like Persian, Uyghur, Kurdish, Punjabi, Sindhi, Balti, Balochi, Pashto, Lurish, Urdu, Kashmiri, Rohingya, Somali, Mandinka, Kazakh (in China), Kurdish, or Azeri (in Iran). Was used for Turkish until 1928. Includes 28 basic consonant letters for the Arabic language, plus additional letters for other languages. Some letters represent a consonant or a long vowel, while short vowels are optionally written with diacritics. Variants include Kufi with a very simplified structure, the widely-used Naskh calligraphic variant, and the highly cursive Nastaliq used mainly for Urdu. Needs software support for complex text layout (shaping).

Noto Sans Arabic

Typography - Arabic.png

Web Embed

Copy this code into the <head> of your HTML document:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap" rel="stylesheet">

Copy this code into the CSS document or <script> of your HTML document:

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap');
Licensing

Noto Sans Arabic is available as an open source font through Google Fonts. It is licensed under the Open Font License.

Installation

Placebo UI is available as an yarn package. Followed by necessary necessary dependencies like

yarn add @suraasa/placebo-ui react-jss iconoir-react

This package depends on external libraries. If your project is using Typescript then you will need to install their types externally.

yarn add -D @types/react-modal

Usage

In order to get on with placebo the application must be wrapped with ThemeProvider which can be imported from react-jss. And import ThemeProvider from the package react-jss.

import { ThemeProvider } from "react-jss"

With this we need to pass theme object (which can be imported from Placebo UI) to ThemeProvider in order to set up a default theme in the application.

import { theme } from "@suraasa/placebo-ui"

CSSBaseline is used in order to reset css ie remove default html styling

import { CssBaseline } from "@suraasa/placebo-ui"

Now wrap ThemeProvider around application and pass theme object.

import React from "react"
import { ThemeProvider } from "react-jss"
import { CssBaseline, theme } from "@suraasa/placebo-ui"

function App() {
  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <HomePage />
    </ThemeProvider>
  )
}

export default App

This gives access to create own css classes based on theme for the application by importing createUseStyles

import React from "react"

import { createUseStyles } from "react-jss"

const useStyles = createUseStyles(theme => ({
  container: {
    margin: theme.spacing(1),
  },
}))
const HomePage = () => {
  const classes = useStyles()
  return (
    <div className={classes.container}>
      <h1>Hello World!</h1>
    </div>
  )
}

export default HomePage

By using createUseStyles we get access to the theme object passed through ThemeProvider.The theme provides us with spacing property that by default has the value of 8px and passing the value of 1 gives margin of 8px.

Scripts

yarn storybook

Starts the development server on http://localhost:6006

yarn create-component <name>

Creates a new component with the following files:

  • index.ts
  • Name.tsx
  • Name.stories.tsx
  • Name.test.tsx
yarn test

Run predefined test.

yarn lint:fix

Runs eslint --fix on the entire project. Fixes all autofixable issues. Also comes in handy to find issues after a change that affects other files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors