panelui-native 0.102.2 → 0.103.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/lib/module/components/bottom-sheet/index.js +116 -49
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/panelside/index.js +8 -28
- package/lib/module/components/panelside/index.js.map +1 -1
- package/lib/module/components/selection-mode/index.js.map +1 -1
- package/lib/module/components/sketch/index.js +1086 -0
- package/lib/module/components/sketch/index.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/index.js.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +13 -3
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
- package/lib/typescript/src/components/selection-mode/index.d.ts +2 -4
- package/lib/typescript/src/components/selection-mode/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sketch/index.d.ts +100 -0
- package/lib/typescript/src/components/sketch/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +8 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/bottom-sheet/index.tsx +94 -17
- package/src/components/panelside/index.tsx +8 -38
- package/src/components/selection-mode/index.tsx +2 -4
- package/src/components/sketch/index.tsx +1290 -0
- package/src/index.ts +11 -0
- package/src/native/index.ts +8 -0
|
@@ -119,6 +119,14 @@ interface SwiftUIModifiers {
|
|
|
119
119
|
* changing any code on a report of "the colour did nothing".
|
|
120
120
|
*/
|
|
121
121
|
presentationBackground: (color: string) => unknown;
|
|
122
|
+
/**
|
|
123
|
+
* Stops a sheet being dragged or swiped away. Its controls can still close
|
|
124
|
+
* it. Optional for the same reason as `disabled` below: call it through a
|
|
125
|
+
* guard.
|
|
126
|
+
*/
|
|
127
|
+
interactiveDismissDisabled?: (isDisabled?: boolean) => unknown;
|
|
128
|
+
/** Shows or hides the grabber at the top of a sheet. Optional; guard it. */
|
|
129
|
+
presentationDragIndicator?: (visibility: 'automatic' | 'visible' | 'hidden') => unknown;
|
|
122
130
|
/**
|
|
123
131
|
* Greys a control out and stops it answering.
|
|
124
132
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/native/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAe,CAAC;AAEjE,UAAU,cAAc;IACtB,IAAI,EAAE,aAAa,CAAC;QAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB;;;;;;;;;;;;;;;;;;;WAmBG;QACH,aAAa,CAAC,EAAE,OAAO,GAAG;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC;QACvE;;;;;;;;;;;;;;;WAeG;QACH,cAAc,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;QAClD;;;;;;WAMG;QACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC,CAAC;IACH;;;;OAIG;IACH,UAAU,EAAE,aAAa,CAAC;QACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC,CAAC;IACH;;;;;OAKG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,aAAa,C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aAAa,CAAC;QAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;KAC/B,CAAC,GAAG;QACH,OAAO,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;QACjD,KAAK,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;KAChD,CAAC;IACF,gBAAgB,EAAE,aAAa,CAAC;QAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,aAAa,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACpE,CAAC,GAAG;QACH,IAAI,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;QAC9C,WAAW,EAAE,aAAa,CAAC;YAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;KACtD,CAAC;CACH;AAKD,wBAAgB,cAAc,IAAI,qBAAqB,GAAG,IAAI,CAkB7D;AAKD,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAc7D;AAED;;;;;;;GAOG;AACH,UAAU,gBAAgB;IACxB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAKD,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAc7D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "panelui-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"description": "High-performance React Native UI components for Expo. Semantic design tokens, powered by Uniwind (Tailwind v4) and Reanimated.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
type ReactNode,
|
|
16
16
|
} from 'react';
|
|
17
17
|
import {
|
|
18
|
+
Platform,
|
|
18
19
|
Pressable,
|
|
19
20
|
StyleSheet,
|
|
20
21
|
useWindowDimensions,
|
|
@@ -100,8 +101,9 @@ const sheetVariants = tv({
|
|
|
100
101
|
// rule through the middle of nothing.
|
|
101
102
|
false: 'rounded-t-3xl border-b-0',
|
|
102
103
|
// Floating: all four edges are real, so all four are drawn and all four
|
|
103
|
-
// corners are rounded.
|
|
104
|
-
|
|
104
|
+
// corners are rounded. The bottom gap depends on the safe area, so it is
|
|
105
|
+
// set in the style rather than here — see `detachedGap`.
|
|
106
|
+
true: 'mx-4 rounded-3xl',
|
|
105
107
|
},
|
|
106
108
|
},
|
|
107
109
|
defaultVariants: {
|
|
@@ -242,6 +244,31 @@ function nativeSheetSurface(color: string): unknown[] | undefined {
|
|
|
242
244
|
return undefined;
|
|
243
245
|
}
|
|
244
246
|
|
|
247
|
+
/**
|
|
248
|
+
* The modifiers that hold a native sheet still and hide its grabber, where the
|
|
249
|
+
* platform has them. iOS only: Compose's sheet is not asked, and keeps its own
|
|
250
|
+
* drag and handle.
|
|
251
|
+
*
|
|
252
|
+
* A sheet whose content takes drags — a canvas, a map — needs both. Left to
|
|
253
|
+
* the platform, a downward stroke on the content moves the sheet instead.
|
|
254
|
+
*/
|
|
255
|
+
function nativeSheetBehaviour(
|
|
256
|
+
dismissible: boolean,
|
|
257
|
+
showGrabber: boolean
|
|
258
|
+
): unknown[] {
|
|
259
|
+
const swiftUI = getSwiftUIModifiers();
|
|
260
|
+
if (!swiftUI) return [];
|
|
261
|
+
|
|
262
|
+
const modifiers: unknown[] = [];
|
|
263
|
+
if (!dismissible && swiftUI.interactiveDismissDisabled) {
|
|
264
|
+
modifiers.push(swiftUI.interactiveDismissDisabled(true));
|
|
265
|
+
}
|
|
266
|
+
if (!showGrabber && swiftUI.presentationDragIndicator) {
|
|
267
|
+
modifiers.push(swiftUI.presentationDragIndicator('hidden'));
|
|
268
|
+
}
|
|
269
|
+
return modifiers;
|
|
270
|
+
}
|
|
271
|
+
|
|
245
272
|
/**
|
|
246
273
|
* Set by the root so Content knows the platform is drawing the sheet, and with
|
|
247
274
|
* which detents. Null means the styled sheet renders.
|
|
@@ -270,6 +297,18 @@ const SheetSurfaceContext = createContext<{
|
|
|
270
297
|
hasScrollable: SharedValue<boolean>;
|
|
271
298
|
} | null>(null);
|
|
272
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Whether the sheet has a height of its own for `Body` to fill.
|
|
302
|
+
*
|
|
303
|
+
* Provided by both the styled and the native sheet, because the body has to be
|
|
304
|
+
* laid out differently in the two cases. A sized sheet is a definite column,
|
|
305
|
+
* and the body takes what the header and footer leave. An `auto` sheet is
|
|
306
|
+
* measured from its content — and a body that asks to fill it (`flex: 1`, a
|
|
307
|
+
* basis of zero) asks for a share of nothing, so it comes out zero points tall
|
|
308
|
+
* and everything in it disappears.
|
|
309
|
+
*/
|
|
310
|
+
const SheetSizedContext = createContext(false);
|
|
311
|
+
|
|
273
312
|
function BottomSheetRoot({
|
|
274
313
|
children,
|
|
275
314
|
open,
|
|
@@ -329,7 +368,13 @@ function BottomSheetTrigger({ children }: BottomSheetTriggerProps) {
|
|
|
329
368
|
|
|
330
369
|
export interface BottomSheetContentProps extends ViewProps {
|
|
331
370
|
className?: string;
|
|
332
|
-
/**
|
|
371
|
+
/**
|
|
372
|
+
* Whether the reader can close the sheet themselves — by tapping the
|
|
373
|
+
* backdrop, dragging it down, or pressing back on Android. Default true.
|
|
374
|
+
*
|
|
375
|
+
* Off, only your own controls close it. On the native sheet this also stops
|
|
376
|
+
* the drag on iOS, which is what a sheet whose content takes drags needs.
|
|
377
|
+
*/
|
|
333
378
|
dismissible?: boolean;
|
|
334
379
|
/**
|
|
335
380
|
* Show a close button in the top trailing corner — the right in a
|
|
@@ -345,6 +390,8 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
345
390
|
* Turn it off when the sheet draws its own — a component wrapping this one
|
|
346
391
|
* to give the surface a material of its own has to put the handle on that
|
|
347
392
|
* material, and a handle floating above it belongs to nothing.
|
|
393
|
+
*
|
|
394
|
+
* On the native sheet it hides the platform's grabber on iOS.
|
|
348
395
|
*/
|
|
349
396
|
showGrabber?: boolean;
|
|
350
397
|
/**
|
|
@@ -352,7 +399,8 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
352
399
|
* bottom, so it reads as a card laid over the app rather than a drawer
|
|
353
400
|
* pulled out of it. All four corners round and the bottom border comes back,
|
|
354
401
|
* since a floating sheet has four real edges where a docked one has three.
|
|
355
|
-
*
|
|
402
|
+
* On Android it floats above the navigation bar, so the system buttons stay
|
|
403
|
+
* uncovered. Ignored by the native sheet, which the platform positions itself.
|
|
356
404
|
*/
|
|
357
405
|
detached?: boolean;
|
|
358
406
|
/**
|
|
@@ -368,7 +416,8 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
368
416
|
* How tall the sheet opens.
|
|
369
417
|
*
|
|
370
418
|
* `auto` sizes to the content, which is right for a sheet that is a handful
|
|
371
|
-
* of rows.
|
|
419
|
+
* of rows. It stops short of the status bar, and a `Body` inside it scrolls
|
|
420
|
+
* once the content is taller than that. `half` and `full` fix the height instead, for content that has to
|
|
372
421
|
* be given the room rather than allowed to ask for it — a list, a form, a
|
|
373
422
|
* document. Either way the sheet is clamped to leave the status bar clear,
|
|
374
423
|
* so `full` is as tall as the screen allows rather than as tall as the screen.
|
|
@@ -689,18 +738,26 @@ function BottomSheetContent({
|
|
|
689
738
|
),
|
|
690
739
|
}));
|
|
691
740
|
|
|
741
|
+
/*
|
|
742
|
+
* How far a detached sheet floats above the bottom of the screen.
|
|
743
|
+
*
|
|
744
|
+
* On iOS it floats over the home indicator, which only takes a swipe. On
|
|
745
|
+
* Android the bottom inset can be the three-button navigation bar, whose
|
|
746
|
+
* buttons have to stay reachable, so the sheet sits above the inset.
|
|
747
|
+
*/
|
|
748
|
+
const detachedGap =
|
|
749
|
+
Platform.OS === 'android' ? Math.max(insets.bottom + 12, 24) : 24;
|
|
750
|
+
|
|
692
751
|
/*
|
|
693
752
|
* A sized sheet is clamped rather than handed its fraction outright.
|
|
694
753
|
* `insets.top` is the status bar and the notch, and content that runs under
|
|
695
754
|
* those is unreadable at exactly the moment the sheet is at its tallest.
|
|
696
755
|
*/
|
|
756
|
+
const sheetCap = screenHeight - insets.top - (detached ? detachedGap : 8);
|
|
697
757
|
const sizedHeight =
|
|
698
758
|
size === 'auto'
|
|
699
759
|
? undefined
|
|
700
|
-
: Math.min(
|
|
701
|
-
screenHeight * SIZE_FRACTION[size],
|
|
702
|
-
screenHeight - insets.top - (detached ? 24 : 8)
|
|
703
|
-
);
|
|
760
|
+
: Math.min(screenHeight * SIZE_FRACTION[size], sheetCap);
|
|
704
761
|
|
|
705
762
|
const surface = useMemo(
|
|
706
763
|
() => ({ scrollGesture, scrollOffset, hasScrollable }),
|
|
@@ -731,7 +788,10 @@ function BottomSheetContent({
|
|
|
731
788
|
: typeof requested === 'string'
|
|
732
789
|
? requested
|
|
733
790
|
: undefined;
|
|
734
|
-
const
|
|
791
|
+
const painted = surface ? nativeSheetSurface(surface) ?? [] : [];
|
|
792
|
+
const held = nativeSheetBehaviour(dismissible, showGrabber);
|
|
793
|
+
const modifiers =
|
|
794
|
+
painted.length || held.length ? [...painted, ...held] : undefined;
|
|
735
795
|
// The platform owns presentation, so this stays mounted and toggles
|
|
736
796
|
// isPresented rather than unmounting on close.
|
|
737
797
|
//
|
|
@@ -753,6 +813,7 @@ function BottomSheetContent({
|
|
|
753
813
|
>
|
|
754
814
|
<RNHostView matchContents>
|
|
755
815
|
<BottomSheetContext.Provider value={context}>
|
|
816
|
+
<SheetSizedContext.Provider value={snapPoints !== undefined}>
|
|
756
817
|
<View
|
|
757
818
|
{...props}
|
|
758
819
|
className={cn(
|
|
@@ -775,6 +836,7 @@ function BottomSheetContent({
|
|
|
775
836
|
>
|
|
776
837
|
{textChildren(children)}
|
|
777
838
|
</View>
|
|
839
|
+
</SheetSizedContext.Provider>
|
|
778
840
|
</BottomSheetContext.Provider>
|
|
779
841
|
</RNHostView>
|
|
780
842
|
</NativeBottomSheet>
|
|
@@ -828,15 +890,20 @@ function BottomSheetContent({
|
|
|
828
890
|
// the safe-area padding with it.
|
|
829
891
|
style={[
|
|
830
892
|
sheetStyle,
|
|
831
|
-
// A detached sheet's own bottom margin already clears the
|
|
832
|
-
//
|
|
833
|
-
//
|
|
834
|
-
|
|
835
|
-
|
|
893
|
+
// A detached sheet's own bottom margin already clears the system
|
|
894
|
+
// bar, so it takes plain padding rather than stacking the inset
|
|
895
|
+
// on top of the gap.
|
|
896
|
+
detached
|
|
897
|
+
? { marginBottom: detachedGap, paddingBottom: 16 }
|
|
898
|
+
: { paddingBottom: Math.max(insets.bottom, 16) },
|
|
899
|
+
sizedHeight === undefined
|
|
900
|
+
? { maxHeight: sheetCap }
|
|
901
|
+
: { height: sizedHeight },
|
|
836
902
|
props.style,
|
|
837
903
|
]}
|
|
838
904
|
>
|
|
839
905
|
<SheetSurfaceContext.Provider value={surface}>
|
|
906
|
+
<SheetSizedContext.Provider value={sizedHeight !== undefined}>
|
|
840
907
|
{showGrabber ? (
|
|
841
908
|
<View className="mb-3 self-center">
|
|
842
909
|
<View className="h-1 w-10 rounded-full bg-muted-foreground/30" />
|
|
@@ -869,6 +936,7 @@ function BottomSheetContent({
|
|
|
869
936
|
/>
|
|
870
937
|
</Pressable>
|
|
871
938
|
) : null}
|
|
939
|
+
</SheetSizedContext.Provider>
|
|
872
940
|
</SheetSurfaceContext.Provider>
|
|
873
941
|
</Animated.View>
|
|
874
942
|
</GestureDetector>
|
|
@@ -929,7 +997,12 @@ export interface BottomSheetBodyProps
|
|
|
929
997
|
}
|
|
930
998
|
|
|
931
999
|
/**
|
|
932
|
-
* The scrolling part of a
|
|
1000
|
+
* The scrolling part of a sheet.
|
|
1001
|
+
*
|
|
1002
|
+
* In a sheet with a `size` it fills whatever the header and footer leave. In
|
|
1003
|
+
* an `auto` sheet it is as tall as its content, and scrolls once the sheet
|
|
1004
|
+
* has grown as tall as the screen allows — or as a `maxHeight` on the content
|
|
1005
|
+
* allows.
|
|
933
1006
|
*
|
|
934
1007
|
* A plain `ScrollView` works here too, but only one of the two gestures can
|
|
935
1008
|
* win a given drag and neither knows about the other, so the list and the
|
|
@@ -943,6 +1016,7 @@ const BottomSheetBody = forwardRef<
|
|
|
943
1016
|
BottomSheetBodyProps
|
|
944
1017
|
>(function BottomSheetBody({ className, children, onScroll, ...props }, ref) {
|
|
945
1018
|
const surface = useContext(SheetSurfaceContext);
|
|
1019
|
+
const sized = useContext(SheetSizedContext);
|
|
946
1020
|
|
|
947
1021
|
useEffect(() => {
|
|
948
1022
|
if (!surface) return;
|
|
@@ -983,7 +1057,10 @@ const BottomSheetBody = forwardRef<
|
|
|
983
1057
|
ref={ref}
|
|
984
1058
|
scrollEventThrottle={16}
|
|
985
1059
|
showsVerticalScrollIndicator={false}
|
|
986
|
-
|
|
1060
|
+
// In a sized sheet the body fills what the header and footer leave. In
|
|
1061
|
+
// an `auto` one it is as tall as its content and gives way once the
|
|
1062
|
+
// sheet reaches its cap, which is what makes a long list scroll.
|
|
1063
|
+
className={cn(sized ? 'flex-1' : 'shrink grow-0', className)}
|
|
987
1064
|
{...props}
|
|
988
1065
|
onScroll={composed}
|
|
989
1066
|
>
|
|
@@ -120,23 +120,13 @@ import { tv } from 'tailwind-variants';
|
|
|
120
120
|
import { useCSSVariable } from 'uniwind';
|
|
121
121
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
122
122
|
import { HugeiconsIcon, type IconSvgElement } from '@hugeicons/react-native';
|
|
123
|
-
import Cancel01Icon from '@hugeicons/core-free-icons/Cancel01Icon';
|
|
124
123
|
import Menu01Icon from '@hugeicons/core-free-icons/Menu01Icon';
|
|
125
124
|
import MoreHorizontalIcon from '@hugeicons/core-free-icons/MoreHorizontalIcon';
|
|
126
125
|
import Search01Icon from '@hugeicons/core-free-icons/Search01Icon';
|
|
127
126
|
import { IconColorProvider, useIconColor } from '../../icons';
|
|
128
|
-
import {
|
|
129
|
-
BottomSheet,
|
|
130
|
-
bottomSheetDetentHeight,
|
|
131
|
-
type BottomSheetBodyProps,
|
|
132
|
-
type BottomSheetProps,
|
|
133
|
-
} from '../bottom-sheet';
|
|
134
127
|
import { Button } from '../button';
|
|
135
128
|
import { Menu, type MenuContentProps } from '../menu';
|
|
136
|
-
import { Tabs } from '../tabs';
|
|
137
|
-
import { getNativeUI } from '../../native';
|
|
138
129
|
import { AnimatedPressable } from '../../primitives/animated-pressable';
|
|
139
|
-
import { KeyboardAvoider } from '../../primitives/keyboard-avoider';
|
|
140
130
|
import { Text, textChildren, type TextProps } from '../../primitives/text';
|
|
141
131
|
import { useBackHandler } from '../../hooks/use-back-handler';
|
|
142
132
|
import { useDirectionSign } from '../../hooks/use-direction';
|
|
@@ -254,20 +244,6 @@ const DOCK_WIDTH_MAX = 320;
|
|
|
254
244
|
/** How far above the floating footer the list starts dissolving into it. */
|
|
255
245
|
const FOOTER_FADE = 28;
|
|
256
246
|
|
|
257
|
-
/**
|
|
258
|
-
* What `BottomSheet.Content` leaves below its last child, maxed against the
|
|
259
|
-
* home indicator. Mirrored here so the search field can subtract the strip it
|
|
260
|
-
* already sits above before it travels with the keyboard.
|
|
261
|
-
*/
|
|
262
|
-
const SHEET_BOTTOM_PADDING = 16;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* The top padding the search surface asks `BottomSheet.Content` for, and takes
|
|
266
|
-
* back off the column's height. Smaller than the sheet's own default, because
|
|
267
|
-
* this surface leads with a round button rather than with a title.
|
|
268
|
-
*/
|
|
269
|
-
const SHEET_TOP_PADDING = 12;
|
|
270
|
-
|
|
271
247
|
/** Progress past which a layer is treated as fully hidden for accessibility. */
|
|
272
248
|
const HIDDEN_EPSILON = 0.05;
|
|
273
249
|
|
|
@@ -2060,22 +2036,16 @@ function PanelsideTrigger({
|
|
|
2060
2036
|
/* ------------------------------------------------------------------ *
|
|
2061
2037
|
* Search.
|
|
2062
2038
|
*
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2065
|
-
*
|
|
2066
|
-
*
|
|
2067
|
-
* the top, which is the far end of the screen from the keyboard that has just
|
|
2068
|
-
* opened under it.
|
|
2039
|
+
* On a phone, search is a button in the header rather than a field. The panel
|
|
2040
|
+
* is most of the screen and a field is 40 points of it, so results would have
|
|
2041
|
+
* to push the history down — and the field would be at the far end of the
|
|
2042
|
+
* screen from the keyboard.
|
|
2069
2043
|
*
|
|
2070
|
-
*
|
|
2071
|
-
* a
|
|
2072
|
-
* being searched; the results fill the middle; and the field is at the bottom,
|
|
2073
|
-
* where the thumb already is, riding the keyboard rather than hiding behind
|
|
2074
|
-
* it.
|
|
2044
|
+
* The button draws the control and nothing else. What it opens — a page, a
|
|
2045
|
+
* sheet, a screen on the app's own stack — is the app's to decide.
|
|
2075
2046
|
*
|
|
2076
|
-
* `Panelside.Search
|
|
2077
|
-
*
|
|
2078
|
-
* no keyboard covering half the screen.
|
|
2047
|
+
* `Panelside.Search`, the inline field, suits a docked panel on a tablet,
|
|
2048
|
+
* where there is width for a field and no keyboard covering half the screen.
|
|
2079
2049
|
* ------------------------------------------------------------------ */
|
|
2080
2050
|
|
|
2081
2051
|
export interface PanelsideSearchTriggerProps extends Omit<PressableProps, 'children'> {
|
|
@@ -1055,10 +1055,8 @@ export interface SelectionModeSheetProps {
|
|
|
1055
1055
|
/**
|
|
1056
1056
|
* How tall the sheet opens.
|
|
1057
1057
|
*
|
|
1058
|
-
* `full` by default
|
|
1059
|
-
*
|
|
1060
|
-
* of no height draws nothing — which looks like an empty sheet rather than
|
|
1061
|
-
* like a missing style.
|
|
1058
|
+
* `full` by default. `auto` sizes the sheet to its rows, up to the height
|
|
1059
|
+
* of the screen, and suits a short list.
|
|
1062
1060
|
*
|
|
1063
1061
|
* Full rather than half because a picker spends a header and a footer before
|
|
1064
1062
|
* it draws a single row. At half a screen that leaves four or five rows for
|