@ankhorage/surface 2.0.3 → 2.1.1
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/CHANGELOG.md +12 -0
- package/README.md +13 -1
- package/dist/components/action-sheet/ActionSheet.d.ts +1 -1
- package/dist/components/action-sheet/ActionSheet.d.ts.map +1 -1
- package/dist/components/action-sheet/ActionSheet.js +5 -4
- package/dist/components/action-sheet/ActionSheet.js.map +1 -1
- package/dist/components/action-sheet/ActionSheetItem.d.ts +1 -1
- package/dist/components/action-sheet/ActionSheetItem.d.ts.map +1 -1
- package/dist/components/action-sheet/ActionSheetItem.js +2 -2
- package/dist/components/action-sheet/ActionSheetItem.js.map +1 -1
- package/dist/components/action-sheet/types.d.ts +3 -0
- package/dist/components/action-sheet/types.d.ts.map +1 -1
- package/dist/components/action-sheet/types.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +4 -3
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/types.d.ts +2 -0
- package/dist/components/drawer/types.d.ts.map +1 -1
- package/dist/components/drawer/types.js.map +1 -1
- package/dist/components/menu/Menu.d.ts +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +10 -6
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/menu/types.d.ts +2 -0
- package/dist/components/menu/types.d.ts.map +1 -1
- package/dist/components/menu/types.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +4 -3
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/types.d.ts +2 -0
- package/dist/components/modal/types.d.ts.map +1 -1
- package/dist/components/modal/types.js.map +1 -1
- package/dist/components/navigation/DrawerNavigation.d.ts +1 -1
- package/dist/components/navigation/DrawerNavigation.d.ts.map +1 -1
- package/dist/components/navigation/DrawerNavigation.js +2 -2
- package/dist/components/navigation/DrawerNavigation.js.map +1 -1
- package/dist/components/navigation/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/navigation/DrawerNavigationItem.d.ts.map +1 -1
- package/dist/components/navigation/DrawerNavigationItem.js +2 -2
- package/dist/components/navigation/DrawerNavigationItem.js.map +1 -1
- package/dist/components/navigation/NavigationItem.d.ts +1 -1
- package/dist/components/navigation/NavigationItem.d.ts.map +1 -1
- package/dist/components/navigation/NavigationItem.js +2 -2
- package/dist/components/navigation/NavigationItem.js.map +1 -1
- package/dist/components/navigation/NavigationList.d.ts +1 -1
- package/dist/components/navigation/NavigationList.d.ts.map +1 -1
- package/dist/components/navigation/NavigationList.js +2 -2
- package/dist/components/navigation/NavigationList.js.map +1 -1
- package/dist/components/navigation/TabBar.d.ts +1 -1
- package/dist/components/navigation/TabBar.d.ts.map +1 -1
- package/dist/components/navigation/TabBar.js +2 -2
- package/dist/components/navigation/TabBar.js.map +1 -1
- package/dist/components/navigation/TabBarItem.d.ts +1 -1
- package/dist/components/navigation/TabBarItem.d.ts.map +1 -1
- package/dist/components/navigation/TabBarItem.js +2 -2
- package/dist/components/navigation/TabBarItem.js.map +1 -1
- package/dist/components/navigation/types.d.ts +7 -0
- package/dist/components/navigation/types.d.ts.map +1 -1
- package/dist/components/navigation/types.js.map +1 -1
- package/dist/components/tabs/Tab.d.ts +1 -1
- package/dist/components/tabs/Tab.d.ts.map +1 -1
- package/dist/components/tabs/Tab.js +9 -6
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/tabs/types.d.ts +2 -0
- package/dist/components/tabs/types.d.ts.map +1 -1
- package/dist/components/tabs/types.js.map +1 -1
- package/dist/components/text-input/TextInput.d.ts +1 -1
- package/dist/components/text-input/TextInput.d.ts.map +1 -1
- package/dist/components/text-input/TextInput.js +8 -2
- package/dist/components/text-input/TextInput.js.map +1 -1
- package/dist/components/text-input/types.d.ts +2 -0
- package/dist/components/text-input/types.d.ts.map +1 -1
- package/dist/components/text-input/types.js.map +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.d.ts.map +1 -1
- package/dist/components/toast/Toast.js +3 -2
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/toast/types.d.ts +2 -0
- package/dist/components/toast/types.d.ts.map +1 -1
- package/dist/components/toast/types.js.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +3 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/types.d.ts +2 -0
- package/dist/components/tooltip/types.d.ts.map +1 -1
- package/dist/components/tooltip/types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactionPolicy.d.ts +5 -0
- package/dist/interactionPolicy.d.ts.map +1 -0
- package/dist/interactionPolicy.js +2 -0
- package/dist/interactionPolicy.js.map +1 -0
- package/dist/primitives/button-base/ButtonBase.d.ts +1 -1
- package/dist/primitives/button-base/ButtonBase.d.ts.map +1 -1
- package/dist/primitives/button-base/ButtonBase.js +3 -2
- package/dist/primitives/button-base/ButtonBase.js.map +1 -1
- package/dist/primitives/button-base/types.d.ts +2 -1
- package/dist/primitives/button-base/types.d.ts.map +1 -1
- package/dist/primitives/button-base/types.js.map +1 -1
- package/package.json +3 -3
- package/src/components/action-sheet/ActionSheet.tsx +5 -2
- package/src/components/action-sheet/ActionSheetItem.tsx +2 -0
- package/src/components/action-sheet/types.ts +3 -0
- package/src/components/drawer/Drawer.tsx +4 -2
- package/src/components/drawer/types.ts +3 -0
- package/src/components/menu/Menu.tsx +18 -6
- package/src/components/menu/types.ts +3 -0
- package/src/components/modal/Modal.tsx +4 -2
- package/src/components/modal/types.ts +3 -0
- package/src/components/navigation/DrawerNavigation.tsx +8 -1
- package/src/components/navigation/DrawerNavigationItem.tsx +7 -1
- package/src/components/navigation/NavigationItem.tsx +7 -1
- package/src/components/navigation/NavigationList.tsx +8 -1
- package/src/components/navigation/TabBar.tsx +8 -2
- package/src/components/navigation/TabBarItem.tsx +2 -1
- package/src/components/navigation/policy.test.ts +96 -0
- package/src/components/navigation/types.ts +7 -0
- package/src/components/tabs/Tab.tsx +17 -6
- package/src/components/tabs/types.ts +3 -0
- package/src/components/text-input/TextInput.tsx +10 -2
- package/src/components/text-input/types.ts +2 -0
- package/src/components/toast/Toast.tsx +10 -2
- package/src/components/toast/types.ts +2 -0
- package/src/components/tooltip/Tooltip.tsx +6 -4
- package/src/components/tooltip/types.ts +3 -0
- package/src/index.test.ts +1 -0
- package/src/index.ts +1 -0
- package/src/interactionPolicy.test.ts +86 -0
- package/src/interactionPolicy.ts +5 -0
- package/src/primitives/button-base/ButtonBase.tsx +4 -2
- package/src/primitives/button-base/types.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/components/text-input/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,oBAAoB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EAC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MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,EAEf;MAAA,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACnB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CACzE,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, TextInput as ReactNativeTextInput, View } from 'react-native';\n\nimport {\n resolveControlSize,\n resolveFieldState,\n resolveFocusRingStyles,\n resolveInputColors,\n resolveTextStyles,\n} from '../../internal/resolvers';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { TextInputProps } from './types';\n\nexport function TextInput({\n value,\n defaultValue,\n onChangeText,\n placeholder,\n size = 'm',\n disabled = false,\n readOnly = false,\n invalid = false,\n leadingAccessory,\n trailingAccessory,\n interactionPolicy = 'enabled',\n style,\n testID,\n onFocus,\n onBlur,\n ...props\n}: TextInputProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n const [focused, setFocused] = React.useState(false);\n const fieldState = resolveFieldState({\n disabled,\n focused,\n invalid,\n readOnly,\n });\n const colors = resolveInputColors(theme, fieldState);\n const resolvedTextStyle = resolveTextStyles(theme, {\n variant: controlSize.textVariant,\n });\n const resolvedLineHeight =\n typeof resolvedTextStyle.lineHeight === 'number'\n ? resolvedTextStyle.lineHeight\n : controlSize.minHeight - controlSize.paddingVertical * 2;\n const lineCount = Math.max(props.numberOfLines ?? 1, 1);\n const inputMinHeight = props.multiline\n ? resolvedLineHeight * lineCount\n : controlSize.minHeight - controlSize.paddingVertical * 2;\n const containerMinHeight = props.multiline\n ? inputMinHeight + controlSize.paddingVertical * 2\n : controlSize.minHeight;\n const passive = interactionPolicy === 'passive';\n\n const handleFocus: NonNullable<TextInputProps['onFocus']> = (event) => {\n setFocused(true);\n onFocus?.(event);\n };\n\n const handleBlur: NonNullable<TextInputProps['onBlur']> = (event) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return (\n <View\n style={[\n {\n minHeight: containerMinHeight,\n paddingHorizontal: controlSize.paddingHorizontal,\n paddingVertical: controlSize.paddingVertical,\n borderRadius: controlSize.borderRadius,\n borderWidth: 1,\n borderColor: colors.borderColor,\n backgroundColor: colors.backgroundColor,\n flexDirection: 'row',\n alignItems: props.multiline ? 'flex-start' : 'center',\n opacity: colors.opacity,\n },\n resolveFocusRingStyles(theme.semantics.border.focus, focused, Platform.OS === 'web'),\n ]}\n >\n {leadingAccessory ? (\n <View style={{ marginRight: theme.spacing.s }}>{leadingAccessory}</View>\n ) : null}\n <ReactNativeTextInput\n {...props}\n defaultValue={defaultValue}\n editable={passive ? false : !disabled && !readOnly}\n numberOfLines={props.multiline ? props.numberOfLines : 1}\n onBlur={handleBlur}\n onChangeText={(nextValue) => {\n if (passive) {\n return;\n }\n\n onChangeText?.(nextValue);\n }}\n onFocus={handleFocus}\n placeholder={placeholder}\n placeholderTextColor={colors.placeholderColor}\n readOnly={readOnly}\n style={[\n {\n flex: 1,\n minHeight: inputMinHeight,\n padding: 0,\n color: colors.contentColor,\n textAlignVertical: props.multiline ? 'top' : 'center',\n },\n style,\n ]}\n testID={testID}\n value={value}\n />\n {trailingAccessory ? (\n <View style={{ marginLeft: theme.spacing.s }}>{trailingAccessory}</View>\n ) : null}\n </View>\n );\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { StyleProp, TextInputProps as ReactNativeTextInputProps, TextStyle } from 'react-native';
|
|
3
|
+
import type { InteractionPolicy } from '../../interactionPolicy';
|
|
3
4
|
import type { ControlSize } from '../../internal/resolvers/resolveControlSize';
|
|
4
5
|
export interface TextInputProps extends Omit<ReactNativeTextInputProps, 'defaultValue' | 'editable' | 'onChangeText' | 'placeholderTextColor' | 'style' | 'testID' | 'value'> {
|
|
5
6
|
value?: string;
|
|
@@ -12,6 +13,7 @@ export interface TextInputProps extends Omit<ReactNativeTextInputProps, 'default
|
|
|
12
13
|
invalid?: boolean;
|
|
13
14
|
leadingAccessory?: React.ReactNode;
|
|
14
15
|
trailingAccessory?: React.ReactNode;
|
|
16
|
+
interactionPolicy?: InteractionPolicy;
|
|
15
17
|
style?: StyleProp<TextStyle>;
|
|
16
18
|
testID?: string;
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,SAAS,EACT,cAAc,IAAI,yBAAyB,EAC3C,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE/E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,yBAAyB,EACvB,cAAc,GACd,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,GACP,QAAQ,GACR,OAAO,CACV;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,SAAS,EACT,cAAc,IAAI,yBAAyB,EAC3C,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAE/E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,yBAAyB,EACvB,cAAc,GACd,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,GACP,QAAQ,GACR,OAAO,CACV;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/text-input/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type {\n StyleProp,\n TextInputProps as ReactNativeTextInputProps,\n TextStyle,\n} from 'react-native';\n\nimport type { ControlSize } from '../../internal/resolvers/resolveControlSize';\n\nexport interface TextInputProps extends Omit<\n ReactNativeTextInputProps,\n | 'defaultValue'\n | 'editable'\n | 'onChangeText'\n | 'placeholderTextColor'\n | 'style'\n | 'testID'\n | 'value'\n> {\n value?: string;\n defaultValue?: string;\n onChangeText?: ((text: string) => void) | undefined;\n placeholder?: string;\n size?: ControlSize;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n leadingAccessory?: React.ReactNode;\n trailingAccessory?: React.ReactNode;\n style?: StyleProp<TextStyle>;\n testID?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/text-input/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type {\n StyleProp,\n TextInputProps as ReactNativeTextInputProps,\n TextStyle,\n} from 'react-native';\n\nimport type { InteractionPolicy } from '../../interactionPolicy';\nimport type { ControlSize } from '../../internal/resolvers/resolveControlSize';\n\nexport interface TextInputProps extends Omit<\n ReactNativeTextInputProps,\n | 'defaultValue'\n | 'editable'\n | 'onChangeText'\n | 'placeholderTextColor'\n | 'style'\n | 'testID'\n | 'value'\n> {\n value?: string;\n defaultValue?: string;\n onChangeText?: ((text: string) => void) | undefined;\n placeholder?: string;\n size?: ControlSize;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n leadingAccessory?: React.ReactNode;\n trailingAccessory?: React.ReactNode;\n interactionPolicy?: InteractionPolicy;\n style?: StyleProp<TextStyle>;\n testID?: string;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ToastProps } from './types';
|
|
3
|
-
export declare function Toast({ title, description, status, onDismiss, testID }: ToastProps): React.JSX.Element;
|
|
3
|
+
export declare function Toast({ title, description, status, onDismiss, interactionPolicy, testID, }: ToastProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAgC1C,wBAAgB,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAgC1C,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAkB,EAClB,SAAS,EACT,iBAA6B,EAC7B,MAAM,GACP,EAAE,UAAU,qBA0CZ"}
|
|
@@ -31,10 +31,11 @@ function resolveToastStatusTextColor(status) {
|
|
|
31
31
|
return 'primary';
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
export function Toast({ title, description, status = 'default', onDismiss, testID }) {
|
|
34
|
+
export function Toast({ title, description, status = 'default', onDismiss, interactionPolicy = 'enabled', testID, }) {
|
|
35
35
|
const { theme } = useTheme();
|
|
36
36
|
const statusColor = resolveToastStatusColor(theme, status);
|
|
37
37
|
const statusTextColor = resolveToastStatusTextColor(status);
|
|
38
|
+
const passive = interactionPolicy === 'passive';
|
|
38
39
|
return (<Surface p="m" style={{
|
|
39
40
|
borderLeftColor: statusColor,
|
|
40
41
|
borderLeftWidth: 3,
|
|
@@ -50,7 +51,7 @@ export function Toast({ title, description, status = 'default', onDismiss, testI
|
|
|
50
51
|
</Text>) : null}
|
|
51
52
|
{description ? <Text emphasis="muted">{description}</Text> : null}
|
|
52
53
|
</Box>
|
|
53
|
-
{onDismiss ? (<Pressable accessibilityLabel="Dismiss notification" accessibilityRole="button" onPress={onDismiss} testID={testID ? `${testID}-dismiss` : undefined}>
|
|
54
|
+
{onDismiss ? (<Pressable accessibilityLabel="Dismiss notification" accessibilityRole="button" onPress={passive ? undefined : onDismiss} testID={testID ? `${testID}-dismiss` : undefined}>
|
|
54
55
|
<Text color={statusTextColor}>×</Text>
|
|
55
56
|
</Pressable>) : null}
|
|
56
57
|
</Inline>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIpD,SAAS,uBAAuB,CAAC,KAAmB,EAAE,MAA4B;IAChF,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;QACtC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;QACtC,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;QACpC,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACnC;YACE,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,2BAA2B,CAAC,MAA4B;IAC/D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,SAAS,C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AAA,EAAE,GAAG,CACL;QAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,CAAC,SAAS,CACR,kBAAkB,CAAC,sBAAsB,CACzC,iBAAiB,CAAC,QAAQ,CAC1B,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CACzC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAEjD;YAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CACvC;UAAA,EAAE,SAAS,CAAC,CACb,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,OAAO,CAAC,CACX,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\n\nimport { Box, Inline, Surface } from '../../layout';\nimport { Text } from '../../primitives/text';\nimport type { SurfaceColor } from '../../surfaceColor';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../theme/types';\nimport type { ToastProps } from './types';\n\nfunction resolveToastStatusColor(theme: SurfaceTheme, status: ToastProps['status']) {\n switch (status) {\n case 'success':\n return theme.semantics.success.base;\n case 'warning':\n return theme.semantics.warning.base;\n case 'error':\n return theme.semantics.error.base;\n case 'info':\n return theme.semantics.info.base;\n default:\n return theme.semantics.action.primary.base;\n }\n}\n\nfunction resolveToastStatusTextColor(status: ToastProps['status']): SurfaceColor {\n switch (status) {\n case 'success':\n return 'success';\n case 'warning':\n return 'warning';\n case 'error':\n return 'error';\n case 'info':\n return 'info';\n default:\n return 'primary';\n }\n}\n\nexport function Toast({\n title,\n description,\n status = 'default',\n onDismiss,\n interactionPolicy = 'enabled',\n testID,\n}: ToastProps) {\n const { theme } = useTheme();\n const statusColor = resolveToastStatusColor(theme, status);\n const statusTextColor = resolveToastStatusTextColor(status);\n const passive = interactionPolicy === 'passive';\n\n return (\n <Surface\n p=\"m\"\n style={{\n borderLeftColor: statusColor,\n borderLeftWidth: 3,\n minWidth: 280,\n shadowOpacity: 0.14,\n shadowRadius: 12,\n shadowOffset: { width: 0, height: 6 },\n }}\n testID={testID}\n variant=\"raised\"\n >\n <Inline align=\"center\" justify=\"space-between\">\n <Box flex={1}>\n {title ? (\n <Text variant=\"label\" weight=\"medium\">\n {title}\n </Text>\n ) : null}\n {description ? <Text emphasis=\"muted\">{description}</Text> : null}\n </Box>\n {onDismiss ? (\n <Pressable\n accessibilityLabel=\"Dismiss notification\"\n accessibilityRole=\"button\"\n onPress={passive ? undefined : onDismiss}\n testID={testID ? `${testID}-dismiss` : undefined}\n >\n <Text color={statusTextColor}>×</Text>\n </Pressable>\n ) : null}\n </Inline>\n </Surface>\n );\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { InteractionPolicy } from '../../interactionPolicy';
|
|
2
3
|
import type { SurfaceStatusColor } from '../../surfaceColor';
|
|
3
4
|
export type ToastStatus = 'default' | SurfaceStatusColor;
|
|
4
5
|
export interface ToastProps {
|
|
@@ -6,6 +7,7 @@ export interface ToastProps {
|
|
|
6
7
|
description?: React.ReactNode;
|
|
7
8
|
status?: ToastStatus;
|
|
8
9
|
onDismiss?: (() => void) | undefined;
|
|
10
|
+
interactionPolicy?: InteractionPolicy;
|
|
9
11
|
testID?: string;
|
|
10
12
|
}
|
|
11
13
|
export interface ToastOptions extends Omit<ToastProps, 'onDismiss'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { SurfaceStatusColor } from '../../surfaceColor';\n\nexport type ToastStatus = 'default' | SurfaceStatusColor;\n\nexport interface ToastProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n status?: ToastStatus;\n onDismiss?: (() => void) | undefined;\n testID?: string;\n}\n\nexport interface ToastOptions extends Omit<ToastProps, 'onDismiss'> {\n duration?: number;\n id?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../../interactionPolicy';\nimport type { SurfaceStatusColor } from '../../surfaceColor';\n\nexport type ToastStatus = 'default' | SurfaceStatusColor;\n\nexport interface ToastProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n status?: ToastStatus;\n onDismiss?: (() => void) | undefined;\n interactionPolicy?: InteractionPolicy;\n testID?: string;\n}\n\nexport interface ToastOptions extends Omit<ToastProps, 'onDismiss'> {\n duration?: number;\n id?: string;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TooltipProps } from './types';
|
|
3
|
-
export declare function Tooltip({ children, content, delay, placement, testID, }: TooltipProps): React.JSX.Element;
|
|
3
|
+
export declare function Tooltip({ children, content, delay, interactionPolicy, placement, testID, }: TooltipProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAe5C,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,KAAW,EACX,SAAiB,EACjB,MAAM,GACP,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAe5C,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,KAAW,EACX,iBAA6B,EAC7B,SAAiB,EACjB,MAAM,GACP,EAAE,YAAY,qBAgFd"}
|
|
@@ -11,13 +11,14 @@ function measureNode(node, callback) {
|
|
|
11
11
|
callback({ height, width, x, y });
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export function Tooltip({ children, content, delay = 150, placement = 'top', testID, }) {
|
|
14
|
+
export function Tooltip({ children, content, delay = 150, interactionPolicy = 'enabled', placement = 'top', testID, }) {
|
|
15
15
|
const { theme } = useTheme();
|
|
16
16
|
const animation = resolveOverlayAnimation('tooltip');
|
|
17
17
|
const anchorRef = React.useRef(null);
|
|
18
18
|
const timeoutRef = React.useRef(null);
|
|
19
19
|
const [visible, setVisible] = React.useState(false);
|
|
20
20
|
const [layout, setLayout] = React.useState(null);
|
|
21
|
+
const passive = interactionPolicy === 'passive';
|
|
21
22
|
const show = React.useCallback(() => {
|
|
22
23
|
if (timeoutRef.current) {
|
|
23
24
|
clearTimeout(timeoutRef.current);
|
|
@@ -46,7 +47,7 @@ export function Tooltip({ children, content, delay = 150, placement = 'top', tes
|
|
|
46
47
|
? layout.y + layout.height + animation.offset
|
|
47
48
|
: 0;
|
|
48
49
|
return (<View collapsable={false} ref={anchorRef} testID={testID ? `${testID}-anchor` : undefined}>
|
|
49
|
-
<Pressable onBlur={hide} onFocus={show} onHoverIn={Platform.OS === 'web' ? show : undefined} onHoverOut={Platform.OS === 'web' ? hide : undefined}>
|
|
50
|
+
<Pressable onBlur={passive ? undefined : hide} onFocus={passive ? undefined : show} onHoverIn={Platform.OS === 'web' && !passive ? show : undefined} onHoverOut={Platform.OS === 'web' && !passive ? hide : undefined}>
|
|
50
51
|
{children}
|
|
51
52
|
</Pressable>
|
|
52
53
|
<Portal layer="tooltip" visible={visible && Boolean(layout)}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AASpD,SAAS,WAAW,CAAC,IAAa,EAAE,QAA2C;IAC7E,MAAM,cAAc,GAAG,IAA6B,CAAC;IACrD,cAAc,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxD,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,GAAG,EACX,SAAS,GAAG,KAAK,EACjB,MAAM,GACO;IACb,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC;IAClD,MA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AAM,CACpB,KAAK,CAAC,CAAC;YACL,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,UAAU;SAChB,CAAC,CAEF;UAAA,CAAC,OAAO,CACN,CAAC,CAAC,GAAG,CACL,KAAK,CAAC,CAAC;YACL,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;SACjD,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,QAAQ,CAEhB;YAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CACxC;cAAA,CAAC,OAAO,CACV;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,OAAO,CACX;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,MAAM,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { type LayoutRectangle, Platform, Pressable, View } from 'react-native';\n\nimport { Portal } from '../../internal/overlay/Portal';\nimport { resolveOverlayAnimation } from '../../internal/resolvers';\nimport { Surface } from '../../layout';\nimport { Text } from '../../primitives/text';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { TooltipProps } from './types';\n\ninterface MeasurableNode {\n measureInWindow?: (\n callback: (x: number, y: number, width: number, height: number) => void,\n ) => void;\n}\n\nfunction measureNode(node: unknown, callback: (layout: LayoutRectangle) => void) {\n const measurableNode = node as MeasurableNode | null;\n measurableNode?.measureInWindow?.((x, y, width, height) => {\n callback({ height, width, x, y });\n });\n}\n\nexport function Tooltip({\n children,\n content,\n delay = 150,\n interactionPolicy = 'enabled',\n placement = 'top',\n testID,\n}: TooltipProps) {\n const { theme } = useTheme();\n const animation = resolveOverlayAnimation('tooltip');\n const anchorRef = React.useRef<View | null>(null);\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const [visible, setVisible] = React.useState(false);\n const [layout, setLayout] = React.useState<LayoutRectangle | null>(null);\n const passive = interactionPolicy === 'passive';\n\n const show = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n measureNode(anchorRef.current, setLayout);\n setVisible(true);\n }, delay);\n }, [delay]);\n\n const hide = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = null;\n }\n setVisible(false);\n }, []);\n\n React.useEffect(\n () => () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n },\n [],\n );\n\n const tooltipLeft = layout ? layout.x : 0;\n const tooltipTop =\n layout && placement === 'top'\n ? layout.y - animation.offset\n : layout\n ? layout.y + layout.height + animation.offset\n : 0;\n\n return (\n <View collapsable={false} ref={anchorRef} testID={testID ? `${testID}-anchor` : undefined}>\n <Pressable\n onBlur={passive ? undefined : hide}\n onFocus={passive ? undefined : show}\n onHoverIn={Platform.OS === 'web' && !passive ? show : undefined}\n onHoverOut={Platform.OS === 'web' && !passive ? hide : undefined}\n >\n {children}\n </Pressable>\n <Portal layer=\"tooltip\" visible={visible && Boolean(layout)}>\n <View\n pointerEvents=\"none\"\n style={{\n left: tooltipLeft,\n position: 'absolute',\n top: tooltipTop,\n }}\n >\n <Surface\n p=\"s\"\n style={{\n backgroundColor: theme.semantics.surface.inverse,\n }}\n testID={testID}\n variant=\"raised\"\n >\n <Text emphasis=\"inverse\" variant=\"caption\">\n {content}\n </Text>\n </Surface>\n </View>\n </Portal>\n </View>\n );\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { InteractionPolicy } from '../../interactionPolicy';
|
|
2
3
|
export interface TooltipProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
content?: React.ReactNode;
|
|
5
6
|
delay?: number;
|
|
7
|
+
interactionPolicy?: InteractionPolicy;
|
|
6
8
|
placement?: 'top' | 'bottom';
|
|
7
9
|
testID?: string;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/tooltip/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n content?: React.ReactNode;\n delay?: number;\n placement?: 'top' | 'bottom';\n testID?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/tooltip/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicy } from '../../interactionPolicy';\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n content?: React.ReactNode;\n delay?: number;\n interactionPolicy?: InteractionPolicy;\n placement?: 'top' | 'bottom';\n testID?: string;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { FontProvider, useFontContext } from './context/FontContext';
|
|
|
45
45
|
export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
|
|
46
46
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
47
47
|
export * from './core/responsive';
|
|
48
|
+
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
48
49
|
export * from './layout';
|
|
49
50
|
export type { ButtonBaseProps } from './primitives/button-base';
|
|
50
51
|
export { ButtonBase } from './primitives/button-base';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MA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AE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { ActionSheetItemProps, ActionSheetProps } from './components/action-sheet';\nexport { ActionSheet, ActionSheetItem } from './components/action-sheet';\nexport type { BadgeProps } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { ButtonIconSpec, ButtonProps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { CheckboxProps } from './components/checkbox';\nexport { Checkbox } from './components/checkbox';\nexport type { DrawerProps } from './components/drawer';\nexport { Drawer } from './components/drawer';\nexport type { FieldProps } from './components/field';\nexport { Field } from './components/field';\nexport type { HelperTextProps } from './components/helper-text';\nexport { HelperText } from './components/helper-text';\nexport type { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { LabelProps } from './components/label';\nexport { Label } from './components/label';\nexport type { ListItemProps } from './components/list-item';\nexport { ListItem } from './components/list-item';\nexport type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './components/menu';\nexport { Menu } from './components/menu';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type {\n DrawerNavigationItemProps,\n DrawerNavigationProps,\n NavigationItemIcon,\n NavigationItemProps,\n NavigationItemSpec,\n NavigationListProps,\n TabBarItemProps,\n TabBarProps,\n} from './components/navigation';\nexport {\n DrawerNavigation,\n DrawerNavigationItem,\n NavigationItem,\n NavigationList,\n TabBar,\n TabBarItem,\n} from './components/navigation';\nexport type { RadioProps } from './components/radio';\nexport { Radio } from './components/radio';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';\nexport { Tab, TabList, TabPanel, Tabs } from './components/tabs';\nexport type { TextInputProps } from './components/text-input';\nexport { TextInput } from './components/text-input';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToastOptions, ToastProps, ToastStatus } from './components/toast';\nexport { Toast, ToastProvider, useToast } from './components/toast';\nexport type { TooltipProps } from './components/tooltip';\nexport { Tooltip } from './components/tooltip';\nexport type { FontRuntime } from './context/FontContext';\nexport { FontProvider, useFontContext } from './context/FontContext';\nexport type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';\nexport { TranslationProvider, useTranslationContext } from './context/TranslationContext';\nexport * from './core/responsive';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\nexport * from './layout';\nexport type { ButtonBaseProps } from './primitives/button-base';\nexport { ButtonBase } from './primitives/button-base';\nexport type { HeadingLevel, HeadingProps } from './primitives/heading';\nexport { Heading } from './primitives/heading';\nexport type { IconProps, IconProvider } from './primitives/icon';\nexport { Icon } from './primitives/icon';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './primitives/image';\nexport { Image } from './primitives/image';\nexport type { TextProps } from './primitives/text';\nexport { Text } from './primitives/text';\nexport type {\n SurfaceColor,\n SurfaceEmphasis,\n SurfacePaletteColor,\n SurfaceStatusColor,\n} from './surfaceColor';\nexport {\n SURFACE_COLORS,\n SURFACE_EMPHASES,\n SURFACE_PALETTE_COLORS,\n SURFACE_STATUS_COLORS,\n} from './surfaceColor';\nexport * from './theme';\nexport { isDeepEqual } from './utils/deepEqual';\nexport { deepMerge } from './utils/deepMerge';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionPolicy.d.ts","sourceRoot":"","sources":["../src/interactionPolicy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionPolicy.js","sourceRoot":"","sources":["../src/interactionPolicy.ts"],"names":[],"mappings":"","sourcesContent":["export type InteractionPolicy = 'enabled' | 'passive';\n\nexport interface InteractionPolicyProps {\n interactionPolicy?: InteractionPolicy;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonBaseProps } from './types';
|
|
3
|
-
export declare function ButtonBase({ children, disabled, onPress, onLongPress, accessibilityLabel, accessibilityRole, accessibilityState, style, testID, ...props }: ButtonBaseProps): React.JSX.Element;
|
|
3
|
+
export declare function ButtonBase({ children, disabled, interactionPolicy, onPress, onLongPress, accessibilityLabel, accessibilityRole, accessibilityState, style, testID, ...props }: ButtonBaseProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ButtonBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAgB/C,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAgB,EAChB,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAA4B,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAgB/C,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAgB,EAChB,iBAA6B,EAC7B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAA4B,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,eAAe,qBA2CjB"}
|
|
@@ -12,18 +12,19 @@ function getInteractionState(pressableState, hovered, focused, disabled) {
|
|
|
12
12
|
disabled,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
export function ButtonBase({ children, disabled = false, onPress, onLongPress, accessibilityLabel, accessibilityRole = 'button', accessibilityState, style, testID, ...props }) {
|
|
15
|
+
export function ButtonBase({ children, disabled = false, interactionPolicy = 'enabled', onPress, onLongPress, accessibilityLabel, accessibilityRole = 'button', accessibilityState, style, testID, ...props }) {
|
|
16
16
|
const { theme } = useTheme();
|
|
17
17
|
const { breakpoint } = useResponsiveRuntime();
|
|
18
18
|
const [hovered, setHovered] = React.useState(false);
|
|
19
19
|
const [focused, setFocused] = React.useState(false);
|
|
20
20
|
const isWeb = Platform.OS === 'web';
|
|
21
21
|
const resolvedBoxStyles = resolveBoxStyles(theme, breakpoint, props);
|
|
22
|
+
const passive = interactionPolicy === 'passive';
|
|
22
23
|
return (<Pressable accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={{ ...accessibilityState, disabled }} disabled={disabled} onBlur={() => setFocused(false)} onFocus={() => {
|
|
23
24
|
if (isWeb) {
|
|
24
25
|
setFocused(true);
|
|
25
26
|
}
|
|
26
|
-
}} onHoverIn={isWeb ? () => setHovered(true) : undefined} onHoverOut={isWeb ? () => setHovered(false) : undefined} onLongPress={onLongPress} onPress={onPress} style={(pressableState) => {
|
|
27
|
+
}} onHoverIn={isWeb ? () => setHovered(true) : undefined} onHoverOut={isWeb ? () => setHovered(false) : undefined} onLongPress={passive ? undefined : onLongPress} onPress={passive ? undefined : onPress} style={(pressableState) => {
|
|
27
28
|
const state = getInteractionState(pressableState, hovered, focused, disabled);
|
|
28
29
|
return [
|
|
29
30
|
resolvedBoxStyles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.js","sourceRoot":"","sources":["../../../src/primitives/button-base/ButtonBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAmC,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,SAAS,mBAAmB,CAC1B,cAA0C,EAC1C,OAAgB,EAChB,OAAgB,EAChB,QAAiB;IAEjB,OAAO,uBAAuB,CAAC;QAC7B,OAAO,EAAE,cAAc,CAAC,OAAO;QAC/B,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAAG,QAAQ,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACQ;IAChB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC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EAAE,EAAE;YACxB,MAAM,KAAK,GAAG,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAE9E,OAAO;gBACL,iBAAiB;gBACjB,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;gBAC1E,KAAK;aACN,CAAC;QACJ,CAAC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,CAAC,cAAc,EAAE,EAAE;YAClB,MAAM,KAAK,GAAG,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAE9E,OAAO,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,CAAC,CACH;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, Pressable, type PressableStateCallbackType } from 'react-native';\n\nimport { useResponsiveRuntime } from '../../core/responsive';\nimport {\n type InteractionState,\n resolveFocusRingStyles,\n resolveInteractiveState,\n} from '../../internal/resolvers';\nimport { resolveBoxStyles } from '../../layout/helpers';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ButtonBaseProps } from './types';\n\nfunction getInteractionState(\n pressableState: PressableStateCallbackType,\n hovered: boolean,\n focused: boolean,\n disabled: boolean,\n): InteractionState {\n return resolveInteractiveState({\n pressed: pressableState.pressed,\n hovered,\n focused,\n disabled,\n });\n}\n\nexport function ButtonBase({\n children,\n disabled = false,\n interactionPolicy = 'enabled',\n onPress,\n onLongPress,\n accessibilityLabel,\n accessibilityRole = 'button',\n accessibilityState,\n style,\n testID,\n ...props\n}: ButtonBaseProps) {\n const { theme } = useTheme();\n const { breakpoint } = useResponsiveRuntime();\n const [hovered, setHovered] = React.useState(false);\n const [focused, setFocused] = React.useState(false);\n const isWeb = Platform.OS === 'web';\n const resolvedBoxStyles = resolveBoxStyles(theme, breakpoint, props);\n const passive = interactionPolicy === 'passive';\n\n return (\n <Pressable\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n accessibilityState={{ ...accessibilityState, disabled }}\n disabled={disabled}\n onBlur={() => setFocused(false)}\n onFocus={() => {\n if (isWeb) {\n setFocused(true);\n }\n }}\n onHoverIn={isWeb ? () => setHovered(true) : undefined}\n onHoverOut={isWeb ? () => setHovered(false) : undefined}\n onLongPress={passive ? undefined : onLongPress}\n onPress={passive ? undefined : onPress}\n style={(pressableState) => {\n const state = getInteractionState(pressableState, hovered, focused, disabled);\n\n return [\n resolvedBoxStyles,\n resolveFocusRingStyles(theme.semantics.border.focus, state.focused, isWeb),\n style,\n ];\n }}\n testID={testID}\n >\n {(pressableState) => {\n const state = getInteractionState(pressableState, hovered, focused, disabled);\n\n return typeof children === 'function' ? children(state) : children;\n }}\n </Pressable>\n );\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';
|
|
3
|
+
import type { InteractionPolicyProps } from '../../interactionPolicy';
|
|
3
4
|
import type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';
|
|
4
5
|
import type { BoxProps } from '../../layout';
|
|
5
|
-
export interface ButtonBaseProps extends Omit<BoxProps, 'children' | 'pointerEvents'
|
|
6
|
+
export interface ButtonBaseProps extends Omit<BoxProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {
|
|
6
7
|
children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"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AAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';\n\nimport type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';\nimport type { BoxProps } from '../../layout';\n\nexport interface ButtonBaseProps
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primitives/button-base/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';\n\nimport type { InteractionPolicyProps } from '../../interactionPolicy';\nimport type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';\nimport type { BoxProps } from '../../layout';\n\nexport interface ButtonBaseProps\n extends Omit<BoxProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {\n children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);\n disabled?: boolean;\n onPress?: ((event: GestureResponderEvent) => void) | undefined;\n onLongPress?: ((event: GestureResponderEvent) => void) | undefined;\n accessibilityLabel?: string;\n accessibilityRole?: AccessibilityRole;\n accessibilityState?: AccessibilityState;\n testID?: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/surface",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "Stable UI foundation for React Native and React Native Web.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/surface#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ankhorage/color-theory": "^0.0.
|
|
46
|
-
"@ankhorage/contracts": "^
|
|
45
|
+
"@ankhorage/color-theory": "^0.0.8",
|
|
46
|
+
"@ankhorage/contracts": "^4.0.1"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"dist",
|
|
@@ -18,10 +18,12 @@ export function ActionSheet({
|
|
|
18
18
|
children,
|
|
19
19
|
cancelLabel = 'Cancel',
|
|
20
20
|
closeOnBackdrop = true,
|
|
21
|
+
interactionPolicy = 'enabled',
|
|
21
22
|
testID,
|
|
22
23
|
}: ActionSheetProps) {
|
|
23
24
|
const { theme } = useTheme();
|
|
24
25
|
const animation = resolveOverlayAnimation('modal');
|
|
26
|
+
const passive = interactionPolicy === 'passive';
|
|
25
27
|
|
|
26
28
|
if (!visible) {
|
|
27
29
|
return null;
|
|
@@ -40,7 +42,7 @@ export function ActionSheet({
|
|
|
40
42
|
}}
|
|
41
43
|
>
|
|
42
44
|
<Pressable
|
|
43
|
-
onPress={closeOnBackdrop ? onDismiss : undefined}
|
|
45
|
+
onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}
|
|
44
46
|
style={{
|
|
45
47
|
backgroundColor: theme.semantics.neutral.text,
|
|
46
48
|
bottom: 0,
|
|
@@ -54,7 +56,7 @@ export function ActionSheet({
|
|
|
54
56
|
/>
|
|
55
57
|
<FocusScope
|
|
56
58
|
active={visible}
|
|
57
|
-
onEscape={onDismiss}
|
|
59
|
+
onEscape={passive ? undefined : onDismiss}
|
|
58
60
|
testID={testID ? `${testID}-focus` : undefined}
|
|
59
61
|
>
|
|
60
62
|
<Box
|
|
@@ -106,6 +108,7 @@ export function ActionSheet({
|
|
|
106
108
|
{onDismiss ? (
|
|
107
109
|
<ActionSheetItem
|
|
108
110
|
label={cancelLabel}
|
|
111
|
+
interactionPolicy={interactionPolicy}
|
|
109
112
|
onPress={onDismiss}
|
|
110
113
|
testID={testID ? `${testID}-cancel` : undefined}
|
|
111
114
|
/>
|
|
@@ -13,6 +13,7 @@ export function ActionSheetItem({
|
|
|
13
13
|
color,
|
|
14
14
|
disabled = false,
|
|
15
15
|
selected = false,
|
|
16
|
+
interactionPolicy = 'enabled',
|
|
16
17
|
onPress,
|
|
17
18
|
testID,
|
|
18
19
|
}: ActionSheetItemProps) {
|
|
@@ -21,6 +22,7 @@ export function ActionSheetItem({
|
|
|
21
22
|
accessibilityRole="button"
|
|
22
23
|
accessibilityState={{ disabled, selected }}
|
|
23
24
|
disabled={disabled}
|
|
25
|
+
interactionPolicy={interactionPolicy}
|
|
24
26
|
onPress={onPress}
|
|
25
27
|
radius="m"
|
|
26
28
|
testID={testID}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
+
import type { InteractionPolicy } from '../../interactionPolicy';
|
|
3
4
|
import type { SurfaceColor } from '../../surfaceColor';
|
|
4
5
|
|
|
5
6
|
export interface ActionSheetProps {
|
|
@@ -10,6 +11,7 @@ export interface ActionSheetProps {
|
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
cancelLabel?: React.ReactNode;
|
|
12
13
|
closeOnBackdrop?: boolean;
|
|
14
|
+
interactionPolicy?: InteractionPolicy;
|
|
13
15
|
testID?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -21,6 +23,7 @@ export interface ActionSheetItemProps {
|
|
|
21
23
|
color?: SurfaceColor;
|
|
22
24
|
disabled?: boolean;
|
|
23
25
|
selected?: boolean;
|
|
26
|
+
interactionPolicy?: InteractionPolicy;
|
|
24
27
|
onPress?: (() => void) | undefined;
|
|
25
28
|
testID?: string;
|
|
26
29
|
}
|
|
@@ -14,10 +14,12 @@ export function Drawer({
|
|
|
14
14
|
position = 'right',
|
|
15
15
|
children,
|
|
16
16
|
closeOnBackdrop = true,
|
|
17
|
+
interactionPolicy = 'enabled',
|
|
17
18
|
testID,
|
|
18
19
|
}: DrawerProps) {
|
|
19
20
|
const { theme } = useTheme();
|
|
20
21
|
const animation = resolveOverlayAnimation('drawer');
|
|
22
|
+
const passive = interactionPolicy === 'passive';
|
|
21
23
|
|
|
22
24
|
if (!visible) {
|
|
23
25
|
return null;
|
|
@@ -36,7 +38,7 @@ export function Drawer({
|
|
|
36
38
|
}}
|
|
37
39
|
>
|
|
38
40
|
<Pressable
|
|
39
|
-
onPress={closeOnBackdrop ? onDismiss : undefined}
|
|
41
|
+
onPress={passive ? undefined : closeOnBackdrop ? onDismiss : undefined}
|
|
40
42
|
style={{
|
|
41
43
|
backgroundColor: theme.semantics.neutral.text,
|
|
42
44
|
bottom: 0,
|
|
@@ -50,7 +52,7 @@ export function Drawer({
|
|
|
50
52
|
/>
|
|
51
53
|
<FocusScope
|
|
52
54
|
active={visible}
|
|
53
|
-
onEscape={onDismiss}
|
|
55
|
+
onEscape={passive ? undefined : onDismiss}
|
|
54
56
|
testID={testID ? `${testID}-focus` : undefined}
|
|
55
57
|
>
|
|
56
58
|
<Box
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
|
|
3
|
+
import type { InteractionPolicy } from '../../interactionPolicy';
|
|
4
|
+
|
|
3
5
|
export interface DrawerProps {
|
|
4
6
|
visible: boolean;
|
|
5
7
|
onDismiss?: (() => void) | undefined;
|
|
6
8
|
position?: 'left' | 'right';
|
|
7
9
|
children?: React.ReactNode;
|
|
8
10
|
closeOnBackdrop?: boolean;
|
|
11
|
+
interactionPolicy?: InteractionPolicy;
|
|
9
12
|
testID?: string;
|
|
10
13
|
}
|