PageSourceSearch

https://app.youscan.io/assets/ColorPicker-Bs7xI-Ud.js

js youscan.io collected 2026-10-02 14:31:57 UTC 3,377 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`2a2642b6dfacef97687e3efcbfceddb15cf2ec44`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`0a61c602-c132-4081-87f1-14e2a66d3a29`,e._sentryDebugIdIdentifier=`sentry-dbid-0a61c602-c132-4081-87f1-14e2a66d3a29`)}catch{}})();import{o as e}from"./rolldown-runtime-Dq-L5ofj.js";import{y as t}from"./vendor-highcharts-D9LiJ1jq.js";import{x as n}from"./vendor-mui-CwwA7Cvy.js";import{St as r,Vr as i}from"./vendors-_iXptsBn.js";import"./apiSingleton-DoXPG3Va.js";import{G as a,t as o}from"./Popover-BFBsLyOX.js";import{t as s}from"./IconButton-DRhiu9MX.js";import{t as c}from"./TextField-CCs-7-sS.js";var l=n(),u=e(i()),d={base:`_base_1x0zs_1`},f=({className:e,children:t,"data-hook":n=`secondary-text`})=>(0,l.jsx)(`span`,{className:(0,u.default)(e,d.base),"data-hook":n,children:t}),p={base:`_base_7fsn0_1`,iconButton:`_iconButton_7fsn0_9`},m={base:`_base_zcvhk_1`,small:`_small_zcvhk_25`,selected:`_selected_zcvhk_30`},h=({small:e,color:t,name:n,selected:r,onSelect:i})=>{let o=()=>{i(n,t)};return(0,l.jsx)(`button`,{type:`button`,"aria-label":`Select ${n} color`,style:{backgroundColor:t},className:(0,u.default)(m.base,{[m.selected]:r,[m.small]:e}),onClick:o,children:r&&(0,l.jsx)(a,{type:`check`,color:`black`,size:e?8:16})})},g=e(t()),_={base:`_base_1qgpc_1`,selected:`_selected_1qgpc_25`,colorPicker:`_colorPicker_1qgpc_29`,pickerContainer:`_pickerContainer_1qgpc_33`,hexInput:`_hexInput_1qgpc_54`},v=/^#[0-9A-Fa-f]{6}$/,y=({color:e,selected:t,onSelect:n})=>{let[i,s]=(0,g.useState)(e);(0,g.useEffect)(()=>{s(e)},[e]);let d=()=>{v.test(i)||s(e)};return(0,l.jsx)(o,{hideArrow:!0,placement:`bottom-start`,content:(0,l.jsxs)(`div`,{className:_.pickerContainer,children:[(0,l.jsx)(c,{fullWidth:!0,size:`small`,value:i,onChange:e=>{s(e),v.test(e)&&n(e)},onBlur:()=>{d()},onKeyDown:e=>{e.key===`Enter`&&(d(),e.currentTarget.blur())},placeholder:`#3B82F6`,className:_.hexInput}),(0,l.jsx)(r,{color:v.test(i)?i:e,onChange:e=>{s(e),n(e)},className:_.colorPicker})]}),children:(0,l.jsxs)(`button`,{type:`button`,"aria-label":`Custom color picker`,className:(0,u.default)(_.base,{[_.selected]:t}),style:t?{backgroundColor:e}:void 0,children:[(0,l.jsx)(a,{type:`palette`,size:t?12:16,color:t?`black`:`default`,className:_.paletteIcon}),t&&(0,l.jsx)(a,{type:`check`,size:t?12:16,color:`black`})]})})},b=({small:e,colors:t,selected:n,className:r,type:i=`inline`,trigger:a,withCustomColor:c=!1,"data-hook":d=`color-picker`,onSelect:f})=>{let m=Object.keys(t),g=c?m.slice(0,-1):m,_=c&&!!n&&!(e=>g.some(n=>e===t[n]||e===n))(n);return i===`popover`?(0,l.jsx)(`div`,{className:(0,u.default)(p.base,r),"data-hook":d,children:(0,l.jsx)(o,{content:(0,l.jsxs)(`div`,{className:(0,u.default)(p.base),children:[g.map(r=>(0,l.jsx)(h,{small:e,name:r,color:t[r],selected:n===t[r]||n===r,onSelect:f},r)),c&&(0,l.jsx)(y,{color:n,selected:_,onSelect:e=>f(`custom`,e)})]}),children:a||(0,l.jsx)(s,{className:(0,u.default)(p.iconButton),iconType:`palette`})})}):(0,l.jsxs)(`div`,{className:(0,u.default)(p.base,r),"data-hook":d,children:[g.map(r=>(0,l.jsx)(h,{small:e,name:r,color:t[r],selected:n===t[r]||n===r,onSelect:f},r)),c&&(0,l.jsx)(y,{color:n,selected:_,onSelect:e=>f(`custom`,e)})]})};export{f as n,b as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.