GithubHelp home page GithubHelp logo

fuellabs / fuel-ui Goto Github PK

View Code? Open in Web Editor NEW
65.0 65.0 16.0 9.25 MB

Fuel design system

Home Page: https://design.fuel.network

License: Apache License 2.0

JavaScript 17.06% TypeScript 82.80% Shell 0.07% HTML 0.06%

fuel-ui's People

Contributors

aksa12 avatar eswarasai avatar github-actions[bot] avatar josevitordaltoe avatar kavi-d avatar lfscamargo avatar luizasfight avatar luizstacio avatar matt-user avatar pedronauck avatar pixelsbyeryc avatar rfuelsh avatar tomiiide 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

Watchers

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

fuel-ui's Issues

Feat: fund and display user wallets

Motivation

The user needs to have tokens in order to interact with the escrow contract.

Usage example

No response

Possible implementations

No response

Add Accordion component

<Accordion type="single" defaultValue="item-1" collapsible>
  <Accordion.Item value="item-1">
    <Accordion.Trigger>Hello world</Accordion.Trigger>
    <Accordion.Content>
      Yes. It's unstyled by default, giving you
      <br /> freedom over the look and feel.
    </Accordion.Content>
  </Accordion.Item>
  <Accordion.Item value="item-2">
    <Accordion.Trigger>Is it unstyled?</Accordion.Trigger>
    <Accordion.Content>
      Yes. It&apos;s unstyled by default, giving you
      <br /> freedom over the look and feel.
    </Accordion.Content>
  </Accordion.Item>
</Accordion>

Add Alert component

Tasks

  • Alert component
  • Alert.Title component
  • Alert.Description component
  • Alert.Actions component
  • Alert.Button component
  • Tests scenarios

Usage

import { Alert } from '@fuel-js/react';

/**
 * Basic example
 */
export default () => (
  <Alert status='error'>
    <Alert.Title>Your browser is outdated!</AlertTitle>
    <Alert.Description>Your experience may be degraded.</AlertDescription>
    <Alert.Actions>
      <Alert.Button>Dismiss</Alert.Button>
    </Alert.Actions>
  </Alert>
);

