@ankhorage/zora 2.13.2 → 3.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 +13 -0
- package/README.md +1 -1
- package/dist/components/action-sheet/ActionSheetItem.d.ts.map +1 -1
- package/dist/components/action-sheet/ActionSheetItem.js +1 -1
- package/dist/components/action-sheet/ActionSheetItem.js.map +1 -1
- package/dist/components/app-bar/AppBar.js.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/gradient/Gradient.d.ts +2 -2
- package/dist/components/gradient/Gradient.d.ts.map +1 -1
- package/dist/components/gradient/Gradient.js +12 -7
- package/dist/components/gradient/Gradient.js.map +1 -1
- package/dist/components/gradient/GradientRendererContext.d.ts +11 -0
- package/dist/components/gradient/GradientRendererContext.d.ts.map +1 -0
- package/dist/components/gradient/GradientRendererContext.js +19 -0
- package/dist/components/gradient/GradientRendererContext.js.map +1 -0
- package/dist/components/gradient/index.d.ts +2 -1
- package/dist/components/gradient/index.d.ts.map +1 -1
- package/dist/components/gradient/index.js +1 -0
- package/dist/components/gradient/index.js.map +1 -1
- package/dist/components/gradient/types.d.ts +14 -0
- package/dist/components/gradient/types.d.ts.map +1 -1
- package/dist/components/gradient/types.js.map +1 -1
- package/dist/components/icon/Icon.d.ts +1 -2
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/metric-card/MetricCard.d.ts.map +1 -1
- package/dist/components/metric-card/MetricCard.js +1 -1
- package/dist/components/metric-card/MetricCard.js.map +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +1 -1
- package/dist/components/textarea/Textarea.js.map +1 -1
- 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/internal/resolveZoraNavigationItems.d.ts +2 -2
- package/dist/internal/resolveZoraNavigationItems.d.ts.map +1 -1
- package/dist/internal/resolveZoraNavigationItems.js +4 -3
- package/dist/internal/resolveZoraNavigationItems.js.map +1 -1
- package/dist/layout/app-shell/AppShell.d.ts.map +1 -1
- package/dist/layout/app-shell/AppShell.js +2 -4
- package/dist/layout/app-shell/AppShell.js.map +1 -1
- package/dist/patterns/auth/oauthProviders.d.ts +9 -0
- package/dist/patterns/auth/oauthProviders.d.ts.map +1 -1
- package/dist/patterns/auth/oauthProviders.js +9 -9
- package/dist/patterns/auth/oauthProviders.js.map +1 -1
- package/dist/patterns/auth/types.d.ts +2 -6
- package/dist/patterns/auth/types.d.ts.map +1 -1
- package/dist/patterns/auth/types.js.map +1 -1
- package/dist/patterns/scanner/BarcodeScannerView.js +1 -1
- package/dist/patterns/scanner/BarcodeScannerView.js.map +1 -1
- package/dist/patterns/timeline/Timeline.d.ts.map +1 -1
- package/dist/patterns/timeline/Timeline.js +1 -1
- package/dist/patterns/timeline/Timeline.js.map +1 -1
- package/dist/patterns/zora-tab-bar/ZoraTabBar.d.ts.map +1 -1
- package/dist/patterns/zora-tab-bar/ZoraTabBar.js +1 -1
- package/dist/patterns/zora-tab-bar/ZoraTabBar.js.map +1 -1
- package/package.json +34 -29
- package/src/components/action-sheet/ActionSheetItem.tsx +1 -6
- package/src/components/app-bar/AppBar.tsx +3 -3
- package/src/components/avatar/Avatar.tsx +1 -8
- package/src/components/breadcrumbs/Breadcrumbs.tsx +1 -2
- package/src/components/chip/Chip.tsx +1 -8
- package/src/components/gradient/Gradient.tsx +16 -12
- package/src/components/gradient/GradientRendererContext.tsx +27 -0
- package/src/components/gradient/index.ts +4 -0
- package/src/components/gradient/types.ts +17 -0
- package/src/components/icon/Icon.tsx +1 -1
- package/src/components/input/Input.tsx +2 -12
- package/src/components/menu/Menu.tsx +1 -8
- package/src/components/metric-card/MetricCard.tsx +1 -8
- package/src/components/select/Select.tsx +1 -1
- package/src/components/textarea/Textarea.tsx +2 -12
- package/src/expo57Migration.test.ts +125 -0
- package/src/index.ts +4 -1
- package/src/interactionPolicy.test.ts +1 -1
- package/src/internal/resolveZoraNavigationItems.test.ts +11 -0
- package/src/internal/resolveZoraNavigationItems.ts +7 -6
- package/src/layout/app-shell/AppShell.tsx +2 -6
- package/src/metadata/componentMeta.test.ts +2 -1
- package/src/nativePeerContract.test.ts +5 -3
- package/src/patterns/auth/oauthProviders.test.ts +25 -0
- package/src/patterns/auth/oauthProviders.ts +9 -9
- package/src/patterns/auth/types.ts +2 -6
- package/src/patterns/scanner/BarcodeScannerView.tsx +1 -1
- package/src/patterns/timeline/Timeline.tsx +1 -2
- package/src/patterns/zora-tab-bar/ZoraTabBar.tsx +1 -2
- package/src/platformAcceptance.test.ts +14 -0
- package/src/registry.test.ts +5 -1
- package/src/theme/themeScopeStructure.test.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/auth/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ButtonProps } from '../../components/button';\nimport type { FormFieldConfig, FormValues } from '../../components/form';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type AuthIdentifierKind = 'email' | 'phone' | 'username';\n\nexport interface AuthFormBaseProps extends ZoraBaseProps {\n loading?: boolean;\n disabled?: boolean;\n error?: React.ReactNode;\n submitLabel?: React.ReactNode;\n}\n\nexport interface SignInFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n secret: string;\n}\n\nexport interface SignInFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n secretLabel?: React.ReactNode;\n forgotPasswordLabel?: React.ReactNode;\n signUpLabel?: React.ReactNode;\n onSubmit: (values: SignInFormValues) => void | Promise<void>;\n onForgotPassword?: () => void | Promise<void>;\n onSignUp?: () => void | Promise<void>;\n}\n\nexport type SignUpFormValues = FormValues;\nexport type SignUpFormField = FormFieldConfig;\n\nexport interface SignUpFormProps extends AuthFormBaseProps {\n fields?: readonly SignUpFormField[];\n signInLabel?: React.ReactNode;\n onSubmit: (values: SignUpFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface ForgotPasswordFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n}\n\nexport interface ForgotPasswordFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n signInLabel?: React.ReactNode;\n onSubmit: (values: ForgotPasswordFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface OtpFormValues {\n otp: string;\n}\n\nexport interface OtpFormProps extends AuthFormBaseProps {\n length?: number;\n otpLabel?: React.ReactNode;\n resendLabel?: React.ReactNode;\n resendDisabled?: boolean;\n resendLoading?: boolean;\n onSubmit: (values: OtpFormValues) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/auth/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ButtonProps } from '../../components/button';\nimport type { FormFieldConfig, FormValues } from '../../components/form';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type AuthIdentifierKind = 'email' | 'phone' | 'username';\n\nexport interface AuthFormBaseProps extends ZoraBaseProps {\n loading?: boolean;\n disabled?: boolean;\n error?: React.ReactNode;\n submitLabel?: React.ReactNode;\n}\n\nexport interface SignInFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n secret: string;\n}\n\nexport interface SignInFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n secretLabel?: React.ReactNode;\n forgotPasswordLabel?: React.ReactNode;\n signUpLabel?: React.ReactNode;\n onSubmit: (values: SignInFormValues) => void | Promise<void>;\n onForgotPassword?: () => void | Promise<void>;\n onSignUp?: () => void | Promise<void>;\n}\n\nexport type SignUpFormValues = FormValues;\nexport type SignUpFormField = FormFieldConfig;\n\nexport interface SignUpFormProps extends AuthFormBaseProps {\n fields?: readonly SignUpFormField[];\n signInLabel?: React.ReactNode;\n onSubmit: (values: SignUpFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface ForgotPasswordFormValues {\n identifier: string;\n identifierKind: AuthIdentifierKind;\n}\n\nexport interface ForgotPasswordFormProps extends AuthFormBaseProps {\n identifiers?: readonly AuthIdentifierKind[];\n identifierLabel?: React.ReactNode;\n signInLabel?: React.ReactNode;\n onSubmit: (values: ForgotPasswordFormValues) => void | Promise<void>;\n onSignIn?: () => void | Promise<void>;\n}\n\nexport interface OtpFormValues {\n otp: string;\n}\n\nexport interface OtpFormProps extends AuthFormBaseProps {\n length?: number;\n otpLabel?: React.ReactNode;\n resendLabel?: React.ReactNode;\n resendDisabled?: boolean;\n resendLoading?: boolean;\n onSubmit: (values: OtpFormValues) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n}\n\nexport type OAuthProviderIconSpec = ButtonIconSpec;\n\nexport interface OAuthProviderItem {\n id: string;\n label?: React.ReactNode;\n icon?: OAuthProviderIconSpec;\n disabled?: boolean;\n loading?: boolean;\n}\n\nexport interface OAuthProviderButtonProps extends ZoraBaseProps {\n providerId: string;\n label?: React.ReactNode;\n icon?: OAuthProviderIconSpec;\n disabled?: boolean;\n loading?: boolean;\n fullWidth?: boolean;\n size?: ButtonProps['size'];\n variant?: ButtonProps['variant'];\n color?: ButtonProps['color'];\n onPress?: (providerId: string) => void | Promise<void>;\n}\n\nexport type OAuthProviderListLayout = 'stack' | 'inline';\n\nexport interface OAuthProviderListProps extends ZoraBaseProps {\n providers: readonly OAuthProviderItem[];\n disabled?: boolean;\n loading?: boolean;\n fullWidth?: boolean;\n layout?: OAuthProviderListLayout;\n size?: ButtonProps['size'];\n variant?: ButtonProps['variant'];\n color?: ButtonProps['color'];\n onProviderPress?: (providerId: string) => void | Promise<void>;\n}\n"]}
|
|
@@ -23,7 +23,7 @@ function BarcodeScannerViewInner({ themeId: _themeId, interactionPolicy, mode: _
|
|
|
23
23
|
<Box>
|
|
24
24
|
<View style={[styles.viewport, viewportStyle]}>
|
|
25
25
|
{camera ? (<View style={styles.cameraSlot}>{camera}</View>) : (<View style={[styles.placeholder, placeholderStyle]}/>)}
|
|
26
|
-
<View
|
|
26
|
+
<View style={[styles.overlay, { pointerEvents: 'none' }]}>
|
|
27
27
|
<ScanOverlay cornerLabel={cornerLabel} description={overlayDescription} title={overlayTitle}/>
|
|
28
28
|
</View>
|
|
29
29
|
</View>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarcodeScannerView.js","sourceRoot":"","sources":["../../../src/patterns/scanner/BarcodeScannerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;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,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,UAAU;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;IACD,WAAW,EAAE;QACX,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;IACD,OAAO,EAAE;QACP,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,EAAE;KACR;CACF,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { Card } from '../../components/card';\nimport { Text } from '../../components/text';\nimport { Box, Stack } from '../../foundation';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { CameraPermissionView } from './CameraPermissionView';\nimport { ScanOverlay } from './ScanOverlay';\nimport type { BarcodeScannerViewProps } from './types';\n\nfunction BarcodeScannerViewInner({\n themeId: _themeId,\n interactionPolicy,\n mode: _mode,\n permissionStatus,\n camera,\n children,\n title = 'Scan barcode',\n description = 'Point the camera at a barcode to continue.',\n overlayTitle,\n overlayDescription,\n cornerLabel,\n requestPermissionLabel,\n deniedPermissionLabel,\n manualEntryLabel,\n onRequestPermission,\n onManualEntry,\n testID,\n}: BarcodeScannerViewProps) {\n const { theme } = useZoraTheme();\n const viewportStyle = {\n backgroundColor: theme.semantics.surface.default,\n };\n const placeholderStyle = {\n backgroundColor: theme.semantics.surface.default,\n };\n\n if (permissionStatus !== 'granted') {\n return (\n <CameraPermissionView\n deniedLabel={deniedPermissionLabel}\n manualEntryLabel={manualEntryLabel}\n onManualEntry={onManualEntry}\n onRequestPermission={onRequestPermission}\n requestLabel={requestPermissionLabel}\n status={permissionStatus}\n testID={testID}\n interactionPolicy={interactionPolicy}\n />\n );\n }\n\n return (\n <Card\n compact\n description={description}\n eyebrow=\"Scanner\"\n interactionPolicy={interactionPolicy}\n testID={testID}\n title={title}\n tone=\"subtle\"\n >\n <Stack gap=\"m\">\n <Box>\n <View style={[styles.viewport, viewportStyle]}>\n {camera ? (\n <View style={styles.cameraSlot}>{camera}</View>\n ) : (\n <View style={[styles.placeholder, placeholderStyle]} />\n )}\n <View style={[styles.overlay, { pointerEvents: 'none' }]}>\n <ScanOverlay\n cornerLabel={cornerLabel}\n description={overlayDescription}\n title={overlayTitle}\n />\n </View>\n </View>\n </Box>\n {children ? <Box>{children}</Box> : null}\n <Text emphasis=\"muted\" variant=\"caption\">\n Native scanning belongs to an app adapter such as expo-camera. ZORA owns this visible\n scanner surface.\n </Text>\n </Stack>\n </Card>\n );\n}\n\nconst styles = StyleSheet.create({\n viewport: {\n aspectRatio: 0.72,\n borderRadius: 28,\n minHeight: 360,\n overflow: 'hidden',\n position: 'relative',\n },\n cameraSlot: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n placeholder: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n overlay: {\n bottom: 24,\n left: 24,\n position: 'absolute',\n right: 24,\n top: 24,\n },\n});\n\n/***\n * Composed ZORA scanner shell for barcode scanning experiences.\n *\n * `BarcodeScannerView` is camera-adapter-neutral: pass an `expo-camera`, web,\n * or test camera element through `camera`; keep permission and fallback UI here.\n *\n */\nexport const BarcodeScannerView = withZoraThemeScope(BarcodeScannerViewInner);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/patterns/timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/patterns/timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAuG3D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -43,7 +43,7 @@ function TimelineInner({ themeId: _themeId, mode: _mode, interactionPolicy: _int
|
|
|
43
43
|
return (<Inline key={item.id} align="flex-start" gap="m" testID={item.testID} wrap="nowrap">
|
|
44
44
|
<Stack align="center" flexShrink={0} gap="xs" style={{ width: 24 }}>
|
|
45
45
|
<Box bg={status === 'neutral' ? theme.semantics.neutral.surface : role.softBg} borderColor={status === 'neutral' ? theme.semantics.neutral.divider : role.base} borderWidth={1} height={20} radius="full" width={20} style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
46
|
-
{item.icon ? (<Icon color={status === 'neutral' ? theme.semantics.content.muted : role.base}
|
|
46
|
+
{item.icon ? (<Icon {...item.icon} color={status === 'neutral' ? theme.semantics.content.muted : role.base} size={iconSize}/>) : null}
|
|
47
47
|
</Box>
|
|
48
48
|
|
|
49
49
|
{showConnector ? (<Box bg={theme.semantics.neutral.divider} height={connectorHeight} radius="full" style={{ width: 2 }}/>) : null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../../src/patterns/timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBA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;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CACxB;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Heading } from '../../components/heading';\nimport { Icon } from '../../components/icon';\nimport { Text } from '../../components/text';\nimport { Box, Inline, Stack } from '../../foundation';\nimport type { ZoraColor } from '../../internal/recipes';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { TimelineItem, TimelineProps } from './types';\n\nfunction resolveRoleSemantics(theme: SurfaceTheme, color: ZoraColor): RoleSemantics {\n switch (color) {\n case 'secondary':\n return theme.semantics.secondary;\n case 'tertiary':\n return theme.semantics.accent;\n case 'quaternary':\n return theme.semantics.highlight;\n case 'error':\n return theme.semantics.error;\n case 'info':\n return theme.semantics.info;\n case 'primary':\n return theme.semantics.action.primary;\n case 'danger':\n return theme.semantics.action.danger;\n case 'success':\n return theme.semantics.success;\n case 'warning':\n return theme.semantics.warning;\n case 'neutral':\n default:\n return theme.semantics.action.neutral;\n }\n}\n\nfunction TimelineInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy: _interactionPolicy,\n testID,\n items,\n compact = false,\n}: TimelineProps) {\n const { theme } = useZoraTheme();\n const gap = compact ? 'm' : 'l';\n const connectorHeight = compact ? 20 : 36;\n\n const renderItem = (item: TimelineItem, index: number) => {\n const status = item.status ?? 'neutral';\n const role = resolveRoleSemantics(theme, status);\n const showConnector = index < items.length - 1;\n const iconSize = Math.max(12, resolveIconSize('s'));\n\n return (\n <Inline key={item.id} align=\"flex-start\" gap=\"m\" testID={item.testID} wrap=\"nowrap\">\n <Stack align=\"center\" flexShrink={0} gap=\"xs\" style={{ width: 24 }}>\n <Box\n bg={status === 'neutral' ? theme.semantics.neutral.surface : role.softBg}\n borderColor={status === 'neutral' ? theme.semantics.neutral.divider : role.base}\n borderWidth={1}\n height={20}\n radius=\"full\"\n width={20}\n style={{ alignItems: 'center', justifyContent: 'center' }}\n >\n {item.icon ? (\n <Icon\n {...item.icon}\n color={status === 'neutral' ? theme.semantics.content.muted : role.base}\n size={iconSize}\n />\n ) : null}\n </Box>\n\n {showConnector ? (\n <Box\n bg={theme.semantics.neutral.divider}\n height={connectorHeight}\n radius=\"full\"\n style={{ width: 2 }}\n />\n ) : null}\n </Stack>\n\n <Stack flex={1} gap=\"xs\" testID={testID}>\n <Inline align=\"flex-start\" gap=\"s\" justify=\"space-between\" wrap=\"wrap\">\n <Heading level={compact ? 4 : 3}>{item.title}</Heading>\n {item.meta ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {item.meta}\n </Text>\n ) : null}\n </Inline>\n {item.description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {item.description}\n </Text>\n ) : null}\n </Stack>\n </Inline>\n );\n };\n\n return (\n <Stack gap={gap} testID={testID}>\n {items.map(renderItem)}\n </Stack>\n );\n}\n\n/***\n * Timeline pattern for displaying a sequence of events.\n *\n \n */\nexport const Timeline = withZoraThemeScope(TimelineInner);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraTabBar.d.ts","sourceRoot":"","sources":["../../../src/patterns/zora-tab-bar/ZoraTabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ZoraTabBar.d.ts","sourceRoot":"","sources":["../../../src/patterns/zora-tab-bar/ZoraTabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA4I/C;;;;GAIG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -59,7 +59,7 @@ function ZoraTabBarInner({ themeId: _themeId, mode: _mode, interactionPolicy, st
|
|
|
59
59
|
paddingHorizontal: theme.spacing.s,
|
|
60
60
|
paddingVertical: compact ? theme.spacing.xs : theme.spacing.s,
|
|
61
61
|
}} testID={item.metadata?.testID ?? (testID ? `${testID}-item-${item.route.key}` : undefined)}>
|
|
62
|
-
{item.metadata?.icon ? (<Icon
|
|
62
|
+
{item.metadata?.icon ? (<Icon {...item.metadata.icon} color={contentColor} size={compact ? theme.spacing.m : theme.spacing.l}/>) : null}
|
|
63
63
|
<ReactNativeText numberOfLines={1} style={{
|
|
64
64
|
color: contentColor,
|
|
65
65
|
fontSize: labelSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraTabBar.js","sourceRoot":"","sources":["../../../src/patterns/zora-tab-bar/ZoraTabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,yBAAyB,CAChC,KAAsB,EACtB,aAAsB;IAEtB,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,C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AK,MAAM,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,CACL,CAAC,OAAO,CACN,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAChD,OAAO,CAAC,QAAQ,CAEhB;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,OAAO,CAAC,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, Text as ReactNativeText } from 'react-native';\n\nimport { Icon } from '../../components/icon';\nimport { Box, Surface } from '../../foundation';\nimport {\n createTabBarItemPressHandler,\n resolveNavigationItems,\n} from '../../internal/resolveZoraNavigationItems';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraTabBarProps } from './types';\n\nfunction resolveAccessibilityLabel(\n label: React.ReactNode,\n explicitLabel?: string,\n): string | undefined {\n if (explicitLabel !== undefined) {\n return explicitLabel;\n }\n\n if (typeof label === 'string') {\n return label;\n }\n\n if (typeof label === 'number') {\n return String(label);\n }\n\n return undefined;\n}\n\nfunction ZoraTabBarInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n state,\n navigation,\n descriptors,\n insets,\n routeMap,\n compact = false,\n chrome = 'raised',\n testID,\n}: ZoraTabBarProps) {\n const { theme } = useZoraTheme();\n const resolved = resolveNavigationItems({\n state,\n descriptors,\n routeMap,\n kind: 'tab',\n });\n\n const bottomInset = insets?.bottom ?? 0;\n const minHeight = compact ? 56 : 64;\n const labelSize = compact ? theme.typography.sizes.xs : theme.typography.sizes.s;\n const labelWeight = theme.typography.weights.medium;\n const content = (\n <Box\n bg=\"surface\"\n style={{\n borderTopColor: theme.semantics.border.default,\n borderTopWidth: 1,\n flexDirection: 'row',\n minHeight: minHeight + bottomInset,\n paddingBottom: bottomInset,\n }}\n testID={testID}\n >\n {resolved.map((item) => {\n const { active } = item;\n const { disabled } = item;\n const contentColor = disabled\n ? theme.semantics.content.subtle\n : active\n ? theme.semantics.action.primary.base\n : theme.semantics.content.muted;\n const backgroundColor = active\n ? theme.semantics.action.primary.softBg\n : theme.semantics.surface.default;\n\n return (\n <Pressable\n accessibilityLabel={resolveAccessibilityLabel(\n item.label,\n item.metadata?.accessibilityLabel,\n )}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: active, disabled }}\n disabled={disabled}\n key={item.route.key}\n onPress={\n interactionPolicy === 'passive'\n ? undefined\n : createTabBarItemPressHandler({ item, navigation })\n }\n style={{\n alignItems: 'center',\n backgroundColor,\n flex: 1,\n justifyContent: 'center',\n minHeight,\n opacity: disabled ? 0.48 : 1,\n paddingHorizontal: theme.spacing.s,\n paddingVertical: compact ? theme.spacing.xs : theme.spacing.s,\n }}\n testID={\n item.metadata?.testID ?? (testID ? `${testID}-item-${item.route.key}` : undefined)\n }\n >\n {item.metadata?.icon ? (\n <Icon\n {...item.metadata.icon}\n color={contentColor}\n size={compact ? theme.spacing.m : theme.spacing.l}\n />\n ) : null}\n <ReactNativeText\n numberOfLines={1}\n style={{\n color: contentColor,\n fontSize: labelSize,\n fontWeight: labelWeight,\n lineHeight: compact ? 16 : 20,\n marginTop: item.metadata?.icon ? theme.spacing.xs : 0,\n textAlign: 'center',\n }}\n >\n {item.label}\n </ReactNativeText>\n </Pressable>\n );\n })}\n </Box>\n );\n\n if (chrome === 'none') {\n return content;\n }\n\n return (\n <Surface\n interactionPolicy={interactionPolicy}\n testID={testID ? `${testID}-chrome` : undefined}\n variant=\"raised\"\n >\n {content}\n </Surface>\n );\n}\n\n/***\n * Bottom tab bar pattern with badge support and active state styling.\n *\n \n */\nexport const ZoraTabBar = withZoraThemeScope(ZoraTabBarInner);\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -25,25 +25,20 @@
|
|
|
25
25
|
"components"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@react-native-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"react": "
|
|
33
|
-
"react
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"optional": true
|
|
38
|
-
},
|
|
39
|
-
"expo-font": {
|
|
40
|
-
"optional": true
|
|
41
|
-
}
|
|
28
|
+
"@react-native-picker/picker": "2.11.4",
|
|
29
|
+
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
30
|
+
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
31
|
+
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
|
32
|
+
"@react-native-vector-icons/ionicons": "^13.1.3",
|
|
33
|
+
"react": "19.2.3",
|
|
34
|
+
"react-native": "0.86.2",
|
|
35
|
+
"react-native-safe-area-context": "~5.7.0",
|
|
36
|
+
"react-native-web": "~0.21.0"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
44
39
|
"@ankhorage/color-theory": "^0.0.8",
|
|
45
|
-
"@ankhorage/contracts": "^
|
|
46
|
-
"@ankhorage/surface": "^
|
|
40
|
+
"@ankhorage/contracts": "^8.0.0",
|
|
41
|
+
"@ankhorage/surface": "^3.0.0"
|
|
47
42
|
},
|
|
48
43
|
"files": [
|
|
49
44
|
"dist",
|
|
@@ -79,28 +74,38 @@
|
|
|
79
74
|
"changeset:status": "changeset status --since=origin/main",
|
|
80
75
|
"docs": "paradox",
|
|
81
76
|
"knip": "ankhorage-knip",
|
|
77
|
+
"examples:validate": "bun scripts/validate-example-projects.ts",
|
|
78
|
+
"expo:candidate": "bun scripts/validate-expo-candidate.ts",
|
|
82
79
|
"lint": "ankhorage-eslint . --max-warnings=0",
|
|
83
80
|
"lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
|
|
84
81
|
"format": "ankhorage-prettier --write .",
|
|
85
82
|
"format:check": "ankhorage-prettier --check .",
|
|
86
83
|
"prepack": "bun run build",
|
|
87
84
|
"test": "bun test src",
|
|
88
|
-
"typecheck": "bun x tsc --noEmit -p tsconfig.json",
|
|
85
|
+
"typecheck": "bun x tsc --noEmit -p tsconfig.json && bun x tsc --noEmit -p tsconfig.scripts.json",
|
|
89
86
|
"version-packages": "changeset version"
|
|
90
87
|
},
|
|
91
88
|
"devDependencies": {
|
|
92
|
-
"@ankhorage/devtools": "^1.
|
|
89
|
+
"@ankhorage/devtools": "^1.6.0",
|
|
93
90
|
"@ankhorage/paradox": "^0.1.21",
|
|
94
91
|
"@changesets/cli": "^2.31.0",
|
|
95
|
-
"@
|
|
96
|
-
"@react-native-
|
|
97
|
-
"@
|
|
98
|
-
"@
|
|
99
|
-
"@
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"react
|
|
103
|
-
"
|
|
92
|
+
"@react-native-picker/picker": "2.11.4",
|
|
93
|
+
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
94
|
+
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
95
|
+
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
|
96
|
+
"@react-native-vector-icons/ionicons": "^13.1.3",
|
|
97
|
+
"@types/bun": "^1.3.14",
|
|
98
|
+
"@types/node": "^24.13.3",
|
|
99
|
+
"@types/react": "^19.2.18",
|
|
100
|
+
"@types/react-dom": "^19.2.4",
|
|
101
|
+
"@types/react-native-web": "^0.19.2",
|
|
102
|
+
"happy-dom": "^20.11.6",
|
|
103
|
+
"react": "19.2.3",
|
|
104
|
+
"react-dom": "19.2.3",
|
|
105
|
+
"react-native": "0.86.2",
|
|
106
|
+
"react-native-safe-area-context": "~5.7.0",
|
|
107
|
+
"react-native-web": "~0.21.0",
|
|
108
|
+
"typescript": "~6.0.3"
|
|
104
109
|
},
|
|
105
|
-
"packageManager": "bun@1.3.
|
|
110
|
+
"packageManager": "bun@1.3.14"
|
|
106
111
|
}
|
|
@@ -18,12 +18,7 @@ function ActionSheetItemInner({
|
|
|
18
18
|
const resolvedLeading =
|
|
19
19
|
leading ??
|
|
20
20
|
(icon ? (
|
|
21
|
-
<Icon
|
|
22
|
-
color={theme.semantics.content.muted}
|
|
23
|
-
name={icon.name}
|
|
24
|
-
provider={icon.provider}
|
|
25
|
-
size={resolveIconSize('s')}
|
|
26
|
-
/>
|
|
21
|
+
<Icon {...icon} color={theme.semantics.content.muted} size={resolveIconSize('s')} />
|
|
27
22
|
) : undefined);
|
|
28
23
|
|
|
29
24
|
return <SurfaceActionSheetItem {...props} leading={resolvedLeading} />;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppBar as SurfaceAppBar } from '@ankhorage/surface';
|
|
1
|
+
import { AppBar as SurfaceAppBar, type ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Box, Inline, Stack } from '../../foundation';
|
|
@@ -9,8 +9,8 @@ import { IconButton } from '../icon-button';
|
|
|
9
9
|
import { Text } from '../text';
|
|
10
10
|
import type { AppBarMode, AppBarOverflowAction, AppBarProps } from './types';
|
|
11
11
|
|
|
12
|
-
const DEFAULT_CANCEL_ICON = { name: 'close-outline' };
|
|
13
|
-
const DEFAULT_OVERFLOW_ICON = { name: 'ellipsis-vertical' };
|
|
12
|
+
const DEFAULT_CANCEL_ICON = { name: 'close-outline' } satisfies ButtonIconSpec;
|
|
13
|
+
const DEFAULT_OVERFLOW_ICON = { name: 'ellipsis-vertical' } satisfies ButtonIconSpec;
|
|
14
14
|
|
|
15
15
|
function resolveMode(mode: AppBarMode | undefined): AppBarMode {
|
|
16
16
|
return mode ?? { type: 'default' };
|
|
@@ -109,14 +109,7 @@ function AvatarInner({
|
|
|
109
109
|
|
|
110
110
|
if (iconFallback) {
|
|
111
111
|
const iconSize = Math.max(16, Math.round(resolvedSize * 0.48));
|
|
112
|
-
return
|
|
113
|
-
<Icon
|
|
114
|
-
color={contentColor}
|
|
115
|
-
name={iconFallback.name}
|
|
116
|
-
provider={iconFallback.provider}
|
|
117
|
-
size={iconSize}
|
|
118
|
-
/>
|
|
119
|
-
);
|
|
112
|
+
return <Icon {...iconFallback} color={contentColor} size={iconSize} />;
|
|
120
113
|
}
|
|
121
114
|
|
|
122
115
|
return null;
|
|
@@ -64,9 +64,8 @@ function BreadcrumbLabel({ item, compact }: { item: BreadcrumbItem; compact: boo
|
|
|
64
64
|
<Inline align="center" gap="xs" wrap="nowrap">
|
|
65
65
|
{item.icon ? (
|
|
66
66
|
<Icon
|
|
67
|
+
{...item.icon}
|
|
67
68
|
color={theme.semantics.content.muted}
|
|
68
|
-
name={item.icon.name}
|
|
69
|
-
provider={item.icon.provider}
|
|
70
69
|
size={resolveIconSize(compact ? 's' : 'm')}
|
|
71
70
|
/>
|
|
72
71
|
) : null}
|
|
@@ -65,14 +65,7 @@ function ChipInner({
|
|
|
65
65
|
}}
|
|
66
66
|
>
|
|
67
67
|
<Inline align="center" gap="xs" wrap="nowrap">
|
|
68
|
-
{icon ?
|
|
69
|
-
<Icon
|
|
70
|
-
color={colors.contentColor}
|
|
71
|
-
name={icon.name}
|
|
72
|
-
provider={icon.provider}
|
|
73
|
-
size={iconSize}
|
|
74
|
-
/>
|
|
75
|
-
) : null}
|
|
68
|
+
{icon ? <Icon {...icon} color={colors.contentColor} size={iconSize} /> : null}
|
|
76
69
|
<Text color={textColor} emphasis={textEmphasis} variant="label">
|
|
77
70
|
{children}
|
|
78
71
|
</Text>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Box } from '../../foundation';
|
|
5
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
+
import { useGradientRenderer } from './GradientRendererContext';
|
|
6
6
|
import type { GradientProps } from './types';
|
|
7
7
|
|
|
8
8
|
function GradientInner({
|
|
@@ -21,6 +21,8 @@ function GradientInner({
|
|
|
21
21
|
p,
|
|
22
22
|
testID,
|
|
23
23
|
}: GradientProps) {
|
|
24
|
+
const gradientRenderer = useGradientRenderer();
|
|
25
|
+
|
|
24
26
|
return (
|
|
25
27
|
<Box
|
|
26
28
|
height={height}
|
|
@@ -30,17 +32,19 @@ function GradientInner({
|
|
|
30
32
|
width={width}
|
|
31
33
|
style={{ overflow: 'hidden' }}
|
|
32
34
|
>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
{React.createElement(
|
|
36
|
+
gradientRenderer,
|
|
37
|
+
{
|
|
38
|
+
colors,
|
|
39
|
+
end,
|
|
40
|
+
locations,
|
|
41
|
+
start,
|
|
42
|
+
style: { flex: 1 },
|
|
43
|
+
},
|
|
40
44
|
<Box p={p} style={{ flex: 1 }}>
|
|
41
45
|
{children}
|
|
42
|
-
</Box
|
|
43
|
-
|
|
46
|
+
</Box>,
|
|
47
|
+
)}
|
|
44
48
|
</Box>
|
|
45
49
|
);
|
|
46
50
|
}
|
|
@@ -48,7 +52,7 @@ function GradientInner({
|
|
|
48
52
|
/***
|
|
49
53
|
* Gradient background container for branded loading surfaces, hero blocks, and previews.
|
|
50
54
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
55
|
+
* The host supplies a platform-compatible renderer through
|
|
56
|
+
* `GradientRendererProvider`; ZORA does not require an Expo runtime.
|
|
53
57
|
*/
|
|
54
58
|
export const Gradient = withZoraThemeScope(GradientInner);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { createContext, use } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { GradientRenderer, GradientRendererProviderProps } from './types';
|
|
4
|
+
|
|
5
|
+
const GradientRendererContext = createContext<GradientRenderer | null>(null);
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Supplies the host-owned renderer used by `Gradient`.
|
|
9
|
+
*
|
|
10
|
+
* Expo apps can adapt `expo-linear-gradient` here, while standalone React
|
|
11
|
+
* Native hosts can inject another compatible implementation.
|
|
12
|
+
*/
|
|
13
|
+
export function GradientRendererProvider({ children, renderer }: GradientRendererProviderProps) {
|
|
14
|
+
return <GradientRendererContext value={renderer}>{children}</GradientRendererContext>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useGradientRenderer(): GradientRenderer {
|
|
18
|
+
const renderer = use(GradientRendererContext);
|
|
19
|
+
|
|
20
|
+
if (!renderer) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
'Gradient requires a renderer. Wrap the app in GradientRendererProvider with a platform-compatible gradient implementation.',
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return renderer;
|
|
27
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export { Gradient } from './Gradient';
|
|
2
|
+
export { GradientRendererProvider } from './GradientRendererContext';
|
|
2
3
|
export type {
|
|
3
4
|
GradientColor,
|
|
4
5
|
GradientColors,
|
|
5
6
|
GradientLocations,
|
|
6
7
|
GradientPoint,
|
|
7
8
|
GradientProps,
|
|
9
|
+
GradientRenderer,
|
|
10
|
+
GradientRendererProps,
|
|
11
|
+
GradientRendererProviderProps,
|
|
8
12
|
} from './types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
3
|
|
|
3
4
|
import type { BoxProps } from '../../foundation';
|
|
4
5
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
@@ -12,6 +13,22 @@ export interface GradientPoint {
|
|
|
12
13
|
readonly y: number;
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
export interface GradientRendererProps {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
colors: GradientColors;
|
|
19
|
+
locations?: GradientLocations;
|
|
20
|
+
start?: GradientPoint;
|
|
21
|
+
end?: GradientPoint;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type GradientRenderer = React.ComponentType<GradientRendererProps>;
|
|
26
|
+
|
|
27
|
+
export interface GradientRendererProviderProps {
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
renderer: GradientRenderer;
|
|
30
|
+
}
|
|
31
|
+
|
|
15
32
|
export interface GradientProps extends ZoraBaseProps {
|
|
16
33
|
children?: React.ReactNode;
|
|
17
34
|
colors: GradientColors;
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export type IconProps = ZoraBaseProps & SurfaceIconProps;
|
|
8
8
|
|
|
9
9
|
function IconInner({
|
|
10
10
|
themeId: _themeId,
|
|
@@ -30,12 +30,7 @@ function InputInner({
|
|
|
30
30
|
interactionPolicy={interactionPolicy}
|
|
31
31
|
leadingAccessory={
|
|
32
32
|
leadingIcon ? (
|
|
33
|
-
<Surface.Icon
|
|
34
|
-
color={iconColor}
|
|
35
|
-
name={leadingIcon.name}
|
|
36
|
-
provider={leadingIcon.provider}
|
|
37
|
-
size={iconSize}
|
|
38
|
-
/>
|
|
33
|
+
<Surface.Icon {...leadingIcon} color={iconColor} size={iconSize} />
|
|
39
34
|
) : undefined
|
|
40
35
|
}
|
|
41
36
|
readOnly={readOnly}
|
|
@@ -53,12 +48,7 @@ function InputInner({
|
|
|
53
48
|
onPress={trailingAction.onPress}
|
|
54
49
|
/>
|
|
55
50
|
) : trailingIcon ? (
|
|
56
|
-
<Surface.Icon
|
|
57
|
-
color={iconColor}
|
|
58
|
-
name={trailingIcon.name}
|
|
59
|
-
provider={trailingIcon.provider}
|
|
60
|
-
size={iconSize}
|
|
61
|
-
/>
|
|
51
|
+
<Surface.Icon {...trailingIcon} color={iconColor} size={iconSize} />
|
|
62
52
|
) : undefined
|
|
63
53
|
}
|
|
64
54
|
/>
|
|
@@ -17,14 +17,7 @@ function renderActionLeading(action: MenuAction, iconColor: string) {
|
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
return (
|
|
21
|
-
<Icon
|
|
22
|
-
color={iconColor}
|
|
23
|
-
name={action.icon.name}
|
|
24
|
-
provider={action.icon.provider}
|
|
25
|
-
size={resolveIconSize('s')}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
20
|
+
return <Icon {...action.icon} color={iconColor} size={resolveIconSize('s')} />;
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
function renderActionTrailing(action: MenuAction) {
|
|
@@ -45,14 +45,7 @@ function MetricCardInner({
|
|
|
45
45
|
<Inline align="flex-start" gap="m" justify="space-between">
|
|
46
46
|
<Stack flex={1} gap="xs">
|
|
47
47
|
<Inline align="center" gap="xs" wrap="wrap">
|
|
48
|
-
{icon ? (
|
|
49
|
-
<Icon
|
|
50
|
-
color={iconColor}
|
|
51
|
-
name={icon.name}
|
|
52
|
-
provider={icon.provider}
|
|
53
|
-
size={resolveIconSize('s')}
|
|
54
|
-
/>
|
|
55
|
-
) : null}
|
|
48
|
+
{icon ? <Icon {...icon} color={iconColor} size={resolveIconSize('s')} /> : null}
|
|
56
49
|
<Text emphasis="muted" variant="caption" weight="semiBold">
|
|
57
50
|
{label}
|
|
58
51
|
</Text>
|
|
@@ -30,7 +30,7 @@ function SelectInner<TValue extends string = string>({
|
|
|
30
30
|
radius="m"
|
|
31
31
|
testID={testID}
|
|
32
32
|
>
|
|
33
|
-
<View
|
|
33
|
+
<View style={{ pointerEvents: passive ? 'none' : 'auto' }}>
|
|
34
34
|
<Picker
|
|
35
35
|
enabled={!disabled}
|
|
36
36
|
onValueChange={(itemValue) => {
|
|
@@ -25,23 +25,13 @@ function TextareaInner({
|
|
|
25
25
|
interactionPolicy={interactionPolicy}
|
|
26
26
|
leadingAccessory={
|
|
27
27
|
leadingIcon ? (
|
|
28
|
-
<Surface.Icon
|
|
29
|
-
color={iconColor}
|
|
30
|
-
name={leadingIcon.name}
|
|
31
|
-
provider={leadingIcon.provider}
|
|
32
|
-
size={iconSize}
|
|
33
|
-
/>
|
|
28
|
+
<Surface.Icon {...leadingIcon} color={iconColor} size={iconSize} />
|
|
34
29
|
) : undefined
|
|
35
30
|
}
|
|
36
31
|
size={size}
|
|
37
32
|
trailingAccessory={
|
|
38
33
|
trailingIcon ? (
|
|
39
|
-
<Surface.Icon
|
|
40
|
-
color={iconColor}
|
|
41
|
-
name={trailingIcon.name}
|
|
42
|
-
provider={trailingIcon.provider}
|
|
43
|
-
size={iconSize}
|
|
44
|
-
/>
|
|
34
|
+
<Surface.Icon {...trailingIcon} color={iconColor} size={iconSize} />
|
|
45
35
|
) : undefined
|
|
46
36
|
}
|
|
47
37
|
/>
|