UNPKG

azure-devops-ui

Version:

React components for building web UI in Azure DevOps

1 lines 797 B
import"../../CommonImports";import"../../Core/core.css";import"./ColorSwatchPicker.css";import*as React from"react";import{ColorPip}from"../ColorPip/ColorPip";import{FocusZone,FocusZoneDirection}from"../../FocusZone";import{css}from"../../Util";import{Observer}from"../../Observer";var ColorSwatchPicker=function(e){var r=e.colors,o=e.className,t=e.onPipClick,e=e.selectedIndex;return React.createElement(FocusZone,{activateOnEnter:!0,direction:FocusZoneDirection.Horizontal},React.createElement("div",{className:css("bolt-colorswatchpicker flex-row",o)},React.createElement(Observer,{selectedIndex:e},function(o){return r.map(function(e,r){return React.createElement(ColorPip,{key:r,color:e,isSelected:o.selectedIndex===r,onClick:function(e,o){return t(e,o,r)}})})})))};export{ColorSwatchPicker};