1.1.16 • Published 9 months ago

@wethecurious/wtc-ui-library v1.1.16

Weekly downloads
1
License
MIT
Repository
-
Last release
9 months ago

wtc-ui-library

A UI library to be used on WTC sites and exhibits

NPM JavaScript Style Guide

Docs

Docs site coming soon...

Install

npm install --save @wethecurious/wtc-ui-library

Usage

This library depends on an external theme. Served either from the assets server or as a theme object. This must be passed to the WTCProvider component

// index.js
/**
 * This example assume the use of styled components. Notice the WTCProvider, wrapping
 * the ThemeProvider for this app the ui library is being used in.
 */
import { WTCProvider } from '@wethecurious/wtc-ui-library'
import { asyncTheme } from './hoc/asyncTheme'

const Container = props => (
  <WTCProvider theme={props.theme}>
    <ThemeProvider theme={props.theme}>
      <App />
    </ThemeProvider>
  </WTCProvider>
)
const ThemedContainer = asyncTheme(Container, 'http://localhost:4000/themes')
ReactDOM.render(<ThemedContainer />, document.getElementById('root'))

// Component
import * as React from 'react'

import { MyComponent } from 'wtc-ui-library'

class Example extends React.Component {
  render() {
    return <MyComponent />
  }
}

Available components

  • AutoCompleteDropDown
  • TextInput
  • DebouncedTextInput
  • Box
  • Button
  • Heading
  • Icon
  • WTCProvider
  • Text
  • Table
  • MarkdownViewer
  • Card
  • Header
  • Modal
  • InputText
  • InputPassword
  • InputNumber
  • Hero
  • VideoPlayer
  • Calendar
  • SignedImage
  • SignedVideo
  • SignedAudio
  • RadioGroup
  • Radio
  • Sidebar
  • Dropdown
  • Slider

Available Definitions

Definition Usage

import { Size } from '@wethecurious/wtc-ui-library'

export enum Size {
  XXS = 'xxs',
  XS = 'xs',
  S = 's',
  MS = 'ms',
  M = 'm',
  ML = 'ml',
  L = 'l',
  XL = 'xl',
  XXL = 'xxl'
}

export enum Scale {
  XXS = 'xxs',
  XS = 'xs',
  S = 's',
  MS = 'ms',
  M = 'm',
  ML = 'ml',
  L = 'l',
  XL = 'xl',
  XXL = 'xxl',
  Zero = 'zero'
}

export interface Scale2D {
  x?: Scale
  y?: Scale
}

export interface Scale3D extends Scale2D {
  z?: Scale
}

export interface ScreenPosition {
  Left: 'left'
  Right: 'right'
  Top: 'top'
  Bottom: 'bottom'
}

export enum Status {
  Ok = 'ok',
  Warning = 'warning',
  Critical = 'critical',
  Error = 'error',
  Unknown = 'unknown',
  Disabled = 'disabled',
  Neutral = 'neutral'
}

export enum Weight {
  Light = 'light',
  Regular = 'regular',
  Bold = 'bold',
  Heavy = 'heavy',
}

export enum BackgroundColour {
  Light = 'light',
  Dark = 'dark',
  Highlight = 'highlight',
  HighlightSecondary = 'highlight-secondary'
}

export enum Corner {
  TopLeft = 'top-left',
  TopRight = 'top-right',
  BottomRight = 'bottom-right',
  BottomLeft = 'bottom-left'
}

Icon Definitions

export enum IconType {
  AddOutline = 'addOutline',
  Add = 'add',
  Collapse = 'collapse',
  Delete = 'delete',
  DeleteOutline = 'deleteOutline',
  Expand = 'expand',
  Remove = 'remove',
  RemoveOutline = 'removeOutline',
  Share = 'share',
  Close = 'close',
  Down = 'down',
  GroupOutline = 'groupOutline',
  Group = 'group',
  Left = 'left',
  LevelBack = 'levelBack',
  LevelUp = 'levelUp',
  List = 'list',
  Menu = 'menu',
  Next = 'next',
  Previous = 'previous',
  Right = 'right',
  Search = 'search',
  Critical = 'critical',
  CriticalOutline = 'criticalOutline',
  ErrorOutline = 'errorOutline',
  Disabled = 'disabled',
  Ok = 'ok',
  OkOutline = 'okOutline',
  Unknown = 'unknown',
  UnknownOutline = 'unknownOutline',
  Warning = 'warning',
  WarningOutline = 'warningOutline'
}
1.1.16

9 months ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 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.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

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago