react-native-terra-ui 0.1.1 → 0.2.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 +90 -0
- package/lib/module/components/avatar/Avatar.js +118 -35
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/box/Box.js +15 -2
- package/lib/module/components/box/Box.js.map +1 -1
- package/lib/module/components/box/utils.js +4 -1
- package/lib/module/components/box/utils.js.map +1 -1
- package/lib/module/components/button/Button.js +7 -14
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +372 -0
- package/lib/module/components/chip/Chip.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -0
- package/lib/module/components/chip/index.js.map +1 -0
- package/lib/module/components/chip/types.js +2 -0
- package/lib/module/components/chip/types.js.map +1 -0
- package/lib/module/components/chip/utils.js +36 -0
- package/lib/module/components/chip/utils.js.map +1 -0
- package/lib/module/components/empty-state/EmptyState.js +200 -0
- package/lib/module/components/empty-state/EmptyState.js.map +1 -0
- package/lib/module/components/empty-state/index.js +4 -0
- package/lib/module/components/empty-state/index.js.map +1 -0
- package/lib/module/components/empty-state/types.js +2 -0
- package/lib/module/components/empty-state/types.js.map +1 -0
- package/lib/module/components/header/header-buttons.js +31 -36
- package/lib/module/components/header/header-buttons.js.map +1 -1
- package/lib/module/components/header/index.js +1 -1
- package/lib/module/components/header/index.js.map +1 -1
- package/lib/module/components/header/parts/HeaderGradientOverlay.js +38 -0
- package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -0
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +69 -99
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +32 -63
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/icon/Icon.js +20 -8
- package/lib/module/components/icon/Icon.js.map +1 -1
- package/lib/module/components/image/Image.js +54 -0
- package/lib/module/components/image/Image.js.map +1 -0
- package/lib/module/components/image/index.js +4 -0
- package/lib/module/components/image/index.js.map +1 -0
- package/lib/module/components/image/types.js +4 -0
- package/lib/module/components/image/types.js.map +1 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/portal/Portal.js +42 -0
- package/lib/module/components/portal/Portal.js.map +1 -0
- package/lib/module/components/portal/PortalContext.js +1 -16
- package/lib/module/components/portal/PortalContext.js.map +1 -1
- package/lib/module/components/portal/PortalHost.js +16 -14
- package/lib/module/components/portal/PortalHost.js.map +1 -1
- package/lib/module/components/portal/PortalProvider.js +51 -19
- package/lib/module/components/portal/PortalProvider.js.map +1 -1
- package/lib/module/components/portal/index.js +1 -1
- package/lib/module/components/portal/index.js.map +1 -1
- package/lib/module/components/screen/Screen.js +25 -28
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +7 -5
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenFlashList.js +144 -0
- package/lib/module/components/screen/ScreenFlashList.js.map +1 -0
- package/lib/module/components/screen/ScreenFlatList.js +88 -27
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +101 -34
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/index.js +1 -0
- package/lib/module/components/screen/index.js.map +1 -1
- package/lib/module/components/screen/parts/BottomSafeArea.js +62 -0
- package/lib/module/components/screen/parts/BottomSafeArea.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js +50 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -0
- package/lib/module/components/screen/types.js +4 -0
- package/lib/module/components/screen/types.js.map +1 -0
- package/lib/module/components/screen/utils.js +12 -9
- package/lib/module/components/screen/utils.js.map +1 -1
- package/lib/module/components/surface/Surface.js +16 -9
- package/lib/module/components/surface/Surface.js.map +1 -1
- package/lib/module/components/text/Text.js +23 -5
- package/lib/module/components/text/Text.js.map +1 -1
- package/lib/module/components/toast/Toast.js +8 -8
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +268 -0
- package/lib/module/components/toolbar/Toolbar.js.map +1 -0
- package/lib/module/components/toolbar/index.js +4 -0
- package/lib/module/components/toolbar/index.js.map +1 -0
- package/lib/module/context/ThemeProvider.js +5 -2
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/{components/icon/utils.js → theme/defaults/icons.js} +1 -1
- package/lib/module/theme/defaults/icons.js.map +1 -0
- package/lib/module/theme/defaults/image.js +30 -0
- package/lib/module/theme/defaults/image.js.map +1 -0
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/{configure.js → registry.js} +21 -28
- package/lib/module/theme/registry.js.map +1 -0
- package/lib/module/theme/runtime.js +1 -1
- package/lib/module/theme/theme.js +91 -10
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/theme/tokens/dark.js +59 -68
- package/lib/module/theme/tokens/dark.js.map +1 -1
- package/lib/module/theme/tokens/light.js +49 -67
- package/lib/module/theme/tokens/light.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +241 -20
- package/lib/module/theme/tokens/primitives.js.map +1 -1
- package/lib/module/utils/accent-utils.js +4 -4
- package/lib/module/utils/accent-utils.js.map +1 -1
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/avatar/types.d.ts +4 -4
- package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
- package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
- package/lib/typescript/src/components/box/utils.d.ts +6 -1
- package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/button/Button.d.ts +1 -1
- package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/Chip.d.ts +24 -0
- package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts +4 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/types.d.ts +8 -0
- package/lib/typescript/src/components/chip/types.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/utils.d.ts +8 -0
- package/lib/typescript/src/components/chip/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts +45 -0
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/index.d.ts +4 -0
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -0
- package/lib/typescript/src/components/empty-state/types.d.ts +6 -0
- package/lib/typescript/src/components/empty-state/types.d.ts.map +1 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts +27 -0
- package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
- package/lib/typescript/src/components/header/index.d.ts +1 -1
- package/lib/typescript/src/components/header/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts +7 -0
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +18 -7
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/components/image/Image.d.ts +16 -0
- package/lib/typescript/src/components/image/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/image/index.d.ts +3 -0
- package/lib/typescript/src/components/image/index.d.ts.map +1 -0
- package/lib/typescript/src/components/image/types.d.ts +7 -0
- package/lib/typescript/src/components/image/types.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +4 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/Portal.d.ts +26 -0
- package/lib/typescript/src/components/portal/Portal.d.ts.map +1 -0
- package/lib/typescript/src/components/portal/PortalContext.d.ts +11 -14
- package/lib/typescript/src/components/portal/PortalContext.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/PortalHost.d.ts +9 -4
- package/lib/typescript/src/components/portal/PortalHost.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/PortalProvider.d.ts +3 -3
- package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/portal/index.d.ts +4 -2
- package/lib/typescript/src/components/portal/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/Screen.d.ts +18 -13
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +12 -9
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlashList.d.ts +43 -0
- package/lib/typescript/src/components/screen/ScreenFlashList.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +17 -7
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +51 -16
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/index.d.ts +3 -0
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +30 -0
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +22 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/types.d.ts +42 -0
- package/lib/typescript/src/components/screen/types.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/utils.d.ts +9 -9
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/Surface.d.ts +7 -0
- package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts +115 -0
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -0
- package/lib/typescript/src/components/toolbar/index.d.ts +3 -0
- package/lib/typescript/src/components/toolbar/index.d.ts.map +1 -0
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/{components/icon/utils.d.ts → theme/defaults/icons.d.ts} +2 -2
- package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -0
- package/lib/typescript/src/theme/defaults/image.d.ts +4 -0
- package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +1 -1
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/{configure.d.ts → registry.d.ts} +1 -1
- package/lib/typescript/src/theme/registry.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +21 -1
- package/lib/typescript/src/theme/theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/dark.d.ts +41 -64
- package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/light.d.ts +44 -65
- package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/primitives.d.ts +228 -17
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +65 -35
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/package.json +23 -9
- package/skills/terra-ui/SKILL.md +193 -0
- package/skills/terra-ui/references/recipes.md +198 -0
- package/skills/terra-ui/references/troubleshooting.md +112 -0
- package/src/components/avatar/Avatar.tsx +128 -38
- package/src/components/avatar/types.ts +5 -5
- package/src/components/box/Box.tsx +13 -1
- package/src/components/box/utils.ts +10 -0
- package/src/components/button/Button.tsx +7 -15
- package/src/components/chip/Chip.tsx +444 -0
- package/src/components/chip/index.ts +3 -0
- package/src/components/chip/types.ts +15 -0
- package/src/components/chip/utils.ts +34 -0
- package/src/components/empty-state/EmptyState.tsx +209 -0
- package/src/components/empty-state/index.ts +3 -0
- package/src/components/empty-state/types.ts +5 -0
- package/src/components/header/header-buttons.tsx +33 -45
- package/src/components/header/index.ts +2 -0
- package/src/components/header/parts/HeaderGradientOverlay.tsx +29 -0
- package/src/components/header/variants/LargeTitleHeader/index.tsx +68 -102
- package/src/components/header/variants/TitleHeader/index.tsx +47 -56
- package/src/components/icon/Icon.tsx +20 -15
- package/src/components/image/Image.tsx +48 -0
- package/src/components/image/index.ts +2 -0
- package/src/components/image/types.ts +7 -0
- package/src/components/index.ts +4 -0
- package/src/components/portal/Portal.tsx +55 -0
- package/src/components/portal/PortalContext.tsx +14 -22
- package/src/components/portal/PortalHost.tsx +17 -10
- package/src/components/portal/PortalProvider.tsx +58 -21
- package/src/components/portal/index.ts +4 -2
- package/src/components/screen/Screen.tsx +45 -59
- package/src/components/screen/ScreenContext.tsx +19 -12
- package/src/components/screen/ScreenFlashList.tsx +196 -0
- package/src/components/screen/ScreenFlatList.tsx +100 -39
- package/src/components/screen/ScreenScrollView.tsx +114 -53
- package/src/components/screen/index.ts +3 -0
- package/src/components/screen/parts/BottomSafeArea.tsx +60 -0
- package/src/components/screen/parts/ScreenPlaceholder.tsx +55 -0
- package/src/components/screen/types.ts +43 -0
- package/src/components/screen/utils.ts +29 -15
- package/src/components/surface/Surface.tsx +17 -20
- package/src/components/text/Text.tsx +23 -5
- package/src/components/toast/Toast.tsx +8 -8
- package/src/components/toolbar/Toolbar.tsx +353 -0
- package/src/components/toolbar/index.ts +6 -0
- package/src/context/ThemeProvider.tsx +5 -4
- package/src/{components/icon/utils.tsx → theme/defaults/icons.tsx} +1 -1
- package/src/theme/defaults/image.tsx +34 -0
- package/src/theme/index.ts +1 -1
- package/src/theme/{configure.ts → registry.ts} +19 -34
- package/src/theme/runtime.ts +1 -1
- package/src/theme/theme.ts +127 -13
- package/src/theme/tokens/dark.ts +60 -69
- package/src/theme/tokens/light.ts +50 -68
- package/src/theme/tokens/primitives.ts +248 -20
- package/src/theme/types.ts +67 -35
- package/src/utils/accent-utils.ts +4 -4
- package/lib/module/components/icon/utils.js.map +0 -1
- package/lib/module/theme/configure.js.map +0 -1
- package/lib/typescript/src/components/icon/utils.d.ts.map +0 -1
- package/lib/typescript/src/theme/configure.d.ts.map +0 -1
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ScrollViewProps } from 'react-native';
|
|
3
3
|
import { type ScrollHandlerProcessed } from 'react-native-reanimated';
|
|
4
|
-
|
|
4
|
+
import type { ScreenScrollableProps } from './types.js';
|
|
5
|
+
export interface ScreenScrollViewProps extends Omit<ScrollViewProps, 'horizontal'>, ScreenScrollableProps {
|
|
5
6
|
children?: ReactNode;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Extra bottom padding on the scroll content — clearance for a tab bar or
|
|
13
|
-
* home indicator. Defaults to the `layout.screen.margin.y` token when margins
|
|
14
|
-
* are enabled, otherwise `0`.
|
|
15
|
-
*/
|
|
16
|
-
bottomInset?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Optional Reanimated scroll handler composed with the screen's own scroll
|
|
19
|
-
* tracking and any JS `onScroll` callback.
|
|
8
|
+
* Reanimated scroll handler for custom scroll-driven animation, composed
|
|
9
|
+
* alongside the screen's own scroll tracking and any JS `onScroll`
|
|
10
|
+
* callback. Runs on the UI thread — for simple JS-side callbacks, use
|
|
11
|
+
* `onScroll` instead; it doesn't require writing a worklet.
|
|
20
12
|
*/
|
|
21
13
|
scrollHandler?: ScrollHandlerProcessed<Record<string, unknown>>;
|
|
22
14
|
}
|
|
@@ -25,12 +17,55 @@ export interface ScreenScrollViewProps extends ScrollViewProps {
|
|
|
25
17
|
* ref, mirrors offset into `scrollY`, hosts the portal target at the top (where
|
|
26
18
|
* header content is injected), and applies token-driven content padding.
|
|
27
19
|
*
|
|
20
|
+
* For simple side effects (analytics, infinite-scroll triggers), pass a plain
|
|
21
|
+
* `onScroll` callback. For scroll-driven animation, pass your own
|
|
22
|
+
* `useAnimatedScrollHandler` via `scrollHandler` instead — it runs on the UI
|
|
23
|
+
* thread alongside the screen's own handler, with no JS-thread round trip.
|
|
24
|
+
*
|
|
28
25
|
* @example
|
|
29
26
|
* ```tsx
|
|
30
27
|
* <Screen.ScrollView>
|
|
31
28
|
* <Text>Scrollable content</Text>
|
|
32
29
|
* </Screen.ScrollView>
|
|
33
30
|
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Loading placeholder instead of a per-screen spinner branch
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const { data, loading } = useQuery();
|
|
35
|
+
*
|
|
36
|
+
* <Screen.ScrollView loading={loading}>
|
|
37
|
+
* <Text>{data?.title}</Text>
|
|
38
|
+
* </Screen.ScrollView>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Empty placeholder when there is nothing to render
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Screen.ScrollView EmptyComponent={<EmptyState icon="status.info" title="Nothing yet" fill />}>
|
|
44
|
+
* {items.map((item) => <Row key={item.id} item={item} />)}
|
|
45
|
+
* </Screen.ScrollView>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Simple JS-side scroll callback
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Screen.ScrollView onScroll={(e) => console.log(e.nativeEvent.contentOffset.y)}>
|
|
51
|
+
* <Text>Scrollable content</Text>
|
|
52
|
+
* </Screen.ScrollView>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Custom scroll-driven animation
|
|
56
|
+
* ```tsx
|
|
57
|
+
* const headerOpacity = useSharedValue(1);
|
|
58
|
+
* const scrollHandler = useAnimatedScrollHandler({
|
|
59
|
+
* onScroll: (event) => {
|
|
60
|
+
* headerOpacity.value = interpolate(event.contentOffset.y, [0, 100], [1, 0]);
|
|
61
|
+
* // Need a JS-side side effect too? Call scheduleOnRN(fn, ...args) here.
|
|
62
|
+
* },
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* <Screen.ScrollView scrollHandler={scrollHandler}>
|
|
66
|
+
* <Text>Scrollable content</Text>
|
|
67
|
+
* </Screen.ScrollView>
|
|
68
|
+
* ```
|
|
34
69
|
*/
|
|
35
|
-
export declare function ScreenScrollView({ children, style, contentContainerStyle,
|
|
70
|
+
export declare function ScreenScrollView({ children, style, contentContainerStyle, scrollHandler: externalScrollHandler, onScroll: onScrollProp, horizontal, loading, LoadingComponent, EmptyComponent, margins, ...rest }: ScreenScrollViewProps): import("react").JSX.Element;
|
|
36
71
|
//# sourceMappingURL=ScreenScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ScreenScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAiB,EACf,KAAK,sBAAsB,EAG5B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAGpE,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EACzC,qBAAqB;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,aAAa,EAAE,qBAAqB,EACpC,QAAQ,EAAE,YAAY,EACtB,UAAkB,EAClB,OAAe,EACf,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,GAAG,IAAI,EACR,EAAE,qBAAqB,+BAoEvB"}
|
|
@@ -2,8 +2,11 @@ export type { ScreenHeaderProps, ScreenProps } from './Screen.js';
|
|
|
2
2
|
export { Screen } from './Screen.js';
|
|
3
3
|
export type { ScreenContextValue } from './ScreenContext.js';
|
|
4
4
|
export { useScreen } from './ScreenContext.js';
|
|
5
|
+
export type { ScreenFlashListProps } from './ScreenFlashList.js';
|
|
6
|
+
export { ScreenFlashList } from './ScreenFlashList.js';
|
|
5
7
|
export type { ScreenFlatListProps } from './ScreenFlatList.js';
|
|
6
8
|
export { ScreenFlatList } from './ScreenFlatList.js';
|
|
7
9
|
export type { ScreenScrollViewProps } from './ScreenScrollView.js';
|
|
8
10
|
export { ScreenScrollView } from './ScreenScrollView.js';
|
|
11
|
+
export type { ScreenMargins, ScreenScrollableProps } from './types.js';
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAiB,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAiB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAS,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bottom clearance that measures itself.
|
|
3
|
+
*
|
|
4
|
+
* The insets Unistyles reports are the window's, which cover the system bars and
|
|
5
|
+
* nothing else — 24dp for the gesture bar on a Pixel — while a native tab bar
|
|
6
|
+
* sits on top of them for another 80dp and overlaps the content beneath it.
|
|
7
|
+
* `react-native-screens` tracks that second one separately, as an *interface*
|
|
8
|
+
* inset, and reports it to its own `SafeAreaView`; asking a view is the only way
|
|
9
|
+
* to learn it. Neither `runtime.insets.bottom` nor `useSafeAreaInsets()` knows
|
|
10
|
+
* about it — both read 24 on a tab screen — and a constant would be wrong the
|
|
11
|
+
* moment the bar is absent, which is every pushed screen.
|
|
12
|
+
*
|
|
13
|
+
* `insetType="all"` covers system and interface both, so this view owns the
|
|
14
|
+
* whole bottom edge — which is why the scroll containers pad only their margin;
|
|
15
|
+
* adding the window inset there too would double-count the gesture bar.
|
|
16
|
+
* `"interface"` alone would be wrong: it measures the same on a tab screen (the
|
|
17
|
+
* bar's inset already spans the gesture bar beneath it) but reports nothing on a
|
|
18
|
+
* pushed screen, which would then lose its gesture-bar clearance.
|
|
19
|
+
*
|
|
20
|
+
* `insetType` is Android-only; on iOS the bottom safe area of a view inside a
|
|
21
|
+
* tab controller already includes the bar. Measured on a tab screen: 132dp on a
|
|
22
|
+
* Pixel, 95pt on an iPhone 17 — against the 24dp / 34pt the window insets
|
|
23
|
+
* report, which is the gap this closes.
|
|
24
|
+
*
|
|
25
|
+
* `flex: 0` cancels the `flex: 1` that `SafeAreaView` sets on itself, which
|
|
26
|
+
* would otherwise stretch it into the leftover space of a list shorter than the
|
|
27
|
+
* viewport. With no children, its height is exactly the padding it applies.
|
|
28
|
+
*/
|
|
29
|
+
export declare function BottomSafeArea(): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=BottomSafeArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSafeArea.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/BottomSafeArea.tsx"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,gCAE7B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { ScreenScrollableProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Centres a loading/empty placeholder in whatever space the content leaves.
|
|
5
|
+
* Grows so the placeholder sits in the middle of the content area rather than
|
|
6
|
+
* hugging the top, which needs the content container to grow as well.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ScreenPlaceholder({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
interface PlaceholderInput extends Pick<ScreenScrollableProps, 'loading' | 'LoadingComponent' | 'EmptyComponent'> {
|
|
12
|
+
/** Whether the container has nothing to render (empty `data`, no children). */
|
|
13
|
+
isEmpty: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The placeholder a scroll container should show instead of its content, or
|
|
17
|
+
* `null` to render the content. Loading wins over empty: while data is in
|
|
18
|
+
* flight there is nothing to be empty about yet.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderScreenPlaceholder({ loading, LoadingComponent, EmptyComponent, isEmpty, }: PlaceholderInput): ReactElement | null;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ScreenPlaceholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenPlaceholder.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEtE;AAED,UAAU,gBACR,SAAQ,IAAI,CACV,qBAAqB,EACrB,SAAS,GAAG,kBAAkB,GAAG,gBAAgB,CAClD;IACD,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,OAAO,GACR,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAUxC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Which axes of the `layout.screen.margin` token a scroll container pads its
|
|
4
|
+
* content with.
|
|
5
|
+
*
|
|
6
|
+
* `'y'` pads the top and bottom of the content area. It stacks on top of the
|
|
7
|
+
* structural insets — the header height and the safe area — which apply
|
|
8
|
+
* whether or not margins are on.
|
|
9
|
+
*/
|
|
10
|
+
export type ScreenMargins = 'all' | 'x' | 'y' | 'none';
|
|
11
|
+
/**
|
|
12
|
+
* Props shared by `Screen.ScrollView`, `Screen.FlatList` and
|
|
13
|
+
* `Screen.FlashList`, so a screen can swap one container for another without
|
|
14
|
+
* relearning its API.
|
|
15
|
+
*/
|
|
16
|
+
export interface ScreenScrollableProps {
|
|
17
|
+
/** Lay content out along the x axis. Defaults to `false`. */
|
|
18
|
+
horizontal?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Renders a centred placeholder in the content area instead of the content —
|
|
21
|
+
* spares every screen from hand-rolling a loading branch while its data
|
|
22
|
+
* arrives. The `Screen.Header` still renders, so the chrome stays put.
|
|
23
|
+
*/
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Node shown while `loading`. Defaults to a `Spinner`; it is centred in the
|
|
27
|
+
* content area either way.
|
|
28
|
+
*/
|
|
29
|
+
LoadingComponent?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Node shown, centred, when there is nothing to render and `loading` is
|
|
32
|
+
* false — an empty `data` array on the list containers, no children on
|
|
33
|
+
* `Screen.ScrollView`. Omit it to render nothing.
|
|
34
|
+
*/
|
|
35
|
+
EmptyComponent?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Which axes get `layout.screen.margin` padding. Defaults to the enclosing
|
|
38
|
+
* `Screen`'s `margins`.
|
|
39
|
+
*/
|
|
40
|
+
margins?: ScreenMargins;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type ComponentType, type ReactElement } from 'react';
|
|
2
|
+
import type { ScreenMargins } from './types.js';
|
|
3
|
+
export type ListHeaderComponent = ComponentType | ReactElement | null | undefined;
|
|
4
|
+
/** Renders a `ListHeaderComponent`-shaped prop (element, component, or nullish) into an element. */
|
|
5
|
+
export declare function renderListHeader(ListHeaderComponent: ListHeaderComponent): ReactElement | null;
|
|
6
|
+
/** Whether `margins` pads the horizontal axis. */
|
|
7
|
+
export declare const hasXMargin: (margins: ScreenMargins) => boolean;
|
|
8
|
+
/** Whether `margins` pads the vertical axis (the bottom of the content area). */
|
|
9
|
+
export declare const hasYMargin: (margins: ScreenMargins) => boolean;
|
|
10
10
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAC3B,aAAa,GACb,YAAY,GACZ,IAAI,GACJ,SAAS,CAAC;AAEd,oGAAoG;AACpG,wBAAgB,gBAAgB,CAC9B,mBAAmB,EAAE,mBAAmB,GACvC,YAAY,GAAG,IAAI,CAIrB;AAED,kDAAkD;AAClD,eAAO,MAAM,UAAU,GAAI,SAAS,aAAa,KAAG,OACd,CAAC;AAEvC,iFAAiF;AACjF,eAAO,MAAM,UAAU,GAAI,SAAS,aAAa,KAAG,OACd,CAAC"}
|
|
@@ -20,6 +20,13 @@ export interface SurfaceProps extends Omit<BoxProps, 'bg'> {
|
|
|
20
20
|
* default (overridable via `radius`), and an optional drop shadow via
|
|
21
21
|
* `elevation`. All other Box style-props are accepted.
|
|
22
22
|
*
|
|
23
|
+
* Every visual decision is expressed as a **theme token key** handed to `Box`,
|
|
24
|
+
* which resolves it against the active theme. Surface therefore never reads the
|
|
25
|
+
* theme itself — no `useUnistyles()` in the render path, and no stylesheet
|
|
26
|
+
* crossing a component boundary (a Unistyles style handed to `Box` would land
|
|
27
|
+
* on a plain `View` the Babel plugin has not processed, and so would freeze at
|
|
28
|
+
* whichever theme was active when it was created).
|
|
29
|
+
*
|
|
23
30
|
* @example
|
|
24
31
|
* ```tsx
|
|
25
32
|
* <Surface variant="raised" elevation="md" p="4" radius="lg">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/Surface.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/Surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAA8B,KAAK,QAAQ,EAAE,MAAM,iBAAQ,CAAC;AAEnE,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxD,sDAAsD;IACtD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAmCD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,0LAmBnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAE9B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EAGf,WAAW,EACZ,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAiBhE,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,+CAA+C;IAC/C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,IAAI,WAAW,EAE9B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EAGf,WAAW,EACZ,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAiBhE,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,+CAA+C;IAC/C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uLAkEhB,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type PressableProps, type ViewProps } from 'react-native';
|
|
3
|
+
import type { ColorToken, SpacingKey, TerraIconName } from '../../theme/types';
|
|
4
|
+
interface ToolbarButtonBaseProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
5
|
+
/** Icon to render, before the label when both are given. */
|
|
6
|
+
icon?: TerraIconName;
|
|
7
|
+
/** Icon size in density-independent pixels. Defaults to `20`. */
|
|
8
|
+
iconSize?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Foreground token for the icon and label. Defaults to the group's `tint`,
|
|
11
|
+
* or `text.default` outside a group.
|
|
12
|
+
*/
|
|
13
|
+
tint?: ColorToken;
|
|
14
|
+
/**
|
|
15
|
+
* Fill. Defaults to `surface.default` standalone, and to `transparent`
|
|
16
|
+
* inside a {@link ToolbarGroup}, which paints the shared capsule instead.
|
|
17
|
+
* Set it explicitly to opt back out of the group's fill.
|
|
18
|
+
*/
|
|
19
|
+
background?: ColorToken;
|
|
20
|
+
/**
|
|
21
|
+
* Label content. A `string` or `number` renders as themed text in the
|
|
22
|
+
* button's `tint`; anything else renders as given. The cell grows
|
|
23
|
+
* horizontally to fit, so a text item is a pill rather than a circle.
|
|
24
|
+
*/
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Merged over the base style, so a single item can be repositioned (e.g.
|
|
28
|
+
* pinned over a hero image) without a wrapper view. Supports `Pressable`'s
|
|
29
|
+
* function form for press-state styling.
|
|
30
|
+
*/
|
|
31
|
+
style?: PressableProps['style'];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* An icon-only button has no visible text, so it must carry an
|
|
35
|
+
* `accessibilityLabel`; one with children may rely on them instead.
|
|
36
|
+
*/
|
|
37
|
+
export type ToolbarButtonProps = ToolbarButtonBaseProps & ({
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
accessibilityLabel?: string;
|
|
40
|
+
} | {
|
|
41
|
+
icon: TerraIconName;
|
|
42
|
+
accessibilityLabel: string;
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* An action inside a toolbar — a circular icon button, a text pill, or both.
|
|
46
|
+
* Paints its own capsule standalone, and goes transparent inside a
|
|
47
|
+
* {@link ToolbarGroup} so the group's shared capsule shows through.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <Toolbar.Button icon="share" accessibilityLabel="Share" onPress={share} />
|
|
52
|
+
* <Toolbar.Button onPress={save}>Save</Toolbar.Button>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function ToolbarButton({ icon, iconSize, tint, background, children, accessibilityLabel, onPress, hitSlop, style, ...rest }: ToolbarButtonProps): import("react").JSX.Element;
|
|
56
|
+
export interface ToolbarGroupProps extends ViewProps {
|
|
57
|
+
/** Capsule fill. Defaults to `surface.default`. */
|
|
58
|
+
background?: ColorToken;
|
|
59
|
+
/**
|
|
60
|
+
* Foreground token inherited by every item's icon and label. Defaults to
|
|
61
|
+
* `text.default`; a per-item `tint` still wins.
|
|
62
|
+
*/
|
|
63
|
+
tint?: ColorToken;
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Wraps several {@link ToolbarButton}s in one shared capsule — the iOS
|
|
68
|
+
* `ToolbarItemGroup` look. Children drop their individual circular fill and
|
|
69
|
+
* inherit the group's, so the row reads as a single segmented pill.
|
|
70
|
+
*
|
|
71
|
+
* No height of its own: the capsule takes the height of its tallest child, and
|
|
72
|
+
* its full radius clamps to half of that for an exact stadium.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Toolbar.Group>
|
|
77
|
+
* <Toolbar.Button icon="add" accessibilityLabel="Add" onPress={add} />
|
|
78
|
+
* <Toolbar.Button icon="download" accessibilityLabel="Save" onPress={save} />
|
|
79
|
+
* </Toolbar.Group>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare const ToolbarGroup: import("react").ForwardRefExoticComponent<ToolbarGroupProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
83
|
+
export interface ToolbarProps extends ViewProps {
|
|
84
|
+
/**
|
|
85
|
+
* Space between groups and standalone items. Defaults to `'2'` (8dp) — the
|
|
86
|
+
* separator between a capsule and an adjacent standalone item.
|
|
87
|
+
*/
|
|
88
|
+
gap?: SpacingKey;
|
|
89
|
+
children?: ReactNode;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A row of {@link ToolbarGroup}s and standalone {@link ToolbarButton}s. The
|
|
93
|
+
* header's `LeftToolbar` / `RightToolbar` slots supply one automatically, so
|
|
94
|
+
* you only need to render it yourself when placing a toolbar elsewhere — over
|
|
95
|
+
* a hero image, or floating above content.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <Toolbar style={{ position: 'absolute', right: 16, bottom: 24 }}>
|
|
100
|
+
* <Toolbar.Group>
|
|
101
|
+
* <Toolbar.Button icon="add" accessibilityLabel="Add" onPress={add} />
|
|
102
|
+
* <Toolbar.Button icon="download" accessibilityLabel="Save" onPress={save} />
|
|
103
|
+
* </Toolbar.Group>
|
|
104
|
+
* <Toolbar.Button icon="share" accessibilityLabel="Share" onPress={share} />
|
|
105
|
+
* </Toolbar>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
declare const ToolbarRoot: import("react").ForwardRefExoticComponent<ToolbarProps & import("react").RefAttributes<import("react-native/types_generated/src/private/webapis/dom/nodes/ReactNativeElement").default>>;
|
|
109
|
+
type ToolbarComponent = typeof ToolbarRoot & {
|
|
110
|
+
Group: typeof ToolbarGroup;
|
|
111
|
+
Button: typeof ToolbarButton;
|
|
112
|
+
};
|
|
113
|
+
export declare const Toolbar: ToolbarComponent;
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA4C1E,UAAU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G;AACH,QAAA,MAAM,WAAW,0LAQhB,CAAC;AAEF,KAAK,gBAAgB,GAAG,OAAO,WAAW,GAAG;IAC3C,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,MAAM,EAAE,OAAO,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAkB,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/toolbar/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAgB,CAAC;AAezD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,gCAoB9D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,kCAAkC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,qCAAqC;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAezC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TerraIconComponent, TerraSemanticIconName } from '
|
|
1
|
+
import type { TerraIconComponent, TerraSemanticIconName } from '../types.js';
|
|
2
2
|
export declare const PersonIcon: TerraIconComponent;
|
|
3
3
|
export declare const defaultIcons: Record<TerraSemanticIconName, TerraIconComponent>;
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/theme/defaults/icons.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAElB,qBAAqB,EACtB,MAAM,aAAU,CAAC;AAsHlB,eAAO,MAAM,UAAU,EAAE,kBAWxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAS1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../src/theme/defaults/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAwB,MAAM,aAAU,CAAC;AAW1E,sEAAsE;AACtE,eAAO,MAAM,YAAY,EAAE,mBAkBvB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export type { DeepPartial } from '../utils/deep-merge';
|
|
|
4
4
|
export { deepMerge } from '../utils/deep-merge';
|
|
5
5
|
export { resolveThemeColor } from '../utils/resolve-theme-color';
|
|
6
6
|
export { FONT_WEIGHT_VALUE, SYSTEM_FONT } from '../utils/typography';
|
|
7
|
-
export { configureTerraUI, getAccentNames, getDefaultRadius, getIcon, getImageComponent, getIsConfigured, getRequiredIcon, getSurfaceElevation, resolveTheme, } from './
|
|
7
|
+
export { configureTerraUI, getAccentNames, getDefaultRadius, getIcon, getImageComponent, getIsConfigured, getRequiredIcon, getSurfaceElevation, resolveTheme, } from './registry.js';
|
|
8
8
|
export { applyAccent, applyScheme, getCurrentAccent } from './runtime.js';
|
|
9
9
|
export { defaultDarkTheme, defaultLightTheme } from './theme.js';
|
|
10
10
|
export type { Accent, AccentOverride, AccentShorthand, ActionColorToken, BackgroundColorToken, BorderColorToken, ButtonDefaults, ColorToken, ComponentDefaults, ContentColorToken, DefaultRadiusToken, ElevationKey, ElevationScale, ElevationStyle, FontWeightToken, LayoutTokens, OpacityTokens, RadiusComponent, RadiusKey, Scheme, SpacingKey, StatusColorToken, SurfaceColorToken, SurfaceDefaults, TerraConfig, TerraIconComponent, TerraIconName, TerraIconProps, TerraImageComponent, TerraImageContentFit, TerraImageProps, TerraSemanticIconName, TerraTheme, TerraThemeOverride, TextColorToken, TextVariant, ThemeColor, ThemeRadiusOverride, TypeStyle, Typography, } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[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,MAAM,mBAAmB,QAAO,YACZ,CAAC;AAE5B,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAI5E;AA8BD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,WAAgB,GAAG,IAAI,CAiD/D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RadiusKey, TerraTheme } from './types.js';
|
|
1
|
+
import type { RadiusKey, SpacingKey, TerraTheme } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Default base corner radius (dp) — the `lg` (×1) step — taken from the
|
|
4
4
|
* `radius.base` primitive. The rest of the scale is derived from it via
|
|
@@ -7,6 +7,26 @@ import type { RadiusKey, TerraTheme } from './types.js';
|
|
|
7
7
|
* `radius.base` token.
|
|
8
8
|
*/
|
|
9
9
|
export declare const DEFAULT_RADIUS_BASE: number;
|
|
10
|
+
/**
|
|
11
|
+
* Every {@link SpacingKey} — its own numeric value IS the multiplier applied
|
|
12
|
+
* to the base unit (e.g. `'5'` → `5 × base`), so no separate multiplier table
|
|
13
|
+
* is needed the way {@link RADIUS_MULTIPLIERS} is for radius.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SPACING_KEYS: SpacingKey[];
|
|
16
|
+
/**
|
|
17
|
+
* Default spacing base unit (dp) — taken from the `spacing.base` primitive.
|
|
18
|
+
* The rest of the scale is derived from it (each step's value is its key
|
|
19
|
+
* multiplied by this base); override at runtime with
|
|
20
|
+
* `configureTerraUI({ shared: { spacing: { base } } })`, or change the
|
|
21
|
+
* `spacing.base` token.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_SPACING_BASE: number;
|
|
24
|
+
/**
|
|
25
|
+
* Builds the full spacing scale from a single base value. Each step's value is
|
|
26
|
+
* its key multiplied by `base` — no outliers needed, since `'0'` naturally
|
|
27
|
+
* resolves to `0` for any base.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildSpacingScale(base?: number): Record<SpacingKey, number>;
|
|
10
30
|
/**
|
|
11
31
|
* Per-token multipliers applied to the base radius (DaisyUI-style). `none` (0)
|
|
12
32
|
* and `full` (9999) are fixed and not scaled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/theme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/theme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAMV,SAAS,EACT,UAAU,EACV,UAAU,EAGX,MAAM,YAAS,CAAC;AAoGjB;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,UAAU,EAkBpC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAoB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,GAAE,MAA6B,GAClC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAM5B;AAID;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,EACnC,MAAM,CASP,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,GAAE,MAA4B,GACjC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAQ3B;AAwCD,eAAO,MAAM,iBAAiB,EAAE,UAQ/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,UAQ9B,CAAC"}
|