@kanso-labs/react-native-kanso-ui 0.8.0 → 0.10.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 (253) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/badge/index.js +9 -70
  5. package/dist/badge/index.js.map +1 -1
  6. package/dist/button/group.d.ts +5 -0
  7. package/dist/button/group.js +115 -0
  8. package/dist/button/group.js.map +1 -0
  9. package/dist/button/index.d.ts +4 -1
  10. package/dist/button/index.js +45 -23
  11. package/dist/button/index.js.map +1 -1
  12. package/dist/button/palettes.d.ts +2 -0
  13. package/dist/button/slots.js +2 -1
  14. package/dist/button/slots.js.map +1 -1
  15. package/dist/calendar/index.js +351 -182
  16. package/dist/calendar/index.js.map +1 -1
  17. package/dist/calendar/styles.js +33 -2
  18. package/dist/calendar/styles.js.map +1 -1
  19. package/dist/carousel/arrangement.d.ts +5 -0
  20. package/dist/carousel/arrangement.js +123 -0
  21. package/dist/carousel/arrangement.js.map +1 -0
  22. package/dist/chequer/index.js +95 -0
  23. package/dist/chequer/index.js.map +1 -0
  24. package/dist/collection/index.d.ts +157 -0
  25. package/dist/collection/index.js +1331 -0
  26. package/dist/collection/index.js.map +1 -0
  27. package/dist/color-thumb/index.js +56 -0
  28. package/dist/color-thumb/index.js.map +1 -0
  29. package/dist/components/badge/index.d.ts +48 -0
  30. package/dist/components/badge/index.js +122 -0
  31. package/dist/components/badge/index.js.map +1 -0
  32. package/dist/{badge → components/badge}/styles.js +10 -6
  33. package/dist/components/badge/styles.js.map +1 -0
  34. package/dist/components/breadcrumbs/index.d.ts +66 -0
  35. package/dist/components/breadcrumbs/index.js +285 -0
  36. package/dist/components/breadcrumbs/index.js.map +1 -0
  37. package/dist/components/button/index.d.ts +4 -2
  38. package/dist/components/button/index.js +227 -188
  39. package/dist/components/button/index.js.map +1 -1
  40. package/dist/components/button-group/index.d.ts +87 -0
  41. package/dist/components/button-group/index.js +275 -0
  42. package/dist/components/button-group/index.js.map +1 -0
  43. package/dist/components/calendar/index.d.ts +11 -3
  44. package/dist/components/calendar/index.js +60 -45
  45. package/dist/components/calendar/index.js.map +1 -1
  46. package/dist/components/carousel/index.d.ts +72 -0
  47. package/dist/components/carousel/index.js +496 -0
  48. package/dist/components/carousel/index.js.map +1 -0
  49. package/dist/components/checkbox/index.d.ts +7 -1
  50. package/dist/components/checkbox/index.js +183 -138
  51. package/dist/components/checkbox/index.js.map +1 -1
  52. package/dist/components/checkbox-group/index.d.ts +92 -0
  53. package/dist/components/checkbox-group/index.js +306 -0
  54. package/dist/components/checkbox-group/index.js.map +1 -0
  55. package/dist/components/code/index.d.ts +25 -0
  56. package/dist/components/code/index.js +87 -0
  57. package/dist/components/code/index.js.map +1 -0
  58. package/dist/components/color-area/index.d.ts +85 -0
  59. package/dist/components/color-area/index.js +630 -0
  60. package/dist/components/color-area/index.js.map +1 -0
  61. package/dist/components/color-field/index.d.ts +144 -0
  62. package/dist/components/color-field/index.js +516 -0
  63. package/dist/components/color-field/index.js.map +1 -0
  64. package/dist/components/color-picker/index.d.ts +74 -0
  65. package/dist/components/color-picker/index.js +317 -0
  66. package/dist/components/color-picker/index.js.map +1 -0
  67. package/dist/components/color-slider/index.d.ts +82 -0
  68. package/dist/components/color-slider/index.js +456 -0
  69. package/dist/components/color-slider/index.js.map +1 -0
  70. package/dist/components/color-swatch/index.d.ts +46 -0
  71. package/dist/components/color-swatch/index.js +127 -0
  72. package/dist/components/color-swatch/index.js.map +1 -0
  73. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  74. package/dist/components/color-swatch-picker/index.js +287 -0
  75. package/dist/components/color-swatch-picker/index.js.map +1 -0
  76. package/dist/components/color-wheel/index.d.ts +71 -0
  77. package/dist/components/color-wheel/index.js +407 -0
  78. package/dist/components/color-wheel/index.js.map +1 -0
  79. package/dist/components/combo-box/index.d.ts +193 -0
  80. package/dist/components/combo-box/index.js +616 -0
  81. package/dist/components/combo-box/index.js.map +1 -0
  82. package/dist/components/container/index.d.ts +47 -0
  83. package/dist/components/container/index.js +85 -0
  84. package/dist/components/container/index.js.map +1 -0
  85. package/dist/components/date-field/index.d.ts +120 -0
  86. package/dist/components/date-field/index.js +111 -0
  87. package/dist/components/date-field/index.js.map +1 -0
  88. package/dist/components/date-picker/index.d.ts +130 -0
  89. package/dist/components/date-picker/index.js +310 -0
  90. package/dist/components/date-picker/index.js.map +1 -0
  91. package/dist/components/date-range-picker/index.d.ts +139 -0
  92. package/dist/components/date-range-picker/index.js +421 -0
  93. package/dist/components/date-range-picker/index.js.map +1 -0
  94. package/dist/components/disclosure/index.d.ts +94 -0
  95. package/dist/components/disclosure/index.js +365 -0
  96. package/dist/components/disclosure/index.js.map +1 -0
  97. package/dist/components/disclosure-group/index.d.ts +61 -0
  98. package/dist/components/disclosure-group/index.js +100 -0
  99. package/dist/components/disclosure-group/index.js.map +1 -0
  100. package/dist/components/drop-zone/index.d.ts +113 -0
  101. package/dist/components/drop-zone/index.js +304 -0
  102. package/dist/components/drop-zone/index.js.map +1 -0
  103. package/dist/components/fab/index.d.ts +80 -0
  104. package/dist/components/fab/index.js +246 -0
  105. package/dist/components/fab/index.js.map +1 -0
  106. package/dist/components/fab-menu/index.d.ts +120 -0
  107. package/dist/components/fab-menu/index.js +640 -0
  108. package/dist/components/fab-menu/index.js.map +1 -0
  109. package/dist/components/feed/index.d.ts +57 -0
  110. package/dist/components/feed/index.js +167 -0
  111. package/dist/components/feed/index.js.map +1 -0
  112. package/dist/components/form/index.d.ts +3 -2
  113. package/dist/components/form/index.js.map +1 -1
  114. package/dist/components/icon-button/index.d.ts +4 -2
  115. package/dist/components/icon-button/index.js +204 -171
  116. package/dist/components/icon-button/index.js.map +1 -1
  117. package/dist/components/keycap/index.d.ts +27 -0
  118. package/dist/components/keycap/index.js +136 -0
  119. package/dist/components/keycap/index.js.map +1 -0
  120. package/dist/components/list/index.d.ts +15 -158
  121. package/dist/components/list/index.js +21 -1047
  122. package/dist/components/list/index.js.map +1 -1
  123. package/dist/components/list-box/index.d.ts +73 -0
  124. package/dist/components/list-box/index.js +82 -0
  125. package/dist/components/list-box/index.js.map +1 -0
  126. package/dist/components/loading-indicator/index.d.ts +32 -0
  127. package/dist/components/loading-indicator/index.js +174 -0
  128. package/dist/components/loading-indicator/index.js.map +1 -0
  129. package/dist/components/menu/index.js +1 -1
  130. package/dist/components/navigation-tree/index.d.ts +117 -0
  131. package/dist/components/navigation-tree/index.js +135 -0
  132. package/dist/components/navigation-tree/index.js.map +1 -0
  133. package/dist/components/number-field/index.js +132 -143
  134. package/dist/components/number-field/index.js.map +1 -1
  135. package/dist/components/range-calendar/index.d.ts +69 -0
  136. package/dist/components/range-calendar/index.js +144 -0
  137. package/dist/components/range-calendar/index.js.map +1 -0
  138. package/dist/components/search-view/index.d.ts +78 -0
  139. package/dist/components/search-view/index.js +570 -0
  140. package/dist/components/search-view/index.js.map +1 -0
  141. package/dist/components/select/index.d.ts +152 -0
  142. package/dist/components/select/index.js +419 -0
  143. package/dist/components/select/index.js.map +1 -0
  144. package/dist/components/separator/index.d.ts +3 -2
  145. package/dist/components/separator/index.js +29 -26
  146. package/dist/components/separator/index.js.map +1 -1
  147. package/dist/components/slider/index.d.ts +111 -0
  148. package/dist/components/slider/index.js +673 -0
  149. package/dist/components/slider/index.js.map +1 -0
  150. package/dist/components/split-button/index.d.ts +77 -0
  151. package/dist/components/split-button/index.js +354 -0
  152. package/dist/components/split-button/index.js.map +1 -0
  153. package/dist/components/supporting-pane/index.d.ts +44 -0
  154. package/dist/components/supporting-pane/index.js +109 -0
  155. package/dist/components/supporting-pane/index.js.map +1 -0
  156. package/dist/components/tabs/index.d.ts +196 -0
  157. package/dist/components/tabs/index.js +1137 -0
  158. package/dist/components/tabs/index.js.map +1 -0
  159. package/dist/components/text/index.d.ts +1 -1
  160. package/dist/components/text/index.js +49 -21
  161. package/dist/components/text/index.js.map +1 -1
  162. package/dist/components/text-area/index.d.ts +145 -0
  163. package/dist/components/text-area/index.js +231 -0
  164. package/dist/components/text-area/index.js.map +1 -0
  165. package/dist/components/time-field/index.d.ts +43 -0
  166. package/dist/components/time-field/index.js +107 -0
  167. package/dist/components/time-field/index.js.map +1 -0
  168. package/dist/components/time-picker/index.d.ts +65 -0
  169. package/dist/components/time-picker/index.js +1168 -0
  170. package/dist/components/time-picker/index.js.map +1 -0
  171. package/dist/components/toolbar/index.d.ts +53 -0
  172. package/dist/components/toolbar/index.js +185 -0
  173. package/dist/components/toolbar/index.js.map +1 -0
  174. package/dist/components/tooltip/index.d.ts +101 -0
  175. package/dist/components/tooltip/index.js +223 -0
  176. package/dist/components/tooltip/index.js.map +1 -0
  177. package/dist/components/tree/index.d.ts +112 -0
  178. package/dist/components/tree/index.js +157 -0
  179. package/dist/components/tree/index.js.map +1 -0
  180. package/dist/control/group.js +23 -0
  181. package/dist/control/group.js.map +1 -0
  182. package/dist/disclosure/chevron.js +75 -0
  183. package/dist/disclosure/chevron.js.map +1 -0
  184. package/dist/disclosure/index.js +7 -0
  185. package/dist/disclosure/index.js.map +1 -0
  186. package/dist/drop/index.d.ts +54 -0
  187. package/dist/drop/index.js +161 -0
  188. package/dist/drop/index.js.map +1 -0
  189. package/dist/fab/index.d.ts +19 -0
  190. package/dist/fab/index.js +147 -0
  191. package/dist/fab/index.js.map +1 -0
  192. package/dist/field/chevron.js +74 -0
  193. package/dist/field/chevron.js.map +1 -0
  194. package/dist/field/index.d.ts +2 -1
  195. package/dist/field/index.js +350 -153
  196. package/dist/field/index.js.map +1 -1
  197. package/dist/field/styles.js +27 -0
  198. package/dist/field/styles.js.map +1 -1
  199. package/dist/files/index.d.ts +18 -0
  200. package/dist/files/index.js +107 -0
  201. package/dist/files/index.js.map +1 -0
  202. package/dist/form/index.d.ts +6 -4
  203. package/dist/form/index.js +64 -85
  204. package/dist/form/index.js.map +1 -1
  205. package/dist/glyphs/index.js +92 -1
  206. package/dist/glyphs/index.js.map +1 -1
  207. package/dist/i18n/index.js +20 -1
  208. package/dist/i18n/index.js.map +1 -1
  209. package/dist/i18n/messages.js +1394 -34
  210. package/dist/i18n/messages.js.map +1 -1
  211. package/dist/index.d.ts +51 -6
  212. package/dist/index.js +47 -4
  213. package/dist/indicator/paths.js +23 -1
  214. package/dist/indicator/paths.js.map +1 -1
  215. package/dist/modal/index.js +96 -68
  216. package/dist/modal/index.js.map +1 -1
  217. package/dist/navigation/index.js +8 -5
  218. package/dist/navigation/index.js.map +1 -1
  219. package/dist/number/keyboard.js +16 -0
  220. package/dist/number/keyboard.js.map +1 -0
  221. package/dist/overlay/anchored.js +68 -38
  222. package/dist/overlay/anchored.js.map +1 -1
  223. package/dist/overlay/keyboard.js +57 -0
  224. package/dist/overlay/keyboard.js.map +1 -0
  225. package/dist/overlay/panel.js +173 -19
  226. package/dist/overlay/panel.js.map +1 -1
  227. package/dist/overlay/placement.js +16 -2
  228. package/dist/overlay/placement.js.map +1 -1
  229. package/dist/picker/index.js +322 -0
  230. package/dist/picker/index.js.map +1 -0
  231. package/dist/press/index.d.ts +2 -0
  232. package/dist/press/index.js +102 -100
  233. package/dist/press/index.js.map +1 -1
  234. package/dist/row/index.js +77 -69
  235. package/dist/row/index.js.map +1 -1
  236. package/dist/row/styles.js +13 -2
  237. package/dist/row/styles.js.map +1 -1
  238. package/dist/segments/field.js +277 -0
  239. package/dist/segments/field.js.map +1 -0
  240. package/dist/segments/index.js +574 -0
  241. package/dist/segments/index.js.map +1 -0
  242. package/dist/segments/styles.js +24 -0
  243. package/dist/segments/styles.js.map +1 -0
  244. package/dist/separator/index.js +7 -0
  245. package/dist/separator/index.js.map +1 -0
  246. package/dist/slider/index.js +145 -0
  247. package/dist/slider/index.js.map +1 -0
  248. package/dist/swatch/index.js +56 -0
  249. package/dist/swatch/index.js.map +1 -0
  250. package/dist/typography/size.js +14 -0
  251. package/dist/typography/size.js.map +1 -0
  252. package/package.json +11 -2
  253. package/dist/badge/styles.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,49 +1,94 @@
