@kanso-labs/react-native-kanso-ui 0.0.0-stage → 0.1.1

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 (145) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +205 -2
  3. package/dist/button/index.d.ts +56 -0
  4. package/dist/button/index.js +169 -0
  5. package/dist/button/index.js.map +1 -0
  6. package/dist/button/palettes.js +47 -0
  7. package/dist/button/palettes.js.map +1 -0
  8. package/dist/chip/index.js +194 -0
  9. package/dist/chip/index.js.map +1 -0
  10. package/dist/chip/styles.js +36 -0
  11. package/dist/chip/styles.js.map +1 -0
  12. package/dist/clipboard/index.js +58 -0
  13. package/dist/clipboard/index.js.map +1 -0
  14. package/dist/components/avatar/index.d.ts +82 -0
  15. package/dist/components/avatar/index.js +62 -0
  16. package/dist/components/avatar/index.js.map +1 -0
  17. package/dist/components/button/index.d.ts +87 -0
  18. package/dist/components/button/index.js +377 -0
  19. package/dist/components/button/index.js.map +1 -0
  20. package/dist/components/card/index.d.ts +78 -0
  21. package/dist/components/card/index.js +315 -0
  22. package/dist/components/card/index.js.map +1 -0
  23. package/dist/components/checkbox/index.d.ts +76 -0
  24. package/dist/components/checkbox/index.js +360 -0
  25. package/dist/components/checkbox/index.js.map +1 -0
  26. package/dist/components/chip/index.d.ts +84 -0
  27. package/dist/components/chip/index.js +257 -0
  28. package/dist/components/chip/index.js.map +1 -0
  29. package/dist/components/chip-group/index.d.ts +143 -0
  30. package/dist/components/chip-group/index.js +669 -0
  31. package/dist/components/chip-group/index.js.map +1 -0
  32. package/dist/components/copy-field/index.d.ts +60 -0
  33. package/dist/components/copy-field/index.js +277 -0
  34. package/dist/components/copy-field/index.js.map +1 -0
  35. package/dist/components/currency/index.d.ts +69 -0
  36. package/dist/components/currency/index.js +162 -0
  37. package/dist/components/currency/index.js.map +1 -0
  38. package/dist/components/form/index.d.ts +84 -0
  39. package/dist/components/form/index.js +95 -0
  40. package/dist/components/form/index.js.map +1 -0
  41. package/dist/components/icon-button/index.d.ts +68 -0
  42. package/dist/components/icon-button/index.js +289 -0
  43. package/dist/components/icon-button/index.js.map +1 -0
  44. package/dist/components/link/index.d.ts +59 -0
  45. package/dist/components/link/index.js +191 -0
  46. package/dist/components/link/index.js.map +1 -0
  47. package/dist/components/number-field/index.d.ts +151 -0
  48. package/dist/components/number-field/index.js +832 -0
  49. package/dist/components/number-field/index.js.map +1 -0
  50. package/dist/components/product-icon/index.d.ts +70 -0
  51. package/dist/components/product-icon/index.js +60 -0
  52. package/dist/components/product-icon/index.js.map +1 -0
  53. package/dist/components/radio-group/index.d.ts +105 -0
  54. package/dist/components/radio-group/index.js +597 -0
  55. package/dist/components/radio-group/index.js.map +1 -0
  56. package/dist/components/search-field/index.d.ts +98 -0
  57. package/dist/components/search-field/index.js +521 -0
  58. package/dist/components/search-field/index.js.map +1 -0
  59. package/dist/components/segmented-button/index.d.ts +113 -0
  60. package/dist/components/segmented-button/index.js +937 -0
  61. package/dist/components/segmented-button/index.js.map +1 -0
  62. package/dist/components/separator/index.d.ts +45 -0
  63. package/dist/components/separator/index.js +109 -0
  64. package/dist/components/separator/index.js.map +1 -0
  65. package/dist/components/stack/index.d.ts +70 -0
  66. package/dist/components/stack/index.js +107 -0
  67. package/dist/components/stack/index.js.map +1 -0
  68. package/dist/components/switch/index.d.ts +76 -0
  69. package/dist/components/switch/index.js +591 -0
  70. package/dist/components/switch/index.js.map +1 -0
  71. package/dist/components/text/index.d.ts +44 -0
  72. package/dist/components/text/index.js +78 -0
  73. package/dist/components/text/index.js.map +1 -0
  74. package/dist/components/text-field/index.d.ts +146 -0
  75. package/dist/components/text-field/index.js +228 -0
  76. package/dist/components/text-field/index.js.map +1 -0
  77. package/dist/control/index.js +117 -0
  78. package/dist/control/index.js.map +1 -0
  79. package/dist/control/styles.js +36 -0
  80. package/dist/control/styles.js.map +1 -0
  81. package/dist/field/index.d.ts +13 -0
  82. package/dist/field/index.js +1007 -0
  83. package/dist/field/index.js.map +1 -0
  84. package/dist/field/styles.js +131 -0
  85. package/dist/field/styles.js.map +1 -0
  86. package/dist/form/index.d.ts +24 -0
  87. package/dist/form/index.js +209 -0
  88. package/dist/form/index.js.map +1 -0
  89. package/dist/glyphs/icon-style.d.ts +25 -0
  90. package/dist/glyphs/icon-style.js +22 -0
  91. package/dist/glyphs/icon-style.js.map +1 -0
  92. package/dist/glyphs/index.js +170 -0
  93. package/dist/glyphs/index.js.map +1 -0
  94. package/dist/glyphs/styles.js +7 -0
  95. package/dist/glyphs/styles.js.map +1 -0
  96. package/dist/hooks/useWindowSizeClass.d.ts +25 -0
  97. package/dist/hooks/useWindowSizeClass.js +39 -0
  98. package/dist/hooks/useWindowSizeClass.js.map +1 -0
  99. package/dist/index.d.ts +31 -0
  100. package/dist/index.js +27 -0
  101. package/dist/mark/image.js +61 -0
  102. package/dist/mark/image.js.map +1 -0
  103. package/dist/mark/index.d.ts +9 -0
  104. package/dist/mark/index.js +234 -0
  105. package/dist/mark/index.js.map +1 -0
  106. package/dist/mark/initials.js +65 -0
  107. package/dist/mark/initials.js.map +1 -0
  108. package/dist/mark/styles.d.ts +1 -0
  109. package/dist/mark/styles.js +73 -0
  110. package/dist/mark/styles.js.map +1 -0
  111. package/dist/number/parser.js +321 -0
  112. package/dist/number/parser.js.map +1 -0
  113. package/dist/number/state.js +235 -0
  114. package/dist/number/state.js.map +1 -0
  115. package/dist/overlay/host.js +111 -0
  116. package/dist/overlay/host.js.map +1 -0
  117. package/dist/press/index.js +350 -0
  118. package/dist/press/index.js.map +1 -0
  119. package/dist/press/styles.js +31 -0
  120. package/dist/press/styles.js.map +1 -0
  121. package/dist/router/index.d.ts +28 -0
  122. package/dist/router/index.js +82 -0
  123. package/dist/router/index.js.map +1 -0
  124. package/dist/theme/color.js +25 -0
  125. package/dist/theme/color.js.map +1 -0
  126. package/dist/theme/resolve.d.ts +6 -0
  127. package/dist/theme/resolve.js +310 -0
  128. package/dist/theme/resolve.js.map +1 -0
  129. package/dist/theme/scope.d.ts +42 -0
  130. package/dist/theme/scope.js +80 -0
  131. package/dist/theme/scope.js.map +1 -0
  132. package/dist/theme/styles.js +39 -0
  133. package/dist/theme/styles.js.map +1 -0
  134. package/dist/theme-scope.d.ts +56 -0
  135. package/dist/theme-scope.js +127 -0
  136. package/dist/theme-scope.js.map +1 -0
  137. package/dist/tokens/defaults.d.ts +407 -0
  138. package/dist/tokens/defaults.js +403 -0
  139. package/dist/tokens/defaults.js.map +1 -0
  140. package/dist/typography/fonts.js +84 -0
  141. package/dist/typography/fonts.js.map +1 -0
  142. package/dist/typography/roles.d.ts +10 -0
  143. package/dist/typography/roles.js +82 -0
  144. package/dist/typography/roles.js.map +1 -0
  145. package/package.json +132 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","Ref","BlurEvent","Insets","KeyboardTypeOptions","StyleProp","TextInput","TextInputProps","TextInputSubmitEditingEvent","ViewStyle","NumberFormatter","useEffect","useId","useImperativeHandle","useRef","useState","AccessibilityInfo","Platform","Pressable","StyleSheet","useWindowDimensions","View","FieldVariant","ValidationResult","IconStyle","NumberFieldState","ResolvedTheme","describedBy","FieldBox","FieldInput","FieldMessage","useFieldFocus","useFieldValidation","MinusGlyph","PlusGlyph","IconStyleContext","useNumberFieldState","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","IconButton","NumberFieldProps","Omit","decrementLabel","defaultValue","description","error","floatingLabel","formatOptions","Intl","NumberFormatOptions","incrementLabel","inputRef","isDisabled","isReadOnly","isRequired","label","locale","maxValue","minValue","name","numeric","onChange","value","ref","step","steppers","style","validate","variant","Spin","onPress","onPressIn","onPressOut","StepperProps","children","half","onBlur","onFocus","outlined","place","SteppersProps","canDecrement","canIncrement","inline","onDecrement","onIncrement","STEPPER_WIDTH","GLYPH_SIZE","SPIN_DELAY","SPIN_INTERVAL","deviceLocale","stylesOf","radii","spacing","create","stepper","alignItems","flexBasis","flexGrow","justifyContent","width","stepperBottomOutlined","borderBottomEndRadius","xs","stepperRing","outlineOffset","alignSelf","flexDirection","marginEnd","lg","marginStart","sm","marginVertical","steppersInline","gap","md","steppersOutlined","stepperTop","borderTopEndRadius","blurThen","then","event","commitBefore","state","handler","Event","commit","editInto","onEdit","text","setInputValue","glyphOf","color","size","halfOf","typography","fontScale","bodyLargeLineHeight","bodySmallLineHeight","keyboardOf","hasDecimals","hasNegative","undefined","Number","isNaN","OS","localeOf","NumberFormat","supportedLocalesOf","resolvedOptions","marginVerticalOf","margin","NumberField","t0","$","_c","onSubmitEditing","props","t1","t2","t3","t4","t5","t6","t7","t8","returnKeyType","id","control","writtenIn","t9","numberValue","empty","t10","String","t11","isEmpty","submitted","validation","shownError","t12","t13","focus","maximumFractionDigits","announced","useStepAnnouncement","inputValue","stepperFocused","setStepperFocused","t14","t15","Symbol","for","current","t16","t17","t18","t19","t20","decrement","increment","t21","steppersOf","stepThen","focused","t22","t23","t24","handlers","t25","t26","t27","t28","t29","t30","t31","t32","t33","outwardSlop","slop","reach","top","bottom","Stepper","ariaLabel","theme","styles","colors","stateLayerOpacity","corner","feedback","onSurfaceVariant","corners","disabled","T0","ring","layer","onSurface","disabledContent","Steppers","sizing","up","useSpin","down","controlXs","canStep","latest","timer","spun","clearTimeout","tick","setTimeout","pending","announceForAccessibility","_c"],"sources":["../../../src/components/number-field/index.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react'\nimport type {\n BlurEvent,\n Insets,\n KeyboardTypeOptions,\n StyleProp,\n TextInput,\n TextInputProps,\n TextInputSubmitEditingEvent,\n ViewStyle,\n} from 'react-native'\n\nimport { NumberFormatter } from '@internationalized/number'\nimport { useEffect, useId, useImperativeHandle, useRef, useState } from 'react'\nimport {\n AccessibilityInfo,\n Platform,\n Pressable,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\n\nimport type { FieldVariant } from '../../field'\nimport type { ValidationResult } from '../../form'\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { NumberFieldState } from '../../number/state'\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport {\n describedBy,\n FieldBox,\n FieldInput,\n FieldMessage,\n useFieldFocus,\n} from '../../field'\nimport { useFieldValidation } from '../../form'\nimport { MinusGlyph, PlusGlyph } from '../../glyphs'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { useNumberFieldState } from '../../number/state'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's NumberField: the text fields page's field holding a number,\n// drawn through the field chrome in src/field as TextField is, with the value\n// in the mono face and tabular figures by default and two steppers at the\n// box's end.\n//\n// The steppers come in web's two layouts. Stacked, the plus over the minus,\n// they are a column flush with the box's top, end and bottom, each half of\n// the box and 32dp wide, drawing the icon buttons page's 20dp glyph in on\n// surface variant with the state layer and the ripple every control draws.\n// The top one takes the box's top-end corner, and the bottom one the outlined\n// box's bottom-end corner, so the column reads as the box's own edge. Side by\n// side, they are extra-small icon buttons, 8dp apart and 12dp from the end\n// where the page puts a field's icons, centred on the box. Either way a tap\n// steps once, on release, and a hold keeps stepping until the press ends or\n// the value reaches its bound, as React Aria's steppers do for a touch, and\n// the box shows focus while a stepper has it, as web's does.\n//\n// **The stacked pair reaches 48dp outward**, through `hitSlop`: the top one\n// up and the bottom one down, each 8dp to either side. Web keeps the pair to\n// its drawn size, since two 48dp targets inside the column would overlap;\n// reaching away from each other, the two never meet.\n//\n// The value is React Stately's, through src/number: a keystroke is kept only\n// where the text could still become a number in the field's locale and\n// format, and the text is read, clamped to the range, snapped to the step\n// and written back formatted when the field loses focus or the return key is\n// pressed, as web's is on blur and Enter. The keyboard is the one that types\n// what the field takes: a minus where the range reaches below zero, and a\n// decimal separator where the format shows a fraction. On iOS a minus is on\n// the numbers and punctuation keyboard alone, so a field that takes one gets\n// that.\n//\n// **The locale is a prop**, defaulting to the device's, where web reads it\n// from React Aria's `I18nProvider`. It decides how the value is written and\n// read, so a field in a German app reads \"1.234,5\" as 1234.5.\n//\n// A stepper press is announced on iOS and Android, by the value it leaves,\n// since VoiceOver and TalkBack stay on the stepper rather than reading the\n// field again.\n\ntype NumberFieldProps = Omit<\n TextInputProps,\n | 'accessibilityHint'\n | 'accessibilityLabel'\n | 'aria-disabled'\n | 'aria-label'\n | 'autoComplete'\n | 'autoCorrect'\n | 'children'\n | 'cursorColor'\n | 'defaultValue'\n | 'editable'\n | 'inputMode'\n | 'keyboardType'\n | 'maxLength'\n | 'multiline'\n | 'numberOfLines'\n | 'onChange'\n | 'onChangeText'\n | 'placeholder'\n | 'placeholderTextColor'\n | 'readOnly'\n | 'selectionColor'\n | 'spellCheck'\n | 'style'\n | 'underlineColorAndroid'\n | 'value'\n> & {\n /**\n * The name of the stepper that lowers the value, for a screen reader. Left\n * out, it is the English \"Decrease\" followed by the field's own label.\n */\n readonly decrementLabel?: string\n /** The value the field opens with, when it keeps its own. */\n readonly defaultValue?: number\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state: the message, the error colours, and the\n * invalid state a screen reader reads all follow from it. The line under\n * the field arrives with the message, so the field grows when this does,\n * unless it is inside a `Form`, which keeps the line drawn. It wins over\n * what `validate` and the form say, and holds a `native` form back.\n */\n readonly error?: string\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n readonly floatingLabel?: boolean\n /**\n * How the value is written and read: a currency, a percentage, a unit, a\n * number of fraction digits. It also decides what can be typed.\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * The name of the stepper that raises the value, for a screen reader. Left\n * out, it is the English \"Increase\" followed by the field's own label.\n */\n readonly incrementLabel?: string\n /**\n * A ref to the field's own `TextInput`, which is what a call site moves\n * focus to, after a server's error, say. `ref` is the field as a whole.\n */\n readonly inputRef?: Ref<TextInput>\n /**\n * Draws the field disabled: it takes no focus, no input and no steps.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Shows the value and takes focus, but takes no input and no steps.\n * @default false\n */\n readonly isReadOnly?: boolean\n /**\n * Marks the label with an asterisk, as the text fields page marks a field\n * that must be filled.\n * @default false\n */\n readonly isRequired?: boolean\n /**\n * What the field is for, and the name a screen reader reads for it.\n * Required, since a field with no label is a box nobody can name.\n */\n readonly label: string\n /**\n * The BCP 47 locale the value is written and read in. Defaults to the\n * device's.\n */\n readonly locale?: string\n /** The highest value the field takes. A committed value is clamped to it. */\n readonly maxValue?: number\n /** The lowest value the field takes. A committed value is clamped to it. */\n readonly minValue?: number\n /**\n * The name the value is submitted under by the `Form` around the field,\n * and the key its `validationErrors` reach the field by. The form submits\n * the number written out, such as `1234.5`, and `''` for an empty field.\n */\n readonly name?: string\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column. On by default, since a\n * number field holds nothing else.\n * @default true\n */\n readonly numeric?: boolean\n /**\n * Called with the committed value, once it is read from what was typed or\n * stepped to. `NaN` is an empty field.\n */\n readonly onChange?: (value: number) => void\n readonly ref?: Ref<View>\n /**\n * The amount the steppers move the value by, and the multiple of it, from\n * `minValue`, that a committed value snaps to.\n */\n readonly step?: number\n /**\n * How the two steppers sit at the end of the box: stacked, the plus over\n * the minus, flush with the box's edge, or side by side as extra-small\n * icon buttons.\n * @default 'vertical'\n */\n readonly steppers?: 'horizontal' | 'vertical'\n /** Positions and sizes the field as a whole. */\n readonly style?: StyleProp<ViewStyle>\n /**\n * Checks the value, `NaN` for an empty field, and returns its problem in\n * words, or several, where there is one, and `true`, `null` or `undefined`\n * where there is none. Under the default `aria` validation the error shows\n * as the value changes; inside a `native` form it shows once a submission\n * is tried, or once the field loses focus after an edit, and holds the form\n * back.\n */\n readonly validate?: (value: number) => ValidationResult\n /** The value, when the call site keeps it. `NaN` is an empty field. */\n readonly value?: number\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats, the text fields page's two fields.\n * @default 'filled'\n */\n readonly variant?: FieldVariant\n}\n\n// What a stepper hands its control so a tap steps once and a hold keeps\n// stepping.\ntype Spin = {\n readonly onPress: () => void\n readonly onPressIn: () => void\n readonly onPressOut: () => void\n}\n\ntype StepperProps = Spin & {\n readonly 'aria-label': string\n readonly children: ReactNode\n readonly half: number\n readonly isDisabled: boolean\n readonly onBlur: () => void\n readonly onFocus: () => void\n readonly outlined: boolean\n readonly place: 'bottom' | 'top'\n}\n\ntype SteppersProps = {\n readonly canDecrement: boolean\n readonly canIncrement: boolean\n readonly decrementLabel: string\n readonly incrementLabel: string\n readonly inline: boolean\n readonly onBlur: () => void\n readonly onDecrement: () => void\n readonly onFocus: () => void\n readonly onIncrement: () => void\n readonly outlined: boolean\n}\n\n// A stacked stepper's width, and the glyph it draws: the icon buttons page's\n// 20dp, for the extra-small size the pair stands in for.\nconst STEPPER_WIDTH = 32\nconst GLYPH_SIZE = 20\n\n// How long a stepper is held before it starts stepping on its own, and how\n// often it steps after that: React Aria's timings for a stepper held by\n// touch.\nconst SPIN_DELAY = 600\nconst SPIN_INTERVAL = 60\n\nlet deviceLocale: string | undefined\n\nconst stylesOf = themedStyles(({ radii, spacing }) =>\n StyleSheet.create({\n // One stacked stepper: half the column, its glyph in the middle.\n stepper: {\n alignItems: 'center',\n flexBasis: 0,\n flexGrow: 1,\n justifyContent: 'center',\n width: STEPPER_WIDTH,\n },\n stepperBottomOutlined: {\n borderBottomEndRadius: radii.xs,\n },\n // The ring inside the stepper, as web draws it, since outside it would\n // fall over the box's edge and the other stepper.\n stepperRing: {\n outlineOffset: -2,\n },\n // Stacked: the column reaches out of the box's padding to sit flush with\n // its top, end and bottom, 8dp after the value rather than the box's 16.\n steppers: {\n alignSelf: 'stretch',\n flexDirection: 'column',\n marginEnd: -spacing.lg,\n marginStart: spacing.sm - spacing.lg,\n marginVertical: -spacing.sm,\n },\n // Side by side: 12dp from the end, as the page places a field's icons,\n // and 8dp apart, which is how far each button's target reaches past it,\n // so neither target falls over the other's glyph. They centre on the\n // box, as the page centres a trailing icon and as web draws them, and\n // take no more of its height than the value's line, so the outlined\n // box, whose content is that line alone, is not made taller by them.\n // The margins that do it are worked out where they render, since the\n // line follows the device's text size.\n steppersInline: {\n alignSelf: 'center',\n flexDirection: 'row',\n gap: spacing.sm,\n marginEnd: spacing.md - spacing.lg,\n marginStart: spacing.sm - spacing.lg,\n },\n // In the outlined box the column has 16dp to reach rather than 8.\n steppersOutlined: {\n marginVertical: -spacing.lg,\n },\n stepperTop: {\n borderTopEndRadius: radii.xs,\n },\n }),\n)\n\n// The field's own blur handling, then the call site's.\nfunction blurThen(\n onBlur: () => void,\n then: ((event: BlurEvent) => void) | undefined,\n) {\n return (event: BlurEvent) => {\n onBlur()\n then?.(event)\n }\n}\n\n// Reads the text as the field's value, then hands the event on.\nfunction commitBefore<Event>(\n state: NumberFieldState,\n handler: ((event: Event) => void) | undefined,\n) {\n return (event: Event) => {\n state.commit()\n handler?.(event)\n }\n}\n\n// The text typed, kept only where it could still become a number, and\n// reported to the field's validation as an edit.\nfunction editInto(state: NumberFieldState, onEdit: () => void) {\n return (text: string) => {\n if (state.validate(text)) {\n state.setInputValue(text)\n onEdit()\n }\n }\n}\n\nfunction glyphOf(color: string): IconStyle {\n return { color, size: GLYPH_SIZE }\n}\n\n// A stacked stepper's half of the box: the box's padding above and below\n// and the lines it holds, at the device's text size, halved.\nfunction halfOf(\n { spacing, typography }: ResolvedTheme,\n outlined: boolean,\n fontScale: number,\n) {\n return outlined\n ? spacing.lg + (typography.bodyLargeLineHeight * fontScale) / 2\n : spacing.sm +\n ((typography.bodySmallLineHeight + typography.bodyLargeLineHeight) *\n fontScale) /\n 2\n}\n\n// The keyboard that types what the field takes. React Aria's own choice of\n// input mode, in React Native's keyboards.\nfunction keyboardOf(\n minValue: number | undefined,\n hasDecimals: boolean,\n): KeyboardTypeOptions {\n const hasNegative =\n minValue === undefined || Number.isNaN(minValue) || minValue < 0\n\n if (hasNegative) {\n return Platform.OS === 'ios' ? 'numbers-and-punctuation' : 'numeric'\n }\n\n return hasDecimals ? 'decimal-pad' : 'number-pad'\n}\n\n// The locale the field writes in: the one given, where the runtime takes it\n// as a locale at all, or the device's.\nfunction localeOf(locale: string | undefined) {\n if (locale !== undefined) {\n try {\n Intl.NumberFormat.supportedLocalesOf(locale)\n return locale\n } catch {\n // A malformed tag, which falls back to the device's.\n }\n }\n\n deviceLocale ??= new Intl.NumberFormat().resolvedOptions().locale\n return deviceLocale\n}\n\n// The margin that gives a side-by-side stepper the value's line in the\n// box's height: half the difference between the two, negative where the\n// button is taller.\nfunction marginVerticalOf(margin: number): ViewStyle {\n return { marginVertical: margin }\n}\n\n/**\n * A labelled number input with steppers, the text fields page's filled or\n * outlined field. Pass `value` with `onChange` to control it, or\n * `defaultValue` to let it keep its own; `onChange` is handed the committed\n * number, `NaN` for an empty field. `minValue`, `maxValue` and `step` shape\n * it, and `formatOptions` says how it reads, in `locale`: a currency, a\n * percentage, a unit.\n *\n * React Native's own `TextInput` props, the return key among them, reach the\n * control; `style` and `ref` are the field as a whole, and `inputRef` the\n * control.\n *\n * ```tsx\n * <NumberField defaultValue={1234.5} label=\"Label\" />\n * ```\n */\nfunction NumberField({\n decrementLabel,\n defaultValue,\n description,\n error,\n floatingLabel = true,\n formatOptions,\n incrementLabel,\n inputRef,\n isDisabled = false,\n isReadOnly = false,\n isRequired = false,\n label,\n locale,\n maxValue,\n minValue,\n name,\n numeric = true,\n onBlur,\n onChange,\n onFocus,\n onSubmitEditing,\n ref,\n returnKeyType = 'done',\n step,\n steppers = 'vertical',\n style,\n validate,\n value,\n variant = 'filled',\n ...props\n}: NumberFieldProps) {\n const id = useId()\n const control = useRef<TextInput>(null)\n const writtenIn = localeOf(locale)\n const state = useNumberFieldState({\n defaultValue,\n formatOptions,\n isDisabled,\n isReadOnly,\n locale: writtenIn,\n maxValue,\n minValue,\n onChange,\n step,\n value,\n })\n const empty = Number.isNaN(state.numberValue)\n const validation = useFieldValidation({\n control,\n error,\n isDisabled,\n isEmpty: empty,\n isReadOnly,\n isRequired,\n name,\n submitted: empty ? '' : String(state.numberValue),\n validate,\n value: state.numberValue,\n })\n const shownError = validation.error\n const focus = useFieldFocus({\n onBlur: commitBefore<BlurEvent>(state, blurThen(validation.onBlur, onBlur)),\n onFocus,\n })\n const hasDecimals =\n (new NumberFormatter(writtenIn, formatOptions).resolvedOptions()\n .maximumFractionDigits ?? 0) > 0\n const announced = useStepAnnouncement(state.inputValue)\n // The box is focused while focus is anywhere in it, a stepper's included,\n // as web's is through `:focus-within`.\n const [stepperFocused, setStepperFocused] = useState(false)\n\n useImperativeHandle<null | TextInput, null | TextInput>(\n inputRef,\n () => control.current,\n [],\n )\n\n return (\n <View ref={ref} style={style}>\n <FieldBox\n control={control}\n end={steppersOf({\n canDecrement: state.canDecrement,\n canIncrement: state.canIncrement,\n decrementLabel: decrementLabel ?? `Decrease ${label}`,\n incrementLabel: incrementLabel ?? `Increase ${label}`,\n inline: steppers === 'horizontal',\n onBlur: () => {\n setStepperFocused(false)\n },\n onDecrement: announced(stepThen(state.decrement, validation.onEdit)),\n onFocus: () => {\n setStepperFocused(true)\n },\n onIncrement: announced(stepThen(state.increment, validation.onEdit)),\n outlined: variant === 'outlined',\n })}\n floatingLabel={floatingLabel}\n isDisabled={isDisabled}\n isFocused={focus.focused || stepperFocused}\n isInvalid={shownError !== undefined}\n isPopulated={state.inputValue !== ''}\n isRequired={isRequired}\n label={label}\n variant={variant}\n >\n <FieldInput\n {...props}\n {...focus.handlers}\n aria-label={label}\n autoComplete=\"off\"\n autoCorrect={false}\n described={describedBy(id, { description, error: shownError })}\n editable={!isDisabled && !isReadOnly}\n keyboardType={keyboardOf(minValue, hasDecimals)}\n numeric={numeric}\n onChangeText={editInto(state, validation.onEdit)}\n onSubmitEditing={commitBefore<TextInputSubmitEditingEvent>(\n state,\n onSubmitEditing,\n )}\n ref={control}\n returnKeyType={returnKeyType}\n spellCheck={false}\n value={state.inputValue}\n />\n </FieldBox>\n <FieldMessage description={description} error={shownError} id={id} />\n </View>\n )\n}\n\n// The 48dp target a stacked stepper reaches to, all of its height on the\n// side away from the other stepper, and its width either side.\nfunction outwardSlop(\n half: number,\n place: 'bottom' | 'top',\n): Insets | undefined {\n const slop = hitSlop(half, STEPPER_WIDTH)\n if (slop === undefined) {\n return undefined\n }\n\n const reach = (slop.top ?? 0) + (slop.bottom ?? 0)\n return place === 'top'\n ? { ...slop, bottom: 0, top: reach }\n : { ...slop, bottom: reach, top: 0 }\n}\n\n/**\n * One of the stacked pair: half the column, the glyph in on surface\n * variant, and the state layer, the ripple and the ring every control\n * draws, the ring inside it. Disabled at the end of the range, where the\n * glyph takes on surface at the disabled opacity.\n */\nfunction Stepper({\n 'aria-label': ariaLabel,\n children,\n half,\n isDisabled,\n onBlur,\n onFocus,\n onPress,\n onPressIn,\n onPressOut,\n outlined,\n place,\n}: StepperProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { colors, stateLayerOpacity } = theme\n const corner =\n place === 'top'\n ? styles.stepperTop\n : outlined\n ? styles.stepperBottomOutlined\n : undefined\n const feedback = usePressFeedback({\n color: colors.onSurfaceVariant,\n corners: corner,\n disabled: isDisabled,\n onBlur,\n onFocus,\n onPressIn,\n onPressOut,\n })\n\n return (\n <Pressable\n {...feedback.handlers}\n aria-label={ariaLabel}\n disabled={isDisabled}\n hitSlop={outwardSlop(half, place)}\n onPress={onPress}\n role=\"button\"\n style={composeStyles<ViewStyle>(\n styles.stepper,\n corner,\n feedback.ring,\n feedback.ring === undefined ? undefined : styles.stepperRing,\n )}\n >\n {feedback.layer}\n <IconStyleContext\n value={glyphOf(\n isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurfaceVariant,\n )}\n >\n {children}\n </IconStyleContext>\n </Pressable>\n )\n}\n\n/**\n * The two steppers at the box's end, stacked or side by side, each\n * disabled where it would not move the value.\n */\nfunction Steppers({\n canDecrement,\n canIncrement,\n decrementLabel,\n incrementLabel,\n inline,\n onBlur,\n onDecrement,\n onFocus,\n onIncrement,\n outlined,\n}: SteppersProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const { sizing, typography } = theme\n const up = useSpin(onIncrement, canIncrement)\n const down = useSpin(onDecrement, canDecrement)\n\n if (inline) {\n return (\n <View\n style={composeStyles<ViewStyle>(\n styles.steppersInline,\n marginVerticalOf(\n (typography.bodyLargeLineHeight * fontScale - sizing.controlXs) / 2,\n ),\n )}\n >\n <IconButton\n {...down}\n aria-label={decrementLabel}\n isDisabled={!canDecrement}\n onBlur={onBlur}\n onFocus={onFocus}\n size=\"xs\"\n >\n <MinusGlyph />\n </IconButton>\n <IconButton\n {...up}\n aria-label={incrementLabel}\n isDisabled={!canIncrement}\n onBlur={onBlur}\n onFocus={onFocus}\n size=\"xs\"\n >\n <PlusGlyph />\n </IconButton>\n </View>\n )\n }\n\n const half = halfOf(theme, outlined, fontScale)\n\n return (\n <View\n style={composeStyles<ViewStyle>(\n styles.steppers,\n outlined ? styles.steppersOutlined : undefined,\n )}\n >\n <Stepper\n {...up}\n aria-label={incrementLabel}\n half={half}\n isDisabled={!canIncrement}\n onBlur={onBlur}\n onFocus={onFocus}\n outlined={outlined}\n place=\"top\"\n >\n <PlusGlyph />\n </Stepper>\n <Stepper\n {...down}\n aria-label={decrementLabel}\n half={half}\n isDisabled={!canDecrement}\n onBlur={onBlur}\n onFocus={onFocus}\n outlined={outlined}\n place=\"bottom\"\n >\n <MinusGlyph />\n </Stepper>\n </View>\n )\n}\n\n// The steppers as the box's end, built by a call rather than written at the\n// prop, which is what react-perf's no-jsx-as-prop is after.\nfunction steppersOf(props: SteppersProps) {\n return <Steppers {...props} />\n}\n\n/**\n * A stepper's press handlers: a tap steps once, when it is released, and a\n * hold keeps stepping, from `SPIN_DELAY` on and every `SPIN_INTERVAL` after,\n * until the press ends or the value reaches its bound. A hold steps nothing\n * more on release, and a press the finger slides off steps nothing at all,\n * as React Aria's stepper does for a touch.\n */\n// A stepper's step, reported to the field's validation as an edit.\nfunction stepThen(step: () => void, onEdit: () => void) {\n return () => {\n step()\n onEdit()\n }\n}\n\nfunction useSpin(step: () => void, canStep: boolean): Spin {\n // The step and whether it can move, as of the last render, since a hold\n // steps from timers that outlive the render that started them.\n const latest = useRef({ canStep, step })\n const timer = useRef<ReturnType<typeof setTimeout>>(undefined)\n const spun = useRef(false)\n\n useEffect(() => {\n latest.current = { canStep, step }\n })\n useEffect(\n () => () => {\n clearTimeout(timer.current)\n },\n [],\n )\n\n const tick = () => {\n if (!latest.current.canStep) {\n return\n }\n spun.current = true\n latest.current.step()\n timer.current = setTimeout(tick, SPIN_INTERVAL)\n }\n\n return {\n onPress: () => {\n if (!spun.current) {\n latest.current.step()\n }\n },\n onPressIn: () => {\n clearTimeout(timer.current)\n spun.current = false\n timer.current = setTimeout(tick, SPIN_DELAY)\n },\n onPressOut: () => {\n clearTimeout(timer.current)\n },\n }\n}\n\n/**\n * Says the field's text after a stepper press, once the field has written\n * it, on iOS and Android, where the screen reader stays on the stepper.\n * Wrap each step in what it returns.\n */\nfunction useStepAnnouncement(text: string) {\n const pending = useRef(false)\n\n useEffect(() => {\n if (pending.current) {\n pending.current = false\n AccessibilityInfo.announceForAccessibility(text)\n }\n }, [text])\n\n return (step: () => void) => () => {\n pending.current = Platform.OS === 'ios' || Platform.OS === 'android'\n step()\n }\n}\n\nexport { NumberField }\nexport type { NumberFieldProps }\n"],"mappings":";;;;;;;;;;;;;;;;AAkRA,MAAM0F,gBAAgB;AACtB,MAAMC,aAAa;AAKnB,MAAMC,aAAa;AACnB,MAAMC,gBAAgB;AAEtB,IAAIC;AAEJ,MAAMC,WAAWrD,cAAc,EAAEsD,OAAOC,cACtC9E,WAAW+E,OAAO;CAEhBC,SAAS;EACPC,YAAY;EACZC,WAAW;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B,EAAA,KAAAzB;EAAAyB,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAA;EAAAL,KAAAC,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CALTnJ,UAAUkJ,IAKPK,EAAM;CAAC,IAAAC;CAAA,IAAAL,EAAA,OAAAqC,OAAAC,IAAA,2BAAA,GAAA;EAEHjC,MAAA/F,eAAsB;GAC3B4L,QAAO3D,UAAWpL,SAAQoI,OAAQ,SAASpI,SAAQoI,OAAQ;GAC3DjF,KAAK;EAAC;EACP0F,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAHMK;AAGN"}
