Giter Club home page Giter Club logo

ui's Introduction

aragonUI

Overview

aragonUI is a React library used to build user interfaces for Aragon and its related projects. It provides the components needed to build experiences that feel integrated with Aragon ecosystem, and can be used both client or server side.

The complete documentation can be found on the aragonUI website.

Getting Started

If you are unfamiliar with aragonUI, we recommend you to start with the getting started page. If you only want to know how to add aragonUI to your project, have a look at the quick setup:

Quick setup

Install aragonUI alongside styled-components from npm:

npm install --save @aragon/ui styled-components

Copy its assets into your public directory:

npx copy-aragon-ui-assets ./public

Wrap your app with the Main component:

import React from 'react'
import { Main } from '@aragon/ui'

function App() {
  return (
    <Main>
      <h1>Hello aragonUI!</h1>
    </Main>
  )
}

Your project is now ready to use aragonUI. πŸ’«

Open https://ui.aragon.org/ to see the list of the available components and learn how to use them.

Assets

aragonUI require some assets (e.g. fonts) in order to work properly. These need to be copied where they can be accessed by the library, like the public/ directory of a project using Create React App.

Copy these assets using the provided copy-aragon-ui-assets command:

npx copy-aragon-ui-assets ./public

By default, it will create a directory named aragon-ui in the specified directory.

This emplacement is communicated to the library through the <Main> component. The default path is ./aragon-ui/, but you can change it using the assetsUrl prop:

import { Main } from '@aragon/ui'

const App = () => (
  <Main assetsUrl="http://example.com/aragon-ui-assets/">
    <h1>Hello aragonUI!</h1>
  </Main>
)

You may also want to add it as a build step in your project, so that aragonUI can be upgraded without having to worry about this.

"scripts": {
  "sync-assets": "copy-aragon-ui-assets ./public",
  "build": "npm run sync-assets && react-scripts build",
  "start": "npm run sync-assets && react-scripts start"
}

See copy-aragon-ui-assets -h for more information.

Build and Develop

Please have a look at CONTRIBUTING.md.

Projects using aragonUI

License

MIT, see LICENSE.

ui's People

Contributors

0xvolodya avatar 2color avatar adekbadek avatar andy-hook avatar aquigorka avatar bpierre avatar chadoh avatar corydickson avatar deamme avatar delfipolito avatar dependabot[bot] avatar evalir avatar fiberjw avatar gasolin avatar githubdoramon avatar izqui avatar joserfelix avatar josx avatar jyash97 avatar kdichev avatar lmcorbalan avatar luisivan avatar mathewmeconry avatar monokh avatar petermphillips avatar rperez89 avatar sohkai avatar stvtortora avatar victaphu avatar yuetloo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui's Issues

Make `styled-components` a peerDependency?

A consumer of this package could want to use their own instance (or version) of styled-components. It'd be nice if they could install and provide their own instance of styled-components.

Add BadgeText

image

Circular border-radius:

image

Different bg:

image

Header:

image

Location: src/Badge/BadgeText.js

Could probably be integrated with the current BadgeNumber?

Rename icons

Opening an issue after having discussed this with @izqui.

Our icon set is composed of actions (notifications, wallet, …) and app icons (tokens, fundraising, …). Some icons used for apps are also used to represent actions. At the moment, their name is describing the app they represent.

This is the Identity app icon, which is named IconIdentity:

You can see it being used in the Aragon menu:

image

And this same icon is also used as a β€œTransfer token” action in the Tokens app:

image

  • Icons names should describe what they represent in the most generic way, rather than the app they happen to represent (in the example above, it could be β€œuser-add”).
  • If an app is using an icon from the Aragon UI icon set, this app is free to duplicate it.

Add Form

See most app side panels.

Location: src/Form/Form.js

Animation principles and parameters

We need to define the kind of animations we want to apply to different cases, and expose their parameters in Aragon UI.

We could split them in two groups:

  • Normal transitions: exposed as a set of predefined spring animations [1] (using react-motion).
  • Super fast transitions (< 150ms): when immediate feedback is needed for an interaction. Could be on hover, press, etc. These can be easing based (the spring() CSS timing function is still at the proposal stage) and will mostly consist of guidelines about when and how to use them. We could also decide to not use any transition at all in these cases, depending on the kind of feeling we want to express.

[1] If you are not familiar with spring based animations, I recommend reading β€œCreating Animations and Interactions with Physical Models” and/or watching this talk by Cheng Lou (author of React Motion) to understand why they are awesome ✨

Use `create-index`

Add https://github.com/gajus/create-index and autogenerate index.js files for each component folder.


@bpierre and I were also discussing what we should do when we need to use "internal" components in more than one place. One idea would be to allow named exports (i.e. export { ... }) from a component so that internal components could access them, but then to not export them to consumers by only re-exporting the default export from each component.

An example, for better clarity:

// in component.js
const InternalComponent = {}
const Component = {} // requires InternalComponent

export { InternalComponent } // this export would be accessible to components inside the library, in case they wanted to restyle it slightly or reuse it
export default Component // this export would be the only component available to outside consumers of the library
// in index.js
export { default as Component } from "component.js"

Enhancements to label style

I recommend:

  • Removing the ":" from all field labels (this colon is not really necessary - there seems to be inconsistency of where a ':' is used - for example, look at the New Vote panel)
  • Moving the asterisk for required fields closer to the label (easier for readability)

Example of before & after

image

Fix Flow errors

There seems to be a ton of flow errors right now. Not sure how difficult they are to fix (maybe just updating some typings for most of them?), but it'd be nice to investigate.

Create a better structure for utils

shared-utils and math-utils should live under a utils/ directory.

It would also be nice to move some of the related code in shared-utils to their own file, e.g. a utils/styled/breakpoints.js.

Field: add inline mode

image

Modify existing Field to support inlining multiple Fields together with their labels.

The default Field should also be inline-block, to allow for multiple non-inlined Fields to live beside each other.

Component states

We need to design / implement focus, disabled and pressed states for these components:

Question: do we want hover effects?

Hookify all the things

E.g. SidePanel could pass down opened via a render prop, most HOCs should have a render prop equivalent exposed.

Add organization switcher component

It should be possible to switch between multiple organizations in the Electron client, much like on Slack. The switcher should approximately look the same too, where the badge on the organization icon is the number of unread notifications in that organization.

Related to aragon/client#47.

Imgur

Add strong DropDown

image

Could probably be done by adding a new prop to DropDown and applying some more styling.

Add Select

image

Wide:

image

Expanded (with search capability):

image

Location: src/Form/Select.js
Example: react-select

The normal and wide options may be serviceable via the DropDown component, but we'd have to figure out if it'll work with the form.

Autocomplete component

It would be nice to have an autocomplete feature for e.g. address fields, displaying different entities and apps in and outside your organisation.

I imagine something like this (excuse the non-jpg):

╔══════════════════════════════════╗
β•‘ 0xdeadbeef                       β•‘ <- What you type
β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•‘
β”‚ 0xdeadbeef                       β”‚ <- Autocomplete of what you type
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ APPS                             β”‚ <- Label
β”‚ Permissions (0xddadbeef)         β”‚ <- Apps in DAO
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ENTITIES                         β”‚ <- Label
β”‚ satoshi.aragonid.eth (0xdddbeef) β”‚ <- Interesting entities in DAO
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Add AccordionInfo

image

Location: src/Accordion/AccordionInfo.js

Maybe allow the hiding ability via a prop, so other information panels can also reuse the same component, e.g.:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.