@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","StyleProp","ViewProps","ViewStyle","StyleSheet","View","IndicatorTone","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","DETERMINATE_EASING","stylesOf","indicatorStylesOf","useTheme","composeStyles","MeterProps","Omit","formatOptions","Intl","NumberFormatOptions","label","locale","maxValue","minValue","ref","showValue","style","tone","MeterTone","value","valueLabel","styles","create","line","alignSelf","Extract","Meter","t0","$","_c","ariaLabel","props","t1","t2","t3","t4","t5","undefined","theme","colors","t6","reading","t7","motion","durationMedium1","duration","easing","shown","percentage","onLayout","width","t8","t9","t10","text","t11","root","t12","t13","t14","t15","t16","_c","indicatorStylesOf"],"sources":["../../../src/components/meter/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewProps, ViewStyle } from 'react-native'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport type { IndicatorTone } from '../../indicator'\n\nimport {\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport {\n DETERMINATE_EASING,\n stylesOf as indicatorStylesOf,\n} from '../../indicator/styles'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// A meter is the progress indicators page's line, drawn for a measurement\n// rather than for a task, as on web: the same three parts at the same 4dp,\n// the same label row above them, and the same motion when the number changes.\n// All of that is `src/indicator`, shared with ProgressIndicator, so what is\n// here is the two things that make it a meter rather than a progress bar.\n//\n// The first is the role. The root says `meter` rather than `progressbar`, as\n// React Aria's `Meter` does on web, and a screen reader says the two\n// differently: one is how full something is, the other how far along\n// something is. That is also why a meter has no indeterminate state: a\n// measurement whose value is unknown is not a measurement.\n//\n// The second is `tone`. The page draws one colour pair, which is right for a\n// task, since progress does not become good or bad on its way to done. A\n// measurement does, so `negative` and `positive` recolour the active\n// indicator and the stop indicator and leave the track alone. A column of\n// meters then reads as one scale with bars of different colours. Which tone a\n// value deserves is the call site's to decide: nothing here reads the number\n// and picks one.\n//\n// The value is shown by default, where a progress indicator hides it. A meter\n// is the number, and `formatOptions` is what makes it read as a percentage,\n// bytes or a plain count, in `locale`.\n\ntype MeterProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * What is being measured, shown above the line. A screen reader reads it as\n * the meter's name; a meter whose surroundings name it takes `aria-label`\n * 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 top of the scale.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The bottom of the scale.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the value is shown beside the label.\n * @default true\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours the measurement is drawn in. `primary` states without\n * ranking; `negative` and `positive` say the value is bad or good, and\n * recolour the active indicator and the stop indicator, leaving the track in\n * its secondary container so a column of meters still shares one track.\n * @default 'primary'\n */\n readonly tone?: MeterTone\n /**\n * The measurement, 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\nconst styles = StyleSheet.create({\n // The row the line is drawn across, measured for the width it is drawn to.\n line: {\n alignSelf: 'stretch',\n },\n})\n\n// The three of the shared line's four tones a meter draws. The fourth,\n// `inherit`, is for an indicator inside something that carries its own\n// colour, which is a pending button rather than a measurement.\ntype MeterTone = Extract<IndicatorTone, 'negative' | 'positive' | 'primary'>\n\n/**\n * How full something is, on a scale it names: disk used, storage left, a\n * rating out of five. Pass `value` between `minValue` and `maxValue`, and\n * `formatOptions` to say how the number reads, in `locale`. For how far along\n * a task is, reach for ProgressIndicator instead: a meter has no indeterminate\n * state, because a measurement always has a value.\n *\n * ```tsx\n * <Meter label=\"Label\" tone=\"negative\" value={94} />\n * ```\n *\n * A screen reader hears it as a meter named by its label, with its value as\n * `formatOptions` writes it. `style`, `ref` and `testID` land on the meter as\n * a whole, which is the view a layout positions.\n */\nfunction Meter({\n 'aria-label': ariaLabel,\n formatOptions,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n showValue = true,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n ...props\n}: MeterProps) {\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 shown = useEased(reading.percentage, {\n duration: theme.motion.durationMedium1,\n easing: DETERMINATE_EASING,\n })\n const { onLayout, width } = useMeasuredWidth()\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={reading.value}\n aria-valuetext={reading.text}\n role=\"meter\"\n {...props}\n style={composeStyles<ViewStyle>(indicatorStylesOf(theme).root, style)}\n >\n <IndicatorLabels\n label={label}\n value={showValue ? reading.text : undefined}\n />\n <View onLayout={onLayout} style={styles.line}>\n <IndicatorLine colors={colors} percentage={shown} width={width} />\n </View>\n </View>\n )\n}\n\nexport { Meter }\nexport type { MeterProps, MeterTone }\n"],"mappings":";;;;;;;;AAgGA,MAAMmC,SAAS9B,WAAW+B,OAAO,EAE/BC,MAAM,EACJC,WAAW,UACb,EACF,CAAC;;;;;;;;;;;;;;;;AAsBD,SAAAE,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAvB;CAAA,IAAAG;CAAA,IAAAC;CAAA,IAAAoB;CAAA,IAAAf;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAhB;CAAA,IAAAQ,EAAA,OAAAD,IAAA;EAAe,CAAA,CAAA,cAAAG,WAAAvB,eAAAG,OAAAC,QAAAC,UAAAoB,IAAAnB,UAAAoB,IAAAlB,WAAAmB,IAAAlB,OAAAC,MAAAkB,IAAAhB,OAAAiB,IAAAhB,YAAA,GAAAW,SAAAJ;EAaFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAArB;EAAAqB,EAAA,KAAAlB;EAAAkB,EAAA,KAAAjB;EAAAiB,EAAA,KAAAG;EAAAH,EAAA,KAAAZ;EAAAY,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAR;CAAA,OAAA;EAAAU,YAAAF,EAAA;EAAArB,gBAAAqB,EAAA;EAAAlB,QAAAkB,EAAA;EAAAjB,SAAAiB,EAAA;EAAAG,QAAAH,EAAA;EAAAZ,QAAAY,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QAAAa,QAAAtB,SAAAS,EAAA,QAAA2B,OAAA3B,EAAA,QAAA8B,OAAA9B,EAAA,QAAAgC,OAAAhC,EAAA,QAAAuB,IAAA;EAjBTU,MAAA,qBAAC,MAAD;GACE,YAAA;GACY,cAAAV;GACGvC,iBAAAA;GACAC,iBAAAA;GACA,iBAAAuC;GACC,kBAAAC;GACX,MAAA;GAAO,GACRtB;GACG,OAAAwB;GATT,UAAA,CAWEG,KAIAE,GAfG;;EAkBEhC,EAAA,MAAAhB;EAAAgB,EAAA,MAAAf;EAAAe,EAAA,MAAAG;EAAAH,EAAA,MAAAa,QAAAa;EAAA1B,EAAA,MAAAa,QAAAtB;EAAAS,EAAA,MAAA2B;EAAA3B,EAAA,MAAA8B;EAAA9B,EAAA,MAAAgC;EAAAhC,EAAA,MAAAuB;EAAAvB,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OAlBPiC;AAkBO"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","StyleProp","ViewProps","ViewStyle","StyleSheet","View","IndicatorTone","useLocaleOf","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","DETERMINATE_EASING","stylesOf","indicatorStylesOf","useTheme","composeStyles","MeterProps","Omit","formatOptions","Intl","NumberFormatOptions","label","locale","maxValue","minValue","ref","showValue","style","tone","MeterTone","value","valueLabel","styles","create","line","alignSelf","Extract","Meter","t0","$","_c","ariaLabel","props","t1","t2","t3","t4","t5","undefined","theme","colors","writtenIn","t6","reading","t7","motion","durationMedium1","duration","easing","shown","percentage","onLayout","width","t8","t9","t10","text","t11","root","t12","t13","t14","t15","t16","_c","indicatorStylesOf"],"sources":["../../../src/components/meter/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewProps, ViewStyle } from 'react-native'\n\nimport { StyleSheet, View } from 'react-native'\n\nimport type { IndicatorTone } from '../../indicator'\n\nimport { useLocaleOf } from '../../i18n/provider'\nimport {\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport {\n DETERMINATE_EASING,\n stylesOf as indicatorStylesOf,\n} from '../../indicator/styles'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// A meter is the progress indicators page's line, drawn for a measurement\n// rather than for a task, as on web: the same three parts at the same 4dp,\n// the same label row above them, and the same motion when the number changes.\n// All of that is `src/indicator`, shared with ProgressIndicator, so what is\n// here is the two things that make it a meter rather than a progress bar.\n//\n// The first is the role. The root says `meter` rather than `progressbar`, as\n// React Aria's `Meter` does on web, and a screen reader says the two\n// differently: one is how full something is, the other how far along\n// something is. That is also why a meter has no indeterminate state: a\n// measurement whose value is unknown is not a measurement.\n//\n// The second is `tone`. The page draws one colour pair, which is right for a\n// task, since progress does not become good or bad on its way to done. A\n// measurement does, so `negative` and `positive` recolour the active\n// indicator and the stop indicator and leave the track alone. A column of\n// meters then reads as one scale with bars of different colours. Which tone a\n// value deserves is the call site's to decide: nothing here reads the number\n// and picks one.\n//\n// The value is shown by default, where a progress indicator hides it. A meter\n// is the number, and `formatOptions` is what makes it read as a percentage,\n// bytes or a plain count, in `locale`.\n\ntype MeterProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * What is being measured, shown above the line. A screen reader reads it as\n * the meter's name; a meter whose surroundings name it takes `aria-label`\n * 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 top of the scale.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The bottom of the scale.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the value is shown beside the label.\n * @default true\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours the measurement is drawn in. `primary` states without\n * ranking; `negative` and `positive` say the value is bad or good, and\n * recolour the active indicator and the stop indicator, leaving the track in\n * its secondary container so a column of meters still shares one track.\n * @default 'primary'\n */\n readonly tone?: MeterTone\n /**\n * The measurement, 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\nconst styles = StyleSheet.create({\n // The row the line is drawn across, measured for the width it is drawn to.\n line: {\n alignSelf: 'stretch',\n },\n})\n\n// The three of the shared line's four tones a meter draws. The fourth,\n// `inherit`, is for an indicator inside something that carries its own\n// colour, which is a pending button rather than a measurement.\ntype MeterTone = Extract<IndicatorTone, 'negative' | 'positive' | 'primary'>\n\n/**\n * How full something is, on a scale it names: disk used, storage left, a\n * rating out of five. Pass `value` between `minValue` and `maxValue`, and\n * `formatOptions` to say how the number reads, in `locale`. For how far along\n * a task is, reach for ProgressIndicator instead: a meter has no indeterminate\n * state, because a measurement always has a value.\n *\n * ```tsx\n * <Meter label=\"Label\" tone=\"negative\" value={94} />\n * ```\n *\n * A screen reader hears it as a meter named by its label, with its value as\n * `formatOptions` writes it. `style`, `ref` and `testID` land on the meter as\n * a whole, which is the view a layout positions.\n */\nfunction Meter({\n 'aria-label': ariaLabel,\n formatOptions,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n showValue = true,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n ...props\n}: MeterProps) {\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 shown = useEased(reading.percentage, {\n duration: theme.motion.durationMedium1,\n easing: DETERMINATE_EASING,\n })\n const { onLayout, width } = useMeasuredWidth()\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={reading.value}\n aria-valuetext={reading.text}\n role=\"meter\"\n {...props}\n style={composeStyles<ViewStyle>(indicatorStylesOf(theme).root, style)}\n >\n <IndicatorLabels\n label={label}\n value={showValue ? reading.text : undefined}\n />\n <View onLayout={onLayout} style={styles.line}>\n <IndicatorLine colors={colors} percentage={shown} width={width} />\n </View>\n </View>\n )\n}\n\nexport { Meter }\nexport type { MeterProps, MeterTone }\n"],"mappings":";;;;;;;;;AAkGA,MAAMoC,SAAS/B,WAAWgC,OAAO,EAE/BC,MAAM,EACJC,WAAW,UACb,EACF,CAAC;;;;;;;;;;;;;;;;AAsBD,SAAAE,MAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAvB;CAAA,IAAAG;CAAA,IAAAC;CAAA,IAAAoB;CAAA,IAAAf;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAhB;CAAA,IAAAQ,EAAA,OAAAD,IAAA;EAAe,CAAA,CAAA,cAAAG,WAAAvB,eAAAG,OAAAC,QAAAC,UAAAoB,IAAAnB,UAAAoB,IAAAlB,WAAAmB,IAAAlB,OAAAC,MAAAkB,IAAAhB,OAAAiB,IAAAhB,YAAA,GAAAW,SAAAJ;EAaFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAArB;EAAAqB,EAAA,KAAAlB;EAAAkB,EAAA,KAAAjB;EAAAiB,EAAA,KAAAG;EAAAH,EAAA,KAAAZ;EAAAY,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAR;CAAA,OAAA;EAAAU,YAAAF,EAAA;EAAArB,gBAAAqB,EAAA;EAAAlB,QAAAkB,EAAA;EAAAjB,SAAAiB,EAAA;EAAAG,QAAAH,EAAA;EAAAZ,QAAAY,EAAA;EAAAI,KAAAJ,EA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AAAa,QAAA3B,EAAA,QAAAc,QAAAvB,SAAAS,EAAA,QAAA4B,OAAA5B,EAAA,QAAA+B,OAAA/B,EAAA,QAAAiC,OAAAjC,EAAA,QAAAwB,IAAA;EAjBTU,MAAA,qBAAC,MAAD;GACE,YAAA;GACY,cAAAV;GACGxC,iBAAAA;GACAC,iBAAAA;GACA,iBAAAwC;GACC,kBAAAC;GACX,MAAA;GAAO,GACRvB;GACG,OAAAyB;GATT,UAAA,CAWEG,KAIAE,GAfG;;EAkBEjC,EAAA,MAAAhB;EAAAgB,EAAA,MAAAf;EAAAe,EAAA,MAAAG;EAAAH,EAAA,MAAAc,QAAAa;EAAA3B,EAAA,MAAAc,QAAAvB;EAAAS,EAAA,MAAA4B;EAAA5B,EAAA,MAAA+B;EAAA/B,EAAA,MAAAiC;EAAAjC,EAAA,MAAAwB;EAAAxB,EAAA,MAAAkC;CAAA,OAAAA,MAAAlC,EAAA;CAAA,OAlBPkC;AAkBO"}
@@ -6,7 +6,9 @@ import { ComponentRef, Ref } from "react";
6
6
  type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'autoComplete' | 'autoCorrect' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'inputMode' | 'keyboardType' | 'maxLength' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholder' | 'placeholderTextColor' | 'readOnly' | 'selectionColor' | 'spellCheck' | 'style' | 'underlineColorAndroid' | 'value'> & {
7
7
  /**
8
8
  * The name of the stepper that lowers the value, for a screen reader. Left
9
- * out, it is the English "Decrease" followed by the field's own label.
9
+ * out, it is the name React Aria gives web's in the `I18nProvider`'s
10
+ * locale, or the device's outside one, around the field's own label:
11
+ * "Decrease Label" in English.
10
12
  */
11
13
  readonly decrementLabel?: string;
12
14
  /** The value the field opens with, when it keeps its own. */
@@ -39,7 +41,9 @@ type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
39
41
  readonly formatOptions?: Intl.NumberFormatOptions;
40
42
  /**
41
43
  * The name of the stepper that raises the value, for a screen reader. Left
42
- * out, it is the English "Increase" followed by the field's own label.
44
+ * out, it is the name React Aria gives web's in the `I18nProvider`'s
45
+ * locale, or the device's outside one, around the field's own label:
46
+ * "Increase Label" in English.
43
47
  */
44
48
  readonly incrementLabel?: string;
45
49
  /**
@@ -70,7 +74,7 @@ type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
70
74
  readonly label: string;
71
75
  /**
72
76
  * The BCP 47 locale the value is written and read in. Defaults to the
73
- * device's.
77
+ * `I18nProvider`'s, or the device's outside one.
74
78
  */
75
79
  readonly locale?: string;
76
80
  /** The highest value the field takes. A committed value is clamped to it. */
@@ -3,7 +3,8 @@ import { useTheme } from "../../theme/scope.js";
3
3
  import { composeStyles, themedStyles } from "../../theme/styles.js";
4
4
  import { hitSlop, usePressFeedback } from "../../press/index.js";
5
5
  import { withOpacity } from "../../theme/color.js";
6
- import { localeOf } from "../../number/locale.js";
6
+ import { messagesFor } from "../../i18n/index.js";
7
+ import { useLocaleOf } from "../../i18n/provider.js";
7
8
  import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
8
9
  import { useFieldValidation } from "../../form/index.js";
9
10
  import { IconButton } from "../icon-button/index.js";
@@ -99,7 +100,7 @@ function marginVerticalOf(margin) {
99
100
  * ```
100
101
  */
101
102
  function NumberField(t0) {
102
- const $ = c(110);
103
+ const $ = c(126);
103
104
  let decrementLabel;
104
105
  let defaultValue;
105
106
  let description;
@@ -205,30 +206,45 @@ function NumberField(t0) {
205
206
  const variant = t8 === void 0 ? "filled" : t8;
206
207
  const id = useId();
207
208
  const control = useRef(null);
208
- const writtenIn = localeOf(locale);
209
- const state = useNumberFieldState({
210
- defaultValue,
211
- formatOptions,
212
- isDisabled,
213
- isReadOnly,
214
- locale: writtenIn,
215
- maxValue,
216
- minValue,
217
- onChange,
218
- step,
219
- value
220
- });
209
+ const writtenIn = useLocaleOf(locale);
221
210
  let t9;
222
- if ($[31] !== state.numberValue) {
223
- t9 = Number.isNaN(state.numberValue);
224
- $[31] = state.numberValue;
225
- $[32] = t9;
226
- } else t9 = $[32];
227
- const empty = t9;
228
- const t10 = empty ? "" : String(state.numberValue);
229
- let t11;
230
- if ($[33] !== empty || $[34] !== error || $[35] !== isDisabled || $[36] !== isReadOnly || $[37] !== isRequired || $[38] !== name || $[39] !== state.numberValue || $[40] !== t10 || $[41] !== validate) {
231
- t11 = {
211
+ if ($[31] !== defaultValue || $[32] !== formatOptions || $[33] !== isDisabled || $[34] !== isReadOnly || $[35] !== maxValue || $[36] !== minValue || $[37] !== onChange || $[38] !== step || $[39] !== value || $[40] !== writtenIn) {
212
+ t9 = {
213
+ defaultValue,
214
+ formatOptions,
215
+ isDisabled,
216
+ isReadOnly,
217
+ locale: writtenIn,
218
+ maxValue,
219
+ minValue,
220
+ onChange,
221
+ step,
222
+ value
223
+ };
224
+ $[31] = defaultValue;
225
+ $[32] = formatOptions;
226
+ $[33] = isDisabled;
227
+ $[34] = isReadOnly;
228
+ $[35] = maxValue;
229
+ $[36] = minValue;
230
+ $[37] = onChange;
231
+ $[38] = step;
232
+ $[39] = value;
233
+ $[40] = writtenIn;
234
+ $[41] = t9;
235
+ } else t9 = $[41];
236
+ const state = useNumberFieldState(t9);
237
+ let t10;
238
+ if ($[42] !== state.numberValue) {
239
+ t10 = Number.isNaN(state.numberValue);
240
+ $[42] = state.numberValue;
241
+ $[43] = t10;
242
+ } else t10 = $[43];
243
+ const empty = t10;
244
+ const t11 = empty ? "" : String(state.numberValue);
245
+ let t12;
246
+ if ($[44] !== empty || $[45] !== error || $[46] !== isDisabled || $[47] !== isReadOnly || $[48] !== isRequired || $[49] !== name || $[50] !== state.numberValue || $[51] !== t11 || $[52] !== validate) {
247
+ t12 = {
232
248
  control,
233
249
  error,
234
250
  isDisabled,
@@ -236,222 +252,228 @@ function NumberField(t0) {
236
252
  isReadOnly,
237
253
  isRequired,
238
254
  name,
239
- submitted: t10,
255
+ submitted: t11,
240
256
  validate,
241
257
  value: state.numberValue
242
258
  };
243
- $[33] = empty;
244
- $[34] = error;
245
- $[35] = isDisabled;
246
- $[36] = isReadOnly;
247
- $[37] = isRequired;
248
- $[38] = name;
249
- $[39] = state.numberValue;
250
- $[40] = t10;
251
- $[41] = validate;
252
- $[42] = t11;
253
- } else t11 = $[42];
254
- const validation = useFieldValidation(t11);
259
+ $[44] = empty;
260
+ $[45] = error;
261
+ $[46] = isDisabled;
262
+ $[47] = isReadOnly;
263
+ $[48] = isRequired;
264
+ $[49] = name;
265
+ $[50] = state.numberValue;
266
+ $[51] = t11;
267
+ $[52] = validate;
268
+ $[53] = t12;
269
+ } else t12 = $[53];
270
+ const validation = useFieldValidation(t12);
255
271
  const shownError = validation.error;
256
- let t12;
257
- if ($[43] !== onBlur || $[44] !== state || $[45] !== validation.onBlur) {
258
- t12 = commitBefore(state, blurThen(validation.onBlur, onBlur));
259
- $[43] = onBlur;
260
- $[44] = state;
261
- $[45] = validation.onBlur;
262
- $[46] = t12;
263
- } else t12 = $[46];
264
272
  let t13;
265
- if ($[47] !== onFocus || $[48] !== t12) {
266
- t13 = {
267
- onBlur: t12,
273
+ if ($[54] !== onBlur || $[55] !== state || $[56] !== validation.onBlur) {
274
+ t13 = commitBefore(state, blurThen(validation.onBlur, onBlur));
275
+ $[54] = onBlur;
276
+ $[55] = state;
277
+ $[56] = validation.onBlur;
278
+ $[57] = t13;
279
+ } else t13 = $[57];
280
+ let t14;
281
+ if ($[58] !== onFocus || $[59] !== t13) {
282
+ t14 = {
283
+ onBlur: t13,
268
284
  onFocus
269
285
  };
270
- $[47] = onFocus;
271
- $[48] = t12;
272
- $[49] = t13;
273
- } else t13 = $[49];
274
- const focus = useFieldFocus(t13);
275
- const hasDecimals = (new NumberFormatter(writtenIn, formatOptions).resolvedOptions().maximumFractionDigits ?? 0) > 0;
286
+ $[58] = onFocus;
287
+ $[59] = t13;
288
+ $[60] = t14;
289
+ } else t14 = $[60];
290
+ const focus = useFieldFocus(t14);
291
+ let t15;
292
+ if ($[61] !== formatOptions || $[62] !== writtenIn) {
293
+ t15 = new NumberFormatter(writtenIn, formatOptions).resolvedOptions().maximumFractionDigits ?? 0;
294
+ $[61] = formatOptions;
295
+ $[62] = writtenIn;
296
+ $[63] = t15;
297
+ } else t15 = $[63];
298
+ const hasDecimals = t15 > 0;
276
299
  const announced = useStepAnnouncement(state.inputValue);
277
300
  const [stepperFocused, setStepperFocused] = useState(false);
278
- let t14;
279
- let t15;
280
- if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
281
- t14 = () => control.current;
282
- t15 = [];
283
- $[50] = t14;
284
- $[51] = t15;
301
+ let t16;
302
+ let t17;
303
+ if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
304
+ t16 = () => control.current;
305
+ t17 = [];
306
+ $[64] = t16;
307
+ $[65] = t17;
285
308
  } else {
286
- t14 = $[50];
287
- t15 = $[51];
309
+ t16 = $[64];
310
+ t17 = $[65];
288
311
  }
289
- useImperativeHandle(inputRef, t14, t15);
290
- const t16 = decrementLabel ?? `Decrease ${label}`;
291
- const t17 = incrementLabel ?? `Increase ${label}`;
292
- const t18 = steppers === "horizontal";
293
- let t19;
294
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
295
- t19 = () => {
296
- setStepperFocused(false);
297
- };
298
- $[52] = t19;
299
- } else t19 = $[52];
300
- let t20;
301
- if ($[53] !== announced || $[54] !== state.canDecrement || $[55] !== state.canIncrement || $[56] !== state.decrement || $[57] !== state.increment || $[58] !== t16 || $[59] !== t17 || $[60] !== t18 || $[61] !== validation.onEdit || $[62] !== variant) {
302
- let t21;
303
- if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
304
- t21 = () => {
312
+ useImperativeHandle(inputRef, t16, t17);
313
+ let t18;
314
+ if ($[66] !== announced || $[67] !== decrementLabel || $[68] !== incrementLabel || $[69] !== label || $[70] !== state.canDecrement || $[71] !== state.canIncrement || $[72] !== state.decrement || $[73] !== state.increment || $[74] !== steppers || $[75] !== validation.onEdit || $[76] !== variant || $[77] !== writtenIn) {
315
+ let t19;
316
+ if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
317
+ t19 = () => {
318
+ setStepperFocused(false);
319
+ };
320
+ $[79] = t19;
321
+ } else t19 = $[79];
322
+ let t20;
323
+ if ($[80] === Symbol.for("react.memo_cache_sentinel")) {
324
+ t20 = () => {
305
325
  setStepperFocused(true);
306
326
  };
307
- $[64] = t21;
308
- } else t21 = $[64];
309
- t20 = steppersOf({
327
+ $[80] = t20;
328
+ } else t20 = $[80];
329
+ t18 = steppersOf({
310
330
  canDecrement: state.canDecrement,
311
331
  canIncrement: state.canIncrement,
312
- decrementLabel: t16,
313
- incrementLabel: t17,
314
- inline: t18,
332
+ decrementLabel: decrementLabel ?? messagesFor(writtenIn).decrease.replace("{label}", label),
333
+ incrementLabel: incrementLabel ?? messagesFor(writtenIn).increase.replace("{label}", label),
334
+ inline: steppers === "horizontal",
315
335
  onBlur: t19,
316
336
  onDecrement: announced(stepThen(state.decrement, validation.onEdit)),
317
- onFocus: t21,
337
+ onFocus: t20,
318
338
  onIncrement: announced(stepThen(state.increment, validation.onEdit)),
319
339
  outlined: variant === "outlined"
320
340
  });
321
- $[53] = announced;
322
- $[54] = state.canDecrement;
323
- $[55] = state.canIncrement;
324
- $[56] = state.decrement;
325
- $[57] = state.increment;
326
- $[58] = t16;
327
- $[59] = t17;
328
- $[60] = t18;
329
- $[61] = validation.onEdit;
330
- $[62] = variant;
331
- $[63] = t20;
332
- } else t20 = $[63];
333
- const t21 = focus.focused || stepperFocused;
334
- const t22 = shownError !== void 0;
335
- const t23 = state.inputValue !== "";
336
- const t24 = focus.handlers;
337
- let t25;
338
- if ($[65] !== description || $[66] !== id || $[67] !== shownError) {
339
- t25 = describedBy(id, {
341
+ $[66] = announced;
342
+ $[67] = decrementLabel;
343
+ $[68] = incrementLabel;
344
+ $[69] = label;
345
+ $[70] = state.canDecrement;
346
+ $[71] = state.canIncrement;
347
+ $[72] = state.decrement;
348
+ $[73] = state.increment;
349
+ $[74] = steppers;
350
+ $[75] = validation.onEdit;
351
+ $[76] = variant;
352
+ $[77] = writtenIn;
353
+ $[78] = t18;
354
+ } else t18 = $[78];
355
+ const t19 = focus.focused || stepperFocused;
356
+ const t20 = shownError !== void 0;
357
+ const t21 = state.inputValue !== "";
358
+ const t22 = focus.handlers;
359
+ let t23;
360
+ if ($[81] !== description || $[82] !== id || $[83] !== shownError) {
361
+ t23 = describedBy(id, {
340
362
  description,
341
363
  error: shownError
342
364
  });
343
- $[65] = description;
344
- $[66] = id;
345
- $[67] = shownError;
346
- $[68] = t25;
347
- } else t25 = $[68];
348
- const t26 = !isDisabled && !isReadOnly;
365
+ $[81] = description;
366
+ $[82] = id;
367
+ $[83] = shownError;
368
+ $[84] = t23;
369
+ } else t23 = $[84];
370
+ const t24 = !isDisabled && !isReadOnly;
371
+ let t25;
372
+ if ($[85] !== hasDecimals || $[86] !== minValue) {
373
+ t25 = keyboardOf(minValue, hasDecimals);
374
+ $[85] = hasDecimals;
375
+ $[86] = minValue;
376
+ $[87] = t25;
377
+ } else t25 = $[87];
378
+ let t26;
379
+ if ($[88] !== state || $[89] !== validation.onEdit) {
380
+ t26 = editInto(state, validation.onEdit);
381
+ $[88] = state;
382
+ $[89] = validation.onEdit;
383
+ $[90] = t26;
384
+ } else t26 = $[90];
349
385
  let t27;
350
- if ($[69] !== hasDecimals || $[70] !== minValue) {
351
- t27 = keyboardOf(minValue, hasDecimals);
352
- $[69] = hasDecimals;
353
- $[70] = minValue;
354
- $[71] = t27;
355
- } else t27 = $[71];
386
+ if ($[91] !== onSubmitEditing || $[92] !== state) {
387
+ t27 = commitBefore(state, onSubmitEditing);
388
+ $[91] = onSubmitEditing;
389
+ $[92] = state;
390
+ $[93] = t27;
391
+ } else t27 = $[93];
356
392
  let t28;
357
- if ($[72] !== state || $[73] !== validation.onEdit) {
358
- t28 = editInto(state, validation.onEdit);
359
- $[72] = state;
360
- $[73] = validation.onEdit;
361
- $[74] = t28;
362
- } else t28 = $[74];
363
- let t29;
364
- if ($[75] !== onSubmitEditing || $[76] !== state) {
365
- t29 = commitBefore(state, onSubmitEditing);
366
- $[75] = onSubmitEditing;
367
- $[76] = state;
368
- $[77] = t29;
369
- } else t29 = $[77];
370
- let t30;
371
- if ($[78] !== focus.handlers || $[79] !== label || $[80] !== numeric || $[81] !== props || $[82] !== returnKeyType || $[83] !== state.inputValue || $[84] !== t25 || $[85] !== t26 || $[86] !== t27 || $[87] !== t28 || $[88] !== t29) {
372
- t30 = /* @__PURE__ */ jsx(FieldInput, {
393
+ if ($[94] !== focus.handlers || $[95] !== label || $[96] !== numeric || $[97] !== props || $[98] !== returnKeyType || $[99] !== state.inputValue || $[100] !== t23 || $[101] !== t24 || $[102] !== t25 || $[103] !== t26 || $[104] !== t27) {
394
+ t28 = /* @__PURE__ */ jsx(FieldInput, {
373
395
  ...props,
374
- ...t24,
396
+ ...t22,
375
397
  "aria-label": label,
376
398
  autoComplete: "off",
377
399
  autoCorrect: false,
378
- described: t25,
379
- editable: t26,
380
- keyboardType: t27,
400
+ described: t23,
401
+ editable: t24,
402
+ keyboardType: t25,
381
403
  numeric,
382
- onChangeText: t28,
383
- onSubmitEditing: t29,
404
+ onChangeText: t26,
405
+ onSubmitEditing: t27,
384
406
  ref: control,
385
407
  returnKeyType,
386
408
  spellCheck: false,
387
409
  value: state.inputValue
388
410
  });
389
- $[78] = focus.handlers;
390
- $[79] = label;
391
- $[80] = numeric;
392
- $[81] = props;
393
- $[82] = returnKeyType;
394
- $[83] = state.inputValue;
395
- $[84] = t25;
396
- $[85] = t26;
397
- $[86] = t27;
398
- $[87] = t28;
399
- $[88] = t29;
400
- $[89] = t30;
401
- } else t30 = $[89];
402
- let t31;
403
- if ($[90] !== floatingLabel || $[91] !== isDisabled || $[92] !== isRequired || $[93] !== label || $[94] !== t20 || $[95] !== t21 || $[96] !== t22 || $[97] !== t23 || $[98] !== t30 || $[99] !== variant) {
404
- t31 = /* @__PURE__ */ jsx(FieldBox, {
411
+ $[94] = focus.handlers;
412
+ $[95] = label;
413
+ $[96] = numeric;
414
+ $[97] = props;
415
+ $[98] = returnKeyType;
416
+ $[99] = state.inputValue;
417
+ $[100] = t23;
418
+ $[101] = t24;
419
+ $[102] = t25;
420
+ $[103] = t26;
421
+ $[104] = t27;
422
+ $[105] = t28;
423
+ } else t28 = $[105];
424
+ let t29;
425
+ if ($[106] !== floatingLabel || $[107] !== isDisabled || $[108] !== isRequired || $[109] !== label || $[110] !== t18 || $[111] !== t19 || $[112] !== t20 || $[113] !== t21 || $[114] !== t28 || $[115] !== variant) {
426
+ t29 = /* @__PURE__ */ jsx(FieldBox, {
405
427
  control,
406
- end: t20,
428
+ end: t18,
407
429
  floatingLabel,
408
430
  isDisabled,
409
- isFocused: t21,
410
- isInvalid: t22,
411
- isPopulated: t23,
431
+ isFocused: t19,
432
+ isInvalid: t20,
433
+ isPopulated: t21,
412
434
  isRequired,
413
435
  label,
414
436
  variant,
415
- children: t30
437
+ children: t28
416
438
  });
417
- $[90] = floatingLabel;
418
- $[91] = isDisabled;
419
- $[92] = isRequired;
420
- $[93] = label;
421
- $[94] = t20;
422
- $[95] = t21;
423
- $[96] = t22;
424
- $[97] = t23;
425
- $[98] = t30;
426
- $[99] = variant;
427
- $[100] = t31;
428
- } else t31 = $[100];
429
- let t32;
430
- if ($[101] !== description || $[102] !== id || $[103] !== shownError) {
431
- t32 = /* @__PURE__ */ jsx(FieldMessage, {
439
+ $[106] = floatingLabel;
440
+ $[107] = isDisabled;
441
+ $[108] = isRequired;
442
+ $[109] = label;
443
+ $[110] = t18;
444
+ $[111] = t19;
445
+ $[112] = t20;
446
+ $[113] = t21;
447
+ $[114] = t28;
448
+ $[115] = variant;
449
+ $[116] = t29;
450
+ } else t29 = $[116];
451
+ let t30;
452
+ if ($[117] !== description || $[118] !== id || $[119] !== shownError) {
453
+ t30 = /* @__PURE__ */ jsx(FieldMessage, {
432
454
  description,
433
455
  error: shownError,
434
456
  id
435
457
  });
436
- $[101] = description;
437
- $[102] = id;
438
- $[103] = shownError;
439
- $[104] = t32;
440
- } else t32 = $[104];
441
- let t33;
442
- if ($[105] !== ref || $[106] !== style || $[107] !== t31 || $[108] !== t32) {
443
- t33 = /* @__PURE__ */ jsxs(View, {
458
+ $[117] = description;
459
+ $[118] = id;
460
+ $[119] = shownError;
461
+ $[120] = t30;
462
+ } else t30 = $[120];
463
+ let t31;
464
+ if ($[121] !== ref || $[122] !== style || $[123] !== t29 || $[124] !== t30) {
465
+ t31 = /* @__PURE__ */ jsxs(View, {
444
466
  ref,
445
467
  style,
446
- children: [t31, t32]
468
+ children: [t29, t30]
447
469
  });
448
- $[105] = ref;
449
- $[106] = style;
450
- $[107] = t31;
451
- $[108] = t32;
452
- $[109] = t33;
453
- } else t33 = $[109];
454
- return t33;
470
+ $[121] = ref;
471
+ $[122] = style;
472
+ $[123] = t29;
473
+ $[124] = t30;
474
+ $[125] = t31;
475
+ } else t31 = $[125];
476
+ return t31;
455
477
  }
456
478
  function outwardSlop(half, place) {
457
479
  const slop = hitSlop(half, STEPPER_WIDTH);