@@ -0,0 +1,70 @@
1
+ import { MarkImageProps } from "../../mark/index.js";
2
+ import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
+ import { Ref } from "react";
4
+ //#region src/components/product-icon/index.d.ts
5
+ type ProductIconProps = Omit<ViewProps, 'children' | 'style'> & {
6
+ /**
7
+ * Hides the mark from screen readers, for one beside the name of what it
8
+ * identifies, where it would otherwise announce the name a second time.
9
+ * `name` still supplies the initial, and is not announced.
10
+ * @default false
11
+ */
12
+ readonly decorative?: boolean;
13
+ /**
14
+ * Props for the mark's own `Image`: `crossOrigin` and `referrerPolicy` for
15
+ * where it is served from, and `resizeMethod`, `fadeDuration` and
16
+ * `progressiveRenderingEnabled` for how Android decodes and shows it.
17
+ */
18
+ readonly imgProps?: MarkImageProps;
19
+ /**
20
+ * What this identifies. Supplies both the fallback initial and the
21
+ * accessible name, so a screen reader announces the thing rather than
22
+ * reading a letter aloud. The initial is the name's first letter, number or
23
+ * emoji, passing over punctuation it opens with: a handle's at sign, a
24
+ * channel's hash or a bracket.
25
+ */
26
+ readonly name: string;
27
+ readonly ref?: Ref<View>;
28
+ /**
29
+ * Edge length: `sm` 36dp, `md` 40dp, `lg` 56dp. The same three Avatar
30
+ * uses, so the two are interchangeable wherever one leads a row or a card.
31
+ * @default 'md'
32
+ */
33
+ readonly size?: 'lg' | 'md' | 'sm';
34
+ /**
35
+ * The mark to show in place of the initial. The initial stays until it has
36
+ * loaded, and comes back if it fails.
37
+ */
38
+ readonly src?: string;
39
+ readonly style?: StyleProp<ViewStyle>;
40
+ /**
41
+ * Which container and on-container colour pair to tint the fallback with.
42
+ * It is the fallback's own background, so it is gone once `src` has loaded
43
+ * rather than sitting behind the mark.
44
+ * @default 'primary'
45
+ */
46
+ readonly tone?: 'negative' | 'positive' | 'primary' | 'secondary' | 'tertiary';
47
+ };
48
+ /**
49
+ * A small square mark identifying something that is not a person, such as
50
+ * an application, a service or a brand. Reach for Avatar when it is a
51
+ * person.
52
+ *
53
+ * ```tsx
54
+ * <ProductIcon name="First item" src={logo} />
55
+ * ```
56
+ *
57
+ * The mark is letterboxed rather than cropped, so a logo of any aspect ratio
58
+ * can be handed over as it was drawn.
59
+ *
60
+ * It is announced as an image named by `name`. When the thing's name is
61
+ * already written next to the mark, mark it `decorative`, so a screen reader
62
+ * reads the name once.
63
+ *
64
+ * The initial is taken in the device's locale. `style`, `ref` and `testID`
65
+ * land on the square.
66
+ */
67
+ declare function ProductIcon({ size, tone, ...props }: ProductIconProps): import("react").JSX.Element;
68
+ //#endregion
69
+ export { ProductIcon, type ProductIconProps };
70
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,60 @@
1
+ import { Mark } from "../../mark/index.js";
2
+ import { c } from "react/compiler-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/product-icon/index.tsx
5
+ /**
6
+ * A small square mark identifying something that is not a person, such as
7
+ * an application, a service or a brand. Reach for Avatar when it is a
8
+ * person.
9
+ *
10
+ * ```tsx
11
+ * <ProductIcon name="First item" src={logo} />
12
+ * ```
13
+ *
14
+ * The mark is letterboxed rather than cropped, so a logo of any aspect ratio
15
+ * can be handed over as it was drawn.
16
+ *
17
+ * It is announced as an image named by `name`. When the thing's name is
18
+ * already written next to the mark, mark it `decorative`, so a screen reader
19
+ * reads the name once.
20
+ *
21
+ * The initial is taken in the device's locale. `style`, `ref` and `testID`
22
+ * land on the square.
23
+ */
24
+ function ProductIcon(t0) {
25
+ const $ = c(8);
26
+ let props;
27
+ let t1;
28
+ let t2;
29
+ if ($[0] !== t0) {
30
+ ({size: t1, tone: t2, ...props} = t0);
31
+ $[0] = t0;
32
+ $[1] = props;
33
+ $[2] = t1;
34
+ $[3] = t2;
35
+ } else {
36
+ props = $[1];
37
+ t1 = $[2];
38
+ t2 = $[3];
39
+ }
40
+ const size = t1 === void 0 ? "md" : t1;
41
+ const tone = t2 === void 0 ? "primary" : t2;
42
+ let t3;
43
+ if ($[4] !== props || $[5] !== size || $[6] !== tone) {
44
+ t3 = /* @__PURE__ */ jsx(Mark, {
45
+ ...props,
46
+ kind: "thing",
47
+ size,
48
+ tone
49
+ });
50
+ $[4] = props;
51
+ $[5] = size;
52
+ $[6] = tone;
53
+ $[7] = t3;
54
+ } else t3 = $[7];
55
+ return t3;
56
+ }
57
+ //#endregion
58
+ export { ProductIcon };
59
+
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Ref","StyleProp","View","ViewProps","ViewStyle","MarkImageProps","Mark","ProductIconProps","Omit","decorative","imgProps","name","ref","size","src","style","tone","ProductIcon","t0","$","_c","props","t1","t2","undefined","t3","_c"],"sources":["../../../src/components/product-icon/index.tsx"],"sourcesContent":["import type { Ref } from 'react'\nimport type { StyleProp, View, ViewProps, ViewStyle } from 'react-native'\n\nimport type { MarkImageProps } from '../../mark'\n\nimport { Mark } from '../../mark'\n\n// The counterpart to Avatar: Avatar stands for a person, this stands for\n// everything else, such as an application, a service or a brand. It is drawn\n// as a rounded square with the mark letterboxed, and its tone tints the\n// fallback rather than the square. The header of `src/mark/styles.ts` says\n// why on all three counts.\n//\n// The box, the sizes, the tones, the mark's loading and the labelling are\n// the mark's in `src/mark`, which Avatar draws a person through as well. No\n// Material Design page draws a product mark, so its sizes are Avatar's, 36,\n// 40 and 56, which is what lets a mark and a person fill the same slot, and\n// its corner is the small one from the radius scale, as web's is.\n\ntype ProductIconProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * Hides the mark from screen readers, for one beside the name of what it\n * identifies, where it would otherwise announce the name a second time.\n * `name` still supplies the initial, and is not announced.\n * @default false\n */\n readonly decorative?: boolean\n /**\n * Props for the mark's own `Image`: `crossOrigin` and `referrerPolicy` for\n * where it is served from, and `resizeMethod`, `fadeDuration` and\n * `progressiveRenderingEnabled` for how Android decodes and shows it.\n */\n readonly imgProps?: MarkImageProps\n /**\n * What this identifies. Supplies both the fallback initial and the\n * accessible name, so a screen reader announces the thing rather than\n * reading a letter aloud. The initial is the name's first letter, number or\n * emoji, passing over punctuation it opens with: a handle's at sign, a\n * channel's hash or a bracket.\n */\n readonly name: string\n readonly ref?: Ref<View>\n /**\n * Edge length: `sm` 36dp, `md` 40dp, `lg` 56dp. The same three Avatar\n * uses, so the two are interchangeable wherever one leads a row or a card.\n * @default 'md'\n */\n readonly size?: 'lg' | 'md' | 'sm'\n /**\n * The mark to show in place of the initial. The initial stays until it has\n * loaded, and comes back if it fails.\n */\n readonly src?: string\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which container and on-container colour pair to tint the fallback with.\n * It is the fallback's own background, so it is gone once `src` has loaded\n * rather than sitting behind the mark.\n * @default 'primary'\n */\n readonly tone?: 'negative' | 'positive' | 'primary' | 'secondary' | 'tertiary'\n}\n\n/**\n * A small square mark identifying something that is not a person, such as\n * an application, a service or a brand. Reach for Avatar when it is a\n * person.\n *\n * ```tsx\n * <ProductIcon name=\"First item\" src={logo} />\n * ```\n *\n * The mark is letterboxed rather than cropped, so a logo of any aspect ratio\n * can be handed over as it was drawn.\n *\n * It is announced as an image named by `name`. When the thing's name is\n * already written next to the mark, mark it `decorative`, so a screen reader\n * reads the name once.\n *\n * The initial is taken in the device's locale. `style`, `ref` and `testID`\n * land on the square.\n */\nfunction ProductIcon({\n size = 'md',\n tone = 'primary',\n ...props\n}: ProductIconProps) {\n return <Mark {...props} kind=\"thing\" size={size} tone={tone} />\n}\n\nexport type { ProductIconProps }\n\nexport { ProductIcon }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkFA,SAAAiB,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAL,MAAAS,IAAAN,MAAAO,IAAA,GAAAF,SAAAH;EAIFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAF,QAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAHjB,MAAAN,OAAAS,OAAAE,KAAAA,IAAA,OAAAF;CACA,MAAAN,OAAAO,OAAAC,KAAAA,IAAA,YAAAD;CAAgB,IAAAE;CAAA,IAAAN,EAAA,OAAAE,SAAAF,EAAA,OAAAN,QAAAM,EAAA,OAAAH,MAAA;EAGTS,KAAA,oBAAC,MAAD;GAAK,GAAKJ;GAAY,MAAA;GAAcR;GAAYG;EAAI,CAAA;EAAIG,EAAA,KAAAE;EAAAF,EAAA,KAAAN;EAAAM,EAAA,KAAAH;EAAAG,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAAxDM;AAAwD"}
@@ -0,0 +1,105 @@
1
+ import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
2
+ import { ReactNode, Ref } from "react";
3
+ //#region src/components/radio-group/index.d.ts
4
+ /** Which way a `RadioGroup` lays out its buttons. */
5
+ type RadioGroupOrientation = 'horizontal' | 'vertical';
6
+ type RadioGroupProps = Omit<ViewProps, 'children' | 'style'> & {
7
+ /** The radio buttons, each with a `value` of its own. */
8
+ readonly children?: ReactNode;
9
+ /** The value selected at first, when the group keeps its own state. */
10
+ readonly defaultValue?: null | string;
11
+ /**
12
+ * A hint under the group. Replaced by `error` when there is one, so the
13
+ * two never stack.
14
+ */
15
+ readonly description?: string;
16
+ /**
17
+ * The problem with the current selection, in words. Its presence is what
18
+ * puts the group in its error state: the message and the label's colour
19
+ * both follow from it.
20
+ */
21
+ readonly error?: string;
22
+ /**
23
+ * Draws every button disabled, and takes no presses.
24
+ * @default false
25
+ */
26
+ readonly isDisabled?: boolean;
27
+ /**
28
+ * Shows the selection without letting a press change it.
29
+ * @default false
30
+ */
31
+ readonly isReadOnly?: boolean;
32
+ /**
33
+ * What the group is for. Required rather than optional: a set of radio
34
+ * buttons with no name is a set a screen reader cannot introduce.
35
+ */
36
+ readonly label: string;
37
+ /** Called with the newly selected value whenever a press changes it. */
38
+ readonly onChange?: (value: string) => void;
39
+ /**
40
+ * Lays the buttons one under another, or along a line that wraps.
41
+ * @default 'vertical'
42
+ */
43
+ readonly orientation?: RadioGroupOrientation;
44
+ readonly ref?: Ref<View>;
45
+ readonly style?: StyleProp<ViewStyle>;
46
+ /**
47
+ * The selected value, for a call site holding the state itself with
48
+ * `onChange`. `null` selects nothing.
49
+ */
50
+ readonly value?: null | string;
51
+ };
52
+ type RadioProps = Omit<ViewProps, 'children' | 'style'> & {
53
+ /**
54
+ * The label, beside the button. A button that a row labels some other way
55
+ * leaves it out and passes `aria-label` instead.
56
+ */
57
+ readonly children?: ReactNode;
58
+ /** A hint under the label, read with the button. */
59
+ readonly description?: string;
60
+ /**
61
+ * Draws this button disabled, and takes no presses on it.
62
+ * @default false
63
+ */
64
+ readonly isDisabled?: boolean;
65
+ readonly ref?: Ref<View>;
66
+ readonly style?: StyleProp<ViewStyle>;
67
+ /** The entry this button stands for, which the group reports when chosen. */
68
+ readonly value: string;
69
+ };
70
+ /**
71
+ * One option of a `RadioGroup`, with its label and optionally a description
72
+ * under it. It names the entry it stands for with `value`; the selection is
73
+ * the group's, so a `Radio` is only ever drawn inside one.
74
+ *
75
+ * A screen reader hears it as a radio button named by its label, checked or
76
+ * not, followed by the line under it. A press anywhere on the button or the
77
+ * label selects it, and the row takes presses over the 48dp target the page
78
+ * asks of the button. `style`, `ref` and `testID` land on the view holding
79
+ * the row and the line under it, which is the element a layout positions.
80
+ */
81
+ declare function Radio({ 'aria-label': ariaLabel, children, description, isDisabled: ownDisabled, style, value, ...props }: RadioProps): import("react").JSX.Element;
82
+ /**
83
+ * A labelled set of radio buttons with one selected value between them. The
84
+ * value is React Stately's, as web's is: pass `value` with `onChange` to
85
+ * control it, or `defaultValue` to let the group keep its own, and each
86
+ * `Radio` inside names the entry it stands for. Disabled, read-only and the
87
+ * error state reach every button from here, and `orientation="horizontal"`
88
+ * lays the buttons along a line.
89
+ *
90
+ * ```tsx
91
+ * <RadioGroup defaultValue="first" label="Label">
92
+ * <Radio value="first">First item</Radio>
93
+ * <Radio value="second">Second item</Radio>
94
+ * </RadioGroup>
95
+ * ```
96
+ *
97
+ * A screen reader hears it as a radio group named by its label. On the web
98
+ * the line under it describes the group, as web's does; on iOS and Android
99
+ * it is read after the buttons, where it sits. `style`, `ref` and `testID`
100
+ * land on the group as a whole, which is the element a layout positions.
101
+ */
102
+ declare function RadioGroup({ children, defaultValue, description, error, isDisabled, isReadOnly, label, onChange, orientation, style, value, ...props }: RadioGroupProps): import("react").JSX.Element;
103
+ //#endregion
104
+ export { Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps };
105
+ //# sourceMappingURL=index.d.ts.map