@cdx-ui/primitives 0.0.1-alpha.1 → 0.0.1-alpha.10
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/lib/commonjs/button/createButtonRoot.js +3 -3
- package/lib/commonjs/button/createButtonRoot.js.map +1 -1
- package/lib/commonjs/checkbox/context.js +14 -0
- package/lib/commonjs/checkbox/context.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxGroup.js +44 -0
- package/lib/commonjs/checkbox/createCheckboxGroup.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxIcon.js +28 -0
- package/lib/commonjs/checkbox/createCheckboxIcon.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxIndicator.js +47 -0
- package/lib/commonjs/checkbox/createCheckboxIndicator.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxLabel.js +46 -0
- package/lib/commonjs/checkbox/createCheckboxLabel.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxRoot.js +99 -0
- package/lib/commonjs/checkbox/createCheckboxRoot.js.map +1 -0
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js +88 -0
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +1 -0
- package/lib/commonjs/checkbox/index.js +32 -0
- package/lib/commonjs/checkbox/index.js.map +1 -0
- package/lib/commonjs/checkbox/types.js +6 -0
- package/lib/commonjs/checkbox/types.js.map +1 -0
- package/lib/commonjs/checkbox/useCheckboxRoot.js +82 -0
- package/lib/commonjs/checkbox/useCheckboxRoot.js.map +1 -0
- package/lib/commonjs/index.js +25 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/switch/createSwitchRoot.js +73 -0
- package/lib/commonjs/switch/createSwitchRoot.js.map +1 -0
- package/lib/commonjs/switch/index.js +15 -0
- package/lib/commonjs/switch/index.js.map +1 -0
- package/lib/commonjs/switch/types.js +6 -0
- package/lib/commonjs/switch/types.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/button/createButtonRoot.js +3 -3
- package/lib/module/button/createButtonRoot.js.map +1 -1
- package/lib/module/checkbox/context.js +7 -0
- package/lib/module/checkbox/context.js.map +1 -0
- package/lib/module/checkbox/createCheckboxGroup.js +39 -0
- package/lib/module/checkbox/createCheckboxGroup.js.map +1 -0
- package/lib/module/checkbox/createCheckboxIcon.js +23 -0
- package/lib/module/checkbox/createCheckboxIcon.js.map +1 -0
- package/lib/module/checkbox/createCheckboxIndicator.js +42 -0
- package/lib/module/checkbox/createCheckboxIndicator.js.map +1 -0
- package/lib/module/checkbox/createCheckboxLabel.js +41 -0
- package/lib/module/checkbox/createCheckboxLabel.js.map +1 -0
- package/lib/module/checkbox/createCheckboxRoot.js +94 -0
- package/lib/module/checkbox/createCheckboxRoot.js.map +1 -0
- package/lib/module/checkbox/createCheckboxRoot.web.js +83 -0
- package/lib/module/checkbox/createCheckboxRoot.web.js.map +1 -0
- package/lib/module/checkbox/index.js +27 -0
- package/lib/module/checkbox/index.js.map +1 -0
- package/lib/module/checkbox/types.js +4 -0
- package/lib/module/checkbox/types.js.map +1 -0
- package/lib/module/checkbox/useCheckboxRoot.js +78 -0
- package/lib/module/checkbox/useCheckboxRoot.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/switch/createSwitchRoot.js +67 -0
- package/lib/module/switch/createSwitchRoot.js.map +1 -0
- package/lib/module/switch/index.js +11 -0
- package/lib/module/switch/index.js.map +1 -0
- package/lib/module/switch/types.js +4 -0
- package/lib/module/switch/types.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/button/context.d.ts +1 -1
- package/lib/typescript/button/context.d.ts.map +1 -1
- package/lib/typescript/button/createButtonRoot.d.ts +1 -1
- package/lib/typescript/button/createButtonRoot.d.ts.map +1 -1
- package/lib/typescript/button/types.d.ts +0 -7
- package/lib/typescript/button/types.d.ts.map +1 -1
- package/lib/typescript/checkbox/context.d.ts +18 -0
- package/lib/typescript/checkbox/context.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxGroup.d.ts +3 -0
- package/lib/typescript/checkbox/createCheckboxGroup.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxIcon.d.ts +3 -0
- package/lib/typescript/checkbox/createCheckboxIcon.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxIndicator.d.ts +5 -0
- package/lib/typescript/checkbox/createCheckboxIndicator.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxLabel.d.ts +5 -0
- package/lib/typescript/checkbox/createCheckboxLabel.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxRoot.d.ts +2 -0
- package/lib/typescript/checkbox/createCheckboxRoot.d.ts.map +1 -0
- package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +2 -0
- package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +1 -0
- package/lib/typescript/checkbox/index.d.ts +10 -0
- package/lib/typescript/checkbox/index.d.ts.map +1 -0
- package/lib/typescript/checkbox/types.d.ts +57 -0
- package/lib/typescript/checkbox/types.d.ts.map +1 -0
- package/lib/typescript/checkbox/useCheckboxRoot.d.ts +147 -0
- package/lib/typescript/checkbox/useCheckboxRoot.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/select/types.d.ts +2 -7
- package/lib/typescript/select/types.d.ts.map +1 -1
- package/lib/typescript/switch/createSwitchRoot.d.ts +3 -0
- package/lib/typescript/switch/createSwitchRoot.d.ts.map +1 -0
- package/lib/typescript/switch/index.d.ts +7 -0
- package/lib/typescript/switch/index.d.ts.map +1 -0
- package/lib/typescript/switch/types.d.ts +38 -0
- package/lib/typescript/switch/types.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +8 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/package.json +12 -9
- package/src/button/context.tsx +1 -1
- package/src/button/createButtonRoot.tsx +5 -4
- package/src/button/types.ts +0 -8
- package/src/checkbox/context.tsx +18 -0
- package/src/checkbox/createCheckboxGroup.tsx +32 -0
- package/src/checkbox/createCheckboxIcon.tsx +18 -0
- package/src/checkbox/createCheckboxIndicator.tsx +43 -0
- package/src/checkbox/createCheckboxLabel.tsx +42 -0
- package/src/checkbox/createCheckboxRoot.tsx +100 -0
- package/src/checkbox/createCheckboxRoot.web.tsx +77 -0
- package/src/checkbox/index.ts +43 -0
- package/src/checkbox/types.ts +74 -0
- package/src/checkbox/useCheckboxRoot.ts +85 -0
- package/src/index.ts +4 -1
- package/src/select/types.ts +2 -10
- package/src/switch/createSwitchRoot.tsx +72 -0
- package/src/switch/index.ts +16 -0
- package/src/switch/types.ts +42 -0
- package/src/types.ts +7 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useContext, useRef } from 'react';
|
|
4
|
+
import { mergeRefs, useFormControlContext } from '@cdx-ui/utils';
|
|
5
|
+
import { useCheckbox } from '@react-native-aria/checkbox';
|
|
6
|
+
import { useHover } from '@react-native-aria/interactions';
|
|
7
|
+
import { useToggleState } from '@react-stately/toggle';
|
|
8
|
+
import { CheckboxGroupContext } from './context';
|
|
9
|
+
export function useCheckboxRoot(props, ref, {
|
|
10
|
+
useInputRefForAria = false
|
|
11
|
+
} = {}) {
|
|
12
|
+
const formControlContext = useFormControlContext();
|
|
13
|
+
const {
|
|
14
|
+
isInvalid,
|
|
15
|
+
isReadOnly,
|
|
16
|
+
isIndeterminate,
|
|
17
|
+
...combinedProps
|
|
18
|
+
} = {
|
|
19
|
+
...formControlContext,
|
|
20
|
+
...props
|
|
21
|
+
};
|
|
22
|
+
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
23
|
+
const state = useToggleState({
|
|
24
|
+
...combinedProps,
|
|
25
|
+
defaultSelected: props.defaultIsChecked,
|
|
26
|
+
isSelected: props.isChecked
|
|
27
|
+
});
|
|
28
|
+
const rootRef = useRef(null);
|
|
29
|
+
const inputRef = useRef(null);
|
|
30
|
+
const mergedRootRef = mergeRefs(ref, rootRef);
|
|
31
|
+
const ariaLabel = combinedProps['aria-label'] || combinedProps.value || 'Checkbox';
|
|
32
|
+
const groupToggleState = useToggleState(checkboxGroupContext ? {
|
|
33
|
+
isReadOnly: isReadOnly || checkboxGroupContext.state.isReadOnly,
|
|
34
|
+
isSelected: checkboxGroupContext.state.isSelected(combinedProps.value),
|
|
35
|
+
onChange(isSelected) {
|
|
36
|
+
if (isSelected) {
|
|
37
|
+
checkboxGroupContext.state.addValue(combinedProps.value);
|
|
38
|
+
} else {
|
|
39
|
+
checkboxGroupContext.state.removeValue(combinedProps.value);
|
|
40
|
+
}
|
|
41
|
+
combinedProps.onChange?.(isSelected);
|
|
42
|
+
}
|
|
43
|
+
} : {
|
|
44
|
+
isSelected: false
|
|
45
|
+
});
|
|
46
|
+
const {
|
|
47
|
+
inputProps: groupItemInputProps
|
|
48
|
+
} = useCheckbox({
|
|
49
|
+
...combinedProps,
|
|
50
|
+
'aria-label': ariaLabel,
|
|
51
|
+
...(checkboxGroupContext && {
|
|
52
|
+
isReadOnly: isReadOnly || checkboxGroupContext.state.isReadOnly,
|
|
53
|
+
isDisabled: combinedProps.isDisabled || checkboxGroupContext.state.isDisabled
|
|
54
|
+
})
|
|
55
|
+
}, checkboxGroupContext ? groupToggleState : state, useInputRefForAria ? inputRef : rootRef);
|
|
56
|
+
const {
|
|
57
|
+
checked: isChecked,
|
|
58
|
+
disabled: isDisabled
|
|
59
|
+
} = groupItemInputProps;
|
|
60
|
+
const {
|
|
61
|
+
hoverProps,
|
|
62
|
+
isHovered
|
|
63
|
+
} = useHover({}, rootRef);
|
|
64
|
+
return {
|
|
65
|
+
combinedProps,
|
|
66
|
+
isInvalid,
|
|
67
|
+
isReadOnly,
|
|
68
|
+
isIndeterminate,
|
|
69
|
+
groupItemInputProps,
|
|
70
|
+
isChecked,
|
|
71
|
+
isDisabled,
|
|
72
|
+
isHovered,
|
|
73
|
+
hoverProps,
|
|
74
|
+
mergedRef: mergedRootRef,
|
|
75
|
+
inputRef
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=useCheckboxRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","useRef","mergeRefs","useFormControlContext","useCheckbox","useHover","useToggleState","CheckboxGroupContext","useCheckboxRoot","props","ref","useInputRefForAria","formControlContext","isInvalid","isReadOnly","isIndeterminate","combinedProps","checkboxGroupContext","state","defaultSelected","defaultIsChecked","isSelected","isChecked","rootRef","inputRef","mergedRootRef","ariaLabel","value","groupToggleState","onChange","addValue","removeValue","inputProps","groupItemInputProps","isDisabled","checked","disabled","hoverProps","isHovered","mergedRef"],"sourceRoot":"../../../src","sources":["checkbox/useCheckboxRoot.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,OAAO;AAC1C,SAASC,SAAS,EAAEC,qBAAqB,QAAQ,eAAe;AAChE,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,QAAQ,QAAQ,iCAAiC;AAC1D,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,oBAAoB,QAAQ,WAAW;AAOhD,OAAO,SAASC,eAAeA,CAC7BC,KAAqB,EACrBC,GAAwB,EACxB;EAAEC,kBAAkB,GAAG;AAA8B,CAAC,GAAG,CAAC,CAAC,EAC3D;EACA,MAAMC,kBAAkB,GAAGT,qBAAqB,CAAC,CAAC;EAElD,MAAM;IAAEU,SAAS;IAAEC,UAAU;IAAEC,eAAe;IAAE,GAAGC;EAAc,CAAC,GAAG;IACnE,GAAGJ,kBAAkB;IACrB,GAAGH;EACL,CAAC;EAED,MAAMQ,oBAAoB,GAAGjB,UAAU,CAACO,oBAAoB,CAAC;EAE7D,MAAMW,KAAK,GAAGZ,cAAc,CAAC;IAC3B,GAAGU,aAAa;IAChBG,eAAe,EAAEV,KAAK,CAACW,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AAGa,QAAQ,GAAGD,OACnC,CAAC;EAED,MAAM;IAAEY,OAAO,EAAEb,SAAS;IAAEc,QAAQ,EAAEF;EAAW,CAAC,GAAGD,mBAAmB;EAExE,MAAM;IAAEI,UAAU;IAAEC;EAAU,CAAC,GAAGjC,QAAQ,CAAC,CAAC,CAAC,EAAEkB,OAAO,CAAC;EAEvD,OAAO;IACLP,aAAa;IACbH,SAAS;IACTC,UAAU;IACVC,eAAe;IACfkB,mBAAmB;IACnBX,SAAS;IACTY,UAAU;IACVI,SAAS;IACTD,UAAU;IACVE,SAAS,EAAEd,aAAa;IACxBD;EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export * from './button';
|
|
4
|
+
export * from './checkbox';
|
|
4
5
|
export * from './input';
|
|
5
|
-
export * from './select';
|
|
6
6
|
export { OverlayInsetsProvider } from './overlay';
|
|
7
|
+
export * from './select';
|
|
8
|
+
export * from './switch';
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OverlayInsetsProvider"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,
|
|
1
|
+
{"version":3,"names":["OverlayInsetsProvider"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,SAA0BA,qBAAqB,QAAQ,WAAW;AAClE,cAAc,UAAU;AACxB,cAAc,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import { useFocusRing } from '@react-native-aria/focus';
|
|
5
|
+
import { useHover } from '@react-native-aria/interactions';
|
|
6
|
+
import { useToggleState } from '@react-stately/toggle';
|
|
7
|
+
import { useFormControlContext, mergeRefs } from '@cdx-ui/utils';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export const createSwitchRoot = BaseSwitch => /*#__PURE__*/forwardRef(({
|
|
10
|
+
disabled,
|
|
11
|
+
isDisabled,
|
|
12
|
+
isChecked,
|
|
13
|
+
isInvalid,
|
|
14
|
+
defaultValue,
|
|
15
|
+
value,
|
|
16
|
+
onValueChange,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const formControlContext = useFormControlContext();
|
|
20
|
+
const combinedProps = {
|
|
21
|
+
...formControlContext,
|
|
22
|
+
...props
|
|
23
|
+
};
|
|
24
|
+
const controlledValue = value ?? isChecked;
|
|
25
|
+
const state = useToggleState({
|
|
26
|
+
defaultSelected: defaultValue ?? false,
|
|
27
|
+
isSelected: controlledValue,
|
|
28
|
+
onChange: onValueChange
|
|
29
|
+
});
|
|
30
|
+
const checked = controlledValue ?? state.isSelected;
|
|
31
|
+
const _ref = React.useRef(null);
|
|
32
|
+
const {
|
|
33
|
+
isHovered
|
|
34
|
+
} = useHover({}, _ref);
|
|
35
|
+
const {
|
|
36
|
+
isFocusVisible,
|
|
37
|
+
focusProps
|
|
38
|
+
} = useFocusRing();
|
|
39
|
+
const mergedRef = mergeRefs(ref, _ref);
|
|
40
|
+
const isDisabledResolved = disabled || isDisabled || combinedProps.isDisabled;
|
|
41
|
+
const isInvalidResolved = isInvalid || combinedProps.isInvalid;
|
|
42
|
+
return /*#__PURE__*/_jsx(BaseSwitch, {
|
|
43
|
+
states: {
|
|
44
|
+
hover: isHovered,
|
|
45
|
+
disabled: isDisabledResolved,
|
|
46
|
+
invalid: isInvalidResolved,
|
|
47
|
+
checked,
|
|
48
|
+
focusVisible: isFocusVisible
|
|
49
|
+
},
|
|
50
|
+
dataSet: {
|
|
51
|
+
hover: isHovered ? 'true' : 'false',
|
|
52
|
+
disabled: isDisabledResolved ? 'true' : 'false',
|
|
53
|
+
invalid: isInvalidResolved ? 'true' : 'false',
|
|
54
|
+
checked: checked ? 'true' : 'false',
|
|
55
|
+
'focus-visible': isFocusVisible ? 'true' : 'false'
|
|
56
|
+
},
|
|
57
|
+
disabled: isDisabledResolved,
|
|
58
|
+
...focusProps,
|
|
59
|
+
onValueChange: val => {
|
|
60
|
+
state.setSelected(val);
|
|
61
|
+
},
|
|
62
|
+
value: checked,
|
|
63
|
+
...combinedProps,
|
|
64
|
+
ref: mergedRef
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=createSwitchRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useFocusRing","useHover","useToggleState","useFormControlContext","mergeRefs","jsx","_jsx","createSwitchRoot","BaseSwitch","disabled","isDisabled","isChecked","isInvalid","defaultValue","value","onValueChange","props","ref","formControlContext","combinedProps","controlledValue","state","defaultSelected","isSelected","onChange","checked","_ref","useRef","isHovered","isFocusVisible","focusProps","mergedRef","isDisabledResolved","isInvalidResolved","states","hover","invalid","focusVisible","dataSet","val","setSelected"],"sourceRoot":"../../../src","sources":["switch/createSwitchRoot.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,QAAQ,QAAQ,iCAAiC;AAC1D,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,qBAAqB,EAAEC,SAAS,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKjE,OAAO,MAAMC,gBAAgB,GAAoBC,UAAkC,iBACjFT,UAAU,CACR,CACE;EACEU,QAAQ;EACRC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,YAAY;EACZC,KAAK;EACLC,aAAa;EACb,GAAGC;AACS,CAAC,EACfC,GAA0B,KACvB;EACH,MAAMC,kBAAkB,GAAGf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AG;IAC7C,CAAE;IACFpB,QAAQ,EAAEuB,kBAAmB;IAAA,GACzBF,UAAU;IACdf,aAAa,EAAGwB,GAAY,IAAK;MAC/BlB,KAAK,CAACmB,WAAW,CAACD,GAAG,CAAC;IACxB,CAAE;IACFzB,KAAK,EAAEW,OAAQ;IAAA,GACVN,aAAa;IAClBF,GAAG,EAAEc;EAA0B,CAChC,CAAC;AAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSwitchRoot","createSwitch","Root","Switch","displayName"],"sourceRoot":"../../../src","sources":["switch/index.ts"],"mappings":";;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AAKrD,OAAO,SAASC,YAAYA,CAAiB;EAC3CC;AAGF,CAAC,EAA8B;EAC7B,MAAMC,MAAM,GAAGH,gBAAgB,CAACE,IAAI,CAAC;EAErCC,MAAM,CAACC,WAAW,GAAG,QAAQ;EAC7B,OAAOD,MAAM;AACf","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["switch/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/button/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/button/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAO,cAAc;;;IAAE,gBAAgB,wBAAoD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { InteractionState } from '
|
|
2
|
+
import type { InteractionState } from '../types';
|
|
3
3
|
export declare const createButtonRoot: <T>(BaseButton: React.ComponentType<T>) => React.ForwardRefExoticComponent<Omit<import("./types").InterfaceButtonProps, "children"> & {
|
|
4
4
|
children?: ((state: InteractionState) => React.ReactNode) | React.ReactNode;
|
|
5
5
|
} & React.RefAttributes<T>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createButtonRoot.d.ts","sourceRoot":"","sources":["../../../src/button/createButtonRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"createButtonRoot.d.ts","sourceRoot":"","sources":["../../../src/button/createButtonRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAKjD,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,YAAY,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;eAYpD,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS;2BA+EhF,CAAC"}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { PropsWithoutRef, ReactElement, ReactNode, RefAttributes } from 'react';
|
|
2
2
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
-
export interface InteractionState {
|
|
4
|
-
hover: boolean;
|
|
5
|
-
focus: boolean;
|
|
6
|
-
active: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
focusVisible: boolean;
|
|
9
|
-
}
|
|
10
3
|
export interface InterfaceButtonProps extends PressableProps {
|
|
11
4
|
/**
|
|
12
5
|
* If true, the button will be in hovered state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/button/types.ts"],"names":[],"mappings":"AAAA,O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AY,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,CACvE,GAAG;IACF,KAAK,EAAE,KAAK,CAAC,yBAAyB,CACpC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,UAAU,GAAG,iBAAiB,CAAC,CACzE,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,yBAAyB,CACtC,eAAe,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAC7D,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACjG,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;CAClG,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS;CAAG;AAEzD,MAAM,MAAM,YAAY,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ICheckboxContextValue } from './types';
|
|
3
|
+
export declare const CheckboxProvider: import("react").FunctionComponent<{
|
|
4
|
+
children: import("react").ReactNode;
|
|
5
|
+
value: ICheckboxContextValue;
|
|
6
|
+
}>, useCheckboxContext: () => ICheckboxContextValue;
|
|
7
|
+
interface ICheckboxGroupState {
|
|
8
|
+
isReadOnly: boolean;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
isSelected: (value: string) => boolean;
|
|
11
|
+
addValue: (value: string) => void;
|
|
12
|
+
removeValue: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const CheckboxGroupContext: React.Context<{
|
|
15
|
+
state: ICheckboxGroupState;
|
|
16
|
+
} | null>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/checkbox/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAO,gBAAgB;;;IAAE,kBAAkB,6BACO,CAAC;AAE1D,UAAU,mBAAmB;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,oBAAoB;WACxB,mBAAmB;SACb,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ICheckboxGroupProps } from './types';
|
|
2
|
+
export declare const createCheckboxGroup: <T>(BaseCheckboxGroup: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<ICheckboxGroupProps & import("react").RefAttributes<T>>;
|
|
3
|
+
//# sourceMappingURL=createCheckboxGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxGroup.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,mBAAmB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sGAwB7E,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ICheckboxIconProps } from './types';
|
|
2
|
+
export declare const createCheckboxIcon: <T>(BaseCheckboxIcon: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<ICheckboxIconProps & import("react").RefAttributes<unknown>>;
|
|
3
|
+
//# sourceMappingURL=createCheckboxIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxIcon.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,2GAa3E,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ICheckboxIndicatorProps } from './types';
|
|
2
|
+
export declare const createCheckboxIndicator: <T>(BaseCheckboxIndicator: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<ICheckboxIndicatorProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
} & import("react").RefAttributes<unknown>>;
|
|
5
|
+
//# sourceMappingURL=createCheckboxIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxIndicator.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxIndicator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAG,uBAAuB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;gBAC3B,MAAM;2CAoCjE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ICheckboxLabelProps } from './types';
|
|
2
|
+
export declare const createCheckboxLabel: <T>(BaseCheckboxLabel: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<ICheckboxLabelProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
} & import("react").RefAttributes<unknown>>;
|
|
5
|
+
//# sourceMappingURL=createCheckboxLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxLabel.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,mBAAmB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;gBACvB,MAAM;2CAmC7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxRoot.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxRoot.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAG,cAAc,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sHA0FxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckboxRoot.web.d.ts","sourceRoot":"","sources":["../../../src/checkbox/createCheckboxRoot.web.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAG,cAAc,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sHAoEvE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ICheckboxComponentType } from './types';
|
|
2
|
+
export type { ICheckboxComponentType, ICheckboxGroupProps, ICheckboxIconProps, ICheckboxIndicatorProps, ICheckboxLabelProps, ICheckboxProps, } from './types';
|
|
3
|
+
export declare const createCheckbox: <Root, Indicator, Icon, Label, Group>({ Root, Indicator, Icon, Label, Group, }: {
|
|
4
|
+
Root: React.ComponentType<Root>;
|
|
5
|
+
Indicator: React.ComponentType<Indicator>;
|
|
6
|
+
Icon: React.ComponentType<Icon>;
|
|
7
|
+
Label: React.ComponentType<Label>;
|
|
8
|
+
Group: React.ComponentType<Group>;
|
|
9
|
+
}) => ICheckboxComponentType<Root, Indicator, Icon, Label, Group>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,cAAc,GAAI,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,0CAMjE;IACD,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACnC,KAaoB,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAC9E,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PressableProps } from 'react-native';
|
|
2
|
+
export interface InterfaceCheckbox extends PressableProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange?: (isSelected: boolean) => void;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
defaultIsChecked?: boolean;
|
|
7
|
+
isChecked?: boolean;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
isInvalid?: boolean;
|
|
10
|
+
isReadOnly?: boolean;
|
|
11
|
+
isHovered?: boolean;
|
|
12
|
+
isFocused?: boolean;
|
|
13
|
+
isPressed?: boolean;
|
|
14
|
+
isRequired?: boolean;
|
|
15
|
+
isIndeterminate?: boolean;
|
|
16
|
+
isFocusVisible?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ICheckboxGroupProps {
|
|
19
|
+
value: string[];
|
|
20
|
+
onChange?: (values: string[]) => void;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
isDisabled?: boolean;
|
|
23
|
+
isInvalid?: boolean;
|
|
24
|
+
isReadOnly?: boolean;
|
|
25
|
+
isRequired?: boolean;
|
|
26
|
+
'aria-label'?: string;
|
|
27
|
+
}
|
|
28
|
+
export type ICheckboxComponentType<Root, Indicator, Icon, Label, Group> = React.ForwardRefExoticComponent<React.RefAttributes<Root> & React.PropsWithoutRef<Root> & InterfaceCheckbox> & {
|
|
29
|
+
Indicator: React.ForwardRefExoticComponent<React.RefAttributes<Indicator> & React.PropsWithoutRef<Indicator> & ICheckboxIndicatorProps>;
|
|
30
|
+
Icon: React.ForwardRefExoticComponent<React.RefAttributes<Icon> & React.PropsWithoutRef<Icon> & ICheckboxIconProps>;
|
|
31
|
+
Label: React.ForwardRefExoticComponent<React.RefAttributes<Label> & React.PropsWithoutRef<Label> & ICheckboxLabelProps>;
|
|
32
|
+
Group: React.ForwardRefExoticComponent<React.RefAttributes<Group> & React.PropsWithoutRef<Group> & ICheckboxGroupProps>;
|
|
33
|
+
};
|
|
34
|
+
export interface ICheckboxIndicatorProps {
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export interface ICheckboxIconProps {
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
/** Render the icon even when unchecked */
|
|
40
|
+
forceMount?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ICheckboxLabelProps {
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
export type ICheckboxProps = InterfaceCheckbox;
|
|
46
|
+
export interface ICheckboxContextValue {
|
|
47
|
+
isChecked?: boolean;
|
|
48
|
+
isDisabled?: boolean;
|
|
49
|
+
isHovered?: boolean;
|
|
50
|
+
isInvalid?: boolean;
|
|
51
|
+
isReadOnly?: boolean;
|
|
52
|
+
isPressed?: boolean;
|
|
53
|
+
isFocused?: boolean;
|
|
54
|
+
isIndeterminate?: boolean;
|
|
55
|
+
isFocusVisible?: boolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC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KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { ICheckboxProps } from './types';
|
|
2
|
+
interface UseCheckboxRootOptions {
|
|
3
|
+
useInputRefForAria?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useCheckboxRoot(props: ICheckboxProps, ref?: React.Ref<unknown>, { useInputRefForAria }?: UseCheckboxRootOptions): {
|
|
6
|
+
combinedProps: {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange?: (isSelected: boolean) => void;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
defaultIsChecked?: boolean;
|
|
11
|
+
isChecked?: boolean;
|
|
12
|
+
isDisabled?: boolean | undefined;
|
|
13
|
+
isHovered?: boolean;
|
|
14
|
+
isFocused?: boolean;
|
|
15
|
+
isPressed?: boolean;
|
|
16
|
+
isRequired?: boolean | undefined;
|
|
17
|
+
isFocusVisible?: boolean;
|
|
18
|
+
onHoverIn?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
|
|
19
|
+
onHoverOut?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
|
|
20
|
+
onPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
21
|
+
onPressIn?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
22
|
+
onPressOut?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
23
|
+
onLongPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
24
|
+
onBlur?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
|
|
25
|
+
onFocus?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
|
|
26
|
+
cancelable?: null | boolean | undefined;
|
|
27
|
+
delayHoverIn?: number | null | undefined;
|
|
28
|
+
delayHoverOut?: number | null | undefined;
|
|
29
|
+
delayLongPress?: null | number | undefined;
|
|
30
|
+
disabled?: null | boolean | undefined;
|
|
31
|
+
hitSlop?: null | import("react-native").Insets | number | undefined;
|
|
32
|
+
pressRetentionOffset?: null | import("react-native").Insets | number | undefined;
|
|
33
|
+
android_disableSound?: null | boolean | undefined;
|
|
34
|
+
android_ripple?: null | import("react-native").PressableAndroidRippleConfig | undefined;
|
|
35
|
+
testOnly_pressed?: null | boolean | undefined;
|
|
36
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle> | ((state: import("react-native").PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").ViewStyle>) | undefined;
|
|
37
|
+
unstable_pressDelay?: number | undefined;
|
|
38
|
+
accessible?: boolean | undefined;
|
|
39
|
+
accessibilityActions?: ReadonlyArray<import("react-native").AccessibilityActionInfo> | undefined;
|
|
40
|
+
accessibilityLabel?: string | undefined;
|
|
41
|
+
'aria-label'?: string | undefined;
|
|
42
|
+
accessibilityRole?: import("react-native").AccessibilityRole | undefined;
|
|
43
|
+
accessibilityState?: import("react-native").AccessibilityState | undefined;
|
|
44
|
+
'aria-busy'?: boolean | undefined;
|
|
45
|
+
'aria-checked'?: boolean | "mixed" | undefined;
|
|
46
|
+
'aria-disabled'?: boolean | undefined;
|
|
47
|
+
'aria-expanded'?: boolean | undefined;
|
|
48
|
+
'aria-selected'?: boolean | undefined;
|
|
49
|
+
accessibilityHint?: string | undefined;
|
|
50
|
+
accessibilityValue?: import("react-native").AccessibilityValue | undefined;
|
|
51
|
+
'aria-valuemax'?: import("react-native").AccessibilityValue["max"] | undefined;
|
|
52
|
+
'aria-valuemin'?: import("react-native").AccessibilityValue["min"] | undefined;
|
|
53
|
+
'aria-valuenow'?: import("react-native").AccessibilityValue["now"] | undefined;
|
|
54
|
+
'aria-valuetext'?: import("react-native").AccessibilityValue["text"] | undefined;
|
|
55
|
+
onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
|
|
56
|
+
importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
|
|
57
|
+
'aria-hidden'?: boolean | undefined;
|
|
58
|
+
'aria-modal'?: boolean | undefined;
|
|
59
|
+
role?: import("react-native").Role | undefined;
|
|
60
|
+
accessibilityLabelledBy?: string | string[] | undefined;
|
|
61
|
+
'aria-labelledby'?: string | undefined;
|
|
62
|
+
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
63
|
+
'aria-live'?: ("polite" | "assertive" | "off") | undefined;
|
|
64
|
+
screenReaderFocusable?: boolean | undefined;
|
|
65
|
+
accessibilityElementsHidden?: boolean | undefined;
|
|
66
|
+
accessibilityViewIsModal?: boolean | undefined;
|
|
67
|
+
onAccessibilityEscape?: (() => void) | undefined;
|
|
68
|
+
onAccessibilityTap?: (() => void) | undefined;
|
|
69
|
+
onMagicTap?: (() => void) | undefined;
|
|
70
|
+
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
71
|
+
accessibilityLanguage?: string | undefined;
|
|
72
|
+
accessibilityShowsLargeContentViewer?: boolean | undefined;
|
|
73
|
+
accessibilityLargeContentTitle?: string | undefined;
|
|
74
|
+
accessibilityRespondsToUserInteraction?: boolean | undefined;
|
|
75
|
+
id?: string | undefined;
|
|
76
|
+
needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
|
|
77
|
+
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined | undefined;
|
|
78
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined | undefined;
|
|
79
|
+
removeClippedSubviews?: boolean | undefined | undefined;
|
|
80
|
+
testID?: string | undefined | undefined;
|
|
81
|
+
nativeID?: string | undefined | undefined;
|
|
82
|
+
collapsable?: boolean | undefined | undefined;
|
|
83
|
+
collapsableChildren?: boolean | undefined | undefined;
|
|
84
|
+
renderToHardwareTextureAndroid?: boolean | undefined | undefined;
|
|
85
|
+
focusable?: boolean | undefined | undefined;
|
|
86
|
+
tabIndex?: 0 | -1 | undefined | undefined;
|
|
87
|
+
shouldRasterizeIOS?: boolean | undefined | undefined;
|
|
88
|
+
isTVSelectable?: boolean | undefined | undefined;
|
|
89
|
+
hasTVPreferredFocus?: boolean | undefined | undefined;
|
|
90
|
+
tvParallaxShiftDistanceX?: number | undefined | undefined;
|
|
91
|
+
tvParallaxShiftDistanceY?: number | undefined | undefined;
|
|
92
|
+
tvParallaxTiltAngle?: number | undefined | undefined;
|
|
93
|
+
tvParallaxMagnification?: number | undefined | undefined;
|
|
94
|
+
onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
95
|
+
onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
96
|
+
onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
97
|
+
onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
98
|
+
onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
99
|
+
onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
100
|
+
onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
101
|
+
onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
102
|
+
onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
103
|
+
onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
104
|
+
onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
105
|
+
onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
106
|
+
onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
107
|
+
onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
108
|
+
onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
109
|
+
onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
110
|
+
onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
111
|
+
onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
112
|
+
onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
113
|
+
onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
114
|
+
onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
115
|
+
onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
116
|
+
onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
117
|
+
onPointerCancel?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
118
|
+
onPointerCancelCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
119
|
+
onPointerDown?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
120
|
+
onPointerDownCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
121
|
+
onPointerUp?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
122
|
+
onPointerUpCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
123
|
+
hasFeedbackText?: boolean | undefined;
|
|
124
|
+
hasHelpText?: boolean | undefined;
|
|
125
|
+
labelId?: string | undefined;
|
|
126
|
+
feedbackId?: string | undefined;
|
|
127
|
+
helpTextId?: string | undefined;
|
|
128
|
+
htmlProps?: {
|
|
129
|
+
[x: string]: unknown;
|
|
130
|
+
} | undefined;
|
|
131
|
+
};
|
|
132
|
+
isInvalid: boolean | undefined;
|
|
133
|
+
isReadOnly: boolean | undefined;
|
|
134
|
+
isIndeterminate: boolean | undefined;
|
|
135
|
+
groupItemInputProps: any;
|
|
136
|
+
isChecked: any;
|
|
137
|
+
isDisabled: any;
|
|
138
|
+
isHovered: boolean;
|
|
139
|
+
hoverProps: {
|
|
140
|
+
onHoverIn: () => void;
|
|
141
|
+
onHoverOut: () => void;
|
|
142
|
+
};
|
|
143
|
+
mergedRef: import("react").RefCallback<unknown>;
|
|
144
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
145
|
+
};
|
|
146
|
+
export {};
|
|
147
|
+
//# sourceMappingURL=useCheckboxRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCheckboxRoot.d.ts","sourceRoot":"","sources":["../../../src/checkbox/useCheckboxRoot.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU,sBAAsB;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EACxB,EAAE,kBAA0B,EAAE,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqE5D"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from './button';
|
|
2
|
+
export * from './checkbox';
|
|
2
3
|
export * from './input';
|
|
4
|
+
export { type EdgeInsets, OverlayInsetsProvider } from './overlay';
|
|
3
5
|
export * from './select';
|
|
4
|
-
export
|
|
6
|
+
export * from './switch';
|
|
7
|
+
export type { InteractionState } from './types';
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,KAAK,UAAU,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACnE,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import type { PropsWithoutRef, ReactNode, RefAttributes, RefObject } from 'react';
|
|
2
2
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
import type { EntryOrExitLayoutType } from 'react-native-reanimated';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
focus: boolean;
|
|
7
|
-
active: boolean;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
focusVisible: boolean;
|
|
10
|
-
}
|
|
4
|
+
import type { InteractionState } from '../types';
|
|
5
|
+
export type { InteractionState };
|
|
11
6
|
export interface SelectItemInteractionState extends InteractionState {
|
|
12
7
|
highlighted: boolean;
|
|
13
8
|
checked: boolean;
|