@kanso-labs/react-native-kanso-ui 0.11.25 → 0.11.26

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/README.md CHANGED
@@ -113,6 +113,33 @@ draw Gesture Handler's root view around their own track, so an app need not wrap
113
113
  itself in `GestureHandlerRootView` for them, and one that already does loses
114
114
  nothing.
115
115
 
116
+ ### The keyboard
117
+
118
+ A `Sheet`, a `Dialog` and a `SearchView` keep what they hold above the software
119
+ keyboard. React Native draws edge to edge on Android, so the keyboard covers the
120
+ window rather than shrinking it, and each of them is a `Modal`, a window of its
121
+ own, whose keyboard Android reports to nothing React Native listens to. Install
122
+ [react-native-keyboard-controller](https://kirillzyusko.github.io/react-native-keyboard-controller/),
123
+ an optional peer, and mount its provider at the root of the app, for those
124
+ reports to reach the library:
125
+
126
+ ```bash
127
+ npx expo install react-native-keyboard-controller
128
+ ```
129
+
130
+ ```tsx
131
+ import { KeyboardProvider } from 'react-native-keyboard-controller'
132
+
133
+ ;<KeyboardProvider navigationBarTranslucent statusBarTranslucent>
134
+ <App />
135
+ </KeyboardProvider>
136
+ ```
137
+
138
+ Without it, iOS keeps the overlays above the keyboard all the same, and Android
139
+ does so only for a field in the app's own window. A screen of the app's own is
140
+ the app's to keep clear, with the controller's `KeyboardAwareScrollView` or
141
+ `KeyboardAvoidingView`.
142
+
116
143
  ## Routing
117
144
 
118
145
  A component with an `href` presses through the app's router once the app is
@@ -1,6 +1,7 @@
1
1
  import { ButtonSlotContext } from "../../button/slots.js";
2
2
  import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
3
3
  import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, registerOf, useModalState, useModalTrigger } from "../../modal/index.js";
4
+ import { useKeyboardInset } from "../../overlay/keyboard.js";
4
5
  import { refsOf } from "../../ref/index.js";
5
6
  import { useTheme } from "../../theme/scope.js";
6
7
  import { composeStyles, themedStyles } from "../../theme/styles.js";
