@cdx-ui/primitives 0.0.1-alpha.5 → 0.0.1-alpha.6

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.
Files changed (101) hide show
  1. package/lib/commonjs/button/createButtonRoot.js +3 -3
  2. package/lib/commonjs/button/createButtonRoot.js.map +1 -1
  3. package/lib/commonjs/checkbox/context.js +14 -0
  4. package/lib/commonjs/checkbox/context.js.map +1 -0
  5. package/lib/commonjs/checkbox/createCheckboxGroup.js +44 -0
  6. package/lib/commonjs/checkbox/createCheckboxGroup.js.map +1 -0
  7. package/lib/commonjs/checkbox/createCheckboxIcon.js +28 -0
  8. package/lib/commonjs/checkbox/createCheckboxIcon.js.map +1 -0
  9. package/lib/commonjs/checkbox/createCheckboxIndicator.js +47 -0
  10. package/lib/commonjs/checkbox/createCheckboxIndicator.js.map +1 -0
  11. package/lib/commonjs/checkbox/createCheckboxLabel.js +46 -0
  12. package/lib/commonjs/checkbox/createCheckboxLabel.js.map +1 -0
  13. package/lib/commonjs/checkbox/createCheckboxRoot.js +99 -0
  14. package/lib/commonjs/checkbox/createCheckboxRoot.js.map +1 -0
  15. package/lib/commonjs/checkbox/createCheckboxRoot.web.js +88 -0
  16. package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +1 -0
  17. package/lib/commonjs/checkbox/index.js +32 -0
  18. package/lib/commonjs/checkbox/index.js.map +1 -0
  19. package/lib/commonjs/checkbox/types.js +6 -0
  20. package/lib/commonjs/checkbox/types.js.map +1 -0
  21. package/lib/commonjs/checkbox/useCheckboxRoot.js +82 -0
  22. package/lib/commonjs/checkbox/useCheckboxRoot.js.map +1 -0
  23. package/lib/commonjs/index.js +13 -1
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/types.js +2 -0
  26. package/lib/commonjs/types.js.map +1 -0
  27. package/lib/module/button/createButtonRoot.js +3 -3
  28. package/lib/module/button/createButtonRoot.js.map +1 -1
  29. package/lib/module/checkbox/context.js +7 -0
  30. package/lib/module/checkbox/context.js.map +1 -0
  31. package/lib/module/checkbox/createCheckboxGroup.js +39 -0
  32. package/lib/module/checkbox/createCheckboxGroup.js.map +1 -0
  33. package/lib/module/checkbox/createCheckboxIcon.js +23 -0
  34. package/lib/module/checkbox/createCheckboxIcon.js.map +1 -0
  35. package/lib/module/checkbox/createCheckboxIndicator.js +42 -0
  36. package/lib/module/checkbox/createCheckboxIndicator.js.map +1 -0
  37. package/lib/module/checkbox/createCheckboxLabel.js +41 -0
  38. package/lib/module/checkbox/createCheckboxLabel.js.map +1 -0
  39. package/lib/module/checkbox/createCheckboxRoot.js +94 -0
  40. package/lib/module/checkbox/createCheckboxRoot.js.map +1 -0
  41. package/lib/module/checkbox/createCheckboxRoot.web.js +83 -0
  42. package/lib/module/checkbox/createCheckboxRoot.web.js.map +1 -0
  43. package/lib/module/checkbox/index.js +27 -0
  44. package/lib/module/checkbox/index.js.map +1 -0
  45. package/lib/module/checkbox/types.js +4 -0
  46. package/lib/module/checkbox/types.js.map +1 -0
  47. package/lib/module/checkbox/useCheckboxRoot.js +78 -0
  48. package/lib/module/checkbox/useCheckboxRoot.js.map +1 -0
  49. package/lib/module/index.js +2 -1
  50. package/lib/module/index.js.map +1 -1
  51. package/lib/module/types.js +2 -0
  52. package/lib/module/types.js.map +1 -0
  53. package/lib/typescript/button/context.d.ts +1 -1
  54. package/lib/typescript/button/context.d.ts.map +1 -1
  55. package/lib/typescript/button/createButtonRoot.d.ts +1 -1
  56. package/lib/typescript/button/createButtonRoot.d.ts.map +1 -1
  57. package/lib/typescript/button/types.d.ts +0 -7
  58. package/lib/typescript/button/types.d.ts.map +1 -1
  59. package/lib/typescript/checkbox/context.d.ts +18 -0
  60. package/lib/typescript/checkbox/context.d.ts.map +1 -0
  61. package/lib/typescript/checkbox/createCheckboxGroup.d.ts +3 -0
  62. package/lib/typescript/checkbox/createCheckboxGroup.d.ts.map +1 -0
  63. package/lib/typescript/checkbox/createCheckboxIcon.d.ts +3 -0
  64. package/lib/typescript/checkbox/createCheckboxIcon.d.ts.map +1 -0
  65. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts +5 -0
  66. package/lib/typescript/checkbox/createCheckboxIndicator.d.ts.map +1 -0
  67. package/lib/typescript/checkbox/createCheckboxLabel.d.ts +5 -0
  68. package/lib/typescript/checkbox/createCheckboxLabel.d.ts.map +1 -0
  69. package/lib/typescript/checkbox/createCheckboxRoot.d.ts +2 -0
  70. package/lib/typescript/checkbox/createCheckboxRoot.d.ts.map +1 -0
  71. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +2 -0
  72. package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +1 -0
  73. package/lib/typescript/checkbox/index.d.ts +10 -0
  74. package/lib/typescript/checkbox/index.d.ts.map +1 -0
  75. package/lib/typescript/checkbox/types.d.ts +57 -0
  76. package/lib/typescript/checkbox/types.d.ts.map +1 -0
  77. package/lib/typescript/checkbox/useCheckboxRoot.d.ts +147 -0
  78. package/lib/typescript/checkbox/useCheckboxRoot.d.ts.map +1 -0
  79. package/lib/typescript/index.d.ts +3 -1
  80. package/lib/typescript/index.d.ts.map +1 -1
  81. package/lib/typescript/select/types.d.ts +2 -7
  82. package/lib/typescript/select/types.d.ts.map +1 -1
  83. package/lib/typescript/types.d.ts +8 -0
  84. package/lib/typescript/types.d.ts.map +1 -0
  85. package/package.json +6 -2
  86. package/src/button/context.tsx +1 -1
  87. package/src/button/createButtonRoot.tsx +5 -4
  88. package/src/button/types.ts +0 -8
  89. package/src/checkbox/context.tsx +18 -0
  90. package/src/checkbox/createCheckboxGroup.tsx +32 -0
  91. package/src/checkbox/createCheckboxIcon.tsx +18 -0
  92. package/src/checkbox/createCheckboxIndicator.tsx +43 -0
  93. package/src/checkbox/createCheckboxLabel.tsx +42 -0
  94. package/src/checkbox/createCheckboxRoot.tsx +100 -0
  95. package/src/checkbox/createCheckboxRoot.web.tsx +77 -0
  96. package/src/checkbox/index.ts +43 -0
  97. package/src/checkbox/types.ts +74 -0
  98. package/src/checkbox/useCheckboxRoot.ts +85 -0
  99. package/src/index.ts +3 -1
  100. package/src/select/types.ts +2 -10
  101. package/src/types.ts +7 -0
