@bikdotai/bik-component-library 0.0.196-beta-2 → 0.0.196-beta-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/checkBox/CheckBox.d.ts +0 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkList/CheckList.js +1 -1
- package/dist/cjs/components/radioList/RadioList.js +1 -1
- package/dist/esm/components/checkBox/CheckBox.d.ts +0 -1
- package/dist/esm/components/checkBox/CheckBox.js +1 -1
- package/dist/esm/components/checkList/CheckList.js +1 -1
- package/dist/esm/components/radioList/RadioList.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("./CheckBox.styled.js"),t=require("../TypographyStyle.js"),l=require("../../constants/Theme.js");const a=s=>e.jsxs("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[e.jsx("rect",{x:"0",y:"0",width:"18",height:"18",rx:"4",fill:s.isDisabled?l.COLORS.content.inactive:l.COLORS.background.positive.vibrant}),!s.isPartial&&e.jsx("svg",Object.assign({width:"10",height:"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),s.isPartial&&e.jsx("rect",{x:"5",y:"8",width:"8",height:"2",rx:"1",fill:l.COLORS.surface.standard})]}));exports.CheckBox=r=>{var n;const[c,o]=s.useState(r.isChecked||!1),[d,h]=s.useState(r.isDisabled||!1),[u,x]=s.useState(!1),[b,C]=s.useState(!1);return s.useEffect((()=>{o(r.isChecked)}),[r.isChecked]),s.useEffect((()=>{h(r.isDisabled||!1)}),[r.isDisabled]),e.jsxs(i.CheckboxContainer,Object.assign({onClick:()=>{var e;if(!r.isDisabled){const s=!c;o(s),null===(e=r.onValueChange)||void 0===e||e.call(r,s,r.value)}},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),onMouseDown:()=>C(!0),onMouseUp:()=>C(!1)},{children:[e.jsx(i.CheckboxIcon,Object.assign({checked:c,hovered:u,clicked:b,isDisabled:d},{children:c&&e.jsx(a,{isPartial:null!==(n=r.isPartiallyChecked)&&void 0!==n&&n,isDisabled:d})})),r.label&&e.jsx(t.BodyPrimary,Object.assign({color:r.isDisabled?l.COLORS.text.disabled:l.COLORS.text.primary},{children:r.label}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../checkBox/CheckBox.js"),i=require("./CheckList.styled.js"),r=require("../TypographyStyle.js"),c=require("../../constants/Theme.js");exports.CheckList=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../checkBox/CheckBox.js"),i=require("./CheckList.styled.js"),r=require("../TypographyStyle.js"),c=require("../../constants/Theme.js");exports.CheckList=l=>{const[n,a]=s.useState(l.listItems);s.useEffect((()=>{a(l.listItems)}),[l.listItems]);const o=(e,s)=>{const t=[...n],i=n.find((e=>e.value===s));i&&(i.isChecked=e),a(t);const r=t.filter((e=>e.isChecked));l.onChange(r)};return e.jsxs(i.CheckListStyled,{children:[(l.title||l.subTitle)&&e.jsxs("div",Object.assign({className:"title__container"},{children:[l.title&&e.jsx(r.TitleRegular,{children:l.title}),l.subTitle&&e.jsx(r.BodySecondary,Object.assign({color:c.COLORS.text.secondary},{children:l.subTitle}))]})),e.jsx("div",Object.assign({className:"list__container"},{children:n.map((s=>e.jsx(t.CheckBox,Object.assign({},s,{onValueChange:o}),s.value)))}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../radioButton/RadioButton.js"),i=require("./RadioList.styled.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js");exports.RadioList=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../radioButton/RadioButton.js"),i=require("./RadioList.styled.js"),r=require("../TypographyStyle.js"),a=require("../../constants/Theme.js");exports.RadioList=l=>{const[n,c]=t.useState(l.listItems);t.useEffect((()=>{c(l.listItems)}),[l.listItems]);const o=(e,t)=>{let s;const i=[...n];i.forEach((i=>{i.value===t?(s=i,i.isActive=e):i.isActive=!e})),c(i),l.onChange(s)};return e.jsxs(i.RadioListStyled,{children:[(l.title||l.subTitle)&&e.jsxs("div",Object.assign({className:"title__container"},{children:[l.title&&e.jsx(r.TitleRegular,{children:l.title}),l.subTitle&&e.jsx(r.BodySecondary,Object.assign({color:a.COLORS.text.secondary},{children:l.subTitle}))]})),e.jsx("div",Object.assign({className:"list__container"},{children:n.map((t=>e.jsx(s.RadioButton,Object.assign({},t,{onValueChange:o}),t.value)))}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as s,useEffect as l}from"react";import{CheckboxContainer as t,CheckboxIcon as o}from"./CheckBox.styled.js";import{BodyPrimary as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as s,useEffect as l}from"react";import{CheckboxContainer as t,CheckboxIcon as o}from"./CheckBox.styled.js";import{BodyPrimary as a}from"../TypographyStyle.js";import{COLORS as r}from"../../constants/Theme.js";const n=s=>e("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[i("rect",{x:"0",y:"0",width:"18",height:"18",rx:"4",fill:s.isDisabled?r.content.inactive:r.background.positive.vibrant}),!s.isPartial&&i("svg",Object.assign({width:"10",height:"9",x:"4",y:"4",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.68189 1.06043C10.0724 1.45096 10.0724 2.08412 9.68189 2.47464L4.02501 8.13152C3.63449 8.52205 3.00132 8.52205 2.6108 8.13152L0.489684 6.01041C0.0991601 5.61988 0.0991598 4.98672 0.489684 4.59619C0.880209 4.20567 1.51337 4.20567 1.9039 4.59619L3.31791 6.0102L8.26768 1.06043C8.6582 0.669907 9.29137 0.669907 9.68189 1.06043Z",fill:"white"})})),s.isPartial&&i("rect",{x:"5",y:"8",width:"8",height:"2",rx:"1",fill:r.surface.standard})]})),d=d=>{var c;const[h,b]=s(d.isChecked||!1),[g,v]=s(d.isDisabled||!1),[w,m]=s(!1),[p,u]=s(!1);return l((()=>{b(d.isChecked)}),[d.isChecked]),l((()=>{v(d.isDisabled||!1)}),[d.isDisabled]),e(t,Object.assign({onClick:()=>{var e;if(!d.isDisabled){const i=!h;b(i),null===(e=d.onValueChange)||void 0===e||e.call(d,i,d.value)}},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1)},{children:[i(o,Object.assign({checked:h,hovered:w,clicked:p,isDisabled:g},{children:h&&i(n,{isPartial:null!==(c=d.isPartiallyChecked)&&void 0!==c&&c,isDisabled:g})})),d.label&&i(a,Object.assign({color:d.isDisabled?r.text.disabled:r.text.primary},{children:d.label}))]}))};export{d as CheckBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as s,useEffect as i}from"react";import{CheckBox as c}from"../checkBox/CheckBox.js";import{CheckListStyled as o}from"./CheckList.styled.js";import{TitleRegular as r,BodySecondary as n}from"../TypographyStyle.js";import{COLORS as l}from"../../constants/Theme.js";const a=a=>{const[m,h]=s(a.listItems);i((()=>{h(a.listItems)}),[a.listItems]);const d=(t,e)=>{const s=[...m],i=m.find((t=>t.value===e));i&&(i.isChecked=t),h(s);const c=s.filter((t=>t.isChecked));a.onChange(c)};return t(o,{children:[(a.title||a.subTitle)&&t("div",Object.assign({className:"title__container"},{children:[a.title&&e(r,{children:a.title}),a.subTitle&&e(n,Object.assign({color:l.text.secondary},{children:a.subTitle}))]})),e("div",Object.assign({className:"list__container"},{children:m.map((t=>e(c,Object.assign({},t,{onValueChange:d}),t.value)))}))]})};export{a as CheckList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as i}from"react";import{RadioButton as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as i,useEffect as s}from"react";import{RadioButton as o}from"../radioButton/RadioButton.js";import{RadioListStyled as r}from"./RadioList.styled.js";import{TitleRegular as n,BodySecondary as a}from"../TypographyStyle.js";import{COLORS as c}from"../../constants/Theme.js";const l=l=>{const[m,d]=i(l.listItems);s((()=>{d(l.listItems)}),[l.listItems]);const h=(t,e)=>{let i;const s=[...m];s.forEach((s=>{s.value===e?(i=s,s.isActive=t):s.isActive=!t})),d(s),l.onChange(i)};return t(r,{children:[(l.title||l.subTitle)&&t("div",Object.assign({className:"title__container"},{children:[l.title&&e(n,{children:l.title}),l.subTitle&&e(a,Object.assign({color:c.text.secondary},{children:l.subTitle}))]})),e("div",Object.assign({className:"list__container"},{children:m.map((t=>e(o,Object.assign({},t,{onValueChange:h}),t.value)))}))]})};export{l as RadioList};
|