UNPKG

@privy-io/react-auth

Version:

React client for the Privy Auth API

2 lines (1 loc) 1.45 kB
"use strict";var e=require("react/jsx-runtime"),i=require("styled-components");let o=/*#__PURE__*/i.styled.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),c=/*#__PURE__*/i.styled.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),d=/*#__PURE__*/i.styled.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),r=/*#__PURE__*/i.styled.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],(e=>e.color),(e=>e.checked?e.color:"var(--privy-color-background)"),d,(e=>e.color),c,(e=>e.checked?"visible":"hidden"));exports.Checkbox=({className:i,checked:l,color:s="var(--privy-color-accent)",...t})=>/*#__PURE__*/e.jsx("label",{children:/*#__PURE__*/e.jsxs(o,{className:i,children:[/*#__PURE__*/e.jsx(d,{checked:l,...t}),/*#__PURE__*/e.jsx(r,{color:s,checked:l,children:/*#__PURE__*/e.jsx(c,{viewBox:"0 0 24 24",children:/*#__PURE__*/e.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});