npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pk-rtu-mirea-ui-library

v1.0.32

Published

Library of UI components used for the site of the admissions office of RTU MIREA

Downloads

8

Readme

pk-rtu-mirea-ui-library

Library of UI components used for the site of the admissions office of RTU MIREA

NPM JavaScript Style Guide

This UI library was developed for using at sites of admission committee RTU MIREA. Here you can find different UI Components such as:

  • Loading screen
  • Button
  • Text field
  • Select dropdown
  • Tag element
  • Mobile Pop Up (beta)

Install

npm install --save pk-rtu-mirea-ui-library

Usage

After installation you can start create your amazing products. Here is the example:

import React from 'react'

import { Loading } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <Loading fullscreen />
  )
}

Let's look at each component separately

Loading screen

This is a simple screen that can be displayed while loading data

Props

| Option | Description | Value | Default value | |:----------|:----------|:----------|:----------| | fullscreen | This option allows you to position the loading screen in the center of the browser window. | Bool | false| | text | This option allows you to display the text on the loading screen | String | "Пожалуйста, подождите! Идет загрузка..." |

Example

import React from 'react'

import { Loading } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <Loading text={"Please wait..."} fullscreen />
  )
}

Tag

This is a simple tag

Props

| Option | Description| Value | Default value| |:----------|:-----------|:----------|:-------------| | fullWidth | Sets width of tag to 100% of parent | Bool | false | | wordWrap | Sets white-space to 'break-spaces' | Bool | false | | size | Sets the size of the tag | 'small', 'medium' or 'large' | 'medium' | | bgColor | Sets background color of tag | String (hex color) | #f9b233 | | textColor | Sets text color of tag | String (hex color) | #fff | | children | Content of tag | Children | - | | hint | Shows hint on hover | JSx element | - | | hintPosition | Set position of hint based on parent | 'top', 'left', 'right', 'bottom' | 'left; | | crossButton | Enables cross in tag | Bool | false | | handleCross | Function on cross clicking | Func | - | | crossColor | Sets color of cross | String | #ffffff |

Example

import React from 'react'

import { Tag } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <Tag 
      size={'small'}
      bgColor={"#000"}
      textColor={"#fff"}
      wordWrap
      fullWidth
    >
      <p>My Tag</p>
    </Tag>
  )
}

Button

This is button component

Props

| Option | Description| Value | Default value| |:----------|:-----------|:----------|:-------------| | fullWidth | Sets width of button to 100% of parent | Bool | false | | fullHeight | Sets height of button to 100% of parent | Bool | false | | size | Sets the size of the button | 'small', 'medium' or 'large' | 'medium' | | bgColor | Sets background color of tag | String (hex color) | #f9b233 | | textColor | Sets text color color of tag | String (hex color) | #fff | | disabled | Makes the button inactive | Bool | false | | onClick | Function at the push of a button | func | ()=>{}| | children | Content of button | Children | - |

Example

import React from 'react'

import { Button } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <Button 
      size='small'
      bgColor='#000'
      textColor='#fff'
      onClick={() => { handleClear(); this.handleClearLocal(); }}
      disabled
      fullWidth
      fullHeight
    >
      <p>My Button </p>
    </Button>
  )
}

TextField

Props

| Option | Description| Value | Default value| |:----------|:----------|:----------|:----------| | fullHeight | Sets height of button to 100% of parent | Bool | false | | size | Sets the size of the button | 'small' or 'medium' | 'medium'| | onChange | Function at the changing value | Func | ()=>{} | | placeholder | Text when value == "" | String | - | | value | Value of text field | String | - |

Example

import React from 'react'

import { TextField } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <TextField
      placeholder={"Поиск..."}
      size={"medium"}
      value={searchText}
      onChange={this.searchHandle}
      fullHeight
    />
  )
}

Select

Props

Bold is for required options

| Option | Description| Value | Default value| |:----------------|:-----------|:----------|:-------------| | list | List of displayed items | Array of objects | - | | valueKey | Key of value in list of items | String | - | | onChange | List item selection function | Func | - | | placeholder | Text of Select header when value is undefined | String | - | | displayValue | Text of Select header when value is not undefined | String | - | | selectValue | User-selected value | Object | - | | isMulti | Sets the ability to select multiple items | Bool | false | | size | Sets the size of the Select | 'small' or 'medium' | 'medium'| | textColor | Set color of text | string | #000 | | selectColor | Background of item on hover | String | #f9b233 | | searchable | Sets the ability to search in a dropdown list | Bool | false | | noWrapSelectHeader| Sets white-space of Select header to 'break-spaces' | Bool | false | | fullHeight | Sets height of button to 100% of parent | Bool | false | | disabled | Makes the button inactive | Bool | false | | disabledAlert | Text of alert if disabled == true | Bool | - | | listIcon | Sets the ability to display svg icon | Bool | false | | iconArray | Array of svg icons (listItem.id == List.id) | Array | - | | iconColor | Set color of svg icon | string | #f9b233 |

Example

import React, { useState } from 'react'

import { Select } from 'pk-rtu-mirea-ui-library'
import radio from "./img/radio.svg"
import it from './img/it.svg'
import chem from './img/chem.svg'
import law from './img/law.svg'

const List = [
  { id: 1, val: 'text 1' },
  { id: 2, val: 'text 2' },
  { id: 3, val: 'text 3' },
  { id: 4, val: 'text 4' }
]

const iconArray=[
  { id: 1, path: radio },
  { id: 2, path: it },
  { id: 3, path: chem },
  { id: 4, path: law }
]

const App = () => {
  const [object, setObject] = useState({})

  return (
    <Select
      placeholder={'Not selected...'}
      selectValue={object}
      displayValue={object.val}
      list={List}
      valueKey={"val"}
      onChange={setObject}
      fullHeight
      disabled
      disabledAlert={"ha-ha select is disabled"}
    />
  )
}

Mobile Pop Up (beta)

Props

| Option | Description| Value | Default value| |:----------|:----------|:----------|:----------| | buttonText| Text of button for open Pop Up | String | - | | header | Header of Pop Up | String | - | | children | Content of Pop Up | Children | - |

Example

import React from 'react'

import { MobilePopUp } from 'pk-rtu-mirea-ui-library'

const App = () => {
  return (
    <MobilePopUp buttonText={'Open'} header={'Header'}>
      <p>Hi 1</p>
    </MobilePopUp>
  )
}

License

MIT © slavaklevleev