@ankhorage/surface 6.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 +12 -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/{components/field → features/form/field/adapters/inbound}/Field.d.ts +2 -2
- package/dist/features/form/field/adapters/inbound/Field.d.ts.map +1 -0
- package/dist/features/form/field/adapters/inbound/Field.js +40 -0
- package/dist/features/form/field/adapters/inbound/Field.js.map +1 -0
- package/dist/features/form/field/public.d.ts +3 -0
- package/dist/features/form/field/public.d.ts.map +1 -0
- package/dist/features/form/field/public.js +2 -0
- package/dist/features/form/field/public.js.map +1 -0
- 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/{components/switch → features/form/switch/adapters/inbound}/Switch.d.ts +1 -1
- package/dist/features/form/switch/adapters/inbound/Switch.d.ts.map +1 -0
- package/dist/features/form/switch/adapters/inbound/Switch.js +52 -0
- package/dist/features/form/switch/adapters/inbound/Switch.js.map +1 -0
- package/dist/features/form/switch/public.d.ts +3 -0
- package/dist/features/form/switch/public.d.ts.map +1 -0
- package/dist/features/form/switch/public.js +2 -0
- package/dist/features/form/switch/public.js.map +1 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +8 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
- package/dist/features/list/adapters/inbound/List.d.ts +5 -0
- package/dist/features/list/adapters/inbound/List.d.ts.map +1 -0
- package/dist/features/list/adapters/inbound/List.js +7 -0
- package/dist/features/list/adapters/inbound/List.js.map +1 -0
- package/dist/features/list/adapters/inbound/ListItem.d.ts +5 -0
- package/dist/features/list/adapters/inbound/ListItem.d.ts.map +1 -0
- package/dist/features/list/adapters/inbound/ListItem.js +59 -0
- package/dist/features/list/adapters/inbound/ListItem.js.map +1 -0
- package/dist/features/list/public.d.ts +4 -0
- package/dist/features/list/public.d.ts.map +1 -0
- package/dist/features/list/public.js +3 -0
- package/dist/features/list/public.js.map +1 -0
- 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 +8 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -7
- 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/{components/field/types.d.ts → types/field.d.ts} +1 -1
- package/dist/types/field.d.ts.map +1 -0
- package/dist/types/field.js +2 -0
- package/dist/types/field.js.map +1 -0
- package/dist/types/list.d.ts +20 -0
- package/dist/types/list.d.ts.map +1 -0
- package/dist/types/list.js +2 -0
- package/dist/types/list.js.map +1 -0
- 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 +15 -0
- package/dist/types/switch.d.ts.map +1 -0
- package/dist/types/switch.js +2 -0
- package/dist/types/switch.js.map +1 -0
- 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/field/adapters/inbound/Field.tsx +82 -0
- package/src/features/form/field/public.ts +2 -0
- package/src/features/form/radio/adapters/inbound/Radio.tsx +5 -5
- package/src/features/form/switch/adapters/inbound/Switch.tsx +123 -0
- package/src/features/form/switch/public.ts +2 -0
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +21 -5
- package/src/features/list/adapters/inbound/List.tsx +9 -0
- package/src/features/list/adapters/inbound/ListItem.tsx +128 -0
- package/src/features/list/public.test.ts +13 -0
- package/src/features/list/public.ts +3 -0
- 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 +17 -11
- package/src/index.ts +8 -14
- package/src/interactionPolicy.test.ts +4 -4
- package/src/types/button.ts +3 -3
- package/src/types/checkbox.ts +2 -2
- package/src/types/list.ts +22 -0
- package/src/{primitives/button-base/types.ts → types/pressable.ts} +4 -4
- package/src/types/radio.ts +2 -2
- package/src/{components/switch/types.ts → types/switch.ts} +4 -4
- package/dist/components/field/Field.d.ts.map +0 -1
- package/dist/components/field/Field.js +0 -27
- package/dist/components/field/Field.js.map +0 -1
- package/dist/components/field/index.d.ts +0 -3
- package/dist/components/field/index.d.ts.map +0 -1
- package/dist/components/field/index.js +0 -2
- package/dist/components/field/index.js.map +0 -1
- package/dist/components/field/types.d.ts.map +0 -1
- package/dist/components/field/types.js +0 -2
- package/dist/components/field/types.js.map +0 -1
- package/dist/components/helper-text/HelperText.d.ts +0 -4
- package/dist/components/helper-text/HelperText.d.ts.map +0 -1
- package/dist/components/helper-text/HelperText.js +0 -8
- package/dist/components/helper-text/HelperText.js.map +0 -1
- package/dist/components/helper-text/index.d.ts +0 -3
- package/dist/components/helper-text/index.d.ts.map +0 -1
- package/dist/components/helper-text/index.js +0 -2
- package/dist/components/helper-text/index.js.map +0 -1
- package/dist/components/helper-text/types.d.ts +0 -9
- package/dist/components/helper-text/types.d.ts.map +0 -1
- package/dist/components/helper-text/types.js +0 -2
- package/dist/components/helper-text/types.js.map +0 -1
- package/dist/components/label/Label.d.ts +0 -4
- package/dist/components/label/Label.d.ts.map +0 -1
- package/dist/components/label/Label.js +0 -11
- package/dist/components/label/Label.js.map +0 -1
- package/dist/components/label/index.d.ts +0 -3
- package/dist/components/label/index.d.ts.map +0 -1
- package/dist/components/label/index.js +0 -2
- package/dist/components/label/index.js.map +0 -1
- package/dist/components/label/types.d.ts +0 -10
- package/dist/components/label/types.d.ts.map +0 -1
- package/dist/components/label/types.js +0 -2
- package/dist/components/label/types.js.map +0 -1
- package/dist/components/list-item/ListItem.d.ts +0 -5
- package/dist/components/list-item/ListItem.d.ts.map +0 -1
- package/dist/components/list-item/ListItem.js +0 -44
- package/dist/components/list-item/ListItem.js.map +0 -1
- package/dist/components/list-item/index.d.ts +0 -3
- package/dist/components/list-item/index.d.ts.map +0 -1
- package/dist/components/list-item/index.js +0 -2
- package/dist/components/list-item/index.js.map +0 -1
- package/dist/components/list-item/types.d.ts +0 -11
- package/dist/components/list-item/types.d.ts.map +0 -1
- package/dist/components/list-item/types.js +0 -2
- package/dist/components/list-item/types.js.map +0 -1
- package/dist/components/switch/Switch.d.ts.map +0 -1
- package/dist/components/switch/Switch.js +0 -68
- package/dist/components/switch/Switch.js.map +0 -1
- package/dist/components/switch/index.d.ts +0 -3
- package/dist/components/switch/index.d.ts.map +0 -1
- package/dist/components/switch/index.js +0 -2
- package/dist/components/switch/index.js.map +0 -1
- package/dist/components/switch/types.d.ts +0 -15
- package/dist/components/switch/types.d.ts.map +0 -1
- package/dist/components/switch/types.js +0 -2
- package/dist/components/switch/types.js.map +0 -1
- package/dist/components/textarea/Textarea.d.ts +0 -4
- package/dist/components/textarea/Textarea.d.ts.map +0 -1
- package/dist/components/textarea/Textarea.js +0 -6
- package/dist/components/textarea/Textarea.js.map +0 -1
- package/dist/components/textarea/index.d.ts +0 -3
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js +0 -2
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textarea/types.d.ts +0 -5
- package/dist/components/textarea/types.d.ts.map +0 -1
- package/dist/components/textarea/types.js +0 -2
- package/dist/components/textarea/types.js.map +0 -1
- 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/components/field/Field.tsx +0 -52
- package/src/components/field/index.ts +0 -2
- package/src/components/helper-text/HelperText.tsx +0 -12
- package/src/components/helper-text/index.ts +0 -2
- package/src/components/helper-text/types.ts +0 -10
- package/src/components/label/Label.tsx +0 -23
- package/src/components/label/index.ts +0 -2
- package/src/components/label/types.ts +0 -11
- package/src/components/list-item/ListItem.tsx +0 -76
- package/src/components/list-item/index.ts +0 -2
- package/src/components/list-item/types.ts +0 -11
- package/src/components/switch/Switch.tsx +0 -113
- package/src/components/switch/index.ts +0 -2
- package/src/components/textarea/Textarea.tsx +0 -15
- package/src/components/textarea/index.ts +0 -2
- package/src/components/textarea/types.ts +0 -5
- package/src/primitives/button-base/index.ts +0 -2
- /package/src/{components/field/types.ts → types/field.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/switch/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/switch/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export type { SwitchProps } from '../../../types/switch';\nexport { Switch } from './adapters/inbound/Switch';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA6C9C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Platform, TextInput as ReactNativeTextInput, View } from 'react-native';
|
|
2
|
+
import { Platform, TextInput as ReactNativeTextInput, View, } from 'react-native';
|
|
3
3
|
import { resolveFocusRingStyles } from '../../../../../internal/resolvers';
|
|
4
4
|
import { useTheme } from '../../../../../theme/ThemeContext';
|
|
5
5
|
import { resolveTextInputPresentation } from '../../utils/resolveTextInputPresentation';
|
|
@@ -18,16 +18,20 @@ export function TextInput(props) {
|
|
|
18
18
|
setFocused(false);
|
|
19
19
|
nativeProps.onBlur?.(event);
|
|
20
20
|
}} onChangeText={(nextValue) => {
|
|
21
|
-
if (interactionPolicy !== 'passive')
|
|
21
|
+
if (interactionPolicy !== 'passive')
|
|
22
22
|
nativeProps.onChangeText?.(nextValue);
|
|
23
|
-
}
|
|
24
23
|
}} onFocus={(event) => {
|
|
25
24
|
setFocused(true);
|
|
26
25
|
nativeProps.onFocus?.(event);
|
|
27
|
-
}} placeholderTextColor={presentation.placeholderColor} readOnly={readOnly} style={
|
|
26
|
+
}} placeholderTextColor={presentation.placeholderColor} readOnly={readOnly} style={resolveInputStyle(presentation.inputStyle, nativeProps.multiline, nativeProps.style)}/>
|
|
28
27
|
{renderAccessory(trailingAccessory, presentation.accessorySpacing, 'trailing')}
|
|
29
28
|
</View>);
|
|
30
29
|
}
|
|
30
|
+
const multilineInputStyle = { textAlignVertical: 'top' };
|
|
31
|
+
/*** Resolves TextInput style composition including canonical multiline alignment. */
|
|
32
|
+
function resolveInputStyle(presentationStyle, multiline, style) {
|
|
33
|
+
return [presentationStyle, multiline ? multilineInputStyle : undefined, style];
|
|
34
|
+
}
|
|
31
35
|
/*** Renders one optional TextInput accessory with directional spacing. */
|
|
32
36
|
function renderAccessory(accessory, spacing, position) {
|
|
33
37
|
if (!accessory)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EAER,SAAS,IAAI,oBAAoB,EAEjC,IAAI,GAEL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,EACJ,QAAQ,EAAE,SAAS,EACnB,iBAAiB,GAAG,SAAS,EAC7B,OAAO,EAAE,QAAQ,EACjB,gBAAgB,EAChB,QAAQ,GAAG,KAAK,EAChB,IAAI,EAAE,KAAK,EACX,iBAAiB,EACjB,GAAG,WAAW,EACf,GAAG,KAAK,CAAC;IACV,MAAM,YAAY,GAAG,4BAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAEzE,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,YAAY,CAAC,cAAc;YAC3B,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC;SACrF,CAAC,CAEF;MAAA,CAAC,eAAe,CAAC,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAC5E;MAA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0E;AAC1E,SAAS,eAAe,CACtB,SAA0B,EAC1B,OAAe,EACf,QAAgC;IAEhC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,0EAA0E;AAC1E,SAAS,qBAAqB,CAAC,OAAe,EAAE,QAAgC;IAC9E,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACrF,CAAC","sourcesContent":["import React from 'react';\nimport {\n Platform,\n type StyleProp,\n TextInput as ReactNativeTextInput,\n type TextStyle,\n View,\n type ViewStyle,\n} from 'react-native';\n\nimport { resolveFocusRingStyles } from '../../../../../internal/resolvers';\nimport { useTheme } from '../../../../../theme/ThemeContext';\nimport type { TextInputProps } from '../../../../../types/text-input';\nimport { resolveTextInputPresentation } from '../../utils/resolveTextInputPresentation';\n\n/*** Renders a token-aware text input with controlled interaction policy. */\nexport function TextInput(props: TextInputProps) {\n const { theme } = useTheme();\n const [focused, setFocused] = React.useState(false);\n const {\n disabled: _disabled,\n interactionPolicy = 'enabled',\n invalid: _invalid,\n leadingAccessory,\n readOnly = false,\n size: _size,\n trailingAccessory,\n ...nativeProps\n } = props;\n const presentation = resolveTextInputPresentation(theme, props, focused);\n\n return (\n <View\n style={[\n presentation.containerStyle,\n resolveFocusRingStyles(theme.semantics.border.focus, focused, Platform.OS === 'web'),\n ]}\n >\n {renderAccessory(leadingAccessory, presentation.accessorySpacing, 'leading')}\n <ReactNativeTextInput\n {...nativeProps}\n editable={presentation.editable}\n numberOfLines={presentation.numberOfLines}\n onBlur={(event) => {\n setFocused(false);\n nativeProps.onBlur?.(event);\n }}\n onChangeText={(nextValue) => {\n if (interactionPolicy !== 'passive') nativeProps.onChangeText?.(nextValue);\n }}\n onFocus={(event) => {\n setFocused(true);\n nativeProps.onFocus?.(event);\n }}\n placeholderTextColor={presentation.placeholderColor}\n readOnly={readOnly}\n style={resolveInputStyle(presentation.inputStyle, nativeProps.multiline, nativeProps.style)}\n />\n {renderAccessory(trailingAccessory, presentation.accessorySpacing, 'trailing')}\n </View>\n );\n}\n\nconst multilineInputStyle: TextStyle = { textAlignVertical: 'top' };\n\n/*** Resolves TextInput style composition including canonical multiline alignment. */\nfunction resolveInputStyle(\n presentationStyle: StyleProp<TextStyle>,\n multiline: boolean | undefined,\n style: StyleProp<TextStyle>,\n): StyleProp<TextStyle> {\n return [presentationStyle, multiline ? multilineInputStyle : undefined, style];\n}\n\n/*** Renders one optional TextInput accessory with directional spacing. */\nfunction renderAccessory(\n accessory: React.ReactNode,\n spacing: number,\n position: 'leading' | 'trailing',\n) {\n if (!accessory) return null;\n return <View style={resolveAccessoryStyle(spacing, position)}>{accessory}</View>;\n}\n\n/*** Resolves spacing around a leading or trailing TextInput accessory. */\nfunction resolveAccessoryStyle(spacing: number, position: 'leading' | 'trailing'): ViewStyle {\n return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ListProps } from '../../../../types/list';
|
|
3
|
+
/*** Groups list items under one neutral Surface list boundary. */
|
|
4
|
+
export declare function List({ children, testID }: ListProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,qBAEnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from '../../../layout/public';
|
|
3
|
+
/*** Groups list items under one neutral Surface list boundary. */
|
|
4
|
+
export function List({ children, testID }) {
|
|
5
|
+
return <View testID={testID}>{children}</View>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,kEAAkE;AAClE,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAa;IAClD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ListProps } from '../../../../types/list';\nimport { View } from '../../../layout/public';\n\n/*** Groups list items under one neutral Surface list boundary. */\nexport function List({ children, testID }: ListProps) {\n return <View testID={testID}>{children}</View>;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ListItemProps } from '../../../../types/list';
|
|
3
|
+
/*** Renders a static or interactive list item with shared row geometry and interaction states. */
|
|
4
|
+
export declare function ListItem(props: ListItemProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK5D,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAI5C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
3
|
+
import { View } from '../../../layout/public';
|
|
4
|
+
import { Pressable } from '../../../pressable/public';
|
|
5
|
+
import { Text } from '../../../typography/public';
|
|
6
|
+
/*** Renders a static or interactive list item with shared row geometry and interaction states. */
|
|
7
|
+
export function ListItem(props) {
|
|
8
|
+
const { theme } = useTheme();
|
|
9
|
+
if (!props.onPress)
|
|
10
|
+
return renderStaticListItem(props, theme);
|
|
11
|
+
return renderInteractiveListItem({ ...props, onPress: props.onPress }, theme);
|
|
12
|
+
}
|
|
13
|
+
/*** Renders a non-pressable list item. */
|
|
14
|
+
function renderStaticListItem(props, theme) {
|
|
15
|
+
return (<ListItemContent {...props} backgroundColor={props.selected ? theme.semantics.selection.background : 'transparent'}/>);
|
|
16
|
+
}
|
|
17
|
+
/*** Renders a pressable list item with shared interaction-state presentation. */
|
|
18
|
+
function renderInteractiveListItem(props, theme) {
|
|
19
|
+
return (<Pressable accessibilityLabel={props.accessibilityLabel} accessibilityRole="button" accessibilityState={{ disabled: props.disabled ?? false, selected: props.selected ?? false }} disabled={props.disabled ?? false} interactionPolicy={props.interactionPolicy} onPress={props.onPress} testID={props.testID}>
|
|
20
|
+
{(state) => (<ListItemContent {...props} backgroundColor={resolveListItemBackground(theme, {
|
|
21
|
+
hovered: state.hovered,
|
|
22
|
+
pressed: state.pressed,
|
|
23
|
+
selected: props.selected ?? false,
|
|
24
|
+
})} disabled={state.disabled} testID={undefined}/>)}
|
|
25
|
+
</Pressable>);
|
|
26
|
+
}
|
|
27
|
+
/*** Resolves the neutral list-item background for one interaction state. */
|
|
28
|
+
function resolveListItemBackground(theme, state) {
|
|
29
|
+
if (state.pressed)
|
|
30
|
+
return theme.semantics.neutral.surfaceActive;
|
|
31
|
+
if (state.hovered)
|
|
32
|
+
return theme.semantics.neutral.surfaceHover;
|
|
33
|
+
if (state.selected)
|
|
34
|
+
return theme.semantics.selection.background;
|
|
35
|
+
return 'transparent';
|
|
36
|
+
}
|
|
37
|
+
/*** Renders the shared visual row content for static and interactive list items. */
|
|
38
|
+
function ListItemContent({ backgroundColor, children, compact = false, description, disabled = false, leading, testID, title, trailing, }) {
|
|
39
|
+
const content = children ?? renderDefaultContent(title, description);
|
|
40
|
+
return (<View align="center" bg={backgroundColor} direction="row" gap="m" opacity={disabled ? 0.72 : 1} px="m" py={compact ? 's' : 'm'} testID={testID}>
|
|
41
|
+
{leading !== undefined ? <View>{leading}</View> : null}
|
|
42
|
+
<View flex={1}>{content}</View>
|
|
43
|
+
{trailing !== undefined ? <View>{trailing}</View> : null}
|
|
44
|
+
</View>);
|
|
45
|
+
}
|
|
46
|
+
/*** Renders the default title and description content when custom children are absent. */
|
|
47
|
+
function renderDefaultContent(title, description) {
|
|
48
|
+
if (title === undefined && description === undefined)
|
|
49
|
+
return null;
|
|
50
|
+
return (<View flex={1} gap="xs">
|
|
51
|
+
{title !== undefined ? (<Text numberOfLines={1} variant="body" weight="medium">
|
|
52
|
+
{title}
|
|
53
|
+
</Text>) : null}
|
|
54
|
+
{description !== undefined ? (<Text emphasis="muted" numberOfLines={2} variant="bodySmall">
|
|
55
|
+
{description}
|
|
56
|
+
</Text>) : null}
|
|
57
|
+
</View>);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=ListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CA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C1D;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../../../theme/types';\nimport type { ListItemProps } from '../../../../types/list';\nimport { View } from '../../../layout/public';\nimport { Pressable } from '../../../pressable/public';\nimport { Text } from '../../../typography/public';\n\n/*** Renders a static or interactive list item with shared row geometry and interaction states. */\nexport function ListItem(props: ListItemProps) {\n const { theme } = useTheme();\n if (!props.onPress) return renderStaticListItem(props, theme);\n return renderInteractiveListItem({ ...props, onPress: props.onPress }, theme);\n}\n\n/*** Renders a non-pressable list item. */\nfunction renderStaticListItem(props: ListItemProps, theme: SurfaceTheme) {\n return (\n <ListItemContent\n {...props}\n backgroundColor={props.selected ? theme.semantics.selection.background : 'transparent'}\n />\n );\n}\n\n/*** Renders a pressable list item with shared interaction-state presentation. */\nfunction renderInteractiveListItem(\n props: ListItemProps & { onPress: NonNullable<ListItemProps['onPress']> },\n theme: SurfaceTheme,\n) {\n return (\n <Pressable\n accessibilityLabel={props.accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: props.disabled ?? false, selected: props.selected ?? false }}\n disabled={props.disabled ?? false}\n interactionPolicy={props.interactionPolicy}\n onPress={props.onPress}\n testID={props.testID}\n >\n {(state) => (\n <ListItemContent\n {...props}\n backgroundColor={resolveListItemBackground(theme, {\n hovered: state.hovered,\n pressed: state.pressed,\n selected: props.selected ?? false,\n })}\n disabled={state.disabled}\n testID={undefined}\n />\n )}\n </Pressable>\n );\n}\n\ninterface ListItemBackgroundState {\n hovered: boolean;\n pressed: boolean;\n selected: boolean;\n}\n\ntype ListItemContentProps = Omit<\n ListItemProps,\n 'accessibilityLabel' | 'interactionPolicy' | 'onPress' | 'selected'\n> & {\n backgroundColor: string;\n};\n\n/*** Resolves the neutral list-item background for one interaction state. */\nfunction resolveListItemBackground(theme: SurfaceTheme, state: ListItemBackgroundState) {\n if (state.pressed) return theme.semantics.neutral.surfaceActive;\n if (state.hovered) return theme.semantics.neutral.surfaceHover;\n if (state.selected) return theme.semantics.selection.background;\n return 'transparent';\n}\n\n/*** Renders the shared visual row content for static and interactive list items. */\nfunction ListItemContent({\n backgroundColor,\n children,\n compact = false,\n description,\n disabled = false,\n leading,\n testID,\n title,\n trailing,\n}: ListItemContentProps) {\n const content = children ?? renderDefaultContent(title, description);\n\n return (\n <View\n align=\"center\"\n bg={backgroundColor}\n direction=\"row\"\n gap=\"m\"\n opacity={disabled ? 0.72 : 1}\n px=\"m\"\n py={compact ? 's' : 'm'}\n testID={testID}\n >\n {leading !== undefined ? <View>{leading}</View> : null}\n <View flex={1}>{content}</View>\n {trailing !== undefined ? <View>{trailing}</View> : null}\n </View>\n );\n}\n\n/*** Renders the default title and description content when custom children are absent. */\nfunction renderDefaultContent(title: React.ReactNode, description: React.ReactNode) {\n if (title === undefined && description === undefined) return null;\n return (\n <View flex={1} gap=\"xs\">\n {title !== undefined ? (\n <Text numberOfLines={1} variant=\"body\" weight=\"medium\">\n {title}\n </Text>\n ) : null}\n {description !== undefined ? (\n <Text emphasis=\"muted\" numberOfLines={2} variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export type { ListItemProps, ListProps } from '../../types/list';\nexport { List } from './adapters/inbound/List';\nexport { ListItem } from './adapters/inbound/ListItem';\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PressableProps } from '../../../../types/pressable';
|
|
3
|
+
/*** Renders the token-aware Surface adapter for React Native Pressable. */
|
|
4
|
+
export declare function Pressable({ children, disabled, interactionPolicy, onPress, onLongPress, accessibilityLabel, accessibilityRole, accessibilityState, style, testID, ...props }: PressableProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../../../../src/features/pressable/adapters/inbound/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,QAAgB,EAChB,iBAA6B,EAC7B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAA4B,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,cAAc,qBAsChB"}
|
|
@@ -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,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,iBAAiB,GAAG,SAAS,EAC7B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAAG,QAAQ,EAC5B,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACO;IACf,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,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,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J,CAAC,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,CAAC,cAAc,EAAE,EAAE;YAClB,MAAM,KAAK,GAAG,uBAAuB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAClF,OAAO,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,CAAC,CACH;IAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,SAAS,oBAAoB,CAC3B,iBAAsD,EACtD,OAAkC,EAClC,WAA0C;IAE1C,OAAO,iBAAiB,KAAK,SAAS;QACpC,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;QAChD,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,yFAAyF;AACzF,SAAS,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
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export type { FieldProps } from './components/field';
|
|
2
|
-
export { Field } from './components/field';
|
|
3
|
-
export type { HelperTextProps } from './components/helper-text';
|
|
4
|
-
export { HelperText } from './components/helper-text';
|
|
5
|
-
export type { LabelProps } from './components/label';
|
|
6
|
-
export { Label } from './components/label';
|
|
7
|
-
export type { ListItemProps } from './components/list-item';
|
|
8
|
-
export { ListItem } from './components/list-item';
|
|
9
|
-
export type { SwitchProps } from './components/switch';
|
|
10
|
-
export { Switch } from './components/switch';
|
|
11
|
-
export type { TextareaProps } from './components/textarea';
|
|
12
|
-
export { Textarea } from './components/textarea';
|
|
13
1
|
export type { FontRuntime } from './context/FontContext';
|
|
14
2
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
15
3
|
export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
|
|
@@ -27,8 +15,12 @@ export type { CardProps } from './features/card/public';
|
|
|
27
15
|
export { Card } from './features/card/public';
|
|
28
16
|
export type { CheckboxProps } from './features/form/checkbox/public';
|
|
29
17
|
export { Checkbox } from './features/form/checkbox/public';
|
|
18
|
+
export type { FieldProps } from './features/form/field/public';
|
|
19
|
+
export { Field } from './features/form/field/public';
|
|
30
20
|
export type { RadioProps } from './features/form/radio/public';
|
|
31
21
|
export { Radio } from './features/form/radio/public';
|
|
22
|
+
export type { SwitchProps } from './features/form/switch/public';
|
|
23
|
+
export { Switch } from './features/form/switch/public';
|
|
32
24
|
export type { TextInputProps } from './features/form/text-input/public';
|
|
33
25
|
export { TextInput } from './features/form/text-input/public';
|
|
34
26
|
export type { FontIconSource, IconProps, IconProvider, IconSource, IconVariant, SvgIconSource, } from './features/icon/public';
|
|
@@ -39,12 +31,16 @@ export type { KeyboardAvoidingViewBehavior, KeyboardAvoidingViewProps, } from '.
|
|
|
39
31
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
40
32
|
export type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';
|
|
41
33
|
export { Divider, Grid, ScrollView, View } from './features/layout/public';
|
|
34
|
+
export type { ListItemProps, ListProps } from './features/list/public';
|
|
35
|
+
export { List, ListItem } from './features/list/public';
|
|
42
36
|
export type { ModalProps } from './features/modal/public';
|
|
43
37
|
export { Modal } from './features/modal/public';
|
|
44
38
|
export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from './features/popover/public';
|
|
45
39
|
export { Popover } from './features/popover/public';
|
|
46
40
|
export type { PopoverMenuAction, PopoverMenuActionIntent, PopoverMenuProps, } from './features/popover-menu/public';
|
|
47
41
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
42
|
+
export type { PressableProps } from './features/pressable/public';
|
|
43
|
+
export { Pressable } from './features/pressable/public';
|
|
48
44
|
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
49
45
|
export { Surface } from './features/surface/public';
|
|
50
46
|
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';
|
|
@@ -56,8 +52,6 @@ export { Tooltip } from './features/tooltip/public';
|
|
|
56
52
|
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
57
53
|
export { Heading, Text } from './features/typography/public';
|
|
58
54
|
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
59
|
-
export type { ButtonBaseProps } from './primitives/button-base';
|
|
60
|
-
export { ButtonBase } from './primitives/button-base';
|
|
61
55
|
export type { SurfaceColor, SurfaceEmphasis, SurfacePaletteColor, SurfaceStatusColor, } from './surfaceColor';
|
|
62
56
|
export { SURFACE_COLORS, SURFACE_EMPHASES, SURFACE_PALETTE_COLORS, SURFACE_STATUS_COLORS, } from './surfaceColor';
|
|
63
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,
|
|
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,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE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1F,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
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export { Field } from './components/field';
|
|
2
|
-
export { HelperText } from './components/helper-text';
|
|
3
|
-
export { Label } from './components/label';
|
|
4
|
-
export { ListItem } from './components/list-item';
|
|
5
|
-
export { Switch } from './components/switch';
|
|
6
|
-
export { Textarea } from './components/textarea';
|
|
7
1
|
export { FontProvider, useFontContext } from './context/FontContext';
|
|
8
2
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
9
3
|
export * from './core/responsive';
|
|
@@ -13,21 +7,24 @@ export { Badge } from './features/badge/public';
|
|
|
13
7
|
export { Button, IconButton } from './features/button/public';
|
|
14
8
|
export { Card } from './features/card/public';
|
|
15
9
|
export { Checkbox } from './features/form/checkbox/public';
|
|
10
|
+
export { Field } from './features/form/field/public';
|
|
16
11
|
export { Radio } from './features/form/radio/public';
|
|
12
|
+
export { Switch } from './features/form/switch/public';
|
|
17
13
|
export { TextInput } from './features/form/text-input/public';
|
|
18
14
|
export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
|
|
19
15
|
export { Image } from './features/image/public';
|
|
20
16
|
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
21
17
|
export { Divider, Grid, ScrollView, View } from './features/layout/public';
|
|
18
|
+
export { List, ListItem } from './features/list/public';
|
|
22
19
|
export { Modal } from './features/modal/public';
|
|
23
20
|
export { Popover } from './features/popover/public';
|
|
24
21
|
export { PopoverMenu } from './features/popover-menu/public';
|
|
22
|
+
export { Pressable } from './features/pressable/public';
|
|
25
23
|
export { Surface } from './features/surface/public';
|
|
26
24
|
export { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';
|
|
27
25
|
export { Toast, ToastProvider, useToast } from './features/toast/public';
|
|
28
26
|
export { Tooltip } from './features/tooltip/public';
|
|
29
27
|
export { Heading, Text } from './features/typography/public';
|
|
30
|
-
export { ButtonBase } from './primitives/button-base';
|
|
31
28
|
export { SURFACE_COLORS, SURFACE_EMPHASES, SURFACE_PALETTE_COLORS, SURFACE_STATUS_COLORS, } from './surfaceColor';
|
|
32
29
|
export * from './theme';
|
|
33
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,
|
|
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,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,cAAc,mBAAmB,CAAC;AAUlC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,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xB,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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/types/field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/types/field.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nexport interface FieldProps {\n children?: React.ReactNode;\n label?: React.ReactNode;\n helperText?: React.ReactNode;\n errorText?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n readOnly?: boolean;\n testID?: string;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { InteractionPolicyProps } from '../interactionPolicy';
|
|
3
|
+
export interface ListProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
testID?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ListItemProps extends InteractionPolicyProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
leading?: React.ReactNode;
|
|
12
|
+
trailing?: React.ReactNode;
|
|
13
|
+
onPress?: (() => void) | undefined;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
accessibilityLabel?: string;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/types/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,sBAAsB;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/types/list.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicyProps } from '../interactionPolicy';\n\nexport interface ListProps {\n children?: React.ReactNode;\n testID?: string;\n}\n\nexport interface ListItemProps extends InteractionPolicyProps {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onPress?: (() => void) | undefined;\n disabled?: boolean;\n selected?: boolean;\n compact?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n"]}
|