@kanso-labs/react-native-kanso-ui 0.7.0 → 0.9.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 (150) hide show
  1. package/README.md +37 -0
  2. package/dist/badge/index.js +9 -68
  3. package/dist/badge/index.js.map +1 -1
  4. package/dist/button/index.d.ts +2 -1
  5. package/dist/button/index.js +1 -1
  6. package/dist/button/index.js.map +1 -1
  7. package/dist/button/palettes.d.ts +2 -0
  8. package/dist/button/pending.js +17 -21
  9. package/dist/button/pending.js.map +1 -1
  10. package/dist/calendar/index.js +1 -1
  11. package/dist/components/autocomplete/index.js +28 -26
  12. package/dist/components/autocomplete/index.js.map +1 -1
  13. package/dist/components/avatar/index.d.ts +2 -2
  14. package/dist/components/avatar/index.js +2 -2
  15. package/dist/components/avatar/index.js.map +1 -1
  16. package/dist/components/badge/index.d.ts +48 -0
  17. package/dist/components/badge/index.js +122 -0
  18. package/dist/components/badge/index.js.map +1 -0
  19. package/dist/{badge → components/badge}/styles.js +10 -6
  20. package/dist/components/badge/styles.js.map +1 -0
  21. package/dist/components/breadcrumbs/index.d.ts +66 -0
  22. package/dist/components/breadcrumbs/index.js +285 -0
  23. package/dist/components/breadcrumbs/index.js.map +1 -0
  24. package/dist/components/calendar/index.d.ts +1 -1
  25. package/dist/components/calendar/index.js +77 -38
  26. package/dist/components/calendar/index.js.map +1 -1
  27. package/dist/components/checkbox/index.d.ts +7 -1
  28. package/dist/components/checkbox/index.js +183 -138
  29. package/dist/components/checkbox/index.js.map +1 -1
  30. package/dist/components/checkbox-group/index.d.ts +93 -0
  31. package/dist/components/checkbox-group/index.js +306 -0
  32. package/dist/components/checkbox-group/index.js.map +1 -0
  33. package/dist/components/chip-group/index.d.ts +4 -3
  34. package/dist/components/chip-group/index.js +47 -45
  35. package/dist/components/chip-group/index.js.map +1 -1
  36. package/dist/components/code/index.d.ts +25 -0
  37. package/dist/components/code/index.js +87 -0
  38. package/dist/components/code/index.js.map +1 -0
  39. package/dist/components/container/index.d.ts +47 -0
  40. package/dist/components/container/index.js +85 -0
  41. package/dist/components/container/index.js.map +1 -0
  42. package/dist/components/copy-field/index.d.ts +5 -5
  43. package/dist/components/copy-field/index.js +30 -28
  44. package/dist/components/copy-field/index.js.map +1 -1
  45. package/dist/components/currency/index.d.ts +2 -2
  46. package/dist/components/currency/index.js +3 -1
  47. package/dist/components/currency/index.js.map +1 -1
  48. package/dist/components/fab/index.d.ts +80 -0
  49. package/dist/components/fab/index.js +231 -0
  50. package/dist/components/fab/index.js.map +1 -0
  51. package/dist/components/fab-menu/index.d.ts +120 -0
  52. package/dist/components/fab-menu/index.js +640 -0
  53. package/dist/components/fab-menu/index.js.map +1 -0
  54. package/dist/components/feed/index.d.ts +57 -0
  55. package/dist/components/feed/index.js +167 -0
  56. package/dist/components/feed/index.js.map +1 -0
  57. package/dist/components/keycap/index.d.ts +27 -0
  58. package/dist/components/keycap/index.js +136 -0
  59. package/dist/components/keycap/index.js.map +1 -0
  60. package/dist/components/list/index.d.ts +6 -5
  61. package/dist/components/list/index.js +97 -106
  62. package/dist/components/list/index.js.map +1 -1
  63. package/dist/components/menu/index.d.ts +4 -3
  64. package/dist/components/menu/index.js +33 -40
  65. package/dist/components/menu/index.js.map +1 -1
  66. package/dist/components/meter/index.d.ts +2 -1
  67. package/dist/components/meter/index.js +9 -7
  68. package/dist/components/meter/index.js.map +1 -1
  69. package/dist/components/number-field/index.d.ts +7 -3
  70. package/dist/components/number-field/index.js +214 -192
  71. package/dist/components/number-field/index.js.map +1 -1
  72. package/dist/components/product-icon/index.d.ts +2 -2
  73. package/dist/components/product-icon/index.js +2 -2
  74. package/dist/components/product-icon/index.js.map +1 -1
  75. package/dist/components/progress-indicator/index.d.ts +2 -1
  76. package/dist/components/progress-indicator/index.js +15 -13
  77. package/dist/components/progress-indicator/index.js.map +1 -1
  78. package/dist/components/search-field/index.d.ts +3 -3
  79. package/dist/components/search-field/index.js +105 -104
  80. package/dist/components/search-field/index.js.map +1 -1
  81. package/dist/components/separator/index.d.ts +3 -2
  82. package/dist/components/separator/index.js +29 -26
  83. package/dist/components/separator/index.js.map +1 -1
  84. package/dist/components/sheet/index.d.ts +2 -2
  85. package/dist/components/sheet/index.js +22 -26
  86. package/dist/components/sheet/index.js.map +1 -1
  87. package/dist/components/snackbar/index.d.ts +3 -3
  88. package/dist/components/snackbar/index.js +36 -34
  89. package/dist/components/snackbar/index.js.map +1 -1
  90. package/dist/components/supporting-pane/index.d.ts +44 -0
  91. package/dist/components/supporting-pane/index.js +109 -0
  92. package/dist/components/supporting-pane/index.js.map +1 -0
  93. package/dist/components/tag/index.d.ts +58 -0
  94. package/dist/components/tag/index.js +205 -0
  95. package/dist/components/tag/index.js.map +1 -0
  96. package/dist/components/text/index.d.ts +1 -1
  97. package/dist/components/text/index.js +49 -21
  98. package/dist/components/text/index.js.map +1 -1
  99. package/dist/components/text-area/index.d.ts +145 -0
  100. package/dist/components/text-area/index.js +231 -0
  101. package/dist/components/text-area/index.js.map +1 -0
  102. package/dist/components/text-field/index.d.ts +6 -3
  103. package/dist/components/text-field/index.js +3 -0
  104. package/dist/components/text-field/index.js.map +1 -1
  105. package/dist/components/toolbar/index.d.ts +53 -0
  106. package/dist/components/toolbar/index.js +185 -0
  107. package/dist/components/toolbar/index.js.map +1 -0
  108. package/dist/control/group.js +23 -0
  109. package/dist/control/group.js.map +1 -0
  110. package/dist/fab/index.d.ts +19 -0
  111. package/dist/fab/index.js +147 -0
  112. package/dist/fab/index.js.map +1 -0
  113. package/dist/field/index.js +123 -79
  114. package/dist/field/index.js.map +1 -1
  115. package/dist/field/styles.js +18 -0
  116. package/dist/field/styles.js.map +1 -1
  117. package/dist/form/index.d.ts +1 -2
  118. package/dist/form/index.js +1 -1
  119. package/dist/form/index.js.map +1 -1
  120. package/dist/i18n/index.js +12 -1
  121. package/dist/i18n/index.js.map +1 -1
  122. package/dist/i18n/messages.js +367 -0
  123. package/dist/i18n/messages.js.map +1 -1
  124. package/dist/i18n/provider.d.ts +53 -0
  125. package/dist/i18n/provider.js +96 -0
  126. package/dist/i18n/provider.js.map +1 -0
  127. package/dist/index.d.ts +19 -4
  128. package/dist/index.js +17 -3
  129. package/dist/indicator/index.js +1 -2
  130. package/dist/indicator/index.js.map +1 -1
  131. package/dist/mark/index.js +77 -117
  132. package/dist/mark/index.js.map +1 -1
  133. package/dist/mark/initials.js.map +1 -1
  134. package/dist/modal/index.js +59 -46
  135. package/dist/modal/index.js.map +1 -1
  136. package/dist/navigation/index.js +8 -5
  137. package/dist/navigation/index.js.map +1 -1
  138. package/dist/number/count.js +15 -0
  139. package/dist/number/count.js.map +1 -0
  140. package/dist/number/locale.js.map +1 -1
  141. package/dist/overlay/host.js +30 -21
  142. package/dist/overlay/host.js.map +1 -1
  143. package/dist/overlay/placement.js +3 -1
  144. package/dist/overlay/placement.js.map +1 -1
  145. package/dist/separator/index.js +7 -0
  146. package/dist/separator/index.js.map +1 -0
  147. package/dist/typography/size.js +14 -0
  148. package/dist/typography/size.js.map +1 -0
  149. package/package.json +1 -1
  150. package/dist/badge/styles.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","Ref","DimensionValue","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","I18nManager","StyleSheet","View","Animated","useAnimatedProps","useAnimatedStyle","useDerivedValue","useReducedMotion","Svg","Path","IndicatorColors","IndicatorTone","Curve","Keyframe","RingWave","HIDDEN","activeLength","fillOf","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","keyframeAt","useLoop","arcPath","TURN","WAVE_HEIGHT","WAVE_ORIGIN","wavePath","wavyArcPath","DETERMINATE_EASING","GAP","stylesOf","indicatorStylesOf","THICKNESS","parseLength","useTheme","composeStyles","themedStyles","Bar","scale","start","translate","ProgressIndicatorProps","Omit","buffer","diameter","formatOptions","Intl","NumberFormatOptions","isIndeterminate","label","locale","maxValue","minValue","ref","shape","ProgressIndicatorShape","showValue","style","tone","ProgressIndicatorTone","value","valueLabel","variant","ProgressIndicatorVariant","Extract","CIRCULAR_SIZE","RADIUS","ARC_MS","CYCLE_MS","ROTATE_MS","Math","round","RING_EASING","RING_SETTLE","INDETERMINATE_MS","BUFFER_MS","LINE_SLOWDOWN","RING_SLOWDOWN","WAVE_WAVELENGTH","INDETERMINATE_WAVELENGTH","WAVE_REACH","WAVE_FROM","WAVE_UNTIL","WAVY_SIZE","RING_AMPLITUDE","RING_WAVELENGTH","WAVY_RADIUS","RING_WAVE","amplitude","centre","radius","waves","PITCH","PRIMARY_BAR","SECONDARY_BAR","EXPAND_ARC","TRAVEL_ARC","AnimatedPath","createAnimatedComponent","styles","create","bar","height","left","position","top","transformOrigin","buffered","flexShrink","dot","width","dotRow","flexDirection","gap","dots","flexGrow","minWidth","overflow","line","alignSelf","justifyContent","mirrored","transform","scaleX","rootCircular","alignItems","row","track","absoluteFill","wave","wavyLine","radii","borderRadius","pill","circle","Buffer","t0","$","_c","colors","share","theme","own","reduceMotion","clock","direction","isRTL","scroll","translateX","get","t1","widthOf","t2","T0","t4","t5","t6","dotsFor","map","t7","t8","t3","t9","bufferShare","percentage","undefined","range","remaining","min","max","CircularTrack","motion","wavy","box","circumference","durationLong2","duration","easing","timing","shown","fade","isWaving","slowdown","arc","cycle","turn","active","opacity","from","d","length","strokeOf","DeterminateLine","durationMedium1","under","Array","ceil","_","index","IndeterminateBars","primary","useBarStyle","secondary","IndeterminateLine","LinearTrack","onLayout","LineWave","Symbol","for","ProgressIndicator","ariaLabel","props","reading","text","t10","root","RingWavePath","phase","color","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","const","time","WaveBar","to","_c","indicatorStylesOf"],"sources":["../../../src/components/progress-indicator/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type {\n DimensionValue,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport { I18nManager, StyleSheet, View } from 'react-native'\nimport Animated, {\n useAnimatedProps,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n} from 'react-native-reanimated'\nimport Svg, { Path } from 'react-native-svg'\n\nimport type { IndicatorColors, IndicatorTone } from '../../indicator'\nimport type { Curve, Keyframe } from '../../indicator/motion'\nimport type { RingWave } from '../../indicator/paths'\n\nimport { HIDDEN } from '../../glyphs/hidden'\nimport {\n activeLength,\n fillOf,\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport { keyframeAt, useLoop } from '../../indicator/motion'\nimport {\n arcPath,\n TURN,\n WAVE_HEIGHT,\n WAVE_ORIGIN,\n wavePath,\n wavyArcPath,\n} from '../../indicator/paths'\nimport {\n DETERMINATE_EASING,\n GAP,\n stylesOf as indicatorStylesOf,\n THICKNESS,\n} from '../../indicator/styles'\nimport { parseLength } from '../../theme/resolve'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The progress indicators page's indicator, as kanso-ui's ProgressIndicator\n// draws it: a line or a ring, in either of the page's two shapes, flat and\n// wavy. Both carry the three parts the page's anatomy names, the active\n// indicator in primary, the track in secondary container and, on the line,\n// the stop indicator in primary at the end, at the page's 4dp thickness with\n// the 4dp gap its measurements give either side of the track. The flat ring\n// is the page's default 40dp of the four sizes it draws, and the wavy ring the\n// 48dp its wave needs room for.\n//\n// The determinate line is src/indicator's, which Meter draws too: the active\n// indicator takes the value's share of what the gaps and the stop leave, and\n// the track takes the rest. The determinate ring is two arcs of one circle:\n// the active arc runs clockwise from the top for its share of the\n// circumference, and the track picks up 4dp past it and stops 4dp before it\n// comes back round, which is the same gap measured along the curve.\n//\n// The animations are Material's own, with web's numbers: the line's two bars\n// and their four keyframe sets, the buffer's scrolling dots, the ring's 1333ms\n// arc, its four-arc cycle and its 1568ms rotation, and the 250ms and 500ms a\n// determinate value moves over. React Native has no CSS keyframes, so each\n// set is a list of the same frames read off a looping clock on the UI thread,\n// in src/indicator/motion.ts.\n//\n// Under reduced motion the motion slows rather than stopping, as web's does:\n// an indicator that freezes stops saying the work is going on, and a frozen\n// arc caught at its short end reads as broken. The multipliers are web's, two\n// for the line and a quarter more for the ring. A determinate value jumps\n// there instead of easing, as web's transition drops to `0s`.\n//\n// The wavy shape draws the active indicator as a wave and leaves the track and\n// the stop flat, as the page does, with web's numbers, which are Material's\n// own: on the line a 3dp amplitude, a 40dp wavelength and a 10dp row, with a\n// 20dp wavelength while indeterminate; on the ring a 1.6dp amplitude and a\n// 15dp wavelength, rounded to a whole number of waves so the wave closes on\n// itself. A determinate wave lies flat up to a tenth of the way and from 95%\n// on, and is drawn over the flat drawing, the two crossfading as the value\n// crosses those bounds. The flat drawing is also what a reader who has asked\n// for reduced motion sees, since a wave is motion even standing still, and\n// what a line wider than `WAVE_REACH` is drawn as.\n//\n// Web cuts its arcs and waves out of whole curves with dash patterns; here\n// each is a path built from where it starts and how far it runs, for the\n// reason src/indicator/paths.ts gives.\n//\n// The root carries the role, the range, the value and its text, which React\n// Aria's `useProgressBar` gives web's, so a screen reader hears the label and\n// the value as one element. The value is read as React Aria reads it: clamped\n// to the range, and written as a percentage unless `formatOptions` says\n// otherwise, in `locale`.\n\n/** A bar of the indeterminate line, as web's keyframes move it. */\ntype Bar = {\n /** Its scale across, from its start. */\n readonly scale: readonly Keyframe[]\n /** Where it starts, as a share of the row before the row's own start. */\n readonly start: number\n /** How far it has travelled from there, as a share of the row. */\n readonly translate: readonly Keyframe[]\n}\n\ntype ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How far the work is loaded ahead of the value, a video's buffered\n * seconds or a queue's fetched pages. Read on the same scale as `value`:\n * the track is solid up to it and dotted beyond. Ignored while the\n * indicator is indeterminate and by the ring, and left out for work with\n * nothing to buffer.\n */\n readonly buffer?: number\n /**\n * How wide the ring is drawn, as a CSS length read the way a theme's\n * lengths are. Everything inside scales with it, so a ring in a button can\n * take the button's icon size. The length is in px, since a relative unit\n * has nothing on native to be relative to. Ignored by the line, which fills\n * the width it is given.\n * @default '40px', or '48px' for the wavy ring\n */\n readonly diameter?: `${number}px`\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * For work whose length is not known: the indicator runs on its own, and\n * has no value to show or announce.\n * @default false\n */\n readonly isIndeterminate?: boolean\n /**\n * What the work is, shown above the indicator. A screen reader reads it as\n * the indicator's name; an indicator whose surroundings name it takes\n * `aria-label` instead and leaves this out.\n */\n readonly label?: string\n /**\n * The BCP 47 locale the value is written in. Defaults to the device's.\n */\n readonly locale?: string\n /**\n * The value at which the work is done.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The value at which the work starts.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The page's two shapes. `wavy` draws the active indicator as a wave, which\n * lies flat near either end of a determinate value, and leaves the track\n * and the stop flat; the wavy ring is 48dp across rather than 40. Under\n * reduced motion a wavy indicator is drawn flat.\n * @default 'flat'\n */\n readonly shape?: ProgressIndicatorShape\n /**\n * Whether the value is shown beside the label. Ignored while the indicator\n * is indeterminate, which has no value to show.\n * @default false\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours it is drawn in. `primary` is the page's own pair, the active\n * indicator in primary over a secondary container track, and `inherit`\n * takes the colour of the slot it sits in, for an indicator inside something\n * that already has one, such as a button, where primary would be the fill.\n * @default 'primary'\n */\n readonly tone?: ProgressIndicatorTone\n /**\n * How far the work has gone, between `minValue` and `maxValue`.\n * @default 0\n */\n readonly value?: number\n /** The value as words, in place of the number `formatOptions` writes. */\n readonly valueLabel?: string\n /**\n * The line the page draws, or the ring: `linear` fills the width it is\n * given, `circular` is 40dp across.\n * @default 'linear'\n */\n readonly variant?: ProgressIndicatorVariant\n}\n\ntype ProgressIndicatorShape = 'flat' | 'wavy'\n\n// The two of the shared line's four tones an indicator draws. The other two\n// say how a measurement reads, which is a meter's business rather than a\n// running task's.\ntype ProgressIndicatorTone = Extract<IndicatorTone, 'inherit' | 'primary'>\n\ntype ProgressIndicatorVariant = 'circular' | 'linear'\n\n// The flat ring. The radius is the diameter less the stroke, halved, so the\n// stroke sits inside the 40dp box rather than straddling its edge.\nconst CIRCULAR_SIZE = 40\nconst RADIUS = (CIRCULAR_SIZE - THICKNESS) / 2\n\n// The ring's timings. The arc is 1333ms; a full cycle is four of them; and the\n// rotation is the arc scaled by 360/306, which is the arc's start rotation plus\n// the circle less the arc's size. A determinate ring moves on Material's own\n// curve rather than the line's.\nconst ARC_MS = 1333\nconst CYCLE_MS = ARC_MS * 4\nconst ROTATE_MS = Math.round((ARC_MS * 360) / 306)\nconst RING_EASING: Curve = [0.4, 0, 0.2, 1]\nconst RING_SETTLE: Curve = [0, 0, 0.2, 1]\n\n// The line's own: 2s for an indeterminate pass, and the 250ms the buffer's\n// dots take to scroll one pitch.\nconst INDETERMINATE_MS = 2000\nconst BUFFER_MS = 250\n\n// What reduced motion slows each shape by.\nconst LINE_SLOWDOWN = 2\nconst RING_SLOWDOWN = 1.25\n\n// The wavy line's two wavelengths, and how far the wave runs: a row wider than\n// that draws flat, as web's does.\nconst WAVE_WAVELENGTH = 40\nconst INDETERMINATE_WAVELENGTH = 20\nconst WAVE_REACH = 2048\n\n// Where a determinate wave stands up and where it lies down again, as\n// percentages of the way.\nconst WAVE_FROM = 10\nconst WAVE_UNTIL = 95\n\n// The wavy ring: the 48dp box, and the wave round the circle pulled in by the\n// amplitude so its crests stay inside the box. The wave count is the\n// wavelength's share of that circle, rounded, which is nine.\nconst WAVY_SIZE = 48\nconst RING_AMPLITUDE = 1.6\nconst RING_WAVELENGTH = 15\nconst WAVY_RADIUS = (WAVY_SIZE - THICKNESS) / 2 - RING_AMPLITUDE\n\nconst RING_WAVE: RingWave = {\n amplitude: RING_AMPLITUDE,\n centre: WAVY_SIZE / 2,\n radius: WAVY_RADIUS,\n waves: Math.round((TURN * WAVY_RADIUS) / RING_WAVELENGTH),\n}\n\n// The buffer's dots: the track's colour, at the stroke's size, one pitch of\n// two and a half strokes apart.\nconst PITCH = THICKNESS * 2.5\n\n// The two bars of the indeterminate line, translated and scaled at once, with\n// web's keyframes, which are Material's.\nconst PRIMARY_BAR: Bar = {\n scale: [\n [0, 0.08],\n [0.3665, 0.08, [0.334731, 0.12482, 0.785844, 1]],\n [0.6915, 0.661479, [0.06, 0.11, 0.6, 1]],\n [1, 0.08],\n ],\n start: -1.45167,\n translate: [\n [0, 0],\n [0.2, 0, [0.5, 0, 0.701732, 0.495819]],\n [0.5915, 0.836714, [0.302435, 0.381352, 0.55, 0.956352]],\n [1, 2.00611],\n ],\n}\n\nconst SECONDARY_BAR: Bar = {\n scale: [\n [0, 0.08, [0.205028, 0.057051, 0.57661, 0.453971]],\n [0.1915, 0.457104, [0.152313, 0.196432, 0.648374, 1.00432]],\n [0.4415, 0.72796, [0.257759, -0.003163, 0.211762, 1.38179]],\n [1, 0.08],\n ],\n start: -0.548889,\n translate: [\n [0, 0, [0.15, 0, 0.515058, 0.409685]],\n [0.25, 0.376519, [0.31033, 0.284058, 0.8, 0.733712]],\n [0.4835, 0.843862, [0.4, 0.627035, 0.6, 0.902026]],\n [1, 1.60278],\n ],\n}\n\n// The indeterminate ring's arc, as a share of the way round. Material\n// contracts it to 10 degrees of turn and grows it to 270; web draws the short\n// end at 8% rather than 10 degrees, since a round cap on so short an arc draws\n// a dot, and this is web's.\nconst EXPAND_ARC: readonly Keyframe[] = [\n [0, 0.08, RING_EASING],\n [0.5, 0.75, RING_EASING],\n [1, 0.08],\n]\n\n// Where the arc starts, in turns. Material turns it in eight steps of 135\n// degrees rather than at a constant rate, each on the arc's own curve, so it\n// settles at each position and springs to the next: three full turns over the\n// cycle, under the rotation's own single turn.\nconst TRAVEL_ARC: readonly Keyframe[] = [\n [0, 0, RING_EASING],\n [0.125, 0.375, RING_EASING],\n [0.25, 0.75, RING_EASING],\n [0.375, 1.125, RING_EASING],\n [0.5, 1.5, RING_EASING],\n [0.625, 1.875, RING_EASING],\n [0.75, 2.25, RING_EASING],\n [0.875, 2.625, RING_EASING],\n [1, 3],\n]\n\nconst AnimatedPath = Animated.createAnimatedComponent(Path)\n\nconst styles = StyleSheet.create({\n // A bar of the indeterminate line: the row's width, scaled from its start\n // and travelling across. Physical rather than logical, as web's are: the\n // keyframes move one way only, so the direction is handled once, by\n // mirroring the row.\n bar: {\n height: THICKNESS,\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'left center',\n },\n // The solid part of a buffered track, as far as the buffer reaches.\n buffered: {\n flexShrink: 0,\n height: THICKNESS,\n },\n dot: {\n height: THICKNESS,\n width: THICKNESS,\n },\n // The dots, scrolling one pitch toward the start of the line and starting\n // again.\n dotRow: {\n flexDirection: 'row',\n gap: PITCH - THICKNESS,\n },\n // What the buffer leaves of the track, which the dots fill.\n dots: {\n flexGrow: 1,\n flexShrink: 1,\n height: THICKNESS,\n minWidth: 0,\n overflow: 'hidden',\n },\n // The flat line's row, whose width the line is drawn to.\n line: {\n alignSelf: 'stretch',\n justifyContent: 'center',\n },\n mirrored: {\n transform: [{ scaleX: -1 }],\n },\n // A circular indicator is its own size rather than the room it is given.\n rootCircular: {\n alignItems: 'flex-start',\n },\n // The indeterminate line's row, which clips its bars at both ends.\n row: {\n alignSelf: 'stretch',\n height: THICKNESS,\n overflow: 'hidden',\n },\n // The track behind the indeterminate line's bars.\n track: {\n ...StyleSheet.absoluteFill,\n },\n // A wave over the line: the row's whole box, mirrored under a right-to-left\n // layout so it starts at the start of the line.\n wave: {\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n },\n // The wavy line's row: the wave's 10dp, with the flat line through its\n // middle.\n wavyLine: {\n alignSelf: 'stretch',\n height: WAVE_HEIGHT,\n justifyContent: 'center',\n },\n})\n\nconst stylesOf = themedStyles(({ radii }) =>\n StyleSheet.create({\n // The bars carry the pill every other part of the line draws. It is drawn\n // under the bar's own scale, so it flattens as the bar narrows, as web's\n // and Material's do.\n bar: { borderRadius: radii.pill },\n dot: { borderRadius: radii.circle },\n row: { borderRadius: radii.pill },\n }),\n)\n\n/**\n * The dots beyond the buffer, scrolling toward the start of the line. There\n * is one more of them than the row has room for, so the row stays full as\n * they move.\n */\nfunction Buffer({\n colors,\n share,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly share: number\n readonly width: number\n}) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const clock = useLoop(BUFFER_MS * (reduceMotion ? LINE_SLOWDOWN : 1), true)\n // A translation is not mirrored under a right-to-left layout, though the\n // row is, so the dots travel the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const scroll = useAnimatedStyle(() => {\n 'worklet'\n return { transform: [{ translateX: -PITCH * clock.get() * direction }] }\n })\n\n return (\n <>\n <View\n style={composeStyles<ViewStyle>(\n styles.buffered,\n fillOf(colors.track),\n widthOf(`${share}%`),\n )}\n />\n <View style={styles.dots}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.dotRow, scroll)}\n >\n {dotsFor(width).map((dot) => (\n <View\n key={dot}\n style={composeStyles<ViewStyle>(\n styles.dot,\n own.dot,\n fillOf(colors.track),\n )}\n />\n ))}\n </Animated.View>\n </View>\n </>\n )\n}\n\n// How much of the track the buffer covers. The buffer is read on the value's\n// scale, and the track holds what the value has not taken, so the solid part\n// is the buffer's share of that remainder, as web's `bufferShare` gives it.\nfunction bufferShare(\n buffer: number | undefined,\n percentage: number,\n minValue: number,\n maxValue: number,\n) {\n if (buffer === undefined) {\n return undefined\n }\n const range = maxValue - minValue\n const buffered = range === 0 ? 0 : ((buffer - minValue) / range) * 100\n const remaining = 100 - percentage\n if (remaining <= 0) {\n return 0\n }\n return Math.min(100, Math.max(0, ((buffered - percentage) / remaining) * 100))\n}\n\n/**\n * The ring: two arcs of one circle while determinate, one arc growing,\n * shrinking and travelling round while indeterminate, and for the wavy shape a\n * wave over the active arc. Drawn on a box of its own size and scaled to the\n * diameter, so the stroke and the gap scale with it.\n */\nfunction CircularTrack({\n colors,\n diameter,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly colors: IndicatorColors\n readonly diameter: number\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion\n const box = wavy ? WAVY_SIZE : CIRCULAR_SIZE\n const centre = box / 2\n const radius = wavy ? WAVY_RADIUS : RADIUS\n const circumference = TURN * radius\n const timing = { duration: motion.durationLong2, easing: RING_SETTLE }\n const shown = useEased(percentage, timing)\n const fade = useEased(\n waves && (isIndeterminate || isWaving(percentage)) ? 1 : 0,\n timing,\n )\n const slowdown = reduceMotion ? RING_SLOWDOWN : 1\n const arc = useLoop(ARC_MS * slowdown, isIndeterminate)\n const cycle = useLoop(CYCLE_MS * slowdown, isIndeterminate)\n const turn = useLoop(Math.round(ROTATE_MS * slowdown), isIndeterminate)\n\n // The active arc, or the indeterminate one: it grows and shrinks over the\n // arc's duration, its start travels the circle over the cycle, and the\n // whole of it turns over the rotation's. An indeterminate ring starts at\n // three o'clock, as web's does once its spin replaces the quarter turn back\n // that puts a determinate one's start at the top.\n const active = useAnimatedProps(() => {\n 'worklet'\n const opacity = 1 - fade.get()\n if (isIndeterminate) {\n const from =\n TURN / 4 + TURN * (turn.get() + keyframeAt(TRAVEL_ARC, cycle.get()))\n return {\n d: arcPath(\n centre,\n radius,\n from,\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity,\n }\n }\n return {\n d: arcPath(centre, radius, 0, (TURN * shown.get()) / 100),\n opacity,\n }\n })\n // The track picks up a gap past the active arc and stops a gap before the\n // top.\n const track = useAnimatedProps(() => {\n 'worklet'\n const length = (circumference * shown.get()) / 100\n return {\n d: arcPath(\n centre,\n radius,\n (length + GAP) / radius,\n Math.max(0, circumference - length - 2 * GAP) / radius,\n ),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={diameter}\n viewBox={`0 0 ${box} ${box}`}\n width={diameter}\n >\n {isIndeterminate ? null : (\n <AnimatedPath animatedProps={track} {...strokeOf(colors.track)} />\n )}\n <AnimatedPath animatedProps={active} {...strokeOf(colors.active)} />\n {waves ? (\n <RingWavePath\n arc={arc}\n colors={colors}\n cycle={cycle}\n fade={fade}\n isIndeterminate={isIndeterminate}\n shown={shown}\n turn={turn}\n />\n ) : null}\n </Svg>\n )\n}\n\n/**\n * The line determinate: src/indicator's, with the buffer in its track, and\n * for the wavy shape a wave over its active indicator, crossfading with it as\n * the value crosses the bounds the wave stands between.\n */\nfunction DeterminateLine({\n buffer,\n colors,\n percentage,\n waves,\n width,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly percentage: number\n readonly waves: boolean\n readonly width: number\n}) {\n const { motion } = useTheme()\n const timing = {\n duration: motion.durationMedium1,\n easing: DETERMINATE_EASING,\n }\n const shown = useEased(percentage, timing)\n const fade = useEased(waves && isWaving(percentage) ? 1 : 0, timing)\n const under = useDerivedValue(() => 1 - fade.get())\n\n return (\n <>\n <IndicatorLine\n activeOpacity={waves ? under : undefined}\n colors={colors}\n percentage={shown}\n width={width}\n >\n {buffer === undefined ? undefined : (\n <Buffer colors={colors} share={buffer} width={width} />\n )}\n </IndicatorLine>\n {waves ? (\n <LineWave colors={colors} fade={fade} shown={shown} width={width} />\n ) : null}\n </>\n )\n}\n\n// One key for each dot the buffer draws across `width`.\nfunction dotsFor(width: number) {\n return Array.from(\n { length: Math.ceil(width / PITCH) + 1 },\n (_, index) => index,\n )\n}\n\n// The flat bars of the indeterminate line.\nfunction IndeterminateBars({\n clock,\n colors,\n width,\n}: {\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const primary = useBarStyle(clock, PRIMARY_BAR, width)\n const secondary = useBarStyle(clock, SECONDARY_BAR, width)\n\n return (\n <>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n primary,\n )}\n />\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n secondary,\n )}\n />\n </>\n )\n}\n\n/**\n * The line indeterminate: the track, with two bars crossing it, or for the\n * wavy shape two stretches of a wave crossing it where the bars would be. The\n * row is mirrored under a right-to-left layout, which makes the sweep travel\n * the way the line reads while the bars move as Material's keyframes say.\n */\nfunction IndeterminateLine({\n colors,\n waves,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly waves: boolean\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const reduceMotion = useReducedMotion()\n const clock = useLoop(\n INDETERMINATE_MS * (reduceMotion ? LINE_SLOWDOWN : 1),\n true,\n )\n const mirrored = I18nManager.isRTL ? styles.mirrored : undefined\n\n return (\n <>\n <View style={composeStyles<ViewStyle>(styles.row, own.row, mirrored)}>\n <View\n style={composeStyles<ViewStyle>(styles.track, fillOf(colors.track))}\n />\n {waves ? null : (\n <IndeterminateBars clock={clock} colors={colors} width={width} />\n )}\n </View>\n {waves ? (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(styles.wave, mirrored)}\n width={width}\n >\n <WaveBar\n bar={PRIMARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n <WaveBar\n bar={SECONDARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n </Svg>\n ) : null}\n </>\n )\n}\n\n// Whether a determinate wave stands at this value; see `WAVE_FROM`.\nfunction isWaving(percentage: number) {\n return percentage > WAVE_FROM && percentage < WAVE_UNTIL\n}\n\n/**\n * The line, measured: the row is laid out first and the line drawn to its\n * width, which is what web's `calc()` and container units do without a\n * measurement.\n */\nfunction LinearTrack({\n buffer,\n colors,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { onLayout, width } = useMeasuredWidth()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion && width <= WAVE_REACH\n\n return (\n <View onLayout={onLayout} style={wavy ? styles.wavyLine : styles.line}>\n {isIndeterminate ? (\n <IndeterminateLine colors={colors} waves={waves} width={width} />\n ) : (\n <DeterminateLine\n buffer={buffer}\n colors={colors}\n percentage={percentage}\n waves={waves}\n width={width}\n />\n )}\n </View>\n )\n}\n\n/** The determinate line's wave, cut to the active indicator's length. */\nfunction LineWave({\n colors,\n fade,\n shown,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly fade: SharedValue<number>\n readonly shown: SharedValue<number>\n readonly width: number\n}) {\n // The active indicator's length less the half stroke each round cap adds at\n // either end, as web's `waveAt` gives it.\n const wave = useAnimatedProps(() => {\n 'worklet'\n const length = Math.max(0, activeLength(width, shown.get()) - THICKNESS)\n return {\n d: wavePath(WAVE_WAVELENGTH, WAVE_ORIGIN, WAVE_ORIGIN + length),\n opacity: fade.get(),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(\n styles.wave,\n I18nManager.isRTL ? styles.mirrored : undefined,\n )}\n width={width}\n >\n <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n </Svg>\n )\n}\n\n/**\n * Progress through a task, as a line or a ring. Pass `value` between\n * `minValue` and `maxValue`, or set `isIndeterminate` for work whose length is\n * not known. `formatOptions` says how the value reads, in `locale`, and\n * `buffer` marks how far the work is loaded ahead of it.\n *\n * ```tsx\n * <ProgressIndicator label=\"Label\" showValue value={40} />\n * ```\n *\n * A screen reader hears it as a progress bar named by its label, with its\n * value as `formatOptions` writes it, and no value while it is indeterminate.\n * `style`, `ref` and `testID` land on the indicator as a whole, which is the\n * view a layout positions.\n */\nfunction ProgressIndicator({\n 'aria-label': ariaLabel,\n buffer,\n diameter,\n formatOptions,\n isIndeterminate = false,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n shape = 'flat',\n showValue = false,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n variant = 'linear',\n ...props\n}: ProgressIndicatorProps) {\n const theme = useTheme()\n const colors = useIndicatorColors(tone)\n const reading = readingOf({\n formatOptions,\n locale,\n maxValue,\n minValue,\n value,\n valueLabel,\n })\n const text = isIndeterminate ? undefined : reading.text\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={isIndeterminate ? undefined : reading.value}\n aria-valuetext={text}\n role=\"progressbar\"\n {...props}\n style={composeStyles<ViewStyle>(\n indicatorStylesOf(theme).root,\n variant === 'circular' ? styles.rootCircular : undefined,\n style,\n )}\n >\n <IndicatorLabels label={label} value={showValue ? text : undefined} />\n {variant === 'circular' ? (\n <CircularTrack\n colors={colors}\n diameter={\n (diameter === undefined ? undefined : parseLength(diameter)) ??\n (shape === 'wavy' ? WAVY_SIZE : CIRCULAR_SIZE)\n }\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n ) : (\n <LinearTrack\n buffer={bufferShare(buffer, reading.percentage, minValue, maxValue)}\n colors={colors}\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n )}\n </View>\n )\n}\n\n/**\n * The wave over the ring's active arc, cut by the same lengths, or running\n * round as the indeterminate arc does. Its crests turn with the ring.\n */\nfunction RingWavePath({\n arc,\n colors,\n cycle,\n fade,\n isIndeterminate,\n shown,\n turn,\n}: {\n readonly arc: SharedValue<number>\n readonly colors: IndicatorColors\n readonly cycle: SharedValue<number>\n readonly fade: SharedValue<number>\n readonly isIndeterminate: boolean\n readonly shown: SharedValue<number>\n readonly turn: SharedValue<number>\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n if (isIndeterminate) {\n const phase = TURN / 4 + TURN * turn.get()\n return {\n d: wavyArcPath(\n RING_WAVE,\n phase,\n phase + TURN * keyframeAt(TRAVEL_ARC, cycle.get()),\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity: fade.get(),\n }\n }\n return {\n d: wavyArcPath(RING_WAVE, 0, 0, (TURN * shown.get()) / 100),\n opacity: fade.get(),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// What every curve of the indicator is stroked with: the colour, at the 4dp\n// thickness, with round ends and joins, and no fill.\nfunction strokeOf(color: string) {\n return {\n fill: 'none',\n stroke: color,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: THICKNESS,\n } as const\n}\n\n/**\n * A bar of the indeterminate line where the clock has it: its start, and its\n * scale from there, both as web's keyframes give them in shares of the row.\n */\nfunction useBarStyle(clock: SharedValue<number>, bar: Bar, width: number) {\n return useAnimatedStyle(() => {\n 'worklet'\n const time = clock.get()\n return {\n transform: [\n { translateX: (bar.start + keyframeAt(bar.translate, time)) * width },\n { scaleX: keyframeAt(bar.scale, time) },\n ],\n }\n })\n}\n\n/**\n * A bar of the indeterminate line drawn as a stretch of the wave: from where\n * the flat bar starts, as long as the flat bar is, and nothing of it before\n * the wave's own start.\n */\nfunction WaveBar({\n bar,\n clock,\n colors,\n width,\n}: {\n readonly bar: Bar\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n const time = clock.get()\n const from =\n WAVE_ORIGIN + (bar.start + keyframeAt(bar.translate, time)) * width\n const to = from + keyframeAt(bar.scale, time) * width\n return {\n d: wavePath(\n INDETERMINATE_WAVELENGTH,\n Math.max(WAVE_ORIGIN, from),\n Math.min(WAVE_ORIGIN + width, to),\n ),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// A view's width, built by a call rather than written inline at the prop,\n// which is what react-perf's no-new-object-as-prop is after.\nfunction widthOf(width: DimensionValue) {\n return { width }\n}\n\nexport { ProgressIndicator }\nexport type {\n ProgressIndicatorProps,\n ProgressIndicatorShape,\n ProgressIndicatorTone,\n ProgressIndicatorVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;AAmNA,MAAM6E,gBAAgB;AACtB,MAAMC,SAAAA;AAMN,MAAMC,SAAS;AACf,MAAMC,WAAWD,SAAS;AAC1B,MAAME,YAAYC,KAAKC,MAAOJ,SAAS,MAAO,GAAG;AACjD,MAAMK,cAAqB;CAAC;CAAK;CAAG;CAAK;AAAC;AAC1C,MAAMC,cAAqB;CAAC;CAAG;CAAG;CAAK;AAAC;AAIxC,MAAMC,mBAAmB;AACzB,MAAMC,YAAY;AAGlB,MAAMC,gBAAgB;AACtB,MAAMC,gBAAgB;AAItB,MAAMC,kBAAkB;AACxB,MAAMC,2BAA2B;AACjC,MAAMC,aAAa;AAInB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AAKnB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AACvB,MAAMC,kBAAkB;AACxB,MAAMC,cAAAA;AAEN,MAAMC,YAAsB;CAC1BC,WAAWJ;CACXK,QAAQN,YAAY;CACpBO,QAAQJ;CACRK,OAAOrB,KAAKC,MAAOhD,OAAO+D,cAAeD,eAAe;AAC1D;AAIA,MAAMO,QAAAA;AAIN,MAAMC,cAAmB;CACvBvD,OAAO;EACL,CAAC,GAAG,GAAI;EACR;GAAC;GAAQ;GAAM;IAAC;IAAU;IAAS;IAAU;GAAC;EAAC;EAC/C;GAAC;GAAQ;GAAU;IAAC;IAAM;IAAM;IAAK;GAAC;EAAC;EACvC,CAAC,GAAG,GAAI;CAAC;CAEXC,OAAO;CACPC,WAAW;EACT,CAAC,GAAG,CAAC;EACL;GAAC;GAAK;GAAG;IAAC;IAAK;IAAG;IAAU;GAAQ;EAAC;EACrC;GAAC;GAAQ;GAAU;IAAC;I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AAI,KAAKnH,MAAM,GACpE,EAAAa,QAAUvG,WAAWiF,IAAG/D,OAAQ2L,IAAI,EAAE,CAAC,EAE3C;CAAC,CACF;AAAC;;;;;;AAQJ,SAAAC,QAAA1F,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAiB,MAAA,EAAArC,KAAA2C,OAAAL,QAAA7B,UAAA0B;CAWf,MAAAP,OAAajI,uBAAiB;EAAA;EAE5B,MAAAiO,OAAajF,MAAKK,IAAK;EACvB,MAAAuC,OACEnK,eAAe4E,IAAG9D,QAASnB,WAAWiF,IAAG7D,WAAYyL,IAAI,KAAKnH;EAChE,MAAAqH,KAAWvC,OAAOxK,WAAWiF,IAAG/D,OAAQ2L,IAAI,IAAInH;EAAK,OAC9C,EAAA+E,GACFnK,SACDqD,0BACAT,KAAImG,IAAKhJ,aAAamK,IAAI,GAC1BtH,KAAIkG,IAAK/I,cAAcqF,OAAOqH,EAAE,CAClC,EACF;CAAC,CACF;CAAC,IAAA7E;CAAA,IAAAb,EAAA,OAAAE,OAAA+C,QAAA;EAE4CpC,KAAAyC,SAASpD,OAAM+C,MAAO;EAACjD,EAAA,KAAAE,OAAA+C;EAAAjD,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,OAAAa,MAAAb,EAAA,OAAAR,MAAA;EAA9DuB,KAAA,oBAAC,cAAD;GAA6BvB,eAAAA;GAAI,GAAMqB;EAAuB,CAAA;EAAIb,EAAA,KAAAa;EAAAb,EAAA,KAAAR;EAAAQ,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAAlEe;AAAkE;AAK3E,SAASD,QAAQzC,OAAuB;CACtC,OAAO,EAAEA,MAAM;AACjB"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","DimensionValue","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","I18nManager","StyleSheet","View","Animated","useAnimatedProps","useAnimatedStyle","useDerivedValue","useReducedMotion","Svg","Path","IndicatorColors","IndicatorTone","Curve","Keyframe","RingWave","HIDDEN","useLocaleOf","activeLength","fillOf","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","keyframeAt","useLoop","arcPath","TURN","WAVE_HEIGHT","WAVE_ORIGIN","wavePath","wavyArcPath","DETERMINATE_EASING","GAP","stylesOf","indicatorStylesOf","THICKNESS","parseLength","useTheme","composeStyles","themedStyles","Bar","scale","start","translate","ProgressIndicatorProps","Omit","buffer","diameter","formatOptions","Intl","NumberFormatOptions","isIndeterminate","label","locale","maxValue","minValue","ref","shape","ProgressIndicatorShape","showValue","style","tone","ProgressIndicatorTone","value","valueLabel","variant","ProgressIndicatorVariant","Extract","CIRCULAR_SIZE","RADIUS","ARC_MS","CYCLE_MS","ROTATE_MS","Math","round","RING_EASING","RING_SETTLE","INDETERMINATE_MS","BUFFER_MS","LINE_SLOWDOWN","RING_SLOWDOWN","WAVE_WAVELENGTH","INDETERMINATE_WAVELENGTH","WAVE_REACH","WAVE_FROM","WAVE_UNTIL","WAVY_SIZE","RING_AMPLITUDE","RING_WAVELENGTH","WAVY_RADIUS","RING_WAVE","amplitude","centre","radius","waves","PITCH","PRIMARY_BAR","SECONDARY_BAR","EXPAND_ARC","TRAVEL_ARC","AnimatedPath","createAnimatedComponent","styles","create","bar","height","left","position","top","transformOrigin","buffered","flexShrink","dot","width","dotRow","flexDirection","gap","dots","flexGrow","minWidth","overflow","line","alignSelf","justifyContent","mirrored","transform","scaleX","rootCircular","alignItems","row","track","absoluteFill","wave","wavyLine","radii","borderRadius","pill","circle","Buffer","t0","$","_c","colors","share","theme","own","reduceMotion","clock","direction","isRTL","scroll","translateX","get","t1","widthOf","t2","T0","t4","t5","t6","dotsFor","map","t7","t8","t3","t9","bufferShare","percentage","undefined","range","remaining","min","max","CircularTrack","motion","wavy","box","circumference","durationLong2","duration","easing","timing","shown","fade","isWaving","slowdown","arc","cycle","turn","active","opacity","from","d","length","strokeOf","DeterminateLine","durationMedium1","under","Array","ceil","_","index","IndeterminateBars","primary","useBarStyle","secondary","IndeterminateLine","LinearTrack","onLayout","LineWave","Symbol","for","ProgressIndicator","ariaLabel","props","writtenIn","reading","text","t10","root","RingWavePath","phase","color","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","const","time","WaveBar","to","_c","indicatorStylesOf"],"sources":["../../../src/components/progress-indicator/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type {\n DimensionValue,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport { I18nManager, StyleSheet, View } from 'react-native'\nimport Animated, {\n useAnimatedProps,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n} from 'react-native-reanimated'\nimport Svg, { Path } from 'react-native-svg'\n\nimport type { IndicatorColors, IndicatorTone } from '../../indicator'\nimport type { Curve, Keyframe } from '../../indicator/motion'\nimport type { RingWave } from '../../indicator/paths'\n\nimport { HIDDEN } from '../../glyphs/hidden'\nimport { useLocaleOf } from '../../i18n/provider'\nimport {\n activeLength,\n fillOf,\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport { keyframeAt, useLoop } from '../../indicator/motion'\nimport {\n arcPath,\n TURN,\n WAVE_HEIGHT,\n WAVE_ORIGIN,\n wavePath,\n wavyArcPath,\n} from '../../indicator/paths'\nimport {\n DETERMINATE_EASING,\n GAP,\n stylesOf as indicatorStylesOf,\n THICKNESS,\n} from '../../indicator/styles'\nimport { parseLength } from '../../theme/resolve'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The progress indicators page's indicator, as kanso-ui's ProgressIndicator\n// draws it: a line or a ring, in either of the page's two shapes, flat and\n// wavy. Both carry the three parts the page's anatomy names, the active\n// indicator in primary, the track in secondary container and, on the line,\n// the stop indicator in primary at the end, at the page's 4dp thickness with\n// the 4dp gap its measurements give either side of the track. The flat ring\n// is the page's default 40dp of the four sizes it draws, and the wavy ring the\n// 48dp its wave needs room for.\n//\n// The determinate line is src/indicator's, which Meter draws too: the active\n// indicator takes the value's share of what the gaps and the stop leave, and\n// the track takes the rest. The determinate ring is two arcs of one circle:\n// the active arc runs clockwise from the top for its share of the\n// circumference, and the track picks up 4dp past it and stops 4dp before it\n// comes back round, which is the same gap measured along the curve.\n//\n// The animations are Material's own, with web's numbers: the line's two bars\n// and their four keyframe sets, the buffer's scrolling dots, the ring's 1333ms\n// arc, its four-arc cycle and its 1568ms rotation, and the 250ms and 500ms a\n// determinate value moves over. React Native has no CSS keyframes, so each\n// set is a list of the same frames read off a looping clock on the UI thread,\n// in src/indicator/motion.ts.\n//\n// Under reduced motion the motion slows rather than stopping, as web's does:\n// an indicator that freezes stops saying the work is going on, and a frozen\n// arc caught at its short end reads as broken. The multipliers are web's, two\n// for the line and a quarter more for the ring. A determinate value jumps\n// there instead of easing, as web's transition drops to `0s`.\n//\n// The wavy shape draws the active indicator as a wave and leaves the track and\n// the stop flat, as the page does, with web's numbers, which are Material's\n// own: on the line a 3dp amplitude, a 40dp wavelength and a 10dp row, with a\n// 20dp wavelength while indeterminate; on the ring a 1.6dp amplitude and a\n// 15dp wavelength, rounded to a whole number of waves so the wave closes on\n// itself. A determinate wave lies flat up to a tenth of the way and from 95%\n// on, and is drawn over the flat drawing, the two crossfading as the value\n// crosses those bounds. The flat drawing is also what a reader who has asked\n// for reduced motion sees, since a wave is motion even standing still, and\n// what a line wider than `WAVE_REACH` is drawn as.\n//\n// Web cuts its arcs and waves out of whole curves with dash patterns; here\n// each is a path built from where it starts and how far it runs, for the\n// reason src/indicator/paths.ts gives.\n//\n// The root carries the role, the range, the value and its text, which React\n// Aria's `useProgressBar` gives web's, so a screen reader hears the label and\n// the value as one element. The value is read as React Aria reads it: clamped\n// to the range, and written as a percentage unless `formatOptions` says\n// otherwise, in `locale`.\n\n/** A bar of the indeterminate line, as web's keyframes move it. */\ntype Bar = {\n /** Its scale across, from its start. */\n readonly scale: readonly Keyframe[]\n /** Where it starts, as a share of the row before the row's own start. */\n readonly start: number\n /** How far it has travelled from there, as a share of the row. */\n readonly translate: readonly Keyframe[]\n}\n\ntype ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How far the work is loaded ahead of the value, a video's buffered\n * seconds or a queue's fetched pages. Read on the same scale as `value`:\n * the track is solid up to it and dotted beyond. Ignored while the\n * indicator is indeterminate and by the ring, and left out for work with\n * nothing to buffer.\n */\n readonly buffer?: number\n /**\n * How wide the ring is drawn, as a CSS length read the way a theme's\n * lengths are. Everything inside scales with it, so a ring in a button can\n * take the button's icon size. The length is in px, since a relative unit\n * has nothing on native to be relative to. Ignored by the line, which fills\n * the width it is given.\n * @default '40px', or '48px' for the wavy ring\n */\n readonly diameter?: `${number}px`\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * For work whose length is not known: the indicator runs on its own, and\n * has no value to show or announce.\n * @default false\n */\n readonly isIndeterminate?: boolean\n /**\n * What the work is, shown above the indicator. A screen reader reads it as\n * the indicator's name; an indicator whose surroundings name it takes\n * `aria-label` instead and leaves this out.\n */\n readonly label?: string\n /**\n * The BCP 47 locale the value is written in. Defaults to the\n * `I18nProvider`'s, or the device's outside one.\n */\n readonly locale?: string\n /**\n * The value at which the work is done.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The value at which the work starts.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The page's two shapes. `wavy` draws the active indicator as a wave, which\n * lies flat near either end of a determinate value, and leaves the track\n * and the stop flat; the wavy ring is 48dp across rather than 40. Under\n * reduced motion a wavy indicator is drawn flat.\n * @default 'flat'\n */\n readonly shape?: ProgressIndicatorShape\n /**\n * Whether the value is shown beside the label. Ignored while the indicator\n * is indeterminate, which has no value to show.\n * @default false\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours it is drawn in. `primary` is the page's own pair, the active\n * indicator in primary over a secondary container track, and `inherit`\n * takes the colour of the slot it sits in, for an indicator inside something\n * that already has one, such as a button, where primary would be the fill.\n * @default 'primary'\n */\n readonly tone?: ProgressIndicatorTone\n /**\n * How far the work has gone, between `minValue` and `maxValue`.\n * @default 0\n */\n readonly value?: number\n /** The value as words, in place of the number `formatOptions` writes. */\n readonly valueLabel?: string\n /**\n * The line the page draws, or the ring: `linear` fills the width it is\n * given, `circular` is 40dp across.\n * @default 'linear'\n */\n readonly variant?: ProgressIndicatorVariant\n}\n\ntype ProgressIndicatorShape = 'flat' | 'wavy'\n\n// The two of the shared line's four tones an indicator draws. The other two\n// say how a measurement reads, which is a meter's business rather than a\n// running task's.\ntype ProgressIndicatorTone = Extract<IndicatorTone, 'inherit' | 'primary'>\n\ntype ProgressIndicatorVariant = 'circular' | 'linear'\n\n// The flat ring. The radius is the diameter less the stroke, halved, so the\n// stroke sits inside the 40dp box rather than straddling its edge.\nconst CIRCULAR_SIZE = 40\nconst RADIUS = (CIRCULAR_SIZE - THICKNESS) / 2\n\n// The ring's timings. The arc is 1333ms; a full cycle is four of them; and the\n// rotation is the arc scaled by 360/306, which is the arc's start rotation plus\n// the circle less the arc's size. A determinate ring moves on Material's own\n// curve rather than the line's.\nconst ARC_MS = 1333\nconst CYCLE_MS = ARC_MS * 4\nconst ROTATE_MS = Math.round((ARC_MS * 360) / 306)\nconst RING_EASING: Curve = [0.4, 0, 0.2, 1]\nconst RING_SETTLE: Curve = [0, 0, 0.2, 1]\n\n// The line's own: 2s for an indeterminate pass, and the 250ms the buffer's\n// dots take to scroll one pitch.\nconst INDETERMINATE_MS = 2000\nconst BUFFER_MS = 250\n\n// What reduced motion slows each shape by.\nconst LINE_SLOWDOWN = 2\nconst RING_SLOWDOWN = 1.25\n\n// The wavy line's two wavelengths, and how far the wave runs: a row wider than\n// that draws flat, as web's does.\nconst WAVE_WAVELENGTH = 40\nconst INDETERMINATE_WAVELENGTH = 20\nconst WAVE_REACH = 2048\n\n// Where a determinate wave stands up and where it lies down again, as\n// percentages of the way.\nconst WAVE_FROM = 10\nconst WAVE_UNTIL = 95\n\n// The wavy ring: the 48dp box, and the wave round the circle pulled in by the\n// amplitude so its crests stay inside the box. The wave count is the\n// wavelength's share of that circle, rounded, which is nine.\nconst WAVY_SIZE = 48\nconst RING_AMPLITUDE = 1.6\nconst RING_WAVELENGTH = 15\nconst WAVY_RADIUS = (WAVY_SIZE - THICKNESS) / 2 - RING_AMPLITUDE\n\nconst RING_WAVE: RingWave = {\n amplitude: RING_AMPLITUDE,\n centre: WAVY_SIZE / 2,\n radius: WAVY_RADIUS,\n waves: Math.round((TURN * WAVY_RADIUS) / RING_WAVELENGTH),\n}\n\n// The buffer's dots: the track's colour, at the stroke's size, one pitch of\n// two and a half strokes apart.\nconst PITCH = THICKNESS * 2.5\n\n// The two bars of the indeterminate line, translated and scaled at once, with\n// web's keyframes, which are Material's.\nconst PRIMARY_BAR: Bar = {\n scale: [\n [0, 0.08],\n [0.3665, 0.08, [0.334731, 0.12482, 0.785844, 1]],\n [0.6915, 0.661479, [0.06, 0.11, 0.6, 1]],\n [1, 0.08],\n ],\n start: -1.45167,\n translate: [\n [0, 0],\n [0.2, 0, [0.5, 0, 0.701732, 0.495819]],\n [0.5915, 0.836714, [0.302435, 0.381352, 0.55, 0.956352]],\n [1, 2.00611],\n ],\n}\n\nconst SECONDARY_BAR: Bar = {\n scale: [\n [0, 0.08, [0.205028, 0.057051, 0.57661, 0.453971]],\n [0.1915, 0.457104, [0.152313, 0.196432, 0.648374, 1.00432]],\n [0.4415, 0.72796, [0.257759, -0.003163, 0.211762, 1.38179]],\n [1, 0.08],\n ],\n start: -0.548889,\n translate: [\n [0, 0, [0.15, 0, 0.515058, 0.409685]],\n [0.25, 0.376519, [0.31033, 0.284058, 0.8, 0.733712]],\n [0.4835, 0.843862, [0.4, 0.627035, 0.6, 0.902026]],\n [1, 1.60278],\n ],\n}\n\n// The indeterminate ring's arc, as a share of the way round. Material\n// contracts it to 10 degrees of turn and grows it to 270; web draws the short\n// end at 8% rather than 10 degrees, since a round cap on so short an arc draws\n// a dot, and this is web's.\nconst EXPAND_ARC: readonly Keyframe[] = [\n [0, 0.08, RING_EASING],\n [0.5, 0.75, RING_EASING],\n [1, 0.08],\n]\n\n// Where the arc starts, in turns. Material turns it in eight steps of 135\n// degrees rather than at a constant rate, each on the arc's own curve, so it\n// settles at each position and springs to the next: three full turns over the\n// cycle, under the rotation's own single turn.\nconst TRAVEL_ARC: readonly Keyframe[] = [\n [0, 0, RING_EASING],\n [0.125, 0.375, RING_EASING],\n [0.25, 0.75, RING_EASING],\n [0.375, 1.125, RING_EASING],\n [0.5, 1.5, RING_EASING],\n [0.625, 1.875, RING_EASING],\n [0.75, 2.25, RING_EASING],\n [0.875, 2.625, RING_EASING],\n [1, 3],\n]\n\nconst AnimatedPath = Animated.createAnimatedComponent(Path)\n\nconst styles = StyleSheet.create({\n // A bar of the indeterminate line: the row's width, scaled from its start\n // and travelling across. Physical rather than logical, as web's are: the\n // keyframes move one way only, so the direction is handled once, by\n // mirroring the row.\n bar: {\n height: THICKNESS,\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'left center',\n },\n // The solid part of a buffered track, as far as the buffer reaches.\n buffered: {\n flexShrink: 0,\n height: THICKNESS,\n },\n dot: {\n height: THICKNESS,\n width: THICKNESS,\n },\n // The dots, scrolling one pitch toward the start of the line and starting\n // again.\n dotRow: {\n flexDirection: 'row',\n gap: PITCH - THICKNESS,\n },\n // What the buffer leaves of the track, which the dots fill.\n dots: {\n flexGrow: 1,\n flexShrink: 1,\n height: THICKNESS,\n minWidth: 0,\n overflow: 'hidden',\n },\n // The flat line's row, whose width the line is drawn to.\n line: {\n alignSelf: 'stretch',\n justifyContent: 'center',\n },\n mirrored: {\n transform: [{ scaleX: -1 }],\n },\n // A circular indicator is its own size rather than the room it is given.\n rootCircular: {\n alignItems: 'flex-start',\n },\n // The indeterminate line's row, which clips its bars at both ends.\n row: {\n alignSelf: 'stretch',\n height: THICKNESS,\n overflow: 'hidden',\n },\n // The track behind the indeterminate line's bars.\n track: {\n ...StyleSheet.absoluteFill,\n },\n // A wave over the line: the row's whole box, mirrored under a right-to-left\n // layout so it starts at the start of the line.\n wave: {\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n },\n // The wavy line's row: the wave's 10dp, with the flat line through its\n // middle.\n wavyLine: {\n alignSelf: 'stretch',\n height: WAVE_HEIGHT,\n justifyContent: 'center',\n },\n})\n\nconst stylesOf = themedStyles(({ radii }) =>\n StyleSheet.create({\n // The bars carry the pill every other part of the line draws. It is drawn\n // under the bar's own scale, so it flattens as the bar narrows, as web's\n // and Material's do.\n bar: { borderRadius: radii.pill },\n dot: { borderRadius: radii.circle },\n row: { borderRadius: radii.pill },\n }),\n)\n\n/**\n * The dots beyond the buffer, scrolling toward the start of the line. There\n * is one more of them than the row has room for, so the row stays full as\n * they move.\n */\nfunction Buffer({\n colors,\n share,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly share: number\n readonly width: number\n}) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const clock = useLoop(BUFFER_MS * (reduceMotion ? LINE_SLOWDOWN : 1), true)\n // A translation is not mirrored under a right-to-left layout, though the\n // row is, so the dots travel the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const scroll = useAnimatedStyle(() => {\n 'worklet'\n return { transform: [{ translateX: -PITCH * clock.get() * direction }] }\n })\n\n return (\n <>\n <View\n style={composeStyles<ViewStyle>(\n styles.buffered,\n fillOf(colors.track),\n widthOf(`${share}%`),\n )}\n />\n <View style={styles.dots}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.dotRow, scroll)}\n >\n {dotsFor(width).map((dot) => (\n <View\n key={dot}\n style={composeStyles<ViewStyle>(\n styles.dot,\n own.dot,\n fillOf(colors.track),\n )}\n />\n ))}\n </Animated.View>\n </View>\n </>\n )\n}\n\n// How much of the track the buffer covers. The buffer is read on the value's\n// scale, and the track holds what the value has not taken, so the solid part\n// is the buffer's share of that remainder, as web's `bufferShare` gives it.\nfunction bufferShare(\n buffer: number | undefined,\n percentage: number,\n minValue: number,\n maxValue: number,\n) {\n if (buffer === undefined) {\n return undefined\n }\n const range = maxValue - minValue\n const buffered = range === 0 ? 0 : ((buffer - minValue) / range) * 100\n const remaining = 100 - percentage\n if (remaining <= 0) {\n return 0\n }\n return Math.min(100, Math.max(0, ((buffered - percentage) / remaining) * 100))\n}\n\n/**\n * The ring: two arcs of one circle while determinate, one arc growing,\n * shrinking and travelling round while indeterminate, and for the wavy shape a\n * wave over the active arc. Drawn on a box of its own size and scaled to the\n * diameter, so the stroke and the gap scale with it.\n */\nfunction CircularTrack({\n colors,\n diameter,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly colors: IndicatorColors\n readonly diameter: number\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion\n const box = wavy ? WAVY_SIZE : CIRCULAR_SIZE\n const centre = box / 2\n const radius = wavy ? WAVY_RADIUS : RADIUS\n const circumference = TURN * radius\n const timing = { duration: motion.durationLong2, easing: RING_SETTLE }\n const shown = useEased(percentage, timing)\n const fade = useEased(\n waves && (isIndeterminate || isWaving(percentage)) ? 1 : 0,\n timing,\n )\n const slowdown = reduceMotion ? RING_SLOWDOWN : 1\n const arc = useLoop(ARC_MS * slowdown, isIndeterminate)\n const cycle = useLoop(CYCLE_MS * slowdown, isIndeterminate)\n const turn = useLoop(Math.round(ROTATE_MS * slowdown), isIndeterminate)\n\n // The active arc, or the indeterminate one: it grows and shrinks over the\n // arc's duration, its start travels the circle over the cycle, and the\n // whole of it turns over the rotation's. An indeterminate ring starts at\n // three o'clock, as web's does once its spin replaces the quarter turn back\n // that puts a determinate one's start at the top.\n const active = useAnimatedProps(() => {\n 'worklet'\n const opacity = 1 - fade.get()\n if (isIndeterminate) {\n const from =\n TURN / 4 + TURN * (turn.get() + keyframeAt(TRAVEL_ARC, cycle.get()))\n return {\n d: arcPath(\n centre,\n radius,\n from,\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity,\n }\n }\n return {\n d: arcPath(centre, radius, 0, (TURN * shown.get()) / 100),\n opacity,\n }\n })\n // The track picks up a gap past the active arc and stops a gap before the\n // top.\n const track = useAnimatedProps(() => {\n 'worklet'\n const length = (circumference * shown.get()) / 100\n return {\n d: arcPath(\n centre,\n radius,\n (length + GAP) / radius,\n Math.max(0, circumference - length - 2 * GAP) / radius,\n ),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={diameter}\n viewBox={`0 0 ${box} ${box}`}\n width={diameter}\n >\n {isIndeterminate ? null : (\n <AnimatedPath animatedProps={track} {...strokeOf(colors.track)} />\n )}\n <AnimatedPath animatedProps={active} {...strokeOf(colors.active)} />\n {waves ? (\n <RingWavePath\n arc={arc}\n colors={colors}\n cycle={cycle}\n fade={fade}\n isIndeterminate={isIndeterminate}\n shown={shown}\n turn={turn}\n />\n ) : null}\n </Svg>\n )\n}\n\n/**\n * The line determinate: src/indicator's, with the buffer in its track, and\n * for the wavy shape a wave over its active indicator, crossfading with it as\n * the value crosses the bounds the wave stands between.\n */\nfunction DeterminateLine({\n buffer,\n colors,\n percentage,\n waves,\n width,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly percentage: number\n readonly waves: boolean\n readonly width: number\n}) {\n const { motion } = useTheme()\n const timing = {\n duration: motion.durationMedium1,\n easing: DETERMINATE_EASING,\n }\n const shown = useEased(percentage, timing)\n const fade = useEased(waves && isWaving(percentage) ? 1 : 0, timing)\n const under = useDerivedValue(() => 1 - fade.get())\n\n return (\n <>\n <IndicatorLine\n activeOpacity={waves ? under : undefined}\n colors={colors}\n percentage={shown}\n width={width}\n >\n {buffer === undefined ? undefined : (\n <Buffer colors={colors} share={buffer} width={width} />\n )}\n </IndicatorLine>\n {waves ? (\n <LineWave colors={colors} fade={fade} shown={shown} width={width} />\n ) : null}\n </>\n )\n}\n\n// One key for each dot the buffer draws across `width`.\nfunction dotsFor(width: number) {\n return Array.from(\n { length: Math.ceil(width / PITCH) + 1 },\n (_, index) => index,\n )\n}\n\n// The flat bars of the indeterminate line.\nfunction IndeterminateBars({\n clock,\n colors,\n width,\n}: {\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const primary = useBarStyle(clock, PRIMARY_BAR, width)\n const secondary = useBarStyle(clock, SECONDARY_BAR, width)\n\n return (\n <>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n primary,\n )}\n />\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n secondary,\n )}\n />\n </>\n )\n}\n\n/**\n * The line indeterminate: the track, with two bars crossing it, or for the\n * wavy shape two stretches of a wave crossing it where the bars would be. The\n * row is mirrored under a right-to-left layout, which makes the sweep travel\n * the way the line reads while the bars move as Material's keyframes say.\n */\nfunction IndeterminateLine({\n colors,\n waves,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly waves: boolean\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const reduceMotion = useReducedMotion()\n const clock = useLoop(\n INDETERMINATE_MS * (reduceMotion ? LINE_SLOWDOWN : 1),\n true,\n )\n const mirrored = I18nManager.isRTL ? styles.mirrored : undefined\n\n return (\n <>\n <View style={composeStyles<ViewStyle>(styles.row, own.row, mirrored)}>\n <View\n style={composeStyles<ViewStyle>(styles.track, fillOf(colors.track))}\n />\n {waves ? null : (\n <IndeterminateBars clock={clock} colors={colors} width={width} />\n )}\n </View>\n {waves ? (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(styles.wave, mirrored)}\n width={width}\n >\n <WaveBar\n bar={PRIMARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n <WaveBar\n bar={SECONDARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n </Svg>\n ) : null}\n </>\n )\n}\n\n// Whether a determinate wave stands at this value; see `WAVE_FROM`.\nfunction isWaving(percentage: number) {\n return percentage > WAVE_FROM && percentage < WAVE_UNTIL\n}\n\n/**\n * The line, measured: the row is laid out first and the line drawn to its\n * width, which is what web's `calc()` and container units do without a\n * measurement.\n */\nfunction LinearTrack({\n buffer,\n colors,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { onLayout, width } = useMeasuredWidth()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion && width <= WAVE_REACH\n\n return (\n <View onLayout={onLayout} style={wavy ? styles.wavyLine : styles.line}>\n {isIndeterminate ? (\n <IndeterminateLine colors={colors} waves={waves} width={width} />\n ) : (\n <DeterminateLine\n buffer={buffer}\n colors={colors}\n percentage={percentage}\n waves={waves}\n width={width}\n />\n )}\n </View>\n )\n}\n\n/** The determinate line's wave, cut to the active indicator's length. */\nfunction LineWave({\n colors,\n fade,\n shown,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly fade: SharedValue<number>\n readonly shown: SharedValue<number>\n readonly width: number\n}) {\n // The active indicator's length less the half stroke each round cap adds at\n // either end, as web's `waveAt` gives it.\n const wave = useAnimatedProps(() => {\n 'worklet'\n const length = Math.max(0, activeLength(width, shown.get()) - THICKNESS)\n return {\n d: wavePath(WAVE_WAVELENGTH, WAVE_ORIGIN, WAVE_ORIGIN + length),\n opacity: fade.get(),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(\n styles.wave,\n I18nManager.isRTL ? styles.mirrored : undefined,\n )}\n width={width}\n >\n <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n </Svg>\n )\n}\n\n/**\n * Progress through a task, as a line or a ring. Pass `value` between\n * `minValue` and `maxValue`, or set `isIndeterminate` for work whose length is\n * not known. `formatOptions` says how the value reads, in `locale`, and\n * `buffer` marks how far the work is loaded ahead of it.\n *\n * ```tsx\n * <ProgressIndicator label=\"Label\" showValue value={40} />\n * ```\n *\n * A screen reader hears it as a progress bar named by its label, with its\n * value as `formatOptions` writes it, and no value while it is indeterminate.\n * `style`, `ref` and `testID` land on the indicator as a whole, which is the\n * view a layout positions.\n */\nfunction ProgressIndicator({\n 'aria-label': ariaLabel,\n buffer,\n diameter,\n formatOptions,\n isIndeterminate = false,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n shape = 'flat',\n showValue = false,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n variant = 'linear',\n ...props\n}: ProgressIndicatorProps) {\n const theme = useTheme()\n const colors = useIndicatorColors(tone)\n const writtenIn = useLocaleOf(locale)\n const reading = readingOf({\n formatOptions,\n locale: writtenIn,\n maxValue,\n minValue,\n value,\n valueLabel,\n })\n const text = isIndeterminate ? undefined : reading.text\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={isIndeterminate ? undefined : reading.value}\n aria-valuetext={text}\n role=\"progressbar\"\n {...props}\n style={composeStyles<ViewStyle>(\n indicatorStylesOf(theme).root,\n variant === 'circular' ? styles.rootCircular : undefined,\n style,\n )}\n >\n <IndicatorLabels label={label} value={showValue ? text : undefined} />\n {variant === 'circular' ? (\n <CircularTrack\n colors={colors}\n diameter={\n (diameter === undefined ? undefined : parseLength(diameter)) ??\n (shape === 'wavy' ? WAVY_SIZE : CIRCULAR_SIZE)\n }\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n ) : (\n <LinearTrack\n buffer={bufferShare(buffer, reading.percentage, minValue, maxValue)}\n colors={colors}\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n )}\n </View>\n )\n}\n\n/**\n * The wave over the ring's active arc, cut by the same lengths, or running\n * round as the indeterminate arc does. Its crests turn with the ring.\n */\nfunction RingWavePath({\n arc,\n colors,\n cycle,\n fade,\n isIndeterminate,\n shown,\n turn,\n}: {\n readonly arc: SharedValue<number>\n readonly colors: IndicatorColors\n readonly cycle: SharedValue<number>\n readonly fade: SharedValue<number>\n readonly isIndeterminate: boolean\n readonly shown: SharedValue<number>\n readonly turn: SharedValue<number>\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n if (isIndeterminate) {\n const phase = TURN / 4 + TURN * turn.get()\n return {\n d: wavyArcPath(\n RING_WAVE,\n phase,\n phase + TURN * keyframeAt(TRAVEL_ARC, cycle.get()),\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity: fade.get(),\n }\n }\n return {\n d: wavyArcPath(RING_WAVE, 0, 0, (TURN * shown.get()) / 100),\n opacity: fade.get(),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// What every curve of the indicator is stroked with: the colour, at the 4dp\n// thickness, with round ends and joins, and no fill.\nfunction strokeOf(color: string) {\n return {\n fill: 'none',\n stroke: color,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: THICKNESS,\n } as const\n}\n\n/**\n * A bar of the indeterminate line where the clock has it: its start, and its\n * scale from there, both as web's keyframes give them in shares of the row.\n */\nfunction useBarStyle(clock: SharedValue<number>, bar: Bar, width: number) {\n return useAnimatedStyle(() => {\n 'worklet'\n const time = clock.get()\n return {\n transform: [\n { translateX: (bar.start + keyframeAt(bar.translate, time)) * width },\n { scaleX: keyframeAt(bar.scale, time) },\n ],\n }\n })\n}\n\n/**\n * A bar of the indeterminate line drawn as a stretch of the wave: from where\n * the flat bar starts, as long as the flat bar is, and nothing of it before\n * the wave's own start.\n */\nfunction WaveBar({\n bar,\n clock,\n colors,\n width,\n}: {\n readonly bar: Bar\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n const time = clock.get()\n const from =\n WAVE_ORIGIN + (bar.start + keyframeAt(bar.translate, time)) * width\n const to = from + keyframeAt(bar.scale, time) * width\n return {\n d: wavePath(\n INDETERMINATE_WAVELENGTH,\n Math.max(WAVE_ORIGIN, from),\n Math.min(WAVE_ORIGIN + width, to),\n ),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// A view's width, built by a call rather than written inline at the prop,\n// which is what react-perf's no-new-object-as-prop is after.\nfunction widthOf(width: DimensionValue) {\n return { width }\n}\n\nexport { ProgressIndicator }\nexport type {\n ProgressIndicatorProps,\n ProgressIndicatorShape,\n ProgressIndicatorTone,\n ProgressIndicatorVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqNA,MAAM8E,gBAAgB;AACtB,MAAMC,SAAAA;AAMN,MAAMC,SAAS;AACf,MAAMC,WAAWD,SAAS;AAC1B,MAAME,YAAYC,KAAKC,MAAOJ,SAAS,MAAO,GAAG;AACjD,MAAMK,cAAqB;CAAC;CAAK;CAAG;CAAK;AAAC;AAC1C,MAAMC,cAAqB;CAAC;CAAG;CAAG;CAAK;AAAC;AAIxC,MAAMC,mBAAmB;AACzB,MAAMC,YAAY;AAGlB,MAAMC,gBAAgB;AACtB,MAAMC,gBAAgB;AAItB,MAAMC,kBAAkB;AACxB,MAAMC,2BAA2B;AACjC,MAAMC,aAAa;AAInB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AAKnB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AACvB,MAAMC,kBAAkB;AACxB,MAAMC,cAAAA;AAEN,MAAMC,YAAsB;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EAAA,KAAAE,OAAA+C;EAAAjD,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,OAAAa,MAAAb,EAAA,OAAAR,MAAA;EAA9DuB,KAAA,oBAAC,cAAD;GAA6BvB,eAAAA;GAAI,GAAMqB;EAAuB,CAAA;EAAIb,EAAA,KAAAa;EAAAb,EAAA,KAAAR;EAAAQ,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAAlEe;AAAkE;AAK3E,SAASD,QAAQzC,OAAuB;CACtC,OAAO,EAAEA,MAAM;AACjB"}
@@ -5,8 +5,8 @@ import { ComponentRef, Ref } from "react";
5
5
  type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholderTextColor' | 'readOnly' | 'returnKeyType' | 'role' | 'selectionColor' | 'style' | 'underlineColorAndroid' | 'value'> & {
6
6
  /**
7
7
  * The name of the button that clears the field, for a screen reader.
8
- * Left out, it is "Clear search", the English name web's takes from React
9
- * Aria.
8
+ * Left out, it is the name React Aria gives web's in the `I18nProvider`'s
9
+ * locale, or the device's outside one, "Clear search" in English.
10
10
  */
11
11
  readonly clearLabel?: string;
12
12
  /**
@@ -100,7 +100,7 @@ type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
100
100
  * <SearchField label="Label" placeholder="Supporting text" />
101
101
  * ```
102
102
  */
103
- declare function SearchField({ clearLabel, defaultValue, description, error, inputRef, isDisabled, isRequired, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props }: SearchFieldProps): import("react").JSX.Element;
103
+ declare function SearchField({ clearLabel: ownClearLabel, defaultValue, description, error, inputRef, isDisabled, isRequired, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props }: SearchFieldProps): import("react").JSX.Element;
104
104
  //#endregion
105
105
  export { SearchField, type SearchFieldProps };
106
106
  //# sourceMappingURL=index.d.ts.map
@@ -4,6 +4,7 @@ import { composeStyles, themedStyles } from "../../theme/styles.js";
4
4
  import { usePressFeedback } from "../../press/index.js";
5
5
  import { withOpacity } from "../../theme/color.js";
6
6
  import { AutocompleteContext } from "../../autocomplete/index.js";
7
+ import { useMessages } from "../../i18n/provider.js";
7
8
  import { CloseGlyph, SearchGlyph } from "../../glyphs/index.js";
8
9
  import { useFieldValidation } from "../../form/index.js";
9
10
  import { IconButton } from "../icon-button/index.js";
@@ -15,7 +16,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
15
16
  //#region src/components/search-field/index.tsx
16
17
  const ICON_SIZE = 24;
17
18
  const MAX_WIDTH = 720;
18
- const CLEAR_LABEL = "Clear search";
19
19
  const stylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity }) => StyleSheet.create({
20
20
  bar: {
21
21
  alignItems: "center",
@@ -283,17 +283,17 @@ function SearchField(t0) {
283
283
  let onKeyPress;
284
284
  let onSubmit;
285
285
  let onSubmitEditing;
286
+ let ownClearLabel;
286
287
  let props;
287
288
  let ref;
288
289
  let style;
289
290
  let t1;
290
291
  let t2;
291
292
  let t3;
292
- let t4;
293
293
  let validate;
294
294
  let value;
295
295
  if ($[0] !== t0) {
296
- ({clearLabel: t1, defaultValue: t2, description, error, inputRef, isDisabled: t3, isRequired: t4, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props} = t0);
296
+ ({clearLabel: ownClearLabel, defaultValue: t1, description, error, inputRef, isDisabled: t2, isRequired: t3, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props} = t0);
297
297
  $[0] = t0;
298
298
  $[1] = description;
299
299
  $[2] = error;
@@ -307,13 +307,13 @@ function SearchField(t0) {
307
307
  $[10] = onKeyPress;
308
308
  $[11] = onSubmit;
309
309
  $[12] = onSubmitEditing;
310
- $[13] = props;
311
- $[14] = ref;
312
- $[15] = style;
313
- $[16] = t1;
314
- $[17] = t2;
315
- $[18] = t3;
316
- $[19] = t4;
310
+ $[13] = ownClearLabel;
311
+ $[14] = props;
312
+ $[15] = ref;
313
+ $[16] = style;
314
+ $[17] = t1;
315
+ $[18] = t2;
316
+ $[19] = t3;
317
317
  $[20] = validate;
318
318
  $[21] = value;
319
319
  } else {
@@ -329,34 +329,35 @@ function SearchField(t0) {
329
329
  onKeyPress = $[10];
330
330
  onSubmit = $[11];
331
331
  onSubmitEditing = $[12];
332
- props = $[13];
333
- ref = $[14];
334
- style = $[15];
335
- t1 = $[16];
336
- t2 = $[17];
337
- t3 = $[18];
338
- t4 = $[19];
332
+ ownClearLabel = $[13];
333
+ props = $[14];
334
+ ref = $[15];
335
+ style = $[16];
336
+ t1 = $[17];
337
+ t2 = $[18];
338
+ t3 = $[19];
339
339
  validate = $[20];
340
340
  value = $[21];
341
341
  }
342
- const clearLabel = t1 === void 0 ? CLEAR_LABEL : t1;
343
- const defaultValue = t2 === void 0 ? "" : t2;
344
- const isDisabled = t3 === void 0 ? false : t3;
345
- const isRequired = t4 === void 0 ? false : t4;
342
+ const defaultValue = t1 === void 0 ? "" : t1;
343
+ const isDisabled = t2 === void 0 ? false : t2;
344
+ const isRequired = t3 === void 0 ? false : t3;
345
+ const messages = useMessages();
346
+ const clearLabel = ownClearLabel ?? messages.clearSearch;
346
347
  const id = useId();
347
348
  const control = useRef(null);
348
349
  const autocomplete = use(AutocompleteContext);
349
350
  const [own, setOwn] = useState(defaultValue);
350
351
  const current = autocomplete?.inputValue ?? value ?? own;
351
352
  const report = reportTo(autocomplete, onChange);
352
- const t5 = current === "";
353
- let t6;
354
- if ($[22] !== current || $[23] !== error || $[24] !== isDisabled || $[25] !== isRequired || $[26] !== name || $[27] !== t5 || $[28] !== validate) {
355
- t6 = {
353
+ const t4 = current === "";
354
+ let t5;
355
+ if ($[22] !== current || $[23] !== error || $[24] !== isDisabled || $[25] !== isRequired || $[26] !== name || $[27] !== t4 || $[28] !== validate) {
356
+ t5 = {
356
357
  control,
357
358
  error,
358
359
  isDisabled,
359
- isEmpty: t5,
360
+ isEmpty: t4,
360
361
  isReadOnly: false,
361
362
  isRequired,
362
363
  name,
@@ -369,83 +370,83 @@ function SearchField(t0) {
369
370
  $[24] = isDisabled;
370
371
  $[25] = isRequired;
371
372
  $[26] = name;
372
- $[27] = t5;
373
+ $[27] = t4;
373
374
  $[28] = validate;
374
- $[29] = t6;
375
- } else t6 = $[29];
376
- const validation = useFieldValidation(t6);
377
- let t7;
375
+ $[29] = t5;
376
+ } else t5 = $[29];
377
+ const validation = useFieldValidation(t5);
378
+ let t6;
378
379
  if ($[30] !== onBlur || $[31] !== validation.onBlur) {
379
- t7 = blurThen(validation.onBlur, onBlur);
380
+ t6 = blurThen(validation.onBlur, onBlur);
380
381
  $[30] = onBlur;
381
382
  $[31] = validation.onBlur;
382
- $[32] = t7;
383
- } else t7 = $[32];
384
- let t8;
385
- if ($[33] !== onFocus || $[34] !== t7) {
386
- t8 = {
387
- onBlur: t7,
383
+ $[32] = t6;
384
+ } else t6 = $[32];
385
+ let t7;
386
+ if ($[33] !== onFocus || $[34] !== t6) {
387
+ t7 = {
388
+ onBlur: t6,
388
389
  onFocus
389
390
  };
390
391
  $[33] = onFocus;
391
- $[34] = t7;
392
- $[35] = t8;
393
- } else t8 = $[35];
394
- const focus = useFieldFocus(t8);
392
+ $[34] = t6;
393
+ $[35] = t7;
394
+ } else t7 = $[35];
395
+ const focus = useFieldFocus(t7);
395
396
  const clear = clearInto(setOwn, report, onClear, validation.onEdit);
396
397
  const shownError = validation.error;
397
- let t10;
398
+ let t8;
398
399
  let t9;
399
400
  if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
400
- t9 = () => control.current;
401
- t10 = [];
402
- $[36] = t10;
401
+ t8 = () => control.current;
402
+ t9 = [];
403
+ $[36] = t8;
403
404
  $[37] = t9;
404
405
  } else {
405
- t10 = $[36];
406
+ t8 = $[36];
406
407
  t9 = $[37];
407
408
  }
408
- useImperativeHandle(inputRef, t9, t10);
409
+ useImperativeHandle(inputRef, t8, t9);
409
410
  const T0 = View;
410
411
  const T1 = SearchBar;
411
- const t11 = focus.focused;
412
- const t12 = shownError !== void 0;
413
- const t13 = current !== "";
412
+ const t10 = focus.focused;
413
+ const t11 = shownError !== void 0;
414
+ const t12 = current !== "";
414
415
  const T2 = FieldInput;
415
- const t14 = focus.handlers;
416
- let t15;
416
+ const t13 = focus.handlers;
417
+ let t14;
417
418
  if ($[38] !== description || $[39] !== id || $[40] !== shownError) {
418
- t15 = describedBy(id, {
419
+ t14 = describedBy(id, {
419
420
  description,
420
421
  error: shownError
421
422
  });
422
423
  $[38] = description;
423
424
  $[39] = id;
424
425
  $[40] = shownError;
425
- $[41] = t15;
426
- } else t15 = $[41];
427
- const t16 = !isDisabled;
428
- const t17 = editInto(setOwn, report, validation.onEdit);
429
- const t18 = keyInto(current === "" || isDisabled ? void 0 : clear, onKeyPress);
430
- let t19;
426
+ $[41] = t14;
427
+ } else t14 = $[41];
428
+ const t15 = !isDisabled;
429
+ const t16 = editInto(setOwn, report, validation.onEdit);
430
+ const t17 = keyInto(current === "" || isDisabled ? void 0 : clear, onKeyPress);
431
+ let t18;
431
432
  if ($[42] !== current || $[43] !== onSubmit || $[44] !== onSubmitEditing) {
432
- t19 = submitInto(current, onSubmit, onSubmitEditing);
433
+ t18 = submitInto(current, onSubmit, onSubmitEditing);
433
434
  $[42] = current;
434
435
  $[43] = onSubmit;
435
436
  $[44] = onSubmitEditing;
436
- $[45] = t19;
437
- } else t19 = $[45];
438
- let t20;
439
- if ($[46] !== T2 || $[47] !== current || $[48] !== focus.handlers || $[49] !== label || $[50] !== props || $[51] !== t15 || $[52] !== t16 || $[53] !== t17 || $[54] !== t18 || $[55] !== t19) {
440
- t20 = /* @__PURE__ */ jsx(T2, {
437
+ $[45] = t18;
438
+ } else t18 = $[45];
439
+ let t19;
440
+ if ($[46] !== T2 || $[47] !== current || $[48] !== focus.handlers || $[49] !== label || $[50] !== props || $[51] !== t14 || $[52] !== t15 || $[53] !== t16 || $[54] !== t17 || $[55] !== t18) {
441
+ t19 = /* @__PURE__ */ jsx(T2, {
441
442
  ...props,
442
- ...t14,
443
+ ...t13,
443
444
  "aria-label": label,
444
- described: t15,
445
- editable: t16,
446
- onChangeText: t17,
447
- onKeyPress: t18,
448
- onSubmitEditing: t19,
445
+ described: t14,
446
+ editable: t15,
447
+ onChangeText: t16,
448
+ onKeyPress: t17,
449
+ onSubmitEditing: t18,
449
450
  ref: control,
450
451
  returnKeyType: "search",
451
452
  role: "searchbox",
@@ -456,25 +457,25 @@ function SearchField(t0) {
456
457
  $[48] = focus.handlers;
457
458
  $[49] = label;
458
459
  $[50] = props;
459
- $[51] = t15;
460
- $[52] = t16;
461
- $[53] = t17;
462
- $[54] = t18;
463
- $[55] = t19;
464
- $[56] = t20;
465
- } else t20 = $[56];
466
- let t21;
467
- if ($[57] !== T1 || $[58] !== clear || $[59] !== clearLabel || $[60] !== focus.focused || $[61] !== isDisabled || $[62] !== isRequired || $[63] !== t12 || $[64] !== t13 || $[65] !== t20) {
468
- t21 = /* @__PURE__ */ jsx(T1, {
460
+ $[51] = t14;
461
+ $[52] = t15;
462
+ $[53] = t16;
463
+ $[54] = t17;
464
+ $[55] = t18;
465
+ $[56] = t19;
466
+ } else t19 = $[56];
467
+ let t20;
468
+ if ($[57] !== T1 || $[58] !== clear || $[59] !== clearLabel || $[60] !== focus.focused || $[61] !== isDisabled || $[62] !== isRequired || $[63] !== t11 || $[64] !== t12 || $[65] !== t19) {
469
+ t20 = /* @__PURE__ */ jsx(T1, {
469
470
  clearLabel,
470
471
  control,
471
472
  isDisabled,
472
- isFocused: t11,
473
- isInvalid: t12,
473
+ isFocused: t10,
474
+ isInvalid: t11,
474
475
  isRequired,
475
476
  onClear: clear,
476
- showsClear: t13,
477
- children: t20
477
+ showsClear: t12,
478
+ children: t19
478
479
  });
479
480
  $[57] = T1;
480
481
  $[58] = clear;
@@ -482,14 +483,14 @@ function SearchField(t0) {
482
483
  $[60] = focus.focused;
483
484
  $[61] = isDisabled;
484
485
  $[62] = isRequired;
485
- $[63] = t12;
486
- $[64] = t13;
487
- $[65] = t20;
488
- $[66] = t21;
489
- } else t21 = $[66];
490
- let t22;
486
+ $[63] = t11;
487
+ $[64] = t12;
488
+ $[65] = t19;
489
+ $[66] = t20;
490
+ } else t20 = $[66];
491
+ let t21;
491
492
  if ($[67] !== description || $[68] !== id || $[69] !== shownError) {
492
- t22 = /* @__PURE__ */ jsx(FieldMessage, {
493
+ t21 = /* @__PURE__ */ jsx(FieldMessage, {
493
494
  description,
494
495
  error: shownError,
495
496
  id
@@ -497,23 +498,23 @@ function SearchField(t0) {
497
498
  $[67] = description;
498
499
  $[68] = id;
499
500
  $[69] = shownError;
500
- $[70] = t22;
501
- } else t22 = $[70];
502
- let t23;
503
- if ($[71] !== T0 || $[72] !== ref || $[73] !== style || $[74] !== t21 || $[75] !== t22) {
504
- t23 = /* @__PURE__ */ jsxs(T0, {
501
+ $[70] = t21;
502
+ } else t21 = $[70];
503
+ let t22;
504
+ if ($[71] !== T0 || $[72] !== ref || $[73] !== style || $[74] !== t20 || $[75] !== t21) {
505
+ t22 = /* @__PURE__ */ jsxs(T0, {
505
506
  ref,
506
507
  style,
507
- children: [t21, t22]
508
+ children: [t20, t21]
508
509
  });
509
510
  $[71] = T0;
510
511
  $[72] = ref;
511
512
  $[73] = style;
512
- $[74] = t21;
513
- $[75] = t22;
514
- $[76] = t23;
515
- } else t23 = $[76];
516
- return t23;
513
+ $[74] = t20;
514
+ $[75] = t21;
515
+ $[76] = t22;
516
+ } else t22 = $[76];
517
+ return t22;
517
518
  }
518
519
  function submitInto(value, onSubmit, onSubmitEditing) {
519
520
  return (event) => {