@@ -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,2 @@
1
+ export declare const createCheckboxRoot: <T>(BaseCheckbox: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<import("./types").InterfaceCheckbox & import("react").RefAttributes<T>>;
2
+ //# sourceMappingURL=createCheckboxRoot.d.ts.map
@@ -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,2 @@
1
+ export declare const createCheckboxRoot: <T>(BaseCheckbox: React.ComponentType<T>) => import("react").ForwardRefExoticComponent<import("./types").InterfaceCheckbox & import("react").RefAttributes<T>>;
2
+ //# sourceMappingURL=createCheckboxRoot.web.d.ts.map
@@ -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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ED,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,7 @@
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 { OverlayInsetsProvider, type EdgeInsets } from './overlay';
6
+ export type { InteractionState } from './types';
5
7
  //# 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,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,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,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
- export interface InteractionState {
5
- hover: boolean;
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;
@@ -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,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIrE,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;AAED,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IAClE,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EA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KAAK,CAAC,yBAAyB,CACtC,eAAe,CAAC,YAAY,GAAG,mBAAmB,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAChF,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,yBAAyB,CACpC,eAAe,CAAC,UAAU,GAAG,iBAAiB,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAC1E,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC,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,8 @@
1
+ export interface InteractionState {
2
+ hover: boolean;
3
+ focus: boolean;
4
+ active: boolean;
5
+ disabled: boolean;
6
+ focusVisible: boolean;
7
+ }
8
+ //# sourceMappingURL=types.d.ts.map
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/primitives",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.6",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "module": "lib/module/index.js",
6
6
  "react-native": "src/index.ts",
@@ -46,9 +46,13 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
+ "@react-aria/visually-hidden": "3.8.30",
50
+ "@react-native-aria/checkbox": "0.2.10",
49
51
  "@react-native-aria/focus": "^0.2.9",
50
52
  "@react-native-aria/interactions": "^0.2.16",
51
- "@cdx-ui/utils": "0.0.1-alpha.5"
53
+ "@react-stately/checkbox": "3.7.4",
54
+ "@react-stately/toggle": "3.9.4",
55
+ "@cdx-ui/utils": "0.0.1-alpha.6"
52
56
  },
53
57
  "devDependencies": {
54
58
  "@types/react": "*",
@@ -1,4 +1,4 @@
1
1
  import { createContext } from '@cdx-ui/utils';
2
- import type { InteractionState } from './types';
2
+ import type { InteractionState } from '../types';
3
3
 
4
4
  export const [ButtonProvider, useButtonContext] = createContext<InteractionState>('ButtonContext');
@@ -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, InteractionState } from './types';
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}
@@ -1,14 +1,6 @@
1
1
  import type { PropsWithoutRef, ReactElement, ReactNode, RefAttributes } from 'react';