1
1
  import { AppBar, AppBarProps } from "./components/app-bar/index.js";
2
2
  import { Autocomplete, AutocompleteFilter, AutocompleteProps } from "./components/autocomplete/index.js";
3
3
  import { Avatar, AvatarProps } from "./components/avatar/index.js";
4
+ import { Badge, BadgeProps } from "./components/badge/index.js";
5
+ import { Breadcrumbs, BreadcrumbsItem, BreadcrumbsItemProps, BreadcrumbsProps } from "./components/breadcrumbs/index.js";
4
6
  import { Button, ButtonProps, ButtonShape, ButtonSize, ButtonVariant } from "./components/button/index.js";
7
+ import { ButtonGroup, ButtonGroupProps, ButtonGroupVariant } from "./components/button-group/index.js";
5
8
  import { Calendar, CalendarProps } from "./components/calendar/index.js";
6
9
  import { Card, CardProps, CardVariant } from "./components/card/index.js";
10
+ import { CarouselLayout } from "./carousel/arrangement.js";
11
+ import { Carousel, CarouselItem, CarouselItemProps, CarouselProps } from "./components/carousel/index.js";
7
12
  import { Checkbox, CheckboxProps } from "./components/checkbox/index.js";
13
+ import { CheckboxGroup, CheckboxGroupProps } from "./components/checkbox-group/index.js";
8
14
  import { Chip, ChipActionProps, ChipFilterProps, ChipProps, ChipVariant } from "./components/chip/index.js";
9
15
  import { ChipGroup, ChipGroupChip, ChipGroupChipProps, ChipGroupProps } from "./components/chip-group/index.js";
