New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pikas-ui/checkbox

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pikas-ui/checkbox - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6

dist/Checkbox.cjs

2

dist/Checkbox.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _jsxruntime = require('react/jsx-runtime');var _styles = require('@pikas-ui/styles');var _icons = require('@pikas-ui/icons');var _text = require('@pikas-ui/text');var _react = require('react');var _reactcheckbox = require('@radix-ui/react-checkbox'); var R = _interopRequireWildcard(_reactcheckbox);var _fontcolorcontrast = require('font-color-contrast'); var _fontcolorcontrast2 = _interopRequireDefault(_fontcolorcontrast);const D=_styles.styled.call(void 0, "div",{display:"flex",flexDirection:"column",userSelect:"none"}),H=_styles.styled.call(void 0, R.Root,{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderStyle:"solid",variants:{focus:{true:{outline:"solid",outlineColor:"$PRIMARY",outlineWidth:2}}}}),O=_styles.styled.call(void 0, R.Indicator,{}),U=_styles.styled.call(void 0, "div",{display:"flex",alignItems:"center"}),Z= exports.CheckboxSide ={left:!0,right:!0},Y= exports.Checkbox =({id:a,label:r,textError:b,fontSize:$,className:E,defaultChecked:h,checked:d,onChange:m,disabled:n,required:N,name:M,bgColor:p,bgColorChecked:C,borderRadius:W,boxShadow:w,borderColor:F,borderWidth:L,size:o,side:x,outline:P,indeterminate:l,styles:e})=>{const i=_styles.useTheme.call(void 0, ),[s,u]=_react.useState.call(void 0, l?"indeterminate":h||"indeterminate"),[A,y]=_react.useState.call(void 0, !1),B=S=>{u(S),m&&m(S)};return _react.useEffect.call(void 0, ()=>{d!==void 0&&u(d)},[d]),_react.useEffect.call(void 0, ()=>{l&&u("indeterminate")},[l]),_jsxruntime.jsxs.call(void 0, D,{className:E,css:{fontSize:`$${$}`,cursor:n?"not-allowed":void 0,opacity:n?.5:1,"& > *":{pointerEvents:n?"none":void 0},..._optionalChain([e, 'optionalAccess', _ => _.container])},children:[_jsxruntime.jsxs.call(void 0, U,{children:[r&&x==="left"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:a,style:{marginRight:8,fontWeight:"$NORMAL",..._optionalChain([e, 'optionalAccess', _2 => _2.label])},children:r}):null,_jsxruntime.jsx.call(void 0, H,{defaultChecked:h,id:a,onCheckedChange:B,checked:s,disabled:n,required:N,name:M,focus:P?A:void 0,onFocus:()=>y(!0),onBlur:()=>y(!1),css:{backgroundColor:`$${p}`,br:W,boxShadow:`$${w}`,borderColor:`$${F}`,borderWidth:L,width:o,height:o,'&[aria-checked="true"]':{backgroundColor:`$${C}`},..._optionalChain([e, 'optionalAccess', _3 => _3.checkboxRoot])},children:_jsxruntime.jsxs.call(void 0, O,{css:{color:i&&_fontcolorcontrast2.default.call(void 0, i.colors[C||"WHITE"].value,.7)||void 0,..._optionalChain([e, 'optionalAccess', _4 => _4.checkboxIndicator])},children:[s==="indeterminate"&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:minus",colorHex:i&&_fontcolorcontrast2.default.call(void 0, i.colors[p||"BLACK"].value,.7)||"",styles:{container:{opacity:.5,..._optionalChain([e, 'optionalAccess', _5 => _5.icon, 'optionalAccess', _6 => _6.container])},svg:{..._optionalChain([e, 'optionalAccess', _7 => _7.icon, 'optionalAccess', _8 => _8.svg])}},size:o?o/1.25:void 0}),s===!0&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:check",size:o?o/1.25:void 0,styles:{..._optionalChain([e, 'optionalAccess', _9 => _9.icon])}})]})}),r&&x==="right"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:a,style:{marginLeft:8,fontWeight:"$NORMAL",..._optionalChain([e, 'optionalAccess', _10 => _10.label])},children:r}):null]}),b?_jsxruntime.jsx.call(void 0, _text.TextError,{style:{marginTop:5,..._optionalChain([e, 'optionalAccess', _11 => _11.textError])},children:b}):null]})};Y.defaultProps={bgColor:"WHITE",bgColorChecked:"PRIMARY",boxShadow:"DIMINUTION_1",borderRadius:"md",size:24,side:"right",borderWidth:0,outline:!0,fontSize:"EM-MEDIUM",disabled:!1,required:!1,indeterminate:!1,defaultChecked:!1};exports.Checkbox = Y; exports.CheckboxSide = Z;
import{jsx as t,jsxs as f}from"react/jsx-runtime";import{useTheme as z}from"@pikas-ui/styles";import{styled as a}from"@pikas-ui/styles";import{IconByName as k}from"@pikas-ui/icons";import{Label as g,TextError as q}from"@pikas-ui/text";import{useEffect as T}from"react";import{useState as I}from"react";import*as R from"@radix-ui/react-checkbox";import v from"font-color-contrast";const D=a("div",{display:"flex",flexDirection:"column",userSelect:"none"}),H=a(R.Root,{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderStyle:"solid",variants:{focus:{true:{outline:"solid",outlineColor:"$PRIMARY",outlineWidth:2}}}}),O=a(R.Indicator,{}),U=a("div",{display:"flex",alignItems:"center"}),Z={left:!0,right:!0},Y=({id:c,label:r,textError:b,fontSize:$,className:E,defaultChecked:h,checked:d,onChange:m,disabled:n,required:N,name:M,bgColor:p,bgColorChecked:C,borderRadius:W,boxShadow:w,borderColor:F,borderWidth:L,size:o,side:x,outline:P,indeterminate:l,styles:e})=>{const i=z(),[s,u]=I(l?"indeterminate":h||"indeterminate"),[A,y]=I(!1),B=S=>{u(S),m&&m(S)};return T(()=>{d!==void 0&&u(d)},[d]),T(()=>{l&&u("indeterminate")},[l]),f(D,{className:E,css:{fontSize:`$${$}`,cursor:n?"not-allowed":void 0,opacity:n?.5:1,"& > *":{pointerEvents:n?"none":void 0},...e?.container},children:[f(U,{children:[r&&x==="left"?t(g,{htmlFor:c,style:{marginRight:8,fontWeight:"$NORMAL",...e?.label},children:r}):null,t(H,{defaultChecked:h,id:c,onCheckedChange:B,checked:s,disabled:n,required:N,name:M,focus:P?A:void 0,onFocus:()=>y(!0),onBlur:()=>y(!1),css:{backgroundColor:`$${p}`,br:W,boxShadow:`$${w}`,borderColor:`$${F}`,borderWidth:L,width:o,height:o,'&[aria-checked="true"]':{backgroundColor:`$${C}`},...e?.checkboxRoot},children:f(O,{css:{color:i&&v.default(i.colors[C||"WHITE"].value,.7)||void 0,...e?.checkboxIndicator},children:[s==="indeterminate"&&t(k,{name:"bx:minus",colorHex:i&&v.default(i.colors[p||"BLACK"].value,.7)||"",styles:{container:{opacity:.5,...e?.icon?.container},svg:{...e?.icon?.svg}},size:o?o/1.25:void 0}),s===!0&&t(k,{name:"bx:check",size:o?o/1.25:void 0,styles:{...e?.icon}})]})}),r&&x==="right"?t(g,{htmlFor:c,style:{marginLeft:8,fontWeight:"$NORMAL",...e?.label},children:r}):null]}),b?t(q,{style:{marginTop:5,...e?.textError},children:b}):null]})};Y.defaultProps={bgColor:"WHITE",bgColorChecked:"PRIMARY",boxShadow:"DIMINUTION_1",borderRadius:"md",size:24,side:"right",borderWidth:0,outline:!0,fontSize:"EM-MEDIUM",disabled:!1,required:!1,indeterminate:!1,defaultChecked:!1};export{Y as Checkbox,Z as CheckboxSide};
//# sourceMappingURL=Checkbox.js.map

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _Checkboxjs = require('./Checkbox.js'); _createStarExport(_Checkboxjs);
export*from"./Checkbox.js";
//# sourceMappingURL=index.js.map
{
"name": "@pikas-ui/checkbox",
"version": "2.1.5",
"version": "2.1.6",
"private": false,
"description": "",
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./dist/*": {
"import": "./dist/*.js",
"require": "./dist/*.cjs",
"types": "./dist/*.d.ts"
}
},
"files": [

@@ -26,5 +39,5 @@ "dist/**/*"

"dependencies": {
"@pikas-ui/icons": "2.1.4",
"@pikas-ui/styles": "2.3.4",
"@pikas-ui/text": "3.1.4",
"@pikas-ui/icons": "2.1.5",
"@pikas-ui/styles": "2.3.5",
"@pikas-ui/text": "3.1.5",
"@radix-ui/react-checkbox": "^1.0.0",

@@ -31,0 +44,0 @@ "font-color-contrast": "^11.1.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc