0.0.1-alpha.4 • Published 4 years ago

asdasdasddsadsadas v0.0.1-alpha.4

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Noveo Web Components

Web Components was designed by Noveo UI Kit and builded on Stencil

Documentation was written on Storybook: http://components.noveogroup.com

If you want to run storybook locally then you can use serve

cd storybook-static
serve

How to use

If you want to use this components on React application then you should use special components for React: http://example.com

Because React support web-components only for 71%: https://custom-elements-everywhere.com/libraries/react/results/results.html

Installation

By npm:

npm install @noveo/web-components --save

Or by yarn:

yarn add @noveo/web-components

Usage

import { defineCustomElements } from '@noveo/web-components/loader';

defineCustomElements(window);

If you want to support Edge and IE11:

import { applyPolyfills, defineCustomElements } from '@noveo/web-components/loader';

applyPolyfills.then(() => defineCustomElements(window));

After defineCustomElements call all components will be available like HTML5 elements:

<nv-table>
  <nv-table-head>
    <nv-table-cell>Name</nv-table-cell>
    <nv-table-cell>Job Title</nv-table-cell>
    <nv-table-cell>Salary</nv-table-cell>
  </nv-table-head>
  <nv-table-body>
    <nv-table-row>
      <nv-table-cell>Rhianna</nv-table-cell>
      <nv-table-cell>International Program Officer</nv-table-cell>
      <nv-table-cell>$972</nv-table-cell>
    </nv-table-row>
    <nv-table-row>
      <nv-table-cell>Archibald</nv-table-cell>
      <nv-table-cell>Central Tactics Planner</nv-table-cell>
      <nv-table-cell>$852</nv-table-cell>
    </nv-table-row>
    <nv-table-row>
      <nv-table-cell>Deondre</nv-table-cell>
      <nv-table-cell>Forward Interactions Planner</nv-table-cell>
      <nv-table-cell>$274</nv-table-cell>
    </nv-table-row>
  </nv-table-body>
</nv-table>

Components

nv-alert

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorAlertMods.DANGER \| AlertMods.PRIMARY \| AlertMods.SUCCESS \| AlertMods.WARNAlertMods.PRIMARY
dismiss--(event: MouseEvent) => voidundefined
isOpenis-openbooleantrue
timeouttimeoutnumberundefined

nv-button

Properties

PropertyAttributeDescriptionTypeDefault
bigbigmakes the button taller and longerbooleanfalse
colorcolorcolor option (danger, success, primary, secondary)ButtonColors.danger \| ButtonColors.primary \| ButtonColors.secondary \| ButtonColors.successButtonColors.primary
disableddisableddisables the button and changes stylesbooleanfalse
outlineoutlinechanges stylesbooleanfalse
sizesizesize option (xs, sm, md, lg, xl, xxl, responsive-container, responsive-text)ButtonSizes.lg \| ButtonSizes.md \| ButtonSizes.responsiveContainer \| ButtonSizes.responsiveText \| ButtonSizes.sm \| ButtonSizes.xl \| ButtonSizes.xs \| ButtonSizes.xxlButtonSizes.responsiveText

nv-checkbox

Properties

PropertyAttributeDescriptionTypeDefault
checkedcheckedactivity flagbooleanfalse
descriptiondescriptiontext between label and checkboxstring''
disableddisableddisables the checkbox and changes stylesbooleanfalse
dropVariantdrop-variantchanges the styles of the active statebooleanfalse
errorerrorred text under the checkbox, makes the label redstring''
labellabellarge text over checkboxstring''
namenamename prop for inputstring''
valuevaluecheckbox textstring''

Events

EventDescriptionType
changeonChange event returns isCheckedCustomEvent<boolean>

Dependencies

Used by

Depends on

Graph

graph TD;
  nv-checkbox --> nv-label
  nv-select --> nv-checkbox
  style nv-checkbox fill:#f9f,stroke:#333,stroke-width:4px

nv-dropdown-container

Dependencies

Used by

Graph

graph TD;
  nv-select --> nv-dropdown-container
  style nv-dropdown-container fill:#f9f,stroke:#333,stroke-width:4px

nv-icon

Properties