16
+ import { Code, CodeProps } from "./components/code/index.js";
17
+ import { ColorArea, ColorAreaProps } from "./components/color-area/index.js";
18
+ import { FieldVariant } from "./field/index.js";
19
+ import { ColorField, ColorFieldProps } from "./components/color-field/index.js";
20
+ import { ColorPicker, ColorPickerProps } from "./components/color-picker/index.js";
21
+ import { ColorSlider, ColorSliderProps } from "./components/color-slider/index.js";
22
+ import { ColorSwatch, ColorSwatchProps } from "./components/color-swatch/index.js";
23
+ import { ColorSwatchPicker, ColorSwatchPickerItem, ColorSwatchPickerItemProps, ColorSwatchPickerLayout, ColorSwatchPickerProps } from "./components/color-swatch-picker/index.js";
24
+ import { ColorWheel, ColorWheelProps } from "./components/color-wheel/index.js";
25
+ import { ComboBox, ComboBoxProps, ComboBoxSelectionMode } from "./components/combo-box/index.js";
26
+ import { Container, ContainerPadding, ContainerProps } from "./components/container/index.js";
10
27
  import { CopyField, CopyFieldProps } from "./components/copy-field/index.js";
11
28
  import { Currency, CurrencyProps, CurrencySignDisplay, CurrencyTone } from "./components/currency/index.js";
29
+ import { DateField, DateFieldProps } from "./components/date-field/index.js";
30
+ import { DatePicker, DatePickerProps } from "./components/date-picker/index.js";
31
+ import { DateRangePicker, DateRangePickerProps } from "./components/date-range-picker/index.js";
12
32
  import { Dialog, DialogBody, DialogBodyProps, DialogContent, DialogContentProps, DialogFooter, DialogHeader, DialogPartProps, DialogProps, DialogTitle, DialogTitleProps } from "./components/dialog/index.js";
33
+ import { Disclosure, DisclosureHeader, DisclosureHeaderProps, DisclosurePanel, DisclosurePanelProps, DisclosureProps } from "./components/disclosure/index.js";
34
+ import { DisclosureGroup, DisclosureGroupProps } from "./components/disclosure-group/index.js";
35
+ import { PickedFile } from "./files/index.js";
36
+ import { DragTypes, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, FileDropItem, TextDropItem, isFileDropItem, isTextDropItem } from "./drop/index.js";
37
+ import { DropZone, DropZoneProps, FileTrigger, FileTriggerProps } from "./components/drop-zone/index.js";
38
+ import { KuiTheme } from "./tokens/defaults.js";
39
+ import { ResolvedTheme, useTheme } from "./theme/scope.js";
40
+ import { TypeRole } from "./typography/roles.js";
41
+ import { FabSize, FabTone, FabVariant } from "./fab/index.js";
42
+ import { Fab, FabProps } from "./components/fab/index.js";
43
+ import { FabMenu, FabMenuItem, FabMenuItemProps, FabMenuProps } from "./components/fab-menu/index.js";
44
+ import { Feed, FeedProps } from "./components/feed/index.js";
13
45
  import { Form, FormHandle, FormProps } from "./components/form/index.js";
