@jamsrui/checkbox 0.0.14 → 0.0.16

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/index.d.mts CHANGED
@@ -12,17 +12,22 @@ import './checkbox-root.mjs';
12
12
  import './styles.mjs';
13
13
  import '@jamsrui/core';
14
14
 
15
+ type CheckboxProps = Checkbox$1.Props;
15
16
  declare const Checkbox: ((props: Checkbox$1.Props) => react_jsx_runtime.JSX.Element) & {
17
+ Root: (props: Checkbox$1.Props) => react_jsx_runtime.JSX.Element;
16
18
  Control: (props: CheckboxControl.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
17
19
  Indicator: (props: CheckboxIndicator.Props) => react_jsx_runtime.JSX.Element;
18
20
  Content: (props: CheckboxContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
19
21
  };
20
- type Checkbox = {
21
- Root: Checkbox$1.Props;
22
- Control: CheckboxControl.Props;
23
- Indicator: CheckboxIndicator.Props;
24
- Content: CheckboxContent.Props;
25
- };
26
- type CheckboxProps = Checkbox$1.Props;
22
+ declare namespace Checkbox {
23
+ interface Props extends Checkbox$1.Props {
24
+ }
25
+ interface Control extends CheckboxControl.Props {
26
+ }
27
+ interface Indicator extends CheckboxIndicator.Props {
28
+ }
29
+ interface Content extends CheckboxContent.Props {
30
+ }
31
+ }
27
32
 
28
33
  export { Checkbox, type CheckboxProps };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{Checkbox as o}from"./checkbox.mjs";import{CheckboxContent as t}from"./checkbox-content.mjs";import{CheckboxControl as e}from"./checkbox-control.mjs";import{CheckboxIndicator as r}from"./checkbox-indicator.mjs";import{CheckboxConfig as k,useCheckboxConfig as i}from"./checkbox-config.mjs";const b=Object.assign(o,{Control:e,Indicator:r,Content:t});export{b as Checkbox,k as CheckboxConfig,i as useCheckboxConfig};
1
+ import{Checkbox as o}from"./checkbox.mjs";import{CheckboxContent as e}from"./checkbox-content.mjs";import{CheckboxControl as t}from"./checkbox-control.mjs";import{CheckboxIndicator as r}from"./checkbox-indicator.mjs";import{CheckboxConfig as h,useCheckboxConfig as i}from"./checkbox-config.mjs";const p=Object.assign(o,{Root:o,Control:t,Indicator:r,Content:e});export{p as Checkbox,h as CheckboxConfig,i as useCheckboxConfig};
@@ -22,11 +22,13 @@ declare const useCheckbox: (props: useCheckbox.Props) => {
22
22
  declare namespace useCheckbox {
23
23
  interface Props extends CheckboxRoot.Props, CheckboxVariantProps {
24
24
  defaultChecked?: boolean;
25
- isChecked?: boolean;
25
+ checked?: boolean;
26
26
  onCheckedChange?: (checked: boolean) => void;
27
27
  isIntermediate?: boolean;
28
28
  disabled?: boolean;
29
29
  inputProps?: UIProps<"input">;
30
+ name?: string;
31
+ form?: string;
30
32
  }
31
33
  }
32
34
 
@@ -1 +1 @@
1
- import{useCallback as a,useMemo as E}from"react";import{useControlledState as F,useFocusVisible as U,useHover as j,useMergeRefs as K,usePress as L}from"@jamsrui/hooks";import{dataAttr as s,dataAttrDev as r,mapPropsVariants as O,mergeProps as S}from"@jamsrui/utils";import{checkboxVariants as v}from"./styles.mjs";const J=y=>{const[R,m]=O(y,v.variantKeys),{isInvalid:h}=m,o=v(m),{isChecked:V,onCheckedChange:i,defaultChecked:p,isIntermediate:c,disabled:G=!1,inputProps:H,...d}=R,t=G,[n=!1,b]=F({defaultProp:p,prop:V,onChange:i}),{isFocusVisible:C,ref:M}=U({isDisabled:t}),{isPressed:k,ref:A}=L({isDisabled:t}),{isHovered:u,ref:D}=j({isDisabled:t}),P=K([M,A,D]),l=a(e=>{b(e.target.checked)},[b]),f=a(()=>({...d,className:o.root({className:d.className}),"data-slot":r("root"),"data-component":r("checkbox"),"data-checked":s(n||c),"data-focus-visible":s(C),"data-pressed":s(k),"data-hovered":s(u),"data-disabled":s(t),"aria-disabled":s(t),"data-invalid":s(h)}),[d,n,t,C,u,c,k,h,o]),x=a(e=>({onChange:l,...S(e,H,{onChange:l}),disabled:t,"aria-disabled":s(t),ref:P,type:"checkbox","data-slot":r("input"),className:o.input({className:e.className})}),[l,t,P,o]),g=a(e=>({...e,"data-slot":r("content"),className:o.content({className:e.className})}),[o]),N=a(e=>({...e,"data-slot":r("control"),className:o.control({className:e.className})}),[o]),I=a(e=>({...e,"data-slot":r("indicator"),className:o.indicator({className:e.className})}),[o]);return E(()=>({getRootProps:f,getInputProps:x,getContentProps:g,getControlProps:N,getIndicatorProps:I,onCheckedChange:i,defaultChecked:p,isChecked:n,isIntermediate:c}),[p,g,x,f,N,I,n,c,i])};export{J as useCheckbox};
1
+ import{useCallback as a,useMemo as E}from"react";import{useControlledState as F,useFocusVisible as U,useHover as j,useMergeRefs as K,usePress as L}from"@jamsrui/hooks";import{dataAttr as s,dataAttrDev as r,mapPropsVariants as O,mergeProps as S}from"@jamsrui/utils";import{checkboxVariants as v}from"./styles.mjs";const J=y=>{const[R,m]=O(y,v.variantKeys),{isInvalid:h}=m,o=v(m),{checked:V,onCheckedChange:i,defaultChecked:p,isIntermediate:c,disabled:G=!1,inputProps:H,...d}=R,t=G,[n=!1,b]=F({defaultProp:p,prop:V,onChange:i}),{isFocusVisible:C,ref:M}=U({isDisabled:t}),{isPressed:k,ref:A}=L({isDisabled:t}),{isHovered:u,ref:D}=j({isDisabled:t}),P=K([M,A,D]),l=a(e=>{b(e.target.checked)},[b]),f=a(()=>({...d,className:o.root({className:d.className}),"data-slot":r("root"),"data-component":r("checkbox"),"data-checked":s(n||c),"data-focus-visible":s(C),"data-pressed":s(k),"data-hovered":s(u),"data-disabled":s(t),"aria-disabled":s(t),"data-invalid":s(h)}),[d,n,t,C,u,c,k,h,o]),x=a(e=>({onChange:l,...S(e,H,{onChange:l}),disabled:t,"aria-disabled":s(t),ref:P,type:"checkbox","data-slot":r("input"),className:o.input({className:e.className})}),[l,t,P,o]),g=a(e=>({...e,"data-slot":r("content"),className:o.content({className:e.className})}),[o]),N=a(e=>({...e,"data-slot":r("control"),className:o.control({className:e.className})}),[o]),I=a(e=>({...e,"data-slot":r("indicator"),className:o.indicator({className:e.className})}),[o]);return E(()=>({getRootProps:f,getInputProps:x,getContentProps:g,getControlProps:N,getIndicatorProps:I,onCheckedChange:i,defaultChecked:p,isChecked:n,isIntermediate:c}),[p,g,x,f,N,I,n,c,i])};export{J as useCheckbox};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamsrui/checkbox",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",
@@ -16,11 +16,11 @@
16
16
  "react": ">=19"
17
17
  },
18
18
  "dependencies": {
19
- "@jamsrui/context": "^0.0.3",
20
- "@jamsrui/core": "^0.0.12",
21
- "@jamsrui/hooks": "^0.0.14",
22
- "@jamsrui/slot": "^0.0.13",
23
- "@jamsrui/utils": "^0.0.14"
19
+ "@jamsrui/context": "^0.0.4",
20
+ "@jamsrui/utils": "^0.0.15",
21
+ "@jamsrui/hooks": "^0.0.15",
22
+ "@jamsrui/core": "^0.0.13",
23
+ "@jamsrui/slot": "^0.0.14"
24
24
  },
25
25
  "description": "A modern and beautiful Next.js UI components library.",
26
26
  "keywords": [