PropertyAttributeDescriptionTypeDefault
namenameThe icon to use from the built-in set of icons. Only alpha characters and dash are allowed.stringundefined
publicPathpublic-pathThe custom path to assets dir on a server. Should be used with name attribute to make up a full path like this: /${publicPath}assets/icons/${iconName}.svgstring''
sizesizeThe size of the icon. Available options are: sm, md, and lg.IconSizes.LG \| IconSizes.MD \| IconSizes.SMIconSizes.SM
srcsrcThe exact path to an SVG file on a server. If used, it overrides the path formed by name and public-path attributes.stringundefined

Dependencies

Used by

Graph

graph TD;
  nv-select --> nv-icon
  style nv-icon fill:#f9f,stroke:#333,stroke-width:4px

nv-input

Properties

PropertyAttributeDescriptionTypeDefault
autocompleteautocompleteIf input should provide autocompletestring'on'
autofocusautofocusIf input should autofocus on mountbooleanfalse
disableddisabledIf input is disabled or notbooleanfalse
invalidinvalidIf input is invalid or notbooleanfalse
namenameName attribute for the inputstring''
placeholderplaceholderPlaceholder for the inputstring''
requiredrequiredWhenever input is required or notbooleanfalse
typetypeType attribute for the inputstring'text'
valuevalueValue for the inputstring''

Events

EventDescriptionType
changeonChange event returns current input valueCustomEvent<string>

nv-label

Properties

PropertyAttributeDescriptionTypeDefault
descriptiondescriptiontext between label and elementstring''
errorerrorred text under the element, makes the label redstring''
labellabellarge text over elementstring''

Dependencies

Used by

Graph

graph TD;
  nv-checkbox --> nv-label
  nv-radio-group --> nv-label
  nv-select --> nv-label
  nv-switch --> nv-label
  style nv-label fill:#f9f,stroke:#333,stroke-width:4px

nv-radio-group

Properties

PropertyAttributeDescriptionTypeDefault
columncolumnswitch flex-direction (row | column)booleantrue
descriptiondescriptiontext between label and radio-groupstring''
errorerrorred text under the radio-group, makes the label redstring''
labellabellarge text over radio-groupstring''
valuevaluemakes an element with this value activestringnull

Events

EventDescriptionType
changeonChange event returns the value of the selected radioCustomEvent<string>

Dependencies

Depends on

Graph

graph TD;
  nv-radio-group --> nv-label
  style nv-radio-group fill:#f9f,stroke:#333,stroke-width:4px

nv-select

Properties

PropertyAttributeDescriptionTypeDefault
descriptiondescriptiontext between label and selectstring''
disableddisableddisables the select and changes stylesbooleanfalse
errorerrorred text under the select, makes the label redstring''
items--initial dataItem[][]
labellabellarge text over selectstring''
placeholderplaceholderplaceholderstring''
typetypestyle option (primary, checkbox, multi)SelectTypes.checkbox \| SelectTypes.multi \| SelectTypes.primarySelectTypes.primary
valuevalueinitial valuestring \| string[]null

Events

EventDescriptionType
changeonChange event returns selected valuesCustomEvent<string \| string[]>

Dependencies

Depends on

Graph

graph TD;
  nv-select --> nv-icon
  nv-select --> nv-checkbox
  nv-select --> nv-label
  nv-select --> nv-dropdown
  nv-select --> nv-dropdown-button
  nv-select --> nv-dropdown-container
  nv-checkbox --> nv-label
  style nv-select fill:#f9f,stroke:#333,stroke-width:4px

nv-switch

Properties

PropertyAttributeDescriptionTypeDefault
checkedcheckedactivity flagbooleanfalse
descriptiondescriptiontext between label and switchstring''
disableddisableddisables the switch and changes stylesbooleanfalse
errorerrorred text under the switch, makes the label redstring''
labellabellarge text over switchstring''
namenamename prop for inputstring''
valuevalueswitch textstring''

Events

EventDescriptionType
changeonChange event returns isCheckedCustomEvent<boolean>

Dependencies

Depends on

Graph

graph TD;
  nv-switch --> nv-label
  style nv-switch fill:#f9f,stroke:#333,stroke-width:4px

nv-tabs

Properties

PropertyAttributeDescriptionTypeDefault
activeactiveid of the active tabstringdefaultActive
typetypestyle option (primary, secondary, table)TabTypes.primary \| TabTypes.secondary \| TabTypes.tableTabTypes.primary

Events

EventDescriptionType
changeonChange event returns the active-tab-id of the selected tabCustomEvent<string>