14
46
  import { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from "./components/icon-button/index.js";
47
+ import { Keycap, KeycapProps } from "./components/keycap/index.js";
15
48
  import { Link, LinkProps, LinkTone, LinkUnderline } from "./components/link/index.js";
16
49
  import { List, ListLoadMore, ListLoadMoreProps, ListProps, ListRow, ListRowProps, ListSection, ListSectionProps } from "./components/list/index.js";
50
+ import { ListBox, ListBoxItem, ListBoxItemProps, ListBoxLoadMore, ListBoxLoadMoreProps, ListBoxProps, ListBoxSection, ListBoxSectionProps } from "./components/list-box/index.js";
17
51
  import { ListDetail, ListDetailProps } from "./components/list-detail/index.js";
18
52
  import { ListItem, ListItemProps } from "./components/list-item/index.js";
53
+ import { LoadingIndicator, LoadingIndicatorProps } from "./components/loading-indicator/index.js";
19
54
  import { Menu, MenuAlign, MenuContent, MenuContentProps, MenuItem, MenuItemProps, MenuLoadMore, MenuLoadMoreProps, MenuProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSide, MenuSubmenu, MenuSubmenuProps, MenuTrigger } from "./components/menu/index.js";
20
55
  import { Meter, MeterProps, MeterTone } from "./components/meter/index.js";
21
- import { KuiTheme } from "./tokens/defaults.js";
22
- import { ResolvedTheme, useTheme } from "./theme/scope.js";
23
56
  import { NavigationBar, NavigationBarItem, NavigationBarItemProps, NavigationBarProps, NavigationTabBar, NavigationTabBarProps } from "./components/navigation-bar/index.js";
24
57
  import { NavigationRail, NavigationRailItem, NavigationRailItemProps, NavigationRailProps } from "./components/navigation-rail/index.js";
25
- import { FieldVariant } from "./field/index.js";
58
+ import { NavigationTree, NavigationTreeItem, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSection, NavigationTreeSectionProps } from "./components/navigation-tree/index.js";
26
59
  import { NumberField, NumberFieldProps } from "./components/number-field/index.js";
27
60
  import { Popover, PopoverAlign, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitle, PopoverTitleProps, PopoverTrigger } from "./components/popover/index.js";
28
61
  import { ProductIcon, ProductIconProps } from "./components/product-icon/index.js";
29
62
  import { ProgressIndicator, ProgressIndicatorProps, ProgressIndicatorShape, ProgressIndicatorTone, ProgressIndicatorVariant } from "./components/progress-indicator/index.js";
30
63
  import { Radio, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioProps } from "./components/radio-group/index.js";
64
+ import { RangeCalendar, RangeCalendarProps } from "./components/range-calendar/index.js";
31
65
  import { SearchField, SearchFieldProps } from "./components/search-field/index.js";
66
+ import { SearchView, SearchViewContent, SearchViewContentProps, SearchViewProps } from "./components/search-view/index.js";
32
67
  import { SegmentedButton, SegmentedButtonProps, SegmentedButtonSegment, SegmentedButtonSegmentProps } from "./components/segmented-button/index.js";
68
+ import { Select, SelectProps } from "./components/select/index.js";
33
69
  import { Separator, SeparatorInset, SeparatorProps } from "./components/separator/index.js";
34
70
  import { Sheet, SheetBody, SheetBodyProps, SheetContent, SheetContentProps, SheetFooter, SheetHandle, SheetHandleProps, SheetHeader, SheetPartProps, SheetProps, SheetTitle, SheetTitleProps } from "./components/sheet/index.js";
71
+ import { Slider, SliderProps, SliderSize } from "./components/slider/index.js";
35
72
  import { Snackbar, SnackbarAction, SnackbarOptions, SnackbarProps, SnackbarQueue } from "./components/snackbar/index.js";
73
+ import { SplitButton, SplitButtonAction, SplitButtonActionProps, SplitButtonMenu, SplitButtonMenuProps, SplitButtonProps, SplitButtonVariant } from "./components/split-button/index.js";
36
74
  import { Stack, StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
75
+ import { SupportingPane, SupportingPaneProps } from "./components/supporting-pane/index.js";
37
76
  import { Switch, SwitchProps } from "./components/switch/index.js";
77
+ import { Tabs, TabsLayout, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsPanels, TabsPanelsProps, TabsProps, TabsTab, TabsTabProps, TabsVariant } from "./components/tabs/index.js";
38
78
  import { Tag, TagProps, TagTone, TagVariant } from "./components/tag/index.js";
39
- import { TypeRole } from "./typography/roles.js";
40
79
  import { Text, TextProps } from "./components/text/index.js";
80
+ import { TextArea, TextAreaProps } from "./components/text-area/index.js";
41
81
  import { TextField, TextFieldProps } from "./components/text-field/index.js";
82
+ import { TimeField, TimeFieldProps } from "./components/time-field/index.js";
83
+ import { TimePicker, TimePickerMode, TimePickerProps } from "./components/time-picker/index.js";
84
+ import { Toolbar, ToolbarProps, ToolbarTone } from "./components/toolbar/index.js";
85
+ import { Tooltip, TooltipAlign, TooltipProps, TooltipSide } from "./components/tooltip/index.js";
86
+ import { Tree, TreeItem, TreeItemProps, TreeLoadMore, TreeLoadMoreProps, TreeProps, TreeSection, TreeSectionProps } from "./components/tree/index.js";
42
87
  import { IconStyle, useIconStyle } from "./glyphs/icon-style.js";
43
88
  import { AppBarScroll, AppBarScrollOptions, useAppBarScroll } from "./hooks/useAppBarScroll.js";
44
89
  import { WindowSizeClass, useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
45
90
  import { I18nProvider, I18nProviderProps, Locale, useLocale } from "./i18n/provider.js";
46
91
  import { RouterProvider, RouterProviderProps } from "./router/index.js";
47
92
  import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
48
- import { Key, Selection } from "react-stately";
49
- export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, 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, I18nProvider, type I18nProviderProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, type Locale, 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, NavigationBar, NavigationBarItem, type NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailProps, NavigationTabBar, type NavigationTabBarProps, 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, Tag, type TagProps, type TagTone, type TagVariant, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
93
+ import { Color, ColorChannel, ColorSpace, Key, Selection, getColorChannels, parseColor } from "react-stately";
94
+ export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, type Color, ColorArea, type ColorAreaProps, type ColorChannel, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, type ColorSpace, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerLayout, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerPadding, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, type DragTypes, type DropEnterEvent, type DropEvent, type DropExitEvent, type DropItem, type DropOperation, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, type FileDropItem, FileTrigger, type FileTriggerProps, Form, type FormHandle, type FormProps, I18nProvider, type I18nProviderProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, type Locale, 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, NavigationBar, NavigationBarItem, type NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailProps, NavigationTabBar, type NavigationTabBarProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, type PickedFile, 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, RangeCalendar, type RangeCalendarProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, 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, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, type TextDropItem, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, type TypeRole, type WindowSizeClass, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
package/dist/index.js CHANGED
@@ -1,45 +1,88 @@
1
1
  import { useIconStyle } from "./glyphs/icon-style.js";
2
2
  import { useAppBarScroll } from "./hooks/useAppBarScroll.js";
3
3
  import { useTheme } from "./theme/scope.js";
4
+ import { Keycap } from "./components/keycap/index.js";
4
5
  import { Text } from "./components/text/index.js";
5
6
  import { AppBar } from "./components/app-bar/index.js";
6
7
  import { I18nProvider, useLocale } from "./i18n/provider.js";
7
8
  import { Autocomplete } from "./components/autocomplete/index.js";
8
9
  import { Avatar } from "./components/avatar/index.js";
10
+ import { Badge } from "./components/badge/index.js";
9
11
  import { RouterProvider } from "./router/index.js";
12
+ import { Link } from "./components/link/index.js";
13
+ import { Breadcrumbs, BreadcrumbsItem } from "./components/breadcrumbs/index.js";
10
14
  import { ProgressIndicator } from "./components/progress-indicator/index.js";
11
15
  import { Button } from "./components/button/index.js";
16
+ import { ButtonGroup } from "./components/button-group/index.js";
12
17
  import { IconButton } from "./components/icon-button/index.js";
18
+ import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
13
19
  import { Calendar } from "./components/calendar/index.js";
14
20
  import { Card } from "./components/card/index.js";
21
+ import { Carousel, CarouselItem } from "./components/carousel/index.js";
15
22
  import { Checkbox } from "./components/checkbox/index.js";
23
+ import { CheckboxGroup } from "./components/checkbox-group/index.js";
16
24
  import { Chip } from "./components/chip/index.js";
17
25
  import { ChipGroup, ChipGroupChip } from "./components/chip-group/index.js";
26
+ import { Code } from "./components/code/index.js";
27
+ import { ColorArea } from "./components/color-area/index.js";
28
+ import { ColorField } from "./components/color-field/index.js";
29
+ import { ColorSlider } from "./components/color-slider/index.js";
30
+ import { ColorSwatch } from "./components/color-swatch/index.js";
31
+ import { ColorPicker } from "./components/color-picker/index.js";
32
+ import { ColorSwatchPicker, ColorSwatchPickerItem } from "./components/color-swatch-picker/index.js";
33
+ import { ColorWheel } from "./components/color-wheel/index.js";
34
+ import { ComboBox } from "./components/combo-box/index.js";
35
+ import { Container } from "./components/container/index.js";
18
36
  import { CopyField } from "./components/copy-field/index.js";
19
37
  import { Currency } from "./components/currency/index.js";
20
- import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
38
+ import { DateField } from "./components/date-field/index.js";
39
+ import { DatePicker } from "./components/date-picker/index.js";
40
+ import { RangeCalendar } from "./components/range-calendar/index.js";
41
+ import { DateRangePicker } from "./components/date-range-picker/index.js";
21
42
  import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "./components/dialog/index.js";
43
+ import { Disclosure, DisclosureHeader, DisclosurePanel } from "./components/disclosure/index.js";
44
+ import { Separator } from "./components/separator/index.js";
45
+ import { DisclosureGroup } from "./components/disclosure-group/index.js";
46
+ import { isFileDropItem, isTextDropItem } from "./drop/index.js";
47
+ import { DropZone, FileTrigger } from "./components/drop-zone/index.js";
48
+ import { Fab } from "./components/fab/index.js";
49
+ import { FabMenu, FabMenuItem } from "./components/fab-menu/index.js";
50
+ import { Feed } from "./components/feed/index.js";
22
51
  import { Form } from "./components/form/index.js";
23
- import { Link } from "./components/link/index.js";
24
52
  import { List, ListLoadMore, ListRow, ListSection } from "./components/list/index.js";
53
+ import { ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection } from "./components/list-box/index.js";
25
54
  import { ListDetail } from "./components/list-detail/index.js";
26
55
  import { ListItem } from "./components/list-item/index.js";
27
- import { Separator } from "./components/separator/index.js";
56
+ import { LoadingIndicator } from "./components/loading-indicator/index.js";
28
57
  import { Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu } from "./components/menu/index.js";
29
58
  import { Meter } from "./components/meter/index.js";
30
59
  import { NavigationBar, NavigationBarItem, NavigationTabBar } from "./components/navigation-bar/index.js";
31
60
  import { NavigationRail, NavigationRailItem } from "./components/navigation-rail/index.js";
61
+ import { NavigationTree, NavigationTreeItem, NavigationTreeSection } from "./components/navigation-tree/index.js";
32
62
  import { NumberField } from "./components/number-field/index.js";
33
63
  import { Popover, PopoverContent, PopoverDescription, PopoverTitle } from "./components/popover/index.js";
34
64
  import { ProductIcon } from "./components/product-icon/index.js";
35
65
  import { Radio, RadioGroup } from "./components/radio-group/index.js";
36
66
  import { SearchField } from "./components/search-field/index.js";
67
+ import { SearchView, SearchViewContent } from "./components/search-view/index.js";
37
68
  import { SegmentedButton, SegmentedButtonSegment } from "./components/segmented-button/index.js";
69
+ import { Select } from "./components/select/index.js";
38
70
  import { Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle } from "./components/sheet/index.js";
71
+ import { Slider } from "./components/slider/index.js";
39
72
  import { Snackbar } from "./components/snackbar/index.js";
73
+ import { SplitButton, SplitButtonAction, SplitButtonMenu } from "./components/split-button/index.js";
40
74
  import { Stack } from "./components/stack/index.js";
75
+ import { SupportingPane } from "./components/supporting-pane/index.js";
41
76
  import { Switch } from "./components/switch/index.js";
77
+ import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab } from "./components/tabs/index.js";
42
78
  import { Tag } from "./components/tag/index.js";
79
+ import { TextArea } from "./components/text-area/index.js";
43
80
  import { TextField } from "./components/text-field/index.js";
81
+ import { TimeField } from "./components/time-field/index.js";
82
+ import { TimePicker } from "./components/time-picker/index.js";
83
+ import { Toolbar } from "./components/toolbar/index.js";
84
+ import { Tooltip } from "./components/tooltip/index.js";
85
+ import { Tree, TreeItem, TreeLoadMore, TreeSection } from "./components/tree/index.js";
44
86
  import { ThemeScope } from "./theme-scope.js";
45
- export { AppBar, Autocomplete, Avatar, Button, Calendar, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, I18nProvider, IconButton, Link, List, ListDetail, ListItem, ListLoadMore, ListRow, ListSection, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailItem, NavigationTabBar, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Snackbar, Stack, Switch, Tag, Text, TextField, ThemeScope, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
87
+ import { getColorChannels, parseColor } from "react-stately";
88
+ export { AppBar, Autocomplete, Avatar, Badge, Breadcrumbs, BreadcrumbsItem, Button, ButtonGroup, Calendar, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Chip, ChipGroup, ChipGroupChip, Code, ColorArea, ColorField, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorWheel, ComboBox, Container, CopyField, Currency, DateField, DatePicker, DateRangePicker, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Disclosure, DisclosureGroup, DisclosureHeader, DisclosurePanel, DropZone, Fab, FabMenu, FabMenuItem, Feed, FileTrigger, Form, I18nProvider, IconButton, Keycap, Link, List, ListBox, ListBoxItem, ListBoxLoadMore, ListBoxSection, ListDetail, ListItem, ListLoadMore, ListRow, ListSection, LoadingIndicator, Menu, MenuContent, MenuItem, MenuLoadMore, MenuSection, MenuSeparator, MenuSubmenu, Meter, NavigationBar, NavigationBarItem, NavigationRail, NavigationRailItem, NavigationTabBar, NavigationTree, NavigationTreeItem, NavigationTreeSection, NumberField, Popover, PopoverContent, PopoverDescription, PopoverTitle, ProductIcon, ProgressIndicator, Radio, RadioGroup, RangeCalendar, RouterProvider, SearchField, SearchView, SearchViewContent, SegmentedButton, SegmentedButtonSegment, Select, Separator, Sheet, SheetBody, SheetContent, SheetFooter, SheetHandle, SheetHeader, SheetTitle, Slider, Snackbar, SplitButton, SplitButtonAction, SplitButtonMenu, Stack, SupportingPane, Switch, Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, Tag, Text, TextArea, TextField, ThemeScope, TimeField, TimePicker, Toolbar, Tooltip, Tree, TreeItem, TreeLoadMore, TreeSection, getColorChannels, isFileDropItem, isTextDropItem, parseColor, useAppBarScroll, useIconStyle, useLocale, useTheme, useWindowSizeClass };
@@ -27,6 +27,28 @@ function arcPath(centre, radius, from, sweep) {
27
27
  return `M${point(from)}A${radius} ${radius} 0 ${large} 1 ${point(from + span)}`;
28
28
  }
29
29
  /**
30
+ * A loading indicator's shape `share` of the way from `from` to `to`, point by
31
+ * point, turned `angle` radians clockwise about (`centre`, `centre`), and
32
+ * closed. Each list holds every point's x and then its y, the two of the same
33
+ * length, so the nth point of one becomes the nth of the other. A share past
34
+ * 1, as a spring's overshoot gives, carries the shape on past `to`, as web's
35
+ * interpolation of one polygon into the next does.
36
+ */
37
+ function shapePath(from, to, share, angle, centre) {
38
+ "worklet";
39
+ const cos = Math.cos(angle);
40
+ const sin = Math.sin(angle);
41
+ let path = "";
42
+ for (let index = 0; index < from.length; index += 2) {
43
+ const x = from[index] + (to[index] - from[index]) * share - centre;
44
+ const y = from[index + 1] + (to[index + 1] - from[index + 1]) * share - centre;
45
+ const turnedX = centre + x * cos - y * sin;
46
+ const turnedY = centre + x * sin + y * cos;
47
+ path += `${index === 0 ? "M" : "L"}${turnedX.toFixed(PLACES)} ${turnedY.toFixed(PLACES)}`;
48
+ }
49
+ return `${path}Z`;
50
+ }
51
+ /**
30
52
  * A stretch of the wave along a line, from `from` to `to` across its row, on a
31
53
  * wave `wavelength` long that rises first from `WAVE_ORIGIN`, as web's does.
32
54
  * Nothing when the stretch is empty, which is how a bar that has not yet
@@ -67,6 +89,6 @@ function wavyArcPath(wave, phase, from, sweep) {
67
89
  return `${path}L${point(to)}`;
68
90
  }
69
91
  //#endregion
70
- export { TURN, WAVE_HEIGHT, WAVE_ORIGIN, arcPath, wavePath, wavyArcPath };
92
+ export { TURN, WAVE_HEIGHT, WAVE_ORIGIN, arcPath, shapePath, wavePath, wavyArcPath };
71
93
 
72
94
  //# sourceMappingURL=paths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","names":["THICKNESS","PLACES","TURN","Math","PI","DOT","WAVE_AMPLITUDE","WAVE_HEIGHT","WAVE_ORIGIN","POINTS_PER_WAVELENGTH","POINTS_PER_RING_WAVE","RingWave","amplitude","centre","radius","waves","arcPath","from","sweep","span","min","max","large","point","angle","x","sin","y","cos","toFixed","wavePath","wavelength","to","crest","step","path","index","floor","wavyArcPath","wave","phase","reach"],"sources":["../../src/indicator/paths.ts"],"sourcesContent":["import { THICKNESS } from './styles'\n\n// The paths a progress indicator draws its curves along: an arc of a circle,\n// an arc of a circle with a wave round it, and a wave along a line. Each is\n// built from where it starts and how far it runs, so a curve that moves is a\n// new path each frame rather than a dash pattern that moves.\n//\n// Web cuts its arcs and waves out of whole curves with `stroke-dasharray`,\n// normalised by `pathLength` so a dash reads as a share of the way round.\n// react-native-svg has no `pathLength`, and a dash pattern Reanimated moves\n// frame by frame is the least reliable of an svg's props across iOS, Android\n// and the web, so here the cut is made in the path itself, which every\n// platform redraws alike. The geometry is web's: the same circles, the same\n// waves, and the same lengths along them.\n//\n// Every builder is a worklet, so it runs on the UI thread with the animation\n// that moves it, and a test can call it as it stands. Each is whole on its\n// own, its helpers nested inside it: a worklet captures what it calls when the\n// module is evaluated, so one calling another declared below it would be\n// handed nothing, and the linter orders declarations by name, not by use.\n\n// Three decimal places, which keeps a path short without moving a point by\n// anything a screen could show, as web rounds its own.\nconst PLACES = 3\n\n/** A full turn, in radians. */\nconst TURN = 2 * Math.PI\n\n// The least an arc runs. Web's zero-length dash still draws, as a dot the\n// size of the stroke, since a round cap is drawn at either end of a dash of\n// any length; an svg path of no length draws nothing at all, so the arc is\n// given this much instead, which is the same dot.\nconst DOT = 0.001\n\n// The wave along the line: its amplitude either side of the middle, and the\n// row it is drawn in, which is the amplitude either side plus the stroke.\n// It starts half a stroke in, so its round cap starts at the row's edge.\nconst WAVE_AMPLITUDE = 3\nconst WAVE_HEIGHT = WAVE_AMPLITUDE * 2 + THICKNESS\nconst WAVE_ORIGIN = THICKNESS / 2\n\n// How many points a wavelength is drawn through: web draws a line's wave as\n// cubic half waves and a ring's as twenty points to a wave. A wave cut short\n// partway through a cubic would need it split, so both are drawn as points\n// here, finely enough that the joins are below what the 4dp stroke shows.\nconst POINTS_PER_WAVELENGTH = 16\nconst POINTS_PER_RING_WAVE = 20\n\n/** A circle a ring's wave runs round, and the wave. */\ntype RingWave = {\n /** How far the wave rises either side of the circle. */\n readonly amplitude: number\n /** The centre, on both axes. */\n readonly centre: number\n /** The circle's radius. */\n readonly radius: number\n /** How many crests the wave has round the whole circle. */\n readonly waves: number\n}\n\n/**\n * An arc of the circle about (`centre`, `centre`), clockwise from `from` for\n * `sweep` radians, both measured from the top. A sweep of nothing draws a dot,\n * as web's zero-length dash does, and a full turn stops short of closing by\n * a hair the round caps cover, since an arc that ends where it starts is no\n * arc at all.\n */\nfunction arcPath(centre: number, radius: number, from: number, sweep: number) {\n 'worklet'\n const span = Math.min(Math.max(sweep, DOT), TURN - DOT)\n const large = span > Math.PI ? 1 : 0\n\n // A point on the circle, `angle` radians clockwise from the top.\n function point(angle: number) {\n const x = centre + radius * Math.sin(angle)\n const y = centre - radius * Math.cos(angle)\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n return `M${point(from)}A${radius} ${radius} 0 ${large} 1 ${point(from + span)}`\n}\n\n/**\n * A stretch of the wave along a line, from `from` to `to` across its row, on a\n * wave `wavelength` long that rises first from `WAVE_ORIGIN`, as web's does.\n * Nothing when the stretch is empty, which is how a bar that has not yet\n * reached the row, or has left it, draws nothing.\n */\nfunction wavePath(wavelength: number, from: number, to: number) {\n 'worklet'\n if (to <= from) {\n return ''\n }\n\n // The point on the wave above `x`.\n function point(x: number) {\n const crest = Math.sin((TURN * (x - WAVE_ORIGIN)) / wavelength)\n const y = WAVE_HEIGHT / 2 - WAVE_AMPLITUDE * crest\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n const step = wavelength / POINTS_PER_WAVELENGTH\n let path = `M${point(from)}`\n for (\n let index = Math.floor((from - WAVE_ORIGIN) / step) + 1;\n WAVE_ORIGIN + index * step < to;\n index++\n ) {\n path += `L${point(WAVE_ORIGIN + index * step)}`\n }\n\n return `${path}L${point(to)}`\n}\n\n/**\n * A stretch of a ring's wave, clockwise from `from` for `sweep` radians, both\n * measured from the top, as `arcPath` takes them. `phase` is the angle the\n * wave rises from, which turns with a spinning ring so its crests turn with\n * it. A sweep of nothing draws a dot, as an arc's does.\n */\nfunction wavyArcPath(\n wave: RingWave,\n phase: number,\n from: number,\n sweep: number,\n) {\n 'worklet'\n const { amplitude, centre, radius, waves } = wave\n\n // The point on the wave at `angle`, clockwise from the top.\n function point(angle: number) {\n const reach = radius + amplitude * Math.sin(waves * (angle - phase))\n const x = centre + reach * Math.sin(angle)\n const y = centre - reach * Math.cos(angle)\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n const step = TURN / (waves * POINTS_PER_RING_WAVE)\n const to = from + Math.min(Math.max(sweep, DOT), TURN)\n let path = `M${point(from)}`\n for (let index = Math.floor(from / step) + 1; index * step < to; index++) {\n path += `L${point(index * step)}`\n }\n\n return `${path}L${point(to)}`\n}\n\nexport { arcPath, TURN, WAVE_HEIGHT, WAVE_ORIGIN, wavePath, wavyArcPath }\nexport type { RingWave }\n"],"mappings":";AAuBA,MAAMC,SAAS;;AAGf,MAAMC,OAAO,IAAIC,KAAKC;AAMtB,MAAMC,MAAM;AAKZ,MAAMC,iBAAiB;AACvB,MAAMC,cAAcD;AACpB,MAAME,cAAAA;AAMN,MAAMC,wBAAwB;AAC9B,MAAMC,uBAAuB;;;;;;;;AAqB7B,SAASM,QAAQH,QAAgBC,QAAgBG,MAAcC,OAAe;CAC5E;CACA,MAAMC,OAAOhB,KAAKiB,IAAIjB,KAAKkB,IAAIH,OAAOb,GAAG,GAAGH,OAAOG,GAAG;CACtD,MAAMiB,QAAQH,OAAOhB,KAAKC,KAAK,IAAI;CAGnC,SAASmB,MAAMC,OAAe;EAC5B,MAAMC,IAAIZ,SAASC,SAASX,KAAKuB,IAAIF,KAAK;EAC1C,MAAMG,IAAId,SAASC,SAASX,KAAKyB,IAAIJ,KAAK;EAC1C,OAAO,GAAGC,EAAEI,QAAQ5B,MAAM,EAAC,GAAI0B,EAAEE,QAAQ5B,MAAM;CACjD;CAEA,OAAO,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AGH,IAAI;CACrD,IAAIiC,OAAO,IAAIZ,MAAMN,IAAI;CACzB,KAAK,IAAImB,QAAQjC,KAAKkC,MAAMpB,OAAOiB,IAAI,IAAI,GAAGE,QAAQF,OAAOF,IAAII,SAC/DD,QAAQ,IAAIZ,MAAMa,QAAQF,IAAI;CAGhC,OAAO,GAAGC,KAAI,GAAIZ,MAAMS,EAAE;AAC5B"}
1
+ {"version":3,"file":"paths.js","names":["THICKNESS","PLACES","TURN","Math","PI","DOT","WAVE_AMPLITUDE","WAVE_HEIGHT","WAVE_ORIGIN","POINTS_PER_WAVELENGTH","POINTS_PER_RING_WAVE","RingWave","amplitude","centre","radius","waves","arcPath","from","sweep","span","min","max","large","point","angle","x","sin","y","cos","toFixed","shapePath","to","share","path","index","length","turnedX","turnedY","wavePath","wavelength","crest","step","floor","wavyArcPath","wave","phase","reach"],"sources":["../../src/indicator/paths.ts"],"sourcesContent":["import { THICKNESS } from './styles'\n\n// The paths a progress indicator draws its curves along: an arc of a circle,\n// an arc of a circle with a wave round it, and a wave along a line. Each is\n// built from where it starts and how far it runs, so a curve that moves is a\n// new path each frame rather than a dash pattern that moves. Beside them is\n// the shape a loading indicator morphs through, built the same way from the\n// two shapes it is between and how far it has turned.\n//\n// Web cuts its arcs and waves out of whole curves with `stroke-dasharray`,\n// normalised by `pathLength` so a dash reads as a share of the way round.\n// react-native-svg has no `pathLength`, and a dash pattern Reanimated moves\n// frame by frame is the least reliable of an svg's props across iOS, Android\n// and the web, so here the cut is made in the path itself, which every\n// platform redraws alike. The geometry is web's: the same circles, the same\n// waves, and the same lengths along them.\n//\n// Every builder is a worklet, so it runs on the UI thread with the animation\n// that moves it, and a test can call it as it stands. Each is whole on its\n// own, its helpers nested inside it: a worklet captures what it calls when the\n// module is evaluated, so one calling another declared below it would be\n// handed nothing, and the linter orders declarations by name, not by use.\n\n// Three decimal places, which keeps a path short without moving a point by\n// anything a screen could show, as web rounds its own.\nconst PLACES = 3\n\n/** A full turn, in radians. */\nconst TURN = 2 * Math.PI\n\n// The least an arc runs. Web's zero-length dash still draws, as a dot the\n// size of the stroke, since a round cap is drawn at either end of a dash of\n// any length; an svg path of no length draws nothing at all, so the arc is\n// given this much instead, which is the same dot.\nconst DOT = 0.001\n\n// The wave along the line: its amplitude either side of the middle, and the\n// row it is drawn in, which is the amplitude either side plus the stroke.\n// It starts half a stroke in, so its round cap starts at the row's edge.\nconst WAVE_AMPLITUDE = 3\nconst WAVE_HEIGHT = WAVE_AMPLITUDE * 2 + THICKNESS\nconst WAVE_ORIGIN = THICKNESS / 2\n\n// How many points a wavelength is drawn through: web draws a line's wave as\n// cubic half waves and a ring's as twenty points to a wave. A wave cut short\n// partway through a cubic would need it split, so both are drawn as points\n// here, finely enough that the joins are below what the 4dp stroke shows.\nconst POINTS_PER_WAVELENGTH = 16\nconst POINTS_PER_RING_WAVE = 20\n\n/** A circle a ring's wave runs round, and the wave. */\ntype RingWave = {\n /** How far the wave rises either side of the circle. */\n readonly amplitude: number\n /** The centre, on both axes. */\n readonly centre: number\n /** The circle's radius. */\n readonly radius: number\n /** How many crests the wave has round the whole circle. */\n readonly waves: number\n}\n\n/**\n * An arc of the circle about (`centre`, `centre`), clockwise from `from` for\n * `sweep` radians, both measured from the top. A sweep of nothing draws a dot,\n * as web's zero-length dash does, and a full turn stops short of closing by\n * a hair the round caps cover, since an arc that ends where it starts is no\n * arc at all.\n */\nfunction arcPath(centre: number, radius: number, from: number, sweep: number) {\n 'worklet'\n const span = Math.min(Math.max(sweep, DOT), TURN - DOT)\n const large = span > Math.PI ? 1 : 0\n\n // A point on the circle, `angle` radians clockwise from the top.\n function point(angle: number) {\n const x = centre + radius * Math.sin(angle)\n const y = centre - radius * Math.cos(angle)\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n return `M${point(from)}A${radius} ${radius} 0 ${large} 1 ${point(from + span)}`\n}\n\n/**\n * A loading indicator's shape `share` of the way from `from` to `to`, point by\n * point, turned `angle` radians clockwise about (`centre`, `centre`), and\n * closed. Each list holds every point's x and then its y, the two of the same\n * length, so the nth point of one becomes the nth of the other. A share past\n * 1, as a spring's overshoot gives, carries the shape on past `to`, as web's\n * interpolation of one polygon into the next does.\n */\nfunction shapePath(\n from: readonly number[],\n to: readonly number[],\n share: number,\n angle: number,\n centre: number,\n) {\n 'worklet'\n const cos = Math.cos(angle)\n const sin = Math.sin(angle)\n let path = ''\n for (let index = 0; index < from.length; index += 2) {\n const x = from[index] + (to[index] - from[index]) * share - centre\n const y =\n from[index + 1] + (to[index + 1] - from[index + 1]) * share - centre\n const turnedX = centre + x * cos - y * sin\n const turnedY = centre + x * sin + y * cos\n path += `${index === 0 ? 'M' : 'L'}${turnedX.toFixed(PLACES)} ${turnedY.toFixed(PLACES)}`\n }\n\n return `${path}Z`\n}\n\n/**\n * A stretch of the wave along a line, from `from` to `to` across its row, on a\n * wave `wavelength` long that rises first from `WAVE_ORIGIN`, as web's does.\n * Nothing when the stretch is empty, which is how a bar that has not yet\n * reached the row, or has left it, draws nothing.\n */\nfunction wavePath(wavelength: number, from: number, to: number) {\n 'worklet'\n if (to <= from) {\n return ''\n }\n\n // The point on the wave above `x`.\n function point(x: number) {\n const crest = Math.sin((TURN * (x - WAVE_ORIGIN)) / wavelength)\n const y = WAVE_HEIGHT / 2 - WAVE_AMPLITUDE * crest\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n const step = wavelength / POINTS_PER_WAVELENGTH\n let path = `M${point(from)}`\n for (\n let index = Math.floor((from - WAVE_ORIGIN) / step) + 1;\n WAVE_ORIGIN + index * step < to;\n index++\n ) {\n path += `L${point(WAVE_ORIGIN + index * step)}`\n }\n\n return `${path}L${point(to)}`\n}\n\n/**\n * A stretch of a ring's wave, clockwise from `from` for `sweep` radians, both\n * measured from the top, as `arcPath` takes them. `phase` is the angle the\n * wave rises from, which turns with a spinning ring so its crests turn with\n * it. A sweep of nothing draws a dot, as an arc's does.\n */\nfunction wavyArcPath(\n wave: RingWave,\n phase: number,\n from: number,\n sweep: number,\n) {\n 'worklet'\n const { amplitude, centre, radius, waves } = wave\n\n // The point on the wave at `angle`, clockwise from the top.\n function point(angle: number) {\n const reach = radius + amplitude * Math.sin(waves * (angle - phase))\n const x = centre + reach * Math.sin(angle)\n const y = centre - reach * Math.cos(angle)\n return `${x.toFixed(PLACES)} ${y.toFixed(PLACES)}`\n }\n\n const step = TURN / (waves * POINTS_PER_RING_WAVE)\n const to = from + Math.min(Math.max(sweep, DOT), TURN)\n let path = `M${point(from)}`\n for (let index = Math.floor(from / step) + 1; index * step < to; index++) {\n path += `L${point(index * step)}`\n }\n\n return `${path}L${point(to)}`\n}\n\nexport {\n arcPath,\n shapePath,\n TURN,\n WAVE_HEIGHT,\n WAVE_ORIGIN,\n wavePath,\n wavyArcPath,\n}\nexport type { RingWave }\n"],"mappings":";AAyBA,MAAMC,SAAS;;AAGf,MAAMC,OAAO,IAAIC,KAAKC;AAMtB,MAAMC,MAAM;AAKZ,MAAMC,iBAAiB;AACvB,MAAMC,cAAcD;AACpB,MAAME,cAAAA;AAMN,MAAMC,wBAAwB;AAC9B,MAAMC,uBAAuB;;;;;;;;AAqB7B,SAASM,QAAQH,QAAgBC,QAAgBG,MAAcC,OAAe;CAC5E;CACA,MAAMC,OAAOhB,KAAKiB,IAAIjB,KAAKkB,IAAIH,OAAOb,GAAG,GAAGH,OAAOG,GAAG;CACtD,MAAMiB,QAAQH,OAAOhB,KAAKC,KAAK,IAAI;CAGnC,SAASmB,MAAMC,OAAe;EAC5B,MAAMC,IAAIZ,SAASC,SAASX,KAAKuB,IAAIF,KAAK;EAC1C,MAAMG,IAAId,SAASC,SAASX,KAAKyB,IAAIJ,KAAK;EAC1C,OAAO,GAAGC,EAAEI,QAAQ5B,MAAM,EAAC,GAAI0B,EAAEE,QAAQ5B,MAAM;CACjD;CAEA,OAAO,IAAIsB,MAAMN,IAAI,EAAC,GAAIH,OAAM,GAAIA,OAAM,KAAMQ,MAAK,KAAMC,MAAMN,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AO,GAAGR,KAAI,GAAIV,MAAMQ,EAAE;AAC5B;;;;;;;AAQA,SAASY,YACPC,MACAC,OACA5B,MACAC,OACA;CACA;CACA,MAAM,EAAEN,WAAWC,QAAQC,QAAQC,UAAU6B;CAG7C,SAASrB,MAAMC,OAAe;EAC5B,MAAMsB,QAAQhC,SAASF,YAAYT,KAAKuB,IAAIX,SAASS,QAAQqB,MAAM;EACnE,MAAMpB,IAAIZ,SAASiC,QAAQ3C,KAAKuB,IAAIF,KAAK;EACzC,MAAMG,IAAId,SAASiC,QAAQ3C,KAAKyB,IAAIJ,KAAK;EACzC,OAAO,GAAGC,EAAEI,QAAQ5B,MAAM,EAAC,GAAI0B,EAAEE,QAAQ5B,MAAM;CACjD;CAEA,MAAMwC,OAAOvC,QAAQa,QAAQL;CAC7B,MAAMqB,KAAKd,OAAOd,KAAKiB,IAAIjB,KAAKkB,IAAIH,OAAOb,GAAG,GAAGH,IAAI;CACrD,IAAI+B,OAAO,IAAIV,MAAMN,IAAI;CACzB,KAAK,IAAIiB,QAAQ/B,KAAKuC,MAAMzB,OAAOwB,IAAI,IAAI,GAAGP,QAAQO,OAAOV,IAAIG,SAC/DD,QAAQ,IAAIV,MAAMW,QAAQO,IAAI;CAGhC,OAAO,GAAGR,KAAI,GAAIV,MAAMQ,EAAE;AAC5B"}
@@ -1,9 +1,10 @@
1
1
  import { useTheme } from "../theme/scope.js";
2
2
  import { composeStyles, themedStyles } from "../theme/styles.js";
3
3
  import { withOpacity } from "../theme/color.js";
4
- import { ButtonSlotContext } from "../button/slots.js";
4
+ import { ButtonSlotContext, ButtonTooltipContext } from "../button/slots.js";
5
5
  import { AnimatedPressable } from "../button/index.js";
6
6
  import { OverlayHost } from "../overlay/host.js";
7
+ import { SeparatorOrientationContext } from "../separator/index.js";
7
8
  import { c } from "react/compiler-runtime";
8
9
  import { AccessibilityInfo, I18nManager, Modal, Platform, StyleSheet } from "react-native";
9
10
  import { useEffect, useRef, useState } from "react";
@@ -52,88 +53,115 @@ function insetsOf(insets) {
52
53
  * and the scrim, with the surface itself as its children.
53
54
  */
54
55
  function ModalWindow(t0) {
55
- const $ = c(20);
56
- const { children, isKeyboardDismissDisabled, labelledBy, onClose, onScrimPress, scrim, title } = t0;
56
+ const $ = c(27);
57
+ const { children, isKeyboardDismissDisabled, label, labelledBy, onClose, onScrimPress, scrim, title } = t0;
57
58
  const styles = stylesOf(useTheme());
58
59
  const T0 = Modal;
59
60
  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;
61
+ const t2 = Platform.OS === "web" ? label : void 0;
62
+ const t3 = Platform.OS === "web" ? labelledBy : void 0;
63
+ const t4 = true;
64
+ const t5 = isKeyboardDismissDisabled ? ignore : onClose;
65
+ let t6;
64
66
  if ($[0] !== title) {
65
- t5 = focusOf(title);
67
+ t6 = focusOf(title);
66
68
  $[0] = title;
67
- $[1] = t5;
68
- } else t5 = $[1];
69
- const t6 = true;
70
- const t7 = ORIENTATIONS;
71
- const t8 = true;
69
+ $[1] = t6;
70
+ } else t6 = $[1];
71
+ const t7 = true;
72
+ const t8 = ORIENTATIONS;
72
73
  const t9 = true;
74
+ const t10 = true;
73
75
  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,
76
+ const t11 = null;
77
+ const T2 = ButtonTooltipContext;
78
+ const t12 = null;
79
+ const T3 = SeparatorOrientationContext;
80
+ const t13 = null;
81
+ const T4 = OverlayHost;
82
+ const T5 = AnimatedPressable;
83
+ const t14 = false;
84
+ const t15 = true;
85
+ const t16 = false;
86
+ const t17 = composeStyles(styles.scrim, scrim);
87
+ let t18;
88
+ if ($[2] !== T5 || $[3] !== onScrimPress || $[4] !== t17) {
89
+ t18 = /* @__PURE__ */ jsx(T5, {
90
+ accessible: t14,
91
+ "aria-hidden": t15,
92
+ focusable: t16,
87
93
  onPress: onScrimPress,
88
- style: t14,
94
+ style: t17,
89
95
  tabIndex: -1
90
96
  });
91
- $[2] = T3;
97
+ $[2] = T5;
92
98
  $[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;
99
+ $[4] = t17;
100
+ $[5] = t18;
101
+ } else t18 = $[5];
102
+ let t19;
103
+ if ($[6] !== T4 || $[7] !== children || $[8] !== t18) {
104
+ t19 = /* @__PURE__ */ jsxs(T4, { children: [t18, children] });
105
+ $[6] = T4;
100
106
  $[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
107
+ $[8] = t18;
108
+ $[9] = t19;
109
+ } else t19 = $[9];
110
+ let t20;
111
+ if ($[10] !== T3 || $[11] !== t19) {
112
+ t20 = /* @__PURE__ */ jsx(T3, {
113
+ value: t13,
114
+ children: t19
109
115
  });
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, {
116
+ $[10] = T3;
117
+ $[11] = t19;
118
+ $[12] = t20;
119
+ } else t20 = $[12];
120
+ let t21;
121
+ if ($[13] !== T2 || $[14] !== t20) {
122
+ t21 = /* @__PURE__ */ jsx(T2, {
123
+ value: t12,
124
+ children: t20
125
+ });
126
+ $[13] = T2;
127
+ $[14] = t20;
128
+ $[15] = t21;
129
+ } else t21 = $[15];
130
+ let t22;
131
+ if ($[16] !== T1 || $[17] !== t21) {
132
+ t22 = /* @__PURE__ */ jsx(T1, {
133
+ value: t11,
134
+ children: t21
135
+ });
136
+ $[16] = T1;
137
+ $[17] = t21;
138
+ $[18] = t22;
139
+ } else t22 = $[18];
140
+ let t23;
141
+ if ($[19] !== T0 || $[20] !== t2 || $[21] !== t22 || $[22] !== t3 || $[23] !== t5 || $[24] !== t6 || $[25] !== t8) {
142
+ t23 = /* @__PURE__ */ jsx(T0, {
117
143
  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
144
+ "aria-label": t2,
145
+ "aria-labelledby": t3,
146
+ navigationBarTranslucent: t4,
147
+ onRequestClose: t5,
148
+ onShow: t6,
149
+ statusBarTranslucent: t7,
150
+ supportedOrientations: t8,
151
+ transparent: t9,
152
+ visible: t10,
153
+ children: t22
127
154
  });
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;
155
+ $[19] = T0;
156
+ $[20] = t2;
157
+ $[21] = t22;
158
+ $[22] = t3;
159
+ $[23] = t5;
160
+ $[24] = t6;
161
+ $[25] = t8;
162
+ $[26] = t23;
163
+ } else t23 = $[26];
164
+ return t23;
137
165
  }
138
166
  function panelRoleOf(role, labelledBy) {
139
167
  if (Platform.OS === "web") return {};
@@ -1 +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,\n useModalTrigger,\n}\nexport type { ModalOpenProps, ModalTrigger }\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAM6B,YAAwB;CAAEC,QAAQ;CAAGC,MAAM;CAAGC,OAAO;CAAGC,KAAK;AAAE;AAIrE,MAAMC,eAAoD;CACxD;CACA;CACA;CACA;CACA;AAAiB;AAKnB,MAAMC,gBAAgB;AAEtB,MAAMC,WAAWR,cAAc,EAAES,aAC/BnB,WAAWoB,OAAO,EAChBC,OAAO;CACLC,iBAAiBf,YAAYY,OAAOE,OAAOJ,aAAa;CACxDL,QAAQ;CACRC,MAAM;CACNU,UAAU;CACVT,OAAO;CACPC,KAAK;AACP,EACF,CAAC,CACH;AAoCA,SAASuB,QAAQD,OAA4B;CAC3C,aAAa;EACX,IAAIA,UAAU,QAAQtC,SAASwC,OAAO,OACpC3C,kBAAkB4C,uBAAuBH,OAAO,OAAO;CAE3D;AACF;AAIA,SAASI,SAAS,CAAC;AAKnB,SAASC,SAASC,QAA+B;CAC/C,MAAMC,MAAM/C,YAAYgD;CAExB,OAAO;EACLC,eAAeH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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"}
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","ButtonTooltipContext","OverlayHost","SeparatorOrientationContext","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","label","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","t7","t9","t10","T1","t11","T2","t12","T3","t13","T4","T5","t14","t15","t16","t17","t18","t19","t20","t21","t22","t23","t8","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, ButtonTooltipContext } from '../button/slots'\nimport { OverlayHost } from '../overlay'\nimport { SeparatorOrientationContext } from '../separator'\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 /**\n * The window's name on web, for a surface with no headline to be\n * labelled by.\n */\n readonly label?: string\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 label,\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-label={Platform.OS === 'web' ? label : undefined}\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. Nor\n does a button in it take the tooltip of the one that opened it, nor\n a rule in it run the way the toolbar that opened it set. */}\n <ButtonSlotContext value={null}>\n <ButtonTooltipContext value={null}>\n <SeparatorOrientationContext value={null}>\n <OverlayHost>\n {/* A screen reader and a keyboard skip the scrim: the first\n closes the surface with the back or escape gesture, the second\n with Escape. React Native Web's Pressable is a tab stop unless\n told otherwise, whatever `focusable` says. */}\n <AnimatedPressable\n accessible={false}\n aria-hidden\n focusable={false}\n onPress={onScrimPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.scrim,\n scrim,\n )}\n tabIndex={-1}\n />\n {children}\n </OverlayHost>\n </SeparatorOrientationContext>\n </ButtonTooltipContext>\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,\n useModalTrigger,\n}\nexport type { ModalOpenProps, ModalTrigger }\n"],"mappings":";;;;;;;;;;;;;AA8CA,MAAM+B,YAAwB;CAAEC,QAAQ;CAAGC,MAAM;CAAGC,OAAO;CAAGC,KAAK;AAAE;AAIrE,MAAMC,eAAoD;CACxD;CACA;CACA;CACA;CACA;AAAiB;AAKnB,MAAMC,gBAAgB;AAEtB,MAAMC,WAAWR,cAAc,EAAES,aAC/BrB,WAAWsB,OAAO,EAChBC,OAAO;CACLC,iBAAiBf,YAAYY,OAAOE,OAAOJ,aAAa;CACxDL,QAAQ;CACRC,MAAM;CACNU,UAAU;CACVT,OAAO;CACPC,KAAK;AACP,EACF,CAAC,CACH;AAyCA,SAASwB,QAAQD,OAA4B;CAC3C,aAAa;EACX,IAAIA,UAAU,QAAQzC,SAAS2C,OAAO,OACpC9C,kBAAkB+C,uBAAuBH,OAAO,OAAO;CAE3D;AACF;AAIA,SAASI,SAAS,CAAC;AAKnB,SAASC,SAASC,QAA+B;CAC/C,MAAMC,MAAMlD,YAAYmD;CAExB,OAAO;EACLC,eAAeH,OAAOhC;EACtBoC,YAAYH,MAAMD,OAAO/B,OAAO+B,OAAO9B;EACvCmC,cAAcJ,MAAMD,OAAO9B,QAAQ8B,OAAO/B;EAC1CqC,YAAYN,OAAO7B;CACrB;AACF;;;;;AAMA,SAAAoC,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAAtB,UAAAC,2BAAAC,OAAAC,YAAAC,SAAAC,cAAAhB,OAAAiB,UAAAc;CAUnB,MAAAG,SAAerC,SAASV,SAAS,CAAC;CAG/B,MAAAgD,KAAA5D;CACe,MAAA6D,KAAA;CACF,MAAAC,KAAA7D,SAAQ2C,OAAQ,QAAhBN,QAAAyB,KAAAA;CACK,MAAAC,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