@cdx-ui/primitives 0.0.1-alpha.1 → 0.0.1-alpha.11
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/button/index.js +18 -19
- package/lib/commonjs/button/index.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 +90 -0
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +1 -0
- package/lib/commonjs/checkbox/index.js +30 -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/input/index.js +16 -18
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/select/context.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/commonjs/utils/dataAttributes.web.js +1 -4
- package/lib/commonjs/utils/dataAttributes.web.js.map +1 -1
- package/lib/module/button/createButtonRoot.js +3 -3
- package/lib/module/button/createButtonRoot.js.map +1 -1
- package/lib/module/button/index.js +18 -19
- package/lib/module/button/index.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 +85 -0
- package/lib/module/checkbox/createCheckboxRoot.web.js.map +1 -0
- package/lib/module/checkbox/index.js +26 -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/input/index.js +15 -16
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/select/context.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/module/utils/dataAttributes.web.js +1 -4
- package/lib/module/utils/dataAttributes.web.js.map +1 -1
- 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/index.d.ts +1 -1
- package/lib/typescript/button/index.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 +11 -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/input/index.d.ts +3 -2
- package/lib/typescript/input/index.d.ts.map +1 -1
- package/lib/typescript/select/context.d.ts +2 -1
- package/lib/typescript/select/context.d.ts.map +1 -1
- package/lib/typescript/select/types.d.ts +1 -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/lib/typescript/utils/dataAttributes.web.d.ts.map +1 -1
- package/package.json +12 -9
- package/src/button/context.tsx +1 -1
- package/src/button/createButtonRoot.tsx +5 -4
- package/src/button/index.tsx +18 -19
- 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 +79 -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/input/index.tsx +18 -25
- package/src/select/context.tsx +2 -1
- package/src/select/types.ts +1 -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
- package/src/utils/dataAttributes.web.ts +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;IACpE;;OAEG;IACH,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IAExC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,CAC9B,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,GAAG,OAAO,EACnB,OAAO,GAAG,OAAO,IACf,KAAK,CAAC,yBAAyB,CACjC,eAAe,CAAC,WAAW,GAAG,YAAY,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":"AAUA,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAG,cAAc,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sHAoEvE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ICheckboxComponentType } from './types';
|
|
3
|
+
export type { ICheckboxComponentType, ICheckboxGroupProps, ICheckboxIconProps, ICheckboxIndicatorProps, ICheckboxLabelProps, ICheckboxProps, } from './types';
|
|
4
|
+
export declare function createCheckbox<Root, Indicator, Icon, Label, Group>(BaseComponents: {
|
|
5
|
+
Root: React.ComponentType<Root>;
|
|
6
|
+
Indicator: React.ComponentType<Indicator>;
|
|
7
|
+
Icon: React.ComponentType<Icon>;
|
|
8
|
+
Label: React.ComponentType<Label>;
|
|
9
|
+
Group: React.ComponentType<Group>;
|
|
10
|
+
}): ICheckboxComponentType<Root, Indicator, Icon, Label, Group>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,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,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE;IAClF,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,GAkBO,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAClE"}
|
|
@@ -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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,KAAK,CAAC,SAAS,CAAC;IAC3B,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,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,9 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { IInputComponentType } from './types';
|
|
2
3
|
export type { IInputFieldProps, IInputIconProps, IInputProps, IInputRootProps, IInputSlotProps, } from './types';
|
|
3
|
-
export declare
|
|
4
|
+
export declare function createInput<RootProps, IconProps, SlotProps, FieldProps, RootRef = unknown, FieldRef = unknown>(BaseComponents: {
|
|
4
5
|
Root: React.ComponentType<RootProps>;
|
|
5
6
|
Icon: React.ComponentType<IconProps>;
|
|
6
7
|
Slot: React.ComponentType<SlotProps>;
|
|
7
8
|
Field: React.ComponentType<FieldProps>;
|
|
8
|
-
})
|
|
9
|
+
}): IInputComponentType<RootProps, IconProps, SlotProps, FieldProps, RootRef, FieldRef>;
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,WAAW,CACzB,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,OAAO,EAClB,cAAc,EAAE;IAChB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACxC,GAeO,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAC1F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { InteractionState
|
|
1
|
+
import type { InteractionState } from '../types';
|
|
2
|
+
import type { SelectContextValue, SelectItemInteractionState } from './types';
|
|
2
3
|
export declare const SelectContext: import("react").Context<SelectContextValue>;
|
|
3
4
|
export declare const useSelectContext: () => SelectContextValue;
|
|
4
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/select/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/select/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAqB9E,eAAO,MAAM,aAAa,6CAAyD,CAAC;AAEpF,eAAO,MAAM,gBAAgB,0BAAkC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,2CAM/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,wBAAyC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,qDAQ5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,kCAAsC,CAAC"}
|
|
@@ -1,13 +1,7 @@
|
|
|
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
|
-
hover: boolean;
|
|
6
|
-
focus: boolean;
|
|
7
|
-
active: boolean;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
focusVisible: boolean;
|
|
10
|
-
}
|
|
4
|
+
import type { InteractionState } from '../types';
|
|
11
5
|
export interface SelectItemInteractionState extends InteractionState {
|
|
12
6
|
highlighted: boolean;
|
|
13
7
|
checked: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa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AAC,OAAO,CAAC,CAAC,CAAC;IAC3F,OAAO,EAAE,KAAK,CAAC,yBAAyB,CACtC,eAAe,CAAC,YAAY,GAAG,mBAAmB,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAC7E,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,yBAAyB,CACnC,eAAe,CAAC,SAAS,GAAG,gBAAgB,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CACvE,CAAC;IACF,SAAS,EAAE,KAAK,CAAC,yBAAyB,CACxC,eAAe,CAAC,cAAc,GAAG,qBAAqB,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CACjF,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSwitchRoot.d.ts","sourceRoot":"","sources":["../../../src/switch/createSwitchRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,YAAY,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sGA8DhF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ISwitchComponentType } from './types';
|
|
3
|
+
export type { ISwitchProps, ISwitchComponentType, IInterfaceSwitchProps } from './types';
|
|
4
|
+
export declare function createSwitch<T, R = unknown>({ Root, }: {
|
|
5
|
+
Root: React.ComponentType<T>;
|
|
6
|
+
}): ISwitchComponentType<T, R>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEzF,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,EAC3C,IAAI,GACL,EAAE;IACD,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC9B,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAK7B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface IInterfaceSwitchProps {
|
|
3
|
+
/**
|
|
4
|
+
* Callback invoked when the switch value changes.
|
|
5
|
+
*/
|
|
6
|
+
onValueChange?: (value: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* If true, set the Switch to the checked state.
|
|
9
|
+
*/
|
|
10
|
+
isChecked?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The current value of the switch.
|
|
13
|
+
*/
|
|
14
|
+
value?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, the switch will be disabled.
|
|
17
|
+
*/
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the switch will be disabled.
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If true, the checkbox will be initially checked.
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If true, set the switch to the invalid state.
|
|
29
|
+
*/
|
|
30
|
+
isInvalid?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* If true, the switch will be hovered.
|
|
33
|
+
*/
|
|
34
|
+
isHovered?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type ISwitchComponentType<T, R = unknown> = React.ForwardRefExoticComponent<React.PropsWithoutRef<T & IInterfaceSwitchProps> & React.RefAttributes<R>>;
|
|
37
|
+
export type ISwitchProps = IInterfaceSwitchProps;
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/switch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,oBAAoB,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,IAAI,KAAK,CAAC,yBAAyB,CAChF,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,qBAAqB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAC1E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataAttributes.web.d.ts","sourceRoot":"","sources":["../../../src/utils/dataAttributes.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,KAAK,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;CAC3C,
|
|
1
|
+
{"version":3,"file":"dataAttributes.web.d.ts","sourceRoot":"","sources":["../../../src/utils/dataAttributes.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,KAAK,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;CAC3C,CAQA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/primitives",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.11",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"react-native": "./src/index.ts",
|
|
12
|
-
"source": "./src/index.ts",
|
|
13
12
|
"types": "./lib/typescript/index.d.ts",
|
|
14
13
|
"import": "./lib/module/index.js",
|
|
15
14
|
"require": "./lib/commonjs/index.js",
|
|
@@ -30,26 +29,30 @@
|
|
|
30
29
|
]
|
|
31
30
|
},
|
|
32
31
|
"peerDependencies": {
|
|
33
|
-
"react": "
|
|
34
|
-
"react-native": ">=0.
|
|
35
|
-
"react-native-
|
|
36
|
-
"react-
|
|
32
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
33
|
+
"react-native": ">=0.76.0",
|
|
34
|
+
"react-native-reanimated": ">=3.0.0",
|
|
35
|
+
"react-native-web": ">=0.19.0"
|
|
37
36
|
},
|
|
38
37
|
"peerDependenciesMeta": {
|
|
39
38
|
"react-native": {
|
|
40
39
|
"optional": true
|
|
41
40
|
},
|
|
42
|
-
"react-native-
|
|
41
|
+
"react-native-reanimated": {
|
|
43
42
|
"optional": true
|
|
44
43
|
},
|
|
45
|
-
"react-
|
|
44
|
+
"react-native-web": {
|
|
46
45
|
"optional": true
|
|
47
46
|
}
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
49
|
+
"@react-aria/visually-hidden": "3.8.30",
|
|
50
|
+
"@react-native-aria/checkbox": "0.2.10",
|
|
50
51
|
"@react-native-aria/focus": "^0.2.9",
|
|
51
52
|
"@react-native-aria/interactions": "^0.2.16",
|
|
52
|
-
"@
|
|
53
|
+
"@react-stately/checkbox": "3.7.4",
|
|
54
|
+
"@react-stately/toggle": "3.9.4",
|
|
55
|
+
"@cdx-ui/utils": "0.0.1-alpha.11"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
58
|
"@types/react": "*",
|
package/src/button/context.tsx
CHANGED
|
@@ -3,9 +3,10 @@ import { forwardRef, useMemo } from 'react';
|
|
|
3
3
|
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
4
4
|
import { useFocus, useFocusRing } from '@react-native-aria/focus';
|
|
5
5
|
import { useHover, usePress } from '@react-native-aria/interactions';
|
|
6
|
+
import type { InteractionState } from '../types';
|
|
6
7
|
import { dataAttributes } from '../utils/dataAttributes';
|
|
7
8
|
import { ButtonProvider } from './context';
|
|
8
|
-
import type { IButtonProps
|
|
9
|
+
import type { IButtonProps } from './types';
|
|
9
10
|
|
|
10
11
|
export const createButtonRoot = <T,>(BaseButton: React.ComponentType<T>) =>
|
|
11
12
|
forwardRef(
|
|
@@ -37,7 +38,7 @@ export const createButtonRoot = <T,>(BaseButton: React.ComponentType<T>) =>
|
|
|
37
38
|
hover: isHoveredProp || isHovered,
|
|
38
39
|
focus: isFocusedProp || isFocused,
|
|
39
40
|
active: isActiveProp || isActive,
|
|
40
|
-
disabled: isDisabled,
|
|
41
|
+
disabled: !!isDisabled,
|
|
41
42
|
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
42
43
|
};
|
|
43
44
|
}, [
|
|
@@ -61,7 +62,7 @@ export const createButtonRoot = <T,>(BaseButton: React.ComponentType<T>) =>
|
|
|
61
62
|
hover: isHoveredProp || isHovered,
|
|
62
63
|
focus: isFocusedProp || isFocused,
|
|
63
64
|
active: isActiveProp || isActive,
|
|
64
|
-
disabled: isDisabled,
|
|
65
|
+
disabled: !!isDisabled,
|
|
65
66
|
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
66
67
|
})}
|
|
67
68
|
disabled={isDisabled}
|
|
@@ -90,7 +91,7 @@ export const createButtonRoot = <T,>(BaseButton: React.ComponentType<T>) =>
|
|
|
90
91
|
hover: isHoveredProp || isHovered,
|
|
91
92
|
focus: isFocusedProp || isFocused,
|
|
92
93
|
active: isActiveProp || isActive,
|
|
93
|
-
disabled: isDisabled,
|
|
94
|
+
disabled: !!isDisabled,
|
|
94
95
|
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
95
96
|
})
|
|
96
97
|
: children}
|