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 3.3.8 to 3.3.9

14

dist/Checkbox.d.ts
import { PikasCSS, PikasColor, PikasShadow, BorderRadius, PikasFontSize } from '@pikas-ui/styles';
import { IconCSS } from '@pikas-ui/icons';
import { ReactNode } from 'react';
import { ReactNode, FC } from 'react';

@@ -10,3 +10,3 @@ declare const checkboxSide: {

declare type CheckboxSide = keyof typeof checkboxSide;
interface CheckboxCSS {
declare type CheckboxCSS = {
container?: PikasCSS;

@@ -18,8 +18,8 @@ label?: PikasCSS;

icon?: IconCSS;
}
interface CheckboxProps {
};
declare type CheckboxProps = {
defaultChecked?: boolean;
onChange?: (checked: boolean) => void;
id?: string;
label?: string | ReactNode;
label?: ReactNode | string;
backgroundColorName?: PikasColor;

@@ -43,5 +43,5 @@ backgroundColorNameChecked?: PikasColor;

css?: CheckboxCSS;
}
declare const Checkbox: React.FC<CheckboxProps>;
};
declare const Checkbox: FC<CheckboxProps>;
export { Checkbox, CheckboxCSS, CheckboxProps, CheckboxSide, checkboxSide };

@@ -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 q=_styles.styled.call(void 0, "div",{display:"flex",flexDirection:"column",userSelect:"none"}),z=_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}}}}),D=_styles.styled.call(void 0, R.Indicator,{}),Y=_styles.styled.call(void 0, "div",{display:"flex",alignItems:"center"}),V= exports.checkboxSide ={left:!0,right:!0},X= exports.Checkbox =({id:c,label:r,textError:m,fontSize:v,className:N,defaultChecked:h=!1,checked:s,onChange:b,disabled:n=!1,required:E=!1,name:F,backgroundColorName:C="WHITE",backgroundColorNameChecked:k="PRIMARY",borderRadius:L="md",boxShadow:T="DIMINUTION_1",borderColorName:W,borderWidth:w=0,size:o=24,side:S="right",outline:A=!0,indeterminate:l=!1,css:e})=>{const i=_styles.useTheme.call(void 0, ),[d,u]=_react.useState.call(void 0, l?"indeterminate":h),[B,x]=_react.useState.call(void 0, !1),M=p=>{u(p),b&&b(p)};return _react.useEffect.call(void 0, ()=>{s!==void 0&&u(s)},[s]),_react.useEffect.call(void 0, ()=>{l&&u("indeterminate")},[l]),_jsxruntime.jsxs.call(void 0, q,{className:N,css:{fontSize:`$${v}`,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, Y,{children:[r&&S==="left"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:c,css:{marginRight:8,fontWeight:"$NORMAL",..._optionalChain([e, 'optionalAccess', _2 => _2.label])},children:r}):null,_jsxruntime.jsx.call(void 0, z,{defaultChecked:h,id:c,onCheckedChange:M,checked:d,disabled:n,required:E,name:F,focus:A?B:void 0,onFocus:()=>x(!0),onBlur:()=>x(!1),css:{backgroundColor:`$${C}`,br:L,boxShadow:`$${T}`,borderColor:`$${W}`,borderWidth:w,width:o,height:o,'&[aria-checked="true"]':{backgroundColor:`$${k}`},..._optionalChain([e, 'optionalAccess', _3 => _3.checkboxRoot])},children:_jsxruntime.jsxs.call(void 0, D,{css:{color:i&&_fontcolorcontrast2.default.call(void 0, i.colors[k||"WHITE"].value,.7)||void 0,..._optionalChain([e, 'optionalAccess', _4 => _4.checkboxIndicator])},children:[d==="indeterminate"&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:minus",colorHex:i&&_fontcolorcontrast2.default.call(void 0, i.colors[C||"BLACK"].value,.7)||"",css:{..._optionalChain([e, 'optionalAccess', _5 => _5.icon]),container:{opacity:.5,..._optionalChain([e, 'optionalAccess', _6 => _6.icon, 'optionalAccess', _7 => _7.container])}},size:o?o/1.25:void 0}),d===!0&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:check",size:o?o/1.25:void 0,css:_optionalChain([e, 'optionalAccess', _8 => _8.icon])})]})}),r&&S==="right"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:c,css:{marginLeft:8,fontWeight:"$NORMAL",..._optionalChain([e, 'optionalAccess', _9 => _9.label])},children:r}):null]}),m?_jsxruntime.jsx.call(void 0, _text.TextError,{css:{marginTop:5,..._optionalChain([e, 'optionalAccess', _10 => _10.textError])},children:m}):null]})};exports.Checkbox = X; exports.checkboxSide = V;
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _fontcolorcontrast = require('font-color-contrast'); var _fontcolorcontrast2 = _interopRequireDefault(_fontcolorcontrast);const H=_styles.styled.call(void 0, "div",{display:"flex",flexDirection:"column",userSelect:"none"}),Y=_styles.styled.call(void 0, _reactcheckbox.Root,{all:"unset",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",borderStyle:"solid",variants:{focus:{true:{outline:"solid",outlineColor:"$PRIMARY",outlineWidth:2}}}}),z=_styles.styled.call(void 0, _reactcheckbox.Indicator,{}),U=_styles.styled.call(void 0, "div",{display:"flex",alignItems:"center"}),X= exports.checkboxSide ={left:!0,right:!0},Z= exports.Checkbox =({id:c,label:r,textError:f,fontSize:m,className:N,defaultChecked:b=!1,checked:s,onChange:k,disabled:n=!1,required:F=!1,name:E,backgroundColorName:C="WHITE",backgroundColorNameChecked:S="PRIMARY",borderRadius:L="md",boxShadow:T="DIMINUTION_1",borderColorName:x,borderWidth:w=0,size:e=24,side:p="right",outline:M=!0,indeterminate:l=!1,css:o})=>{const i=_styles.useTheme.call(void 0, ),[d,u]=_react.useState.call(void 0, l?"indeterminate":b),[W,g]=_react.useState.call(void 0, !1),A=y=>{u(y),k&&k(y)};return _react.useEffect.call(void 0, ()=>{s!==void 0&&u(s)},[s]),_react.useEffect.call(void 0, ()=>{l&&u("indeterminate")},[l]),_jsxruntime.jsxs.call(void 0, H,{className:N,css:{fontSize:m&&`$${m}`,cursor:n?"not-allowed":void 0,opacity:n?.5:1,"& > *":{pointerEvents:n?"none":void 0},..._optionalChain([o, 'optionalAccess', _ => _.container])},children:[_jsxruntime.jsxs.call(void 0, U,{children:[r&&p==="left"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:c,css:{marginRight:8,fontWeight:"$NORMAL",..._optionalChain([o, 'optionalAccess', _2 => _2.label])},children:r}):null,_jsxruntime.jsx.call(void 0, Y,{defaultChecked:b,id:c,onCheckedChange:A,checked:d,disabled:n,required:F,name:E,focus:M?W:void 0,onFocus:()=>g(!0),onBlur:()=>g(!1),css:{backgroundColor:`$${C}`,br:L,boxShadow:`$${T}`,borderColor:x&&`$${x}`,borderWidth:w,width:e,height:e,'&[aria-checked="true"]':{backgroundColor:`$${S}`},..._optionalChain([o, 'optionalAccess', _3 => _3.checkboxRoot])},children:_jsxruntime.jsxs.call(void 0, z,{css:{color:i&&_fontcolorcontrast2.default.call(void 0, i.colors[S].value,.7),..._optionalChain([o, 'optionalAccess', _4 => _4.checkboxIndicator])},children:[d==="indeterminate"&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:minus",colorHex:i&&_fontcolorcontrast2.default.call(void 0, i.colors[C].value,.7),css:{..._optionalChain([o, 'optionalAccess', _5 => _5.icon]),container:{opacity:.5,..._optionalChain([o, 'optionalAccess', _6 => _6.icon, 'optionalAccess', _7 => _7.container])}},size:e?e/1.25:void 0}),d===!0&&_jsxruntime.jsx.call(void 0, _icons.IconByName,{name:"bx:check",size:e?e/1.25:void 0,css:_optionalChain([o, 'optionalAccess', _8 => _8.icon])})]})}),r&&p==="right"?_jsxruntime.jsx.call(void 0, _text.Label,{htmlFor:c,css:{marginLeft:8,fontWeight:"$NORMAL",..._optionalChain([o, 'optionalAccess', _9 => _9.label])},children:r}):null]}),f?_jsxruntime.jsx.call(void 0, _text.TextError,{css:{marginTop:5,..._optionalChain([o, 'optionalAccess', _10 => _10.textError])},children:f}):null]})};exports.Checkbox = Z; exports.checkboxSide = X;
//# sourceMappingURL=Checkbox.js.map
{
"name": "@pikas-ui/checkbox",
"version": "3.3.8",
"version": "3.3.9",
"private": false,

@@ -42,5 +42,5 @@ "keywords": [

"dependencies": {
"@pikas-ui/icons": "3.3.5",
"@pikas-ui/styles": "3.5.5",
"@pikas-ui/text": "4.2.5",
"@pikas-ui/icons": "3.3.6",
"@pikas-ui/styles": "3.5.6",
"@pikas-ui/text": "4.2.6",
"@radix-ui/react-checkbox": "1.0.1",

@@ -54,10 +54,13 @@ "font-color-contrast": "11.1.0"

"devDependencies": {
"@pikas/config": "1.0.0",
"@pikas/prettier": "1.0.0",
"eslint-config-custom": "1.0.0",
"@pikas/tsconfig": "1.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"@types/node": "18.11.9",
"@types/react": "18.0.24",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.8",
"cross-env": "7.0.3",
"eslint": "8.26.0",
"tsup": "6.3.0",
"eslint": "8.27.0",
"tsup": "6.4.0",
"typescript": "4.8.4"

@@ -64,0 +67,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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