@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/autocomplete/index.js +39 -0
  2. package/dist/autocomplete/index.js.map +1 -0
  3. package/dist/button/index.d.ts +2 -1
  4. package/dist/button/index.js +35 -2
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/pending.js +1 -1
  7. package/dist/button/slots.d.ts +2 -0
  8. package/dist/button/slots.js.map +1 -1
  9. package/dist/chip/index.js +1 -1
  10. package/dist/components/autocomplete/index.d.ts +49 -0
  11. package/dist/components/autocomplete/index.js +87 -0
  12. package/dist/components/autocomplete/index.js.map +1 -0
  13. package/dist/components/avatar/index.d.ts +1 -1
  14. package/dist/components/button/index.d.ts +2 -2
  15. package/dist/components/button/index.js +196 -150
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/card/index.d.ts +1 -1
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/checkbox/index.d.ts +1 -1
  20. package/dist/components/checkbox/index.js +106 -193
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/chip/index.d.ts +1 -1
  23. package/dist/components/chip-group/index.d.ts +1 -1
  24. package/dist/components/chip-group/index.js +1 -1
  25. package/dist/components/copy-field/index.d.ts +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +1 -1
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/dialog/index.d.ts +3 -2
  30. package/dist/components/dialog/index.js +105 -242
  31. package/dist/components/dialog/index.js.map +1 -1
  32. package/dist/components/icon-button/index.d.ts +2 -2
  33. package/dist/components/icon-button/index.js +205 -159
  34. package/dist/components/icon-button/index.js.map +1 -1
  35. package/dist/components/link/index.d.ts +1 -1
  36. package/dist/components/link/index.js +1 -1
  37. package/dist/components/list/index.d.ts +216 -0
  38. package/dist/components/list/index.js +1118 -0
  39. package/dist/components/list/index.js.map +1 -0
  40. package/dist/components/list-item/index.d.ts +63 -0
  41. package/dist/components/list-item/index.js +275 -0
  42. package/dist/components/list-item/index.js.map +1 -0
  43. package/dist/components/menu/index.d.ts +309 -0
  44. package/dist/components/menu/index.js +1283 -0
  45. package/dist/components/menu/index.js.map +1 -0
  46. package/dist/components/meter/index.d.ts +1 -1
  47. package/dist/components/meter/index.js +1 -1
  48. package/dist/components/number-field/index.d.ts +1 -1
  49. package/dist/components/number-field/index.js +2 -2
  50. package/dist/components/popover/index.d.ts +140 -0
  51. package/dist/components/popover/index.js +704 -0
  52. package/dist/components/popover/index.js.map +1 -0
  53. package/dist/components/product-icon/index.d.ts +1 -1
  54. package/dist/components/progress-indicator/index.d.ts +1 -1
  55. package/dist/components/progress-indicator/index.js +1 -1
  56. package/dist/components/radio-group/index.d.ts +1 -1
  57. package/dist/components/radio-group/index.js +1 -1
  58. package/dist/components/search-field/index.d.ts +12 -4
  59. package/dist/components/search-field/index.js +64 -58
  60. package/dist/components/search-field/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +1 -1
  62. package/dist/components/segmented-button/index.js +1 -1
  63. package/dist/components/separator/index.d.ts +1 -1
  64. package/dist/components/separator/index.js +1 -1
  65. package/dist/components/sheet/index.d.ts +137 -0
  66. package/dist/components/sheet/index.js +1091 -0
  67. package/dist/components/sheet/index.js.map +1 -0
  68. package/dist/components/snackbar/index.d.ts +1 -1
  69. package/dist/components/snackbar/index.js +1 -1
  70. package/dist/components/stack/index.d.ts +1 -1
  71. package/dist/components/stack/index.js +1 -1
  72. package/dist/components/switch/index.d.ts +1 -1
  73. package/dist/components/switch/index.js +1 -1
  74. package/dist/components/switch/index.js.map +1 -1
  75. package/dist/components/text/index.d.ts +1 -1
  76. package/dist/components/text/index.js +1 -1
  77. package/dist/components/text-field/index.d.ts +1 -1
  78. package/dist/components/text-field/index.js +1 -1
  79. package/dist/control/checkbox-box.js +137 -0
  80. package/dist/control/checkbox-box.js.map +1 -0
  81. package/dist/control/index.js +1 -1
  82. package/dist/field/index.d.ts +1 -1
  83. package/dist/field/index.js +1 -1
  84. package/dist/form/index.d.ts +1 -1
  85. package/dist/glyphs/index.js +21 -2
  86. package/dist/glyphs/index.js.map +1 -1
  87. package/dist/i18n/index.js +16 -1
  88. package/dist/i18n/index.js.map +1 -1
  89. package/dist/i18n/messages.js +374 -34
  90. package/dist/i18n/messages.js.map +1 -1
  91. package/dist/index.d.ts +7 -1
  92. package/dist/index.js +8 -2
  93. package/dist/indicator/index.d.ts +1 -1
  94. package/dist/indicator/index.js +2 -2
  95. package/dist/mark/index.d.ts +1 -1
  96. package/dist/mark/index.js +1 -1
  97. package/dist/modal/index.d.ts +16 -0
  98. package/dist/modal/index.js +277 -0
  99. package/dist/modal/index.js.map +1 -0
  100. package/dist/overlay/anchored.d.ts +2 -0
  101. package/dist/overlay/anchored.js +182 -0
  102. package/dist/overlay/anchored.js.map +1 -0
  103. package/dist/overlay/host.d.ts +2 -0
  104. package/dist/overlay/host.js +1 -1
  105. package/dist/overlay/index.d.ts +4 -0
  106. package/dist/overlay/panel.js +215 -0
  107. package/dist/overlay/panel.js.map +1 -0
  108. package/dist/overlay/placement.d.ts +8 -0
  109. package/dist/overlay/placement.js +87 -0
  110. package/dist/overlay/placement.js.map +1 -0
  111. package/dist/press/index.js +1 -1
  112. package/dist/ref/index.js +15 -0
  113. package/dist/ref/index.js.map +1 -0
  114. package/dist/router/index.js +1 -1
  115. package/dist/row/index.js +158 -0
  116. package/dist/row/index.js.map +1 -0
  117. package/dist/row/styles.js +51 -0
  118. package/dist/row/styles.js.map +1 -0
  119. package/dist/theme/scope.js +1 -1
  120. package/dist/theme-scope.d.ts +1 -1
  121. package/dist/theme-scope.js +1 -1
  122. package/dist/typography/fonts.js +1 -1
  123. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Autocomplete, AutocompleteFilter, AutocompleteProps } from "./components/autocomplete/index.js";