2
2
  import type { PressableProps, ViewProps } from 'react-native';
3
3
 
4
- export interface InteractionState {
5
- hover: boolean;
6
- focus: boolean;
7
- active: boolean;
8
- disabled?: boolean;
9
- focusVisible: boolean;
10
- }
11
-
12
4
  export interface InterfaceButtonProps extends PressableProps {
13
5
  /**
14
6
  * If true, the button will be in hovered state.
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { createContext } from '@cdx-ui/utils';
3
+ import type { ICheckboxContextValue } from './types';
4
+
5
+ export const [CheckboxProvider, useCheckboxContext] =
6
+ createContext<ICheckboxContextValue>('CheckboxContext');
7
+
8
+ interface ICheckboxGroupState {
9
+ isReadOnly: boolean;
10
+ isDisabled: boolean;
11
+ isSelected: (value: string) => boolean;
12
+ addValue: (value: string) => void;
13
+ removeValue: (value: string) => void;
14
+ }
15
+
16
+ export const CheckboxGroupContext = React.createContext<{
17
+ state: ICheckboxGroupState;
18
+ } | null>(null);
@@ -0,0 +1,32 @@
1
+ import { forwardRef } from 'react';
2
+ import { useFormControlContext } from '@cdx-ui/utils';
3
+ import { useCheckboxGroup } from '@react-native-aria/checkbox';
4
+ import { useCheckboxGroupState } from '@react-stately/checkbox';
5
+ import { CheckboxGroupContext } from './context';
6
+ import type { ICheckboxGroupProps } from './types';
7
+
8
+ export const createCheckboxGroup = <T,>(BaseCheckboxGroup: React.ComponentType<T>) =>
9
+ forwardRef(({ children, ...props }: ICheckboxGroupProps, ref?: React.Ref<T>) => {
10
+ const state = useCheckboxGroupState({
11
+ ...props,
12
+ validationState: props.isInvalid ? 'invalid' : 'valid',
13
+ });
14
+
15
+ const { groupProps } = useCheckboxGroup(
16
+ {
17
+ ...props,
18
+ 'aria-label': props['aria-label'],
19
+ },
20
+ state,
21
+ );
22
+
23
+ const formControlContext = useFormControlContext();
24
+
25
+ return (
26
+ <CheckboxGroupContext.Provider value={{ state: { ...formControlContext, ...state } }}>
27
+ <BaseCheckboxGroup {...groupProps} {...props} ref={ref}>
28
+ {children}
29
+ </BaseCheckboxGroup>
30
+ </CheckboxGroupContext.Provider>
31
+ );
32
+ });
@@ -0,0 +1,18 @@
1
+ import { forwardRef } from 'react';
2
+ import { useCheckboxContext } from './context';
3
+ import type { ICheckboxIconProps } from './types';
4
+
5
+ export const createCheckboxIcon = <T,>(BaseCheckboxIcon: React.ComponentType<T>) =>
6
+ forwardRef<unknown, ICheckboxIconProps>(({ children, forceMount = false, ...props }, ref) => {
7
+ const { isChecked } = useCheckboxContext();
8
+
9
+ if (forceMount || isChecked) {
10
+ return (
11
+ <BaseCheckboxIcon {...(props as T)} ref={ref}>
12
+ {children}
13
+ </BaseCheckboxIcon>
14
+ );
15
+ }
16
+
17
+ return null;
18
+ });
@@ -0,0 +1,43 @@
1
+ import { forwardRef } from 'react';
2
+ import { dataAttributes } from '../utils/dataAttributes';
3
+ import { useCheckboxContext } from './context';
4
+ import type { ICheckboxIndicatorProps } from './types';
5
+
6
+ export const createCheckboxIndicator = <T,>(BaseCheckboxIndicator: React.ComponentType<T>) =>
7
+ forwardRef<unknown, ICheckboxIndicatorProps & { className?: string }>(
8
+ ({ children, className, ...props }, ref) => {
9
+ const {
10
+ isChecked,
11
+ isDisabled,
12
+ isHovered,
13
+ isInvalid,
14
+ isReadOnly,
15
+ isPressed,
16
+ isFocused,
17
+ isIndeterminate,
18
+ isFocusVisible,
19
+ } = useCheckboxContext();
20
+
21
+ return (
22
+ <BaseCheckboxIndicator
23
+ className={className}
24
+ {...dataAttributes({
25
+ hover: isHovered,
26
+ checked: isChecked,
27
+ disabled: isDisabled,
28
+ focusVisible: isFocusVisible,
29
+ invalid: isInvalid,
30
+ readOnly: isReadOnly,
31
+ active: isPressed,
32
+ focused: isFocused,
33
+ indeterminate: isIndeterminate,
34
+ slot: 'checkbox-indicator',
35
+ })}
36
+ {...(props as T)}
37
+ ref={ref}
38
+ >
39
+ {children}
40
+ </BaseCheckboxIndicator>
41
+ );
42
+ },
43
+ );
@@ -0,0 +1,42 @@
1
+ import { forwardRef } from 'react';
2
+ import { dataAttributes } from '../utils/dataAttributes';
3
+ import { useCheckboxContext } from './context';
4
+ import type { ICheckboxLabelProps } from './types';
5
+
6
+ export const createCheckboxLabel = <T,>(BaseCheckboxLabel: React.ComponentType<T>) =>
7
+ forwardRef<unknown, ICheckboxLabelProps & { className?: string }>(
8
+ ({ children, className, ...props }, ref) => {
9
+ const {
10
+ isChecked,
11
+ isDisabled,
12
+ isHovered,
13
+ isInvalid,
14
+ isReadOnly,
15
+ isPressed,
16
+ isFocused,
17
+ isIndeterminate,
18
+ isFocusVisible,
19
+ } = useCheckboxContext();
20
+
21
+ return (
22
+ <BaseCheckboxLabel
23
+ className={className}
24
+ {...dataAttributes({
25
+ hover: isHovered,
26
+ checked: isChecked,
27
+ disabled: isDisabled,
28
+ focusVisible: isFocusVisible,
29
+ invalid: isInvalid,
30
+ readOnly: isReadOnly,
31
+ pressed: isPressed,
32
+ focused: isFocused,
33
+ indeterminate: isIndeterminate,
34
+ })}
35
+ {...(props as T)}
36
+ ref={ref}
37
+ >
38
+ {children}
39
+ </BaseCheckboxLabel>
40
+ );
41
+ },
42
+ );