@ankhorage/surface 7.0.0 → 8.0.0
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 +6 -0
- package/README.md +1 -1
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +5 -5
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/button/adapters/inbound/IconButton.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/IconButton.js +3 -3
- package/dist/features/button/adapters/inbound/IconButton.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +3 -3
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts.map +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js +3 -3
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.d.ts.map +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.js +3 -3
- package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.d.ts.map +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.js +3 -3
- package/dist/features/form/switch/adapters/inbound/Switch.js.map +1 -1
- package/dist/features/list/adapters/inbound/ListItem.d.ts.map +1 -1
- package/dist/features/list/adapters/inbound/ListItem.js +3 -3
- package/dist/features/list/adapters/inbound/ListItem.js.map +1 -1
- package/dist/features/pressable/adapters/inbound/Pressable.d.ts +5 -0
- package/dist/features/pressable/adapters/inbound/Pressable.d.ts.map +1 -0
- package/dist/features/pressable/adapters/inbound/Pressable.js +48 -0
- package/dist/features/pressable/adapters/inbound/Pressable.js.map +1 -0
- package/dist/features/pressable/public.d.ts +3 -0
- package/dist/features/pressable/public.d.ts.map +1 -0
- package/dist/features/pressable/public.js +2 -0
- package/dist/features/pressable/public.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/button.d.ts +3 -3
- package/dist/types/button.d.ts.map +1 -1
- package/dist/types/button.js.map +1 -1
- package/dist/types/checkbox.d.ts +2 -2
- package/dist/types/checkbox.d.ts.map +1 -1
- package/dist/types/checkbox.js.map +1 -1
- package/dist/{primitives/button-base/types.d.ts → types/pressable.d.ts} +5 -5
- package/dist/types/pressable.d.ts.map +1 -0
- package/dist/types/pressable.js +2 -0
- package/dist/types/pressable.js.map +1 -0
- package/dist/types/radio.d.ts +2 -2
- package/dist/types/radio.d.ts.map +1 -1
- package/dist/types/radio.js.map +1 -1
- package/dist/types/switch.d.ts +2 -2
- package/dist/types/switch.d.ts.map +1 -1
- package/dist/types/switch.js.map +1 -1
- package/package.json +1 -1
- package/src/features/button/adapters/inbound/Button.tsx +6 -6
- package/src/features/button/adapters/inbound/IconButton.tsx +3 -3
- package/src/features/card/adapters/inbound/Card.tsx +3 -3
- package/src/features/form/checkbox/adapters/inbound/Checkbox.tsx +5 -5
- package/src/features/form/radio/adapters/inbound/Radio.tsx +5 -5
- package/src/features/form/switch/adapters/inbound/Switch.tsx +3 -3
- package/src/features/list/adapters/inbound/ListItem.tsx +3 -3
- package/src/{primitives/button-base/ButtonBase.tsx → features/pressable/adapters/inbound/Pressable.tsx} +45 -31
- package/src/features/pressable/public.ts +2 -0
- package/src/index.test.ts +2 -0
- package/src/index.ts +2 -2
- package/src/interactionPolicy.test.ts +4 -4
- package/src/types/button.ts +3 -3
- package/src/types/checkbox.ts +2 -2
- package/src/{primitives/button-base/types.ts → types/pressable.ts} +4 -4
- package/src/types/radio.ts +2 -2
- package/src/types/switch.ts +2 -2
- package/dist/primitives/button-base/ButtonBase.d.ts +0 -5
- package/dist/primitives/button-base/ButtonBase.d.ts.map +0 -1
- package/dist/primitives/button-base/ButtonBase.js +0 -42
- package/dist/primitives/button-base/ButtonBase.js.map +0 -1
- package/dist/primitives/button-base/index.d.ts +0 -3
- package/dist/primitives/button-base/index.d.ts.map +0 -1
- package/dist/primitives/button-base/index.js +0 -2
- package/dist/primitives/button-base/index.js.map +0 -1
- package/dist/primitives/button-base/types.d.ts.map +0 -1
- package/dist/primitives/button-base/types.js +0 -2
- package/dist/primitives/button-base/types.js.map +0 -1
- package/src/primitives/button-base/index.ts +0 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Pressable as ReactNativePressable, } from 'react-native';
|
|
3
|
+
import { useResponsiveRuntime } from '../../../../core/responsive';
|
|
4
|
+
import { resolveFocusRingStyles, resolveInteractiveState, } from '../../../../internal/resolvers';
|
|
5
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
6
|
+
import { resolveViewStyles } from '../../../../utils/resolveViewStyles';
|
|
7
|
+
/*** Renders the token-aware Surface adapter for React Native Pressable. */
|
|
8
|
+
export function Pressable({ children, disabled = false, interactionPolicy = 'enabled', onPress, onLongPress, accessibilityLabel, accessibilityRole = 'button', accessibilityState, style, testID, ...props }) {
|
|
9
|
+
const { theme } = useTheme();
|
|
10
|
+
const { breakpoint } = useResponsiveRuntime();
|
|
11
|
+
const [hovered, setHovered] = React.useState(false);
|
|
12
|
+
const [focused, setFocused] = React.useState(false);
|
|
13
|
+
const isWeb = Platform.OS === 'web';
|
|
14
|
+
const resolvedViewStyles = resolveViewStyles(theme, breakpoint, props);
|
|
15
|
+
const pressHandlers = resolvePressHandlers(interactionPolicy, onPress, onLongPress);
|
|
16
|
+
return (<ReactNativePressable {...pressHandlers} accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} accessibilityState={{ ...accessibilityState, disabled }} disabled={disabled} onBlur={() => setFocused(false)} onFocus={() => {
|
|
17
|
+
if (isWeb)
|
|
18
|
+
setFocused(true);
|
|
19
|
+
}} onHoverIn={isWeb ? () => setHovered(true) : undefined} onHoverOut={isWeb ? () => setHovered(false) : undefined} style={(pressableState) => {
|
|
20
|
+
const state = resolveInteractionState(pressableState, hovered, focused, disabled);
|
|
21
|
+
return [
|
|
22
|
+
resolvedViewStyles,
|
|
23
|
+
resolveFocusRingStyles(theme.semantics.border.focus, state.focused, isWeb),
|
|
24
|
+
style,
|
|
25
|
+
];
|
|
26
|
+
}} testID={testID}>
|
|
27
|
+
{(pressableState) => {
|
|
28
|
+
const state = resolveInteractionState(pressableState, hovered, focused, disabled);
|
|
29
|
+
return typeof children === 'function' ? children(state) : children;
|
|
30
|
+
}}
|
|
31
|
+
</ReactNativePressable>);
|
|
32
|
+
}
|
|
33
|
+
/*** Resolves press handlers according to the shared interaction policy. */
|
|
34
|
+
function resolvePressHandlers(interactionPolicy, onPress, onLongPress) {
|
|
35
|
+
return interactionPolicy === 'passive'
|
|
36
|
+
? { onLongPress: undefined, onPress: undefined }
|
|
37
|
+
: { onLongPress, onPress };
|
|
38
|
+
}
|
|
39
|
+
/*** Resolves one native Pressable state into the canonical Surface interaction state. */
|
|
40
|
+
function resolveInteractionState(pressableState, hovered, focused, disabled) {
|
|
41
|
+
return resolveInteractiveState({
|
|
42
|
+
pressed: pressableState.pressed,
|
|
43
|
+
hovered,
|
|
44
|
+
focused,
|
|
45
|
+
disabled,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Pressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.js","sourceRoot":"","sources":["../../../../../src/features/pressable/adapters/inbound/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,SAAS,IAAI,oBAAoB,GAElC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,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S,uBAAuB,CAC9B,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","sourcesContent":["import React from 'react';\nimport {\n Platform,\n Pressable as ReactNativePressable,\n type PressableStateCallbackType,\n} from 'react-native';\n\nimport { useResponsiveRuntime } from '../../../../core/responsive';\nimport {\n type InteractionState,\n resolveFocusRingStyles,\n resolveInteractiveState,\n} from '../../../../internal/resolvers';\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { PressableProps } from '../../../../types/pressable';\nimport { resolveViewStyles } from '../../../../utils/resolveViewStyles';\n\n/*** Renders the token-aware Surface adapter for React Native Pressable. */\nexport function Pressable({\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}: PressableProps) {\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 resolvedViewStyles = resolveViewStyles(theme, breakpoint, props);\n const pressHandlers = resolvePressHandlers(interactionPolicy, onPress, onLongPress);\n\n return (\n <ReactNativePressable\n {...pressHandlers}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n accessibilityState={{ ...accessibilityState, disabled }}\n disabled={disabled}\n onBlur={() => setFocused(false)}\n onFocus={() => {\n if (isWeb) setFocused(true);\n }}\n onHoverIn={isWeb ? () => setHovered(true) : undefined}\n onHoverOut={isWeb ? () => setHovered(false) : undefined}\n style={(pressableState) => {\n const state = resolveInteractionState(pressableState, hovered, focused, disabled);\n return [\n resolvedViewStyles,\n resolveFocusRingStyles(theme.semantics.border.focus, state.focused, isWeb),\n style,\n ];\n }}\n testID={testID}\n >\n {(pressableState) => {\n const state = resolveInteractionState(pressableState, hovered, focused, disabled);\n return typeof children === 'function' ? children(state) : children;\n }}\n </ReactNativePressable>\n );\n}\n\n/*** Resolves press handlers according to the shared interaction policy. */\nfunction resolvePressHandlers(\n interactionPolicy: PressableProps['interactionPolicy'],\n onPress: PressableProps['onPress'],\n onLongPress: PressableProps['onLongPress'],\n) {\n return interactionPolicy === 'passive'\n ? { onLongPress: undefined, onPress: undefined }\n : { onLongPress, onPress };\n}\n\n/*** Resolves one native Pressable state into the canonical Surface interaction state. */\nfunction resolveInteractionState(\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/pressable/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/pressable/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export type { PressableProps } from '../../types/pressable';\nexport { Pressable } from './adapters/inbound/Pressable';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from '
|
|
|
39
39
|
export { Popover } from './features/popover/public';
|
|
40
40
|
export type { PopoverMenuAction, PopoverMenuActionIntent, PopoverMenuProps, } from './features/popover-menu/public';
|
|
41
41
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
42
|
+
export type { PressableProps } from './features/pressable/public';
|
|
43
|
+
export { Pressable } from './features/pressable/public';
|
|
42
44
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
43
45
|
export { Surface } from './features/surface/public';
|
|
44
46
|
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';
|
|
@@ -50,8 +52,6 @@ export { Tooltip } from './features/tooltip/public';
|
|
|
50
52
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
51
53
|
export { Heading, Text } from './features/typography/public';
|
|
52
54
|
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
53
|
-
export type { ButtonBaseProps } from './primitives/button-base';
|
|
54
|
-
export { ButtonBase } from './primitives/button-base';
|
|
55
55
|
export type { SurfaceColor, SurfaceEmphasis, SurfacePaletteColor, SurfaceStatusColor, } from './surfaceColor';
|
|
56
56
|
export { SURFACE_COLORS, SURFACE_EMPHASES, SURFACE_PALETTE_COLORS, SURFACE_STATUS_COLORS, } from './surfaceColor';
|
|
57
57
|
export * from './theme';
|
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,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,cAAc,mBAAmB,CAAC;AAClC,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,Y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M,8BAA8B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,YAAY,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,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"}
|
package/dist/index.js
CHANGED
|
@@ -19,12 +19,12 @@ export { List, ListItem } from './features/list/public';
|
|
|
19
19
|
export { Modal } from './features/modal/public';
|
|
20
20
|
export { Popover } from './features/popover/public';
|
|
21
21
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
22
|
+
export { Pressable } from './features/pressable/public';
|
|
22
23
|
export { Surface } from './features/surface/public';
|
|
23
24
|
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
24
25
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
25
26
|
export { Tooltip } from './features/tooltip/public';
|
|
26
27
|
export { Heading, Text } from './features/typography/public';
|
|
27
|
-
export { ButtonBase } from './primitives/button-base';
|
|
28
28
|
export { SURFACE_COLORS, SURFACE_EMPHASES, SURFACE_PALETTE_COLORS, SURFACE_STATUS_COLORS, } from './surfaceColor';
|
|
29
29
|
export * from './theme';
|
|
30
30
|
export { isDeepEqual } from './utils/deepEqual';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO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UAAU,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMhD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAMpD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAQtE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAQ7D,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 { 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 {\n AccordionContentProps,\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n AccordionTriggerProps,\n} from './features/accordion/public';\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './features/accordion/public';\nexport type { AppBarProps } from './features/app-bar/public';\nexport { AppBar } from './features/app-bar/public';\nexport type { BadgeProps } from './features/badge/public';\nexport { Badge } from './features/badge/public';\nexport type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';\nexport { Button, IconButton } from './features/button/public';\nexport type { CardProps } from './features/card/public';\nexport { Card } from './features/card/public';\nexport type { CheckboxProps } from './features/form/checkbox/public';\nexport { Checkbox } from './features/form/checkbox/public';\nexport type { FieldProps } from './features/form/field/public';\nexport { Field } from './features/form/field/public';\nexport type { RadioProps } from './features/form/radio/public';\nexport { Radio } from './features/form/radio/public';\nexport type { SwitchProps } from './features/form/switch/public';\nexport { Switch } from './features/form/switch/public';\nexport type { TextInputProps } from './features/form/text-input/public';\nexport { TextInput } from './features/form/text-input/public';\nexport type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from './features/icon/public';\nexport { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/public';\nexport { Image } from './features/image/public';\nexport type {\n KeyboardAvoidingViewBehavior,\n KeyboardAvoidingViewProps,\n} from './features/keyboard-avoiding-view/public';\nexport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nexport type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';\nexport { Divider, Grid, ScrollView, View } from './features/layout/public';\nexport type { ListItemProps, ListProps } from './features/list/public';\nexport { List, ListItem } from './features/list/public';\nexport type { ModalProps } from './features/modal/public';\nexport { Modal } from './features/modal/public';\nexport type {\n PopoverAnchorRenderProps,\n PopoverPlacement,\n PopoverProps,\n} from './features/popover/public';\nexport { Popover } from './features/popover/public';\nexport type {\n PopoverMenuAction,\n PopoverMenuActionIntent,\n PopoverMenuProps,\n} from './features/popover-menu/public';\nexport { PopoverMenu } from './features/popover-menu/public';\nexport type { PressableProps } from './features/pressable/public';\nexport { Pressable } from './features/pressable/public';\nexport type { SurfaceProps, SurfaceVariant } from './features/surface/public';\nexport { Surface } from './features/surface/public';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';\nexport { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';\nexport type {\n ToastController,\n ToastOptions,\n ToastProps,\n ToastProviderProps,\n ToastStatus,\n} from './features/toast/public';\nexport { Toast, ToastProvider, useToast } from './features/toast/public';\nexport type { TooltipProps } from './features/tooltip/public';\nexport { Tooltip } from './features/tooltip/public';\nexport type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';\nexport { Heading, Text } from './features/typography/public';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\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"]}
|
package/dist/types/button.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
3
3
|
import type { ButtonVariant } from '../internal/resolvers/resolveInteractiveColors';
|
|
4
|
-
import type { ButtonBaseProps } from '../primitives/button-base';
|
|
5
4
|
import type { SurfaceColor } from '../surfaceColor';
|
|
6
5
|
import type { IconSource } from './icon';
|
|
6
|
+
import type { PressableProps } from './pressable';
|
|
7
7
|
export type ButtonIconSpec = IconSource;
|
|
8
|
-
export interface ButtonProps extends Omit<
|
|
8
|
+
export interface ButtonProps extends Omit<PressableProps, 'accessibilityLabel' | 'children' | 'style'> {
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
variant?: ButtonVariant;
|
|
11
11
|
color?: SurfaceColor;
|
|
@@ -15,7 +15,7 @@ export interface ButtonProps extends Omit<ButtonBaseProps, 'accessibilityLabel'
|
|
|
15
15
|
trailingIcon?: ButtonIconSpec;
|
|
16
16
|
fullWidth?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface IconButtonProps extends Omit<
|
|
18
|
+
export interface IconButtonProps extends Omit<PressableProps, 'children' | 'style' | 'accessibilityLabel'> {
|
|
19
19
|
icon: IconSource;
|
|
20
20
|
accessibilityLabel: string;
|
|
21
21
|
variant?: ButtonVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AAExC,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,cAAc,EACd,oBAAoB,GAAG,UAAU,GAAG,OAAO,CAC5C;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,cAAc,EACd,UAAU,GAAG,OAAO,GAAG,oBAAoB,CAC5C;IACC,IAAI,EAAE,UAAU,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
package/dist/types/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../internal/resolvers/resolveInteractiveColors';\nimport type {
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { ButtonVariant } from '../internal/resolvers/resolveInteractiveColors';\nimport type { SurfaceColor } from '../surfaceColor';\nimport type { IconSource } from './icon';\nimport type { PressableProps } from './pressable';\n\nexport type ButtonIconSpec = IconSource;\n\nexport interface ButtonProps extends Omit<\n PressableProps,\n 'accessibilityLabel' | 'children' | 'style'\n> {\n children?: React.ReactNode;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n loading?: boolean;\n leadingIcon?: ButtonIconSpec;\n trailingIcon?: ButtonIconSpec;\n fullWidth?: boolean;\n}\n\nexport interface IconButtonProps extends Omit<\n PressableProps,\n 'children' | 'style' | 'accessibilityLabel'\n> {\n icon: IconSource;\n accessibilityLabel: string;\n variant?: ButtonVariant;\n color?: SurfaceColor;\n size?: ControlSize;\n}\n"]}
|
package/dist/types/checkbox.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
3
|
-
import type { ButtonBaseProps } from '../primitives/button-base';
|
|
4
3
|
import type { SurfaceColor } from '../surfaceColor';
|
|
5
|
-
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
export interface CheckboxProps extends Omit<PressableProps, 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'> {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
defaultChecked?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/types/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/types/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,cAAc,EACd,mBAAmB,GAAG,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAC9E;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/types/checkbox.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type {
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/types/checkbox.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { SurfaceColor } from '../surfaceColor';\nimport type { PressableProps } from './pressable';\n\nexport interface CheckboxProps extends Omit<\n PressableProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'\n> {\n children?: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n color?: SurfaceColor;\n size?: ControlSize;\n invalid?: boolean;\n readOnly?: boolean;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AccessibilityRole, AccessibilityState, GestureResponderEvent } from 'react-native';
|
|
3
|
-
import type { InteractionPolicyProps } from '
|
|
4
|
-
import type { InteractionState } from '
|
|
5
|
-
import type { ViewProps } from '
|
|
6
|
-
export interface
|
|
3
|
+
import type { InteractionPolicyProps } from '../interactionPolicy';
|
|
4
|
+
import type { InteractionState } from '../internal/resolvers/resolveInteractiveState';
|
|
5
|
+
import type { ViewProps } from './layout';
|
|
6
|
+
export interface PressableProps extends Omit<ViewProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {
|
|
7
7
|
children?: React.ReactNode | ((state: InteractionState) => React.ReactNode);
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
@@ -13,4 +13,4 @@ export interface ButtonBaseProps extends Omit<ViewProps, 'children' | 'pointerEv
|
|
|
13
13
|
accessibilityState?: AccessibilityState;
|
|
14
14
|
testID?: string;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=pressable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pressable.d.ts","sourceRoot":"","sources":["../../src/types/pressable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,eAAe,CAAC,EAAE,sBAAsB;IAC7E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pressable.js","sourceRoot":"","sources":["../../src/types/pressable.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 { ViewProps } from './layout';\n\nexport interface PressableProps\n extends Omit<ViewProps, '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/dist/types/radio.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
3
|
-
import type { ButtonBaseProps } from '../primitives/button-base';
|
|
4
3
|
import type { SurfaceColor } from '../surfaceColor';
|
|
5
|
-
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
export interface RadioProps extends Omit<PressableProps, 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'> {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
defaultChecked?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,cAAc,EACd,mBAAmB,GAAG,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAC9E;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/types/radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type {
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { SurfaceColor } from '../surfaceColor';\nimport type { PressableProps } from './pressable';\n\nexport interface RadioProps extends Omit<\n PressableProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'\n> {\n children?: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n color?: SurfaceColor;\n size?: ControlSize;\n invalid?: boolean;\n readOnly?: boolean;\n}\n"]}
|
package/dist/types/switch.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ControlSize } from '../internal/resolvers/resolveControlSize';
|
|
3
|
-
import type { ButtonBaseProps } from '../primitives/button-base';
|
|
4
3
|
import type { SurfaceColor } from '../surfaceColor';
|
|
5
|
-
|
|
4
|
+
import type { PressableProps } from './pressable';
|
|
5
|
+
export interface SwitchProps extends Omit<PressableProps, 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'> {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
defaultChecked?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/types/switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/types/switch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,cAAc,EACd,mBAAmB,GAAG,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAC9E;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/types/switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/types/switch.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type {
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../src/types/switch.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { SurfaceColor } from '../surfaceColor';\nimport type { PressableProps } from './pressable';\n\nexport interface SwitchProps extends Omit<\n PressableProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'\n> {\n children?: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n color?: SurfaceColor;\n size?: ControlSize;\n invalid?: boolean;\n readOnly?: boolean;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
resolveControlSize,
|
|
8
8
|
resolveIconSize,
|
|
9
9
|
} from '../../../../internal/resolvers';
|
|
10
|
-
import { ButtonBase } from '../../../../primitives/button-base';
|
|
11
10
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
12
11
|
import type { SurfaceTheme } from '../../../../theme/types';
|
|
13
12
|
import type { ButtonProps } from '../../../../types/button';
|
|
14
13
|
import { Icon } from '../../../icon/public';
|
|
15
14
|
import { View } from '../../../layout/public';
|
|
15
|
+
import { Pressable } from '../../../pressable/public';
|
|
16
16
|
import { Text } from '../../../typography/public';
|
|
17
17
|
|
|
18
18
|
/*** Renders the primary Surface action control with semantic visual states. */
|
|
@@ -34,11 +34,11 @@ export function Button({
|
|
|
34
34
|
const controlSize = resolveControlSize(theme, size);
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<
|
|
37
|
+
<Pressable
|
|
38
38
|
{...props}
|
|
39
39
|
disabled={disabled || loading}
|
|
40
40
|
onPress={onPress}
|
|
41
|
-
style={
|
|
41
|
+
style={resolvePressableStyle(fullWidth)}
|
|
42
42
|
testID={testID}
|
|
43
43
|
>
|
|
44
44
|
{(state) => (
|
|
@@ -57,7 +57,7 @@ export function Button({
|
|
|
57
57
|
{children}
|
|
58
58
|
</ButtonContent>
|
|
59
59
|
)}
|
|
60
|
-
</
|
|
60
|
+
</Pressable>
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -114,8 +114,8 @@ function ButtonContent({
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/*** Resolves the outer
|
|
118
|
-
function
|
|
117
|
+
/*** Resolves the outer Pressable layout style. */
|
|
118
|
+
function resolvePressableStyle(fullWidth: boolean): ViewStyle {
|
|
119
119
|
return { alignSelf: fullWidth ? 'stretch' : 'flex-start' };
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
resolveControlSize,
|
|
7
7
|
resolveIconSize,
|
|
8
8
|
} from '../../../../internal/resolvers';
|
|
9
|
-
import { ButtonBase } from '../../../../primitives/button-base';
|
|
10
9
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
11
10
|
import type { IconButtonProps } from '../../../../types/button';
|
|
12
11
|
import { Icon } from '../../../icon/public';
|
|
13
12
|
import { View } from '../../../layout/public';
|
|
13
|
+
import { Pressable } from '../../../pressable/public';
|
|
14
14
|
|
|
15
15
|
/*** Renders a compact accessible icon-only action control. */
|
|
16
16
|
export function IconButton({
|
|
@@ -28,7 +28,7 @@ export function IconButton({
|
|
|
28
28
|
const controlSize = resolveControlSize(theme, size);
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<
|
|
31
|
+
<Pressable
|
|
32
32
|
{...props}
|
|
33
33
|
accessibilityLabel={accessibilityLabel}
|
|
34
34
|
disabled={disabled}
|
|
@@ -46,7 +46,7 @@ export function IconButton({
|
|
|
46
46
|
</View>
|
|
47
47
|
);
|
|
48
48
|
}}
|
|
49
|
-
</
|
|
49
|
+
</Pressable>
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ButtonBase } from '../../../../primitives/button-base';
|
|
5
4
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
6
5
|
import type { CardProps } from '../../../../types/card';
|
|
7
6
|
import type { SurfaceVariant } from '../../../../types/surface';
|
|
7
|
+
import { Pressable } from '../../../pressable/public';
|
|
8
8
|
import { Surface } from '../../../surface/public';
|
|
9
9
|
|
|
10
10
|
/*** Renders a themed content card with optional interactive press states. */
|
|
@@ -28,7 +28,7 @@ export function Card({
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<
|
|
31
|
+
<Pressable accessibilityRole="button" disabled={disabled} onPress={onPress} testID={testID}>
|
|
32
32
|
{(state) => (
|
|
33
33
|
<Surface
|
|
34
34
|
{...props}
|
|
@@ -46,7 +46,7 @@ export function Card({
|
|
|
46
46
|
{children}
|
|
47
47
|
</Surface>
|
|
48
48
|
)}
|
|
49
|
-
</
|
|
49
|
+
</Pressable>
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
resolveSelectionControlNextChecked,
|
|
10
10
|
} from '../../../../../internal/resolvers';
|
|
11
11
|
import { useControllableState } from '../../../../../internal/useControllableState';
|
|
12
|
-
import { ButtonBase } from '../../../../../primitives/button-base';
|
|
13
|
-
import type { ButtonBaseProps } from '../../../../../primitives/button-base/types';
|
|
14
12
|
import { useTheme } from '../../../../../theme/ThemeContext';
|
|
15
13
|
import type { SurfaceTheme } from '../../../../../theme/types';
|
|
16
14
|
import type { CheckboxProps } from '../../../../../types/checkbox';
|
|
17
15
|
import { View } from '../../../../layout/public';
|
|
16
|
+
import type { PressableProps } from '../../../../pressable/public';
|
|
17
|
+
import { Pressable } from '../../../../pressable/public';
|
|
18
18
|
import { Text } from '../../../../typography/public';
|
|
19
19
|
|
|
20
20
|
/*** Renders a controlled or uncontrolled accessible checkbox. */
|
|
@@ -81,7 +81,7 @@ function CheckboxControl({
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
<
|
|
84
|
+
<Pressable
|
|
85
85
|
{...buttonProps}
|
|
86
86
|
accessibilityLabel={accessibilityLabel}
|
|
87
87
|
accessibilityRole="checkbox"
|
|
@@ -103,7 +103,7 @@ function CheckboxControl({
|
|
|
103
103
|
theme,
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
|
-
</
|
|
106
|
+
</Pressable>
|
|
107
107
|
);
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -181,7 +181,7 @@ function resolveCheckboxIndicatorStyle(
|
|
|
181
181
|
|
|
182
182
|
interface CheckboxControlProps {
|
|
183
183
|
accessibilityLabel: CheckboxProps['accessibilityLabel'];
|
|
184
|
-
buttonProps:
|
|
184
|
+
buttonProps: PressableProps;
|
|
185
185
|
children: CheckboxProps['children'];
|
|
186
186
|
color: NonNullable<CheckboxProps['color']>;
|
|
187
187
|
disabled: boolean;
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
resolveSelectionControlNextChecked,
|
|
10
10
|
} from '../../../../../internal/resolvers';
|
|
11
11
|
import { useControllableState } from '../../../../../internal/useControllableState';
|
|
12
|
-
import { ButtonBase } from '../../../../../primitives/button-base';
|
|
13
|
-
import type { ButtonBaseProps } from '../../../../../primitives/button-base/types';
|
|
14
12
|
import { useTheme } from '../../../../../theme/ThemeContext';
|
|
15
13
|
import type { SurfaceTheme } from '../../../../../theme/types';
|
|
16
14
|
import type { RadioProps } from '../../../../../types/radio';
|
|
17
15
|
import { View } from '../../../../layout/public';
|
|
16
|
+
import type { PressableProps } from '../../../../pressable/public';
|
|
17
|
+
import { Pressable } from '../../../../pressable/public';
|
|
18
18
|
import { Text } from '../../../../typography/public';
|
|
19
19
|
import { isRadioTextContent } from '../../utils/isRadioTextContent';
|
|
20
20
|
|
|
@@ -82,7 +82,7 @@ function RadioControl({
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
return (
|
|
85
|
-
<
|
|
85
|
+
<Pressable
|
|
86
86
|
{...buttonProps}
|
|
87
87
|
accessibilityLabel={accessibilityLabel}
|
|
88
88
|
accessibilityRole="radio"
|
|
@@ -104,7 +104,7 @@ function RadioControl({
|
|
|
104
104
|
theme,
|
|
105
105
|
})
|
|
106
106
|
}
|
|
107
|
-
</
|
|
107
|
+
</Pressable>
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -188,7 +188,7 @@ function resolveRadioDotStyle(backgroundColor: string, size: number): ViewStyle
|
|
|
188
188
|
|
|
189
189
|
interface RadioControlProps {
|
|
190
190
|
accessibilityLabel: RadioProps['accessibilityLabel'];
|
|
191
|
-
buttonProps:
|
|
191
|
+
buttonProps: PressableProps;
|
|
192
192
|
children: RadioProps['children'];
|
|
193
193
|
color: NonNullable<RadioProps['color']>;
|
|
194
194
|
disabled: boolean;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
resolveSelectionControlNextChecked,
|
|
9
9
|
} from '../../../../../internal/resolvers';
|
|
10
10
|
import { useControllableState } from '../../../../../internal/useControllableState';
|
|
11
|
-
import { ButtonBase } from '../../../../../primitives/button-base';
|
|
12
11
|
import { useTheme } from '../../../../../theme/ThemeContext';
|
|
13
12
|
import type { SwitchProps } from '../../../../../types/switch';
|
|
14
13
|
import { View } from '../../../../layout/public';
|
|
14
|
+
import { Pressable } from '../../../../pressable/public';
|
|
15
15
|
import { Text } from '../../../../typography/public';
|
|
16
16
|
|
|
17
17
|
/*** Renders a controlled or uncontrolled accessible switch. */
|
|
@@ -43,7 +43,7 @@ export function Switch({
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
|
-
<
|
|
46
|
+
<Pressable
|
|
47
47
|
{...props}
|
|
48
48
|
accessibilityLabel={accessibilityLabel}
|
|
49
49
|
accessibilityRole="switch"
|
|
@@ -58,7 +58,7 @@ export function Switch({
|
|
|
58
58
|
interactionState,
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
|
-
</
|
|
61
|
+
</Pressable>
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { ButtonBase } from '../../../../primitives/button-base';
|
|
4
3
|
import { useTheme } from '../../../../theme/ThemeContext';
|
|
5
4
|
import type { SurfaceTheme } from '../../../../theme/types';
|
|
6
5
|
import type { ListItemProps } from '../../../../types/list';
|
|
7
6
|
import { View } from '../../../layout/public';
|
|
7
|
+
import { Pressable } from '../../../pressable/public';
|
|
8
8
|
import { Text } from '../../../typography/public';
|
|
9
9
|
|
|
10
10
|
/*** Renders a static or interactive list item with shared row geometry and interaction states. */
|
|
@@ -30,7 +30,7 @@ function renderInteractiveListItem(
|
|
|
30
30
|
theme: SurfaceTheme,
|
|
31
31
|
) {
|
|
32
32
|
return (
|
|
33
|
-
<
|
|
33
|
+
<Pressable
|
|
34
34
|
accessibilityLabel={props.accessibilityLabel}
|
|
35
35
|
accessibilityRole="button"
|
|
36
36
|
accessibilityState={{ disabled: props.disabled ?? false, selected: props.selected ?? false }}
|
|
@@ -51,7 +51,7 @@ function renderInteractiveListItem(
|
|
|
51
51
|
testID={undefined}
|
|
52
52
|
/>
|
|
53
53
|
)}
|
|
54
|
-
</
|
|
54
|
+
</Pressable>
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|