@hzblj/kara-components 0.26.2 → 0.27.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 +21 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js +3 -4
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.android.js +3 -4
- package/lib/module/atoms/date-picker/date-picker.android.js.map +1 -1
- package/lib/module/atoms/island/island.android.js +2 -6
- package/lib/module/atoms/island/island.android.js.map +1 -1
- package/lib/module/atoms/picker/picker.android.js +3 -4
- package/lib/module/atoms/picker/picker.android.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +5 -4
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +3 -4
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -1
- package/lib/module/hooks/compose-host.js +27 -0
- package/lib/module/hooks/compose-host.js.map +1 -0
- package/lib/module/molecules/navigation-bar/bar-search-field.js +80 -0
- package/lib/module/molecules/navigation-bar/bar-search-field.js.map +1 -0
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +97 -22
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/rn-list-item/rn-list-item.js +3 -2
- package/lib/module/molecules/rn-list-item/rn-list-item.js.map +1 -1
- package/lib/module/molecules/rn-tooltip/rn-tooltip.android.js +3 -4
- package/lib/module/molecules/rn-tooltip/rn-tooltip.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.android.js +4 -5
- package/lib/module/organisms/context-menu/context-menu.android.js.map +1 -1
- package/lib/module/organisms/header/header-options.android.js +2 -6
- package/lib/module/organisms/header/header-options.android.js.map +1 -1
- package/lib/module/organisms/header/header-search-accessory.android.js +29 -2
- package/lib/module/organisms/header/header-search-accessory.android.js.map +1 -1
- package/lib/module/organisms/header/header-search-input.android.js +11 -51
- package/lib/module/organisms/header/header-search-input.android.js.map +1 -1
- package/lib/module/organisms/header/use-header-search.js +19 -11
- package/lib/module/organisms/header/use-header-search.js.map +1 -1
- package/lib/module/organisms/sheet/sheet.js +17 -1
- package/lib/module/organisms/sheet/sheet.js.map +1 -1
- package/lib/module/organisms/sheet/use-sheet-header.js +7 -1
- package/lib/module/organisms/sheet/use-sheet-header.js.map +1 -1
- package/lib/module/templates/screen/screen.android.js +3 -6
- package/lib/module/templates/screen/screen.android.js.map +1 -1
- package/lib/typescript/hooks/compose-host.d.ts +8 -0
- package/lib/typescript/molecules/navigation-bar/bar-search-field.d.ts +29 -0
- package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -6
- package/lib/typescript/organisms/header/header.types.d.ts +20 -10
- package/lib/typescript/organisms/header/use-header-search.d.ts +5 -3
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +1 -1
- package/package.json +4 -4
- package/src/atoms/activity-indicator/activity-indicator.android.tsx +3 -6
- package/src/atoms/date-picker/date-picker.android.tsx +3 -12
- package/src/atoms/island/island.android.tsx +3 -7
- package/src/atoms/picker/picker.android.tsx +3 -3
- package/src/atoms/pressable/pressable.tsx +5 -7
- package/src/atoms/segmented-control/segmented-control.android.tsx +3 -6
- package/src/hooks/compose-host.tsx +20 -0
- package/src/molecules/navigation-bar/bar-search-field.tsx +94 -0
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +123 -19
- package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -6
- package/src/molecules/rn-list-item/rn-list-item.tsx +2 -1
- package/src/molecules/rn-tooltip/rn-tooltip.android.tsx +4 -3
- package/src/organisms/context-menu/context-menu.android.tsx +5 -9
- package/src/organisms/header/header-options.android.tsx +3 -7
- package/src/organisms/header/header-search-accessory.android.tsx +37 -3
- package/src/organisms/header/header-search-input.android.tsx +14 -53
- package/src/organisms/header/header.types.ts +20 -10
- package/src/organisms/header/use-header-search.tsx +18 -10
- package/src/organisms/sheet/sheet.tsx +19 -2
- package/src/organisms/sheet/sheet.types.ts +1 -1
- package/src/organisms/sheet/use-sheet-header.tsx +7 -1
- package/src/templates/screen/screen.android.tsx +4 -7
|
@@ -65,7 +65,7 @@ export type SheetProps = {
|
|
|
65
65
|
draggable?: boolean
|
|
66
66
|
/** Pinned to the bottom, above the content and the keyboard. */
|
|
67
67
|
footer?: ReactElement
|
|
68
|
-
/** The drag handle. On by default. */
|
|
68
|
+
/** The drag handle. On by default. On Android it is Material's handle, coloured by the app's theme. */
|
|
69
69
|
grabber?: boolean
|
|
70
70
|
/** The user dismissed it; `visible` going false does not call this. */
|
|
71
71
|
onDismiss: () => void
|
|
@@ -17,6 +17,12 @@ type UseSheetHeaderParams = {
|
|
|
17
17
|
/** The bar's own height (`NavigationBar`) plus the room above it, before the header has been measured. */
|
|
18
18
|
const ESTIMATED_HEADER_HEIGHT = (Platform.OS === 'ios' ? 56 : 64) + spacing.s16
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Above a header with no bar. Android's grabber is drawn over the sheet's content, 16 dp from the top and 4 dp tall, so
|
|
22
|
+
* there the header starts 8 dp under it. iOS's grabber ends 10 pt from the top, inside the usual 16 pt.
|
|
23
|
+
*/
|
|
24
|
+
const HEADER_TOP_WITHOUT_BAR = Platform.OS === 'android' ? 's28' : 's16'
|
|
25
|
+
|
|
20
26
|
/** Where a large title's bar title appears once it has scrolled away: the platform's own place for it. */
|
|
21
27
|
const COLLAPSED_TITLE_ALIGNMENT: NavigationBarTitleAlignment = Platform.OS === 'ios' ? 'center' : 'leading'
|
|
22
28
|
|
|
@@ -83,7 +89,7 @@ export const useSheetHeader = ({header: headerProps, scrollable}: UseSheetHeader
|
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
return (
|
|
86
|
-
<Box onLayout={isOverlay ? handleHeaderLayout : undefined} pt=
|
|
92
|
+
<Box onLayout={isOverlay ? handleHeaderLayout : undefined} pt={hasBar ? 's16' : HEADER_TOP_WITHOUT_BAR}>
|
|
87
93
|
{hasBar ? (
|
|
88
94
|
<NavigationBar
|
|
89
95
|
inverted={inverted}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {Column
|
|
1
|
+
import {Column} from '@expo/ui/jetpack-compose'
|
|
2
2
|
import {padding} from '@expo/ui/jetpack-compose/modifiers'
|
|
3
3
|
import {useSxModifiers} from '@hzblj/kara-sx'
|
|
4
|
-
import {useAppTheme} from '@hzblj/kara-theme'
|
|
5
4
|
import {useCallback, useMemo, useRef, useState} from 'react'
|
|
6
5
|
import {StatusBar, StyleSheet, View} from 'react-native'
|
|
6
|
+
import {ComposeHost} from '../../hooks/compose-host'
|
|
7
7
|
import {HostBoundary} from '../../hooks/host-context'
|
|
8
8
|
import type {ScreenComponent, ScreenProps} from './screen.types'
|
|
9
9
|
|
|
@@ -18,7 +18,6 @@ export const Screen: ScreenComponent = ({
|
|
|
18
18
|
ignoreSafeArea = 'none',
|
|
19
19
|
testID,
|
|
20
20
|
}: ScreenProps) => {
|
|
21
|
-
const theme = useAppTheme()
|
|
22
21
|
const frame = useRef<View>(null)
|
|
23
22
|
const [statusBarOverlap, setStatusBarOverlap] = useState(0)
|
|
24
23
|
const sx = useSxModifiers({bg, tall: true, wide: true})
|
|
@@ -35,16 +34,14 @@ export const Screen: ScreenComponent = ({
|
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
36
|
<View onLayout={onLayout} ref={frame} style={StyleSheet.absoluteFill} testID={testID}>
|
|
38
|
-
<
|
|
39
|
-
colorScheme={theme.dark ? 'dark' : 'light'}
|
|
37
|
+
<ComposeHost
|
|
40
38
|
ignoreSafeAreaKeyboardInsets={ignoreSafeArea === 'all' || ignoreSafeArea === 'keyboard'}
|
|
41
|
-
seedColor={theme.materialSeed}
|
|
42
39
|
style={StyleSheet.absoluteFill}
|
|
43
40
|
>
|
|
44
41
|
<Column modifiers={modifiers}>
|
|
45
42
|
<HostBoundary>{children}</HostBoundary>
|
|
46
43
|
</Column>
|
|
47
|
-
</
|
|
44
|
+
</ComposeHost>
|
|
48
45
|
</View>
|
|
49
46
|
)
|
|
50
47
|
}
|