Custom props

  • status: 'error' | 'success' | 'warning' | 'info'
  • `variant: 'subtle' | 'solid' | 'left-accent' | 'top-accent'

References

Screen Shot 2022-05-02 at 12 31 09

Tests Scenarios

  • a11y

Add Card component

  • Card component
  • Card.Header component
  • Card.Body component
  • Card.Footer component

Usage

import { Card, ButtonLink } from '@fuel-js/react';

export default () => (
  <Card>
    <Card.Header>Some Title</Card.Header>
    <Card.Body>Image a long and beautiful text here!</Card.Body>
    <Card.Footer>
      <ButtonLink variant="link">More info</ButtonLink>
    </Card.Footer>
  </Alert>
);

Custom props

  • boxShadow: BoxShadowSizes
  • direction: 'row' | 'column'

Add List component

  • Render an unordered or ordered list, with default chars or icons

Use case

<>
  <List type="ordered">
    <List.Item>Value #1</List.Item>
    <List.Item>Value #2</List.Item>
  </List>
  <List icon="CheckIcon">
    <List.Item>Value #1</List.Item>
    <List.Item>Value #2</List.Item>
  </List>
</>

Properties

  • type: 'ordered' | 'unordered'
  • icon: Icons

Add Transitions component

  • This component will add some pre-built transitions using framer-motion

Namespace components

<Transitions.Rotate180 />
<Transitions.Rotate360 />
<Transitions.SlideLeft />
<Transitions.SlideRight />
<Transitions.SlideTop />
<Transitions.SlideDown />
<Transitions.Fade />

Properties

  • on: boolaen (trigger transition)

Add Form component

  • Form.Control component
  • Form.Label component
  • Form.ErrorMessage component
  • Form.HelperText component
  • Test scenarios

Description

  • Form.Control: The wrapper that provides context and functionality for all children.
  • Form.Label: The label of a form section. The usage is similar to html label.
  • Form.HelperText: The message that tells users more details about the form section.
  • Form.ErrorMessage: The message that shows up when an error occurs.

Usage

import { Form, Input } from '@fuel-js/react';

/**
 * Basic example
 */
export default () => (
  <Form.Control>
    <Form.Label htmlFor='email'>Email address</Form.Label>
    <Input id='email' type='email' />
    <Form.HelperText>We'll never share your email.</Form.HelperText>
  </Form.Control>
);

/**
 * Using error message
 */
export default () => (
  <Form.Control>
    <Form.Label htmlFor='email'>Email address</Form.Label>
    <Input id='email' type='email' />
    <Form.ErrorMessage>Email is required.</Form.ErrorMessage>
  </Form.Control>
);

References

Screen Shot 2022-05-02 at 12 39 34

Scenarios

  • A11y
  • Should input have aria-describedby by label first
  • Should input have aria-describedby by helper message if present
  • Should input have aria-describedby by error message if invalid
  • Should input have props derived from form control state
  • Should helper text be hidden if invalid
  • Should error message be hidden if not invalid

Feat: basic project setup

Motivation

Basic project setup for the escrow frontend application. Contains a basic wallet prompt if user has not created a wallet and a blank landing page.

Usage example

No response

Possible implementations

No response

Error: https://registry.yarnpkg.com/@fuel%2fcss: Not found

Trying to install dependencies under ./packages/react not working.

Is it the node version?


Arguments:
/Users/<User>/.nvm/versions/node/v17.9.0/bin/node /opt/homebrew/Cellar/yarn/1.22.18/libexec/bin/yarn.js

PATH:

/opt/homebrew/sbin:/Users/<User>/.nvm/versions/node/v17.9.0/bin:/Users/<User>/.phpenv/shims:/Users/<User>/.phpenv/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/<User>/.composer/vendor/bin:/Users/<User>/.fig/bin:/Users/<User>/.local/bin

Yarn version:

1.22.18

Node version:

17.9.0

Platform:

darwin x64

Trace:

Error: https://registry.yarnpkg.com/@fuel%2fcss: Not found
      at Request.params.callback [as _callback] (/opt/homebrew/Cellar/yarn/1.22.18/libexec/lib/cli.js:66138:18)
      at Request.self.callback (/opt/homebrew/Cellar/yarn/1.22.18/libexec/lib/cli.js:140883:22)
      at Request.emit (node:events:527:28)
      at Request.<anonymous> (/opt/homebrew/Cellar/yarn/1.22.18/libexec/lib/cli.js:141855:10)
      at Request.emit (node:events:527:28)
      at IncomingMessage.<anonymous> (/opt/homebrew/Cellar/yarn/1.22.18/libexec/lib/cli.js:141777:12)
      at Object.onceWrapper (node:events:641:28)
      at IncomingMessage.emit (node:events:539:35)
      at endReadableNT (node:internal/streams/readable:1345:12)
      at processTicksAndRejections (node:internal/process/task_queues:83:21)

Add Copyable component

  • This component will add a tooltip with the message Press to copy to clipboard and a copy icon on left

Use case

<Copyable>My text</Copyable>

Add TextArea component

Tasks

  • TextArea component
  • Tests Scenarios

Description

The Textarea component allows you to easily create multi-line text inputs.

Usage

import { TextArea } from '@fuel-js/react';

/**
 * Basic example
 */
export default () => (
  <TextArea placeholder='Here is a sample placeholder' />
);

Props

<TextArea />

  • value: string
  • defaultValue: string
  • onChange: (value: string) => void
  • isInvalid: boolean
  • isRequired: boolean
  • isDisabled: boolean
  • isLoading: boolean
  • isReadOnly: boolean

References

Screen Shot 2022-05-02 at 12 37 51

Tests Scenarios

  • Should render a basic <textarea /> component
  • Should call onChange on value change
  • Should derive values from surrounding Form.Control

Feat: allow the user to create multiple wallets

Motivation

The user probably needs to be able to create 2 wallets as two addresses interact with the escrow contract. We may just want to create 2 wallets instead of 1 like we do now. This will also allow us to make sure everything is functioning correctly by checking each wallets token balance etc.

Usage example

No response

Possible implementations

No response

Add Avatar component

  • Avatar component
  • Avatar.Image component
  • Avatar.Fallback component
  • Tests scenarios

Usage

import { Avatar } from '@fuel-js/react';

export default () => (
  <Avatar.Root>
    <Avatar.Image src="https://path.to/your-image" alt="Michael Jordan" />
    <Avatar.Fallback delayMs={600}>MJ</Avatar.Fallback>
  </Avatar.Root>
);

References

Tests Scenarios

  • should render the fallback initially with first with letters of name
  • should fallback text has just one letter if name is one word
  • should not render the image initially
  • should render the image after it has loaded
  • should have alt text on the image

Add Input.Number component

Tasks

  • Input.Number component

Properties

  • value: Maybe<string | number>
  • onChange: (value: Maybe<string | number>) => void
  • decimals: number
  • isReadOnly: boolean
  • isDisabled: boolean

Add Description component

Reference here

Use case

<Description>
  <Description.Item>Label:</Description.Item>
  <Description.Value>Value</Description.Value>
</Description>

Properties

  • flow: 'row' | 'col'
  • itemStyle: CSSStyle
  • valueStyle: CSSStyle

Add Input component

Components

  • Input component
  • Input.Field component
  • Input.AddonLeft component
  • Input.AddonRight component
  • Input.ElementLeft component
  • Input.ElementRight component

Usage

import { Input, Icon } from '@fuel-js/react';

/**
 * Basic example
 */
export default () => (
  <Input>
    <Input.Field type="email" name="email" placeholder="email" />
  </Input>
);

/**
 * Using elements
 */
export default () => (
  <Input>
    <Input.ElementLeft element={<Icon.BiEnvelope />} />
    <Input.Field type="email" name="email" placeholder="email" />
  </Input>
);

/**
 * Using addons
 */
export default () => (
  <Input>
    <Input.AddonLeft>+234</Input.AddonLeft>
    <Input.Field type='tel' placeholder='phone number' />
  </Input>
);

Props

Input

  • size: 'sm' | 'md' | 'lg'
  • isInvalid: boolean
  • isRequired: boolean
  • isDisabled: boolean
  • isReadOnly: boolean
  • isFullWidth: boolean

References

Tests Scenarios

  • a11y tests
  • Should render a basic <input /> element
  • Should render elements inside input correctly
  • Should render input with addons
  • Should render input with elements
  • Should disabled input renders correctly
  • Should readonly input renders correctly
  • Should invalid input renders correctly

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.