@kanso-labs/react-native-kanso-ui 0.2.0 → 0.3.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 (60) hide show
  1. package/dist/button/index.d.ts +8 -0
  2. package/dist/button/index.js +38 -26
  3. package/dist/button/index.js.map +1 -1
  4. package/dist/button/slots.js +7 -0
  5. package/dist/button/slots.js.map +1 -0
  6. package/dist/components/avatar/index.d.ts +2 -2
  7. package/dist/components/avatar/index.js.map +1 -1
  8. package/dist/components/button/index.d.ts +3 -3
  9. package/dist/components/button/index.js +115 -109
  10. package/dist/components/button/index.js.map +1 -1
  11. package/dist/components/card/index.d.ts +2 -2
  12. package/dist/components/card/index.js.map +1 -1
  13. package/dist/components/checkbox/index.d.ts +2 -2
  14. package/dist/components/checkbox/index.js.map +1 -1
  15. package/dist/components/chip/index.d.ts +2 -2
  16. package/dist/components/chip/index.js.map +1 -1
  17. package/dist/components/chip-group/index.d.ts +3 -3
  18. package/dist/components/chip-group/index.js.map +1 -1
  19. package/dist/components/copy-field/index.d.ts +2 -2
  20. package/dist/components/copy-field/index.js.map +1 -1
  21. package/dist/components/dialog/index.d.ts +131 -0
  22. package/dist/components/dialog/index.js +861 -0
  23. package/dist/components/dialog/index.js.map +1 -0
  24. package/dist/components/icon-button/index.d.ts +3 -3
  25. package/dist/components/icon-button/index.js +128 -122
  26. package/dist/components/icon-button/index.js.map +1 -1
  27. package/dist/components/link/index.js +1 -1
  28. package/dist/components/link/index.js.map +1 -1
  29. package/dist/components/meter/index.d.ts +2 -2
  30. package/dist/components/meter/index.js.map +1 -1
  31. package/dist/components/number-field/index.d.ts +3 -3
  32. package/dist/components/number-field/index.js.map +1 -1
  33. package/dist/components/product-icon/index.d.ts +2 -2
  34. package/dist/components/product-icon/index.js.map +1 -1
  35. package/dist/components/progress-indicator/index.d.ts +2 -2
  36. package/dist/components/progress-indicator/index.js.map +1 -1
  37. package/dist/components/radio-group/index.d.ts +3 -3
  38. package/dist/components/radio-group/index.js.map +1 -1
  39. package/dist/components/search-field/index.d.ts +3 -3
  40. package/dist/components/search-field/index.js.map +1 -1
  41. package/dist/components/segmented-button/index.d.ts +3 -3
  42. package/dist/components/segmented-button/index.js.map +1 -1
  43. package/dist/components/snackbar/index.d.ts +2 -2
  44. package/dist/components/snackbar/index.js.map +1 -1
  45. package/dist/components/switch/index.d.ts +2 -2
  46. package/dist/components/switch/index.js.map +1 -1
  47. package/dist/components/text-field/index.d.ts +3 -3
  48. package/dist/components/text-field/index.js.map +1 -1
  49. package/dist/field/index.d.ts +1 -1
  50. package/dist/field/index.js.map +1 -1
  51. package/dist/form/index.d.ts +1 -1
  52. package/dist/form/index.js.map +1 -1
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.js +3 -2
  55. package/dist/mark/index.d.ts +1 -1
  56. package/dist/mark/index.js.map +1 -1
  57. package/dist/overlay/host.js.map +1 -1
  58. package/dist/press/index.js +59 -60
  59. package/dist/press/index.js.map +1 -1
  60. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","Ref","TextProps","NativeTextProps","TextStyle","useState","Text","NativeText","Platform","StyleSheet","stylesOf","ringStylesOf","useLinkPress","withOpacity","useTheme","composeStyles","themedStyles","LinkProps","Omit","href","isDisabled","ref","tone","LinkTone","underline","LinkUnderline","WebProps","focusable","onBlur","onFocus","event","currentTarget","matches","selector","onKeyDown","click","key","repeat","onPointerEnter","pointerType","onPointerLeave","underlines","create","always","textDecorationLine","hover","none","colors","radii","stateLayerOpacity","disabledContent","onSurface","base","borderRadius","xs","disabled","color","textDecorationColor","hovered","primary","inherit","outline","Link","t0","$","_c","onPress","props","style","t1","t2","t3","t4","suppressHighlighting","undefined","theme","press","hoveredState","setHovered","ringShown","setRingShown","T0","t10","t5","t6","t7","t8","t9","styles","pressable","t11","OS","webPropsOf","web","ring","shown","_c","NativeText","ringStylesOf"],"sources":["../../../src/components/link/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { TextProps as NativeTextProps, TextStyle } from 'react-native'\n\nimport { useState } from 'react'\nimport { Text as NativeText, Platform, StyleSheet } from 'react-native'\n\nimport { stylesOf as ringStylesOf } from '../../press/styles'\nimport { useLinkPress } from '../../router'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// No Material Design page draws an inline link, so this takes web's reading:\n// the text button's label, the primary role on no container, with the\n// disabled treatment every page gives content, and a rule under it to say it\n// can be followed. That rule is 70% of the primary role, or the outline role\n// under `inherit`, and turns fully primary under a pointer. 70% is web's\n// figure, the least that keeps the rule at 3:1 against the surface in every\n// scheme the library is shown in.\n//\n// It is a nested Text, so it sets no type of its own and takes the size and\n// face of the sentence around it, as web's takes them from its paragraph. A\n// nested Text has no frame of its own, so it takes no `hitSlop` either.\n//\n// Where it departs from web, the platform is the reason:\n//\n// - The disabled colour is on-surface at the `disabledContent` opacity,\n// translucent over whatever the sentence sits on. Web mixes the two over\n// the surface role, and React Native has no `color-mix()`.\n// - Android draws the rule in the text's own colour, since it has no\n// `textDecorationColor`, and every platform draws it at its own thickness\n// and offset, which React Native has no properties for.\n// - Hover, the focus ring and the Enter key are the web's alone: a phone has\n// no pointer to hover with and focuses no span inside a sentence, so on\n// native `hover` draws no rule at all. The colour changes at once rather\n// than over a transition.\n// - iOS's own pressed highlight is off, since web's link draws no pressed\n// state; `suppressHighlighting={false}` turns it back on.\n\ntype LinkProps = Omit<NativeTextProps, 'disabled'> & {\n /**\n * Where the link leads. A press opens it through the `RouterProvider`\n * around the link, or through the platform for a URL with a scheme of its\n * own, after the call site's own `onPress`.\n */\n readonly href?: string\n /**\n * Fades the link to the disabled content colour, and takes no press. It is\n * still announced as a link, a disabled one.\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof NativeText>>\n /**\n * Which colour role to render in. `primary` marks the link out from the\n * text around it; `inherit` takes the colour of the Text around it and\n * leans on the underline alone, for a link in a place already understood\n * to be links, such as a footer.\n * @default 'primary'\n */\n readonly tone?: LinkTone\n /**\n * When to draw the rule. Leave it at `always` in prose: without it, colour\n * is the only thing separating the link from the sentence, which some\n * readers cannot see. `hover` and `none` are for links whose position\n * already announces them, such as a row of footer links. A phone has no\n * pointer, so `hover` draws no rule there.\n * @default 'always'\n */\n readonly underline?: LinkUnderline\n}\n\ntype LinkTone = 'inherit' | 'primary'\n\ntype LinkUnderline = 'always' | 'hover' | 'none'\n\n// What React Native Web hands a link's span, which React Native's own Text\n// declares none of: the browser's pointer, focus and key events, each typed\n// by the fields the link reads, and whether the span takes the Tab key.\ntype WebProps = {\n readonly focusable: boolean\n readonly onBlur: () => void\n readonly onFocus: (event: {\n readonly currentTarget: { readonly matches: (selector: string) => boolean }\n }) => void\n readonly onKeyDown: (event: {\n readonly currentTarget: { readonly click: () => void }\n readonly key: string\n readonly repeat: boolean\n }) => void\n readonly onPointerEnter: (event: { readonly pointerType: string }) => void\n readonly onPointerLeave: () => void\n}\n\n// React Native's underline is off unless a style turns it on, and a nested\n// Text inherits its sentence's, so `hover` and `none` say `none` outright, as\n// web's do over an anchor's own underline.\nconst underlines = StyleSheet.create({\n always: { textDecorationLine: 'underline' },\n hover: { textDecorationLine: 'none' },\n none: { textDecorationLine: 'none' },\n})\n\nconst stylesOf = themedStyles(({ colors, radii, stateLayerOpacity }) => {\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n return StyleSheet.create({\n // The ring's corner on web, where an outline follows it. A nested Text\n // draws no frame on native, so there it draws nothing.\n base: {\n borderRadius: radii.xs,\n },\n disabled: {\n color: disabledContent,\n textDecorationColor: disabledContent,\n },\n // Under a pointer, either tone turns its text and its rule fully primary.\n hovered: {\n color: colors.primary,\n textDecorationColor: colors.primary,\n },\n // No colour, so the Text around it lends its own.\n inherit: {\n textDecorationColor: colors.outline,\n },\n primary: {\n color: colors.primary,\n textDecorationColor: withOpacity(colors.primary, 0.7),\n },\n })\n})\n\n/**\n * A run of text that leads somewhere, inside the sentence it belongs to.\n *\n * ```tsx\n * <Text variant=\"bodyLarge\">\n * Supporting copy with <Link href=\"/first\">a link inside it</Link>.\n * </Text>\n * ```\n *\n * It is React Native's Text with the link role, nested in the library's\n * Text, so it flows and wraps with the words around it and takes their type.\n * Given no Text around it, it draws in the platform's default face rather\n * than the theme's, so a link standing on its own, such as one of a row of\n * footer links, is a Text holding one link.\n *\n * `onPress` fires for a tap, a click and the Enter key alike, then `href` is\n * followed, through the `RouterProvider` around the link or the platform.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction Link({\n href,\n isDisabled = false,\n onPress,\n style,\n suppressHighlighting = true,\n tone = 'primary',\n underline = 'always',\n ...props\n}: LinkProps) {\n const theme = useTheme()\n const press = useLinkPress(href, onPress)\n const [hoveredState, setHovered] = useState(false)\n const [ringShown, setRingShown] = useState(false)\n\n const styles = stylesOf(theme)\n const hovered = !isDisabled && hoveredState\n const pressable = !isDisabled && (href !== undefined || onPress != null)\n const web =\n Platform.OS === 'web'\n ? webPropsOf(isDisabled, setHovered, setRingShown)\n : undefined\n\n return (\n <NativeText\n {...props}\n {...web}\n aria-disabled={isDisabled}\n onPress={pressable ? press : undefined}\n role=\"link\"\n style={composeStyles<TextStyle>(\n styles.base,\n styles[tone],\n underlines[underline],\n hovered && styles.hovered,\n hovered && underline === 'hover' && underlines.always,\n isDisabled && styles.disabled,\n !isDisabled && ringShown && ringStylesOf(theme).ring,\n style,\n )}\n suppressHighlighting={suppressHighlighting}\n />\n )\n}\n\n// The browser's events, read into the link's two states. Hover counts a mouse\n// or a pen and never a touch, which leaves a tapped link's emulated pointer\n// over it, as React Aria's hover does on web. The ring follows the browser's\n// own `:focus-visible`, the rule web's ring is drawn under, read as focus\n// arrives. Enter clicks the span, which is what a browser does for an\n// anchor and what React Native Web hands to `onPress`; a key held down\n// follows the link once.\nfunction webPropsOf(\n isDisabled: boolean,\n setHovered: (hovered: boolean) => void,\n setRingShown: (shown: boolean) => void,\n): WebProps {\n return {\n focusable: !isDisabled,\n onBlur: () => {\n setRingShown(false)\n },\n onFocus: (event) => {\n setRingShown(event.currentTarget.matches(':focus-visible'))\n },\n onKeyDown: (event) => {\n if (!isDisabled && event.key === 'Enter' && !event.repeat) {\n event.currentTarget.click()\n }\n },\n onPointerEnter: (event) => {\n setHovered(event.pointerType !== 'touch')\n },\n onPointerLeave: () => {\n setHovered(false)\n },\n }\n}\n\nexport type { LinkProps, LinkTone, LinkUnderline }\n\nexport { Link }\n"],"mappings":";;;;;;;;;;AAgGA,MAAMyC,aAAahC,WAAWiC,OAAO;CACnCC,QAAQ,EAAEC,oBAAoB,YAAY;CAC1CC,OAAO,EAAED,oBAAoB,OAAO;CACpCE,MAAM,EAAEF,oBAAoB,OAAO;AACrC,CAAC;AAED,MAAMlC,WAAWM,cAAc,EAAE+B,QAAQC,OAAOC,wBAAwB;CACtE,MAAMC,kBAAkBrC,YACtBkC,OAAOI,WACPF,kBAAkBC,eACpB;CAEA,OAAOzC,WAAWiC,OAAO;EAGvBU,MAAM,EACJC,cAAcL,MAAMM,GACtB;EACAC,UAAU;GACRC,OAAON;GACPO,qBAAqBP;EACvB;EAEAQ,SAAS;GACPF,OAAOT,OAAOY;GACdF,qBAAqBV,OAAOY;EAC9B;EAEAC,SAAS,EACPH,qBAAqBV,OAAOc,QAC9B;EACAF,SAAS;GACPH,OAAOT,OAAOY;GACdF,qBAAqB5C,YAAYkC,OAAOY,SAAS,EAAG;EACtD;CACF,CAAC;AACH,CAAC;;;;;;;;;;;;;;;;;;;;AAqBD,SAAAG,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAA9C;CAAA,IAAA+C;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAA5C,MAAAC,YAAAiD,IAA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,QAAAiB,MAAAjB,EAAA,QAAAS,wBAAAT,EAAA,QAAAkB,OAAAlB,EAAA,QAAAmB,MAAAnB,EAAA,QAAAoB,MAAApB,EAAA,QAAAqB,MAAArB,EAAA,QAAAsB,MAAAtB,EAAA,QAAAuB,IAAA;EAfHG,MAAA,oBAAC,IAAD;GAAW,GACLvB;GAAK,GACL0B;GACWzE,iBAAAA;GACN,SAAAkE;GACJ,MAAAC;GACE,OAAAL;GAUeT;EAAoB,CAAA;EAC1CT,EAAA,MAAAiB;EAAAjB,EAAA,MAAAS;EAAAT,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;EAAAvB,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,OAjBF0B;AAiBE;AAWN,SAASE,WACPxE,YACA0D,YACAE,cACU;CACV,OAAO;EACLrD,WAAW,CAACP;EACZQ,cAAc;GACZoD,aAAa,KAAK;EACpB;EACAnD,UAAUC,UAAU;GAClBkD,aAAalD,MAAMC,cAAcC,QAAQ,gBAAgB,CAAC;EAC5D;EACAE,YAAYJ,UAAU;GACpB,IAAI,CAACV,cAAcU,MAAMM,QAAQ,WAAW,CAACN,MAAMO,QACjDP,MAAMC,cAAcI,MAAM;EAE9B;EACAG,iBAAiBR,UAAU;GACzBgD,WAAWhD,MAAMS,gBAAgB,OAAO;EAC1C;EACAC,sBAAsB;GACpBsC,WAAW,KAAK;EAClB;CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","TextProps","NativeTextProps","TextStyle","useState","Text","NativeText","Platform","StyleSheet","stylesOf","ringStylesOf","useLinkPress","withOpacity","useTheme","composeStyles","themedStyles","LinkProps","Omit","href","isDisabled","ref","tone","LinkTone","underline","LinkUnderline","WebProps","focusable","onBlur","onFocus","event","currentTarget","matches","selector","onKeyDown","click","key","repeat","onPointerEnter","nativeEvent","pointerType","onPointerLeave","underlines","create","always","textDecorationLine","hover","none","colors","radii","stateLayerOpacity","disabledContent","onSurface","base","borderRadius","xs","disabled","color","textDecorationColor","hovered","primary","inherit","outline","Link","t0","$","_c","onPress","props","style","t1","t2","t3","t4","suppressHighlighting","undefined","theme","press","hoveredState","setHovered","ringShown","setRingShown","T0","t10","t5","t6","t7","t8","t9","styles","pressable","t11","OS","webPropsOf","web","ring","shown","_c","NativeText","ringStylesOf"],"sources":["../../../src/components/link/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { TextProps as NativeTextProps, TextStyle } from 'react-native'\n\nimport { useState } from 'react'\nimport { Text as NativeText, Platform, StyleSheet } from 'react-native'\n\nimport { stylesOf as ringStylesOf } from '../../press/styles'\nimport { useLinkPress } from '../../router'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// No Material Design page draws an inline link, so this takes web's reading:\n// the text button's label, the primary role on no container, with the\n// disabled treatment every page gives content, and a rule under it to say it\n// can be followed. That rule is 70% of the primary role, or the outline role\n// under `inherit`, and turns fully primary under a pointer. 70% is web's\n// figure, the least that keeps the rule at 3:1 against the surface in every\n// scheme the library is shown in.\n//\n// It is a nested Text, so it sets no type of its own and takes the size and\n// face of the sentence around it, as web's takes them from its paragraph. A\n// nested Text has no frame of its own, so it takes no `hitSlop` either.\n//\n// Where it departs from web, the platform is the reason:\n//\n// - The disabled colour is on-surface at the `disabledContent` opacity,\n// translucent over whatever the sentence sits on. Web mixes the two over\n// the surface role, and React Native has no `color-mix()`.\n// - Android draws the rule in the text's own colour, since it has no\n// `textDecorationColor`, and every platform draws it at its own thickness\n// and offset, which React Native has no properties for.\n// - Hover, the focus ring and the Enter key are the web's alone: a phone has\n// no pointer to hover with and focuses no span inside a sentence, so on\n// native `hover` draws no rule at all. The colour changes at once rather\n// than over a transition.\n// - iOS's own pressed highlight is off, since web's link draws no pressed\n// state; `suppressHighlighting={false}` turns it back on.\n\ntype LinkProps = Omit<NativeTextProps, 'disabled'> & {\n /**\n * Where the link leads. A press opens it through the `RouterProvider`\n * around the link, or through the platform for a URL with a scheme of its\n * own, after the call site's own `onPress`.\n */\n readonly href?: string\n /**\n * Fades the link to the disabled content colour, and takes no press. It is\n * still announced as a link, a disabled one.\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof NativeText>>\n /**\n * Which colour role to render in. `primary` marks the link out from the\n * text around it; `inherit` takes the colour of the Text around it and\n * leans on the underline alone, for a link in a place already understood\n * to be links, such as a footer.\n * @default 'primary'\n */\n readonly tone?: LinkTone\n /**\n * When to draw the rule. Leave it at `always` in prose: without it, colour\n * is the only thing separating the link from the sentence, which some\n * readers cannot see. `hover` and `none` are for links whose position\n * already announces them, such as a row of footer links. A phone has no\n * pointer, so `hover` draws no rule there.\n * @default 'always'\n */\n readonly underline?: LinkUnderline\n}\n\ntype LinkTone = 'inherit' | 'primary'\n\ntype LinkUnderline = 'always' | 'hover' | 'none'\n\n// What React Native Web hands a link's span, which React Native's own Text\n// declares little of: the browser's pointer, focus and key events, each typed\n// by the fields the link reads, and whether the span takes the Tab key. The\n// pointer's type is read off the native event, which is where React Native's\n// own pointer events carry it.\ntype WebProps = {\n readonly focusable: boolean\n readonly onBlur: () => void\n readonly onFocus: (event: {\n readonly currentTarget: { readonly matches: (selector: string) => boolean }\n }) => void\n readonly onKeyDown: (event: {\n readonly currentTarget: { readonly click: () => void }\n readonly key: string\n readonly repeat: boolean\n }) => void\n readonly onPointerEnter: (event: {\n readonly nativeEvent: { readonly pointerType: string }\n }) => void\n readonly onPointerLeave: () => void\n}\n\n// React Native's underline is off unless a style turns it on, and a nested\n// Text inherits its sentence's, so `hover` and `none` say `none` outright, as\n// web's do over an anchor's own underline.\nconst underlines = StyleSheet.create({\n always: { textDecorationLine: 'underline' },\n hover: { textDecorationLine: 'none' },\n none: { textDecorationLine: 'none' },\n})\n\nconst stylesOf = themedStyles(({ colors, radii, stateLayerOpacity }) => {\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n return StyleSheet.create({\n // The ring's corner on web, where an outline follows it. A nested Text\n // draws no frame on native, so there it draws nothing.\n base: {\n borderRadius: radii.xs,\n },\n disabled: {\n color: disabledContent,\n textDecorationColor: disabledContent,\n },\n // Under a pointer, either tone turns its text and its rule fully primary.\n hovered: {\n color: colors.primary,\n textDecorationColor: colors.primary,\n },\n // No colour, so the Text around it lends its own.\n inherit: {\n textDecorationColor: colors.outline,\n },\n primary: {\n color: colors.primary,\n textDecorationColor: withOpacity(colors.primary, 0.7),\n },\n })\n})\n\n/**\n * A run of text that leads somewhere, inside the sentence it belongs to.\n *\n * ```tsx\n * <Text variant=\"bodyLarge\">\n * Supporting copy with <Link href=\"/first\">a link inside it</Link>.\n * </Text>\n * ```\n *\n * It is React Native's Text with the link role, nested in the library's\n * Text, so it flows and wraps with the words around it and takes their type.\n * Given no Text around it, it draws in the platform's default face rather\n * than the theme's, so a link standing on its own, such as one of a row of\n * footer links, is a Text holding one link.\n *\n * `onPress` fires for a tap, a click and the Enter key alike, then `href` is\n * followed, through the `RouterProvider` around the link or the platform.\n * `style`, `ref` and `testID` land on React Native's own Text.\n */\nfunction Link({\n href,\n isDisabled = false,\n onPress,\n style,\n suppressHighlighting = true,\n tone = 'primary',\n underline = 'always',\n ...props\n}: LinkProps) {\n const theme = useTheme()\n const press = useLinkPress(href, onPress)\n const [hoveredState, setHovered] = useState(false)\n const [ringShown, setRingShown] = useState(false)\n\n const styles = stylesOf(theme)\n const hovered = !isDisabled && hoveredState\n const pressable = !isDisabled && (href !== undefined || onPress != null)\n const web =\n Platform.OS === 'web'\n ? webPropsOf(isDisabled, setHovered, setRingShown)\n : undefined\n\n return (\n <NativeText\n {...props}\n {...web}\n aria-disabled={isDisabled}\n onPress={pressable ? press : undefined}\n role=\"link\"\n style={composeStyles<TextStyle>(\n styles.base,\n styles[tone],\n underlines[underline],\n hovered && styles.hovered,\n hovered && underline === 'hover' && underlines.always,\n isDisabled && styles.disabled,\n !isDisabled && ringShown && ringStylesOf(theme).ring,\n style,\n )}\n suppressHighlighting={suppressHighlighting}\n />\n )\n}\n\n// The browser's events, read into the link's two states. Hover counts a mouse\n// or a pen and never a touch, which leaves a tapped link's emulated pointer\n// over it, as React Aria's hover does on web. The ring follows the browser's\n// own `:focus-visible`, the rule web's ring is drawn under, read as focus\n// arrives. Enter clicks the span, which is what a browser does for an\n// anchor and what React Native Web hands to `onPress`; a key held down\n// follows the link once.\nfunction webPropsOf(\n isDisabled: boolean,\n setHovered: (hovered: boolean) => void,\n setRingShown: (shown: boolean) => void,\n): WebProps {\n return {\n focusable: !isDisabled,\n onBlur: () => {\n setRingShown(false)\n },\n onFocus: (event) => {\n setRingShown(event.currentTarget.matches(':focus-visible'))\n },\n onKeyDown: (event) => {\n if (!isDisabled && event.key === 'Enter' && !event.repeat) {\n event.currentTarget.click()\n }\n },\n onPointerEnter: (event) => {\n setHovered(event.nativeEvent.pointerType !== 'touch')\n },\n onPointerLeave: () => {\n setHovered(false)\n },\n }\n}\n\nexport type { LinkProps, LinkTone, LinkUnderline }\n\nexport { Link }\n"],"mappings":";;;;;;;;;;AAoGA,MAAM0C,aAAajC,WAAWkC,OAAO;CACnCC,QAAQ,EAAEC,oBAAoB,YAAY;CAC1CC,OAAO,EAAED,oBAAoB,OAAO;CACpCE,MAAM,EAAEF,oBAAoB,OAAO;AACrC,CAAC;AAED,MAAMnC,WAAWM,cAAc,EAAEgC,QAAQC,OAAOC,wBAAwB;CACtE,MAAMC,kBAAkBtC,YACtBmC,OAAOI,WACPF,kBAAkBC,eACpB;CAEA,OAAO1C,WAAWkC,OAAO;EAGvBU,MAAM,EACJC,cAAcL,MAAMM,GACtB;EACAC,UAAU;GACRC,OAAON;GACPO,qBAAqBP;EACvB;EAEAQ,SAAS;GACPF,OAAOT,OAAOY;GACdF,qBAAqBV,OAAOY;EAC9B;EAEAC,SAAS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cAAcI,MAAM;EAE9B;EACAG,iBAAiBR,UAAU;GACzBiD,WAAWjD,MAAMS,YAAYC,gBAAgB,OAAO;EACtD;EACAC,sBAAsB;GACpBsC,WAAW,KAAK;EAClB;CACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { IndicatorTone } from "../../indicator/index.js";
