@jamsrui/checkbox 0.0.16 → 0.0.18
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/checkbox-config.d.mts +2 -2
- package/dist/checkbox-config.mjs +1 -1
- package/dist/checkbox-context.mjs +1 -1
- package/dist/checkbox-input.mjs +1 -1
- package/dist/checkbox.mjs +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +1 -1
- package/dist/use-checkbox.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { WithGlobalConfig } from '@jamsrui/core';
|
|
3
3
|
import { Checkbox } from './checkbox.mjs';
|
|
4
4
|
import './use-checkbox.mjs';
|
|
5
5
|
import '@jamsrui/utils';
|
|
@@ -17,7 +17,7 @@ declare const CheckboxConfig: (props: Omit<Partial<CheckboxConfig.Props>, "child
|
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
}) => react_jsx_runtime.JSX.Element;
|
|
19
19
|
declare namespace CheckboxConfig {
|
|
20
|
-
interface Props extends
|
|
20
|
+
interface Props extends WithGlobalConfig<Checkbox.Props> {
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
package/dist/checkbox-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[
|
|
1
|
+
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[i,t]=o({displayName:"CheckboxConfig"});export{i as CheckboxConfig,t as useCheckboxConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t,use as o}from"react";const x=t(null),r=()=>{const e=o(x);if(!e)throw new Error("useCheckboxContext must be used within a CheckboxContext");return e};export{x as CheckboxContext,r as useCheckboxContext};
|
|
1
|
+
"use client";import{createContext as t,use as o}from"react";const x=t(null),r=()=>{const e=o(x);if(!e)throw new Error("useCheckboxContext must be used within a CheckboxContext");return e};export{x as CheckboxContext,r as useCheckboxContext};
|
package/dist/checkbox-input.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useFieldA11yContext as r}from"@jamsrui/context";import{useRenderElement as
|
|
1
|
+
"use client";import{useFieldA11yContext as r}from"@jamsrui/context";import{useRenderElement as n}from"@jamsrui/hooks";import{useCheckboxContext as p}from"./checkbox-context.mjs";const c=e=>{const{getInputProps:t}=p(),o=r();return n("input",{props:[o?.getInputProps()??{},t(e)]})};export{c as CheckboxInput};
|
package/dist/checkbox.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{FieldA11yContext as n,useFieldA11y as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{FieldA11yContext as n,useFieldA11y as i}from"@jamsrui/context";import{mergeConfigProps as s}from"@jamsrui/utils";import{useCheckboxConfig as C}from"./checkbox-config.mjs";import{CheckboxContext as m}from"./checkbox-context.mjs";import{CheckboxRoot as p}from"./checkbox-root.mjs";import{checkboxVariants as f}from"./styles.mjs";import{useCheckbox as h}from"./use-checkbox.mjs";const P=e=>{const t=C(),r=s(f.defaultVariants,t,e),c=h(r),x=i();return o(m,{value:c,children:o(n,{value:x,children:o(p,{children:e.children})})})};export{P as Checkbox};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { Checkbox as Checkbox$1 } from './checkbox.mjs';
|
|
4
|
+
import { CheckboxConfig } from './checkbox-config.mjs';
|
|
5
|
+
export { useCheckboxConfig } from './checkbox-config.mjs';
|
|
4
6
|
import { CheckboxContent } from './checkbox-content.mjs';
|
|
5
7
|
import { CheckboxControl } from './checkbox-control.mjs';
|
|
6
8
|
import { CheckboxIndicator } from './checkbox-indicator.mjs';
|
|
7
|
-
export {
|
|
8
|
-
import '
|
|
9
|
+
export { useCheckbox } from './use-checkbox.mjs';
|
|
10
|
+
import '@jamsrui/core';
|
|
9
11
|
import '@jamsrui/utils';
|
|
10
12
|
import './checkbox-input.mjs';
|
|
11
13
|
import './checkbox-root.mjs';
|
|
12
14
|
import './styles.mjs';
|
|
13
|
-
import '@jamsrui/core';
|
|
14
15
|
|
|
15
|
-
type CheckboxProps = Checkbox$1.Props;
|
|
16
16
|
declare const Checkbox: ((props: Checkbox$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
17
17
|
Root: (props: Checkbox$1.Props) => react_jsx_runtime.JSX.Element;
|
|
18
18
|
Control: (props: CheckboxControl.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
@@ -22,6 +22,8 @@ declare const Checkbox: ((props: Checkbox$1.Props) => react_jsx_runtime.JSX.Elem
|
|
|
22
22
|
declare namespace Checkbox {
|
|
23
23
|
interface Props extends Checkbox$1.Props {
|
|
24
24
|
}
|
|
25
|
+
interface Config extends CheckboxConfig.Props {
|
|
26
|
+
}
|
|
25
27
|
interface Control extends CheckboxControl.Props {
|
|
26
28
|
}
|
|
27
29
|
interface Indicator extends CheckboxIndicator.Props {
|
|
@@ -30,4 +32,4 @@ declare namespace Checkbox {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
export { Checkbox,
|
|
35
|
+
export { Checkbox, CheckboxConfig, CheckboxContent, CheckboxControl, CheckboxIndicator };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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{
|
|
1
|
+
import{Checkbox as o}from"./checkbox.mjs";import{CheckboxConfig as n,useCheckboxConfig as x}from"./checkbox-config.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{useCheckbox as c}from"./use-checkbox.mjs";const h=Object.assign(o,{Root:o,Control:t,Indicator:r,Content:e});export{h as Checkbox,n as CheckboxConfig,e as CheckboxContent,t as CheckboxControl,r as CheckboxIndicator,c as useCheckbox,x as useCheckboxConfig};
|
package/dist/use-checkbox.mjs
CHANGED
|
@@ -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),{checked:V,onCheckedChange:i,defaultChecked:p,isIntermediate:c,disabled:G=!1,inputProps:H,...
|
|
1
|
+
"use client";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,...l}=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]),d=a(e=>{b(e.target.checked)},[b]),f=a(()=>({...l,className:o.root({className:l.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)}),[l,n,t,C,u,c,k,h,o]),x=a(e=>({onChange:d,...S(e,H,{onChange:d}),disabled:t,"aria-disabled":s(t),ref:P,type:"checkbox","data-slot":r("input"),className:o.input({className:e.className})}),[d,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.
|
|
3
|
+
"version": "0.0.18",
|
|
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.
|
|
20
|
-
"@jamsrui/
|
|
21
|
-
"@jamsrui/
|
|
22
|
-
"@jamsrui/
|
|
23
|
-
"@jamsrui/
|
|
19
|
+
"@jamsrui/context": "^0.0.6",
|
|
20
|
+
"@jamsrui/hooks": "^0.0.17",
|
|
21
|
+
"@jamsrui/core": "^0.0.14",
|
|
22
|
+
"@jamsrui/slot": "^0.0.15",
|
|
23
|
+
"@jamsrui/utils": "^0.0.17"
|
|
24
24
|
},
|
|
25
25
|
"description": "A modern and beautiful Next.js UI components library.",
|
|
26
26
|
"keywords": [
|