@kanso-labs/react-native-kanso-ui 0.9.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 (196) 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/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1331 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/color-area/index.d.ts +85 -0
  42. package/dist/components/color-area/index.js +630 -0
  43. package/dist/components/color-area/index.js.map +1 -0
  44. package/dist/components/color-field/index.d.ts +144 -0
  45. package/dist/components/color-field/index.js +516 -0
  46. package/dist/components/color-field/index.js.map +1 -0
  47. package/dist/components/color-picker/index.d.ts +74 -0
  48. package/dist/components/color-picker/index.js +317 -0
  49. package/dist/components/color-picker/index.js.map +1 -0
  50. package/dist/components/color-slider/index.d.ts +82 -0
  51. package/dist/components/color-slider/index.js +456 -0
  52. package/dist/components/color-slider/index.js.map +1 -0
  53. package/dist/components/color-swatch/index.d.ts +46 -0
  54. package/dist/components/color-swatch/index.js +127 -0
  55. package/dist/components/color-swatch/index.js.map +1 -0
  56. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  57. package/dist/components/color-swatch-picker/index.js +287 -0
  58. package/dist/components/color-swatch-picker/index.js.map +1 -0
  59. package/dist/components/color-wheel/index.d.ts +71 -0
  60. package/dist/components/color-wheel/index.js +407 -0
  61. package/dist/components/color-wheel/index.js.map +1 -0
  62. package/dist/components/combo-box/index.d.ts +193 -0
  63. package/dist/components/combo-box/index.js +616 -0
  64. package/dist/components/combo-box/index.js.map +1 -0
  65. package/dist/components/date-field/index.d.ts +120 -0
  66. package/dist/components/date-field/index.js +111 -0
  67. package/dist/components/date-field/index.js.map +1 -0
  68. package/dist/components/date-picker/index.d.ts +130 -0
  69. package/dist/components/date-picker/index.js +310 -0
  70. package/dist/components/date-picker/index.js.map +1 -0
  71. package/dist/components/date-range-picker/index.d.ts +139 -0
  72. package/dist/components/date-range-picker/index.js +421 -0
  73. package/dist/components/date-range-picker/index.js.map +1 -0
  74. package/dist/components/disclosure/index.d.ts +94 -0
  75. package/dist/components/disclosure/index.js +365 -0
  76. package/dist/components/disclosure/index.js.map +1 -0
  77. package/dist/components/disclosure-group/index.d.ts +61 -0
  78. package/dist/components/disclosure-group/index.js +100 -0
  79. package/dist/components/disclosure-group/index.js.map +1 -0
  80. package/dist/components/drop-zone/index.d.ts +113 -0
  81. package/dist/components/drop-zone/index.js +304 -0
  82. package/dist/components/drop-zone/index.js.map +1 -0
  83. package/dist/components/fab/index.d.ts +1 -1
  84. package/dist/components/fab/index.js +91 -76
  85. package/dist/components/fab/index.js.map +1 -1
  86. package/dist/components/form/index.d.ts +3 -2
  87. package/dist/components/form/index.js.map +1 -1
  88. package/dist/components/icon-button/index.d.ts +4 -2
  89. package/dist/components/icon-button/index.js +204 -171
  90. package/dist/components/icon-button/index.js.map +1 -1
  91. package/dist/components/list/index.d.ts +15 -158
  92. package/dist/components/list/index.js +21 -1047
  93. package/dist/components/list/index.js.map +1 -1
  94. package/dist/components/list-box/index.d.ts +73 -0
  95. package/dist/components/list-box/index.js +82 -0
  96. package/dist/components/list-box/index.js.map +1 -0
  97. package/dist/components/loading-indicator/index.d.ts +32 -0
  98. package/dist/components/loading-indicator/index.js +174 -0
  99. package/dist/components/loading-indicator/index.js.map +1 -0
  100. package/dist/components/navigation-tree/index.d.ts +117 -0
  101. package/dist/components/navigation-tree/index.js +135 -0
  102. package/dist/components/navigation-tree/index.js.map +1 -0
  103. package/dist/components/number-field/index.js +132 -143
  104. package/dist/components/number-field/index.js.map +1 -1
  105. package/dist/components/range-calendar/index.d.ts +69 -0
  106. package/dist/components/range-calendar/index.js +144 -0
  107. package/dist/components/range-calendar/index.js.map +1 -0
  108. package/dist/components/search-view/index.d.ts +78 -0
  109. package/dist/components/search-view/index.js +570 -0
  110. package/dist/components/search-view/index.js.map +1 -0
  111. package/dist/components/select/index.d.ts +152 -0
  112. package/dist/components/select/index.js +419 -0
  113. package/dist/components/select/index.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +111 -0
  115. package/dist/components/slider/index.js +673 -0
  116. package/dist/components/slider/index.js.map +1 -0
  117. package/dist/components/split-button/index.d.ts +77 -0
  118. package/dist/components/split-button/index.js +354 -0
  119. package/dist/components/split-button/index.js.map +1 -0
  120. package/dist/components/tabs/index.d.ts +196 -0
  121. package/dist/components/tabs/index.js +1137 -0
  122. package/dist/components/tabs/index.js.map +1 -0
  123. package/dist/components/time-field/index.d.ts +43 -0
  124. package/dist/components/time-field/index.js +107 -0
  125. package/dist/components/time-field/index.js.map +1 -0
  126. package/dist/components/time-picker/index.d.ts +65 -0
  127. package/dist/components/time-picker/index.js +1168 -0
  128. package/dist/components/time-picker/index.js.map +1 -0
  129. package/dist/components/tooltip/index.d.ts +101 -0
  130. package/dist/components/tooltip/index.js +223 -0
  131. package/dist/components/tooltip/index.js.map +1 -0
  132. package/dist/components/tree/index.d.ts +112 -0
  133. package/dist/components/tree/index.js +157 -0
  134. package/dist/components/tree/index.js.map +1 -0
  135. package/dist/disclosure/chevron.js +75 -0
  136. package/dist/disclosure/chevron.js.map +1 -0
  137. package/dist/disclosure/index.js +7 -0
  138. package/dist/disclosure/index.js.map +1 -0
  139. package/dist/drop/index.d.ts +54 -0
  140. package/dist/drop/index.js +161 -0
  141. package/dist/drop/index.js.map +1 -0
  142. package/dist/field/chevron.js +74 -0
  143. package/dist/field/chevron.js.map +1 -0
  144. package/dist/field/index.d.ts +2 -1
  145. package/dist/field/index.js +310 -154
  146. package/dist/field/index.js.map +1 -1
  147. package/dist/field/styles.js +9 -0
  148. package/dist/field/styles.js.map +1 -1
  149. package/dist/files/index.d.ts +18 -0
  150. package/dist/files/index.js +107 -0
  151. package/dist/files/index.js.map +1 -0
  152. package/dist/form/index.d.ts +5 -2
  153. package/dist/form/index.js +64 -85
  154. package/dist/form/index.js.map +1 -1
  155. package/dist/glyphs/index.js +92 -1
  156. package/dist/glyphs/index.js.map +1 -1
  157. package/dist/i18n/index.js +20 -1
  158. package/dist/i18n/index.js.map +1 -1
  159. package/dist/i18n/messages.js +1394 -34
  160. package/dist/i18n/messages.js.map +1 -1
  161. package/dist/index.d.ts +35 -3
  162. package/dist/index.js +34 -3
  163. package/dist/indicator/paths.js +23 -1
  164. package/dist/indicator/paths.js.map +1 -1
  165. package/dist/modal/index.js +92 -77
  166. package/dist/modal/index.js.map +1 -1
  167. package/dist/number/keyboard.js +16 -0
  168. package/dist/number/keyboard.js.map +1 -0
  169. package/dist/overlay/anchored.js +68 -38
  170. package/dist/overlay/anchored.js.map +1 -1
  171. package/dist/overlay/keyboard.js +57 -0
  172. package/dist/overlay/keyboard.js.map +1 -0
  173. package/dist/overlay/panel.js +173 -19
  174. package/dist/overlay/panel.js.map +1 -1
  175. package/dist/overlay/placement.js +13 -1
  176. package/dist/overlay/placement.js.map +1 -1
  177. package/dist/picker/index.js +322 -0
  178. package/dist/picker/index.js.map +1 -0
  179. package/dist/press/index.d.ts +2 -0
  180. package/dist/press/index.js +102 -100
  181. package/dist/press/index.js.map +1 -1
  182. package/dist/row/index.js +77 -69
  183. package/dist/row/index.js.map +1 -1
  184. package/dist/row/styles.js +13 -2
  185. package/dist/row/styles.js.map +1 -1
  186. package/dist/segments/field.js +277 -0
  187. package/dist/segments/field.js.map +1 -0
  188. package/dist/segments/index.js +574 -0
  189. package/dist/segments/index.js.map +1 -0
  190. package/dist/segments/styles.js +24 -0
  191. package/dist/segments/styles.js.map +1 -0
  192. package/dist/slider/index.js +145 -0
  193. package/dist/slider/index.js.map +1 -0
  194. package/dist/swatch/index.js +56 -0
  195. package/dist/swatch/index.js.map +1 -0
  196. package/package.json +11 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactElement","ReactNode","Ref","AccessibilityActionEvent","ColorValue","GestureResponderEvent","HostInstance","LayoutChangeEvent","ListRenderItemInfo","PressableProps","ScrollViewProps","StyleProp","TextStyle","ViewStyle","Key","Node","Selection","SelectionMode","ListState","ListProps","StatelyListProps","TreeState","Children","createContext","use","useEffect","useMemo","useRef","useState","AccessibilityInfo","FlatList","Text","NativeText","Platform","Pressable","StyleSheet","View","useListState","AutocompleteValue","ResolvedTheme","AutocompleteContext","toggleState","ProgressIndicator","CheckboxBox","ExpandChevron","resultsFor","useLocaleOf","useMessages","hitSlop","usePressFeedback","refsOf","useOpenLink","hasContent","RowContent","rowContentColor","rowStyleOf","rowStyles","useTheme","composeStyles","themedStyles","useTypeRole","BOX_SLOT","LOADING_DIAMETER","LOAD_OFFSET","INITIAL_ROWS","IDLE","CollectionLoadMoreProps","CURRENT_PAGE","const","styles","create","box","alignItems","height","justifyContent","width","idle","status","overflow","pointerEvents","position","stylesOf","colors","radii","sizing","spacing","content","paddingVertical","sm","drawerHeader","color","onSurfaceVariant","paddingBottom","xxs","paddingHorizontal","lg","md","paddingTop","empty","header","lead","flexDirection","gap","list","backgroundColor","surface","loading","minHeight","rowSm","pill","borderRadius","onSurface","CollectionKind","isLoading","label","onLoadMore","scrollOffset","style","testID","CollectionProps","Omit","children","item","T","defaultSelectedKeys","Iterable","disabledKeys","disallowEmptySelection","items","onAction","key","onSelectionChange","keys","ref","renderEmptyState","selectedKeys","selectionMode","selectLabel","CollectionRowProps","id","isDisabled","leading","overline","supporting","textValue","trailing","CollectionSectionProps","CollectionState","CollectionValue","focusKey","ground","kind","loadMore","onFocusTarget","node","route","RouteMark","state","CollectionViewProps","revealFocus","selectedRoute","Entry","current","trail","ReadonlySet","ScrollFailure","averageItemLength","index","CollectionContext","accessibilityActionOf","actions","collapse","expand","select","event","nativeEvent","actionName","childElementsOf","elements","forEach","child","push","Collection","t0","$","_c","props","t1","undefined","autocomplete","matches","t2","filterOf","filter","t3","t4","t5","CollectionView","contentContainerStyle","keyboardShouldPersistTaps","onLayout","emptyState","theme","own","entriesOf","entries","loader","rows","sticky","collection","routeMarkOf","setList","revealed","setRevealed","focusIndex","findIndex","entry","isList","listStyle","messages","t6","flatten","t7","t8","value","T0","T1","t9","t10","Math","max","t11","keyOf","t13","EmptyState","t14","LoaderRow","t15","loadMoreOf","t16","t17","revealOnLayout","t18","scrollNear","t19","t20","t21","t12","renderEntry","t22","t23","currentState","OS","EmptyRow","headline","noResults","useCollection","open","expansionOf","expandedKeys","addRow","row","has","childNodes","type","rendered","length","getChildren","nodes","keptOf","focusKeyOf","chosen","selectionManager","firstSelectedKey","hrefOf","href","kept","some","String","loaderNode","hasChildNodes","name","loadingMore","useLoadingAnnouncement","nestedRowNode","element","noop","pressThen","onPress","then","ResultsStatus","count","locale","message","useResultsAnnouncement","scrollToIndex","animated","viewPosition","find","level","found","pop","Set","rowCountOf","rowNode","RowNode","onBlur","onFocus","onHoverIn","onHoverOut","onLongPress","onPressIn","onPressOut","_children","_headline","_id","_isDisabled","_label","_textValue","openLink","tree","rowRef","disabled","checks","canSelectItem","selectable","selected","isSelected","onTrail","marked","variant","branch","expanded","toggle","toggleOf","listAction","action","acts","isEmpty","offersSelect","opens","feedback","corners","withBox","treeLead","chevron","indent","xl","lines","rowStyle","accessibilityActions","onAccessibilityAction","handlers","ring","layer","scrollToOffset","offset","SectionHeader","drawer","title","sectionNode","SelectBox","drawn","Symbol","for","toggleKey","TreeChevron","isExpanded","marginStart","Error","was","announceForAccessibility","_c","NativeText"],"sources":["../../src/collection/index.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react'\nimport type {\n AccessibilityActionEvent,\n ColorValue,\n GestureResponderEvent,\n HostInstance,\n LayoutChangeEvent,\n ListRenderItemInfo,\n PressableProps,\n ScrollViewProps,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native'\nimport type { Key, Node, Selection, SelectionMode } from 'react-stately'\nimport type {\n ListState,\n ListProps as StatelyListProps,\n} from 'react-stately/useListState'\nimport type { TreeState } from 'react-stately/useTreeState'\n\nimport {\n Children,\n createContext,\n use,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {\n AccessibilityInfo,\n FlatList,\n Text as NativeText,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport { useListState } from 'react-stately/useListState'\n\nimport type { AutocompleteValue } from '../autocomplete'\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { AutocompleteContext } from '../autocomplete'\nimport { toggleState } from '../button'\nimport { ProgressIndicator } from '../components/progress-indicator'\nimport { CheckboxBox } from '../control/checkbox-box'\nimport { ExpandChevron } from '../disclosure/chevron'\nimport { resultsFor } from '../i18n'\nimport { useLocaleOf, useMessages } from '../i18n/provider'\nimport { hitSlop, usePressFeedback } from '../press'\nimport { refsOf } from '../ref'\nimport { useOpenLink } from '../router'\nimport {\n hasContent,\n RowContent,\n rowContentColor,\n rowStyleOf,\n rowStyles,\n} from '../row'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles, themedStyles } from '../theme/styles'\nimport { useTypeRole } from '../typography/roles'\n\n// The collection kanso-ui's List and ListBox both draw, from the lists page:\n// a column of the rows ListItem draws, shared through src/row, with\n// selection, an action per row, sections and a row that loads more. It is a\n// `FlatList`, so a long collection draws the rows in view and a few screens\n// either side rather than every row it holds. List and ListBox are each this\n// with a `kind`, and differ where their web counterparts do: a List draws a\n// checkbox on a row that selects and paints a ground of its own, while a\n// ListBox marks a selected option with its container alone and is\n// transparent, so the same one sits on a page and inside a popover. A Tree\n// is a List whose state is a tree's, drawn from React Stately's tree state\n// rather than its list state: its rows nest, a row with rows under it opens\n// and closes, and the rows of an open one follow it in the same column. A\n// NavigationTree is a Tree drawn as a navigation drawer: its rows are links,\n// the one whose `href` is the route is marked with the drawer's pill, and\n// the rows it sits under with a bold label.\n//\n// Four things differ from web's, each because a screen reader or a touch on\n// a phone works differently from a keyboard in a browser.\n//\n// **A row is one element to a screen reader.** Web's List row is a grid row\n// whose checkbox is a cell a keyboard reaches on its own, and web's ListBox\n// option is an option in a listbox. VoiceOver and TalkBack read a pressable\n// row as one element and reach nothing inside it, and announce neither a\n// listbox nor an option, so a row is a button that reports whether it is\n// selected, and selecting it from a screen reader is an accessibility action\n// named by `selectLabel`. A List offers that action on every row that\n// selects, as web's checkbox is there on every one; a ListBox offers it on\n// an option whose press runs an action, the one case where a press may not\n// select. Under React Native Web a row reports itself pressed, as a toggle\n// button does, since a button cannot be selected there.\n//\n// **A press does what React Aria's touch press does.** On a row that selects\n// and has no action, a press selects it. On one with an action, a press runs\n// the action while nothing is selected and selects once something is, and a\n// long press selects; a press on a List's checkbox selects either way.\n//\n// **Sections are flattened, and so is a tree.** A `FlatList` holds one\n// column of cells, so a section is its header and then its rows, and the\n// header is a heading to a screen reader rather than the name of a group.\n// An open row of a tree is followed by the rows under it, each indented a\n// chevron's width further, so a large tree draws only what is in view. A\n// List's headers stay at the top while their rows scroll under them. A\n// ListBox's scroll with the rows, since it has no ground to cover them with.\n//\n// **A List is drawn on surface,** the lists page's container colour, which\n// web leaves to the page. A sticky header needs a ground to cover the rows\n// scrolling under it, and it takes the list's, so a `style` giving the list\n// another background gives its headers the same one.\n\n// A checkbox drawn in a row sits in a slot an icon's size, the lists page's\n// 24dp, rather than in the 40dp state layer Checkbox draws it in.\nconst BOX_SLOT = 24\n\n// The ring the loading row draws, a row's icon across.\nconst LOADING_DIAMETER = '24px'\n\n// How far past the visible end of the list `onLoadMore` is called, as a\n// share of the list's visible height, as web's `scrollOffset` defaults.\nconst LOAD_OFFSET = 1\n\n// The rows a `FlatList` draws at first, its own default, which a list grows\n// to reach the row it opens on.\nconst INITIAL_ROWS = 10\n\n// What the loading row reads when the collection has no `LoadMore` part,\n// which leaves it nothing to draw.\nconst IDLE: CollectionLoadMoreProps = {}\n\n// What marks a drawer's current row on the web, where a screen reader reads\n// it, as web's does.\nconst CURRENT_PAGE = { 'aria-current': 'page' } as const\n\nconst styles = StyleSheet.create({\n box: {\n alignItems: 'center',\n height: BOX_SLOT,\n justifyContent: 'center',\n width: BOX_SLOT,\n },\n // What the `LoadMore` part leaves while nothing is loading: the live\n // region, with nothing in it and no height.\n idle: {\n height: 0,\n },\n // The count a search leaves, which a screen reader hears and no one sees:\n // out of the flow, and a point across, as web's visually hidden status is.\n status: {\n height: 1,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n width: 1,\n },\n})\n\nconst stylesOf = themedStyles(\n ({ colors, radii, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The 8dp above the first row and below the last, as web's container\n // draws them.\n content: {\n paddingVertical: spacing.sm,\n },\n // The navigation drawer page's section heading, in on surface variant,\n // held 12dp further in than a list's, which lines it up with the labels\n // inside the rows' pills.\n drawerHeader: {\n color: colors.onSurfaceVariant,\n paddingBottom: spacing.xxs,\n paddingHorizontal: spacing.lg + spacing.md,\n paddingTop: spacing.lg,\n },\n empty: {\n color: colors.onSurfaceVariant,\n },\n // The lists page's subhead: title small in on surface variant, at the\n // row's inline padding so it lines up with the headlines under it, with\n // more room above than below so it reads as belonging to what follows.\n header: {\n color: colors.onSurfaceVariant,\n paddingBottom: spacing.xxs,\n paddingHorizontal: spacing.lg,\n paddingTop: spacing.lg,\n },\n // The checkbox beside whatever the row's leading slot was given, a\n // row's own gap apart.\n lead: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: spacing.lg,\n },\n list: {\n backgroundColor: colors.surface,\n },\n // A row's height for the ring, so the list does not jump when the next\n // items land.\n loading: {\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: sizing.rowSm,\n },\n // The corners a drawer's row clips its state layer and ripple to.\n pill: {\n borderRadius: radii.pill,\n },\n // Never seen, but in a pair that reads, for a checker that looks.\n status: {\n color: colors.onSurface,\n },\n }),\n)\n\n/**\n * Which component draws the collection: a List, whose rows that select carry\n * a checkbox and whose ground is surface, a ListBox, whose options carry\n * none and which has no ground, or a NavigationTree's drawer, whose rows are\n * links, with the current one marked, and which has no ground either.\n */\ntype CollectionKind = 'drawer' | 'list' | 'listbox'\n\ntype CollectionLoadMoreProps = {\n /**\n * Draws the ring in a row of its own while more items are being fetched.\n * @default false\n */\n readonly isLoading?: boolean\n /**\n * What a screen reader calls the ring, and hears as it appears. Left out,\n * it is the word for it in the `I18nProvider`'s language, or the device's\n * outside one, \"Loading more\" in English.\n */\n readonly label?: string\n /**\n * Called when the end of the list comes within `scrollOffset` of its\n * visible end, while nothing is loading. Called once for each length the\n * list reaches, so a load that adds nothing does not start another.\n */\n readonly onLoadMore?: () => void\n /**\n * How far past the visible end of the list the next items are asked for,\n * as a share of the list's visible height.\n * @default 1\n */\n readonly scrollOffset?: number\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype CollectionProps<T extends object = object> = Omit<\n ScrollViewProps,\n 'children' | 'role' | 'stickyHeaderIndices' | 'style'\n> & {\n /**\n * The rows, each an `Item`, `Section` or `LoadMore` part. With `items`, a\n * function from an item to its part, called for each item in turn.\n */\n readonly children?: ((item: T) => ReactElement) | ReactNode\n /** The keys selected at first, when the list keeps its own selection. */\n readonly defaultSelectedKeys?: 'all' | Iterable<Key>\n /** The keys of the rows drawn disabled, which take no presses. */\n readonly disabledKeys?: Iterable<Key>\n /**\n * Keeps the last selected row selected, so a press on it changes nothing.\n * @default false\n */\n readonly disallowEmptySelection?: boolean\n /** The entries `children` draws a part for, when it is a function. */\n readonly items?: Iterable<T>\n /**\n * Called with a row's key when a press runs its action. A row's own\n * `onAction` takes its place for that row.\n */\n readonly onAction?: (key: Key) => void\n /** Called with the selected keys whenever a press changes them. */\n readonly onSelectionChange?: (keys: Selection) => void\n readonly ref?: Ref<FlatList>\n /**\n * What the list shows when it has no rows and nothing is loading. Left\n * out, it is a muted row saying \"No results\" in the `I18nProvider`'s\n * language, or the device's outside one, so the list keeps a row's height.\n */\n readonly renderEmptyState?: () => ReactNode\n /**\n * The selected keys, for a call site holding the selection itself with\n * `onSelectionChange`.\n */\n readonly selectedKeys?: 'all' | Iterable<Key>\n /**\n * Whether rows can be selected: one at a time, several, or none.\n * @default 'none'\n */\n readonly selectionMode?: SelectionMode\n /**\n * What selecting a row is called, for a screen reader: the accessibility\n * action that selects a row whose press may do something else. The row's\n * own text is what names the row. Left out, it is the word for it in the\n * `I18nProvider`'s language, or the device's outside one, \"Select\" in\n * English.\n */\n readonly selectLabel?: string\n readonly style?: StyleProp<ViewStyle>\n}\n\ntype CollectionRowProps = Omit<\n PressableProps,\n 'children' | 'disabled' | 'id' | 'role' | 'style'\n> & {\n /** The row's headline, the one thing it is mostly about. */\n readonly children?: ReactNode\n /** The key the row is selected and reported by. Give one to every row. */\n readonly id?: Key\n /**\n * Draws the row disabled, and takes no presses on it, as a key in the\n * list's `disabledKeys` does.\n * @default false\n */\n readonly isDisabled?: boolean\n /** Content before the headline: an avatar, an icon. */\n readonly leading?: ReactNode\n /**\n * Called when a press runs the row's action, in place of the list's\n * `onAction` for this row.\n */\n readonly onAction?: () => void\n /**\n * A line above the headline, in label small and the muted role. Given\n * beside `supporting`, it makes the row the three-line item.\n */\n readonly overline?: ReactNode\n readonly ref?: Ref<HostInstance>\n readonly style?: StyleProp<ViewStyle>\n /** A second line under the headline, in body medium and the muted role. */\n readonly supporting?: ReactNode\n /**\n * The row's text, read off `children` when they are a plain string, so a\n * row whose headline is an element passes it.\n */\n readonly textValue?: string\n /** Content after the headline, such as an amount or a control. */\n readonly trailing?: ReactNode\n}\n\ntype CollectionSectionProps = {\n /** The rows in the section. */\n readonly children?: ReactNode\n /**\n * The section's heading, a heading to a screen reader. A section without\n * one is its rows alone.\n */\n readonly header?: ReactNode\n readonly id?: Key\n}\n\n/**\n * The state a collection is drawn from: a list's, or a tree's, which holds\n * which rows are open beside what a list's holds.\n */\ntype CollectionState<T> = ListState<T> | TreeState<T>\n\n// What the cells of the `FlatList` read from the collection they are drawn\n// in.\ntype CollectionValue = {\n /** The row whose node goes to `onFocusTarget`. */\n readonly focusKey: Key | null\n /**\n * The ground a List's sticky header covers the rows under it with, and\n * none for a ListBox, whose headers do not stick.\n */\n readonly ground: ColorValue | undefined\n readonly kind: CollectionKind\n /** The `LoadMore` part the collection ends in, if it has one. */\n readonly loadMore: CollectionLoadMoreProps | undefined\n readonly onAction: ((key: Key) => void) | undefined\n readonly onFocusTarget: ((node: HostInstance | null) => void) | undefined\n readonly renderEmptyState: () => ReactNode\n /** Where a drawer's route is among its rows, and nothing for the others. */\n readonly route: RouteMark | undefined\n readonly selectLabel: string\n readonly state: CollectionState<unknown>\n}\n\ntype CollectionViewProps<T extends object = object> = Omit<\n CollectionProps<T>,\n | 'children'\n | 'defaultSelectedKeys'\n | 'disabledKeys'\n | 'disallowEmptySelection'\n | 'items'\n | 'onSelectionChange'\n | 'selectedKeys'\n | 'selectionMode'\n> & {\n /** The row whose node is handed to `onFocusTarget`, if any. */\n readonly focusKey?: Key | null\n readonly kind: CollectionKind\n /** Handed the node of the row `focusKey` names, as it mounts and goes. */\n readonly onFocusTarget?: (node: HostInstance | null) => void\n /**\n * Scrolls the row `focusKey` names into view, once, the first time the\n * list is laid out while this holds: a panel passes it once it has been\n * placed, and so has the height it scrolls in.\n * @default false\n */\n readonly revealFocus?: boolean\n /**\n * A drawer's current route, matched against each row's `href`: the row it\n * matches is the current one, and the rows above it are its trail.\n */\n readonly selectedRoute?: string | undefined\n /**\n * The list state the rows are drawn from, and select through, or a tree\n * state, which opens and closes them too.\n */\n readonly state: CollectionState<T>\n}\n\n/** One cell of the `FlatList`: a section's header, or a row. */\ntype Entry = {\n readonly kind: 'header' | 'item'\n readonly node: Node<unknown>\n}\n\n/**\n * The row of a drawer whose `href` is the route, and the rows it sits\n * under, at every depth.\n */\ntype RouteMark = {\n readonly current: Key | null\n readonly trail: ReadonlySet<Key>\n}\n\n/** What a `FlatList` reports when it cannot scroll to a row. */\ntype ScrollFailure = {\n readonly averageItemLength: number\n readonly index: number\n}\n\nconst CollectionContext = createContext<CollectionValue | null>(null)\n\n// Runs what a screen reader asks of a row: selecting it, or opening or\n// closing a tree's row, each where the row offers it.\nfunction accessibilityActionOf(actions: {\n readonly collapse: (() => void) | undefined\n readonly expand: (() => void) | undefined\n readonly select: (() => void) | undefined\n}) {\n return (event: AccessibilityActionEvent) => {\n switch (event.nativeEvent.actionName) {\n case 'collapse': {\n actions.collapse?.()\n break\n }\n case 'expand': {\n actions.expand?.()\n break\n }\n case 'select': {\n actions.select?.()\n break\n }\n }\n }\n}\n\n/**\n * The parts nested in a part, a Section's rows or a Tree row's, walked as\n * React Stately's own Section walks them, which leaves each child its own\n * key rather than the one `Children.toArray` gives it. A condition left\n * false is no part: React hands a boolean or an undefined child over as\n * null.\n */\nfunction childElementsOf(children: ReactNode): ReactNode[] {\n const elements: ReactNode[] = []\n\n Children.forEach(children, (child) => {\n if (child !== null) {\n elements.push(child)\n }\n })\n\n return elements\n}\n\n/**\n * The `FlatList` List and ListBox draw, from parts read off its children by\n * React Stately's list state. Inside an `Autocomplete`, it shows the rows the\n * search keeps and says how many there are to a screen reader, and a tap on\n * a row reaches it while the keyboard is up.\n */\nfunction Collection<T extends object = object>({\n children,\n defaultSelectedKeys,\n disabledKeys,\n disallowEmptySelection,\n items,\n onSelectionChange,\n selectedKeys,\n selectionMode = 'none',\n ...props\n}: CollectionProps<T> & { readonly kind: CollectionKind }) {\n const autocomplete = use(AutocompleteContext)\n const matches = autocomplete?.matches\n const filter = useMemo(\n () => (matches === undefined ? undefined : filterOf<T>(matches)),\n [matches],\n )\n const state = useListState<T>({\n // Each part builds its own entry in the collection; see `rowNode` and\n // the two beside it. The collection skips what is not an element, as a\n // ReactNode may be, and asks any element for its entry.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see above\n children: children as StatelyListProps<T>['children'],\n defaultSelectedKeys,\n disabledKeys,\n disallowEmptySelection,\n filter,\n items,\n onSelectionChange,\n selectedKeys,\n selectionMode,\n })\n\n return <CollectionView<T> {...props} state={state} />\n}\n\n/**\n * The `FlatList` itself, drawn from a list state built elsewhere: by\n * `Collection` from its own props, or by a component whose state holds more\n * than a list's, as a Select's holds whether it is open and a Tree's which\n * rows are. `focusKey` names the\n * row whose node is handed to `onFocusTarget`, for a panel that sends a\n * screen reader to it as it opens.\n */\nfunction CollectionView<T extends object = object>({\n contentContainerStyle,\n focusKey = null,\n keyboardShouldPersistTaps,\n kind,\n onAction,\n onFocusTarget,\n onLayout,\n ref,\n renderEmptyState = emptyState,\n revealFocus = false,\n selectedRoute,\n selectLabel,\n state,\n style,\n ...props\n}: CollectionViewProps<T>) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const autocomplete = use(AutocompleteContext)\n const { entries, loader, rows, sticky } = useMemo(\n () => entriesOf(state),\n [state],\n )\n const route = useMemo(\n () =>\n kind === 'drawer'\n ? routeMarkOf(state.collection, selectedRoute)\n : undefined,\n [kind, selectedRoute, state.collection],\n )\n const [list, setList] = useState<FlatList | null>(null)\n const [revealed, setRevealed] = useState(false)\n const focusIndex =\n focusKey === null\n ? -1\n : entries.findIndex(\n (entry) => entry.kind === 'item' && entry.node.key === focusKey,\n )\n const isList = kind === 'list'\n const listStyle = composeStyles<ViewStyle>(\n isList ? own.list : undefined,\n style,\n )\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- a node carries the props its part was written with, which React Stately types as `any`\n const loadMore: CollectionLoadMoreProps | undefined = loader?.props\n const isLoading = loadMore?.isLoading ?? false\n const messages = useMessages()\n // A List's own ground unless `style` gives it another.\n const ground = isList\n ? (StyleSheet.flatten(style)?.backgroundColor ?? theme.colors.surface)\n : undefined\n const value = useMemo<CollectionValue>(\n () => ({\n focusKey,\n ground,\n kind,\n loadMore,\n onAction,\n onFocusTarget,\n renderEmptyState,\n route,\n selectLabel: selectLabel ?? messages.select,\n state,\n }),\n [\n focusKey,\n ground,\n kind,\n loadMore,\n messages,\n onAction,\n onFocusTarget,\n renderEmptyState,\n route,\n selectLabel,\n state,\n ],\n )\n\n return (\n <CollectionContext value={value}>\n <FlatList\n {...props}\n contentContainerStyle={composeStyles<ViewStyle>(\n own.content,\n contentContainerStyle,\n )}\n data={entries}\n // Enough rows drawn at first to hold the one a screen reader is sent\n // to, which has to be there to be sent to.\n initialNumToRender={Math.max(INITIAL_ROWS, focusIndex + 1)}\n keyboardShouldPersistTaps={\n keyboardShouldPersistTaps ??\n (autocomplete === null ? undefined : 'handled')\n }\n keyExtractor={keyOf}\n ListEmptyComponent={isLoading ? undefined : EmptyState}\n ListFooterComponent={loadMore === undefined ? undefined : LoaderRow}\n onEndReached={loadMore === undefined ? undefined : loadMoreOf(loadMore)}\n onEndReachedThreshold={loadMore?.scrollOffset ?? LOAD_OFFSET}\n onLayout={revealOnLayout(onLayout, {\n index: revealFocus && !revealed ? focusIndex : -1,\n list,\n setRevealed,\n })}\n onScrollToIndexFailed={scrollNear(list)}\n ref={refsOf(setList, ref)}\n renderItem={renderEntry}\n stickyHeaderIndices={isList ? sticky : undefined}\n style={listStyle}\n />\n {autocomplete === null ? null : <ResultsStatus count={rows} />}\n </CollectionContext>\n )\n}\n\n// What a drawer's row reports of being the current one. Native has no\n// counterpart to `aria-current`, so there the current row reports itself\n// selected, as NavigationBar's current destination does, which VoiceOver and\n// TalkBack both read out. Read as the row draws, as Breadcrumbs reads it.\nfunction currentState(current: boolean) {\n if (Platform.OS !== 'web') {\n return { 'aria-selected': current }\n }\n return current ? CURRENT_PAGE : undefined\n}\n\n/**\n * The muted row a list shows when nothing is in it: a row's box and\n * headline in on surface variant, with no press of its own.\n */\nfunction EmptyRow() {\n const theme = useTheme()\n const own = stylesOf(theme)\n const headline = useTypeRole('bodyLarge')\n const messages = useMessages()\n\n return (\n <View style={rowStyleOf(theme, {})}>\n <NativeText style={composeStyles<TextStyle>(headline, own.empty)}>\n {messages.noResults}\n </NativeText>\n </View>\n )\n}\n\n// What the list shows when nothing is in it.\nfunction emptyState() {\n return <EmptyRow />\n}\n\n// The list's empty state, as the component `ListEmptyComponent` takes.\nfunction EmptyState() {\n return <>{useCollection().renderEmptyState()}</>\n}\n\n/**\n * The cells the `FlatList` draws, in order, where the headers among them\n * are, and how many rows there are: the rows outside any section, and each\n * section's header followed by its rows, with the rows under each open row\n * of a tree after it. The row that loads more is drawn after them all.\n */\nfunction entriesOf<T>(state: CollectionState<T>) {\n const entries: Entry[] = []\n const sticky: number[] = []\n const open = expansionOf(state)?.expandedKeys\n let loader: Node<T> | undefined\n let rows = 0\n\n const addRow = (row: Node<T>) => {\n entries.push({ kind: 'item', node: row })\n rows++\n if (open?.has(row.key) === true) {\n // oxlint-disable-next-line typescript/no-deprecated -- a tree's collection has no getChildren, and this is the field it reads a row's rows from itself\n for (const child of row.childNodes) {\n if (child.type === 'item') {\n addRow(child)\n }\n }\n }\n }\n\n for (const node of state.collection) {\n if (node.type === 'loader') {\n loader = node\n } else if (node.type === 'section') {\n if (hasContent(node.rendered)) {\n sticky.push(entries.length)\n entries.push({ kind: 'header', node })\n }\n const children =\n state.collection.getChildren?.(node.key) ??\n // oxlint-disable-next-line typescript/no-deprecated -- a fallback for a collection without getChildren\n node.childNodes\n for (const row of children) {\n addRow(row)\n }\n } else {\n addRow(node)\n }\n }\n\n return { entries, loader, rows, sticky }\n}\n\n/**\n * The tree state a collection is drawn from, which says which rows are open\n * and opens and closes them, or null for a list's, as React Aria tells the\n * two apart.\n */\nfunction expansionOf<T>(state: CollectionState<T>): null | TreeState<T> {\n return 'expandedKeys' in state ? state : null\n}\n\n/**\n * What a list inside an Autocomplete builds its collection from: the rows\n * the search keeps, each section with a row left in it, and the row that\n * loads more. Each node is copied rather than handed on, as React Stately's\n * ComboBox copies its own, since a collection numbers the nodes it holds.\n */\nfunction filterOf<T>(matches: AutocompleteValue['matches']) {\n return (nodes: Iterable<Node<T>>) => keptOf(nodes, matches)\n}\n\n/**\n * The row a screen reader is sent to as a panel holding the list opens: the\n * first one chosen, or the first that takes a press where none is.\n */\nfunction focusKeyOf<T>(state: ListState<T>): Key | null {\n const chosen = state.selectionManager.firstSelectedKey\n\n if (chosen !== null) {\n return chosen\n }\n\n for (const node of state.collection) {\n if (node.type === 'item' && !state.disabledKeys.has(node.key)) {\n return node.key\n }\n\n if (node.type === 'section') {\n for (const row of state.collection.getChildren?.(node.key) ?? []) {\n if (!state.disabledKeys.has(row.key)) {\n return row.key\n }\n }\n }\n }\n\n return null\n}\n\n// The `href` a drawer's row was written with.\nfunction hrefOf(node: Node<unknown>): string | undefined {\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- a node carries the props its row was written with, which React Stately types as `any`\n const { href }: { readonly href?: string } = node.props\n return href\n}\n\nfunction keptOf<T>(\n nodes: Iterable<Node<T>>,\n matches: AutocompleteValue['matches'],\n): Node<T>[] {\n const kept: Node<T>[] = []\n\n for (const node of nodes) {\n if (node.type === 'section') {\n // oxlint-disable-next-line typescript/no-deprecated -- a filter is handed the nodes before a collection holds them, so there is none to ask\n const rows = keptOf(node.childNodes, matches)\n\n if (rows.some((row) => row.type === 'item')) {\n // oxlint-disable-next-line typescript/no-deprecated -- the field the collection reads a section's rows from\n kept.push({ ...node, childNodes: rows })\n }\n } else if (node.type !== 'item' || matches(node.textValue, node)) {\n kept.push({ ...node })\n }\n }\n\n return kept\n}\n\n// A cell's key in the `FlatList`: a header's and a row's apart, since a\n// section's header carries the section's key.\nfunction keyOf({ kind, node }: Entry) {\n return `${kind}:${String(node.key)}`\n}\n\n// The entry the collection holds for a `LoadMore` part.\nfunction* loaderNode(props: CollectionLoadMoreProps) {\n yield { hasChildNodes: false, props, rendered: null, type: 'loader' }\n}\n\n/**\n * The row the `LoadMore` part draws: a live region, empty while idle and\n * holding the ring while loading. Android and React Native Web say what\n * arrives in it; iOS has no live regions, so the ring's name is said there\n * as it appears.\n */\nfunction LoaderRow() {\n const own = stylesOf(useTheme())\n const {\n isLoading = false,\n label,\n style,\n testID,\n } = useCollection().loadMore ?? IDLE\n const messages = useMessages()\n const name = label ?? messages.loadingMore\n\n useLoadingAnnouncement(isLoading, name)\n\n return (\n <View\n aria-live=\"polite\"\n style={composeStyles<ViewStyle>(\n isLoading ? own.loading : styles.idle,\n style,\n )}\n testID={testID}\n >\n {isLoading ? (\n <ProgressIndicator\n aria-label={name}\n diameter={LOADING_DIAMETER}\n isIndeterminate\n variant=\"circular\"\n />\n ) : null}\n </View>\n )\n}\n\n// Asks for more as the reader nears the end, unless a load is under way.\nfunction loadMoreOf({\n isLoading = false,\n onLoadMore,\n}: CollectionLoadMoreProps) {\n return () => {\n if (!isLoading) {\n onLoadMore?.()\n }\n }\n}\n\n// The entry the collection holds for a tree's `Item` part: keyed by the\n// row's `id`, carrying the props it is drawn from, and holding the rows\n// nested in it, which the collection reads only while the row is open. What\n// the row draws as its first line and what that is worth as text are the\n// part's own, a Tree's headline and a NavigationTree's label.\nfunction* nestedRowNode(\n props: {\n readonly 'aria-label'?: string\n readonly children?: ReactNode\n readonly id?: Key\n },\n rendered: ReactNode,\n textValue: string,\n) {\n const children = childElementsOf(props.children)\n\n yield {\n 'aria-label': props['aria-label'],\n *childNodes() {\n for (const element of children) {\n yield { element }\n }\n },\n hasChildNodes: children.length > 0,\n key: props.id,\n props,\n rendered,\n textValue,\n type: 'item',\n }\n}\n\nfunction noop() {\n // A press on a row with nothing to do runs the call site's `onPress` alone.\n}\n\n/**\n * The press handler of a row: the call site's own handler, then the row's.\n * Built by a call rather than written inline at the prop, which is what\n * react-perf's no-new-function-as-prop is after.\n */\nfunction pressThen(\n onPress: PressableProps['onPress'],\n then: (() => void) | undefined,\n) {\n return (event: GestureResponderEvent) => {\n onPress?.(event)\n then?.()\n }\n}\n\n// One cell, drawn as the part it came from.\nfunction renderEntry({ item }: ListRenderItemInfo<Entry>) {\n return item.kind === 'header' ? (\n <SectionHeader node={item.node} />\n ) : (\n <RowNode node={item.node} />\n )\n}\n\n/**\n * How many rows a search leaves, said to a screen reader as it changes and\n * never drawn: in a polite live region on Android and under React Native\n * Web, and through `AccessibilityInfo` on iOS, which has no live regions,\n * so nothing is drawn there at all. A `count` of `null` says nothing, for a\n * list that is closed, so the count is said again as it opens.\n */\nfunction ResultsStatus({ count }: { readonly count: null | number }) {\n const own = stylesOf(useTheme())\n const locale = useLocaleOf(undefined)\n const message = count === null ? '' : resultsFor(count, locale)\n\n useResultsAnnouncement(message)\n\n if (Platform.OS === 'ios') {\n return null\n }\n\n return (\n <View aria-live=\"polite\" style={styles.status}>\n <NativeText style={own.status}>{message}</NativeText>\n </View>\n )\n}\n\n/**\n * The list's layout handler: the call site's own, then a scroll that brings\n * the row at `index` into view, once, where there is one to reveal. The row\n * goes to the bottom of the list where it was below the fold, and a row\n * already in view stays where it is: scrolled to put a row at the bottom, a\n * list never scrolls past its end, and one that would have to scroll back\n * above its start stays at the top.\n */\nfunction revealOnLayout(\n onLayout: ((event: LayoutChangeEvent) => void) | undefined,\n {\n index,\n list,\n setRevealed,\n }: {\n readonly index: number\n readonly list: FlatList | null\n readonly setRevealed: (revealed: boolean) => void\n },\n) {\n return (event: LayoutChangeEvent) => {\n onLayout?.(event)\n if (index > 0 && list !== null) {\n setRevealed(true)\n list.scrollToIndex({ animated: false, index, viewPosition: 1 })\n }\n }\n}\n\n// The route's row among a drawer's rows, found through every row, open or\n// not, since a current row closed out of sight still marks its trail.\nfunction routeMarkOf<T>(\n nodes: Iterable<Node<T>>,\n selectedRoute: string | undefined,\n): RouteMark {\n const trail: Key[] = []\n const find = (level: Iterable<Node<T>>): Key | null => {\n for (const node of level) {\n if (node.type === 'item' && hrefOf(node) === selectedRoute) {\n return node.key\n }\n if (node.type === 'item') {\n trail.push(node.key)\n }\n // oxlint-disable-next-line typescript/no-deprecated -- a tree's collection holds only the rows on show, and the route may be under a closed one\n const found = find(node.childNodes)\n\n if (found !== null) {\n return found\n }\n if (node.type === 'item') {\n trail.pop()\n }\n }\n return null\n }\n const current = selectedRoute === undefined ? null : find(nodes)\n\n return { current, trail: new Set(current === null ? [] : trail) }\n}\n\n// How many rows the list holds, the ones inside sections among them.\nfunction rowCountOf<T>(state: ListState<T>) {\n return entriesOf(state).rows\n}\n\n// The entry the collection holds for an `Item` part, as React Stately's own\n// `Item` gives one: keyed by the row's `id`, and carrying the props it is\n// drawn from.\nfunction* rowNode(props: CollectionRowProps) {\n yield {\n 'aria-label': props['aria-label'],\n hasChildNodes: false,\n key: props.id,\n props,\n rendered: props.children,\n textValue:\n props.textValue ??\n (typeof props.children === 'string' ? props.children : ''),\n type: 'item',\n }\n}\n\n/**\n * A row: the state layer, the ripple and the focus ring over the leading\n * slot, the lines and the trailing slot, on primary container while\n * selected, with a List's checkbox before them on a row that selects. A\n * Tree's row is indented by its depth and starts with its chevron, or a\n * chevron's space on a row with nothing under it. A row with nothing to do\n * on a press, in a collection that neither selects nor acts, is a `View`\n * that only presents.\n */\nfunction RowNode({ node }: { readonly node: Node<unknown> }) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const collection = useCollection()\n const messages = useMessages()\n\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- a node carries the props its row was written with, which React Stately types as `any`\n const {\n children: _children,\n headline: _headline,\n href,\n id: _id,\n isDisabled: _isDisabled,\n label: _label,\n leading,\n onAction,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n overline,\n ref,\n style,\n supporting,\n textValue: _textValue,\n trailing,\n ...props\n }: CollectionRowProps & {\n readonly headline?: ReactNode\n readonly href?: string\n readonly label?: ReactNode\n } = node.props\n const isList = collection.kind === 'list'\n const { route } = collection\n const openLink = useOpenLink()\n const { selectionManager } = collection.state\n const tree = expansionOf(collection.state)\n const { key } = node\n const rowRef =\n key === collection.focusKey ? refsOf(collection.onFocusTarget, ref) : ref\n // The selection manager reads a row's own `isDisabled` off its entry,\n // beside the list's `disabledKeys`, so it answers for both.\n const disabled = selectionManager.isDisabled(key)\n const checks = selectionManager.selectionMode !== 'none'\n const selectable = selectionManager.canSelectItem(key)\n const selected = checks && selectionManager.isSelected(key)\n // A drawer's row whose `href` is the route, drawn as a selected row is,\n // and the rows it sits under, whose labels are drawn bold.\n const current = route?.current === key\n const onTrail = route?.trail.has(key) === true\n const marked = selected || current\n const variant = route === undefined ? undefined : 'drawer'\n // A tree's row with rows under it, which opens and closes.\n const branch = tree !== null && node.hasChildNodes\n const expanded = branch && tree.expandedKeys.has(key)\n const toggle = toggleOf(tree, key)\n const listAction = collection.onAction\n // A row with an `href` goes there. Otherwise, React Aria's rule for a tree\n // that neither selects nor acts: a press on a row with rows under it opens\n // or closes it.\n const action =\n onAction ??\n (href === undefined\n ? listAction === undefined\n ? branch && !checks\n ? toggle\n : undefined\n : () => {\n listAction(key)\n }\n : () => {\n openLink(href)\n })\n // React Aria's rule for a touch press on a row that selects: the action\n // while nothing is selected, the selection after.\n const acts = action !== undefined && (!selectable || selectionManager.isEmpty)\n // A List's row offers the select action wherever its checkbox does; a\n // ListBox's option only where a press may run its action instead.\n const offersSelect = selectable && (isList || action !== undefined)\n // A row that opens offers the one of the two it can do, as web names its\n // chevron, and a disabled one neither.\n const opens = branch && !disabled\n const select = () => {\n selectionManager.select(key)\n }\n const content = rowContentColor(theme, {\n isDisabled: disabled,\n isSelected: marked,\n variant,\n })\n const feedback = usePressFeedback({\n color: content,\n corners: route === undefined ? undefined : own.pill,\n disabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n })\n\n const box =\n isList && checks ? (\n <SelectBox\n isDisabled={disabled}\n isSelected={selected}\n onPress={acts && selectable ? select : undefined}\n />\n ) : null\n const lead =\n tree === null\n ? box === null\n ? leading\n : withBox(box, leading, own.lead)\n : treeLead({\n box,\n // The muted role at rest, as web draws the chevron, and the row's\n // own colour where the muted role would not read.\n chevron: branch ? (\n <TreeChevron\n color={\n disabled || marked ? content : theme.colors.onSurfaceVariant\n }\n isDisabled={disabled}\n isExpanded={expanded}\n onPress={toggle}\n />\n ) : null,\n indent: node.level * theme.spacing.xl,\n leading,\n style: own.lead,\n })\n const lines = (\n <RowContent\n isDisabled={disabled}\n isEmphasized={onTrail}\n isSelected={marked}\n leading={lead}\n overline={overline}\n supporting={supporting}\n trailing={trailing}\n variant={variant}\n >\n {node.rendered}\n </RowContent>\n )\n const rowStyle = rowStyleOf(theme, {\n isSelected: marked,\n overline,\n supporting,\n variant,\n })\n const accessibilityActions = [\n ...(offersSelect\n ? [{ label: collection.selectLabel, name: 'select' }]\n : []),\n ...(opens\n ? [\n expanded\n ? { label: messages.collapse, name: 'collapse' }\n : { label: messages.expand, name: 'expand' },\n ]\n : []),\n ]\n\n if (!checks && action === undefined && onPress === undefined) {\n return (\n <View\n aria-disabled={disabled || undefined}\n ref={rowRef}\n style={composeStyles<ViewStyle>(rowStyle, style)}\n testID={props.testID}\n >\n {lines}\n </View>\n )\n }\n\n return (\n <Pressable\n role={href === undefined ? 'button' : 'link'}\n {...props}\n {...(checks ? toggleState(selected) : undefined)}\n {...(route === undefined ? undefined : currentState(current))}\n {...(branch ? { 'aria-expanded': expanded } : undefined)}\n {...(accessibilityActions.length > 0\n ? {\n accessibilityActions,\n onAccessibilityAction: accessibilityActionOf({\n collapse: opens && expanded ? toggle : undefined,\n expand: opens && !expanded ? toggle : undefined,\n select: offersSelect ? select : undefined,\n }),\n }\n : undefined)}\n {...feedback.handlers}\n disabled={disabled}\n onLongPress={\n action !== undefined && selectable\n ? pressThen(onLongPress, select)\n : onLongPress\n }\n onPress={pressThen(onPress, acts ? action : selectable ? select : noop)}\n ref={rowRef}\n style={composeStyles<ViewStyle>(\n rowStyle,\n feedback.ring,\n feedback.ring === undefined ? undefined : rowStyles.ring,\n style,\n )}\n >\n {feedback.layer}\n {lines}\n </Pressable>\n )\n}\n\n/**\n * Where a row the list has not measured yet is reached: as far down as rows\n * of the average height would put it, which a `FlatList` asks for in place\n * of scrolling to a row it cannot place.\n */\nfunction scrollNear(list: FlatList | null) {\n return ({ averageItemLength, index }: ScrollFailure) => {\n list?.scrollToOffset({\n animated: false,\n offset: averageItemLength * index,\n })\n }\n}\n\n/**\n * A section's heading: on a List's ground, so the rows pass under it as it\n * sticks, and on none in a ListBox, where it scrolls with them.\n */\nfunction SectionHeader({ node }: { readonly node: Node<unknown> }) {\n const own = stylesOf(useTheme())\n const { ground, kind } = useCollection()\n const drawer = kind === 'drawer'\n // The lists page's subhead is title small, and the drawer page's label\n // large.\n const title = useTypeRole(drawer ? 'labelLarge' : 'titleSmall')\n\n return (\n <View\n style={\n ground === undefined\n ? undefined\n : composeStyles<ViewStyle>({ backgroundColor: ground })\n }\n >\n <NativeText\n role=\"heading\"\n style={composeStyles<TextStyle>(\n title,\n drawer ? own.drawerHeader : own.header,\n )}\n >\n {node.rendered}\n </NativeText>\n </View>\n )\n}\n\n// The entry the collection holds for a `Section` part.\nfunction* sectionNode(props: CollectionSectionProps) {\n const children = childElementsOf(props.children)\n\n yield {\n *childNodes() {\n for (const element of children) {\n yield { element }\n }\n },\n hasChildNodes: true,\n key: props.id,\n props,\n rendered: props.header,\n type: 'section',\n }\n}\n\n/**\n * The checkbox a List's selecting row draws, for the eye alone: the row is\n * what a screen reader hears and presses. On a row whose press runs an\n * action, a touch on the box selects instead, through a press of its own the\n * size of a 48dp target, hidden from the reader as the box is.\n */\nfunction SelectBox({\n isDisabled,\n isSelected,\n onPress,\n}: {\n readonly isDisabled: boolean\n readonly isSelected: boolean\n readonly onPress: (() => void) | undefined\n}) {\n const drawn = (\n <CheckboxBox\n isDisabled={isDisabled}\n isSelected={isSelected}\n within={BOX_SLOT}\n />\n )\n\n if (onPress === undefined) {\n return <View style={styles.box}>{drawn}</View>\n }\n\n return (\n <Pressable\n accessible={false}\n aria-hidden\n disabled={isDisabled}\n focusable={false}\n hitSlop={hitSlop(BOX_SLOT, BOX_SLOT)}\n onPress={onPress}\n style={styles.box}\n tabIndex={-1}\n >\n {drawn}\n </Pressable>\n )\n}\n\n/**\n * Opens a tree's row, or closes it when it is open. Built by a call rather\n * than written inline, which is what react-perf's\n * no-new-function-as-prop is after.\n */\nfunction toggleOf(tree: null | TreeState<unknown>, key: Key) {\n return () => {\n tree?.toggleKey(key)\n }\n}\n\n/**\n * The chevron a Tree's row with rows under it draws, which opens and closes\n * it, for the eye and the finger alone: the row is what a screen reader\n * hears, and opens or closes through its actions. It takes a press of its\n * own the size of a 48dp target, and draws no state layer, since the row\n * around it already carries one.\n */\nfunction TreeChevron({\n color,\n isDisabled,\n isExpanded,\n onPress,\n}: {\n readonly color: ColorValue\n readonly isDisabled: boolean\n readonly isExpanded: boolean\n readonly onPress: () => void\n}) {\n return (\n <Pressable\n accessible={false}\n aria-hidden\n disabled={isDisabled}\n focusable={false}\n hitSlop={hitSlop(BOX_SLOT, BOX_SLOT)}\n onPress={onPress}\n style={styles.box}\n tabIndex={-1}\n >\n <ExpandChevron color={color} isExpanded={isExpanded} />\n </Pressable>\n )\n}\n\n/**\n * The leading slot of a Tree's row: its chevron, or the chevron's space on a\n * row with nothing under it so its headline lines up with one that opens,\n * then the checkbox of a tree that selects, then whatever the row was given,\n * all set in by the row's depth, a chevron's width a level.\n */\nfunction treeLead({\n box,\n chevron,\n indent,\n leading,\n style,\n}: {\n readonly box: ReactNode\n readonly chevron: ReactNode\n readonly indent: number\n readonly leading: ReactNode\n readonly style: StyleProp<ViewStyle>\n}): ReactNode {\n return (\n <View style={composeStyles<ViewStyle>(style, { marginStart: indent })}>\n {chevron ?? <View style={styles.box} />}\n {box}\n {leading}\n </View>\n )\n}\n\n// The collection a cell is drawn in. Every cell is the `FlatList`'s, inside\n// the collection's own provider, so there always is one.\nfunction useCollection(): CollectionValue {\n const collection = use(CollectionContext)\n\n if (collection === null) {\n throw new Error('A List or ListBox part is drawn by the one it is in.')\n }\n return collection\n}\n\n// Says the ring's name on iOS as it appears. A list loading as it mounts\n// says nothing, as a live region does not read what it was mounted holding.\nfunction useLoadingAnnouncement(isLoading: boolean, label: string) {\n const was = useRef(isLoading)\n\n useEffect(() => {\n if (isLoading && !was.current && Platform.OS === 'ios') {\n AccessibilityInfo.announceForAccessibility(label)\n }\n was.current = isLoading\n }, [isLoading, label])\n}\n\n// Says how many rows are left on iOS each time the count changes. The count\n// a list mounts with is not said, as a live region does not read what it was\n// mounted holding, and an empty message says nothing.\nfunction useResultsAnnouncement(message: string) {\n const was = useRef(message)\n\n useEffect(() => {\n if (message !== was.current && message !== '' && Platform.OS === 'ios') {\n AccessibilityInfo.announceForAccessibility(message)\n }\n was.current = message\n }, [message])\n}\n\n/**\n * The leading slot of a List's row that selects: the checkbox, then whatever\n * the row was given, in a row of their own so the two sit side by side.\n */\nfunction withBox(\n box: ReactElement,\n leading: ReactNode,\n style: StyleProp<ViewStyle>,\n): ReactNode {\n return hasContent(leading) ? (\n <View style={style}>\n {box}\n {leading}\n </View>\n ) : (\n box\n )\n}\n\nexport {\n Collection,\n CollectionView,\n focusKeyOf,\n loaderNode,\n nestedRowNode,\n ResultsStatus,\n rowCountOf,\n rowNode,\n sectionNode,\n}\nexport type {\n CollectionKind,\n CollectionLoadMoreProps,\n CollectionProps,\n CollectionRowProps,\n CollectionSectionProps,\n CollectionViewProps,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoHA,MAAM6D,WAAW;AAGjB,MAAMC,mBAAmB;AAIzB,MAAMC,cAAc;AAIpB,MAAMC,eAAe;AAIrB,MAAMC,OAAgC,CAAC;AAIvC,MAAME,eAAe,EAAE,gBAAgB,OAAO;AAE9C,MAAME,SAASlC,WAAWmC,OAAO;CAC/BC,KAAK;EACHC,YAAY;EACZC,QAAQZ;EACRa,gBAAgB;EAChBC,OAAOd;CACT;CAGAe,MAAM,EACJH,QAAQ,EACV;CAGAI,QAAQ;EACNJ,QAAQ;EACRK,UAAU;EACVC,eAAe;EACfC,UAAU;EACVL,OAAO;CACT;AACF,CAAC;AAED,MAAMM,WAAWtB,cACd,EAAEuB,QAAQC,OAAOC,QAAQC,cACxBlD,WAAWmC,OAAO;CAGhBgB,SAAS,EACPC,iBAAiBF,QAAQG,GAC3B;CAIAC,cAAc;EACZC,OAAOR,OAAOS;EACdC,eAAeP,QAAQQ;EACvBC,mBAAmBT,QAAQU,KAAKV,QAAQW;EACxCC,YAAYZ,QAAQU;CACtB;CACAG,OAAO,EACLR,OAAOR,OAAOS,iBAChB;CAIAQ,QAAQ;EACNT,OAAOR,OAAOS;EACdC,eAAeP,QAAQQ;EACvBC,mBAAmBT,QAAQU;EAC3BE,YAAYZ,QAAQU;CACtB;CAGAK,MAAM;EACJ5B,YAAY;EACZ6B,eAAe;EACfC,KAAKjB,QAAQU;CACf;CACAQ,MAAM,EACJC,iBAAiBtB,OAAOuB,QAC1B;CAGAC,SAAS;EACPlC,YAAY;EACZE,gBAAgB;EAChBiC,WAAWvB,OAAOwB;CACpB;CAEAC,M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,EAAA,KAAAG;CAAA,OAAA;EAAAJ,KAAAC,EAAA;EAAAG,KAAAH,EAAA;CAAA;CALZ/J,UAAU8J,IAKPI,EAAS;AAAC;;;;;AAOf,SAAS4J,QACPhR,KACAsE,SACAxB,OACW;CACX,OAAOjE,WAAWyF,OAAO,IACvB,qBAAC,MAAD;EAAaxB;EAAb,UAAA,CACG9C,KACAsE,OACG;CAENtE,CAAAA,IAAAA;AAEJ"}
@@ -0,0 +1,56 @@
1
+ import { useTheme } from "../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../theme/styles.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { StyleSheet, View } from "react-native";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/color-thumb/index.tsx
7
+ const RING = 2;
8
+ const HAIRLINE = 1;
9
+ const stylesOf = themedStyles(({ colors, radii, shadows }) => StyleSheet.create({
10
+ edge: {
11
+ borderColor: colors.outline,
12
+ borderRadius: radii.circle,
13
+ borderWidth: HAIRLINE,
14
+ height: 26,
15
+ width: 26
16
+ },
17
+ lifted: { boxShadow: shadows.elevation2 },
18
+ ring: {
19
+ borderColor: colors.surface,
20
+ borderRadius: radii.circle,
21
+ borderWidth: RING,
22
+ flexGrow: 1
23
+ }
24
+ }));
25
+ function ColorThumb(t0) {
26
+ const $ = c(7);
27
+ const { color, dragging } = t0;
28
+ const own = stylesOf(useTheme());
29
+ const T0 = View;
30
+ const t1 = composeStyles(own.edge, dragging ? own.lifted : void 0);
31
+ const T1 = View;
32
+ const t2 = composeStyles(own.ring, { backgroundColor: color.toString("css") });
33
+ let t3;
34
+ if ($[0] !== T1 || $[1] !== t2) {
35
+ t3 = /* @__PURE__ */ jsx(T1, { style: t2 });
36
+ $[0] = T1;
37
+ $[1] = t2;
38
+ $[2] = t3;
39
+ } else t3 = $[2];
40
+ let t4;
41
+ if ($[3] !== T0 || $[4] !== t1 || $[5] !== t3) {
42
+ t4 = /* @__PURE__ */ jsx(T0, {
43
+ style: t1,
44
+ children: t3
45
+ });
46
+ $[3] = T0;
47
+ $[4] = t1;
48
+ $[5] = t3;
49
+ $[6] = t4;
50
+ } else t4 = $[6];
51
+ return t4;
52
+ }
53
+ //#endregion
54
+ export { ColorThumb };
55
+
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ViewStyle","Color","StyleSheet","View","useTheme","composeStyles","themedStyles","FILL","RING","HAIRLINE","stylesOf","colors","radii","shadows","create","edge","borderColor","outline","borderRadius","circle","borderWidth","height","width","lifted","boxShadow","elevation2","ring","surface","flexGrow","ColorThumb","t0","$","_c","color","dragging","own","T0","t1","undefined","T1","t2","backgroundColor","toString","t3","t4","_c"],"sources":["../../src/color-thumb/index.tsx"],"sourcesContent":["import type { ViewStyle } from 'react-native'\nimport type { Color } from 'react-stately'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport { useTheme } from '../theme/scope'\nimport { composeStyles, themedStyles } from '../theme/styles'\n\n// The handle a colour slider draws, as kanso-ui's src/styles/color.ts draws\n// it: a 20dp circle filled with the colour at the point it sits on. The\n// component places it; everything here is the ring around that fill.\n//\n// **It is ringed rather than filled, because its fill is the value.** The\n// ring is what has to read, against every colour the track runs through, so\n// it is 2dp of surface with a 1dp hairline in outline outside it, which works\n// on a light ground and a dark one alike. Web draws the two as box shadows\n// and gives a forced palette a border in their place; here they are borders\n// from the start, which no platform mode drops. The fill is the inner view's\n// background, inside the surface ring, so a translucent colour shows the\n// track through it as web's does.\n//\n// While it is dragged it lifts to level 2, as web's does. That is decoration,\n// and the rings are what keep it apart from the track either way.\n\nconst FILL = 20\nconst RING = 2\nconst HAIRLINE = 1\n\nconst stylesOf = themedStyles(({ colors, radii, shadows }) =>\n StyleSheet.create({\n // The hairline, outside the ring.\n edge: {\n borderColor: colors.outline,\n borderRadius: radii.circle,\n borderWidth: HAIRLINE,\n height: FILL + 2 * (RING + HAIRLINE),\n width: FILL + 2 * (RING + HAIRLINE),\n },\n lifted: {\n boxShadow: shadows.elevation2,\n },\n // The surface ring, with the colour inside it.\n ring: {\n borderColor: colors.surface,\n borderRadius: radii.circle,\n borderWidth: RING,\n flexGrow: 1,\n },\n }),\n)\n\nfunction ColorThumb({\n color,\n dragging,\n}: {\n /** The colour at the point the handle sits on. */\n readonly color: Color\n /** Whether the handle is being dragged, which lifts it. */\n readonly dragging: boolean\n}) {\n const own = stylesOf(useTheme())\n\n return (\n <View\n style={composeStyles<ViewStyle>(\n own.edge,\n dragging ? own.lifted : undefined,\n )}\n >\n <View\n style={composeStyles<ViewStyle>(own.ring, {\n backgroundColor: color.toString('css'),\n })}\n />\n </View>\n )\n}\n\nexport { ColorThumb }\n"],"mappings":";;;;;;AAyBA,MAAMQ,OAAO;AACb,MAAMC,WAAW;AAEjB,MAAMC,WAAWJ,cAAc,EAAEK,QAAQC,OAAOC,cAC9CX,WAAWY,OAAO;CAEhBC,MAAM;EACJC,aAAaL,OAAOM;EACpBC,cAAcN,MAAMO;EACpBC,aAAaX;EACbY,QAAQd;EACRe,OAAOf;CACT;CACAgB,QAAQ,EACNC,WAAWX,QAAQY,WACrB;CAEAC,MAAM;EACJV,aAAaL,OAAOgB;EACpBT,cAAcN,MAAMO;EACpBC,aAAaZ;EACboB,UAAU;CACZ;AACF,CAAC,CACH;AAEA,SAAAC,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAoB,MAAA,EAAAC,OAAAC,aAAAJ;CASlB,MAAAK,MAAYzB,SAASN,SAAS,CAAC;CAG5B,MAAAgC,KAAAjC;CACQ,MAAAkC,KAAAhC,cACL8B,IAAGpB,MACHmB,WAAWC,IAAGZ,SAAde,KAAAA,CACF;CAEC,MAAAC,KAAApC;CACQ,MAAAqC,KAAAnC,cAAyB8B,IAAGT,MAAO,EAAAe,iBACvBR,MAAKS,SAAU,KAAK,EACvC,CAAC;CAAC,IAAAC;CAAA,IAAAZ,EAAA,OAAAQ,MAAAR,EAAA,OAAAS,IAAA;EAHJG,KAAA,oBAAC,IAAD,EACS,OAAAH,GAEL,CAAA;EACFT,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;EAAAT,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAK,MAAAL,EAAA,OAAAM,MAAAN,EAAA,OAAAY,IAAA;EAVJC,KAAA,oBAAC,IAAD;GACS,OAAAP;GAKPM,UAAAA;EANG,CAAA;EAWEZ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAXPa;AAWO"}
@@ -24,6 +24,8 @@ type ButtonProps = ButtonForm & Omit<PressableProps, 'children' | 'disabled' | '
24
24
  * `useIconStyle()`.
25
25
  */
26
26
  readonly icon?: ReactNode;
27
+ /** The key a ButtonGroup that selects reports the button by. */
28
+ readonly id?: string;
27
29
  /**
28
30
  * Draws the button disabled, and takes no presses.
29
31
  * @default false
@@ -44,7 +46,7 @@ type ButtonProps = ButtonForm & Omit<PressableProps, 'children' | 'disabled' | '
44
46
  * and type role. `md` is the page's default. The height is a floor, so a
45
47
  * label that wraps, or that the device's text size enlarges, grows the
46
48
  * button rather than running out of it.
47
- * @default 'md'
49
+ * @default the size of the ButtonGroup around it, else 'md'
48
50
  */
49
51
  readonly size?: ButtonSize;
50
52
  readonly style?: StyleProp<ViewStyle>;
@@ -81,7 +83,7 @@ type ButtonVariant = 'elevated' | 'filled' | 'outlined' | 'text' | 'tonal';
81
83
  * target through `hitSlop`, which a `hitSlop` of the call site's own replaces.
82
84
  * `style`, `ref` and `testID` land on the `Pressable`.
83
85
  */
84
- declare function Button({ children, defaultSelected, delayLongPress, disableRipple, hitSlop: ownHitSlop, href, icon, isDisabled, isPending, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, shape, size, slot, style, type, variant, ...props }: ButtonProps): import("react").JSX.Element;
86
+ declare function Button({ accessibilityHint, children, defaultSelected, delayLongPress, disableRipple, hitSlop: ownHitSlop, href, icon, id, isDisabled: ownDisabled, isPending, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, shape, size: ownSize, slot, style, type, variant, ...props }: ButtonProps): import("react").JSX.Element;
85
87
  //#endregion
86
88
  export { Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant };
87
89
  //# sourceMappingURL=index.d.ts.map