@cdx-ui/primitives 0.0.1-beta.2 → 0.0.1-beta.20
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/README.md +38 -24
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/list-item/context.js +11 -0
- package/lib/commonjs/list-item/context.js.map +1 -0
- package/lib/commonjs/list-item/createListItemContent.js +30 -0
- package/lib/commonjs/list-item/createListItemContent.js.map +1 -0
- package/lib/commonjs/list-item/createListItemDescription.js +25 -0
- package/lib/commonjs/list-item/createListItemDescription.js.map +1 -0
- package/lib/commonjs/list-item/createListItemLeadingSlot.js +34 -0
- package/lib/commonjs/list-item/createListItemLeadingSlot.js.map +1 -0
- package/lib/commonjs/list-item/createListItemMeta.js +25 -0
- package/lib/commonjs/list-item/createListItemMeta.js.map +1 -0
- package/lib/commonjs/list-item/createListItemRoot.js +157 -0
- package/lib/commonjs/list-item/createListItemRoot.js.map +1 -0
- package/lib/commonjs/list-item/createListItemSectionHeader.js +54 -0
- package/lib/commonjs/list-item/createListItemSectionHeader.js.map +1 -0
- package/lib/commonjs/list-item/createListItemTitle.js +25 -0
- package/lib/commonjs/list-item/createListItemTitle.js.map +1 -0
- package/lib/commonjs/list-item/createListItemTrailingSlot.js +28 -0
- package/lib/commonjs/list-item/createListItemTrailingSlot.js.map +1 -0
- package/lib/commonjs/list-item/index.js +55 -0
- package/lib/commonjs/list-item/index.js.map +1 -0
- package/lib/commonjs/list-item/types.js +6 -0
- package/lib/commonjs/list-item/types.js.map +1 -0
- package/lib/commonjs/radio/context.js +14 -0
- package/lib/commonjs/radio/context.js.map +1 -0
- package/lib/commonjs/radio/createRadioGroup.js +66 -0
- package/lib/commonjs/radio/createRadioGroup.js.map +1 -0
- package/lib/commonjs/radio/createRadioIndicator.js +43 -0
- package/lib/commonjs/radio/createRadioIndicator.js.map +1 -0
- package/lib/commonjs/radio/createRadioLabel.js +38 -0
- package/lib/commonjs/radio/createRadioLabel.js.map +1 -0
- package/lib/commonjs/radio/createRadioRoot.js +95 -0
- package/lib/commonjs/radio/createRadioRoot.js.map +1 -0
- package/lib/commonjs/radio/createRadioRoot.web.js +87 -0
- package/lib/commonjs/radio/createRadioRoot.web.js.map +1 -0
- package/lib/commonjs/radio/index.js +26 -0
- package/lib/commonjs/radio/index.js.map +1 -0
- package/lib/commonjs/radio/types.js +6 -0
- package/lib/commonjs/radio/types.js.map +1 -0
- package/lib/commonjs/radio/useRadioRoot.js +64 -0
- package/lib/commonjs/radio/useRadioRoot.js.map +1 -0
- package/lib/commonjs/tile/context.js +30 -0
- package/lib/commonjs/tile/context.js.map +1 -0
- package/lib/commonjs/tile/createTileContent.js +30 -0
- package/lib/commonjs/tile/createTileContent.js.map +1 -0
- package/lib/commonjs/tile/createTileDescription.js +28 -0
- package/lib/commonjs/tile/createTileDescription.js.map +1 -0
- package/lib/commonjs/tile/createTileGroup.js +112 -0
- package/lib/commonjs/tile/createTileGroup.js.map +1 -0
- package/lib/commonjs/tile/createTileIndicator.js +46 -0
- package/lib/commonjs/tile/createTileIndicator.js.map +1 -0
- package/lib/commonjs/tile/createTileLeadingSlot.js +34 -0
- package/lib/commonjs/tile/createTileLeadingSlot.js.map +1 -0
- package/lib/commonjs/tile/createTileRoot.js +133 -0
- package/lib/commonjs/tile/createTileRoot.js.map +1 -0
- package/lib/commonjs/tile/createTileTitle.js +28 -0
- package/lib/commonjs/tile/createTileTitle.js.map +1 -0
- package/lib/commonjs/tile/createTileTrailingSlot.js +35 -0
- package/lib/commonjs/tile/createTileTrailingSlot.js.map +1 -0
- package/lib/commonjs/tile/index.js +55 -0
- package/lib/commonjs/tile/index.js.map +1 -0
- package/lib/commonjs/tile/types.js +6 -0
- package/lib/commonjs/tile/types.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/list-item/context.js +5 -0
- package/lib/module/list-item/context.js.map +1 -0
- package/lib/module/list-item/createListItemContent.js +24 -0
- package/lib/module/list-item/createListItemContent.js.map +1 -0
- package/lib/module/list-item/createListItemDescription.js +19 -0
- package/lib/module/list-item/createListItemDescription.js.map +1 -0
- package/lib/module/list-item/createListItemLeadingSlot.js +28 -0
- package/lib/module/list-item/createListItemLeadingSlot.js.map +1 -0
- package/lib/module/list-item/createListItemMeta.js +19 -0
- package/lib/module/list-item/createListItemMeta.js.map +1 -0
- package/lib/module/list-item/createListItemRoot.js +151 -0
- package/lib/module/list-item/createListItemRoot.js.map +1 -0
- package/lib/module/list-item/createListItemSectionHeader.js +48 -0
- package/lib/module/list-item/createListItemSectionHeader.js.map +1 -0
- package/lib/module/list-item/createListItemTitle.js +19 -0
- package/lib/module/list-item/createListItemTitle.js.map +1 -0
- package/lib/module/list-item/createListItemTrailingSlot.js +22 -0
- package/lib/module/list-item/createListItemTrailingSlot.js.map +1 -0
- package/lib/module/list-item/index.js +39 -0
- package/lib/module/list-item/index.js.map +1 -0
- package/lib/module/list-item/types.js +4 -0
- package/lib/module/list-item/types.js.map +1 -0
- package/lib/module/radio/context.js +7 -0
- package/lib/module/radio/context.js.map +1 -0
- package/lib/module/radio/createRadioGroup.js +61 -0
- package/lib/module/radio/createRadioGroup.js.map +1 -0
- package/lib/module/radio/createRadioIndicator.js +38 -0
- package/lib/module/radio/createRadioIndicator.js.map +1 -0
- package/lib/module/radio/createRadioLabel.js +33 -0
- package/lib/module/radio/createRadioLabel.js.map +1 -0
- package/lib/module/radio/createRadioRoot.js +90 -0
- package/lib/module/radio/createRadioRoot.js.map +1 -0
- package/lib/module/radio/createRadioRoot.web.js +82 -0
- package/lib/module/radio/createRadioRoot.web.js.map +1 -0
- package/lib/module/radio/index.js +22 -0
- package/lib/module/radio/index.js.map +1 -0
- package/lib/module/radio/types.js +4 -0
- package/lib/module/radio/types.js.map +1 -0
- package/lib/module/radio/useRadioRoot.js +60 -0
- package/lib/module/radio/useRadioRoot.js.map +1 -0
- package/lib/module/tile/context.js +21 -0
- package/lib/module/tile/context.js.map +1 -0
- package/lib/module/tile/createTileContent.js +24 -0
- package/lib/module/tile/createTileContent.js.map +1 -0
- package/lib/module/tile/createTileDescription.js +22 -0
- package/lib/module/tile/createTileDescription.js.map +1 -0
- package/lib/module/tile/createTileGroup.js +106 -0
- package/lib/module/tile/createTileGroup.js.map +1 -0
- package/lib/module/tile/createTileIndicator.js +40 -0
- package/lib/module/tile/createTileIndicator.js.map +1 -0
- package/lib/module/tile/createTileLeadingSlot.js +28 -0
- package/lib/module/tile/createTileLeadingSlot.js.map +1 -0
- package/lib/module/tile/createTileRoot.js +127 -0
- package/lib/module/tile/createTileRoot.js.map +1 -0
- package/lib/module/tile/createTileTitle.js +22 -0
- package/lib/module/tile/createTileTitle.js.map +1 -0
- package/lib/module/tile/createTileTrailingSlot.js +29 -0
- package/lib/module/tile/createTileTrailingSlot.js.map +1 -0
- package/lib/module/tile/index.js +39 -0
- package/lib/module/tile/index.js.map +1 -0
- package/lib/module/tile/types.js +4 -0
- package/lib/module/tile/types.js.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/list-item/context.d.ts +6 -0
- package/lib/typescript/list-item/context.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemContent.d.ts +3 -0
- package/lib/typescript/list-item/createListItemContent.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemDescription.d.ts +3 -0
- package/lib/typescript/list-item/createListItemDescription.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemLeadingSlot.d.ts +4 -0
- package/lib/typescript/list-item/createListItemLeadingSlot.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemMeta.d.ts +3 -0
- package/lib/typescript/list-item/createListItemMeta.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemRoot.d.ts +4 -0
- package/lib/typescript/list-item/createListItemRoot.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemSectionHeader.d.ts +4 -0
- package/lib/typescript/list-item/createListItemSectionHeader.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemTitle.d.ts +3 -0
- package/lib/typescript/list-item/createListItemTitle.d.ts.map +1 -0
- package/lib/typescript/list-item/createListItemTrailingSlot.d.ts +3 -0
- package/lib/typescript/list-item/createListItemTrailingSlot.d.ts.map +1 -0
- package/lib/typescript/list-item/index.d.ts +16 -0
- package/lib/typescript/list-item/index.d.ts.map +1 -0
- package/lib/typescript/list-item/types.d.ts +86 -0
- package/lib/typescript/list-item/types.d.ts.map +1 -0
- package/lib/typescript/radio/context.d.ts +21 -0
- package/lib/typescript/radio/context.d.ts.map +1 -0
- package/lib/typescript/radio/createRadioGroup.d.ts +3 -0
- package/lib/typescript/radio/createRadioGroup.d.ts.map +1 -0
- package/lib/typescript/radio/createRadioIndicator.d.ts +5 -0
- package/lib/typescript/radio/createRadioIndicator.d.ts.map +1 -0
- package/lib/typescript/radio/createRadioLabel.d.ts +5 -0
- package/lib/typescript/radio/createRadioLabel.d.ts.map +1 -0
- package/lib/typescript/radio/createRadioRoot.d.ts +3 -0
- package/lib/typescript/radio/createRadioRoot.d.ts.map +1 -0
- package/lib/typescript/radio/createRadioRoot.web.d.ts +3 -0
- package/lib/typescript/radio/createRadioRoot.web.d.ts.map +1 -0
- package/lib/typescript/radio/index.d.ts +10 -0
- package/lib/typescript/radio/index.d.ts.map +1 -0
- package/lib/typescript/radio/types.d.ts +54 -0
- package/lib/typescript/radio/types.d.ts.map +1 -0
- package/lib/typescript/radio/useRadioRoot.d.ts +149 -0
- package/lib/typescript/radio/useRadioRoot.d.ts.map +1 -0
- package/lib/typescript/tile/context.d.ts +9 -0
- package/lib/typescript/tile/context.d.ts.map +1 -0
- package/lib/typescript/tile/createTileContent.d.ts +3 -0
- package/lib/typescript/tile/createTileContent.d.ts.map +1 -0
- package/lib/typescript/tile/createTileDescription.d.ts +3 -0
- package/lib/typescript/tile/createTileDescription.d.ts.map +1 -0
- package/lib/typescript/tile/createTileGroup.d.ts +4 -0
- package/lib/typescript/tile/createTileGroup.d.ts.map +1 -0
- package/lib/typescript/tile/createTileIndicator.d.ts +4 -0
- package/lib/typescript/tile/createTileIndicator.d.ts.map +1 -0
- package/lib/typescript/tile/createTileLeadingSlot.d.ts +4 -0
- package/lib/typescript/tile/createTileLeadingSlot.d.ts.map +1 -0
- package/lib/typescript/tile/createTileRoot.d.ts +4 -0
- package/lib/typescript/tile/createTileRoot.d.ts.map +1 -0
- package/lib/typescript/tile/createTileTitle.d.ts +3 -0
- package/lib/typescript/tile/createTileTitle.d.ts.map +1 -0
- package/lib/typescript/tile/createTileTrailingSlot.d.ts +9 -0
- package/lib/typescript/tile/createTileTrailingSlot.d.ts.map +1 -0
- package/lib/typescript/tile/index.d.ts +15 -0
- package/lib/typescript/tile/index.d.ts.map +1 -0
- package/lib/typescript/tile/types.d.ts +119 -0
- package/lib/typescript/tile/types.d.ts.map +1 -0
- package/package.json +5 -2
- package/src/index.ts +3 -0
- package/src/list-item/context.tsx +5 -0
- package/src/list-item/createListItemContent.tsx +23 -0
- package/src/list-item/createListItemDescription.tsx +19 -0
- package/src/list-item/createListItemLeadingSlot.tsx +30 -0
- package/src/list-item/createListItemMeta.tsx +17 -0
- package/src/list-item/createListItemRoot.tsx +178 -0
- package/src/list-item/createListItemSectionHeader.tsx +53 -0
- package/src/list-item/createListItemTitle.tsx +17 -0
- package/src/list-item/createListItemTrailingSlot.tsx +21 -0
- package/src/list-item/index.ts +88 -0
- package/src/list-item/types.ts +122 -0
- package/src/radio/context.tsx +21 -0
- package/src/radio/createRadioGroup.tsx +67 -0
- package/src/radio/createRadioIndicator.tsx +32 -0
- package/src/radio/createRadioLabel.tsx +28 -0
- package/src/radio/createRadioRoot.tsx +100 -0
- package/src/radio/createRadioRoot.web.tsx +81 -0
- package/src/radio/index.ts +37 -0
- package/src/radio/types.ts +67 -0
- package/src/radio/useRadioRoot.ts +69 -0
- package/src/tile/context.tsx +23 -0
- package/src/tile/createTileContent.tsx +23 -0
- package/src/tile/createTileDescription.tsx +19 -0
- package/src/tile/createTileGroup.tsx +134 -0
- package/src/tile/createTileIndicator.tsx +38 -0
- package/src/tile/createTileLeadingSlot.tsx +30 -0
- package/src/tile/createTileRoot.tsx +124 -0
- package/src/tile/createTileTitle.tsx +19 -0
- package/src/tile/createTileTrailingSlot.tsx +25 -0
- package/src/tile/index.ts +88 -0
- package/src/tile/types.ts +153 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PressableProps } from 'react-native';
|
|
2
|
+
export interface IRadioProps extends PressableProps {
|
|
3
|
+
/** Required — identifies this item's value within a Radio.Group. */
|
|
4
|
+
value: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
isInvalid?: boolean;
|
|
7
|
+
isReadOnly?: boolean;
|
|
8
|
+
isHovered?: boolean;
|
|
9
|
+
isFocused?: boolean;
|
|
10
|
+
isPressed?: boolean;
|
|
11
|
+
isFocusVisible?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface IRadioGroupProps {
|
|
15
|
+
/** Controlled selected value. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Default selected value for uncontrolled usage. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Called when the selected value changes. */
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
/** Layout direction of the radio items. */
|
|
22
|
+
direction?: 'column' | 'row';
|
|
23
|
+
/** Form field name for web form integration. */
|
|
24
|
+
name?: string;
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
isInvalid?: boolean;
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
isReadOnly?: boolean;
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
'aria-labelledby'?: string;
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export interface IRadioIndicatorProps {
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export interface IRadioLabelProps {
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export type IRadioComponentType<Root, Indicator, Label, Group> = React.ForwardRefExoticComponent<React.RefAttributes<Root> & React.PropsWithoutRef<Root> & IRadioProps> & {
|
|
40
|
+
Indicator: React.ForwardRefExoticComponent<React.RefAttributes<Indicator> & React.PropsWithoutRef<Indicator> & IRadioIndicatorProps>;
|
|
41
|
+
Label: React.ForwardRefExoticComponent<React.RefAttributes<Label> & React.PropsWithoutRef<Label> & IRadioLabelProps>;
|
|
42
|
+
Group: React.ForwardRefExoticComponent<React.RefAttributes<Group> & React.PropsWithoutRef<Group> & IRadioGroupProps>;
|
|
43
|
+
};
|
|
44
|
+
export interface IRadioContextValue {
|
|
45
|
+
isChecked?: boolean;
|
|
46
|
+
isDisabled?: boolean;
|
|
47
|
+
isInvalid?: boolean;
|
|
48
|
+
isReadOnly?: boolean;
|
|
49
|
+
isFocused?: boolean;
|
|
50
|
+
isFocusVisible?: boolean;
|
|
51
|
+
isHovered?: boolean;
|
|
52
|
+
isPressed?: boolean;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,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,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAA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AAe,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAC7E,CAAC;IACF,KAAK,EAAE,KAAK,CAAC,yBAAyB,CACpC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAC7E,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,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,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { IRadioProps } from './types';
|
|
2
|
+
interface UseRadioRootOptions {
|
|
3
|
+
useInputRefForAria?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useRadioRoot(props: IRadioProps, ref?: React.Ref<unknown>, { useInputRefForAria }?: UseRadioRootOptions): {
|
|
6
|
+
combinedProps: {
|
|
7
|
+
value: string;
|
|
8
|
+
isDisabled?: boolean | undefined;
|
|
9
|
+
isHovered?: boolean;
|
|
10
|
+
isFocused?: boolean;
|
|
11
|
+
isPressed?: boolean;
|
|
12
|
+
isFocusVisible?: boolean;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
onHoverIn?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
|
|
15
|
+
onHoverOut?: null | ((event: import("react-native").MouseEvent) => void) | undefined;
|
|
16
|
+
onPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
17
|
+
onPressIn?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
18
|
+
onPressOut?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
19
|
+
onLongPress?: null | ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
20
|
+
onBlur?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
|
|
21
|
+
onFocus?: null | ((event: import("react-native").NativeSyntheticEvent<import("react-native").TargetedEvent>) => void) | undefined;
|
|
22
|
+
cancelable?: null | boolean | undefined;
|
|
23
|
+
delayHoverIn?: number | null | undefined;
|
|
24
|
+
delayHoverOut?: number | null | undefined;
|
|
25
|
+
delayLongPress?: null | number | undefined;
|
|
26
|
+
disabled?: null | boolean | undefined;
|
|
27
|
+
hitSlop?: null | import("react-native").Insets | number | undefined;
|
|
28
|
+
pressRetentionOffset?: null | import("react-native").Insets | number | undefined;
|
|
29
|
+
android_disableSound?: null | boolean | undefined;
|
|
30
|
+
android_ripple?: null | import("react-native").PressableAndroidRippleConfig | undefined;
|
|
31
|
+
testOnly_pressed?: null | boolean | undefined;
|
|
32
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle> | ((state: import("react-native").PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").ViewStyle>) | undefined;
|
|
33
|
+
unstable_pressDelay?: number | undefined;
|
|
34
|
+
accessible?: boolean | undefined;
|
|
35
|
+
accessibilityActions?: ReadonlyArray<import("react-native").AccessibilityActionInfo> | undefined;
|
|
36
|
+
accessibilityLabel?: string | undefined;
|
|
37
|
+
'aria-label'?: string | undefined;
|
|
38
|
+
accessibilityRole?: import("react-native").AccessibilityRole | undefined;
|
|
39
|
+
accessibilityState?: import("react-native").AccessibilityState | undefined;
|
|
40
|
+
'aria-busy'?: boolean | undefined;
|
|
41
|
+
'aria-checked'?: boolean | "mixed" | undefined;
|
|
42
|
+
'aria-disabled'?: boolean | undefined;
|
|
43
|
+
'aria-expanded'?: boolean | undefined;
|
|
44
|
+
'aria-selected'?: boolean | undefined;
|
|
45
|
+
accessibilityHint?: string | undefined;
|
|
46
|
+
accessibilityValue?: import("react-native").AccessibilityValue | undefined;
|
|
47
|
+
'aria-valuemax'?: import("react-native").AccessibilityValue["max"] | undefined;
|
|
48
|
+
'aria-valuemin'?: import("react-native").AccessibilityValue["min"] | undefined;
|
|
49
|
+
'aria-valuenow'?: import("react-native").AccessibilityValue["now"] | undefined;
|
|
50
|
+
'aria-valuetext'?: import("react-native").AccessibilityValue["text"] | undefined;
|
|
51
|
+
onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
|
|
52
|
+
importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
|
|
53
|
+
'aria-hidden'?: boolean | undefined;
|
|
54
|
+
'aria-modal'?: boolean | undefined;
|
|
55
|
+
role?: import("react-native").Role | undefined;
|
|
56
|
+
accessibilityLabelledBy?: string | string[] | undefined;
|
|
57
|
+
'aria-labelledby'?: string | undefined;
|
|
58
|
+
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
59
|
+
'aria-live'?: ("polite" | "assertive" | "off") | undefined;
|
|
60
|
+
screenReaderFocusable?: boolean | undefined;
|
|
61
|
+
accessibilityElementsHidden?: boolean | undefined;
|
|
62
|
+
accessibilityViewIsModal?: boolean | undefined;
|
|
63
|
+
onAccessibilityEscape?: (() => void) | undefined;
|
|
64
|
+
onAccessibilityTap?: (() => void) | undefined;
|
|
65
|
+
onMagicTap?: (() => void) | undefined;
|
|
66
|
+
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
67
|
+
accessibilityLanguage?: string | undefined;
|
|
68
|
+
accessibilityShowsLargeContentViewer?: boolean | undefined;
|
|
69
|
+
accessibilityLargeContentTitle?: string | undefined;
|
|
70
|
+
accessibilityRespondsToUserInteraction?: boolean | undefined;
|
|
71
|
+
id?: string | undefined;
|
|
72
|
+
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined | undefined;
|
|
73
|
+
testID?: string | undefined | undefined;
|
|
74
|
+
nativeID?: string | undefined | undefined;
|
|
75
|
+
needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
|
|
76
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined | undefined;
|
|
77
|
+
removeClippedSubviews?: boolean | undefined | undefined;
|
|
78
|
+
collapsable?: boolean | undefined | undefined;
|
|
79
|
+
collapsableChildren?: boolean | undefined | undefined;
|
|
80
|
+
renderToHardwareTextureAndroid?: boolean | undefined | undefined;
|
|
81
|
+
focusable?: boolean | undefined | undefined;
|
|
82
|
+
tabIndex?: 0 | -1 | undefined | undefined;
|
|
83
|
+
shouldRasterizeIOS?: boolean | undefined | undefined;
|
|
84
|
+
isTVSelectable?: boolean | undefined | undefined;
|
|
85
|
+
hasTVPreferredFocus?: boolean | undefined | undefined;
|
|
86
|
+
tvParallaxShiftDistanceX?: number | undefined | undefined;
|
|
87
|
+
tvParallaxShiftDistanceY?: number | undefined | undefined;
|
|
88
|
+
tvParallaxTiltAngle?: number | undefined | undefined;
|
|
89
|
+
tvParallaxMagnification?: number | undefined | undefined;
|
|
90
|
+
onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
91
|
+
onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
92
|
+
onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
93
|
+
onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
94
|
+
onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
95
|
+
onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
96
|
+
onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
97
|
+
onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
98
|
+
onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
99
|
+
onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
100
|
+
onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
101
|
+
onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
|
|
102
|
+
onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
103
|
+
onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
104
|
+
onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
105
|
+
onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
106
|
+
onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
|
|
107
|
+
onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
108
|
+
onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
109
|
+
onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
110
|
+
onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
111
|
+
onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
112
|
+
onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
113
|
+
onPointerCancel?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
114
|
+
onPointerCancelCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
115
|
+
onPointerDown?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
116
|
+
onPointerDownCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
117
|
+
onPointerUp?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
118
|
+
onPointerUpCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
|
|
119
|
+
hasFeedbackText?: boolean | undefined;
|
|
120
|
+
hasHelpText?: boolean | undefined;
|
|
121
|
+
setHasFeedbackText?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
|
|
122
|
+
setHasHelpText?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
|
|
123
|
+
name?: string | undefined;
|
|
124
|
+
labelId?: string | undefined;
|
|
125
|
+
feedbackId?: string | undefined;
|
|
126
|
+
helpTextId?: string | undefined;
|
|
127
|
+
htmlProps?: {
|
|
128
|
+
[x: string]: unknown;
|
|
129
|
+
} | undefined;
|
|
130
|
+
inputRef?: React.RefObject<import("react-native").TextInput | null> | undefined;
|
|
131
|
+
focusInput?: (() => void) | undefined;
|
|
132
|
+
isRequired?: boolean | undefined;
|
|
133
|
+
};
|
|
134
|
+
isInvalid: boolean;
|
|
135
|
+
isReadOnly: boolean;
|
|
136
|
+
inputProps: any;
|
|
137
|
+
labelProps: Record<string, unknown>;
|
|
138
|
+
isChecked: any;
|
|
139
|
+
isDisabled: any;
|
|
140
|
+
isHovered: boolean;
|
|
141
|
+
hoverProps: {
|
|
142
|
+
onHoverIn: () => void;
|
|
143
|
+
onHoverOut: () => void;
|
|
144
|
+
};
|
|
145
|
+
mergedRef: import("react").RefCallback<unknown>;
|
|
146
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
147
|
+
};
|
|
148
|
+
export {};
|
|
149
|
+
//# sourceMappingURL=useRadioRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRadioRoot.d.ts","sourceRoot":"","sources":["../../../src/radio/useRadioRoot.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,UAAU,mBAAmB;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,EAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EACxB,EAAE,kBAA0B,EAAE,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDzD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ITileContextValue, ITileGroupContextValue } from './types';
|
|
2
|
+
export declare const TileProvider: import("react").FunctionComponent<{
|
|
3
|
+
children: import("react").ReactNode;
|
|
4
|
+
value: ITileContextValue;
|
|
5
|
+
}>, useTileContext: () => ITileContextValue;
|
|
6
|
+
export declare const TileGroupContextProvider: import("react").Provider<ITileGroupContextValue | null>;
|
|
7
|
+
export declare function useTileGroupContext(): ITileGroupContextValue;
|
|
8
|
+
export declare function useOptionalTileGroupContext(): ITileGroupContextValue | null;
|
|
9
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/tile/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGzE,eAAO,MAAO,YAAY;;;IAAE,cAAc,yBAAmD,CAAC;AAK9F,eAAO,MAAM,wBAAwB,yDAA4B,CAAC;AAElE,wBAAgB,mBAAmB,IAAI,sBAAsB,CAM5D;AAED,wBAAgB,2BAA2B,IAAI,sBAAsB,GAAG,IAAI,CAE3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileContent.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAY9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileDescription.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAYlE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ITileGroupProps } from './types';
|
|
3
|
+
export declare const createTileGroup: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileGroupProps & React.RefAttributes<T>>;
|
|
4
|
+
//# sourceMappingURL=createTileGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileGroup.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAK1E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAgB9D,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,8EAgH5D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ITileIndicatorProps } from './types';
|
|
3
|
+
export declare const createTileIndicator: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileIndicatorProps & React.RefAttributes<unknown>>;
|
|
4
|
+
//# sourceMappingURL=createTileIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileIndicator.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,wFA8BjE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ITileLeadingSlotProps } from './types';
|
|
3
|
+
export declare const createTileLeadingSlot: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileLeadingSlotProps & React.RefAttributes<unknown>>;
|
|
4
|
+
//# sourceMappingURL=createTileLeadingSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileLeadingSlot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileLeadingSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIrD,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,0FAuBnE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ITileProps } from './types';
|
|
3
|
+
export declare const createTileRoot: <T>(BasePressable: React.ComponentType<T>) => React.ForwardRefExoticComponent<ITileProps & React.RefAttributes<unknown>>;
|
|
4
|
+
//# sourceMappingURL=createTileRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileRoot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,SAAS,CAAC;AAQrE,eAAO,MAAM,cAAc,GAAI,CAAC,EAAG,eAAe,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,+EA6GpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileTitle.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAY5D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Generic trailing content (chevron, amount, chip, status). Distinct from `Tile.Indicator`,
|
|
4
|
+
* which is purpose-built for the radio/checkbox selection affordance.
|
|
5
|
+
*
|
|
6
|
+
* Trailing content is meaningful by default (`aria-hidden` falsy), unlike the indicator.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createTileTrailingSlot: <T>(Base: React.ComponentType<T>) => React.ForwardRefExoticComponent<import("react-native").ViewProps & React.RefAttributes<unknown>>;
|
|
9
|
+
//# sourceMappingURL=createTileTrailingSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTileTrailingSlot.d.ts","sourceRoot":"","sources":["../../../src/tile/createTileTrailingSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,qGAYnE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ITileComponentType } from './types';
|
|
3
|
+
export type { ITileComponentType, ITileContentProps, ITileContextValue, ITileDescriptionProps, ITileGroupMultipleProps, ITileGroupProps, ITileGroupSingleProps, ITileGroupContextValue, ITileIndicatorProps, ITileLeadingSlotProps, ITilePressablePassthrough, ITileProps, ITileTitleProps, ITileTrailingSlotProps, TileGroupType, TileGroupValue, } from './types';
|
|
4
|
+
export { TileProvider, useTileContext } from './context';
|
|
5
|
+
export declare function createTile<Pressable, Leading, Content, Title, Description, Indicator, TrailingSlot, Group>(BaseComponents: {
|
|
6
|
+
Pressable: React.ComponentType<Pressable>;
|
|
7
|
+
LeadingSlot: React.ComponentType<Leading>;
|
|
8
|
+
Content: React.ComponentType<Content>;
|
|
9
|
+
Title: React.ComponentType<Title>;
|
|
10
|
+
Description: React.ComponentType<Description>;
|
|
11
|
+
Indicator: React.ComponentType<Indicator>;
|
|
12
|
+
TrailingSlot: React.ComponentType<TrailingSlot>;
|
|
13
|
+
Group: React.ComponentType<Group>;
|
|
14
|
+
}): ITileComponentType<Pressable, Leading, Content, Title, Description, Indicator, TrailingSlot, Group>;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,wBAAgB,UAAU,CACxB,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,EACL,cAAc,EAAE;IAChB,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC1C,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAChD,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CACnC,GA2BO,kBAAkB,CACtB,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,CACN,CACF"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import type { PressableProps, TextProps, ViewProps } from 'react-native';
|
|
3
|
+
import type { WithStyleContextProps } from '@cdx-ui/utils';
|
|
4
|
+
export type TileGroupType = 'single' | 'multiple';
|
|
5
|
+
export type TileGroupValue = string | string[] | undefined;
|
|
6
|
+
interface ITileGroupBaseProps extends ViewProps, WithStyleContextProps {
|
|
7
|
+
/** Disables the whole group. */
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
/** Accessible name for the group (radiogroup / group). */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ITileGroupSingleProps extends ITileGroupBaseProps {
|
|
13
|
+
/** Single-select (radio semantics). One value at a time. */
|
|
14
|
+
type: 'single';
|
|
15
|
+
/** Controlled selected value. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Uncontrolled initial value. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Called when selection changes. */
|
|
20
|
+
onValueChange?: (value: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface ITileGroupMultipleProps extends ITileGroupBaseProps {
|
|
23
|
+
/** Multi-select (checkbox semantics). Zero to `max` values at a time. */
|
|
24
|
+
type: 'multiple';
|
|
25
|
+
/** Controlled selected values. */
|
|
26
|
+
value?: string[];
|
|
27
|
+
/** Uncontrolled initial values. */
|
|
28
|
+
defaultValue?: string[];
|
|
29
|
+
/** Called when selection changes. */
|
|
30
|
+
onValueChange?: (value: string[]) => void;
|
|
31
|
+
/** Maximum selections allowed. @default Infinity */
|
|
32
|
+
max?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Discriminated union: `type` narrows `value` / `defaultValue` / `onValueChange`,
|
|
36
|
+
* and `max` is only valid on `type="multiple"`.
|
|
37
|
+
*/
|
|
38
|
+
export type ITileGroupProps = ITileGroupSingleProps | ITileGroupMultipleProps;
|
|
39
|
+
export interface ITileGroupContextValue {
|
|
40
|
+
type: TileGroupType;
|
|
41
|
+
/** Current selection (string for single, array for multiple). */
|
|
42
|
+
value: string | string[] | undefined;
|
|
43
|
+
toggleValue: (tileValue: string) => void;
|
|
44
|
+
isSelected: (tileValue: string) => boolean;
|
|
45
|
+
/** Group-level disabled or multi-select at max (unselected tiles). */
|
|
46
|
+
isTileDisabledByGroup: (tileValue: string) => boolean;
|
|
47
|
+
isGroupDisabled: boolean;
|
|
48
|
+
max: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ITileContextValue {
|
|
51
|
+
/** This tile's `value`. */
|
|
52
|
+
value: string;
|
|
53
|
+
isSelected: boolean;
|
|
54
|
+
/** Effective disabled (group rules + tile `disabled`). */
|
|
55
|
+
isDisabled: boolean;
|
|
56
|
+
selectionType: TileGroupType;
|
|
57
|
+
}
|
|
58
|
+
export type ITilePressablePassthrough = Partial<Pick<PressableProps, 'onPressIn' | 'onPressOut' | 'onHoverIn' | 'onHoverOut'>>;
|
|
59
|
+
export interface ITileProps extends PressableProps, ITilePressablePassthrough, WithStyleContextProps {
|
|
60
|
+
/**
|
|
61
|
+
* Identifies this tile within `Tile.Group`. Must be unique within the group.
|
|
62
|
+
* Standalone tiles still require a value (useful for form submission, analytics, etc.).
|
|
63
|
+
*/
|
|
64
|
+
value: string;
|
|
65
|
+
/**
|
|
66
|
+
* Disables this tile (in addition to group rules such as multi-select max).
|
|
67
|
+
*/
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Controlled selected state for **standalone** usage (no parent `Tile.Group`).
|
|
71
|
+
* Ignored when the tile is rendered inside a `Tile.Group` — selection is owned by the group.
|
|
72
|
+
*/
|
|
73
|
+
isSelected?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Initial selected state for **standalone**, uncontrolled usage.
|
|
76
|
+
*/
|
|
77
|
+
defaultSelected?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Called when standalone selection state changes. Group context overrides this — when inside
|
|
80
|
+
* a `Tile.Group`, use the group's `onValueChange` instead.
|
|
81
|
+
*/
|
|
82
|
+
onSelectedChange?: (isSelected: boolean) => void;
|
|
83
|
+
}
|
|
84
|
+
export interface ITileLeadingSlotProps extends ViewProps {
|
|
85
|
+
/**
|
|
86
|
+
* Leading content is decorative by default for screen readers.
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
'aria-hidden'?: boolean;
|
|
90
|
+
}
|
|
91
|
+
export type ITileContentProps = ViewProps;
|
|
92
|
+
export type ITileTitleProps = TextProps;
|
|
93
|
+
export type ITileDescriptionProps = TextProps;
|
|
94
|
+
export interface ITileIndicatorProps extends ViewProps {
|
|
95
|
+
/**
|
|
96
|
+
* Explicit indicator visual. When inside a `Tile.Group`, auto-infers from `type`
|
|
97
|
+
* (`single` → radio, `multiple` → checkbox). For standalone tiles, defaults to `'checkbox'`
|
|
98
|
+
* to match the standalone `checkbox` ARIA role; override with `indicatorType="radio"` if
|
|
99
|
+
* a radio-style visual is needed.
|
|
100
|
+
*/
|
|
101
|
+
indicatorType?: 'radio' | 'checkbox';
|
|
102
|
+
children?: ReactNode;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Generic trailing content slot. Use for chevrons, amounts, chips, status text — anything that
|
|
106
|
+
* is **not** the radio/checkbox selection affordance. For that, use `Tile.Indicator`.
|
|
107
|
+
*/
|
|
108
|
+
export type ITileTrailingSlotProps = ViewProps;
|
|
109
|
+
export type ITileComponentType<RootRef, LeadingSlot, Content, Title, Description, Indicator, TrailingSlot, Group> = ForwardRefExoticComponent<RefAttributes<RootRef> & ITileProps> & {
|
|
110
|
+
Group: ForwardRefExoticComponent<RefAttributes<Group> & PropsWithoutRef<Group> & ITileGroupProps>;
|
|
111
|
+
LeadingSlot: ForwardRefExoticComponent<RefAttributes<LeadingSlot> & PropsWithoutRef<LeadingSlot> & ITileLeadingSlotProps>;
|
|
112
|
+
Content: ForwardRefExoticComponent<RefAttributes<Content> & PropsWithoutRef<Content> & ITileContentProps>;
|
|
113
|
+
Title: ForwardRefExoticComponent<RefAttributes<Title> & PropsWithoutRef<Title> & ITileTitleProps>;
|
|
114
|
+
Description: ForwardRefExoticComponent<RefAttributes<Description> & PropsWithoutRef<Description> & ITileDescriptionProps>;
|
|
115
|
+
Indicator: ForwardRefExoticComponent<RefAttributes<Indicator> & PropsWithoutRef<Indicator> & ITileIndicatorProps>;
|
|
116
|
+
TrailingSlot: ForwardRefExoticComponent<RefAttributes<TrailingSlot> & PropsWithoutRef<TrailingSlot> & ITileTrailingSlotProps>;
|
|
117
|
+
};
|
|
118
|
+
export {};
|
|
119
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EA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AAS,CAAC;AAE/C,MAAM,MAAM,kBAAkB,CAC5B,OAAO,EACP,WAAW,EACX,OAAO,EACP,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,KAAK,IACH,yBAAyB,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,GAAG;IACnE,KAAK,EAAE,yBAAyB,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC;IAClG,WAAW,EAAE,yBAAyB,CACpC,aAAa,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,qBAAqB,CAClF,CAAC;IACF,OAAO,EAAE,yBAAyB,CAChC,aAAa,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,iBAAiB,CACtE,CAAC;IACF,KAAK,EAAE,yBAAyB,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC;IAClG,WAAW,EAAE,yBAAyB,CACpC,aAAa,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,qBAAqB,CAClF,CAAC;IACF,SAAS,EAAE,yBAAyB,CAClC,aAAa,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,mBAAmB,CAC5E,CAAC;IACF,YAAY,EAAE,yBAAyB,CACrC,aAAa,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,sBAAsB,CACrF,CAAC;CACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/primitives",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.20",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -51,13 +51,16 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"@react-aria/utils": "^3.33.0",
|
|
54
55
|
"@react-aria/visually-hidden": "3.8.30",
|
|
55
56
|
"@react-native-aria/checkbox": "0.2.10",
|
|
56
57
|
"@react-native-aria/focus": "^0.2.9",
|
|
57
58
|
"@react-native-aria/interactions": "^0.2.16",
|
|
59
|
+
"@react-native-aria/radio": "0.2.13",
|
|
58
60
|
"@react-stately/checkbox": "3.7.4",
|
|
61
|
+
"@react-stately/radio": "3.12.0",
|
|
59
62
|
"@react-stately/toggle": "3.9.4",
|
|
60
|
-
"@cdx-ui/utils": "0.0.1-beta.
|
|
63
|
+
"@cdx-ui/utils": "0.0.1-beta.20"
|
|
61
64
|
},
|
|
62
65
|
"devDependencies": {
|
|
63
66
|
"@types/react": "*",
|
package/src/index.ts
CHANGED
|
@@ -7,9 +7,12 @@ export * from './form';
|
|
|
7
7
|
export * from './input';
|
|
8
8
|
export * from './otp-input';
|
|
9
9
|
export * from './link';
|
|
10
|
+
export * from './list-item';
|
|
10
11
|
export { type EdgeInsets, OverlayInsetsProvider } from './overlay';
|
|
11
12
|
export * from './select';
|
|
12
13
|
export * from './switch';
|
|
14
|
+
export * from './tile';
|
|
13
15
|
export * from './progress';
|
|
16
|
+
export * from './radio';
|
|
14
17
|
export type { InteractionState } from './types';
|
|
15
18
|
export { dataAttributes } from './utils/dataAttributes';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { dataAttributes } from '../utils/dataAttributes';
|
|
3
|
+
import type { IListItemContentProps } from './types';
|
|
4
|
+
|
|
5
|
+
const contentStyle = {
|
|
6
|
+
flex: 1,
|
|
7
|
+
flexDirection: 'column' as const,
|
|
8
|
+
minWidth: 0,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const createListItemContent = <T,>(Base: React.ComponentType<T>) =>
|
|
12
|
+
forwardRef(({ children, style, ...props }: IListItemContentProps, ref: React.Ref<unknown>) => (
|
|
13
|
+
<Base
|
|
14
|
+
{...(props as T)}
|
|
15
|
+
{...dataAttributes({
|
|
16
|
+
slot: 'list-item-content',
|
|
17
|
+
})}
|
|
18
|
+
ref={ref as React.Ref<T>}
|
|
19
|
+
style={[contentStyle, style]}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</Base>
|
|
23
|
+
));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { dataAttributes } from '../utils/dataAttributes';
|
|
3
|
+
import type { IListItemDescriptionProps } from './types';
|
|
4
|
+
|
|
5
|
+
export const createListItemDescription = <T,>(Base: React.ComponentType<T>) =>
|
|
6
|
+
forwardRef(
|
|
7
|
+
({ children, style, ...props }: IListItemDescriptionProps, ref: React.Ref<unknown>) => (
|
|
8
|
+
<Base
|
|
9
|
+
{...(props as T)}
|
|
10
|
+
{...dataAttributes({
|
|
11
|
+
slot: 'list-item-description',
|
|
12
|
+
})}
|
|
13
|
+
ref={ref as React.Ref<T>}
|
|
14
|
+
style={style}
|
|
15
|
+
>
|
|
16
|
+
{children}
|
|
17
|
+
</Base>
|
|
18
|
+
),
|
|
19
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { dataAttributes } from '../utils/dataAttributes';
|
|
3
|
+
import type { IListItemLeadingSlotProps } from './types';
|
|
4
|
+
|
|
5
|
+
const shrinkZero = { flexShrink: 0 as const };
|
|
6
|
+
|
|
7
|
+
export const createListItemLeadingSlot = <T,>(Base: React.ComponentType<T>) =>
|
|
8
|
+
forwardRef(
|
|
9
|
+
(
|
|
10
|
+
{ 'aria-hidden': ariaHidden, style, children, ...props }: IListItemLeadingSlotProps,
|
|
11
|
+
ref: React.Ref<unknown>,
|
|
12
|
+
) => {
|
|
13
|
+
const accessibilityElementsHidden = ariaHidden !== false;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Base
|
|
17
|
+
{...(props as T)}
|
|
18
|
+
{...dataAttributes({
|
|
19
|
+
slot: 'list-item-leading',
|
|
20
|
+
})}
|
|
21
|
+
accessibilityElementsHidden={accessibilityElementsHidden}
|
|
22
|
+
aria-hidden={ariaHidden}
|
|
23
|
+
ref={ref as React.Ref<T>}
|
|
24
|
+
style={[shrinkZero, style]}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</Base>
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { dataAttributes } from '../utils/dataAttributes';
|
|
3
|
+
import type { IListItemMetaProps } from './types';
|
|
4
|
+
|
|
5
|
+
export const createListItemMeta = <T,>(Base: React.ComponentType<T>) =>
|
|
6
|
+
forwardRef(({ children, style, ...props }: IListItemMetaProps, ref: React.Ref<unknown>) => (
|
|
7
|
+
<Base
|
|
8
|
+
{...(props as T)}
|
|
9
|
+
{...dataAttributes({
|
|
10
|
+
slot: 'list-item-meta',
|
|
11
|
+
})}
|
|
12
|
+
ref={ref as React.Ref<T>}
|
|
13
|
+
style={style}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</Base>
|
|
17
|
+
));
|