@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactElement","ReactNode","Ref","ColorValue","GestureResponderEvent","LayoutChangeEvent","LayoutRectangle","NativeScrollEvent","NativeSyntheticEvent","PressableProps","StyleProp","TextStyle","ViewStyle","AnimatedStyle","Key","Node","Orientation","TabListState","TabListStateOptions","Children","createContext","isValidElement","use","useCallback","useEffect","useId","useRef","useState","I18nManager","Text","NativeText","Pressable","ScrollView","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","useTabListState","IconStyle","ResolvedTheme","IconStyleContext","usePressFeedback","useLinkPress","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","Badge","Bar","layout","TabsLayout","orientation","variant","TabsVariant","Measured","label","tab","Placement","length","offset","TabsContextValue","bar","found","ids","state","TabsListElement","TabsListProps","children","item","T","items","Iterable","ref","style","testID","TabsPanelProps","id","TabsPanelsProps","TabsProps","defaultSelectedKey","disabledKeys","isDisabled","onSelectionChange","key","selectedKey","TabsTabProps","Omit","badge","href","icon","textValue","PRIMARY_THICKNESS","SECONDARY_THICKNESS","LEAST_INDICATOR","ICON_SIZE","STACKED_HEIGHT","SCROLLABLE_LEAST","SCROLLABLE_MOST","NO_MEASUREMENTS","ReadonlyMap","Map","NO_HEIGHTS","NO_TABS","TabsContext","PanelHeightContext","height","styles","create","atLeft","left","atRight","right","flexShrink","besideBar","flexGrow","minWidth","clip","overflow","alignItems","justifyContent","width","flexDirection","line","listVertical","rootVertical","row","scroll","tabScrollable","maxWidth","tabShared","flex","tabStacked","minHeight","tabVertical","text","textAlign","textVertical","stylesOf","colors","sizing","spacing","divider","backgroundColor","outlineVariant","bottom","pointerEvents","position","dividerVertical","end","top","indicator","primary","borderTopLeftRadius","borderTopRightRadius","indicatorSecondary","indicatorSecondaryVertical","indicatorVertical","borderBottomStartRadius","borderTopStartRadius","labelInline","gap","sm","labelStacked","xxs","lineBadged","xs","boxSizing","controlMd","paddingHorizontal","lg","ringStyles","ring","outlineOffset","Tabs","t0","$","_c","t1","t2","t3","undefined","t4","listOf","list","t5","props","t6","t7","t8","t9","contextOf","context","t10","t11","t12","t13","TabsList","ariaLabel","labelledBy","useTabs","theme","own","reduceMotion","measured","setMeasured","viewport","setViewport","scrolled","revealed","vertical","scrollable","selected","get","placementOf","placement","Symbol","for","part","previous","withMeasurement","measure","event","contentOffset","nativeEvent","current","y","x","onScroll","first","target","revealOffset","animated","scrollTo","collection","map","node","tabs","t14","t15","viewportOf","t16","TabsTab","_props","getCollectionNode","hasChildNodes","rendered","type","TabState","disabled","engaged","badgeFor","colorOf","stateLayerOpacity","onSurface","disabledContent","onSurfaceVariant","heightOf","report","iconStyleOf","color","size","Indicator","motion","placed","moved","set","timing","duration","durationMedium1","easing","bezier","easingEmphasized","motionStyle","transform","translateY","translateX","indicatorStyleOf","leftEdgeOf","ReturnType","isRTL","getConstants","doLeftAndRightSwapInRTL","child","toArray","nested","ListTab","onMeasure","role","onBlur","onFocus","onHoverIn","onHoverOut","onLayout","onPress","onPressIn","onPressOut","_id","_isDisabled","_textValue","selectionManager","feedback","pressedColor","press","hasIcon","stacked","hovered","pressed","after","T0","nameOf","tabIdOf","handlers","measureThen","selectThen","tabWidthOf","layer","T1","inset","Math","max","start","setSelectedKey","String","replaceAll","TabsPanel","shown","TabsPanels","heights","setHeights","next","withHeight","box","measuredHeight","value","Error","delete","known","List","Panel","Panels","Tab","_c","NativeText"],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactElement, ReactNode, Ref } from 'react'\nimport type {\n ColorValue,\n GestureResponderEvent,\n LayoutChangeEvent,\n LayoutRectangle,\n NativeScrollEvent,\n NativeSyntheticEvent,\n PressableProps,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { Key, Node, Orientation } from 'react-stately'\nimport type {\n TabListState,\n TabListStateOptions,\n} from 'react-stately/useTabListState'\n\nimport {\n Children,\n createContext,\n isValidElement,\n use,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react'\nimport {\n I18nManager,\n Text as NativeText,\n Pressable,\n ScrollView,\n StyleSheet,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\nimport { useTabListState } from 'react-stately/useTabListState'\n\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { usePressFeedback } from '../../press'\nimport { useLinkPress } from '../../router'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\nimport { Badge } from '../badge'\n\n// kanso-ui's Tabs: the tabs page's primary and secondary tabs, with the\n// panels they switch between. Both are a 48dp bar divided into equal\n// sections, with a 1dp outline-variant divider inside the bar along its\n// bottom edge.\n//\n// **Primary** draws the active tab in the primary role and, under its label,\n// a 3dp primary indicator rounded along its top. The indicator follows the\n// label rather than the tab, 2dp short of the label at either end and never\n// shorter than 24dp. A primary tab given an icon stacks the page's 24dp icon\n// over its label, 2dp apart, and the bar grows to the page's 64dp.\n//\n// **Secondary** is the strip that sits under a primary one. Its active tab\n// keeps the on-surface role, and its 2dp primary indicator spans the whole\n// tab. An icon sits before the label, 8dp from it, and the strip keeps its\n// 48dp.\n//\n// A badge sits on the icon where a primary tab stacks one, and 4dp after the\n// label anywhere else.\n//\n// **The bar is equal sections unless `layout` says otherwise.**\n// `layout=\"scrollable\"` gives each tab its label's width, between 72dp and\n// 264dp, in a bar that scrolls without a scroll indicator and brings the\n// selected tab into view, at once the first time and with the platform's\n// own scroll after that.\n//\n// **`orientation=\"vertical\"` turns the bar on its side**, as web does, since\n// the page draws no vertical tabs: the tabs stack, the divider runs down the\n// bar's end edge, and each indicator lies along that edge, 3dp and rounded\n// toward the tab on a primary bar, 2dp and square on a secondary one. The bar\n// sits beside the panels rather than above them.\n//\n// **The state is React Stately's `useTabListState`**, the one web's React Aria\n// keeps. `Tabs` finds its `Tabs.List` among its children, through any view or\n// fragment around it, and builds the state from the tabs written there, so\n// the selection, the first tab chosen when none is given and the disabled\n// keys behave as they do on web. Each `Tabs.Tab` gives the state its entry and\n// renders nothing itself: the list draws every tab from its entry.\n//\n// **The indicator is one view**, which moves to the selected tab's measured\n// place over medium1 on the emphasized curve, as web's shared element does,\n// and at once under reduced motion or when the bar itself is laid out again.\n// `Tabs.Panels` moves its height the same way, between the heights its\n// panels report.\n//\n// A tab is a `tab` reporting whether it is selected, inside a `tablist`, and\n// a panel is a `tabpanel` named by its tab. Touch has no arrow keys, so web's\n// `keyboardActivation` is not taken.\n//\n// **The label comes first in the tree and is drawn after the icon**, through\n// a reversed row or column, as src/navigation does it and for its reason: a\n// badge's count is text, and ahead of the label it put the count before the\n// name.\n\n/** The bar's three decisions, which every part reads from the root. */\ntype Bar = {\n readonly layout: TabsLayout\n readonly orientation: Orientation\n readonly variant: TabsVariant\n}\n\n/** What a tab has reported of its place in the bar. */\ntype Measured = {\n readonly label?: LayoutRectangle\n readonly tab?: LayoutRectangle\n}\n\n/** Where the indicator lies along the bar's own axis. */\ntype Placement = {\n readonly length: number\n readonly offset: number\n}\n\ntype TabsContextValue = {\n readonly bar: Bar\n /** Whether a `Tabs.List` was found among the root's children. */\n readonly found: boolean\n /** The root's own id, which the tabs' and panels' ids start with. */\n readonly ids: string\n readonly state: TabListState<object>\n}\n\n/** How the bar shares its room among the tabs. */\ntype TabsLayout = 'fixed' | 'scrollable'\n\ntype TabsListElement = ReactElement<TabsListProps>\n\ntype TabsListProps<T extends object = object> = {\n /** Names the bar, for a screen reader. */\n readonly 'aria-label'?: string\n /** Names the bar after the element with this id. */\n readonly 'aria-labelledby'?: string\n /**\n * The tabs, as `Tabs.Tab` elements each given an `id`, or with `items` a\n * function from an item to its tab.\n */\n readonly children?: ((item: T) => ReactElement) | ReactNode\n /** The items to draw a tab for, through the function `children` is. */\n readonly items?: Iterable<T>\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype TabsPanelProps = {\n readonly children?: ReactNode\n /**\n * The key of the tab the panel belongs to, which is drawn while that tab\n * is selected. A panel given none is drawn under whichever tab is.\n */\n readonly id?: Key\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype TabsPanelsProps = {\n /** The `Tabs.Panel` elements, whose box moves between their heights. */\n readonly children?: ReactNode\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\ntype TabsProps = {\n /** The bar, as a `Tabs.List`, and the `Tabs.Panel` elements it switches. */\n readonly children?: ReactNode\n /** The tab selected at first, when the bar keeps its own selection. */\n readonly defaultSelectedKey?: Key\n /** The keys of the tabs that take no press, and draw disabled. */\n readonly disabledKeys?: Iterable<Key>\n /**\n * Disables every tab.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * How the bar shares its room: `fixed` divides it into equal sections, and\n * `scrollable` gives each tab its label's width in a bar that scrolls,\n * which is the page's choice for more tabs than the room has sections for.\n * @default 'fixed'\n */\n readonly layout?: TabsLayout\n /** Called with the key of the tab that has just been selected. */\n readonly onSelectionChange?: (key: Key) => void\n /**\n * Whether the bar runs across, above its panels, or down, beside them.\n * @default 'horizontal'\n */\n readonly orientation?: Orientation\n readonly ref?: Ref<ComponentRef<typeof View>>\n /** The key of the selected tab, when the call site holds it. */\n readonly selectedKey?: Key | null\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n /**\n * Which of the page's two tab bars this is: `primary` for the main one,\n * `secondary` for a strip under a primary one.\n * @default 'primary'\n */\n readonly variant?: TabsVariant\n}\n\ntype TabsTabProps = Omit<\n PressableProps,\n 'children' | 'disabled' | 'id' | 'role' | 'style'\n> & {\n /**\n * A badge on the tab: `true` for the badges page's small dot, a number for\n * the large badge holding it. It sits on a primary tab's icon, and after\n * the label anywhere else. The badge is hidden from a screen reader, so say\n * what it says in the tab's `aria-label` too: \"Second item, 3 new\".\n */\n readonly badge?: boolean | number\n /** The tab's label. */\n readonly children?: ReactNode\n /** Where the tab goes when pressed, through the app's router. */\n readonly href?: string\n /**\n * An icon with the label, at the page's 24dp: over it on a primary tab,\n * whose bar grows to 64dp, and before it on a secondary one. The slot hands\n * it its colour and size through `useIconStyle()`.\n */\n readonly icon?: ReactNode\n /**\n * The tab's key, which selection reports and its `Tabs.Panel` shares.\n * Without one, a tab drawn from `items` takes its item's `id` or `key`.\n */\n readonly id?: Key\n /**\n * Draws the tab disabled, and it takes no press, as a key in the bar's\n * `disabledKeys` does.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n /**\n * The tab's text, for a label that is not a plain string. Read off\n * `children` when it is one.\n */\n readonly textValue?: string\n}\n\n/** The tabs page's two styles of tab bar. */\ntype TabsVariant = 'primary' | 'secondary'\n\n// The page's thicknesses for the two indicators, and the least a primary one\n// is drawn at, which no token holds.\nconst PRIMARY_THICKNESS = 3\nconst SECONDARY_THICKNESS = 2\nconst LEAST_INDICATOR = 24\n\n// The page's 24dp icon, and the 64dp a primary bar grows to with one stacked\n// over a label. No sizing token holds 64.\nconst ICON_SIZE = 24\nconst STACKED_HEIGHT = 64\n\n// A scrollable bar's tab: MDC-Android's 72dp at the least and 264dp at the\n// most, as on web.\nconst SCROLLABLE_LEAST = 72\nconst SCROLLABLE_MOST = 264\n\nconst NO_MEASUREMENTS: ReadonlyMap<Key, Measured> = new Map()\nconst NO_HEIGHTS: ReadonlyMap<Key, number> = new Map()\nconst NO_TABS: ReactNode[] = []\n\nconst TabsContext = createContext<null | TabsContextValue>(null)\n\n// The heights the panels inside a `Tabs.Panels` report, by key. Null is no\n// box, and a panel then reports nothing.\nconst PanelHeightContext = createContext<\n ((key: Key, height: number | undefined) => void) | null\n>(null)\n\nconst styles = StyleSheet.create({\n // The bar's left edge, which a horizontal indicator is moved from, in the\n // two spellings `leftEdgeOf` picks between.\n atLeft: {\n left: 0,\n },\n atRight: {\n right: 0,\n },\n // A badge after the label, which keeps its size while the label narrows.\n badge: {\n flexShrink: 0,\n },\n // Beside a vertical bar a panel takes the rest of the row.\n besideBar: {\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n },\n // What a box's height moves inside: its content lays out at its own height\n // whatever the box is, which is what a panel's `onLayout` measures.\n clip: {\n overflow: 'hidden',\n },\n // The page's 24dp icon slot.\n icon: {\n alignItems: 'center',\n flexShrink: 0,\n height: ICON_SIZE,\n justifyContent: 'center',\n width: ICON_SIZE,\n },\n // A label longer than its tab narrows to fit inside it rather than pushing\n // out past its padding.\n label: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 1,\n minWidth: 0,\n },\n // The label's text and the badge after it.\n line: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 1,\n minWidth: 0,\n },\n // A vertical bar holds its tabs in a column as wide as its widest.\n listVertical: {\n flexDirection: 'column',\n flexShrink: 0,\n },\n // A vertical bar sits beside its panels.\n rootVertical: {\n flexDirection: 'row',\n },\n // A horizontal bar holds its tabs in a row.\n row: {\n flexDirection: 'row',\n },\n // A bar that scrolls takes the room the bar has, rather than its tabs'\n // whole length.\n scroll: {\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n },\n // A bar's tab in its scrolling form, as wide as its label.\n tabScrollable: {\n flexGrow: 0,\n flexShrink: 0,\n maxWidth: SCROLLABLE_MOST,\n minWidth: SCROLLABLE_LEAST,\n },\n // An equal share of the bar, whatever its label measures.\n tabShared: {\n flex: 1,\n minWidth: 0,\n },\n tabStacked: {\n minHeight: STACKED_HEIGHT,\n },\n // A vertical bar's tab: one row of it, as tall as its content, with its\n // label at the start.\n tabVertical: {\n justifyContent: 'flex-start',\n },\n text: {\n flexShrink: 1,\n textAlign: 'center',\n },\n textVertical: {\n textAlign: 'auto',\n },\n})\n\nconst stylesOf = themedStyles(({ colors, sizing, spacing }: ResolvedTheme) =>\n StyleSheet.create({\n // The divider, inside the bar along its bottom edge, so it is part of the\n // 48 rather than a pixel under it, and the indicator is drawn over it.\n divider: {\n backgroundColor: colors.outlineVariant,\n bottom: 0,\n height: 1,\n left: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n },\n // Down a vertical bar's end edge.\n dividerVertical: {\n backgroundColor: colors.outlineVariant,\n bottom: 0,\n end: 0,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: 1,\n },\n // Under the label along a horizontal bar, rounded along its top.\n indicator: {\n backgroundColor: colors.primary,\n borderTopLeftRadius: PRIMARY_THICKNESS,\n borderTopRightRadius: PRIMARY_THICKNESS,\n bottom: 0,\n height: PRIMARY_THICKNESS,\n pointerEvents: 'none',\n position: 'absolute',\n },\n // Across the whole tab, square.\n indicatorSecondary: {\n backgroundColor: colors.primary,\n bottom: 0,\n height: SECONDARY_THICKNESS,\n pointerEvents: 'none',\n position: 'absolute',\n },\n indicatorSecondaryVertical: {\n backgroundColor: colors.primary,\n end: 0,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: SECONDARY_THICKNESS,\n },\n // Along the tab's end edge, rounded toward the tab.\n indicatorVertical: {\n backgroundColor: colors.primary,\n borderBottomStartRadius: PRIMARY_THICKNESS,\n borderTopStartRadius: PRIMARY_THICKNESS,\n end: 0,\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: PRIMARY_THICKNESS,\n },\n // A secondary tab's icon before its label, 8dp from it. The label comes\n // first in the tree, so the row runs backwards.\n labelInline: {\n flexDirection: 'row-reverse',\n gap: spacing.sm,\n },\n // A primary tab's icon over its label, 2dp apart.\n labelStacked: {\n flexDirection: 'column-reverse',\n gap: spacing.xxs,\n },\n // A badge 4dp after the label.\n lineBadged: {\n gap: spacing.xs,\n },\n // A minimum rather than a height, so the bar takes its tallest tab's:\n // the row stretches every tab in it to one height.\n tab: {\n alignItems: 'center',\n boxSizing: 'border-box',\n flexDirection: 'row',\n justifyContent: 'center',\n minHeight: sizing.controlMd,\n paddingHorizontal: spacing.lg,\n },\n }),\n)\n\n// The focus ring, drawn inside the tab as web's is, so a focused tab shows\n// its whole ring rather than the half its neighbours cover.\nconst ringStyles = StyleSheet.create({\n ring: {\n outlineOffset: -2,\n },\n})\n\n/**\n * A tab bar and the panels it switches between. Pass `selectedKey` with\n * `onSelectionChange` to hold the selection, or `defaultSelectedKey` to let\n * the bar keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it shows\n * through a shared `id`, and a bar may stand alone without panels.\n *\n * ```tsx\n * <Tabs defaultSelectedKey=\"first\">\n * <Tabs.List aria-label=\"Sections\">\n * <Tabs.Tab id=\"first\">First item</Tabs.Tab>\n * <Tabs.Tab id=\"second\">Second item</Tabs.Tab>\n * </Tabs.List>\n * <Tabs.Panel id=\"first\">\n * <Text>Supporting line</Text>\n * </Tabs.Panel>\n * <Tabs.Panel id=\"second\">\n * <Text>Supporting line</Text>\n * </Tabs.Panel>\n * </Tabs>\n * ```\n *\n * Write the `Tabs.List` among the children of `Tabs`, inside any view or\n * fragment, rather than in a component of the call site's own: the bar is\n * found there, and its tabs are what the selection is built from.\n *\n * `style`, `ref` and `testID` land on the root view, the one a layout\n * positions.\n */\nfunction Tabs({\n children,\n defaultSelectedKey,\n disabledKeys,\n isDisabled,\n layout = 'fixed',\n onSelectionChange,\n orientation = 'horizontal',\n ref,\n selectedKey,\n style,\n testID,\n variant = 'primary',\n}: TabsProps) {\n const list = listOf(children)\n const state = useTabListState<object>({\n // Each tab builds its own entry in the collection; see\n // `TabsTab.getCollectionNode`. The collection skips what is not an\n // element, as a ReactNode may be, and asks any element for its entry.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see above\n children: (list?.props.children ??\n NO_TABS) as TabListStateOptions<object>['children'],\n defaultSelectedKey,\n disabledKeys,\n isDisabled,\n items: list?.props.items,\n onSelectionChange,\n selectedKey: selectedKey ?? undefined,\n })\n const ids = useId()\n const context = contextOf(\n { layout, orientation, variant },\n list !== undefined,\n ids,\n state,\n )\n\n return (\n <TabsContext value={context}>\n <View\n ref={ref}\n style={composeStyles<ViewStyle>(\n orientation === 'vertical' ? styles.rootVertical : undefined,\n style,\n )}\n testID={testID}\n >\n {children}\n </View>\n </TabsContext>\n )\n}\n\n/**\n * The bar: every tab, drawn from the entries its `Tabs.Tab` children gave\n * the root, with the divider and the indicator. Name it with `aria-label` or\n * `aria-labelledby`.\n *\n * `style`, `ref` and `testID` land on the bar's own view.\n */\nfunction TabsList<T extends object = object>({\n 'aria-label': ariaLabel,\n 'aria-labelledby': labelledBy,\n ref,\n style,\n testID,\n}: TabsListProps<T>) {\n const { bar, ids, state } = useTabs('Tabs.List', true)\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const [measured, setMeasured] = useState(NO_MEASUREMENTS)\n const [viewport, setViewport] = useState(0)\n const scroll = useRef<ComponentRef<typeof ScrollView>>(null)\n const scrolled = useRef(0)\n // The key last brought into view, and undefined until one has been, which\n // is what makes the first reveal instant.\n const revealed = useRef<Key | null | undefined>(undefined)\n const vertical = bar.orientation === 'vertical'\n const scrollable = bar.layout === 'scrollable'\n const { selectedKey } = state\n const selected = selectedKey === null ? undefined : measured.get(selectedKey)\n const placement = placementOf(bar, selected, theme.spacing.xxs)\n\n const measure = useCallback(\n (key: Key, part: keyof Measured, layout: LayoutRectangle) => {\n setMeasured((previous) => withMeasurement(previous, key, part, layout))\n },\n [],\n )\n\n // Keeps how far the bar has scrolled, for the next reveal to measure from.\n const onScroll = useCallback(\n (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n const { contentOffset } = event.nativeEvent\n scrolled.current = vertical ? contentOffset.y : contentOffset.x\n },\n [vertical],\n )\n\n // Brings the selected tab into view in a bar that scrolls, as it becomes\n // the selected one.\n useEffect(() => {\n const tab = selected?.tab\n\n if (\n !scrollable ||\n tab === undefined ||\n viewport === 0 ||\n revealed.current === selectedKey\n ) {\n return\n }\n\n const first = revealed.current === undefined\n revealed.current = selectedKey\n\n const target = revealOffset(\n scrolled.current,\n viewport,\n vertical ? tab.y : tab.x,\n vertical ? tab.height : tab.width,\n )\n\n if (target !== undefined) {\n const animated = !first && !reduceMotion\n scroll.current?.scrollTo(\n vertical ? { animated, y: target } : { animated, x: target },\n )\n }\n }, [reduceMotion, scrollable, selected, selectedKey, vertical, viewport])\n\n const tabs = (\n <>\n {[...state.collection].map((node) => (\n <ListTab\n bar={bar}\n ids={ids}\n key={node.key}\n node={node}\n onMeasure={measure}\n state={state}\n />\n ))}\n {placement === undefined ? null : (\n <Indicator bar={bar} placement={placement} selectedKey={selectedKey} />\n )}\n </>\n )\n\n return (\n <View\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n ref={ref}\n role=\"tablist\"\n style={composeStyles<ViewStyle>(\n vertical ? styles.listVertical : styles.row,\n style,\n )}\n testID={testID}\n >\n <View style={vertical ? own.dividerVertical : own.divider} />\n {scrollable ? (\n <ScrollView\n horizontal={!vertical}\n onLayout={viewportOf(setViewport, vertical)}\n onScroll={onScroll}\n ref={scroll}\n scrollEventThrottle={16}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n style={styles.scroll}\n >\n {tabs}\n </ScrollView>\n ) : (\n tabs\n )}\n </View>\n )\n}\n\n/**\n * One tab of a `Tabs.List`, which draws it: the root builds its selection\n * from these, so one renders nothing on its own. Give every tab an `id`,\n * which is the key selection reports and its `Tabs.Panel` shares.\n */\nfunction TabsTab(_props: TabsTabProps): null {\n return null\n}\n\n// The entry the root's collection holds for a tab, as React Stately's own\n// `Item` gives one: keyed by the tab's `id`, and carrying the props the bar\n// draws it from.\nTabsTab.getCollectionNode = function* getCollectionNode(props: TabsTabProps) {\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\ntype TabState = {\n readonly disabled: boolean\n readonly engaged: boolean\n readonly selected: boolean\n}\n\n// The badge, which wraps the icon where a primary tab stacks one and stands\n// after the label anywhere else: `true` for the small dot, a number for the\n// large badge, and nothing for `false`.\nfunction badgeFor(\n badge: boolean | number | undefined,\n icon?: ReactNode,\n): ReactNode {\n if (badge === undefined || badge === false) {\n return icon ?? null\n }\n return (\n <Badge\n count={badge === true ? undefined : badge}\n style={icon === undefined ? styles.badge : undefined}\n >\n {icon}\n </Badge>\n )\n}\n\n/**\n * The colour a tab draws its label and icon in: primary for the active tab\n * of a primary bar and on surface for a secondary one's, on surface for an\n * inactive tab a pointer, a focus or a press engages, on surface variant at\n * rest, and on surface at the disabled content opacity while disabled.\n */\nfunction colorOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n variant: TabsVariant,\n { disabled, engaged, selected }: TabState,\n): string {\n if (disabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n }\n if (selected) {\n return variant === 'primary' ? colors.primary : colors.onSurface\n }\n return engaged ? colors.onSurface : colors.onSurfaceVariant\n}\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's jsx-no-new-object-as-prop is after; the React Compiler\n// memoises the result on its inputs.\nfunction contextOf(\n bar: Bar,\n found: boolean,\n ids: string,\n state: TabListState<object>,\n): TabsContextValue {\n return { bar, found, ids, state }\n}\n\n// A panel's `onLayout` inside a `Tabs.Panels`, which reports its height, and\n// none outside one.\nfunction heightOf(\n report: ((key: Key, height: number | undefined) => void) | null,\n key: Key,\n) {\n if (report === null) {\n return undefined\n }\n return (event: LayoutChangeEvent) => {\n report(key, event.nativeEvent.layout.height)\n }\n}\n\nfunction iconStyleOf(color: ColorValue): IconStyle {\n return { color, size: ICON_SIZE }\n}\n\n/**\n * The active indicator: one view, which moves to the selected tab's place\n * when the selection does, and is put there at once when the bar is only\n * laid out again.\n */\nfunction Indicator({\n bar,\n placement,\n selectedKey,\n}: {\n readonly bar: Bar\n readonly placement: Placement\n readonly selectedKey: Key | null\n}) {\n const theme = useTheme()\n const { motion } = theme\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const offset = useSharedValue(placement.offset)\n const length = useSharedValue(placement.length)\n const placed = useRef(selectedKey)\n const vertical = bar.orientation === 'vertical'\n\n useEffect(() => {\n const moved = placed.current !== selectedKey\n placed.current = selectedKey\n\n if (!moved || reduceMotion) {\n offset.set(placement.offset)\n length.set(placement.length)\n return\n }\n\n const timing = {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasized),\n }\n offset.set(withTiming(placement.offset, timing))\n length.set(withTiming(placement.length, timing))\n }, [\n length,\n motion,\n offset,\n placement.length,\n placement.offset,\n reduceMotion,\n selectedKey,\n ])\n\n const motionStyle = useAnimatedStyle(() => {\n 'worklet'\n return vertical\n ? { height: length.get(), transform: [{ translateY: offset.get() }] }\n : { transform: [{ translateX: offset.get() }], width: length.get() }\n })\n\n return (\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n indicatorStyleOf(own, bar),\n vertical ? undefined : leftEdgeOf(),\n motionStyle,\n )}\n />\n )\n}\n\nfunction indicatorStyleOf(own: ReturnType<typeof stylesOf>, bar: Bar) {\n if (bar.variant === 'primary') {\n return bar.orientation === 'vertical'\n ? own.indicatorVertical\n : own.indicator\n }\n return bar.orientation === 'vertical'\n ? own.indicatorSecondaryVertical\n : own.indicatorSecondary\n}\n\n/**\n * The style that puts a horizontal indicator at the bar's left edge, which is\n * where a layout measures a tab's `x` from in either direction, so that the\n * indicator's translation is the tab's own `x`. React Native swaps `left` and\n * `right` under a right-to-left layout unless the app turns that off, so\n * there `right` is the one naming the left edge. React Native Web reports no\n * right-to-left layout here and keeps `left` where CSS has it.\n */\nfunction leftEdgeOf() {\n return I18nManager.isRTL && I18nManager.getConstants().doLeftAndRightSwapInRTL\n ? styles.atRight\n : styles.atLeft\n}\n\n// The `Tabs.List` among the root's children, looked for through any element\n// around it, a view or a fragment alike, though never inside another `Tabs`,\n// whose bar is its own. A function child, which some components take, is\n// skipped, as `Children.toArray` skips it.\nfunction listOf(children: ReactNode): TabsListElement | undefined {\n for (const child of Children.toArray(children)) {\n if (isValidElement<TabsListProps>(child) && child.type === TabsList) {\n return child\n }\n if (\n isValidElement<{ children?: ReactNode }>(child) &&\n child.type !== Tabs\n ) {\n const nested = listOf(child.props.children)\n\n if (nested !== undefined) {\n return nested\n }\n }\n }\n return undefined\n}\n\n/**\n * One tab as the bar draws it, from its entry in the collection: a `tab`\n * that selects itself when pressed, and reports where it and its label lie\n * so the indicator can follow them.\n */\nfunction ListTab({\n bar,\n ids,\n node,\n onMeasure,\n state,\n}: {\n readonly bar: Bar\n readonly ids: string\n readonly node: Node<object>\n readonly onMeasure: (\n key: Key,\n part: keyof Measured,\n layout: LayoutRectangle,\n ) => void\n readonly state: TabListState<object>\n}) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const role = useTypeRole('titleSmall')\n // A node carries the props its tab was written with, which\n // `getCollectionNode` puts there and React Stately types as `any`.\n // oxlint-disable-next-line typescript/no-unsafe-assignment -- see above\n const {\n 'aria-label': ariaLabel,\n badge,\n children,\n href,\n icon,\n id: _id,\n isDisabled: _isDisabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onPress,\n onPressIn,\n onPressOut,\n ref,\n style,\n textValue: _textValue,\n ...props\n }: TabsTabProps = node.props\n const { key } = node\n // The selection manager reads a tab's own `isDisabled` off its node, beside\n // the bar's `disabledKeys`, so it answers for both.\n const disabled = state.isDisabled || state.selectionManager.isDisabled(key)\n const selected = state.selectedKey === key\n const { variant } = bar\n const feedback = usePressFeedback({\n color:\n variant === 'primary' && selected\n ? theme.colors.primary\n : theme.colors.onSurface,\n disabled,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n pressedColor:\n variant === 'primary' ? theme.colors.primary : theme.colors.onSurface,\n })\n const press = useLinkPress(href, onPress)\n const vertical = bar.orientation === 'vertical'\n const hasIcon = icon !== undefined && icon !== null\n const stacked = hasIcon && variant === 'primary'\n const color = colorOf(theme, variant, {\n disabled,\n engaged:\n feedback.hovered || feedback.pressed || feedback.ring !== undefined,\n selected,\n })\n const after = stacked ? null : badgeFor(badge)\n const text = (\n <NativeText\n numberOfLines={stacked ? 1 : 2}\n style={composeStyles<TextStyle>(\n role,\n styles.text,\n vertical ? styles.textVertical : undefined,\n { color },\n )}\n >\n {children}\n </NativeText>\n )\n\n return (\n <Pressable\n aria-label={ariaLabel ?? nameOf(children)}\n aria-selected={selected}\n id={tabIdOf(ids, key)}\n ref={ref}\n role=\"tab\"\n {...props}\n {...feedback.handlers}\n disabled={disabled}\n onLayout={measureThen(onMeasure, key, 'tab', onLayout)}\n onPress={selectThen(state, key, press)}\n style={composeStyles<ViewStyle>(\n own.tab,\n vertical ? styles.tabVertical : tabWidthOf(bar.layout),\n stacked ? styles.tabStacked : undefined,\n feedback.ring,\n feedback.ring === undefined ? undefined : ringStyles.ring,\n style,\n )}\n >\n {feedback.layer}\n <View\n onLayout={measureThen(onMeasure, key, 'label')}\n style={composeStyles<ViewStyle>(\n styles.label,\n hasIcon ? (stacked ? own.labelStacked : own.labelInline) : undefined,\n )}\n >\n {after === null ? (\n text\n ) : (\n <View style={composeStyles<ViewStyle>(styles.line, own.lineBadged)}>\n {text}\n {after}\n </View>\n )}\n {hasIcon ? (\n <View style={styles.icon}>\n <IconStyleContext value={iconStyleOf(color)}>\n {stacked ? badgeFor(badge, icon) : icon}\n </IconStyleContext>\n </View>\n ) : null}\n </View>\n </Pressable>\n )\n}\n\n// A tab's or a label's `onLayout`, which reports its place to the bar, then\n// calls the call site's own.\nfunction measureThen(\n onMeasure: (key: Key, part: keyof Measured, layout: LayoutRectangle) => void,\n key: Key,\n part: keyof Measured,\n onLayout?: ((event: LayoutChangeEvent) => void) | null,\n) {\n return (event: LayoutChangeEvent) => {\n onMeasure(key, part, event.nativeEvent.layout)\n onLayout?.(event)\n }\n}\n\n// A label that is a string names its tab; anything else leaves the name to\n// `aria-label`.\nfunction nameOf(children: ReactNode): string | undefined {\n return typeof children === 'string' ? children : undefined\n}\n\n/**\n * Where the indicator lies along the bar, from the selected tab's measured\n * place: under its label on a horizontal primary bar, 2dp short of it at\n * either end and at least 24dp, and along the tab's whole length on a\n * secondary bar. Down a vertical bar the same two, along the tab's height.\n * Nothing until what it follows has been measured.\n */\nfunction placementOf(\n { orientation, variant }: Bar,\n measured: Measured | undefined,\n inset: number,\n): Placement | undefined {\n const tab = measured?.tab\n\n if (tab === undefined) {\n return undefined\n }\n\n if (orientation === 'vertical') {\n if (variant === 'secondary') {\n return { length: tab.height, offset: tab.y }\n }\n const length = Math.max(LEAST_INDICATOR, tab.height - 2 * inset)\n return { length, offset: tab.y + (tab.height - length) / 2 }\n }\n\n if (variant === 'secondary') {\n return { length: tab.width, offset: tab.x }\n }\n\n const label = measured?.label\n\n if (label === undefined) {\n return undefined\n }\n\n const length = Math.max(LEAST_INDICATOR, label.width - 2 * inset)\n return { length, offset: tab.x + label.x + (label.width - length) / 2 }\n}\n\n// How far to scroll a bar so a tab lies whole inside it, or nothing when it\n// already does: to its start when it is cut off there, and to its end when\n// it is cut off at the end.\nfunction revealOffset(\n scrolled: number,\n viewport: number,\n start: number,\n size: number,\n): number | undefined {\n if (start < scrolled) {\n return start\n }\n if (start + size > scrolled + viewport) {\n return start + size - viewport\n }\n return undefined\n}\n\n// A press's selection of its tab, then the call site's own handler and the\n// tab's `href`.\nfunction selectThen(\n state: TabListState<object>,\n key: Key,\n press: (event: GestureResponderEvent) => void,\n) {\n return (event: GestureResponderEvent) => {\n state.setSelectedKey(key)\n press(event)\n }\n}\n\n// The id a tab carries for its panel to be named by. Whitespace is taken out\n// of the key, as React Aria does, since a name list is split on it.\nfunction tabIdOf(ids: string, key: Key) {\n return `${ids}-tab-${String(key).replaceAll(/\\s+/gu, '')}`\n}\n\n/**\n * The content of one tab, drawn while its tab is selected. Its `id` is the\n * tab's.\n *\n * `style`, `ref` and `testID` land on the panel's own view.\n */\nfunction TabsPanel({ children, id, ref, style, testID }: TabsPanelProps) {\n const { bar, ids, state } = useTabs('Tabs.Panel')\n const report = use(PanelHeightContext)\n const key = id ?? state.selectedKey\n const shown = key !== null && key === state.selectedKey\n\n // A panel's height is forgotten once it is no longer drawn, so the box\n // waits for the next one's own rather than moving to a height measured\n // the last time it was shown.\n useEffect(() => {\n if (report === null || !shown) {\n return undefined\n }\n return () => {\n report(key, undefined)\n }\n }, [key, report, shown])\n\n if (!shown) {\n return null\n }\n\n return (\n <View\n aria-labelledby={tabIdOf(ids, key)}\n onLayout={heightOf(report, key)}\n ref={ref}\n role=\"tabpanel\"\n style={composeStyles<ViewStyle>(\n bar.orientation === 'vertical' ? styles.besideBar : undefined,\n style,\n )}\n testID={testID}\n >\n {children}\n </View>\n )\n}\n\n/**\n * An optional box around the panels, which moves its height as one panel\n * gives way to the next, over medium1 on the emphasized curve and at once\n * under reduced motion. Without it the panels still work; the box around\n * them simply jumps from one height to the other.\n *\n * `style`, `ref` and `testID` land on the box.\n */\nfunction TabsPanels({ children, ref, style, testID }: TabsPanelsProps) {\n const { bar, state } = useTabs('Tabs.Panels')\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const [heights, setHeights] = useState(NO_HEIGHTS)\n const height = useSharedValue(-1)\n // The key the box last took its height from, and undefined until it has\n // taken one, which is what keeps the first height from moving.\n const placed = useRef<Key | null | undefined>(undefined)\n const { selectedKey } = state\n const target = selectedKey === null ? undefined : heights.get(selectedKey)\n\n const report = useCallback((key: Key, next: number | undefined) => {\n setHeights((previous) => withHeight(previous, key, next))\n }, [])\n\n useEffect(() => {\n if (target === undefined) {\n return\n }\n\n const moved = placed.current !== undefined && placed.current !== selectedKey\n placed.current = selectedKey\n\n height.set(\n moved && !reduceMotion\n ? withTiming(target, {\n duration: motion.durationMedium1,\n easing: Easing.bezier(...motion.easingEmphasized),\n })\n : target,\n )\n }, [height, motion, reduceMotion, selectedKey, target])\n\n // Before a panel has reported its height the box takes its content's own.\n const box = useAnimatedStyle(() => {\n 'worklet'\n const measuredHeight = height.get()\n\n return measuredHeight < 0 ? {} : { height: measuredHeight }\n })\n\n return (\n <PanelHeightContext value={report}>\n <Animated.View\n ref={ref}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.clip,\n bar.orientation === 'vertical' ? styles.besideBar : undefined,\n box,\n style,\n )}\n testID={testID}\n >\n <View>{children}</View>\n </Animated.View>\n </PanelHeightContext>\n )\n}\n\nfunction tabWidthOf(layout: TabsLayout) {\n return layout === 'scrollable' ? styles.tabScrollable : styles.tabShared\n}\n\nfunction useTabs(part: string, list = false): TabsContextValue {\n const value = use(TabsContext)\n if (value === null) {\n throw new Error(`${part} is drawn inside Tabs.`)\n }\n if (list && !value.found) {\n throw new Error(\n 'Tabs.List is written among the children of Tabs, inside any view or fragment, rather than in a component of its own.',\n )\n }\n return value\n}\n\n// The bar's `onLayout` while it scrolls, which keeps how much of it shows.\nfunction viewportOf(\n setViewport: (viewport: number) => void,\n vertical: boolean,\n) {\n return (event: LayoutChangeEvent) => {\n const { height, width } = event.nativeEvent.layout\n setViewport(vertical ? height : width)\n }\n}\n\nfunction withHeight(\n previous: ReadonlyMap<Key, number>,\n key: Key,\n height: number | undefined,\n): ReadonlyMap<Key, number> {\n if (previous.get(key) === height) {\n return previous\n }\n const next = new Map(previous)\n if (height === undefined) {\n next.delete(key)\n } else {\n next.set(key, height)\n }\n return next\n}\n\nfunction withMeasurement(\n previous: ReadonlyMap<Key, Measured>,\n key: Key,\n part: keyof Measured,\n layout: LayoutRectangle,\n): ReadonlyMap<Key, Measured> {\n const known = previous.get(key)?.[part]\n if (\n known !== undefined &&\n known.x === layout.x &&\n known.y === layout.y &&\n known.width === layout.width &&\n known.height === layout.height\n ) {\n return previous\n }\n const next = new Map(previous)\n next.set(key, { ...previous.get(key), [part]: layout })\n return next\n}\n\nTabs.List = TabsList\nTabs.Panel = TabsPanel\nTabs.Panels = TabsPanels\nTabs.Tab = TabsTab\n\nexport { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab }\nexport type {\n TabsLayout,\n TabsListProps,\n TabsPanelProps,\n TabsPanelsProps,\n TabsProps,\n TabsTabProps,\n TabsVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4QA,MAAMiG,oBAAoB;AAC1B,MAAMC,sBAAsB;AAC5B,MAAMC,kBAAkB;AAIxB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AAIvB,MAAMC,mBAAmB;AACzB,MAAMC,kBAAkB;AAExB,MAAMC,kCAA8C,IAAIE,IAAI;AAC5D,MAAMC,6BAAuC,IAAID,IAAI;AACrD,MAAME,UAAuB,CAAA;AAE7B,MAAMC,cAAcxF,cAAuC,IAAI;AAI/D,MAAMyF,qBAAqBzF,cAEzB,IAAI;AAEN,MAAM2F,SAAS9E,WAAW+E,OAAO;CAG/BC,QAAQ,EACNC,MAAM,EACR;CACAC,SAAS,EACPC,OAAO,EACT;CAEAxB,OAAO,EACLyB,YAAY,EACd;CAEAC,WAAW;EACTC,UAAU;EACVF,YAAY;EACZG,UAAU;CACZ;CAGAC,MAAM,EACJC,UAAU,SACZ;CAEA5B,MAAM;EACJ6B,YAAY;EACZN,YAAY;EACZP,QAAQX;EACRyB,gBAAgB;EAChBC,OAAO1B;CACT;CAGAvC,OAAO;EACL+D,YAAY;EACZG,eAAe;EACfT,YAAY;EACZG,UAAU;CACZ;CAEAO,MAAM;EACJJ,YAAY;EACZG,eAAe;EACfT,YAAY;EACZG,UAAU;CACZ;CAEAQ,cAAc;EACZF,eAAe;EACfT,YAAY;CACd;CAEAY,cAAc,EACZH,eAAe,MACjB;CAEAI,KAAK,EACHJ,eAAe,MACjB;CAGAK,QAAQ;EACNZ,UAAU;EACVF,YAAY;EACZG,UAAU;CACZ;CAEAY,eAAe;EACbb,UAAU;EACVF,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OuE,SACvBwN,MAAMvO,WAAWxD,OAAOwD,QAExB,OAAOiH;CAET,MAAM+G,OAAO,IAAIrO,IAAIsH,QAAQ;CAC7B+G,KAAKhE,IAAItL,KAAK;EAAE,GAAGuI,SAASN,IAAIjI,GAAG;GAAIsI,OAAOxK;CAAO,CAAC;CACtD,OAAOwR;AACT;AAEA5J,KAAKoK,OAAO7I;AACZvB,KAAKqK,QAAQd;AACbvJ,KAAKsK,SAASb;AACdzJ,KAAKuK,MAAMnG"}
@@ -38,7 +38,7 @@ type TextProps$1 = TextProps & {
38
38
  * rather than an element. `style`, `ref` and `testID` land on React Native's
39
39
  * own Text.
40
40
  */
41
- declare function Text$1({ style, tone, variant, ...props }: TextProps$1): import("react").JSX.Element;
41
+ declare function Text$1({ children, style, tone, variant, ...props }: TextProps$1): import("react").JSX.Element;
42
42
  //#endregion
43
43
  export { Text$1 as Text, type TextProps$1 as TextProps };
44
44
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,8 @@
1
1
  import { useTheme } from "../../theme/scope.js";
2
2
  import { composeStyles, themedStyles } from "../../theme/styles.js";
3
3
  import { useTypeRole } from "../../typography/roles.js";
4
+ import { TextSizeContext } from "../../typography/size.js";
5
+ import { sentenceLabel } from "../keycap/index.js";
4
6
  import { c } from "react/compiler-runtime";
5
7
  import { StyleSheet, Text } from "react-native";
6
8
  import { jsx } from "react/jsx-runtime";
@@ -36,41 +38,67 @@ const stylesOf = themedStyles(({ colors }) => StyleSheet.create({
36
38
  * own Text.
37
39
  */
38
40
  function Text$1(t0) {
39
- const $ = c(9);
41
+ const $ = c(18);
42
+ let children;
40
43
  let props;
41
44
  let style;
42
45
  let t1;
43
46
  let t2;
44
47
  if ($[0] !== t0) {
45
- ({style, tone: t1, variant: t2, ...props} = t0);
48
+ ({children, style, tone: t1, variant: t2, ...props} = t0);
46
49
  $[0] = t0;
47
- $[1] = props;
48
- $[2] = style;
49
- $[3] = t1;
50
- $[4] = t2;
50
+ $[1] = children;
51
+ $[2] = props;
52
+ $[3] = style;
53
+ $[4] = t1;
54
+ $[5] = t2;
51
55
  } else {
52
- props = $[1];
53
- style = $[2];
54
- t1 = $[3];
55
- t2 = $[4];
56
+ children = $[1];
57
+ props = $[2];
58
+ style = $[3];
59
+ t1 = $[4];
60
+ t2 = $[5];
56
61
  }
57
62
  const tone = t1 === void 0 ? "neutral" : t1;
58
63
  const role = useTypeRole(t2 === void 0 ? "bodyMedium" : t2);
59
64
  const tones = stylesOf(useTheme());
60
- const T0 = Text;
61
- const t3 = composeStyles(role, tones[tone], style);
65
+ const composed = composeStyles(role, tones[tone], style);
66
+ const size = StyleSheet.flatten(composed)?.fontSize;
67
+ const plain = typeof children === "string" || typeof children === "number";
68
+ let t3;
69
+ if ($[6] !== children || $[7] !== props) {
70
+ t3 = props.accessibilityLabel ?? (props["aria-label"] === void 0 ? sentenceLabel(children) : void 0);
71
+ $[6] = children;
72
+ $[7] = props;
73
+ $[8] = t3;
74
+ } else t3 = $[8];
75
+ const label = t3;
62
76
  let t4;
63
- if ($[5] !== T0 || $[6] !== props || $[7] !== t3) {
64
- t4 = /* @__PURE__ */ jsx(T0, {
77
+ if ($[9] !== children || $[10] !== plain || $[11] !== size) {
78
+ t4 = plain ? children : /* @__PURE__ */ jsx(TextSizeContext, {
79
+ value: size,
80
+ children
81
+ });
82
+ $[9] = children;
83
+ $[10] = plain;
84
+ $[11] = size;
85
+ $[12] = t4;
86
+ } else t4 = $[12];
87
+ let t5;
88
+ if ($[13] !== composed || $[14] !== label || $[15] !== props || $[16] !== t4) {
89
+ t5 = /* @__PURE__ */ jsx(Text, {
65
90
  ...props,
66
- style: t3
91
+ accessibilityLabel: label,
92
+ style: composed,
93
+ children: t4
67
94
  });
68
- $[5] = T0;
69
- $[6] = props;
70
- $[7] = t3;
71
- $[8] = t4;
72
- } else t4 = $[8];
73
- return t4;
95
+ $[13] = composed;
96
+ $[14] = label;
97
+ $[15] = props;
98
+ $[16] = t4;
99
+ $[17] = t5;
100
+ } else t5 = $[17];
101
+ return t5;
74
102
  }
75
103
  //#endregion
76
104
  export { Text$1 as Text };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","Ref","TextProps","NativeTextProps","Text","NativeText","StyleSheet","TypeRole","useTheme","composeStyles","themedStyles","useTypeRole","stylesOf","colors","create","error","color","inherit","muted","onSurfaceVariant","negative","neutral","onSurface","positive","primary","ref","tone","variant","t0","$","_c","props","style","t1","t2","undefined","role","tones","T0","t3","t4","Text","_c","NativeText"],"sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { TextProps as NativeTextProps } from 'react-native'\n\nimport { Text as NativeText, StyleSheet } from 'react-native'\n\nimport type { TypeRole } from '../../typography/roles'\n\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// Tone is a separate axis from variant so the two compose freely: any of the\n// fifteen roles in any of these colours, the same set web's Text takes.\n// `inherit` sets no colour, so a Text inside another takes the outer one's.\nconst stylesOf = themedStyles(({ colors }) =>\n StyleSheet.create({\n error: { color: colors.error },\n inherit: {},\n muted: { color: colors.onSurfaceVariant },\n negative: { color: colors.negative },\n neutral: { color: colors.onSurface },\n positive: { color: colors.positive },\n primary: { color: colors.primary },\n }),\n)\n\ntype TextProps = NativeTextProps & {\n readonly ref?: Ref<ComponentRef<typeof NativeText>>\n /**\n * The colour role to draw in. `neutral` is the on-surface role, as it is on\n * web; `inherit` takes the colour of the Text around it instead of setting\n * one.\n * @default 'neutral'\n */\n readonly tone?:\n | 'error'\n | 'inherit'\n | 'muted'\n | 'negative'\n | 'neutral'\n | 'positive'\n | 'primary'\n /**\n * Which role of the type scale to draw in.\n * @default 'bodyMedium'\n */\n readonly variant?: TypeRole\n}\n\n/**\n * A run of text in one role of Material Design's type scale and one colour\n * role, with web's props and values.\n *\n * ```tsx\n * <Text accessibilityRole=\"header\" variant=\"titleLarge\">\n * Headline\n * </Text>\n * ```\n *\n * Each role reads its family, size, line height, weight and tracking from the\n * theme, so an override of the plain or brand family reaches every role drawn\n * in it. The family is the token's first when the app has registered it with\n * expo-font, and the system font otherwise. The OS text size scales every\n * role, as `allowFontScaling` leaves it.\n *\n * Web's `render` and `block` have no counterpart: a native Text is a block\n * unless it sits inside another, and a heading is an `accessibilityRole`\n * rather than an element. `style`, `ref` and `testID` land on React Native's\n * own Text.\n */\nfunction Text({\n style,\n tone = 'neutral',\n variant = 'bodyMedium',\n ...props\n}: TextProps) {\n const role = useTypeRole(variant)\n const tones = stylesOf(useTheme())\n\n return (\n <NativeText {...props} style={composeStyles(role, tones[tone], style)} />\n )\n}\n\nexport type { TextProps }\n\nexport { Text }\n"],"mappings":";;;;;;;AAcA,MAAMY,WAAWF,cAAc,EAAEG,aAC/BP,WAAWQ,OAAO;CAChBC,OAAO,EAAEC,OAAOH,OAAOE,MAAM;CAC7BE,SAAS,CAAC;CACVC,OAAO,EAAEF,OAAOH,OAAOM,iBAAiB;CACxCC,UAAU,EAAEJ,OAAOH,OAAOO,SAAS;CACnCC,SAAS,EAAEL,OAAOH,OAAOS,UAAU;CACnCC,UAAU,EAAEP,OAAOH,OAAOU,SAAS;CACnCC,SAAS,EAAER,OAAOH,OAAOW,QAAQ;AACnC,CAAC,CACH;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAApB,OAAAwB,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAI,OAAAN,MAAAO,IAAAN,SAAAO,IAAA,GAAAH,SAAAH;EAKFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,QAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAHV,MAAAH,OAAAO,OAAAE,KAAAA,IAAA,YAAAF;CAIA,MAAAG,OAAazB,YAHbuB,OAAAC,KAAAA,IAAA,eAAAD,EAGgC;CAChC,MAAAG,QAAczB,SAASJ,SAAS,CAAC;CAG9B,MAAA8B,KAAAjC;CAA6B,MAAAkC,KAAA9B,cAAc2B,MAAMC,MAAMX,OAAOM,KAAK;CAAC,IAAAQ;CAAA,IAAAX,EAAA,OAAAS,MAAAT,EAAA,OAAAE,SAAAF,EAAA,OAAAU,IAAA;EAArEC,KAAA,oBAAC,IAAD;GAAW,GAAKT;GAAc,OAAAQ;EAAuC,CAAA;EAAIV,EAAA,KAAAS;EAAAT,EAAA,KAAAE;EAAAF,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAAzEW;AAAyE"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","TextProps","NativeTextProps","TextStyle","Text","NativeText","StyleSheet","TypeRole","useTheme","composeStyles","themedStyles","useTypeRole","TextSizeContext","sentenceLabel","stylesOf","colors","create","error","color","inherit","muted","onSurfaceVariant","negative","neutral","onSurface","positive","primary","ref","tone","variant","t0","$","_c","children","props","style","t1","t2","undefined","role","tones","composed","size","flatten","fontSize","plain","t3","accessibilityLabel","label","t4","t5","Text","_c","NativeText"],"sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { TextProps as NativeTextProps, TextStyle } from 'react-native'\n\nimport { Text as NativeText, StyleSheet } from 'react-native'\n\nimport type { TypeRole } from '../../typography/roles'\n\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\nimport { TextSizeContext } from '../../typography/size'\nimport { sentenceLabel } from '../keycap'\n\n// Tone is a separate axis from variant so the two compose freely: any of the\n// fifteen roles in any of these colours, the same set web's Text takes.\n// `inherit` sets no colour, so a Text inside another takes the outer one's.\nconst stylesOf = themedStyles(({ colors }) =>\n StyleSheet.create({\n error: { color: colors.error },\n inherit: {},\n muted: { color: colors.onSurfaceVariant },\n negative: { color: colors.negative },\n neutral: { color: colors.onSurface },\n positive: { color: colors.positive },\n primary: { color: colors.primary },\n }),\n)\n\ntype TextProps = NativeTextProps & {\n readonly ref?: Ref<ComponentRef<typeof NativeText>>\n /**\n * The colour role to draw in. `neutral` is the on-surface role, as it is on\n * web; `inherit` takes the colour of the Text around it instead of setting\n * one.\n * @default 'neutral'\n */\n readonly tone?:\n | 'error'\n | 'inherit'\n | 'muted'\n | 'negative'\n | 'neutral'\n | 'positive'\n | 'primary'\n /**\n * Which role of the type scale to draw in.\n * @default 'bodyMedium'\n */\n readonly variant?: TypeRole\n}\n\n/**\n * A run of text in one role of Material Design's type scale and one colour\n * role, with web's props and values.\n *\n * ```tsx\n * <Text accessibilityRole=\"header\" variant=\"titleLarge\">\n * Headline\n * </Text>\n * ```\n *\n * Each role reads its family, size, line height, weight and tracking from the\n * theme, so an override of the plain or brand family reaches every role drawn\n * in it. The family is the token's first when the app has registered it with\n * expo-font, and the system font otherwise. The OS text size scales every\n * role, as `allowFontScaling` leaves it.\n *\n * Web's `render` and `block` have no counterpart: a native Text is a block\n * unless it sits inside another, and a heading is an `accessibilityRole`\n * rather than an element. `style`, `ref` and `testID` land on React Native's\n * own Text.\n */\nfunction Text({\n children,\n style,\n tone = 'neutral',\n variant = 'bodyMedium',\n ...props\n}: TextProps) {\n const role = useTypeRole(variant)\n const tones = stylesOf(useTheme())\n const composed = composeStyles<TextStyle>(role, tones[tone], style)\n // The size the text ends up at, the call site's over the role's, which a\n // Code or a Keycap inside it sets a share of. Plain text holds neither, so\n // it goes in as it is, and a host Text's children stay the string a call\n // site wrote.\n const size = StyleSheet.flatten(composed)?.fontSize\n const plain = typeof children === 'string' || typeof children === 'number'\n // A Keycap is an inline View, whose name a native screen reader leaves out\n // of the sentence, so a Text holding one says the sentence itself unless\n // the call site has labelled it.\n const label =\n props.accessibilityLabel ??\n (props['aria-label'] === undefined ? sentenceLabel(children) : undefined)\n\n return (\n <NativeText {...props} accessibilityLabel={label} style={composed}>\n {plain ? (\n children\n ) : (\n <TextSizeContext value={size}>{children}</TextSizeContext>\n )}\n </NativeText>\n )\n}\n\nexport type { TextProps }\n\nexport { Text }\n"],"mappings":";;;;;;;;;AAgBA,MAAMe,WAAWJ,cAAc,EAAEK,aAC/BT,WAAWU,OAAO;CAChBC,OAAO,EAAEC,OAAOH,OAAOE,MAAM;CAC7BE,SAAS,CAAC;CACVC,OAAO,EAAEF,OAAOH,OAAOM,iBAAiB;CACxCC,UAAU,EAAEJ,OAAOH,OAAOO,SAAS;CACnCC,SAAS,EAAEL,OAAOH,OAAOS,UAAU;CACnCC,UAAU,EAAEP,OAAOH,OAAOU,SAAS;CACnCC,SAAS,EAAER,OAAOH,OAAOW,QAAQ;AACnC,CAAC,CACH;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAAtB,OAAA0B,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAG,UAAAE,OAAAP,MAAAQ,IAAAP,SAAAQ,IAAA,GAAAH,SAAAJ;EAMFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAA;EAAAJ,WAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,QAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;CAAA;CAHV,MAAAH,OAAAQ,OAAAE,KAAAA,IAAA,YAAAF;CAIA,MAAAG,OAAa5B,YAHb0B,OAAAC,KAAAA,IAAA,eAAAD,EAGgC;CAChC,MAAAG,QAAc1B,SAASN,SAAS,CAAC;CACjC,MAAAiC,WAAiBhC,cAAyB8B,MAAMC,MAAMZ,OAAOO,KAAK;CAKlE,MAAAO,OAAapC,WAAUqC,QAASF,QAAkB,CAAC,EAAAG;CACnD,MAAAC,QAAc,OAAOZ,aAAa,YAAY,OAAOA,aAAa;CAAQ,IAAAa;CAAA,IAAAf,EAAA,OAAAE,YAAAF,EAAA,OAAAG,OAAA;EAKxEY,KAAAZ,MAAKa,uBACJb,MAAM,kBAAkBI,KAAAA,IAAYzB,cAAcoB,QAAoB,IAAtEK,KAAAA;EAAwEP,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAF3E,MAAAiB,QACEF;CACyE,IAAAG;CAAA,IAAAlB,EAAA,OAAAE,YAAAF,EAAA,QAAAc,SAAAd,EAAA,QAAAW,MAAA;EAItEO,KAAAJ,QAAAZ,WAGC,oBAAC,iBAAD;GAAwBS,OAAAA;GAAOT;EAAf,CAAA;EACjBF,EAAA,KAAAE;EAAAF,EAAA,MAAAc;EAAAd,EAAA,MAAAW;EAAAX,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAU,YAAAV,EAAA,QAAAiB,SAAAjB,EAAA,QAAAG,SAAAH,EAAA,QAAAkB,IAAA;EALHC,KAAA,oBAACG,MAAD;GAAW,GAAKnB;GAA2Bc,oBAAAA;GAAcP,OAAAA;GACtDQ,UAAAA;EADQ,CAAA;EAMElB,EAAA,MAAAU;EAAAV,EAAA,MAAAiB;EAAAjB,EAAA,MAAAG;EAAAH,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OANbmB;AAMa"}
@@ -0,0 +1,145 @@
1
+ import { ValidationResult } from "../../form/index.js";
2
+ import { FieldVariant } from "../../field/index.js";
3
+ import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
4
+ import { ComponentRef, ReactNode, Ref } from "react";
5
+ //#region src/components/text-area/index.d.ts
6
+ type TextAreaProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholder' | 'placeholderTextColor' | 'readOnly' | 'rows' | 'selectionColor' | 'style' | 'underlineColorAndroid' | 'value'> & {
7
+ /**
8
+ * Whether the field grows with the text it holds, from `rows` up. `false`
9
+ * keeps it at `rows` and scrolls the text inside.
10
+ * @default true
11
+ */
12
+ readonly autosize?: boolean;
13
+ /**
14
+ * Counts the characters the field holds at the end of the supporting line,
15
+ * against `maxLength` where there is one, as the text fields page's
16
+ * character counter does. The count is written in the digits of the
17
+ * `I18nProvider`'s locale, or the device's outside one.
18
+ * @default false
19
+ */
20
+ readonly characterCount?: boolean;
21
+ /**
22
+ * How the limit is said to a screen reader, where there is a `maxLength`.
23
+ * Read with the field rather than as the value changes, so it names the
24
+ * limit and not what is left of it; the visible count is hidden from
25
+ * screen readers, which is what this replaces. Left out, it is the
26
+ * library's sentence in the `I18nProvider`'s locale, or the device's
27
+ * outside one, in the plural form the limit takes there: "Up to 20
28
+ * characters" in English, singular for a limit of one.
29
+ */
30
+ readonly characterLimitLabel?: string;
31
+ /** The value the field opens with, when it keeps its own. */
32
+ readonly defaultValue?: string;
33
+ /**
34
+ * A hint shown under the field. Replaced by `error` when there is one, so
35
+ * the two never stack.
36
+ */
37
+ readonly description?: string;
38
+ /**
39
+ * The problem with the current value, in words. Its presence is what puts
40
+ * the field in its error state: the message, the error colours, and the
41
+ * invalid state a screen reader reads all follow from it. The line under
42
+ * the field arrives with the message, so the field grows when this does,
43
+ * unless it is inside a `Form`, which keeps the line drawn. It wins over
44
+ * what `validate` and the form say, and holds a `native` form back.
45
+ */
46
+ readonly error?: string;
47
+ /**
48
+ * Whether the label sits in the empty box and floats to the top once the
49
+ * field is focused or holds a value, as the text fields page draws it.
50
+ * `false` keeps it small at the top in every state.
51
+ * @default true
52
+ */
53
+ readonly floatingLabel?: boolean;
54
+ /**
55
+ * A ref to the field's own `TextInput`, which is what a call site moves
56
+ * focus to, after a server's error, say. `ref` is the field as a whole.
57
+ */
58
+ readonly inputRef?: Ref<ComponentRef<typeof TextInput>>;
59
+ /**
60
+ * Draws the field disabled: it takes no focus and no input.
61
+ * @default false
62
+ */
63
+ readonly isDisabled?: boolean;
64
+ /**
65
+ * Shows the value and takes focus, but takes no input.
66
+ * @default false
67
+ */
68
+ readonly isReadOnly?: boolean;
69
+ /**
70
+ * Marks the label with an asterisk, as the text fields page marks a field
71
+ * that must be filled.
72
+ * @default false
73
+ */
74
+ readonly isRequired?: boolean;
75
+ /**
76
+ * What the field is for, and the name a screen reader reads for it.
77
+ * Required, since a text area with no label is a box nobody can name.
78
+ */
79
+ readonly label: string;
80
+ /**
81
+ * An icon at the start of the box, before the label and the text: the
82
+ * page's 24dp leading icon, in the muted role. The slot hands it that
83
+ * colour and size through `useIconStyle()`.
84
+ */
85
+ readonly leadingIcon?: ReactNode;
86
+ /**
87
+ * The name the value is submitted under by the `Form` around the field,
88
+ * and the key its `validationErrors` reach the field by.
89
+ */
90
+ readonly name?: string;
91
+ /** Called with the new value as it is edited. */
92
+ readonly onChange?: (value: string) => void;
93
+ readonly ref?: Ref<ComponentRef<typeof View>>;
94
+ /**
95
+ * How many lines of text the field shows: the least it shows while it
96
+ * grows, or all it shows when it does not.
97
+ * @default 3
98
+ */
99
+ readonly rows?: number;
100
+ /** Positions and sizes the field as a whole. */
101
+ readonly style?: StyleProp<ViewStyle>;
102
+ /**
103
+ * An icon at the end of the box, after the text: the page's 24dp trailing
104
+ * icon, in the muted role and the error role while the field has an
105
+ * error. The slot hands it that colour and size through `useIconStyle()`.
106
+ */
107
+ readonly trailingIcon?: ReactNode;
108
+ /**
109
+ * Checks the value, and returns its problem in words, or several, where
110
+ * there is one, and `true`, `null` or `undefined` where there is none.
111
+ * Under the default `aria` validation the error shows as the value
112
+ * changes; inside a `native` form it shows once a submission is tried, or
113
+ * once the field loses focus after an edit, and holds the form back.
114
+ */
115
+ readonly validate?: (value: string) => ValidationResult;
116
+ /** The value, when the call site keeps it. */
117
+ readonly value?: string;
118
+ /**
119
+ * The filled box, or the outlined one: no fill, an outline that thickens
120
+ * and takes the primary role while focused, and the label cutting it once
121
+ * it floats, the text fields page's two fields.
122
+ * @default 'filled'
123
+ */
124
+ readonly variant?: FieldVariant;
125
+ };
126
+ /**
127
+ * A labelled multi-line input, the text fields page's filled or outlined
128
+ * field holding several lines. Pass `value` with `onChange` to control it, or
129
+ * `defaultValue` to let it keep its own; `onChange` is handed the string.
130
+ *
131
+ * It shows `rows` lines at the least and grows with what it holds, or holds
132
+ * at `rows` and scrolls with `autosize={false}`. The page's configurations
133
+ * are props: `leadingIcon` and `trailingIcon` at the box's ends, and
134
+ * `characterCount` opposite the supporting text, counting against
135
+ * `maxLength`. React Native's own `TextInput` props reach the control;
136
+ * `style` and `ref` are the field as a whole, and `inputRef` the control.
137
+ *
138
+ * ```tsx
139
+ * <TextArea label="Label" description="Supporting line" />
140
+ * ```
141
+ */
142
+ declare function TextArea({ autosize, characterCount, characterLimitLabel, defaultValue, description, error, floatingLabel, inputRef, isDisabled, isReadOnly, isRequired, label, leadingIcon, name, onBlur, onChange, onFocus, ref, rows, style, trailingIcon, validate, value, variant, ...props }: TextAreaProps): import("react").JSX.Element;
143
+ //#endregion
144
+ export { TextArea, type TextAreaProps };
145
+ //# sourceMappingURL=index.d.ts.map