2
2
  import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
- import { Ref } from "react";
3
+ import { ComponentRef, Ref } from "react";
4
4
  //#region src/components/meter/index.d.ts
5
5
  type MeterProps = Omit<ViewProps, 'children' | 'style'> & {
6
6
  /**
@@ -28,7 +28,7 @@ type MeterProps = Omit<ViewProps, 'children' | 'style'> & {
28
28
  * @default 0
29
29
  */
30
30
  readonly minValue?: number;
31
- readonly ref?: Ref<View>;
31
+ readonly ref?: Ref<ComponentRef<typeof View>>;
32
32
  /**
33
33
  * Whether the value is shown beside the label.
34
34
  * @default true
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["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 { 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<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,MAAMkC,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,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;EAAAO,KAAAP,EAAA;EAAAQ,KAAAR,EAAA;EAAAR,aAAAQ,EAAA;CAAA;CARX,MAAAhB,WAAAoB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AV;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","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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AfG;;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,7 +1,7 @@
1
1
  import { ValidationResult } from "../../form/index.js";
2
2
  import { FieldVariant } from "../../field/index.js";
3
3
  import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
4
- import { Ref } from "react";
4
+ import { ComponentRef, Ref } from "react";
5
5
  //#region src/components/number-field/index.d.ts
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
  /**
@@ -46,7 +46,7 @@ type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
46
46
  * A ref to the field's own `TextInput`, which is what a call site moves
47
47
  * focus to, after a server's error, say. `ref` is the field as a whole.
48
48
  */
49
- readonly inputRef?: Ref<TextInput>;
49
+ readonly inputRef?: Ref<ComponentRef<typeof TextInput>>;
50
50
  /**
51
51
  * Draws the field disabled: it takes no focus, no input and no steps.
52
52
  * @default false
@@ -95,7 +95,7 @@ type NumberFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
95
95
  * stepped to. `NaN` is an empty field.
96
96
  */
97
97
  readonly onChange?: (value: number) => void;
98
- readonly ref?: Ref<View>;
98
+ readonly ref?: Ref<ComponentRef<typeof View>>;
99
99
  /**
100
100
  * The amount the steppers move the value by, and the multiple of it, from
101
101
  * `minValue`, that a committed value snaps to.
@@ -1 +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","localeOf","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","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","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","resolvedOptions","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 { localeOf } from '../../number/locale'\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\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 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":";;;;;;;;;;;;;;;;;AAmRA,MAAM2F,gBAAgB;AACtB,MAAMC,aAAa;AAKnB,MAAMC,aAAa;AACnB,MAAMC,gBAAgB;AAEtB,MAAMC,WAAWpD,cAAc,EAAEqD,OAAOC,cACtC9E,WAAW+E,OAAO;CAEhBC,SAAS;EACPC,YAAY;EACZC,WAAW;EACXC,UAAU;EACVC,gBAAgB;EAChBC,OAAOb;CACT;CACAc,uBAAuB,EACrBC,uBAAuBV,MAAMW,GAC/B;CAGAC,aAAa,EACXC,eAAe,GACjB;CAGAvC,UAAU;EACRwC,WAAW;EACXC,eAAe;EACfC,WAAW,CAACf,QAAQgB;EACpBC,aAAajB,QAAQkB,KAAKlB,QAAQgB;EAClCG,gBAAgB,CAACnB,QAAQkB;CAC3B;CASAE,gBAAgB;EACdP,WAAW;EACXC,eAAe;EACfO,KAAKrB,QAAQkB;EACbH,WAAWf,QAAQsB,KAAKtB,QAAQgB;EAChCC,aAAajB,QAAQkB,KAAKlB,QAAQgB;CACpC;CAEAO,kBAAkB,EAChBJ,gBAAgB,CAACnB,QAAQgB,GAC3B;CACAQ,YAAY,EACVC,oBAAoB1B,MAAMW,GAC5B;AACF,CAAC,CACH;AAGA,SAASgB,SACP1C,QACA2C,MACA;CACA,QAAQC,UAAqB;EAC3B5C,OAAO;EACP2C,OAAOC,KAAK;CACd;AACF;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AAA,OAdMO;AAcN;;;;;;AAQH,SAAAyB,oBAAArD,MAAA;CAAA,MAAAqB,IAAAC,EAAA,CAAA;CACE,MAAAkG,UAAgB/O,OAAO,KAAK;CAAC,IAAA2I;CAAA,IAAAK;CAAA,IAAAJ,EAAA,OAAArB,MAAA;EAEnBoB,WAAA;GACR,IAAIoG,QAAO3D,SAAQ;IACjB2D,QAAO3D,UAAW;IAClBlL,kBAAiB8O,yBAA0BzH,IAAI;GAAC;EACjD;EACAyB,KAAA,CAACzB,IAAI;EAACqB,EAAA,KAAArB;EAAAqB,EAAA,KAAAD;EAAAC,EAAA,KAAAI;CAAA,OAAA;EAAAL,KAAAC,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CALT/I,UAAU8I,IAKPK,EAAM;CAAC,IAAAC;CAAA,IAAAL,EAAA,OAAAsC,OAAAC,IAAA,2BAAA,GAAA;EAEHlC,MAAA1F,eAAsB;GAC3BwL,QAAO3D,UAAWjL,SAAQoI,OAAQ,SAASpI,SAAQoI,OAAQ;GAC3DhF,KAAK;EAAC;EACPqF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAHMK;AAGN"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","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","localeOf","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","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","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","resolvedOptions","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 { ComponentRef, 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 { localeOf } from '../../number/locale'\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<ComponentRef<typeof 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<ComponentRef<typeof 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\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 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<ComponentRef<typeof 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<\n ComponentRef<typeof TextInput> | null,\n ComponentRef<typeof TextInput> | null\n >(inputRef, () => control.current, [])\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":";;;;;;;;;;;;;;;;;AAmRA,MAAM4F,gBAAgB;AACtB,MAAMC,aAAa;AAKnB,MAAMC,aAAa;AACnB,MAAMC,gBAAgB;AAEtB,MAAMC,WAAWpD,cAAc,EAAEqD,OAAOC,c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AAA;EAEHlC,MAAA1F,eAAsB;GAC3BwL,QAAO3D,UAAWjL,SAAQoI,OAAQ,SAASpI,SAAQoI,OAAQ;GAC3DhF,KAAK;EAAC;EACPqF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAHMK;AAGN"}
@@ -1,6 +1,6 @@
1
1
  import { MarkImageProps } from "../../mark/index.js";
2
2
  import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
- import { Ref } from "react";
3
+ import { ComponentRef, Ref } from "react";
4
4
  //#region src/components/product-icon/index.d.ts
5
5
  type ProductIconProps = Omit<ViewProps, 'children' | 'style'> & {
6
6
  /**
@@ -24,7 +24,7 @@ type ProductIconProps = Omit<ViewProps, 'children' | 'style'> & {
24
24
  * channel's hash or a bracket.
25
25
  */
26
26
  readonly name: string;
27
- readonly ref?: Ref<View>;
27
+ readonly ref?: Ref<ComponentRef<typeof View>>;
28
28
  /**
29
29
  * Edge length: `sm` 36dp, `md` 40dp, `lg` 56dp. The same three Avatar
30
30
  * uses, so the two are interchangeable wherever one leads a row or a card.
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","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 { ComponentRef, 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<ComponentRef<typeof 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,SAAAkB,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"}
@@ -1,6 +1,6 @@
1
1
  import { IndicatorTone } from "../../indicator/index.js";
2
2
  import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
- import { Ref } from "react";
3
+ import { ComponentRef, Ref } from "react";
4
4
  //#region src/components/progress-indicator/index.d.ts
5
5
  type ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {
6
6
  /**
@@ -51,7 +51,7 @@ type ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {
51
51
  * @default 0
52
52
  */
53
53
  readonly minValue?: number;
54
- readonly ref?: Ref<View>;
54
+ readonly ref?: Ref<ComponentRef<typeof View>>;
55
55
  /**
56
56
  * The page's two shapes. `wavy` draws the active indicator as a wave, which
57
57
  * lies flat near either end of a determinate value, and leaves the track