Dependencies

Used by

Graph

graph TD;
  nv-tab-example --> nv-tabs
  nv-table-example --> nv-tabs
  style nv-tabs fill:#f9f,stroke:#333,stroke-width:4px

nv-table

Properties

PropertyAttributeDescriptionTypeDefault
typetypeTabTypes.primary \| TabTypes.secondary \| TabTypes.tableTabTypes.table

Dependencies

Depends on

Graph

graph TD;
  nv-table-example --> nv-table
  nv-table-example --> nv-table-head
  nv-table-example --> nv-table-cell
  nv-table-example --> nv-table-body
  nv-table-example --> nv-table-row
  nv-table-example --> nv-tabs
  nv-table-example --> nv-tab
  nv-table-example --> nv-tab-content
  nv-table-example --> nv-tab-pane
  style nv-table-example fill:#f9f,stroke:#333,stroke-width:4px

nv-table-body

Dependencies

Used by

Graph

graph TD;
  nv-table-example --> nv-table-body
  style nv-table-body fill:#f9f,stroke:#333,stroke-width:4px

nv-table-cell

Properties

PropertyAttributeDescriptionTypeDefault
alignalignTableCellAlignments.center \| TableCellAlignments.left \| TableCellAlignments.rightTableCellAlignments.left
splitterssplittersTableSplitters.all \| TableSplitters.horizontal \| TableSplitters.none \| TableSplitters.partial \| TableSplitters.verticalTableSplitters.all

Dependencies

Used by

Graph

graph TD;
  nv-table-example --> nv-table-cell
  style nv-table-cell fill:#f9f,stroke:#333,stroke-width:4px

nv-table-head

Dependencies

Used by

Graph

graph TD;
  nv-table-example --> nv-table-head
  style nv-table-head fill:#f9f,stroke:#333,stroke-width:4px

nv-table-row

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorTableRowColors.danger \| TableRowColors.default \| TableRowColors.successTableRowColors.default
splitterssplittersTableSplitters.all \| TableSplitters.horizontal \| TableSplitters.none \| TableSplitters.partial \| TableSplitters.verticalundefined

Dependencies

Used by

Graph

graph TD;
  nv-table-example --> nv-table-row
  style nv-table-row fill:#f9f,stroke:#333,stroke-width:4px

nv-tooltip

Properties

PropertyAttributeDescriptionTypeDefault
boundaryboundaryThe element that should act as boundaries for the tooltip.TooltipBoundaries.SCROLLPARENT \| TooltipBoundaries.VIEWPORT \| TooltipBoundaries.WINDOWTooltipBoundaries.VIEWPORT
fadeTimefade-timeThe duration (in seconds) of the tooltip fade-out effect animationnumber0.4
flipflipIf the tooltip should auto-flip when it starts to overlap its target element.booleantrue
hideTriggershide-triggersThe space-separated events that should close the tooltip when fired on the target (eg. mouseout blur). If empty, the tooltip will never be closed from outside. FYI: You will hardly ever need this attribute, since 'opposite' events for common triggers are added automagically.stringundefined
isOpenis-openIf the tooltip should be visiblebooleanfalse
noArrowno-arrowIf the tooltip arrow should be hiddenbooleanundefined
placementplacementThe tooltip placement relative to the targetTooltipPlacements.AUTO \| TooltipPlacements.AUTOEND \| TooltipPlacements.AUTOSTART \| TooltipPlacements.BOTTOM \| TooltipPlacements.BOTTOMEND \| TooltipPlacements.BOTTOMSTART \| TooltipPlacements.LEFT \| TooltipPlacements.LEFTEND \| TooltipPlacements.LEFTSTART \| TooltipPlacements.RIGHT \| TooltipPlacements.RIGHTEND \| TooltipPlacements.RIGHTSTART \| TooltipPlacements.TOP \| TooltipPlacements.TOPEND \| TooltipPlacements.TOPSTARTTooltipPlacements.AUTO
showTriggersshow-triggersThe space-separated events that should open the tooltip when fired on the target (eg. mouseover focus). FYI: If a single click trigger is provided (without hide-triggers), another click event will also be registered on the document object to close the tooltip, for your convenience.stringundefined
targettargetThe CSS selector of the target elementstringundefined
timeouttimeoutHow long in milliseconds the tooltip should stay open after the page load.numberundefined