1
2
  import { Avatar, AvatarProps } from "./components/avatar/index.js";
2
3
  import { Button, ButtonProps, ButtonShape, ButtonSize, ButtonVariant } from "./components/button/index.js";
3
4
  import { Card, CardProps, CardVariant } from "./components/card/index.js";
@@ -10,15 +11,20 @@ import { Dialog, DialogBody, DialogBodyProps, DialogContent, DialogContentProps,
10
11
  import { Form, FormHandle, FormProps } from "./components/form/index.js";
11
12
  import { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from "./components/icon-button/index.js";
12
13
  import { Link, LinkProps, LinkTone, LinkUnderline } from "./components/link/index.js";
14
+ import { List, ListLoadMore, ListLoadMoreProps, ListProps, ListRow, ListRowProps, ListSection, ListSectionProps } from "./components/list/index.js";
15
+ import { ListItem, ListItemProps } from "./components/list-item/index.js";
16
+ import { Menu, MenuAlign, MenuContent, MenuContentProps, MenuItem, MenuItemProps, MenuLoadMore, MenuLoadMoreProps, MenuProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSide, MenuSubmenu, MenuSubmenuProps, MenuTrigger } from "./components/menu/index.js";
13
17
  import { Meter, MeterProps, MeterTone } from "./components/meter/index.js";
14
18
  import { FieldVariant } from "./field/index.js";
15
19
  import { NumberField, NumberFieldProps } from "./components/number-field/index.js";
20
+ import { Popover, PopoverAlign, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitle, PopoverTitleProps, PopoverTrigger } from "./components/popover/index.js";
16
21
  import { ProductIcon, ProductIconProps } from "./components/product-icon/index.js";
17
22
  import { ProgressIndicator, ProgressIndicatorProps, ProgressIndicatorShape, ProgressIndicatorTone, ProgressIndicatorVariant } from "./components/progress-indicator/index.js";
18
23
  import { Radio, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioProps } from "./components/radio-group/index.js";
19
24
  import { SearchField, SearchFieldProps } from "./components/search-field/index.js";
20
25
  import { SegmentedButton, SegmentedButtonProps, SegmentedButtonSegment, SegmentedButtonSegmentProps } from "./components/segmented-button/index.js";
21
26
  import { Separator, SeparatorInset, SeparatorProps } from "./components/separator/index.js";
27
+ import { Sheet, SheetBody, SheetBodyProps, SheetContent, SheetContentProps, SheetFooter, SheetHandle, SheetHandleProps, SheetHeader, SheetPartProps, SheetProps, SheetTitle, SheetTitleProps } from "./components/sheet/index.js";
22
28
  import { Snackbar, SnackbarAction, SnackbarOptions, SnackbarProps, SnackbarQueue } from "./components/snackbar/index.js";
23
29
  import { Stack, StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
24
30
  import { Switch, SwitchProps } from "./components/switch/index.js";
@@ -32,4 +38,4 @@ import { RouterProvider, RouterProviderProps } from "./router/index.js";
32
38
  import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
33
39
  import { ResolvedTheme, useTheme } from "./theme/scope.js";
34
40
  import { Key, Selection } from "react-stately";
35
- export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
41
+ export { Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, type MenuTrigger, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Sheet, SheetBody, type SheetBodyProps, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, type SheetHandleProps, SheetHeader, type SheetPartProps, type SheetProps, SheetTitle, type SheetTitleProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { Autocomplete } from "./components/autocomplete/index.js";
1
2
  import { useIconStyle } from "./glyphs/icon-style.js";
2
3
  import { useTheme } from "./theme/scope.js";
3
4
  import { Avatar } from "./components/avatar/index.js";
@@ -16,16 +17,21 @@ import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTi
16
17
  import { Form } from "./components/form/index.js";
17
18
  import { IconButton } from "./components/icon-button/index.js";
18
19
  import { Link } from "./components/link/index.js";
20
+ import { List, ListLoadMore, ListRow, ListSection } from "./components/list/index.js";
21
+ import { ListItem } from "./components/list-item/index.js";
22
+ import { Separator } from "./components/separator/index.js";
23
+ import { Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu } from "./components/menu/index.js";
19
24
  import { Meter } from "./components/meter/index.js";
20
25
  import { NumberField } from "./components/number-field/index.js";
26
+ import { Popover, PopoverContent, PopoverDescription, PopoverTitle } from "./components/popover/index.js";
21
27
  import { ProductIcon } from "./components/product-icon/index.js";
22
28
  import { Radio, RadioGroup } from "./components/radio-group/index.js";
23
29
  import { SearchField } from "./components/search-field/index.js";
24
30
  import { SegmentedButton, SegmentedButtonSegment } from "./components/segmented-button/index.js";
25
- import { Separator } from "./components/separator/index.js";
31
+ import { Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle } from "./components/sheet/index.js";
26
32
  import { Snackbar } from "./components/snackbar/index.js";
27
33
  import { Stack } from "./components/stack/index.js";
28
34
  import { Switch } from "./components/switch/index.js";
29
35
  import { TextField } from "./components/text-field/index.js";
30
36
  import { ThemeScope } from "./theme-scope.js";
31
- export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
37
+ export { Autocomplete, Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, IconButton, Link, List, ListItem, ListLoadMore, ListRow, ListSection, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
@@ -1,5 +1,5 @@
1
- import "react-native";
2
1
  import { ReactNode } from "react";
2
+ import "react-native";
3
3
  import "react-native-reanimated";
4
4
  //#region src/indicator/index.d.ts
5
5
  /**
@@ -1,14 +1,14 @@
1
+ import { localeOf } from "../number/locale.js";
1
2
  import { useIconStyle } from "../glyphs/icon-style.js";
2
3
  import { useTheme } from "../theme/scope.js";
3
4
  import { composeStyles } from "../theme/styles.js";
4
5
  import { withOpacity } from "../theme/color.js";
5
6
  import { Text as Text$1 } from "../components/text/index.js";
6
- import { localeOf } from "../number/locale.js";
7
7
  import { styles, stylesOf } from "./styles.js";
8
8
  import { c } from "react/compiler-runtime";
9
- import { View } from "react-native";
10
9
  import { useEffect, useState } from "react";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { View } from "react-native";
12
12
  import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
13
13
  import { NumberFormatter } from "@internationalized/number";
14
14
  //#region src/indicator/index.tsx
@@ -1,6 +1,6 @@
1
1
  import "./styles.js";
2
- import { ImageProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
2
  import { ComponentRef, Ref } from "react";
3
+ import { ImageProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
4
4
  //#region src/mark/index.d.ts
5
5
  /** The native props a picture's own `Image` takes, as Avatar and ProductIcon take them. */
6
6
  type MarkImageProps = Pick<ImageProps, 'crossOrigin' | 'fadeDuration' | 'progressiveRenderingEnabled' | 'referrerPolicy' | 'resizeMethod'>;
@@ -6,8 +6,8 @@ import { useImageLoadingStatus } from "./image.js";
6
6
  import { initialOfThing, initialsOfPerson } from "./initials.js";
7
7
  import { DIAMETERS, GLYPH_SHARE, initialsStylesOf, markStyles, markStylesOf } from "./styles.js";
8
8
  import { c } from "react/compiler-runtime";
9
- import { Image, Text, View } from "react-native";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { Image, Text, View } from "react-native";
11
11
  //#region src/mark/index.tsx
12
12
  const KINDS = {
13
13
  person: {
@@ -0,0 +1,16 @@
1
+ import "../button/slots.js";
2
+ import { ReactNode } from "react";
3
+ import { HostInstance, ViewProps, ViewStyle } from "react-native";
4
+ import "react-native-reanimated";
5
+ import "react-native-safe-area-context";
6
+ import "react-stately/useOverlayTriggerState";
7
+ //#region src/modal/index.d.ts
8
+ /** Whether a modal surface is open, and who holds that state. */
9
+ type ModalOpenProps = {
10
+ readonly defaultOpen?: boolean;
11
+ readonly isOpen?: boolean;
12
+ readonly onOpenChange?: (isOpen: boolean) => void;
13
+ };
14
+ //#endregion
15
+ export type { ModalOpenProps };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,277 @@
1
+ import { useTheme } from "../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../theme/styles.js";
3
+ import { ButtonSlotContext } from "../button/slots.js";
4
+ import { AnimatedPressable } from "../button/index.js";
5
+ import { withOpacity } from "../theme/color.js";
6
+ import { OverlayHost } from "../overlay/host.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { useEffect, useRef, useState } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { AccessibilityInfo, I18nManager, Modal, Platform, StyleSheet } from "react-native";
11
+ import { useOverlayTriggerState } from "react-stately/useOverlayTriggerState";
12
+ //#region src/modal/index.tsx
13
+ const NO_INSETS = {
14
+ bottom: 0,
15
+ left: 0,
16
+ right: 0,
17
+ top: 0
18
+ };
19
+ const ORIENTATIONS = [
20
+ "portrait",
21
+ "portrait-upside-down",
22
+ "landscape",
23
+ "landscape-left",
24
+ "landscape-right"
25
+ ];
26
+ const SCRIM_OPACITY = .32;
27
+ const stylesOf = themedStyles(({ colors }) => StyleSheet.create({ scrim: {
28
+ backgroundColor: withOpacity(colors.scrim, SCRIM_OPACITY),
29
+ bottom: 0,
30
+ left: 0,
31
+ position: "absolute",
32
+ right: 0,
33
+ top: 0
34
+ } }));
35
+ function focusOf(title) {
36
+ return () => {
37
+ if (title !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(title, "focus");
38
+ };
39
+ }
40
+ function ignore() {}
41
+ function insetsOf(insets) {
42
+ const rtl = I18nManager.isRTL;
43
+ return {
44
+ paddingBottom: insets.bottom,
45
+ paddingEnd: rtl ? insets.left : insets.right,
46
+ paddingStart: rtl ? insets.right : insets.left,
47
+ paddingTop: insets.top
48
+ };
49
+ }
50
+ /**
51
+ * The window a modal surface is drawn in: the `Modal`, the overlays it hosts,
52
+ * and the scrim, with the surface itself as its children.
53
+ */
54
+ function ModalWindow(t0) {
55
+ const $ = c(20);
56
+ const { children, isKeyboardDismissDisabled, labelledBy, onClose, onScrimPress, scrim, title } = t0;
57
+ const styles = stylesOf(useTheme());
58
+ const T0 = Modal;
59
+ const t1 = "none";
60
+ const t2 = Platform.OS === "web" ? labelledBy : void 0;
61
+ const t3 = true;
62
+ const t4 = isKeyboardDismissDisabled ? ignore : onClose;
63
+ let t5;
64
+ if ($[0] !== title) {
65
+ t5 = focusOf(title);
66
+ $[0] = title;
67
+ $[1] = t5;
68
+ } else t5 = $[1];
69
+ const t6 = true;
70
+ const t7 = ORIENTATIONS;
71
+ const t8 = true;
72
+ const t9 = true;
73
+ const T1 = ButtonSlotContext;
74
+ const t10 = null;
75
+ const T2 = OverlayHost;
76
+ const T3 = AnimatedPressable;
77
+ const t11 = false;
78
+ const t12 = true;
79
+ const t13 = false;
80
+ const t14 = composeStyles(styles.scrim, scrim);
81
+ let t15;
82
+ if ($[2] !== T3 || $[3] !== onScrimPress || $[4] !== t14) {
83
+ t15 = /* @__PURE__ */ jsx(T3, {
84
+ accessible: t11,
85
+ "aria-hidden": t12,
86
+ focusable: t13,
87
+ onPress: onScrimPress,
88
+ style: t14,
89
+ tabIndex: -1
90
+ });
91
+ $[2] = T3;
92
+ $[3] = onScrimPress;
93
+ $[4] = t14;
94
+ $[5] = t15;
95
+ } else t15 = $[5];
96
+ let t16;
97
+ if ($[6] !== T2 || $[7] !== children || $[8] !== t15) {
98
+ t16 = /* @__PURE__ */ jsxs(T2, { children: [t15, children] });
99
+ $[6] = T2;
100
+ $[7] = children;
101
+ $[8] = t15;
102
+ $[9] = t16;
103
+ } else t16 = $[9];
104
+ let t17;
105
+ if ($[10] !== T1 || $[11] !== t16) {
106
+ t17 = /* @__PURE__ */ jsx(T1, {
107
+ value: t10,
108
+ children: t16
109
+ });
110
+ $[10] = T1;
111
+ $[11] = t16;
112
+ $[12] = t17;
113
+ } else t17 = $[12];
114
+ let t18;
115
+ if ($[13] !== T0 || $[14] !== t17 || $[15] !== t2 || $[16] !== t4 || $[17] !== t5 || $[18] !== t7) {
116
+ t18 = /* @__PURE__ */ jsx(T0, {
117
+ animationType: t1,
118
+ "aria-labelledby": t2,
119
+ navigationBarTranslucent: t3,
120
+ onRequestClose: t4,
121
+ onShow: t5,
122
+ statusBarTranslucent: t6,
123
+ supportedOrientations: t7,
124
+ transparent: t8,
125
+ visible: t9,
126
+ children: t17
127
+ });
128
+ $[13] = T0;
129
+ $[14] = t17;
130
+ $[15] = t2;
131
+ $[16] = t4;
132
+ $[17] = t5;
133
+ $[18] = t7;
134
+ $[19] = t18;
135
+ } else t18 = $[19];
136
+ return t18;
137
+ }
138
+ function panelRoleOf(role, labelledBy) {
139
+ if (Platform.OS === "web") return {};
140
+ return {
141
+ "aria-labelledby": labelledBy,
142
+ "aria-modal": true,
143
+ role
144
+ };
145
+ }
146
+ function registerOf(setParts) {
147
+ return (part) => {
148
+ setParts((parts) => ({
149
+ ...parts,
150
+ [part]: parts[part] + 1
151
+ }));
152
+ return () => {
153
+ setParts((parts) => ({
154
+ ...parts,
155
+ [part]: parts[part] - 1
156
+ }));
157
+ };
158
+ };
159
+ }
160
+ /**
161
+ * The open state a surface's content part reads: its trigger's, inside one,
162
+ * and its own otherwise. `present` stays true from the moment it opens until
163
+ * the call site's exit has run and set it false, and the close slot and the
164
+ * scrim close it through `close`.
165
+ */
166
+ function useModalState(outer, props) {
167
+ const $ = c(9);
168
+ const own = useOverlayTriggerState(props);
169
+ const state = outer?.state ?? own;
170
+ const [present, setPresent] = useState(state.isOpen);
171
+ let t0;
172
+ if ($[0] !== state) {
173
+ t0 = () => {
174
+ state.close();
175
+ };
176
+ $[0] = state;
177
+ $[1] = t0;
178
+ } else t0 = $[1];
179
+ const close = t0;
180
+ let t1;
181
+ if ($[2] !== close) {
182
+ t1 = { close };
183
+ $[2] = close;
184
+ $[3] = t1;
185
+ } else t1 = $[3];
186
+ const slots = t1;
187
+ if (state.isOpen && !present) setPresent(true);
188
+ useReturnFocus(present, outer);
189
+ let t2;
190
+ if ($[4] !== close || $[5] !== present || $[6] !== slots || $[7] !== state) {
191
+ t2 = {
192
+ close,
193
+ present,
194
+ setPresent,
195
+ slots,
196
+ state
197
+ };
198
+ $[4] = close;
199
+ $[5] = present;
200
+ $[6] = slots;
201
+ $[7] = state;
202
+ $[8] = t2;
203
+ } else t2 = $[8];
204
+ return t2;
205
+ }
206
+ /**
207
+ * The open state a surface's trigger part holds, and the default slot a
208
+ * button inside it fills: it records itself as the button focus returns to,
209
+ * and opens the surface. React Native types the target as a bare view tag
210
+ * too, which focus cannot be sent to, so such a press records nothing.
211
+ */
212
+ function useModalTrigger(props) {
213
+ const $ = c(8);
214
+ const state = useOverlayTriggerState(props);
215
+ const [trigger, setTrigger] = useState(null);
216
+ let t0;
217
+ if ($[0] !== state || $[1] !== trigger) {
218
+ t0 = {
219
+ state,
220
+ trigger
221
+ };
222
+ $[0] = state;
223
+ $[1] = trigger;
224
+ $[2] = t0;
225
+ } else t0 = $[2];
226
+ const context = t0;
227
+ let t1;
228
+ if ($[3] !== state) {
229
+ t1 = { default: (event) => {
230
+ const target = event.currentTarget;
231
+ setTrigger(typeof target === "number" ? null : target);
232
+ state.open();
233
+ } };
234
+ $[3] = state;
235
+ $[4] = t1;
236
+ } else t1 = $[4];
237
+ const slots = t1;
238
+ let t2;
239
+ if ($[5] !== context || $[6] !== slots) {
240
+ t2 = {
241
+ context,
242
+ slots
243
+ };
244
+ $[5] = context;
245
+ $[6] = slots;
246
+ $[7] = t2;
247
+ } else t2 = $[7];
248
+ return t2;
249
+ }
250
+ function useReturnFocus(present, outer) {
251
+ const $ = c(6);
252
+ const shown = useRef(present);
253
+ let t0;
254
+ if ($[0] !== outer?.trigger || $[1] !== present) {
255
+ t0 = () => {
256
+ const trigger = outer?.trigger ?? null;
257
+ const gone = shown.current && !present;
258
+ shown.current = present;
259
+ if (gone && trigger !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(trigger, "focus");
260
+ };
261
+ $[0] = outer?.trigger;
262
+ $[1] = present;
263
+ $[2] = t0;
264
+ } else t0 = $[2];
265
+ let t1;
266
+ if ($[3] !== outer || $[4] !== present) {
267
+ t1 = [outer, present];
268
+ $[3] = outer;
269
+ $[4] = present;
270
+ $[5] = t1;
271
+ } else t1 = $[5];
272
+ useEffect(t0, t1);
273
+ }
274
+ //#endregion
275
+ export { ModalWindow, NO_INSETS, insetsOf, panelRoleOf, registerOf, useModalState, useModalTrigger };
276
+
277
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","GestureResponderEvent","HostInstance","ModalProps","ViewProps","ViewStyle","AnimatedStyle","EdgeInsets","OverlayTriggerState","useCallback","useEffect","useMemo","useRef","useState","AccessibilityInfo","I18nManager","Modal","Platform","StyleSheet","useOverlayTriggerState","ButtonSlots","ResolvedTheme","AnimatedPressable","ButtonSlotContext","OverlayHost","withOpacity","useTheme","composeStyles","themedStyles","NO_INSETS","bottom","left","right","top","ORIENTATIONS","SCRIM_OPACITY","stylesOf","colors","create","scrim","backgroundColor","position","ModalOpenProps","defaultOpen","isOpen","onOpenChange","ModalTrigger","state","trigger","ModalWindowProps","children","isKeyboardDismissDisabled","labelledBy","onClose","onScrimPress","title","focusOf","OS","sendAccessibilityEvent","ignore","insetsOf","insets","rtl","isRTL","paddingBottom","paddingEnd","paddingStart","paddingTop","ModalWindow","t0","$","_c","styles","T0","t1","t2","undefined","t3","t4","t5","t6","t8","t9","T1","t10","T2","T3","t11","t12","t13","t14","t15","t16","t17","t18","t7","panelRoleOf","role","Pick","registerOf","setParts","update","parts","Readonly","Record","Part","part","useModalState","outer","props","own","present","setPresent","close","slots","useReturnFocus","useModalTrigger","setTrigger","context","default","event","target","currentTarget","open","shown","gone","current","_c"],"sources":["../../src/modal/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type {\n GestureResponderEvent,\n HostInstance,\n ModalProps,\n ViewProps,\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 { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n AccessibilityInfo,\n I18nManager,\n Modal,\n Platform,\n StyleSheet,\n} from 'react-native'\nimport { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'\n\nimport type { ButtonSlots } from '../button/slots'\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { AnimatedPressable } from '../button'\nimport { ButtonSlotContext } from '../button/slots'\nimport { OverlayHost } from '../overlay'\nimport { withOpacity } from '../theme/color'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles, themedStyles } from '../theme/styles'\n\n// The window a modal surface is drawn in, and what a dialog and a sheet share\n// around it: the trigger that opens it, the open state, the scrim, and where\n// focus goes as it shows and once it has gone. Internal: nothing here is\n// exported from the package.\n//\n// **It is a React Native `Modal`**, which keeps React context, so the surface\n// keeps the `ThemeScope` around it, and which is a window of its own on iOS\n// and Android, above the screen and its overlays. The window therefore hosts\n// overlays of its own, so a snackbar or a popover raised from inside it draws\n// above it rather than under it.\n\n// Outside a SafeAreaProvider the insets are unknown, and the window's own edge\n// is the best bound there is.\nconst NO_INSETS: EdgeInsets = { bottom: 0, left: 0, right: 0, top: 0 }\n\n// iOS presents a `Modal` in portrait alone unless told otherwise, which would\n// turn an app held sideways round as the surface opened.\nconst ORIENTATIONS: ModalProps['supportedOrientations'] = [\n 'portrait',\n 'portrait-upside-down',\n 'landscape',\n 'landscape-left',\n 'landscape-right',\n]\n\n// The scrim is the scrim role at 32%, the opacity Material Design gives a\n// modal's scrim and web mixes in.\nconst SCRIM_OPACITY = 0.32\n\nconst stylesOf = themedStyles(({ colors }: ResolvedTheme) =>\n StyleSheet.create({\n scrim: {\n backgroundColor: withOpacity(colors.scrim, SCRIM_OPACITY),\n bottom: 0,\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n }),\n)\n\n/** Whether a modal surface is open, and who holds that state. */\ntype ModalOpenProps = {\n readonly defaultOpen?: boolean\n readonly isOpen?: boolean\n readonly onOpenChange?: (isOpen: boolean) => void\n}\n\n/**\n * What a surface's trigger part hands its content: the open state, and the\n * button that last opened it, for focus to return to.\n */\ntype ModalTrigger = {\n readonly state: OverlayTriggerState\n readonly trigger: HostInstance | null\n}\n\ntype ModalWindowProps = {\n readonly children?: ReactNode\n /** Whether Android's back gesture and Escape on web leave it open. */\n readonly isKeyboardDismissDisabled: boolean\n /** The headline's id, which names the window on web. */\n readonly labelledBy: string | undefined\n /** What the back gesture and Escape call. */\n readonly onClose: () => void\n /** What a press on the scrim calls, or nothing where it closes nothing. */\n readonly onScrimPress: (() => void) | undefined\n /** The scrim's motion. */\n readonly scrim: AnimatedStyle<ViewStyle>\n /** The headline, which a screen reader is sent to once the window shows. */\n readonly title: HostInstance | null\n}\n\n// Sends the screen reader to the headline once the window has shown. React\n// Native Web's `Modal` moves focus into itself.\nfunction focusOf(title: HostInstance | null) {\n return () => {\n if (title !== null && Platform.OS !== 'web') {\n AccessibilityInfo.sendAccessibilityEvent(title, 'focus')\n }\n }\n}\n\n// What the back gesture does on a surface it may not close: nothing, rather\n// than leaving the handler out, which Android warns about.\nfunction ignore() {}\n\n// The safe area as padding. The insets are physical edges, and React Native\n// swaps a left and a right style under a right-to-left layout, so they are\n// handed over as the start and end they are in the direction the layout runs.\nfunction insetsOf(insets: EdgeInsets): ViewStyle {\n const rtl = I18nManager.isRTL\n\n return {\n paddingBottom: insets.bottom,\n paddingEnd: rtl ? insets.left : insets.right,\n paddingStart: rtl ? insets.right : insets.left,\n paddingTop: insets.top,\n }\n}\n\n/**\n * The window a modal surface is drawn in: the `Modal`, the overlays it hosts,\n * and the scrim, with the surface itself as its children.\n */\nfunction ModalWindow({\n children,\n isKeyboardDismissDisabled,\n labelledBy,\n onClose,\n onScrimPress,\n scrim,\n title,\n}: ModalWindowProps) {\n const styles = stylesOf(useTheme())\n\n return (\n <Modal\n animationType=\"none\"\n aria-labelledby={Platform.OS === 'web' ? labelledBy : undefined}\n navigationBarTranslucent\n onRequestClose={isKeyboardDismissDisabled ? ignore : onClose}\n onShow={focusOf(title)}\n statusBarTranslucent\n supportedOrientations={ORIENTATIONS}\n transparent\n visible\n >\n {/* Nothing in the window takes the trigger's slot, the overlays it\n hosts included, so a button in a snackbar raised from the surface\n opens nothing; only the surface's buttons take the close slot. */}\n <ButtonSlotContext value={null}>\n <OverlayHost>\n {/* A screen reader and a keyboard skip the scrim: the first closes\n the surface with the back or escape gesture, the second with\n Escape. React Native Web's Pressable is a tab stop unless told\n otherwise, whatever `focusable` says. */}\n <AnimatedPressable\n accessible={false}\n aria-hidden\n focusable={false}\n onPress={onScrimPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.scrim, scrim)}\n tabIndex={-1}\n />\n {children}\n </OverlayHost>\n </ButtonSlotContext>\n </Modal>\n )\n}\n\n// The surface's role and name on iOS and Android. On web React Native Web's\n// `Modal` is the dialog element, so the surface takes neither there.\nfunction panelRoleOf(\n role: 'alertdialog' | 'dialog',\n labelledBy: string | undefined,\n): Pick<ViewProps, 'aria-labelledby' | 'aria-modal' | 'role'> {\n if (Platform.OS === 'web') {\n return {}\n }\n\n return { 'aria-labelledby': labelledBy, 'aria-modal': true, role }\n}\n\n// Counts each part as it mounts and unmounts, so the parts around it know\n// which of them are there.\nfunction registerOf<Part extends string>(\n setParts: (\n update: (\n parts: Readonly<Record<Part, number>>,\n ) => Readonly<Record<Part, number>>,\n ) => void,\n) {\n return (part: Part) => {\n setParts((parts) => ({ ...parts, [part]: parts[part] + 1 }))\n\n return () => {\n setParts((parts) => ({ ...parts, [part]: parts[part] - 1 }))\n }\n }\n}\n\n/**\n * The open state a surface's content part reads: its trigger's, inside one,\n * and its own otherwise. `present` stays true from the moment it opens until\n * the call site's exit has run and set it false, and the close slot and the\n * scrim close it through `close`.\n */\nfunction useModalState(outer: ModalTrigger | null, props: ModalOpenProps) {\n const own = useOverlayTriggerState(props)\n const state = outer?.state ?? own\n const [present, setPresent] = useState(state.isOpen)\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, outer)\n\n return { close, present, setPresent, slots, state }\n}\n\n/**\n * The open state a surface's trigger part holds, and the default slot a\n * button inside it fills: it records itself as the button focus returns to,\n * and opens the surface. React Native types the target as a bare view tag\n * too, which focus cannot be sent to, so such a press records nothing.\n */\nfunction useModalTrigger(props: ModalOpenProps) {\n const state = useOverlayTriggerState(props)\n const [trigger, setTrigger] = useState<HostInstance | null>(null)\n const context = useMemo<ModalTrigger>(\n () => ({ state, trigger }),\n [state, trigger],\n )\n const slots = useMemo<ButtonSlots>(\n () => ({\n default: (event: GestureResponderEvent) => {\n const target = event.currentTarget\n\n setTrigger(typeof target === 'number' ? null : target)\n state.open()\n },\n }),\n [state],\n )\n\n return { context, slots }\n}\n\n// Sends the screen reader back to the button that opened the surface once it\n// has gone. React Native Web's `Modal` restores focus itself.\nfunction useReturnFocus(present: boolean, outer: ModalTrigger | null) {\n const shown = useRef(present)\n\n useEffect(() => {\n const trigger = outer?.trigger ?? null\n const gone = shown.current && !present\n\n shown.current = present\n if (gone && trigger !== null && Platform.OS !== 'web') {\n AccessibilityInfo.sendAccessibilityEvent(trigger, 'focus')\n }\n }, [outer, present])\n}\n\nexport {\n insetsOf,\n ModalWindow,\n NO_INSETS,\n panelRoleOf,\n registerOf,\n useModalState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AI;CAAA,OAAAA,KAAAJ,EAAA;CARH,MAAA4C,QACSxC;CASR,IAAAC;CAAA,IAAAL,EAAA,OAAAgD,WAAAhD,EAAA,OAAA4C,OAAA;EAEMvC,KAAA;GAAA2C;GAAAJ;EAAiB;EAAC5C,EAAA,KAAAgD;EAAAhD,EAAA,KAAA4C;EAAA5C,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAAlBK;AAAkB;AAK3B,SAAAwC,eAAAJ,SAAAH,OAAA;CAAA,MAAAtC,IAAAC,EAAA,CAAA;CACE,MAAAqD,QAAchH,OAAOmG,OAAO;CAAC,IAAA1C;CAAA,IAAAC,EAAA,OAAAsC,OAAA5D,WAAAsB,EAAA,OAAAyC,SAAA;EAEnB1C,WAAA;GACR,MAAArB,UAAgB4D,OAAK5D,WAAL;GAChB,MAAA6E,OAAaD,MAAKE,WAAL,CAAkBf;GAE/Ba,MAAKE,UAAWf;GAChB,IAAIc,QAAQ7E,YAAY,QAAQ/B,SAAQwC,OAAQ,OAC9C3C,kBAAiB4C,uBAAwBV,SAAS,OAAO;EAC1D;EACFsB,EAAA,KAAAsC,OAAA5D;EAAAsB,EAAA,KAAAyC;EAAAzC,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAsC,SAAAtC,EAAA,OAAAyC,SAAA;EAAErC,KAAA,CAACkC,OAAOG,OAAO;EAACzC,EAAA,KAAAsC;EAAAtC,EAAA,KAAAyC;EAAAzC,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CARnB5D,UAAU2D,IAQPK,EAAgB;AAAC"}
@@ -0,0 +1,2 @@
1
+ import { RefObject } from "react";
2
+ import { HostInstance, ViewStyle } from "react-native";
@@ -0,0 +1,182 @@
1
+ import { useTheme } from "../theme/scope.js";
2
+ import { OverlayHostContext } from "./host.js";
3
+ import { boundsOf, place } from "./placement.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { use, useEffect, useState } from "react";
6
+ import { Dimensions, I18nManager, useWindowDimensions } from "react-native";
7
+ import { SafeAreaInsetsContext } from "react-native-safe-area-context";
8
+ //#region src/overlay/anchored.ts
9
+ const HIDDEN = {
10
+ left: 0,
11
+ opacity: 0,
12
+ pointerEvents: "none",
13
+ position: "absolute",
14
+ top: 0
15
+ };
16
+ const NO_INSETS = {
17
+ bottom: 0,
18
+ left: 0,
19
+ right: 0,
20
+ top: 0
21
+ };
22
+ /**
23
+ * Places a surface drawn in an `Overlay` beside the view that opened it, as
24
+ * web's anchored overlays are placed: on `side`, lined up by `align`, flipped
25
+ * to the opposite side at the edge of the window, and kept inside the safe
26
+ * area's insets with `spacing.md` to spare, the padding React Aria keeps from
27
+ * the edge of the viewport. On `top` and `bottom`, `start` and `end` follow
28
+ * `I18nManager.isRTL`.
29
+ *
30
+ * The anchor is measured with `measureInWindow` whenever the surface reports
31
+ * a new size or the window changes size.
32
+ */
33
+ function useAnchoredPlacement(t0) {
34
+ const $ = c(31);
35
+ const { align: t1, alignOffset: t2, anchor, side: t3, sideOffset } = t0;
36
+ const align = t1 === void 0 ? "center" : t1;
37
+ const alignOffset = t2 === void 0 ? 0 : t2;
38
+ const side = t3 === void 0 ? "bottom" : t3;
39
+ const store = use(OverlayHostContext);
40
+ const { spacing } = useTheme();
41
+ const window = useWindowDimensions();
42
+ const insets = use(SafeAreaInsetsContext) ?? NO_INSETS;
43
+ const [measured, setMeasured] = useState(null);
44
+ const [surface, setSurface] = useState(null);
45
+ let t4;
46
+ if ($[0] !== anchor.current || $[1] !== store || $[2] !== surface) {
47
+ t4 = () => {
48
+ const measure = () => {
49
+ const layer = store?.layer() ?? null;
50
+ const target = anchor.current;
51
+ if (surface === null || layer === null || target === null) return;
52
+ layer.measureInWindow((originX, originY) => {
53
+ target.measureInWindow((x, y, width, height) => {
54
+ setMeasured({
55
+ anchor: {
56
+ height,
57
+ width,
58
+ x,
59
+ y
60
+ },
61
+ origin: {
62
+ x: originX,
63
+ y: originY
64
+ }
65
+ });
66
+ });
67
+ });
68
+ };
69
+ measure();
70
+ const subscription = Dimensions.addEventListener("change", measure);
71
+ return () => {
72
+ subscription.remove();
73
+ };
74
+ };
75
+ $[0] = anchor.current;
76
+ $[1] = store;
77
+ $[2] = surface;
78
+ $[3] = t4;
79
+ } else t4 = $[3];
80
+ let t5;
81
+ if ($[4] !== anchor || $[5] !== store || $[6] !== surface) {
82
+ t5 = [
83
+ anchor,
84
+ store,
85
+ surface
86
+ ];
87
+ $[4] = anchor;
88
+ $[5] = store;
89
+ $[6] = surface;
90
+ $[7] = t5;
91
+ } else t5 = $[7];
92
+ useEffect(t4, t5);
93
+ let t6;
94
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
95
+ t6 = (event) => {
96
+ const { height: height_0, width: width_0 } = event.nativeEvent.layout;
97
+ setSurface((known) => known?.height === height_0 && known.width === width_0 ? known : {
98
+ height: height_0,
99
+ width: width_0
100
+ });
101
+ };
102
+ $[8] = t6;
103
+ } else t6 = $[8];
104
+ const onLayout = t6;
105
+ if (measured === null || surface === null) {
106
+ let t7;
107
+ if ($[9] !== side) {
108
+ t7 = {
109
+ onLayout,
110
+ placed: false,
111
+ side,
112
+ style: HIDDEN
113
+ };
114
+ $[9] = side;
115
+ $[10] = t7;
116
+ } else t7 = $[10];
117
+ return t7;
118
+ }
119
+ let t7;
120
+ if ($[11] !== align || $[12] !== alignOffset || $[13] !== insets || $[14] !== measured.anchor || $[15] !== side || $[16] !== sideOffset || $[17] !== spacing.md || $[18] !== spacing.sm || $[19] !== surface || $[20] !== window) {
121
+ t7 = place({
122
+ align,
123
+ alignOffset,
124
+ anchor: measured.anchor,
125
+ bounds: boundsOf(window, insets, spacing.md),
126
+ rtl: I18nManager.isRTL,
127
+ side,
128
+ sideOffset: sideOffset ?? spacing.sm,
129
+ surface
130
+ });
131
+ $[11] = align;
132
+ $[12] = alignOffset;
133
+ $[13] = insets;
134
+ $[14] = measured.anchor;
135
+ $[15] = side;
136
+ $[16] = sideOffset;
137
+ $[17] = spacing.md;
138
+ $[18] = spacing.sm;
139
+ $[19] = surface;
140
+ $[20] = window;
141
+ $[21] = t7;
142
+ } else t7 = $[21];
143
+ const placement = t7;
144
+ const x_0 = placement.x - measured.origin.x;
145
+ const t8 = placement.y - measured.origin.y;
146
+ let t9;
147
+ if ($[22] !== x_0) {
148
+ t9 = I18nManager.isRTL && I18nManager.doLeftAndRightSwapInRTL ? { right: x_0 } : { left: x_0 };
149
+ $[22] = x_0;
150
+ $[23] = t9;
151
+ } else t9 = $[23];
152
+ let t10;
153
+ if ($[24] !== placement.maxHeight || $[25] !== t8 || $[26] !== t9) {
154
+ t10 = {
155
+ maxHeight: placement.maxHeight,
156
+ position: "absolute",
157
+ top: t8,
158
+ ...t9
159
+ };
160
+ $[24] = placement.maxHeight;
161
+ $[25] = t8;
162
+ $[26] = t9;
163
+ $[27] = t10;
164
+ } else t10 = $[27];
165
+ let t11;
166
+ if ($[28] !== placement.side || $[29] !== t10) {
167
+ t11 = {
168
+ onLayout,
169
+ placed: true,
170
+ side: placement.side,
171
+ style: t10
172
+ };
173
+ $[28] = placement.side;
174
+ $[29] = t10;
175
+ $[30] = t11;
176
+ } else t11 = $[30];
177
+ return t11;
178
+ }
179
+ //#endregion
180
+ export { useAnchoredPlacement };
181
+
182
+ //# sourceMappingURL=anchored.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchored.js","names":["RefObject","HostInstance","LayoutChangeEvent","ViewStyle","use","useEffect","useState","Dimensions","I18nManager","useWindowDimensions","SafeAreaInsetsContext","OverlayAlign","OverlaySide","Rect","Size","useTheme","OverlayHostContext","boundsOf","place","AnchoredPlacement","onLayout","event","placed","side","style","AnchoredPlacementOptions","align","alignOffset","anchor","Pick","sideOffset","Measured","origin","x","y","HIDDEN","left","opacity","pointerEvents","position","top","NO_INSETS","bottom","right","useAnchoredPlacement","t0","$","_c","t1","t2","t3","undefined","store","spacing","window","insets","measured","setMeasured","surface","setSurface","t4","current","measure","layer","target","measureInWindow","originX","originY","width","height","subscription","addEventListener","remove","t5","t6","Symbol","for","height_0","width_0","nativeEvent","layout","known","t7","md","sm","bounds","rtl","isRTL","placement","x_0","t8","t9","doLeftAndRightSwapInRTL","t10","maxHeight","t11","_c"],"sources":["../../src/overlay/anchored.ts"],"sourcesContent":["import type { RefObject } from 'react'\nimport type { HostInstance, LayoutChangeEvent, ViewStyle } from 'react-native'\n\nimport { use, useEffect, useState } from 'react'\nimport { Dimensions, I18nManager, useWindowDimensions } from 'react-native'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { OverlayAlign, OverlaySide, Rect, Size } from './placement'\n\nimport { useTheme } from '../theme/scope'\nimport { OverlayHostContext } from './host'\nimport { boundsOf, place } from './placement'\n\ntype AnchoredPlacement = {\n /**\n * Hand to the surface's own `onLayout`. The surface is placed once it has\n * reported its size, and placed again whenever that size changes.\n */\n readonly onLayout: (event: LayoutChangeEvent) => void\n /**\n * Whether the surface has been placed. Until it has, it is laid out out of\n * sight, and a screen reader cannot be sent to it.\n */\n readonly placed: boolean\n /** The side the surface opened on, which is the opposite one after a flip. */\n readonly side: OverlaySide\n /**\n * The surface's position in the overlay layer, and the height it may take.\n * Until it has been placed it is laid out out of sight, to be measured.\n */\n readonly style: ViewStyle\n}\n\ntype AnchoredPlacementOptions = {\n /**\n * Where the surface sits along the side it opens on.\n * @default 'center'\n */\n readonly align?: OverlayAlign | undefined\n /** Moves the surface along that side, in dp: right or down when positive. */\n readonly alignOffset?: number | undefined\n /** The view the surface opens beside. */\n readonly anchor: RefObject<null | Pick<HostInstance, 'measureInWindow'>>\n /**\n * Which side of the anchor the surface opens on. It flips to the opposite\n * side when there is no room.\n * @default 'bottom'\n */\n readonly side?: OverlaySide | undefined\n /**\n * The gap between the anchor and the surface, in dp.\n * @default spacing.sm\n */\n readonly sideOffset?: number | undefined\n}\n\ntype Measured = {\n readonly anchor: Rect\n /** Where the overlay layer starts in the window. */\n readonly origin: { readonly x: number; readonly y: number }\n}\n\nconst HIDDEN: ViewStyle = {\n left: 0,\n opacity: 0,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n}\n\n// Outside a SafeAreaProvider the insets are unknown, and the window's own edge\n// is the best bound there is.\nconst NO_INSETS = { bottom: 0, left: 0, right: 0, top: 0 }\n\n/**\n * Places a surface drawn in an `Overlay` beside the view that opened it, as\n * web's anchored overlays are placed: on `side`, lined up by `align`, flipped\n * to the opposite side at the edge of the window, and kept inside the safe\n * area's insets with `spacing.md` to spare, the padding React Aria keeps from\n * the edge of the viewport. On `top` and `bottom`, `start` and `end` follow\n * `I18nManager.isRTL`.\n *\n * The anchor is measured with `measureInWindow` whenever the surface reports\n * a new size or the window changes size.\n */\nfunction useAnchoredPlacement({\n align = 'center',\n alignOffset = 0,\n anchor,\n side = 'bottom',\n sideOffset,\n}: AnchoredPlacementOptions): AnchoredPlacement {\n const store = use(OverlayHostContext)\n const { spacing } = useTheme()\n const window = useWindowDimensions()\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const [measured, setMeasured] = useState<Measured | null>(null)\n const [surface, setSurface] = useState<null | Size>(null)\n\n useEffect(() => {\n // The layer is measured as well as the anchor, since the host need not\n // start at the window's corner: the surface is placed in the layer, and\n // the anchor is measured in the window.\n const measure = () => {\n const layer = store?.layer() ?? null\n const target = anchor.current\n\n if (surface === null || layer === null || target === null) {\n return\n }\n\n layer.measureInWindow((originX, originY) => {\n target.measureInWindow((x, y, width, height) => {\n setMeasured({\n anchor: { height, width, x, y },\n origin: { x: originX, y: originY },\n })\n })\n })\n }\n\n measure()\n\n // A rotation or a resized window can move the anchor without the\n // surface changing size.\n const subscription = Dimensions.addEventListener('change', measure)\n\n return () => {\n subscription.remove()\n }\n }, [anchor, store, surface])\n\n const onLayout = (event: LayoutChangeEvent) => {\n const { height, width } = event.nativeEvent.layout\n\n setSurface((known) =>\n known?.height === height && known.width === width\n ? known\n : { height, width },\n )\n }\n\n if (measured === null || surface === null) {\n return { onLayout, placed: false, side, style: HIDDEN }\n }\n\n const placement = place({\n align,\n alignOffset,\n anchor: measured.anchor,\n bounds: boundsOf(window, insets, spacing.md),\n rtl: I18nManager.isRTL,\n side,\n sideOffset: sideOffset ?? spacing.sm,\n surface,\n })\n const x = placement.x - measured.origin.x\n\n return {\n onLayout,\n placed: true,\n side: placement.side,\n style: {\n maxHeight: placement.maxHeight,\n position: 'absolute',\n top: placement.y - measured.origin.y,\n // The placement is in physical coordinates, as `measureInWindow`\n // reports them. React Native swaps `left` and `right` in a right-to-left\n // layout unless an app turns that off, so there `right` is what puts\n // the surface's left edge where the placement says.\n ...(I18nManager.isRTL && I18nManager.doLeftAndRightSwapInRTL\n ? { right: x }\n : { left: x }),\n },\n }\n}\n\nexport type { AnchoredPlacement, AnchoredPlacementOptions }\n\nexport { useAnchoredPlacement }\n"],"mappings":";;;;;;;;AA8DA,MAAMmC,SAAoB;CACxBC,MAAM;CACNC,SAAS;CACTC,eAAe;CACfC,UAAU;CACVC,KAAK;AACP;AAIA,MAAMC,YAAY;CAAEC,QAAQ;CAAGN,MAAM;CAAGO,OAAO;CAAGH,KAAK;AAAE;;;;;;;;;;;;AAazD,SAAAI,qBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA8B,MAAA,EAAArB,OAAAsB,IAAArB,aAAAsB,IAAArB,QAAAL,MAAA2B,IAAApB,eAAAe;CAC5B,MAAAnB,QAAAsB,OAAAG,KAAAA,IAAA,WAAAH;CACA,MAAArB,cAAAsB,OAAAE,KAAAA,IAAA,IAAAF;CAEA,MAAA1B,OAAA2B,OAAAC,KAAAA,IAAA,WAAAD;CAGA,MAAAE,QAAchD,IAAIY,kBAAkB;CACpC,MAAA,EAAAqC,YAAoBtC,SAAS;CAC7B,MAAAuC,SAAe7C,oBAAoB;CACnC,MAAA8C,SAAenD,IAAIM,qBAAkC,KAAtC+B;CACf,MAAA,CAAAe,UAAAC,eAAgCnD,SAA0B,IAAI;CAC9D,MAAA,CAAAoD,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