@@ -334,6 +335,7 @@ function DialogContent(t0) {
334
335
  const [register] = useState(t5);
335
336
  const [title, setTitle] = useState(null);
336
337
  const motion = useDialogMotion(state.isOpen, present, setPresent, basic);
338
+ const keyboard = useKeyboardInset(present);
337
339
  let t6;
338
340
  if ($[15] !== basic || $[16] !== parts || $[17] !== register || $[18] !== titleId) {
339
341
  t6 = {
@@ -356,7 +358,7 @@ function DialogContent(t0) {
356
358
  const t7 = isDismissable && state.isOpen ? close : void 0;
357
359
  const t8 = motion.scrim;
358
360
  const T1 = View;
359
- const t9 = composeStyles(styles.layout, basic ? void 0 : styles.layoutFull);
361
+ const t9 = composeStyles(styles.layout, basic ? { paddingBottom: theme.spacing.xl + keyboard } : styles.layoutFull);
360
362
  const t10 = Animated;
361
363
  let t11;
362
364
  if ($[20] !== labelledBy || $[21] !== role) {
@@ -366,7 +368,10 @@ function DialogContent(t0) {
366
368
  $[22] = t11;
367
369
  } else t11 = $[22];
368
370
  const t12 = isKeyboardDismissDisabled ? void 0 : close;
369
- const t13 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 : insetsOf(insets), motion.panel, style);
371
+ const t13 = composeStyles(styles.container, basic ? styles.containerBasic : styles.containerFull, basic ? void 0 : {
372
+ ...insetsOf(insets),
373
+ paddingBottom: Math.max(insets.bottom, keyboard)
374
+ }, motion.panel, style);
370
375
  let t14;
371
376
  if ($[23] !== children || $[24] !== slots) {
372
377
  t14 = /* @__PURE__ */ jsx(ButtonSlotContext, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","LayoutChangeEvent","ScrollViewProps","StyleProp","TextProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useMemo","useState","Text","NativeText","ScrollView","StyleSheet","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaInsetsContext","ModalOpenProps","ModalTrigger","ResolvedTheme","ButtonSlotContext","useWindowSizeClass","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","registerOf","useModalState","useModalTrigger","refsOf","useTheme","composeStyles","themedStyles","useTypeRole","MIN_WIDTH","MAX_WIDTH","SCALE_FROM","RISE_FROM","NO_PARTS","Readonly","Record","DialogPart","footer","header","title","stylesOf","colors","radii","shadows","sizing","spacing","create","actions","alignItems","flexDirection","flexShrink","flexWrap","gap","sm","justifyContent","padding","xl","actionsFull","borderTopColor","outlineVariant","borderTopWidth","minHeight","rowSm","paddingVertical","xs","bodyText","color","onSurfaceVariant","container","backgroundColor","surfaceContainerHigh","overflow","containerBasic","borderRadius","boxShadow","elevation3","maxHeight","maxWidth","minWidth","width","containerFull","flex","md","paddingBottom","lg","paddingHorizontal","paddingTop","headerFull","borderBottomColor","borderBottomWidth","layout","bottom","left","pointerEvents","position","right","top","layoutFull","onSurface","DialogLayout","basic","parts","register","part","setTitle","node","titleId","DialogLayoutContext","DialogTriggerContext","DialogBodyProps","ref","DialogContentProps","DialogOpenProps","Omit","children","isDismissable","isKeyboardDismissDisabled","role","style","defaultOpen","isOpen","onOpenChange","DialogPartProps","DialogProps","DialogTitleProps","bodyPaddingOf","Dialog","t0","$","_c","t1","context","slots","t2","t3","DialogBody","contentContainerStyle","onContentSizeChange","onLayout","props","useLayout","theme","styles","text","content","setContent","room","setRoom","height","measureContent","event","nativeEvent","measureRoom","T0","t4","t5","t6","DialogContent","undefined","outer","close","present","setPresent","state","insets","sizeClass","setParts","Symbol","for","motion","useDialogMotion","labelledBy","t7","t8","scrim","T1","t9","t10","t11","t12","t13","panel","t14","t15","t16","t17","t18","DialogFooter","DialogHeader","DialogTitle","reduceMotion","durationMedium1","durationShort2","durationShort3","easingEmphasizedAccelerate","easingEmphasizedDecelerate","easingStandard","fade","duration","easing","bezier","set","timer","setTimeout","Math","max","clearTimeout","shown","get","opacity","transform","scale","translateY","Error","Body","Content","Footer","Header","Title","_c","NativeText"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n ScrollViewProps,\n StyleProp,\n TextProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react'\nimport {\n Text as NativeText,\n ScrollView,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ModalOpenProps, ModalTrigger } from '../../modal'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { ButtonSlotContext } from '../../button/slots'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n registerOf,\n useModalState,\n useModalTrigger,\n} from '../../modal'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The dialogs spec page's two dialogs, as kanso-ui's Dialog draws them: one\n// component, since the page pairs them by window size rather than offering a\n// choice. In a medium window or wider it is the basic dialog, a container on\n// surface container high with the 28dp corner, between 280 and 560dp wide,\n// centred over the scrim, with 24dp of padding all round, 16dp between the\n// headline and the body and 24dp between the body and the actions. In a\n// compact window, below 600dp, the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline in\n// title large and a divider under it, and a 56dp action bar over a divider,\n// both inside the device's safe area.\n//\n// An alert dialog, `role=\"alertdialog\"`, is a question with two or three\n// answers rather than a task, and stays the basic dialog at every width, as\n// on web, where a question filling a phone read as a headline at the top of\n// the screen and its answers at the bottom with nothing between them.\n//\n// **It is drawn in a React Native `Modal`**, through src/modal, which keeps\n// React context, so the dialog keeps the `ThemeScope` around it, and which is\n// a window of its own on iOS and Android, above the screen and its overlays.\n// The `Modal` therefore hosts overlays of its own, so a snackbar or a popover\n// raised from inside the dialog draws above it rather than under it.\n//\n// **It animates out as well as in**, from the motion tokens: the panel scales\n// up from 90% on the emphasised decelerating curve, or rises 3% of the window\n// when it fills it, and leaves on the emphasised accelerating one, while the\n// scrim fades on the standard curve. Web only animates in, since React Aria\n// keeps a closing surface mounted only while a CSS animation runs; here the\n// dialog stays mounted until its exit has run. Under reduced motion the\n// panel appears and leaves at once, and the scrim still fades, which is what\n// says the dialog came and went.\n//\n// **A press on the scrim closes it**, unless `isDismissable` is false, and\n// Android's back gesture and VoiceOver's escape gesture close it, unless\n// `isKeyboardDismissDisabled`, the prop that keeps Escape from closing it on\n// web, which is the key React Native Web's `Modal` hands the same handler.\n// A button inside `Dialog` and outside its content opens it, and one given\n// `slot=\"close\"` inside the content closes it, through src/button's\n// slots.ts.\n//\n// **Focus moves into the dialog and back.** On iOS and Android the screen\n// reader is sent to the headline once the dialog shows, and back to the\n// button that opened it once it has gone. React Native Web's `Modal` traps\n// focus and restores it itself, and is the dialog element there, so on web it\n// takes the dialog's name and the panel takes no role of its own. That\n// `Modal` sets its role itself, so an alert dialog is announced as a dialog\n// in the web Storybook; kanso-ui, the library for web apps, keeps the role.\n\n// The panel's width bounds, the page's, and how far it travels as it\n// arrives: it scales up from 90% as the basic dialog, or rises 3% of the\n// window as the full-screen one, as web's keyframes have it.\nconst MIN_WIDTH = 280\nconst MAX_WIDTH = 560\nconst SCALE_FROM = 0.9\nconst RISE_FROM = 0.03\n\nconst NO_PARTS: Readonly<Record<DialogPart, number>> = {\n footer: 0,\n header: 0,\n title: 0,\n}\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The page's 24dp between the body and the actions, and 8dp between\n // the buttons. Actions that do not fit on one row wrap onto another,\n // still at the trailing edge.\n actions: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n gap: spacing.sm,\n justifyContent: 'flex-end',\n padding: spacing.xl,\n },\n // Full screen, the actions are the page's bottom action bar: 56dp at\n // least, over a divider, so an action whose label wraps grows the bar\n // rather than meeting the divider.\n actionsFull: {\n borderTopColor: colors.outlineVariant,\n borderTopWidth: 1,\n minHeight: sizing.rowSm,\n paddingVertical: spacing.xs,\n },\n // The text a body is handed as a string, in the page's body medium on\n // on-surface variant, which is what web's body sets for its text.\n bodyText: {\n color: colors.onSurfaceVariant,\n },\n // Both dialogs' container, whose corner, where it has one, clips the\n // body's scroll.\n container: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n // The basic dialog's container, centred over the scrim and only as\n // tall as the room the scrim's padding leaves, so the body scrolls\n // rather than running off the screen.\n containerBasic: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n maxHeight: '100%',\n maxWidth: MAX_WIDTH,\n minWidth: MIN_WIDTH,\n width: '100%',\n },\n // Full screen, the container fills the window with square corners, and\n // its fill runs on under the safe area its content keeps out of.\n containerFull: {\n flex: 1,\n },\n // The page's 24dp above the headline and 16dp between it and the body,\n // with the headline beside whatever else the header holds, a close\n // button for one.\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.md,\n justifyContent: 'space-between',\n paddingBottom: spacing.lg,\n paddingHorizontal: spacing.xl,\n paddingTop: spacing.xl,\n },\n // Full screen, the header is the page's own 56dp bar, at least, under\n // a divider.\n headerFull: {\n borderBottomColor: colors.outlineVariant,\n borderBottomWidth: 1,\n minHeight: sizing.rowSm,\n paddingBottom: spacing.xs,\n paddingTop: spacing.xs,\n },\n // The scrim centres the container, which is what makes the dialog a\n // dialog rather than a sheet. Full screen it has no room to give. It\n // takes no touches itself, so a press around the container reaches the\n // scrim under it.\n layout: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n padding: spacing.xl,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n layoutFull: {\n alignItems: 'stretch',\n padding: 0,\n },\n // The headline gives way to whatever shares its row.\n title: {\n color: colors.onSurface,\n flexShrink: 1,\n },\n }),\n)\n\n// What the content's parts read: which of the two dialogs is drawn, which\n// parts are there, and the headline's name and node.\ntype DialogLayout = {\n readonly basic: boolean\n readonly parts: Readonly<Record<DialogPart, number>>\n readonly register: (part: DialogPart) => () => void\n readonly setTitle: (node: HostInstance | null) => void\n readonly titleId: string\n}\n\ntype DialogPart = 'footer' | 'header' | 'title'\n\nconst DialogLayoutContext = createContext<DialogLayout | null>(null)\nconst DialogTriggerContext = createContext<ModalTrigger | null>(null)\n\ntype DialogBodyProps = ScrollViewProps & {\n readonly ref?: Ref<ComponentRef<typeof ScrollView>>\n}\n\ntype DialogContentProps = DialogOpenProps &\n Omit<ViewProps, 'children' | 'role' | 'style'> & {\n readonly children?: ReactNode\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. Android's back gesture is `isKeyboardDismissDisabled`'s, and\n * this says nothing about it, so a dialog that has to be answered from\n * one of its actions turns off both.\n * @default true\n */\n readonly isDismissable?: boolean\n /**\n * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on\n * web, from closing the dialog.\n * @default false\n */\n readonly isKeyboardDismissDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * `alertdialog` for a dialog interrupting with something that has to be\n * answered before the app carries on. It also keeps the dialog the basic\n * one in a compact window, centred and sized to its content, where a\n * dialog of the default role fills the window.\n * @default 'dialog'\n */\n readonly role?: 'alertdialog' | 'dialog'\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype DialogOpenProps = ModalOpenProps & {\n /** Whether the dialog starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the dialog is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the dialog opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\ntype DialogPartProps = ViewProps & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype DialogProps = DialogOpenProps & {\n /** The button that opens the dialog, and `Dialog.Content`. */\n readonly children?: ReactNode\n}\n\ntype DialogTitleProps = Omit<TextProps, 'role'> & {\n readonly ref?: Ref<HostInstance>\n}\n\n// The body's padding. The page's 24dp all round is spent by whichever part\n// is at each end, so the body takes the top of it when no header is there\n// and the bottom when no footer is. Full screen, it keeps 24dp under the\n// header's divider as well, which is the content padding the page gives the\n// full-screen dialog.\nfunction bodyPaddingOf(\n { basic, parts }: DialogLayout,\n spacing: ResolvedTheme['spacing'],\n): ViewStyle {\n return {\n gap: spacing.lg,\n paddingBottom: parts.footer > 0 ? 0 : spacing.xl,\n paddingHorizontal: spacing.xl,\n paddingTop: basic && parts.header > 0 ? 0 : spacing.xl,\n }\n}\n\n/**\n * A modal dialog centred over the screen, and the same dialog filling the\n * window in a compact window, the dialogs spec page's basic and full-screen\n * dialogs, paired by window size as the page pairs them. An alert dialog\n * stays the basic one at every width. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">Cancel</Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * Composed rather than configured by props, as web's is, since a dialog's\n * header, body and actions all take arbitrary content. A `Button`,\n * `IconButton` or `Chip` inside `Dialog` and outside its content opens it,\n * and a button given `slot=\"close\"` anywhere inside the content closes it. A\n * dialog nothing on the screen opens leaves `Dialog` out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead.\n */\nfunction Dialog({ children, defaultOpen, isOpen, onOpenChange }: DialogProps) {\n const { context, slots } = useModalTrigger({\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n return (\n <DialogTriggerContext value={context}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogTriggerContext>\n )\n}\n\n/**\n * What the dialog shows, as a body that scrolls when its content runs past\n * the room it has. A string is drawn in the page's body medium on on-surface\n * variant; anything else draws itself. `style`, `ref` and `testID` land on\n * the `ScrollView`.\n *\n * A body its content runs past takes focus, as web's is a tab stop, so a\n * keyboard can scroll it when nothing inside it takes focus; a call site's\n * own `focusable` still wins.\n */\nfunction DialogBody({\n children,\n contentContainerStyle,\n onContentSizeChange,\n onLayout,\n ...props\n}: DialogBodyProps) {\n const layout = useLayout('Dialog.Body')\n const theme = useTheme()\n const styles = stylesOf(theme)\n const text = useTypeRole('bodyMedium')\n const { spacing } = theme\n const [content, setContent] = useState(0)\n const [room, setRoom] = useState(0)\n const measureContent = useCallback(\n (width: number, height: number) => {\n setContent(height)\n onContentSizeChange?.(width, height)\n },\n [onContentSizeChange],\n )\n const measureRoom = useCallback(\n (event: LayoutChangeEvent) => {\n setRoom(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n\n return (\n <ScrollView\n focusable={content > room}\n onContentSizeChange={measureContent}\n onLayout={measureRoom}\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n bodyPaddingOf(layout, spacing),\n contentContainerStyle,\n )}\n >\n {typeof children === 'string' ? (\n <NativeText style={composeStyles<TextStyle>(text, styles.bodyText)}>\n {children}\n </NativeText>\n ) : (\n children\n )}\n </ScrollView>\n )\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the button that opens it stays outside it.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own it is this\n * part's: `isOpen` with `onOpenChange` holds it, and a `slot=\"close\"`\n * button, the scrim and the back gesture all report through `onOpenChange`.\n * `style`, `ref` and `testID` land on the container.\n */\nfunction DialogContent({\n children,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen,\n onOpenChange,\n role = 'dialog',\n style,\n ...props\n}: DialogContentProps) {\n const outer = use(DialogTriggerContext)\n const { close, present, setPresent, slots, state } = useModalState(outer, {\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n const theme = useTheme()\n const styles = stylesOf(theme)\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const sizeClass = useWindowSizeClass()\n const basic = role === 'alertdialog' || sizeClass !== 'compact'\n const titleId = useId()\n const [parts, setParts] = useState(NO_PARTS)\n const [register] = useState(() => registerOf(setParts))\n const [title, setTitle] = useState<HostInstance | null>(null)\n const motion = useDialogMotion(state.isOpen, present, setPresent, basic)\n const layout = useMemo<DialogLayout>(\n () => ({ basic, parts, register, setTitle, titleId }),\n [basic, parts, register, titleId],\n )\n\n if (!present) {\n return null\n }\n\n const labelledBy = parts.title > 0 ? titleId : undefined\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n labelledBy={labelledBy}\n onClose={close}\n onScrimPress={isDismissable && state.isOpen ? close : undefined}\n scrim={motion.scrim}\n title={title}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layout,\n basic ? undefined : styles.layoutFull,\n )}\n >\n <Animated.View\n {...panelRoleOf(role, labelledBy)}\n onAccessibilityEscape={isKeyboardDismissDisabled ? undefined : close}\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.container,\n basic ? styles.containerBasic : styles.containerFull,\n basic ? undefined : insetsOf(insets),\n motion.panel,\n style,\n )}\n >\n <DialogLayoutContext value={layout}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogLayoutContext>\n </Animated.View>\n </View>\n </ModalWindow>\n )\n}\n\n/**\n * The dialog's actions, at the trailing edge and wrapping onto another row\n * when they do not fit on one. Full screen they are the page's bottom action\n * bar. `style`, `ref` and `testID` land on its view.\n */\nfunction DialogFooter({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Footer')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('footer'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.actions,\n layout.basic ? undefined : styles.actionsFull,\n style,\n )}\n />\n )\n}\n\n/**\n * The dialog's header: its `Dialog.Title`, and anything beside it, such as a\n * close button. Full screen it is the page's header bar. `style`, `ref` and\n * `testID` land on its view.\n */\nfunction DialogHeader({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Header')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('header'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.header,\n layout.basic ? undefined : styles.headerFull,\n style,\n )}\n />\n )\n}\n\n/**\n * Names the dialog: the container is labelled by it, and a screen reader is\n * sent to it once the dialog shows. In headline small as the basic dialog,\n * and title large as the full-screen one, where it shares a 56dp bar.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction DialogTitle({ ref, style, ...props }: DialogTitleProps) {\n const layout = useLayout('Dialog.Title')\n const styles = stylesOf(useTheme())\n const role = useTypeRole(layout.basic ? 'headlineSmall' : 'titleLarge')\n const { register, setTitle } = layout\n\n useLayoutEffect(() => register('title'), [register])\n\n return (\n <NativeText\n {...props}\n nativeID={layout.titleId}\n ref={refsOf(setTitle, ref)}\n role=\"heading\"\n style={composeStyles<TextStyle>(role, styles.title, style)}\n />\n )\n}\n\n/**\n * The scrim's and the panel's motion, and the timer that unmounts the dialog\n * once its exit has run. The panel arrives over the medium duration on the\n * emphasised decelerating curve and leaves over the short one on the\n * accelerating curve, and the scrim fades over the short one on the standard\n * curve, both ways. Under reduced motion the panel arrives and leaves at once.\n */\nfunction useDialogMotion(\n isOpen: boolean,\n present: boolean,\n setPresent: (present: boolean) => void,\n basic: boolean,\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const { height } = useWindowDimensions()\n const panel = useSharedValue(0)\n const scrim = useSharedValue(0)\n\n useEffect(() => {\n const fade = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n if (isOpen) {\n scrim.set(withTiming(1, fade))\n panel.set(\n reduceMotion\n ? 1\n : withTiming(1, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }),\n )\n return undefined\n }\n\n if (!present) {\n return undefined\n }\n\n scrim.set(withTiming(0, fade))\n panel.set(\n reduceMotion\n ? 0\n : withTiming(0, {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingEmphasizedAccelerate),\n }),\n )\n const timer = setTimeout(\n () => {\n setPresent(false)\n },\n reduceMotion\n ? motion.durationShort2\n : Math.max(motion.durationShort2, motion.durationShort3),\n )\n\n return () => {\n clearTimeout(timer)\n }\n }, [isOpen, motion, panel, present, reduceMotion, scrim, setPresent])\n\n return {\n panel: useAnimatedStyle(() => {\n 'worklet'\n const shown = panel.get()\n\n return basic\n ? {\n opacity: shown,\n transform: [{ scale: SCALE_FROM + (1 - SCALE_FROM) * shown }],\n }\n : {\n opacity: shown,\n transform: [{ translateY: (1 - shown) * RISE_FROM * height }],\n }\n }),\n scrim: useAnimatedStyle(() => {\n 'worklet'\n return { opacity: scrim.get() }\n }),\n }\n}\n\nfunction useLayout(part: string) {\n const layout = use(DialogLayoutContext)\n\n if (layout === null) {\n throw new Error(`${part} is drawn inside Dialog.Content.`)\n }\n\n return layout\n}\n\nDialog.Body = DialogBody\nDialog.Content = DialogContent\nDialog.Footer = DialogFooter\nDialog.Header = DialogHeader\nDialog.Title = DialogTitle\n\nexport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n}\nexport type {\n DialogBodyProps,\n DialogContentProps,\n DialogPartProps,\n DialogProps,\n DialogTitleProps,\n}\n"],"mappings":";;;;;;;;;;;;;;AA4GA,MAAMkD,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAElB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KAAA1B,EAAA;CAAA,OAnBM0B;AAmBN;AAGH,SAASd,UAAUrC,MAAc;CAC/B,MAAMb,SAASlG,IAAImH,mBAAmB;CAEtC,IAAIjB,WAAW,MACb,MAAM,IAAI2H,MAAM,GAAG9G,KAAI,iCAAkC;CAG3D,OAAOb;AACT;AAEAoC,OAAOwF,OAAO/E;AACdT,OAAOyF,UAAU1D;AACjB/B,OAAO0F,SAAS7B;AAChB7D,OAAO2F,SAAS7B;AAChB9D,OAAO4F,QAAQ7B"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","HostInstance","LayoutChangeEvent","ScrollViewProps","StyleProp","TextProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useMemo","useState","Text","NativeText","ScrollView","StyleSheet","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","SafeAreaInsetsContext","ModalOpenProps","ModalTrigger","ResolvedTheme","ButtonSlotContext","useWindowSizeClass","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","registerOf","useModalState","useModalTrigger","useKeyboardInset","refsOf","useTheme","composeStyles","themedStyles","useTypeRole","MIN_WIDTH","MAX_WIDTH","SCALE_FROM","RISE_FROM","NO_PARTS","Readonly","Record","DialogPart","footer","header","title","stylesOf","colors","radii","shadows","sizing","spacing","create","actions","alignItems","flexDirection","flexShrink","flexWrap","gap","sm","justifyContent","padding","xl","actionsFull","borderTopColor","outlineVariant","borderTopWidth","minHeight","rowSm","paddingVertical","xs","bodyText","color","onSurfaceVariant","container","backgroundColor","surfaceContainerHigh","overflow","containerBasic","borderRadius","boxShadow","elevation3","maxHeight","maxWidth","minWidth","width","containerFull","flex","md","paddingBottom","lg","paddingHorizontal","paddingTop","headerFull","borderBottomColor","borderBottomWidth","layout","bottom","left","pointerEvents","position","right","top","layoutFull","onSurface","DialogLayout","basic","parts","register","part","setTitle","node","titleId","DialogLayoutContext","DialogTriggerContext","DialogBodyProps","ref","DialogContentProps","DialogOpenProps","Omit","children","isDismissable","isKeyboardDismissDisabled","role","style","defaultOpen","isOpen","onOpenChange","DialogPartProps","DialogProps","DialogTitleProps","bodyPaddingOf","Dialog","t0","$","_c","t1","context","slots","t2","t3","DialogBody","contentContainerStyle","onContentSizeChange","onLayout","props","useLayout","theme","styles","text","content","setContent","room","setRoom","height","measureContent","event","nativeEvent","measureRoom","T0","t4","t5","t6","DialogContent","undefined","outer","close","present","setPresent","state","insets","sizeClass","setParts","Symbol","for","motion","useDialogMotion","keyboard","labelledBy","t7","t8","scrim","T1","t9","t10","t11","t12","t13","Math","max","panel","t14","t15","t16","t17","t18","DialogFooter","DialogHeader","DialogTitle","reduceMotion","durationMedium1","durationShort2","durationShort3","easingEmphasizedAccelerate","easingEmphasizedDecelerate","easingStandard","fade","duration","easing","bezier","set","timer","setTimeout","clearTimeout","shown","get","opacity","transform","scale","translateY","Error","Body","Content","Footer","Header","Title","_c","NativeText"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n ScrollViewProps,\n StyleProp,\n TextProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react'\nimport {\n Text as NativeText,\n ScrollView,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ModalOpenProps, ModalTrigger } from '../../modal'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { ButtonSlotContext } from '../../button/slots'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n registerOf,\n useModalState,\n useModalTrigger,\n} from '../../modal'\nimport { useKeyboardInset } from '../../overlay/keyboard'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The dialogs spec page's two dialogs, as kanso-ui's Dialog draws them: one\n// component, since the page pairs them by window size rather than offering a\n// choice. In a medium window or wider it is the basic dialog, a container on\n// surface container high with the 28dp corner, between 280 and 560dp wide,\n// centred over the scrim, with 24dp of padding all round, 16dp between the\n// headline and the body and 24dp between the body and the actions. In a\n// compact window, below 600dp, the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline in\n// title large and a divider under it, and a 56dp action bar over a divider,\n// both inside the device's safe area.\n//\n// **It stays above the software keyboard.** While one is up the basic dialog\n// is centred in the room above it, and the full-screen one pads its bottom by\n// as much of the screen as the keyboard covers, so its actions and a field\n// focused in it are not hidden behind the keyboard. On Android a `Modal`\n// reports the keyboard to React Native only through\n// react-native-keyboard-controller, which src/overlay/keyboard.ts reads where\n// the app installs it.\n//\n// An alert dialog, `role=\"alertdialog\"`, is a question with two or three\n// answers rather than a task, and stays the basic dialog at every width, as\n// on web, where a question filling a phone read as a headline at the top of\n// the screen and its answers at the bottom with nothing between them.\n//\n// **It is drawn in a React Native `Modal`**, through src/modal, which keeps\n// React context, so the dialog keeps the `ThemeScope` around it, and which is\n// a window of its own on iOS and Android, above the screen and its overlays.\n// The `Modal` therefore hosts overlays of its own, so a snackbar or a popover\n// raised from inside the dialog draws above it rather than under it.\n//\n// **It animates out as well as in**, from the motion tokens: the panel scales\n// up from 90% on the emphasised decelerating curve, or rises 3% of the window\n// when it fills it, and leaves on the emphasised accelerating one, while the\n// scrim fades on the standard curve. Web only animates in, since React Aria\n// keeps a closing surface mounted only while a CSS animation runs; here the\n// dialog stays mounted until its exit has run. Under reduced motion the\n// panel appears and leaves at once, and the scrim still fades, which is what\n// says the dialog came and went.\n//\n// **A press on the scrim closes it**, unless `isDismissable` is false, and\n// Android's back gesture and VoiceOver's escape gesture close it, unless\n// `isKeyboardDismissDisabled`, the prop that keeps Escape from closing it on\n// web, which is the key React Native Web's `Modal` hands the same handler.\n// A button inside `Dialog` and outside its content opens it, and one given\n// `slot=\"close\"` inside the content closes it, through src/button's\n// slots.ts.\n//\n// **Focus moves into the dialog and back.** On iOS and Android the screen\n// reader is sent to the headline once the dialog shows, and back to the\n// button that opened it once it has gone. React Native Web's `Modal` traps\n// focus and restores it itself, and is the dialog element there, so on web it\n// takes the dialog's name and the panel takes no role of its own. That\n// `Modal` sets its role itself, so an alert dialog is announced as a dialog\n// in the web Storybook; kanso-ui, the library for web apps, keeps the role.\n\n// The panel's width bounds, the page's, and how far it travels as it\n// arrives: it scales up from 90% as the basic dialog, or rises 3% of the\n// window as the full-screen one, as web's keyframes have it.\nconst MIN_WIDTH = 280\nconst MAX_WIDTH = 560\nconst SCALE_FROM = 0.9\nconst RISE_FROM = 0.03\n\nconst NO_PARTS: Readonly<Record<DialogPart, number>> = {\n footer: 0,\n header: 0,\n title: 0,\n}\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The page's 24dp between the body and the actions, and 8dp between\n // the buttons. Actions that do not fit on one row wrap onto another,\n // still at the trailing edge.\n actions: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n gap: spacing.sm,\n justifyContent: 'flex-end',\n padding: spacing.xl,\n },\n // Full screen, the actions are the page's bottom action bar: 56dp at\n // least, over a divider, so an action whose label wraps grows the bar\n // rather than meeting the divider.\n actionsFull: {\n borderTopColor: colors.outlineVariant,\n borderTopWidth: 1,\n minHeight: sizing.rowSm,\n paddingVertical: spacing.xs,\n },\n // The text a body is handed as a string, in the page's body medium on\n // on-surface variant, which is what web's body sets for its text.\n bodyText: {\n color: colors.onSurfaceVariant,\n },\n // Both dialogs' container, whose corner, where it has one, clips the\n // body's scroll.\n container: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n // The basic dialog's container, centred over the scrim and only as\n // tall as the room the scrim's padding leaves, so the body scrolls\n // rather than running off the screen.\n containerBasic: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n maxHeight: '100%',\n maxWidth: MAX_WIDTH,\n minWidth: MIN_WIDTH,\n width: '100%',\n },\n // Full screen, the container fills the window with square corners, and\n // its fill runs on under the safe area its content keeps out of.\n containerFull: {\n flex: 1,\n },\n // The page's 24dp above the headline and 16dp between it and the body,\n // with the headline beside whatever else the header holds, a close\n // button for one.\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.md,\n justifyContent: 'space-between',\n paddingBottom: spacing.lg,\n paddingHorizontal: spacing.xl,\n paddingTop: spacing.xl,\n },\n // Full screen, the header is the page's own 56dp bar, at least, under\n // a divider.\n headerFull: {\n borderBottomColor: colors.outlineVariant,\n borderBottomWidth: 1,\n minHeight: sizing.rowSm,\n paddingBottom: spacing.xs,\n paddingTop: spacing.xs,\n },\n // The scrim centres the container, which is what makes the dialog a\n // dialog rather than a sheet. Full screen it has no room to give. It\n // takes no touches itself, so a press around the container reaches the\n // scrim under it.\n layout: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n padding: spacing.xl,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n layoutFull: {\n alignItems: 'stretch',\n padding: 0,\n },\n // The headline gives way to whatever shares its row.\n title: {\n color: colors.onSurface,\n flexShrink: 1,\n },\n }),\n)\n\n// What the content's parts read: which of the two dialogs is drawn, which\n// parts are there, and the headline's name and node.\ntype DialogLayout = {\n readonly basic: boolean\n readonly parts: Readonly<Record<DialogPart, number>>\n readonly register: (part: DialogPart) => () => void\n readonly setTitle: (node: HostInstance | null) => void\n readonly titleId: string\n}\n\ntype DialogPart = 'footer' | 'header' | 'title'\n\nconst DialogLayoutContext = createContext<DialogLayout | null>(null)\nconst DialogTriggerContext = createContext<ModalTrigger | null>(null)\n\ntype DialogBodyProps = ScrollViewProps & {\n readonly ref?: Ref<ComponentRef<typeof ScrollView>>\n}\n\ntype DialogContentProps = DialogOpenProps &\n Omit<ViewProps, 'children' | 'role' | 'style'> & {\n readonly children?: ReactNode\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. Android's back gesture is `isKeyboardDismissDisabled`'s, and\n * this says nothing about it, so a dialog that has to be answered from\n * one of its actions turns off both.\n * @default true\n */\n readonly isDismissable?: boolean\n /**\n * Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on\n * web, from closing the dialog.\n * @default false\n */\n readonly isKeyboardDismissDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * `alertdialog` for a dialog interrupting with something that has to be\n * answered before the app carries on. It also keeps the dialog the basic\n * one in a compact window, centred and sized to its content, where a\n * dialog of the default role fills the window.\n * @default 'dialog'\n */\n readonly role?: 'alertdialog' | 'dialog'\n readonly style?: StyleProp<ViewStyle>\n }\n\ntype DialogOpenProps = ModalOpenProps & {\n /** Whether the dialog starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the dialog is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the dialog opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\ntype DialogPartProps = ViewProps & {\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\ntype DialogProps = DialogOpenProps & {\n /** The button that opens the dialog, and `Dialog.Content`. */\n readonly children?: ReactNode\n}\n\ntype DialogTitleProps = Omit<TextProps, 'role'> & {\n readonly ref?: Ref<HostInstance>\n}\n\n// The body's padding. The page's 24dp all round is spent by whichever part\n// is at each end, so the body takes the top of it when no header is there\n// and the bottom when no footer is. Full screen, it keeps 24dp under the\n// header's divider as well, which is the content padding the page gives the\n// full-screen dialog.\nfunction bodyPaddingOf(\n { basic, parts }: DialogLayout,\n spacing: ResolvedTheme['spacing'],\n): ViewStyle {\n return {\n gap: spacing.lg,\n paddingBottom: parts.footer > 0 ? 0 : spacing.xl,\n paddingHorizontal: spacing.xl,\n paddingTop: basic && parts.header > 0 ? 0 : spacing.xl,\n }\n}\n\n/**\n * A modal dialog centred over the screen, and the same dialog filling the\n * window in a compact window, the dialogs spec page's basic and full-screen\n * dialogs, paired by window size as the page pairs them. An alert dialog\n * stays the basic one at every width. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <Dialog>\n * <Button>Open</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">Cancel</Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\n *\n * Composed rather than configured by props, as web's is, since a dialog's\n * header, body and actions all take arbitrary content. A `Button`,\n * `IconButton` or `Chip` inside `Dialog` and outside its content opens it,\n * and a button given `slot=\"close\"` anywhere inside the content closes it. A\n * dialog nothing on the screen opens leaves `Dialog` out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead.\n */\nfunction Dialog({ children, defaultOpen, isOpen, onOpenChange }: DialogProps) {\n const { context, slots } = useModalTrigger({\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n\n return (\n <DialogTriggerContext value={context}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogTriggerContext>\n )\n}\n\n/**\n * What the dialog shows, as a body that scrolls when its content runs past\n * the room it has. A string is drawn in the page's body medium on on-surface\n * variant; anything else draws itself. `style`, `ref` and `testID` land on\n * the `ScrollView`.\n *\n * A body its content runs past takes focus, as web's is a tab stop, so a\n * keyboard can scroll it when nothing inside it takes focus; a call site's\n * own `focusable` still wins.\n */\nfunction DialogBody({\n children,\n contentContainerStyle,\n onContentSizeChange,\n onLayout,\n ...props\n}: DialogBodyProps) {\n const layout = useLayout('Dialog.Body')\n const theme = useTheme()\n const styles = stylesOf(theme)\n const text = useTypeRole('bodyMedium')\n const { spacing } = theme\n const [content, setContent] = useState(0)\n const [room, setRoom] = useState(0)\n const measureContent = useCallback(\n (width: number, height: number) => {\n setContent(height)\n onContentSizeChange?.(width, height)\n },\n [onContentSizeChange],\n )\n const measureRoom = useCallback(\n (event: LayoutChangeEvent) => {\n setRoom(event.nativeEvent.layout.height)\n onLayout?.(event)\n },\n [onLayout],\n )\n\n return (\n <ScrollView\n focusable={content > room}\n onContentSizeChange={measureContent}\n onLayout={measureRoom}\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n bodyPaddingOf(layout, spacing),\n contentContainerStyle,\n )}\n >\n {typeof children === 'string' ? (\n <NativeText style={composeStyles<TextStyle>(text, styles.bodyText)}>\n {children}\n </NativeText>\n ) : (\n children\n )}\n </ScrollView>\n )\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the button that opens it stays outside it.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own it is this\n * part's: `isOpen` with `onOpenChange` holds it, and a `slot=\"close\"`\n * button, the scrim and the back gesture all report through `onOpenChange`.\n * `style`, `ref` and `testID` land on the container.\n */\nfunction DialogContent({\n children,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen,\n onOpenChange,\n role = 'dialog',\n style,\n ...props\n}: DialogContentProps) {\n const outer = use(DialogTriggerContext)\n const { close, present, setPresent, slots, state } = useModalState(outer, {\n defaultOpen,\n isOpen,\n onOpenChange,\n })\n const theme = useTheme()\n const styles = stylesOf(theme)\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const sizeClass = useWindowSizeClass()\n const basic = role === 'alertdialog' || sizeClass !== 'compact'\n const titleId = useId()\n const [parts, setParts] = useState(NO_PARTS)\n const [register] = useState(() => registerOf(setParts))\n const [title, setTitle] = useState<HostInstance | null>(null)\n const motion = useDialogMotion(state.isOpen, present, setPresent, basic)\n const keyboard = useKeyboardInset(present)\n const layout = useMemo<DialogLayout>(\n () => ({ basic, parts, register, setTitle, titleId }),\n [basic, parts, register, titleId],\n )\n\n if (!present) {\n return null\n }\n\n const labelledBy = parts.title > 0 ? titleId : undefined\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n labelledBy={labelledBy}\n onClose={close}\n onScrimPress={isDismissable && state.isOpen ? close : undefined}\n scrim={motion.scrim}\n title={title}\n >\n <View\n style={composeStyles<ViewStyle>(\n styles.layout,\n basic\n ? { paddingBottom: theme.spacing.xl + keyboard }\n : styles.layoutFull,\n )}\n >\n <Animated.View\n {...panelRoleOf(role, labelledBy)}\n onAccessibilityEscape={isKeyboardDismissDisabled ? undefined : close}\n {...props}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.container,\n basic ? styles.containerBasic : styles.containerFull,\n basic\n ? undefined\n : {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, keyboard),\n },\n motion.panel,\n style,\n )}\n >\n <DialogLayoutContext value={layout}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </DialogLayoutContext>\n </Animated.View>\n </View>\n </ModalWindow>\n )\n}\n\n/**\n * The dialog's actions, at the trailing edge and wrapping onto another row\n * when they do not fit on one. Full screen they are the page's bottom action\n * bar. `style`, `ref` and `testID` land on its view.\n */\nfunction DialogFooter({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Footer')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('footer'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.actions,\n layout.basic ? undefined : styles.actionsFull,\n style,\n )}\n />\n )\n}\n\n/**\n * The dialog's header: its `Dialog.Title`, and anything beside it, such as a\n * close button. Full screen it is the page's header bar. `style`, `ref` and\n * `testID` land on its view.\n */\nfunction DialogHeader({ style, ...props }: DialogPartProps) {\n const layout = useLayout('Dialog.Header')\n const styles = stylesOf(useTheme())\n const { register } = layout\n\n useLayoutEffect(() => register('header'), [register])\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n styles.header,\n layout.basic ? undefined : styles.headerFull,\n style,\n )}\n />\n )\n}\n\n/**\n * Names the dialog: the container is labelled by it, and a screen reader is\n * sent to it once the dialog shows. In headline small as the basic dialog,\n * and title large as the full-screen one, where it shares a 56dp bar.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction DialogTitle({ ref, style, ...props }: DialogTitleProps) {\n const layout = useLayout('Dialog.Title')\n const styles = stylesOf(useTheme())\n const role = useTypeRole(layout.basic ? 'headlineSmall' : 'titleLarge')\n const { register, setTitle } = layout\n\n useLayoutEffect(() => register('title'), [register])\n\n return (\n <NativeText\n {...props}\n nativeID={layout.titleId}\n ref={refsOf(setTitle, ref)}\n role=\"heading\"\n style={composeStyles<TextStyle>(role, styles.title, style)}\n />\n )\n}\n\n/**\n * The scrim's and the panel's motion, and the timer that unmounts the dialog\n * once its exit has run. The panel arrives over the medium duration on the\n * emphasised decelerating curve and leaves over the short one on the\n * accelerating curve, and the scrim fades over the short one on the standard\n * curve, both ways. Under reduced motion the panel arrives and leaves at once.\n */\nfunction useDialogMotion(\n isOpen: boolean,\n present: boolean,\n setPresent: (present: boolean) => void,\n basic: boolean,\n) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const { height } = useWindowDimensions()\n const panel = useSharedValue(0)\n const scrim = useSharedValue(0)\n\n useEffect(() => {\n const fade = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n if (isOpen) {\n scrim.set(withTiming(1, fade))\n panel.set(\n reduceMotion\n ? 1\n : withTiming(1, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasizedDecelerate),\n }),\n )\n return undefined\n }\n\n if (!present) {\n return undefined\n }\n\n scrim.set(withTiming(0, fade))\n panel.set(\n reduceMotion\n ? 0\n : withTiming(0, {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingEmphasizedAccelerate),\n }),\n )\n const timer = setTimeout(\n () => {\n setPresent(false)\n },\n reduceMotion\n ? motion.durationShort2\n : Math.max(motion.durationShort2, motion.durationShort3),\n )\n\n return () => {\n clearTimeout(timer)\n }\n }, [isOpen, motion, panel, present, reduceMotion, scrim, setPresent])\n\n return {\n panel: useAnimatedStyle(() => {\n 'worklet'\n const shown = panel.get()\n\n return basic\n ? {\n opacity: shown,\n transform: [{ scale: SCALE_FROM + (1 - SCALE_FROM) * shown }],\n }\n : {\n opacity: shown,\n transform: [{ translateY: (1 - shown) * RISE_FROM * height }],\n }\n }),\n scrim: useAnimatedStyle(() => {\n 'worklet'\n return { opacity: scrim.get() }\n }),\n }\n}\n\nfunction useLayout(part: string) {\n const layout = use(DialogLayoutContext)\n\n if (layout === null) {\n throw new Error(`${part} is drawn inside Dialog.Content.`)\n }\n\n return layout\n}\n\nDialog.Body = DialogBody\nDialog.Content = DialogContent\nDialog.Footer = DialogFooter\nDialog.Header = DialogHeader\nDialog.Title = DialogTitle\n\nexport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n}\nexport type {\n DialogBodyProps,\n DialogContentProps,\n DialogPartProps,\n DialogProps,\n DialogTitleProps,\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqHA,MAAMmD,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AACnB,MAAMC,YAAY;AAElB,MAAMC,WAAiD;CACrDI,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT;AAEA,MAAMC,WAAWb,cACd,EAAEc,QAAQC,OAAOC,SAASC,QAAQC,cACjC5C,WAAW6C,OAAO;CAIhBC,SAAS;EACPC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,UAAU;EACVC,KAAKP,QAAQQ;EACbC,gBAAgB;EAChBC,SAASV,QAAQW;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W,MACb,MAAM,IAAI4H,MAAM,GAAG/G,KAAI,iCAAkC;CAG3D,OAAOb;AACT;AAEAoC,OAAOyF,OAAOhF;AACdT,OAAO0F,UAAU3D;AACjB/B,OAAO2F,SAAS3B;AAChBhE,OAAO4F,SAAS3B;AAChBjE,OAAO6F,QAAQ3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","HostInstance","StyleProp","TextInput","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","createContext","use","useCallback","useMemo","useRef","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","SafeAreaInsetsContext","useOverlayTriggerState","AutocompleteValue","ButtonSlots","AnchoredPlacement","ResolvedTheme","AutocompleteProps","AutocompleteContext","ButtonSlotContext","FieldInput","ArrowBackGlyph","CloseGlyph","useWindowSizeClass","useMessages","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","useAnchoredPlacement","useKeyboardTop","PANEL_ORIGINS","useFocusOnPlaced","usePanelMotion","useReturnFocus","refsOf","useTheme","composeStyles","themedStyles","Autocomplete","IconButton","FULL_HEADER","MIN_WIDTH","MAX_WIDTH","MIN_RESULTS","UNSEEN","opacity","stylesOf","colors","radii","shadows","spacing","create","back","marginStart","xs","clear","marginEnd","divider","backgroundColor","outline","flexShrink","height","docked","borderRadius","xl","boxShadow","elevation3","full","bottom","left","position","right","top","header","alignItems","flexDirection","gap","sm","paddingHorizontal","lg","resultsFull","flex","surface","surfaceContainerHigh","overflow","PanelProps","Omit","SearchViewContentProps","anchor","backLabel","clearLabel","close","isOpen","setInput","input","setPresent","present","T","children","label","placeholder","ref","style","testID","SearchViewProps","defaultOpen","onOpenChange","SearchViewRoot","state","SearchViewContext","clearOf","autocomplete","setInputValue","focus","dockedOf","placement","transformOrigin","side","width","Math","min","max","anchorWidth","fullOf","insets","covered","paddingBottom","measureBottomOf","panel","setBottom","measureInWindow","_x","y","_width","minHeightOf","minHeight","resultsOf","windowHeight","maxHeight","SearchView","t0","$","_c","t1","t2","open","t3","expanded","t4","default","trigger","slots","t5","root","t6","t7","SearchViewContent","defaultInputValue","filter","inputValue","onInputChange","props","Error","messages","undefined","clearSearch","t8","t9","t10","SearchViewPanel","theme","styles","sizing","typography","window","keyboardTop","align","motion","placed","setPanel","setOwnInput","controlLg","bodyLargeLineHeight","fontScale","Symbol","for","OS","onLayout","T0","onSurface","t11","t12","t13","t14","t15","t16","t17","t18","t19","Content","_c"],"sources":["../../../src/components/search-view/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextInput,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\nimport type { OverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport {\n createContext,\n use,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { AutocompleteValue } from '../../autocomplete'\nimport type { ButtonSlots } from '../../button/slots'\nimport type { AnchoredPlacement } from '../../overlay'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { AutocompleteProps } from '../autocomplete'\n\nimport { AutocompleteContext } from '../../autocomplete'\nimport { ButtonSlotContext } from '../../button/slots'\nimport { FieldInput } from '../../field'\nimport { ArrowBackGlyph, CloseGlyph } from '../../glyphs'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { useMessages } from '../../i18n/provider'\nimport { insetsOf, ModalWindow, NO_INSETS, panelRoleOf } from '../../modal'\nimport { useAnchoredPlacement } from '../../overlay'\nimport { useKeyboardTop } from '../../overlay/keyboard'\nimport {\n PANEL_ORIGINS,\n useFocusOnPlaced,\n usePanelMotion,\n useReturnFocus,\n} from '../../overlay/panel'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { Autocomplete } from '../autocomplete'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's SearchView, the search page's search view: what a search opens\n// into. A header holds a back button, the input and a clear button, over a\n// 1dp divider in the outline role, and the results run under it. Both of the\n// page's forms are surface container high, with the input in body large on\n// surface over a supporting text in on surface variant, the back icon in on\n// surface and the clear icon in on surface variant.\n//\n// **Which form is the window's.** In a compact window it is the page's\n// full-screen view: the whole window, square, with a 72dp header, its content\n// inside the safe area while its fill runs on under it. From the medium\n// window up, the docked view: dropped under what opened it, as wide as that\n// and held between the page's 360dp and 720dp, with a 28dp corner, a 56dp\n// header, results at least 240dp tall and the whole view no taller than two\n// thirds of the window, at elevation 3, as web's takes them from Compose's\n// docked search bar. Both headers grow by as much as the input's line does at\n// the device's text size.\n//\n// **Both forms are drawn in a `Modal`**, through src/modal, as web's is a\n// dialog in a modal popover: a screen reader stays inside the view until it\n// closes, and a press outside the docked one lands on a scrim that draws\n// nothing and closes it. The docked one is placed by src/overlay's anchored\n// placement under its trigger, flipped above it where there is no room, and\n// kept above the software keyboard. Full screen, the results stop at the\n// keyboard's top edge, so the last of them can be scrolled into sight above\n// the keys.\n//\n// **It is Autocomplete around the header and the results**, as web's is: the\n// header's input is the autocomplete's field, so a ListBox or a List among\n// the results narrows as it is typed into, says how many rows a search leaves\n// to a screen reader, and takes a press on its first tap while the keyboard\n// is up, as it does anywhere inside an Autocomplete.\n//\n// **The header lines up with the search bar's.** The back button sits where\n// SearchField's magnifier does, its icon 28dp in, and the text starts at\n// 68dp, as the bar's does; the clear button's icon ends 28dp from the end. So\n// a view opened from a bar puts its input where the bar's was.\n//\n// **Focus goes to the input and back.** The input takes the keyboard's focus\n// as the view opens, and a screen reader is sent to it once the view shows,\n// and back to the trigger once it has gone. The back button closes it, as\n// Android's back gesture, VoiceOver's escape gesture and Escape on web do.\n// It fades and scales in and out, as src/overlay's anchored panels do, and\n// at once under reduced motion.\n\n// The page's full-screen header, and the docked view's bounds.\nconst FULL_HEADER = 72\nconst MIN_WIDTH = 360\nconst MAX_WIDTH = 720\nconst MIN_RESULTS = 240\n\n// The docked view's scrim takes presses and draws nothing.\nconst UNSEEN: ViewStyle = { opacity: 0 }\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // 4dp in from the header's padding, so the icon inside the 40dp button\n // sits 28dp in, where the search bar draws its magnifier.\n back: {\n marginStart: spacing.xs,\n },\n // 4dp in from the padding, so the icon inside the 40dp button ends 28dp\n // from the end, as the search bar's does.\n clear: {\n marginEnd: spacing.xs,\n },\n // The page's divider under the header, in the outline role.\n divider: {\n backgroundColor: colors.outline,\n flexShrink: 0,\n height: 1,\n },\n docked: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n },\n full: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.sm,\n paddingHorizontal: spacing.lg,\n },\n // Full screen, the results take what the header leaves, and scroll\n // inside it.\n resultsFull: {\n flex: 1,\n },\n surface: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n }),\n)\n\ntype PanelProps = Omit<\n SearchViewContentProps,\n | 'backLabel'\n | 'clearLabel'\n | 'defaultInputValue'\n | 'filter'\n | 'inputValue'\n | 'onInputChange'\n> & {\n readonly anchor: RefObject<HostInstance | null>\n readonly backLabel: string\n readonly clearLabel: string\n readonly close: () => void\n readonly docked: boolean\n readonly isOpen: boolean\n readonly setInput: (input: ComponentRef<typeof TextInput> | null) => void\n readonly setPresent: (present: boolean) => void\n}\n\ntype SearchViewContentProps<T extends object = object> = Omit<\n AutocompleteProps<T>,\n 'children'\n> & {\n /**\n * What the back button is called, for a screen reader. Left out, the\n * library names it in the `I18nProvider`'s locale, or the device's outside\n * one, \"Back\" in English.\n */\n readonly backLabel?: string\n /** The results: a ListBox or a List, which typing narrows. */\n readonly children?: ReactNode\n /**\n * What the clear button is called, for a screen reader. Left out, it is\n * the name React Aria gives web's in the `I18nProvider`'s locale, or the\n * device's outside one, \"Clear search\" in English.\n */\n readonly clearLabel?: string\n /**\n * What is searched, for a screen reader. It names both the view and its\n * input, and is read rather than shown; `placeholder` is what is seen.\n */\n readonly label: string\n /** The supporting text in the empty input, which is what a person reads. */\n readonly placeholder?: string\n readonly ref?: Ref<HostInstance>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype SearchViewProps = {\n /**\n * The Button or IconButton that opens the view, and `SearchView.Content`.\n */\n readonly children?: ReactNode\n /** Whether the view starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the view is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the view opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n// What the content reads from the root: the open state, and the trigger's\n// node, which the docked view is placed under and focus goes back to.\ntype SearchViewRoot = {\n readonly anchor: RefObject<HostInstance | null>\n readonly state: OverlayTriggerState\n}\n\nconst SearchViewContext = createContext<null | SearchViewRoot>(null)\n\n// Empties the input from the clear button, and hands the keyboard back to it,\n// so the next search is typed straight in.\nfunction clearOf(\n autocomplete: AutocompleteValue,\n input: ComponentRef<typeof TextInput> | null,\n) {\n return () => {\n autocomplete.setInputValue('')\n input?.focus()\n }\n}\n\n// The docked view: as wide as what opened it, between the page's bounds,\n// and placed under it.\nfunction dockedOf(placement: AnchoredPlacement): ViewStyle {\n return {\n ...placement.style,\n transformOrigin: PANEL_ORIGINS[placement.side],\n width: Math.min(\n MAX_WIDTH,\n Math.max(MIN_WIDTH, placement.anchorWidth ?? MIN_WIDTH),\n ),\n }\n}\n\n// The full-screen view's content inside the safe area, and above the\n// keyboard where the keyboard reaches further up than the safe area's own\n// bottom inset.\nfunction fullOf(insets: EdgeInsets, covered: number): ViewStyle {\n return {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, covered),\n transformOrigin: 'top',\n }\n}\n\n// Where the view's bottom edge is in the window, kept for the keyboard to be\n// measured against.\nfunction measureBottomOf(\n panel: HostInstance | null,\n setBottom: (bottom: number) => void,\n) {\n return () => {\n panel?.measureInWindow((_x, y, _width, height) => {\n setBottom(y + height)\n })\n }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\n// The docked view's results: at least the page's 240dp, and short enough\n// that the view stays within two thirds of the window.\nfunction resultsOf(windowHeight: number, header: number): ViewStyle {\n return {\n maxHeight: (windowHeight * 2) / 3 - header - 1,\n minHeight: MIN_RESULTS,\n }\n}\n\n/**\n * The view a search opens into: full screen in a compact window, docked\n * under what opened it in a wider one. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <SearchView>\n * <IconButton aria-label=\"Search\">\n * <SearchIcon />\n * </IconButton>\n * <SearchView.Content label=\"Search\" placeholder=\"Search\">\n * <ListBox aria-label=\"Results\">…</ListBox>\n * </SearchView.Content>\n * </SearchView>\n * ```\n *\n * Composed as Popover is: a `Button`, `IconButton` or `Chip` placed directly\n * inside `SearchView` opens the view, and `SearchView.Content` is the view\n * itself.\n */\nfunction SearchView({\n children,\n defaultOpen,\n isOpen,\n onOpenChange,\n}: SearchViewProps) {\n const state = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n const anchor = useRef<HostInstance>(null)\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: () => {\n state.open()\n },\n trigger: { expanded: state.isOpen, ref: anchor },\n }),\n [state],\n )\n const root = useMemo<SearchViewRoot>(() => ({ anchor, state }), [state])\n\n return (\n <SearchViewContext value={root}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SearchViewContext>\n )\n}\n\n/**\n * The view: the header with its back button, input and clear button, and\n * the results under it, inside an Autocomplete, so typing narrows them. What\n * has been typed is the autocomplete's: pass `inputValue` with\n * `onInputChange` to control it, or `defaultInputValue` to let it keep its\n * own, which starts again each time the view opens.\n *\n * `style`, `ref` and `testID` land on the view's surface.\n */\nfunction SearchViewContent<T extends object = object>({\n backLabel,\n clearLabel,\n defaultInputValue,\n filter,\n inputValue,\n label,\n onInputChange,\n ...props\n}: SearchViewContentProps<T>) {\n const root = use(SearchViewContext)\n\n if (root === null) {\n throw new Error('SearchView.Content is drawn inside SearchView.')\n }\n\n const { anchor, state } = root\n const messages = useMessages()\n const docked = useWindowSizeClass() !== 'compact'\n const [present, setPresent] = useState(state.isOpen)\n const [input, setInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const close = useCallback(() => {\n state.close()\n }, [state])\n const slots = useMemo<ButtonSlots>(() => ({ close }), [close])\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (state.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, false, anchor)\n\n if (!present) {\n return null\n }\n\n return (\n <Autocomplete<T>\n defaultInputValue={defaultInputValue}\n filter={filter}\n inputValue={inputValue}\n onInputChange={onInputChange}\n >\n <ModalWindow\n isKeyboardDismissDisabled={false}\n label={label}\n labelledBy={undefined}\n onClose={close}\n onScrimPress={state.isOpen ? close : undefined}\n scrim={UNSEEN}\n // Full screen it is shown at once, so the screen reader goes to the\n // input as the window shows; docked, once the view has been placed.\n title={docked ? null : input}\n >\n <ButtonSlotContext value={slots}>\n <SearchViewPanel\n {...props}\n anchor={anchor}\n backLabel={backLabel ?? messages.back}\n clearLabel={clearLabel ?? messages.clearSearch}\n close={close}\n docked={docked}\n isOpen={state.isOpen}\n label={label}\n setInput={setInput}\n setPresent={setPresent}\n />\n </ButtonSlotContext>\n </ModalWindow>\n </Autocomplete>\n )\n}\n\n// The surface, drawn in the `Modal` so the anchored placement measures the\n// layer it is drawn in. Read inside the Autocomplete, whose value the input\n// shows and reports each edit to.\nfunction SearchViewPanel({\n anchor,\n backLabel,\n children,\n clearLabel,\n close,\n docked,\n isOpen,\n label,\n placeholder,\n ref,\n setInput,\n setPresent,\n style,\n ...props\n}: PanelProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, sizing, typography } = theme\n const autocomplete = use(AutocompleteContext)\n const window = useWindowDimensions()\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const keyboardTop = useKeyboardTop()\n const placement = useAnchoredPlacement({ align: 'start', anchor })\n const motion = usePanelMotion(isOpen, !docked || placement.placed, setPresent)\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [input, setOwnInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const [bottom, setBottom] = useState<null | number>(null)\n const header =\n (docked ? sizing.controlLg : FULL_HEADER) +\n typography.bodyLargeLineHeight * (window.fontScale - 1)\n // Full screen, how far the keyboard reaches up over the view. iOS draws it\n // over the window, where Android's `Modal` shrinks the window to make room\n // and leaves it nothing to cover.\n const covered =\n keyboardTop === null || bottom === null ? 0 : bottom - keyboardTop\n\n useFocusOnPlaced(docked && placement.placed, input)\n\n if (autocomplete === null) {\n return null\n }\n\n return (\n <Animated.View\n {...panelRoleOf('dialog', undefined)}\n aria-label={Platform.OS === 'web' ? undefined : label}\n onAccessibilityEscape={close}\n {...props}\n onLayout={docked ? placement.onLayout : measureBottomOf(panel, setBottom)}\n ref={refsOf(setPanel, ref)}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n docked ? styles.docked : styles.full,\n docked ? dockedOf(placement) : fullOf(insets, covered),\n motion,\n style,\n )}\n >\n <View\n style={composeStyles<ViewStyle>(styles.header, minHeightOf(header))}\n >\n <IconButton aria-label={backLabel} slot=\"close\" style={styles.back}>\n <ArrowBackGlyph color={colors.onSurface} />\n </IconButton>\n <FieldInput\n aria-label={label}\n // A search view opens to be typed into, so the input takes the\n // keyboard as it shows rather than leaving it to the back button.\n autoFocus\n onChangeText={autocomplete.setInputValue}\n placeholder={placeholder}\n ref={refsOf(setOwnInput, setInput)}\n returnKeyType=\"search\"\n role=\"searchbox\"\n value={autocomplete.inputValue}\n />\n {autocomplete.inputValue === '' ? null : (\n <IconButton\n aria-label={clearLabel}\n onPress={clearOf(autocomplete, input)}\n style={styles.clear}\n >\n <CloseGlyph />\n </IconButton>\n )}\n </View>\n <View style={styles.divider} />\n <View\n style={docked ? resultsOf(window.height, header) : styles.resultsFull}\n >\n {children}\n </View>\n </Animated.View>\n )\n}\n\nSearchView.Content = SearchViewContent\n\nexport { SearchView, SearchViewContent }\nexport type { SearchViewContentProps, SearchViewProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAMoD,cAAc;AACpB,MAAMC,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,cAAc;AAGpB,MAAMC,SAAoB,EAAEC,SAAS,EAAE;AAEvC,MAAMC,WAAWT,cACd,EAAEU,QAAQC,OAAOC,SAASC,cACzB5C,WAAW6C,OAAO;CAGhBC,MAAM,EACJC,aAAaH,QAAQI,GACvB;CAGAC,OAAO,EACLC,WAAWN,QAAQI,GACrB;CAEAG,SAAS;EACPC,iBAAiBX,OAAOY;EACxBC,YAAY;EACZC,QAAQ;CACV;CACAC,QAAQ;EACNC,cAAcf,MAAMgB;EACpBC,WAAWhB,QAAQiB;CACrB;CACAC,MAAM;EACJC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;CACAC,QAAQ;EACNC,YAAY;EACZC,eAAe;EACff,YAAY;EACZgB,KAAK1B,QAAQ2B;EACbC,mBAAmB5B,QAAQ6B;CAC7B;CAGAC,aAAa,EACXC,MAAM,EACR;CACAC,SAAS;EACPxB,iBAAiBX,OAAOoC;EACxBC,UAAU;CACZ;AACF,CAAC,CACL;AAuEA,MAAMyB,oBAAoB9G,cAAqC,IAAI;AAInE,SAAS+G,QACPC,cACAjB,OACA;CACA,aAAa;EACXiB,aAAaC,cAAc,EAAE;EAC7BlB,OAAOmB,MAAM;CACf;AACF;AAIA,S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1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","HostInstance","StyleProp","TextInput","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","createContext","use","useCallback","useMemo","useRef","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","SafeAreaInsetsContext","useOverlayTriggerState","AutocompleteValue","ButtonSlots","AnchoredPlacement","ResolvedTheme","AutocompleteProps","AutocompleteContext","ButtonSlotContext","FieldInput","ArrowBackGlyph","CloseGlyph","useWindowSizeClass","useMessages","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","useAnchoredPlacement","useKeyboardTop","PANEL_ORIGINS","useFocusOnPlaced","usePanelMotion","useReturnFocus","refsOf","useTheme","composeStyles","themedStyles","Autocomplete","IconButton","FULL_HEADER","MIN_WIDTH","MAX_WIDTH","MIN_RESULTS","UNSEEN","opacity","stylesOf","colors","radii","shadows","spacing","create","back","marginStart","xs","clear","marginEnd","divider","backgroundColor","outline","flexShrink","height","docked","borderRadius","xl","boxShadow","elevation3","full","bottom","left","position","right","top","header","alignItems","flexDirection","gap","sm","paddingHorizontal","lg","resultsFull","flex","surface","surfaceContainerHigh","overflow","PanelProps","Omit","SearchViewContentProps","anchor","backLabel","clearLabel","close","isOpen","setInput","input","setPresent","present","T","children","label","placeholder","ref","style","testID","SearchViewProps","defaultOpen","onOpenChange","SearchViewRoot","state","SearchViewContext","clearOf","autocomplete","setInputValue","focus","dockedOf","placement","transformOrigin","side","width","Math","min","max","anchorWidth","fullOf","insets","covered","paddingBottom","measureBottomOf","panel","setBottom","measureInWindow","_x","y","_width","minHeightOf","minHeight","resultsOf","windowHeight","maxHeight","SearchView","t0","$","_c","t1","t2","open","t3","expanded","t4","default","trigger","slots","t5","root","t6","t7","SearchViewContent","defaultInputValue","filter","inputValue","onInputChange","props","Error","messages","undefined","clearSearch","t8","t9","t10","SearchViewPanel","theme","styles","sizing","typography","window","keyboardTop","align","motion","placed","setPanel","setOwnInput","controlLg","bodyLargeLineHeight","fontScale","Symbol","for","OS","onLayout","T0","onSurface","t11","t12","t13","t14","t15","t16","t17","t18","t19","Content","_c"],"sources":["../../../src/components/search-view/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n HostInstance,\n StyleProp,\n TextInput,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\nimport type { OverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport {\n createContext,\n use,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { AutocompleteValue } from '../../autocomplete'\nimport type { ButtonSlots } from '../../button/slots'\nimport type { AnchoredPlacement } from '../../overlay'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { AutocompleteProps } from '../autocomplete'\n\nimport { AutocompleteContext } from '../../autocomplete'\nimport { ButtonSlotContext } from '../../button/slots'\nimport { FieldInput } from '../../field'\nimport { ArrowBackGlyph, CloseGlyph } from '../../glyphs'\nimport { useWindowSizeClass } from '../../hooks/useWindowSizeClass'\nimport { useMessages } from '../../i18n/provider'\nimport { insetsOf, ModalWindow, NO_INSETS, panelRoleOf } from '../../modal'\nimport { useAnchoredPlacement } from '../../overlay'\nimport { useKeyboardTop } from '../../overlay/keyboard'\nimport {\n PANEL_ORIGINS,\n useFocusOnPlaced,\n usePanelMotion,\n useReturnFocus,\n} from '../../overlay/panel'\nimport { refsOf } from '../../ref'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { Autocomplete } from '../autocomplete'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's SearchView, the search page's search view: what a search opens\n// into. A header holds a back button, the input and a clear button, over a\n// 1dp divider in the outline role, and the results run under it. Both of the\n// page's forms are surface container high, with the input in body large on\n// surface over a supporting text in on surface variant, the back icon in on\n// surface and the clear icon in on surface variant.\n//\n// **Which form is the window's.** In a compact window it is the page's\n// full-screen view: the whole window, square, with a 72dp header, its content\n// inside the safe area while its fill runs on under it. From the medium\n// window up, the docked view: dropped under what opened it, as wide as that\n// and held between the page's 360dp and 720dp, with a 28dp corner, a 56dp\n// header, results at least 240dp tall and the whole view no taller than two\n// thirds of the window, at elevation 3, as web's takes them from Compose's\n// docked search bar. Both headers grow by as much as the input's line does at\n// the device's text size.\n//\n// **Both forms are drawn in a `Modal`**, through src/modal, as web's is a\n// dialog in a modal popover: a screen reader stays inside the view until it\n// closes, and a press outside the docked one lands on a scrim that draws\n// nothing and closes it. The docked one is placed by src/overlay's anchored\n// placement under its trigger, flipped above it where there is no room, and\n// kept above the software keyboard. Full screen, the results stop at the\n// keyboard's top edge, so the last of them can be scrolled into sight above\n// the keys.\n//\n// **It is Autocomplete around the header and the results**, as web's is: the\n// header's input is the autocomplete's field, so a ListBox or a List among\n// the results narrows as it is typed into, says how many rows a search leaves\n// to a screen reader, and takes a press on its first tap while the keyboard\n// is up, as it does anywhere inside an Autocomplete.\n//\n// **The header lines up with the search bar's.** The back button sits where\n// SearchField's magnifier does, its icon 28dp in, and the text starts at\n// 68dp, as the bar's does; the clear button's icon ends 28dp from the end. So\n// a view opened from a bar puts its input where the bar's was.\n//\n// **Focus goes to the input and back.** The input takes the keyboard's focus\n// as the view opens, and a screen reader is sent to it once the view shows,\n// and back to the trigger once it has gone. The back button closes it, as\n// Android's back gesture, VoiceOver's escape gesture and Escape on web do.\n// It fades and scales in and out, as src/overlay's anchored panels do, and\n// at once under reduced motion.\n\n// The page's full-screen header, and the docked view's bounds.\nconst FULL_HEADER = 72\nconst MIN_WIDTH = 360\nconst MAX_WIDTH = 720\nconst MIN_RESULTS = 240\n\n// The docked view's scrim takes presses and draws nothing.\nconst UNSEEN: ViewStyle = { opacity: 0 }\n\nconst stylesOf = themedStyles(\n ({ colors, radii, shadows, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // 4dp in from the header's padding, so the icon inside the 40dp button\n // sits 28dp in, where the search bar draws its magnifier.\n back: {\n marginStart: spacing.xs,\n },\n // 4dp in from the padding, so the icon inside the 40dp button ends 28dp\n // from the end, as the search bar's does.\n clear: {\n marginEnd: spacing.xs,\n },\n // The page's divider under the header, in the outline role.\n divider: {\n backgroundColor: colors.outline,\n flexShrink: 0,\n height: 1,\n },\n docked: {\n borderRadius: radii.xl,\n boxShadow: shadows.elevation3,\n },\n full: {\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n header: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: spacing.sm,\n paddingHorizontal: spacing.lg,\n },\n // Full screen, the results take what the header leaves, and scroll\n // inside it.\n resultsFull: {\n flex: 1,\n },\n surface: {\n backgroundColor: colors.surfaceContainerHigh,\n overflow: 'hidden',\n },\n }),\n)\n\ntype PanelProps = Omit<\n SearchViewContentProps,\n | 'backLabel'\n | 'clearLabel'\n | 'defaultInputValue'\n | 'filter'\n | 'inputValue'\n | 'onInputChange'\n> & {\n readonly anchor: RefObject<HostInstance | null>\n readonly backLabel: string\n readonly clearLabel: string\n readonly close: () => void\n readonly docked: boolean\n readonly isOpen: boolean\n readonly setInput: (input: ComponentRef<typeof TextInput> | null) => void\n readonly setPresent: (present: boolean) => void\n}\n\ntype SearchViewContentProps<T extends object = object> = Omit<\n AutocompleteProps<T>,\n 'children'\n> & {\n /**\n * What the back button is called, for a screen reader. Left out, the\n * library names it in the `I18nProvider`'s locale, or the device's outside\n * one, \"Back\" in English.\n */\n readonly backLabel?: string\n /** The results: a ListBox or a List, which typing narrows. */\n readonly children?: ReactNode\n /**\n * What the clear button is called, for a screen reader. Left out, it is\n * the name React Aria gives web's in the `I18nProvider`'s locale, or the\n * device's outside one, \"Clear search\" in English.\n */\n readonly clearLabel?: string\n /**\n * What is searched, for a screen reader. It names both the view and its\n * input, and is read rather than shown; `placeholder` is what is seen.\n */\n readonly label: string\n /** The supporting text in the empty input, which is what a person reads. */\n readonly placeholder?: string\n readonly ref?: Ref<HostInstance>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype SearchViewProps = {\n /**\n * The Button or IconButton that opens the view, and `SearchView.Content`.\n */\n readonly children?: ReactNode\n /** Whether the view starts open, when it keeps its own state. */\n readonly defaultOpen?: boolean\n /** Whether the view is open, when the call site holds the state. */\n readonly isOpen?: boolean\n /** Called with the new state as the view opens or closes. */\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n// What the content reads from the root: the open state, and the trigger's\n// node, which the docked view is placed under and focus goes back to.\ntype SearchViewRoot = {\n readonly anchor: RefObject<HostInstance | null>\n readonly state: OverlayTriggerState\n}\n\nconst SearchViewContext = createContext<null | SearchViewRoot>(null)\n\n// Empties the input from the clear button, and hands the keyboard back to it,\n// so the next search is typed straight in.\nfunction clearOf(\n autocomplete: AutocompleteValue,\n input: ComponentRef<typeof TextInput> | null,\n) {\n return () => {\n autocomplete.setInputValue('')\n input?.focus()\n }\n}\n\n// The docked view: as wide as what opened it, between the page's bounds,\n// and placed under it.\nfunction dockedOf(placement: AnchoredPlacement): ViewStyle {\n return {\n ...placement.style,\n transformOrigin: PANEL_ORIGINS[placement.side],\n width: Math.min(\n MAX_WIDTH,\n Math.max(MIN_WIDTH, placement.anchorWidth ?? MIN_WIDTH),\n ),\n }\n}\n\n// The full-screen view's content inside the safe area, and above the\n// keyboard where the keyboard reaches further up than the safe area's own\n// bottom inset.\nfunction fullOf(insets: EdgeInsets, covered: number): ViewStyle {\n return {\n ...insetsOf(insets),\n paddingBottom: Math.max(insets.bottom, covered),\n transformOrigin: 'top',\n }\n}\n\n// Where the view's bottom edge is in the window, kept for the keyboard to be\n// measured against.\nfunction measureBottomOf(\n panel: HostInstance | null,\n setBottom: (bottom: number) => void,\n) {\n return () => {\n panel?.measureInWindow((_x, y, _width, height) => {\n setBottom(y + height)\n })\n }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\n// The docked view's results: at least the page's 240dp, and short enough\n// that the view stays within two thirds of the window.\nfunction resultsOf(windowHeight: number, header: number): ViewStyle {\n return {\n maxHeight: (windowHeight * 2) / 3 - header - 1,\n minHeight: MIN_RESULTS,\n }\n}\n\n/**\n * The view a search opens into: full screen in a compact window, docked\n * under what opened it in a wider one. Pass `isOpen` with `onOpenChange` to\n * hold the open state, or `defaultOpen` to let it keep its own.\n *\n * ```tsx\n * <SearchView>\n * <IconButton aria-label=\"Search\">\n * <SearchIcon />\n * </IconButton>\n * <SearchView.Content label=\"Search\" placeholder=\"Search\">\n * <ListBox aria-label=\"Results\">…</ListBox>\n * </SearchView.Content>\n * </SearchView>\n * ```\n *\n * Composed as Popover is: a `Button`, `IconButton` or `Chip` placed directly\n * inside `SearchView` opens the view, and `SearchView.Content` is the view\n * itself.\n */\nfunction SearchView({\n children,\n defaultOpen,\n isOpen,\n onOpenChange,\n}: SearchViewProps) {\n const state = useOverlayTriggerState({ defaultOpen, isOpen, onOpenChange })\n const anchor = useRef<HostInstance>(null)\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: () => {\n state.open()\n },\n trigger: { expanded: state.isOpen, ref: anchor },\n }),\n [state],\n )\n const root = useMemo<SearchViewRoot>(() => ({ anchor, state }), [state])\n\n return (\n <SearchViewContext value={root}>\n <ButtonSlotContext value={slots}>{children}</ButtonSlotContext>\n </SearchViewContext>\n )\n}\n\n/**\n * The view: the header with its back button, input and clear button, and\n * the results under it, inside an Autocomplete, so typing narrows them. What\n * has been typed is the autocomplete's: pass `inputValue` with\n * `onInputChange` to control it, or `defaultInputValue` to let it keep its\n * own, which starts again each time the view opens.\n *\n * `style`, `ref` and `testID` land on the view's surface.\n */\nfunction SearchViewContent<T extends object = object>({\n backLabel,\n clearLabel,\n defaultInputValue,\n filter,\n inputValue,\n label,\n onInputChange,\n ...props\n}: SearchViewContentProps<T>) {\n const root = use(SearchViewContext)\n\n if (root === null) {\n throw new Error('SearchView.Content is drawn inside SearchView.')\n }\n\n const { anchor, state } = root\n const messages = useMessages()\n const docked = useWindowSizeClass() !== 'compact'\n const [present, setPresent] = useState(state.isOpen)\n const [input, setInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const close = useCallback(() => {\n state.close()\n }, [state])\n const slots = useMemo<ButtonSlots>(() => ({ close }), [close])\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (state.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, false, anchor)\n\n if (!present) {\n return null\n }\n\n return (\n <Autocomplete<T>\n defaultInputValue={defaultInputValue}\n filter={filter}\n inputValue={inputValue}\n onInputChange={onInputChange}\n >\n <ModalWindow\n isKeyboardDismissDisabled={false}\n label={label}\n labelledBy={undefined}\n onClose={close}\n onScrimPress={state.isOpen ? close : undefined}\n scrim={UNSEEN}\n // Full screen it is shown at once, so the screen reader goes to the\n // input as the window shows; docked, once the view has been placed.\n title={docked ? null : input}\n >\n <ButtonSlotContext value={slots}>\n <SearchViewPanel\n {...props}\n anchor={anchor}\n backLabel={backLabel ?? messages.back}\n clearLabel={clearLabel ?? messages.clearSearch}\n close={close}\n docked={docked}\n isOpen={state.isOpen}\n label={label}\n setInput={setInput}\n setPresent={setPresent}\n />\n </ButtonSlotContext>\n </ModalWindow>\n </Autocomplete>\n )\n}\n\n// The surface, drawn in the `Modal` so the anchored placement measures the\n// layer it is drawn in. Read inside the Autocomplete, whose value the input\n// shows and reports each edit to.\nfunction SearchViewPanel({\n anchor,\n backLabel,\n children,\n clearLabel,\n close,\n docked,\n isOpen,\n label,\n placeholder,\n ref,\n setInput,\n setPresent,\n style,\n ...props\n}: PanelProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, sizing, typography } = theme\n const autocomplete = use(AutocompleteContext)\n const window = useWindowDimensions()\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const keyboardTop = useKeyboardTop()\n const placement = useAnchoredPlacement({ align: 'start', anchor })\n const motion = usePanelMotion(isOpen, !docked || placement.placed, setPresent)\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [input, setOwnInput] = useState<ComponentRef<typeof TextInput> | null>(\n null,\n )\n const [bottom, setBottom] = useState<null | number>(null)\n const header =\n (docked ? sizing.controlLg : FULL_HEADER) +\n typography.bodyLargeLineHeight * (window.fontScale - 1)\n // Full screen, how far the keyboard reaches up over the view. iOS and\n // Android both draw it over the window, which runs edge to edge and does\n // not shrink to make room, so the view keeps out of its way itself.\n const covered =\n keyboardTop === null || bottom === null ? 0 : bottom - keyboardTop\n\n useFocusOnPlaced(docked && placement.placed, input)\n\n if (autocomplete === null) {\n return null\n }\n\n return (\n <Animated.View\n {...panelRoleOf('dialog', undefined)}\n aria-label={Platform.OS === 'web' ? undefined : label}\n onAccessibilityEscape={close}\n {...props}\n onLayout={docked ? placement.onLayout : measureBottomOf(panel, setBottom)}\n ref={refsOf(setPanel, ref)}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n docked ? styles.docked : styles.full,\n docked ? dockedOf(placement) : fullOf(insets, covered),\n motion,\n style,\n )}\n >\n <View\n style={composeStyles<ViewStyle>(styles.header, minHeightOf(header))}\n >\n <IconButton aria-label={backLabel} slot=\"close\" style={styles.back}>\n <ArrowBackGlyph color={colors.onSurface} />\n </IconButton>\n <FieldInput\n aria-label={label}\n // A search view opens to be typed into, so the input takes the\n // keyboard as it shows rather than leaving it to the back button.\n autoFocus\n onChangeText={autocomplete.setInputValue}\n placeholder={placeholder}\n ref={refsOf(setOwnInput, setInput)}\n returnKeyType=\"search\"\n role=\"searchbox\"\n value={autocomplete.inputValue}\n />\n {autocomplete.inputValue === '' ? null : (\n <IconButton\n aria-label={clearLabel}\n onPress={clearOf(autocomplete, input)}\n style={styles.clear}\n >\n <CloseGlyph />\n </IconButton>\n )}\n </View>\n <View style={styles.divider} />\n <View\n style={docked ? resultsOf(window.height, header) : styles.resultsFull}\n >\n {children}\n </View>\n </Animated.View>\n )\n}\n\nSearchView.Content = SearchViewContent\n\nexport { SearchView, SearchViewContent }\nexport type { SearchViewContentProps, SearchViewProps }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAMoD,cAAc;AACpB,MAAMC,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,cAAc;AAGpB,MAAMC,SAAoB,EAAEC,SAAS,EAAE;AAEvC,MAAMC,WAAWT,cACd,EAAEU,QAAQC,OAAOC,SAASC,cACzB5C,WAAW6C,OAAO;CAGhBC,MAAM,EACJC,aAAaH,QAAQI,GACvB;CAGAC,OAAO,EACLC,WAAWN,QAAQI,GACrB;CAEAG,SAAS;EACPC,iBAAiBX,OAAOY;EACxBC,YAAY;EACZC,QAAQ;CACV;CACAC,QAAQ;EACNC,cAAcf,MAAMgB;EACpBC,WAAWhB,QAAQiB;CACrB;CACAC,MAAM;EACJC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;CACAC,QAAQ;EACNC,YAAY;EACZC,eAAe;EACff,YAAY;EACZgB,KAAK1B,QAAQ2B;EACbC,mBAAmB5B,QAAQ6B;CAC7B;CAGAC,aAAa,EACXC,MAAM,EACR;CACAC,SAAS;EACPxB,iBAAiBX,OAAOoC;EACxBC,UAAU;CACZ;AACF,CAAC,CACL;AAuEA,MAAMyB,oBAAoB9G,cAAqC,IAAI;AAInE,SAAS+G,QACPC,cACAjB,OACA;CACA,aAAa;EACXiB,aAAaC,cAAc,EAAE;EAC7BlB,OAAOmB,MAAM;CACf;AACF;AAIA,SAASC,SAASC,WAAyC;CACzD,OAAO;EACL,GAAGA,UAAUb;EACbc,iBAAiBtF,cAAcqF,UAAUE;EACzCC,OAAOC,KAAKC,IACV9E,WACA6E,KAAKE,IAAIhF,WAAW0E,UAAUO,eAAejF,SAAS,CACxD;CACF;AACF;AAKA,SAASkF,OAAOC,QAAoB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AvD,EAAA;CAAA,IAAAwD;CAAA,IAAAxD,EAAA,QAAA3C,YAAA2C,EAAA,QAAAuD,KAAA;EADvEC,MAAA,oBAAC,MAAD;GACS,OAAAD;GAENlG;EAHE,CAAA;EAIE2C,EAAA,MAAA3C;EAAA2C,EAAA,MAAAuD;EAAAvD,EAAA,MAAAwD;CAAA,OAAAA,MAAAxD,EAAA;CAAA,IAAAyD;CAAA,IAAAzD,EAAA,QAAAlD,SAAAkD,EAAA,QAAAoB,SAAApB,EAAA,QAAAqD,OAAArD,EAAA,QAAAsD,OAAAtD,EAAA,QAAAwD,OAAAxD,EAAA,QAAAG,GAAAxI,QAAAqI,EAAA,QAAAK,MAAAL,EAAA,QAAAO,MAAAP,EAAA,QAAAW,MAAAX,EAAA,QAAAa,MAAAb,EAAA,QAAAc,IAAA;EAhDT2C,MAAA,qBAAA,GAAA,MAAA;GAAA,GACMpD;GACQ,cAAAE;GACWzD,uBAAAA;GAAK,GACxBsE;GACM,UAAAT;GACL,KAAAE;GACE,OAAAC;GAPT,UAAA;IAeEuC;IA4BAC;IACAE;GAKF;;EAAgBxD,EAAA,MAAAlD;EAAAkD,EAAA,MAAAoB;EAAApB,EAAA,MAAAqD;EAAArD,EAAA,MAAAsD;EAAAtD,EAAA,MAAAwD;EAAAxD,EAAA,MAAAG,GAAAxI;EAAAqI,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAW;EAAAX,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAyD;CAAA,OAAAA,MAAAzD,EAAA;CAAA,OAjDhByD;AAiDgB;AAIpB3D,WAAW4D,UAAU3C"}
@@ -2,6 +2,7 @@ import { ButtonSlotContext } from "../../button/slots.js";
2
2
  import { useWindowSizeClass } from "../../hooks/useWindowSizeClass.js";
3
3
  import { useMessages } from "../../i18n/provider.js";
4
4
  import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, useModalState, useModalTrigger } from "../../modal/index.js";
5
+ import { useKeyboardInset } from "../../overlay/keyboard.js";
5
6
  import { usePressFeedback } from "../../press/index.js";
6
7
  import { refsOf } from "../../ref/index.js";
7
8
  import { useTheme } from "../../theme/scope.js";
@@ -107,10 +108,11 @@ const stylesOf = themedStyles(({ colors, radii, shadows, spacing }) => StyleShee
107
108
  }));
108
109
  const SheetLayoutContext = createContext(null);
109
110
  const SheetTriggerContext = createContext(null);
110
- function bottomBoundsOf(insets, height) {
111
+ function bottomBoundsOf(insets, height, keyboard) {
111
112
  return {
112
113
  ...insetsOf(insets),
113
114
  maxHeight: height - Math.max(TOP_MARGIN, insets.top),
115
+ paddingBottom: Math.max(insets.bottom, keyboard),
114
116
  paddingTop: 0
115
117
  };
116
118
  }
@@ -647,6 +649,7 @@ function SheetWindow(t0) {
647
649
  const insets = use(SafeAreaInsetsContext) ?? NO_INSETS;
648
650
  const { height } = useWindowDimensions();
649
651
  const bottom = useWindowSizeClass() === "compact";
652
+ const keyboard = useKeyboardInset();
650
653
  const titleId = useId();
651
654
  const [title, setTitle] = useState(null);
652
655
  const [full, setFull] = useState(null);
@@ -662,7 +665,7 @@ function SheetWindow(t0) {
662
665
  } else t2 = $[17];
663
666
  const stops = t2;
664
667
  const twoHeights = stops.partial !== null;
665
- const rest = stops.partial !== null && !expanded ? stops.partial : 0;
668
+ const rest = stops.partial !== null && !expanded && keyboard === 0 ? stops.partial : 0;
666
669
  let t3;
667
670
  if ($[18] !== bottom || $[19] !== full || $[20] !== isOpen || $[21] !== rest || $[22] !== setPresent) {
668
671
  t3 = {
@@ -760,7 +763,7 @@ function SheetWindow(t0) {
760
763
  $[44] = t15;
761
764
  } else t15 = $[44];
762
765
  const t16 = isKeyboardDismissDisabled ? void 0 : close;
763
- const t17 = composeStyles(styles.container, bottom ? styles.containerBottom : styles.containerSide, bottom ? bottomBoundsOf(insets, height) : sideInsetsOf(insets), motion.panel, style);
766
+ const t17 = composeStyles(styles.container, bottom ? styles.containerBottom : styles.containerSide, bottom ? bottomBoundsOf(insets, height, keyboard) : sideInsetsOf(insets, keyboard), motion.panel, style);
764
767
  let t18;
765
768
  if ($[45] !== children || $[46] !== slots) {
766
769
  t18 = /* @__PURE__ */ jsx(ButtonSlotContext, {
@@ -850,9 +853,10 @@ function SheetWindow(t0) {
850
853
  function _temp(was) {
851
854
  return !was;
852
855
  }
853
- function sideInsetsOf(insets) {
856
+ function sideInsetsOf(insets, keyboard) {
854
857
  return {
855
858
  ...insetsOf(insets),
859
+ paddingBottom: Math.max(insets.bottom, keyboard),
856
860
  paddingStart: 0
857
861
  };
858
862
  }