2.2.4 • Published 1 year ago

devyx-ui v2.2.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

Devyx UI 🧱

Our personal React components for web applications.

Installation

You can install with:

yarn add devyx-ui

or

npm install devyx-ui

Usage/Example

import { Button } from 'devyx-ui';

function App() {
  return <Button onClick={() => console.log('Something')}>Click me</Button>
}

Components

Inputs

Normal, currency, mask, date, file, select, searchable select, checkbox and switch inputs

  • Normal, currency, mask (Input)

    Props

    PropertyTypeDefaultDescription
    name?stringtestInput name
    label?string-Label for input
    formAttributes?Formik instance-Instance of Formik form
    extraStyles?CSSProperties-Extra styles for input
    inpuType?stringnormal'normal', 'currency', 'mask'
    maximumFractionDigits?number2Configuration for currency input
    mask?string-mask for inpuType = 'mask'
    hint?string-Help text for input
    ...props{ ...props }-Any props for input
  • DateInput

    Props

    PropertyTypeDefaultDescription
    name?stringtestInput name
    label?string-Label for input
    formAttributes?Formik instance-Instance of Formik form
    extraStyles?CSSProperties-Extra styles for input
    hintstring-Help text for input
    ...props{ ...props }-Any props for input
  • FileInput

    Props

    PropertyTypeDefaultDescription
    handleChange?function-Receives the event from input
    acceptedExtensions?string-Accepted files extensions
    backgroundColor?string#3699ffBackground color of input
    textColor?string#fffColor of icon & text
    label?string-Label of input
    text?stringSelecione um arquivoText of input
    extraStyles?CSSProperties-Additional CSS for input
    extraContainerStyles?CSSProperties-Additional CSS for container input
    hintstring-Help text for input
    ...props{ ...props }-Any props for input
  • Select

    Props

    PropertyTypeDefaultDescription
    name?stringtestSelect name
    label?string-Label for select
    value?string-Current value of select
    formAttributes?Formik instance-Instance of Formik form
    extraStyles?CSSProperties-Extra styles for select
    hintstring-Help text for input
    ...props{ ...props }-Any props for input and SelectProps (https://react-select.com/props#select-props)
  • SearchableSelect

    Props

    PropertyTypeDefaultDescription
    name?stringtestSelect name
    label?string-Label for select
    value?string-Current value of select
    formAttributes?Formik instance-Instance of Formik form
    onSearchNewOption?Function-(inputValue: string) => void
    extraStyles?CSSProperties-Extra styles for select
    hintstring-Help text for input
    ...props{ ...props }-Any props for input and CreatableProps (https://react-select.com/props#creatable-props)
  • Checkbox

    Props

    PropertyTypeDefaultDescription
    name?stringtestCheckbox name
    onChange?function-Checkbox onChange function
    label?string-Label for checkbox
    checkedboolean-State of checkbox
    extraStyles?CSSProperties-Extra styles for checkbox
    ...props{ ...props }-Any props for checkbox
  • Switch

    Props

    PropertyTypeDefaultDescription
    name?stringtestSwitch name
    onChange?function-Switch onChange function
    label?string-Label for switch
    labelOrientation?stringrightat left or at right of switch
    checkedboolean-State of switch
    extraStyles?CSSProperties-Extra styles for switch
    ...props{ ...props }-Any props for switch

Button

Props

PropertyTypeDefaultDescription
onClick?function-Event click of button
color?stringblue'blue', 'blue-outlined', 'red', 'red-outlined', 'black', 'black-outlined'
extraStyles?CSSProperties-Additional CSS for input
...props{ ...props }-Any props for input

Card

Props

PropertyTypeDefaultDescription
variant?stringfloating'floating', 'flat', 'dropdown'
extraStyles?CSSProperties-Additional CSS for input

Modal

Modal base props

PropertyTypeDefaultDescription
setIsOpenfunction-Function to set the modal state
isOpenboolean-Current state of modal
width?string700pxModal width

Modal header props

PropertyTypeDefaultDescription
setIsOpenfunction-Function to set the modal state
title?string-Modal title

Modal footer props

PropertyTypeDefaultDescription
handleCancel?function-Function to close the modal
handleDelete?function-Function to delete data
handleConfirm?function-Function to save data
confirmButtonContent?ReactNode-Content of confirm button
align?stringright'right', 'left', 'center', 'space-between', 'space-around'
extraStyles?CSSProperties-Additional CSS for input

Dropdown

Props

PropertyTypeDefaultDescription
toggleReact Node-Something to render inside a toggle button
right?string-Distance of the right
dropType?stringgeneric'menu', 'generic'
extraDropdownStyles?CSSProperties-Additional CSS for dropdown
extraToggleStyles?CSSProperties-Additional CSS for toggle

Table

Table Props

PropertyTypeDefaultDescription
columnsany[]-Array of React Table columns
dataany[]-Array of data from backend
loading?booleanfalseContent loading
loadingComponent?ReactNodenullReact component to render while loading
noDataComponent?ReactNodenullReact component to render when non exists data
showGenericFilter?booleanfalseRenders an input that will filter all table columns
hiddenColumns?string[]'id'Columns that will not be rendered

Table Pagination Props

PropertyTypeDefaultDescription
pagenumber-Current page
setPagefunction-Set current page
limitnumber-Size of registers per page
setLimitfunction-Set the size of registers per page
totalItemsnumber-Total registers
rowsPerPageOptionsnumber[]5, 10, 25, 50Options of size per page
maxPageItemsnumber-Max of options to change current page
hideFirstAndLastButtons?booleanfalseHide pagination buttons
hidePreviousAndNextButtons?booleanfalseHide pagination buttons
loading?booleanfalseContent loading
loadingComponent?ReactNodenullReact component to render while loading

Filter Buttons

Props

PropertyTypeDefaultDescription
handleClearFilterfunction-Clear filter button
handleFilterstring-Filter button
disabled?boolean-Disable filter button

ActionsColumns

Props

PropertyTypeDefaultDescription
hideEdit?booleanfalseHidden edit button
hideDelete?booleanfalseHidden delete button
extraActions?IExtraActions[]-Extra buttons to actions column
onClickEditfunction-Function to edit button
onClickDeletefunction-Function to delete button

BasePage

Props

PropertyTypeDefaultDescription
titleHeaderstring-Title of page
buttonHeaderContent?ReactNode-Button content in the header
setOpenAddCrudModal?function-Function for button in the header

CrudFeedback

Props

PropertyTypeDefaultDescription
loadingboolean-Loading state of crud
status'success', 'error', ''-Status of crud
messagestring-Message of crud

ColumnFormatters

Generic formatters for columns in tables

  • Status

    Props

    PropertyTypeDefaultDescription
    valueboolean-Value of status
    type?stringtable'table', 'notification'
    tableText?{ true: string, false: string }{ true: Ativo, false: Inativo }Text of status column
  • Document

    Props

    PropertyTypeDefaultDescription
    valuestring-Value of document
  • Phone

    Props

    PropertyTypeDefaultDescription
    valuestring-Value of phone number
  • Currency

    Props

    PropertyTypeDefaultDescription
    valuenumber-Value of status
    maximumFractionDigits?number2Número de casas após a vírgula

Header

Header props

PropertyTypeDefaultDescription
menuType?stringtop'top', 'aside'
pathnamestring-Current route path
logoComponentReact Node-Component for logo
menuIMenu[]-Array of items for menu
actionsIAction[]-Array of action items for menu
actionsMobileIActionsMobile[]-Array of action items for mobile
profileIProfile-Dropdown profile
canvasMenuIMenuCanvas-Component to render canvas menu (aside menu)

Canvas props (IMenuCanvas)

PropertyTypeDefaultDescription
pathnamestring-Current route path
menuLink?IMenuLink[]-Array of link items for menu
menuExpansible?IMenu[]-Array of expansible items for menu
configs?IAction[]-Array of configs for menu

Interfaces

interface IMenu {
  type: 'link' | 'dropdown';          // Menu orientation
  urlToShowActive: string;            // URL to highlight current menu item
  menuItem: ReactNode;                // Component to render as a menu item
}

interface IAction {
  id: string;
  actionItem: ReactNode;              // Component to render as an action item
}

interface IActionsMobile {
  id: string;
  actionItem: ReactNode;              // Component to render as an action mobile
}

interface IProfile {
  id: string;
  profileItem: ReactNode;             // Component to render as a dropdown profile
}

interface IMenuLink {
  urlToShowActive: string;            // URL to highlight current menu item
  menuItem: ReactNode;                // Component to render as a menu link
}

interface IMenuExpansible {
  id: string;
  urlToShowActive: string;            // URL to highlight current menu item
  title: string;                      // Menu title
  icon?: ReactNode;                   // Menu icon
  expansiveItens: IExpansibleItem[];
}

interface IExpansibleItem {
  id: string;
  menuItem: ReactNode;                // Component to render as a menu expansible
  urlToShowActive: string;            // URL to highlight current menu item
}

interface IConfig {
  id: string;
  configItem: ReactNode;              // Component to render as a config item
  urlToShowActive: string;            // URL to highlight current menu item
}

interface IExtraActions {
  onClickAction?: () => void;         // Function for button 
  icon: React.ReactNode;              // Icon for button
  backgroundColor?: string;           // Background button color
  tooltip: string;                    // Help text for button
}
2.2.4

1 year ago

2.2.1

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.1.9

2 years ago

1.9.9

2 years ago

1.9.8

2 years ago

1.9.7

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

2.1.6

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

1.8.9

2 years ago

1.8.8

2 years ago

1.8.7

2 years ago

1.8.2

2 years ago

1.8.6

2 years ago

1.8.5

2 years ago

1.8.4

2 years ago

1.8.3

2 years ago

1.7.3

3 years ago

1.8.1

3 years ago

1.7.2

3 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.7.0

3 years ago

1.5.2

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago