@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.
- package/dist/button/index.d.ts +8 -0
- package/dist/button/index.js +38 -26
- package/dist/button/index.js.map +1 -1
- package/dist/button/slots.js +7 -0
- package/dist/button/slots.js.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/index.js +115 -109
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +3 -3
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +2 -2
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +131 -0
- package/dist/components/dialog/index.js +861 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/icon-button/index.d.ts +3 -3
- package/dist/components/icon-button/index.js +128 -122
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +2 -2
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +3 -3
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +2 -2
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +2 -2
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +3 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +3 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +3 -3
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +2 -2
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +3 -3
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js.map +1 -1
- package/dist/overlay/host.js.map +1 -1
- package/dist/press/index.js +59 -60
- package/dist/press/index.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Ref","DimensionValue","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","I18nManager","StyleSheet","View","Animated","useAnimatedProps","useAnimatedStyle","useDerivedValue","useReducedMotion","Svg","Path","IndicatorColors","IndicatorTone","Curve","Keyframe","RingWave","HIDDEN","activeLength","fillOf","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","keyframeAt","useLoop","arcPath","TURN","WAVE_HEIGHT","WAVE_ORIGIN","wavePath","wavyArcPath","DETERMINATE_EASING","GAP","stylesOf","indicatorStylesOf","THICKNESS","parseLength","useTheme","composeStyles","themedStyles","Bar","scale","start","translate","ProgressIndicatorProps","Omit","buffer","diameter","formatOptions","Intl","NumberFormatOptions","isIndeterminate","label","locale","maxValue","minValue","ref","shape","ProgressIndicatorShape","showValue","style","tone","ProgressIndicatorTone","value","valueLabel","variant","ProgressIndicatorVariant","Extract","CIRCULAR_SIZE","RADIUS","ARC_MS","CYCLE_MS","ROTATE_MS","Math","round","RING_EASING","RING_SETTLE","INDETERMINATE_MS","BUFFER_MS","LINE_SLOWDOWN","RING_SLOWDOWN","WAVE_WAVELENGTH","INDETERMINATE_WAVELENGTH","WAVE_REACH","WAVE_FROM","WAVE_UNTIL","WAVY_SIZE","RING_AMPLITUDE","RING_WAVELENGTH","WAVY_RADIUS","RING_WAVE","amplitude","centre","radius","waves","PITCH","PRIMARY_BAR","SECONDARY_BAR","EXPAND_ARC","TRAVEL_ARC","AnimatedPath","createAnimatedComponent","styles","create","bar","height","left","position","top","transformOrigin","buffered","flexShrink","dot","width","dotRow","flexDirection","gap","dots","flexGrow","minWidth","overflow","line","alignSelf","justifyContent","mirrored","transform","scaleX","rootCircular","alignItems","row","track","absoluteFill","wave","wavyLine","radii","borderRadius","pill","circle","Buffer","t0","$","_c","colors","share","theme","own","reduceMotion","clock","direction","isRTL","scroll","translateX","get","t1","widthOf","t2","T0","t4","t5","t6","dotsFor","map","t7","t8","t3","t9","bufferShare","percentage","undefined","range","remaining","min","max","CircularTrack","motion","wavy","box","circumference","durationLong2","duration","easing","timing","shown","fade","isWaving","slowdown","arc","cycle","turn","active","opacity","from","d","length","strokeOf","DeterminateLine","durationMedium1","under","Array","ceil","_","index","IndeterminateBars","primary","useBarStyle","secondary","IndeterminateLine","LinearTrack","onLayout","LineWave","Symbol","for","ProgressIndicator","ariaLabel","props","reading","text","t10","root","RingWavePath","phase","color","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","const","time","WaveBar","to","_c","indicatorStylesOf"],"sources":["../../../src/components/progress-indicator/index.tsx"],"sourcesContent":["import type { Ref } from 'react'\nimport type {\n DimensionValue,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport { I18nManager, StyleSheet, View } from 'react-native'\nimport Animated, {\n useAnimatedProps,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n} from 'react-native-reanimated'\nimport Svg, { Path } from 'react-native-svg'\n\nimport type { IndicatorColors, IndicatorTone } from '../../indicator'\nimport type { Curve, Keyframe } from '../../indicator/motion'\nimport type { RingWave } from '../../indicator/paths'\n\nimport { HIDDEN } from '../../glyphs/hidden'\nimport {\n activeLength,\n fillOf,\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport { keyframeAt, useLoop } from '../../indicator/motion'\nimport {\n arcPath,\n TURN,\n WAVE_HEIGHT,\n WAVE_ORIGIN,\n wavePath,\n wavyArcPath,\n} from '../../indicator/paths'\nimport {\n DETERMINATE_EASING,\n GAP,\n stylesOf as indicatorStylesOf,\n THICKNESS,\n} from '../../indicator/styles'\nimport { parseLength } from '../../theme/resolve'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The progress indicators page's indicator, as kanso-ui's ProgressIndicator\n// draws it: a line or a ring, in either of the page's two shapes, flat and\n// wavy. Both carry the three parts the page's anatomy names, the active\n// indicator in primary, the track in secondary container and, on the line,\n// the stop indicator in primary at the end, at the page's 4dp thickness with\n// the 4dp gap its measurements give either side of the track. The flat ring\n// is the page's default 40dp of the four sizes it draws, and the wavy ring the\n// 48dp its wave needs room for.\n//\n// The determinate line is src/indicator's, which Meter draws too: the active\n// indicator takes the value's share of what the gaps and the stop leave, and\n// the track takes the rest. The determinate ring is two arcs of one circle:\n// the active arc runs clockwise from the top for its share of the\n// circumference, and the track picks up 4dp past it and stops 4dp before it\n// comes back round, which is the same gap measured along the curve.\n//\n// The animations are Material's own, with web's numbers: the line's two bars\n// and their four keyframe sets, the buffer's scrolling dots, the ring's 1333ms\n// arc, its four-arc cycle and its 1568ms rotation, and the 250ms and 500ms a\n// determinate value moves over. React Native has no CSS keyframes, so each\n// set is a list of the same frames read off a looping clock on the UI thread,\n// in src/indicator/motion.ts.\n//\n// Under reduced motion the motion slows rather than stopping, as web's does:\n// an indicator that freezes stops saying the work is going on, and a frozen\n// arc caught at its short end reads as broken. The multipliers are web's, two\n// for the line and a quarter more for the ring. A determinate value jumps\n// there instead of easing, as web's transition drops to `0s`.\n//\n// The wavy shape draws the active indicator as a wave and leaves the track and\n// the stop flat, as the page does, with web's numbers, which are Material's\n// own: on the line a 3dp amplitude, a 40dp wavelength and a 10dp row, with a\n// 20dp wavelength while indeterminate; on the ring a 1.6dp amplitude and a\n// 15dp wavelength, rounded to a whole number of waves so the wave closes on\n// itself. A determinate wave lies flat up to a tenth of the way and from 95%\n// on, and is drawn over the flat drawing, the two crossfading as the value\n// crosses those bounds. The flat drawing is also what a reader who has asked\n// for reduced motion sees, since a wave is motion even standing still, and\n// what a line wider than `WAVE_REACH` is drawn as.\n//\n// Web cuts its arcs and waves out of whole curves with dash patterns; here\n// each is a path built from where it starts and how far it runs, for the\n// reason src/indicator/paths.ts gives.\n//\n// The root carries the role, the range, the value and its text, which React\n// Aria's `useProgressBar` gives web's, so a screen reader hears the label and\n// the value as one element. The value is read as React Aria reads it: clamped\n// to the range, and written as a percentage unless `formatOptions` says\n// otherwise, in `locale`.\n\n/** A bar of the indeterminate line, as web's keyframes move it. */\ntype Bar = {\n /** Its scale across, from its start. */\n readonly scale: readonly Keyframe[]\n /** Where it starts, as a share of the row before the row's own start. */\n readonly start: number\n /** How far it has travelled from there, as a share of the row. */\n readonly translate: readonly Keyframe[]\n}\n\ntype ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How far the work is loaded ahead of the value, a video's buffered\n * seconds or a queue's fetched pages. Read on the same scale as `value`:\n * the track is solid up to it and dotted beyond. Ignored while the\n * indicator is indeterminate and by the ring, and left out for work with\n * nothing to buffer.\n */\n readonly buffer?: number\n /**\n * How wide the ring is drawn, as a CSS length read the way a theme's\n * lengths are. Everything inside scales with it, so a ring in a button can\n * take the button's icon size. The length is in px, since a relative unit\n * has nothing on native to be relative to. Ignored by the line, which fills\n * the width it is given.\n * @default '40px', or '48px' for the wavy ring\n */\n readonly diameter?: `${number}px`\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * For work whose length is not known: the indicator runs on its own, and\n * has no value to show or announce.\n * @default false\n */\n readonly isIndeterminate?: boolean\n /**\n * What the work is, shown above the indicator. A screen reader reads it as\n * the indicator's name; an indicator whose surroundings name it takes\n * `aria-label` instead and leaves this out.\n */\n readonly label?: string\n /**\n * The BCP 47 locale the value is written in. Defaults to the device's.\n */\n readonly locale?: string\n /**\n * The value at which the work is done.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The value at which the work starts.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<View>\n /**\n * The page's two shapes. `wavy` draws the active indicator as a wave, which\n * lies flat near either end of a determinate value, and leaves the track\n * and the stop flat; the wavy ring is 48dp across rather than 40. Under\n * reduced motion a wavy indicator is drawn flat.\n * @default 'flat'\n */\n readonly shape?: ProgressIndicatorShape\n /**\n * Whether the value is shown beside the label. Ignored while the indicator\n * is indeterminate, which has no value to show.\n * @default false\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours it is drawn in. `primary` is the page's own pair, the active\n * indicator in primary over a secondary container track, and `inherit`\n * takes the colour of the slot it sits in, for an indicator inside something\n * that already has one, such as a button, where primary would be the fill.\n * @default 'primary'\n */\n readonly tone?: ProgressIndicatorTone\n /**\n * How far the work has gone, between `minValue` and `maxValue`.\n * @default 0\n */\n readonly value?: number\n /** The value as words, in place of the number `formatOptions` writes. */\n readonly valueLabel?: string\n /**\n * The line the page draws, or the ring: `linear` fills the width it is\n * given, `circular` is 40dp across.\n * @default 'linear'\n */\n readonly variant?: ProgressIndicatorVariant\n}\n\ntype ProgressIndicatorShape = 'flat' | 'wavy'\n\n// The two of the shared line's four tones an indicator draws. The other two\n// say how a measurement reads, which is a meter's business rather than a\n// running task's.\ntype ProgressIndicatorTone = Extract<IndicatorTone, 'inherit' | 'primary'>\n\ntype ProgressIndicatorVariant = 'circular' | 'linear'\n\n// The flat ring. The radius is the diameter less the stroke, halved, so the\n// stroke sits inside the 40dp box rather than straddling its edge.\nconst CIRCULAR_SIZE = 40\nconst RADIUS = (CIRCULAR_SIZE - THICKNESS) / 2\n\n// The ring's timings. The arc is 1333ms; a full cycle is four of them; and the\n// rotation is the arc scaled by 360/306, which is the arc's start rotation plus\n// the circle less the arc's size. A determinate ring moves on Material's own\n// curve rather than the line's.\nconst ARC_MS = 1333\nconst CYCLE_MS = ARC_MS * 4\nconst ROTATE_MS = Math.round((ARC_MS * 360) / 306)\nconst RING_EASING: Curve = [0.4, 0, 0.2, 1]\nconst RING_SETTLE: Curve = [0, 0, 0.2, 1]\n\n// The line's own: 2s for an indeterminate pass, and the 250ms the buffer's\n// dots take to scroll one pitch.\nconst INDETERMINATE_MS = 2000\nconst BUFFER_MS = 250\n\n// What reduced motion slows each shape by.\nconst LINE_SLOWDOWN = 2\nconst RING_SLOWDOWN = 1.25\n\n// The wavy line's two wavelengths, and how far the wave runs: a row wider than\n// that draws flat, as web's does.\nconst WAVE_WAVELENGTH = 40\nconst INDETERMINATE_WAVELENGTH = 20\nconst WAVE_REACH = 2048\n\n// Where a determinate wave stands up and where it lies down again, as\n// percentages of the way.\nconst WAVE_FROM = 10\nconst WAVE_UNTIL = 95\n\n// The wavy ring: the 48dp box, and the wave round the circle pulled in by the\n// amplitude so its crests stay inside the box. The wave count is the\n// wavelength's share of that circle, rounded, which is nine.\nconst WAVY_SIZE = 48\nconst RING_AMPLITUDE = 1.6\nconst RING_WAVELENGTH = 15\nconst WAVY_RADIUS = (WAVY_SIZE - THICKNESS) / 2 - RING_AMPLITUDE\n\nconst RING_WAVE: RingWave = {\n amplitude: RING_AMPLITUDE,\n centre: WAVY_SIZE / 2,\n radius: WAVY_RADIUS,\n waves: Math.round((TURN * WAVY_RADIUS) / RING_WAVELENGTH),\n}\n\n// The buffer's dots: the track's colour, at the stroke's size, one pitch of\n// two and a half strokes apart.\nconst PITCH = THICKNESS * 2.5\n\n// The two bars of the indeterminate line, translated and scaled at once, with\n// web's keyframes, which are Material's.\nconst PRIMARY_BAR: Bar = {\n scale: [\n [0, 0.08],\n [0.3665, 0.08, [0.334731, 0.12482, 0.785844, 1]],\n [0.6915, 0.661479, [0.06, 0.11, 0.6, 1]],\n [1, 0.08],\n ],\n start: -1.45167,\n translate: [\n [0, 0],\n [0.2, 0, [0.5, 0, 0.701732, 0.495819]],\n [0.5915, 0.836714, [0.302435, 0.381352, 0.55, 0.956352]],\n [1, 2.00611],\n ],\n}\n\nconst SECONDARY_BAR: Bar = {\n scale: [\n [0, 0.08, [0.205028, 0.057051, 0.57661, 0.453971]],\n [0.1915, 0.457104, [0.152313, 0.196432, 0.648374, 1.00432]],\n [0.4415, 0.72796, [0.257759, -0.003163, 0.211762, 1.38179]],\n [1, 0.08],\n ],\n start: -0.548889,\n translate: [\n [0, 0, [0.15, 0, 0.515058, 0.409685]],\n [0.25, 0.376519, [0.31033, 0.284058, 0.8, 0.733712]],\n [0.4835, 0.843862, [0.4, 0.627035, 0.6, 0.902026]],\n [1, 1.60278],\n ],\n}\n\n// The indeterminate ring's arc, as a share of the way round. Material\n// contracts it to 10 degrees of turn and grows it to 270; web draws the short\n// end at 8% rather than 10 degrees, since a round cap on so short an arc draws\n// a dot, and this is web's.\nconst EXPAND_ARC: readonly Keyframe[] = [\n [0, 0.08, RING_EASING],\n [0.5, 0.75, RING_EASING],\n [1, 0.08],\n]\n\n// Where the arc starts, in turns. Material turns it in eight steps of 135\n// degrees rather than at a constant rate, each on the arc's own curve, so it\n// settles at each position and springs to the next: three full turns over the\n// cycle, under the rotation's own single turn.\nconst TRAVEL_ARC: readonly Keyframe[] = [\n [0, 0, RING_EASING],\n [0.125, 0.375, RING_EASING],\n [0.25, 0.75, RING_EASING],\n [0.375, 1.125, RING_EASING],\n [0.5, 1.5, RING_EASING],\n [0.625, 1.875, RING_EASING],\n [0.75, 2.25, RING_EASING],\n [0.875, 2.625, RING_EASING],\n [1, 3],\n]\n\nconst AnimatedPath = Animated.createAnimatedComponent(Path)\n\nconst styles = StyleSheet.create({\n // A bar of the indeterminate line: the row's width, scaled from its start\n // and travelling across. Physical rather than logical, as web's are: the\n // keyframes move one way only, so the direction is handled once, by\n // mirroring the row.\n bar: {\n height: THICKNESS,\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'left center',\n },\n // The solid part of a buffered track, as far as the buffer reaches.\n buffered: {\n flexShrink: 0,\n height: THICKNESS,\n },\n dot: {\n height: THICKNESS,\n width: THICKNESS,\n },\n // The dots, scrolling one pitch toward the start of the line and starting\n // again.\n dotRow: {\n flexDirection: 'row',\n gap: PITCH - THICKNESS,\n },\n // What the buffer leaves of the track, which the dots fill.\n dots: {\n flexGrow: 1,\n flexShrink: 1,\n height: THICKNESS,\n minWidth: 0,\n overflow: 'hidden',\n },\n // The flat line's row, whose width the line is drawn to.\n line: {\n alignSelf: 'stretch',\n justifyContent: 'center',\n },\n mirrored: {\n transform: [{ scaleX: -1 }],\n },\n // A circular indicator is its own size rather than the room it is given.\n rootCircular: {\n alignItems: 'flex-start',\n },\n // The indeterminate line's row, which clips its bars at both ends.\n row: {\n alignSelf: 'stretch',\n height: THICKNESS,\n overflow: 'hidden',\n },\n // The track behind the indeterminate line's bars.\n track: {\n ...StyleSheet.absoluteFill,\n },\n // A wave over the line: the row's whole box, mirrored under a right-to-left\n // layout so it starts at the start of the line.\n wave: {\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n },\n // The wavy line's row: the wave's 10dp, with the flat line through its\n // middle.\n wavyLine: {\n alignSelf: 'stretch',\n height: WAVE_HEIGHT,\n justifyContent: 'center',\n },\n})\n\nconst stylesOf = themedStyles(({ radii }) =>\n StyleSheet.create({\n // The bars carry the pill every other part of the line draws. It is drawn\n // under the bar's own scale, so it flattens as the bar narrows, as web's\n // and Material's do.\n bar: { borderRadius: radii.pill },\n dot: { borderRadius: radii.circle },\n row: { borderRadius: radii.pill },\n }),\n)\n\n/**\n * The dots beyond the buffer, scrolling toward the start of the line. There\n * is one more of them than the row has room for, so the row stays full as\n * they move.\n */\nfunction Buffer({\n colors,\n share,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly share: number\n readonly width: number\n}) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const clock = useLoop(BUFFER_MS * (reduceMotion ? LINE_SLOWDOWN : 1), true)\n // A translation is not mirrored under a right-to-left layout, though the\n // row is, so the dots travel the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const scroll = useAnimatedStyle(() => {\n 'worklet'\n return { transform: [{ translateX: -PITCH * clock.get() * direction }] }\n })\n\n return (\n <>\n <View\n style={composeStyles<ViewStyle>(\n styles.buffered,\n fillOf(colors.track),\n widthOf(`${share}%`),\n )}\n />\n <View style={styles.dots}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.dotRow, scroll)}\n >\n {dotsFor(width).map((dot) => (\n <View\n key={dot}\n style={composeStyles<ViewStyle>(\n styles.dot,\n own.dot,\n fillOf(colors.track),\n )}\n />\n ))}\n </Animated.View>\n </View>\n </>\n )\n}\n\n// How much of the track the buffer covers. The buffer is read on the value's\n// scale, and the track holds what the value has not taken, so the solid part\n// is the buffer's share of that remainder, as web's `bufferShare` gives it.\nfunction bufferShare(\n buffer: number | undefined,\n percentage: number,\n minValue: number,\n maxValue: number,\n) {\n if (buffer === undefined) {\n return undefined\n }\n const range = maxValue - minValue\n const buffered = range === 0 ? 0 : ((buffer - minValue) / range) * 100\n const remaining = 100 - percentage\n if (remaining <= 0) {\n return 0\n }\n return Math.min(100, Math.max(0, ((buffered - percentage) / remaining) * 100))\n}\n\n/**\n * The ring: two arcs of one circle while determinate, one arc growing,\n * shrinking and travelling round while indeterminate, and for the wavy shape a\n * wave over the active arc. Drawn on a box of its own size and scaled to the\n * diameter, so the stroke and the gap scale with it.\n */\nfunction CircularTrack({\n colors,\n diameter,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly colors: IndicatorColors\n readonly diameter: number\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion\n const box = wavy ? WAVY_SIZE : CIRCULAR_SIZE\n const centre = box / 2\n const radius = wavy ? WAVY_RADIUS : RADIUS\n const circumference = TURN * radius\n const timing = { duration: motion.durationLong2, easing: RING_SETTLE }\n const shown = useEased(percentage, timing)\n const fade = useEased(\n waves && (isIndeterminate || isWaving(percentage)) ? 1 : 0,\n timing,\n )\n const slowdown = reduceMotion ? RING_SLOWDOWN : 1\n const arc = useLoop(ARC_MS * slowdown, isIndeterminate)\n const cycle = useLoop(CYCLE_MS * slowdown, isIndeterminate)\n const turn = useLoop(Math.round(ROTATE_MS * slowdown), isIndeterminate)\n\n // The active arc, or the indeterminate one: it grows and shrinks over the\n // arc's duration, its start travels the circle over the cycle, and the\n // whole of it turns over the rotation's. An indeterminate ring starts at\n // three o'clock, as web's does once its spin replaces the quarter turn back\n // that puts a determinate one's start at the top.\n const active = useAnimatedProps(() => {\n 'worklet'\n const opacity = 1 - fade.get()\n if (isIndeterminate) {\n const from =\n TURN / 4 + TURN * (turn.get() + keyframeAt(TRAVEL_ARC, cycle.get()))\n return {\n d: arcPath(\n centre,\n radius,\n from,\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity,\n }\n }\n return {\n d: arcPath(centre, radius, 0, (TURN * shown.get()) / 100),\n opacity,\n }\n })\n // The track picks up a gap past the active arc and stops a gap before the\n // top.\n const track = useAnimatedProps(() => {\n 'worklet'\n const length = (circumference * shown.get()) / 100\n return {\n d: arcPath(\n centre,\n radius,\n (length + GAP) / radius,\n Math.max(0, circumference - length - 2 * GAP) / radius,\n ),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={diameter}\n viewBox={`0 0 ${box} ${box}`}\n width={diameter}\n >\n {isIndeterminate ? null : (\n <AnimatedPath animatedProps={track} {...strokeOf(colors.track)} />\n )}\n <AnimatedPath animatedProps={active} {...strokeOf(colors.active)} />\n {waves ? (\n <RingWavePath\n arc={arc}\n colors={colors}\n cycle={cycle}\n fade={fade}\n isIndeterminate={isIndeterminate}\n shown={shown}\n turn={turn}\n />\n ) : null}\n </Svg>\n )\n}\n\n/**\n * The line determinate: src/indicator's, with the buffer in its track, and\n * for the wavy shape a wave over its active indicator, crossfading with it as\n * the value crosses the bounds the wave stands between.\n */\nfunction DeterminateLine({\n buffer,\n colors,\n percentage,\n waves,\n width,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly percentage: number\n readonly waves: boolean\n readonly width: number\n}) {\n const { motion } = useTheme()\n const timing = {\n duration: motion.durationMedium1,\n easing: DETERMINATE_EASING,\n }\n const shown = useEased(percentage, timing)\n const fade = useEased(waves && isWaving(percentage) ? 1 : 0, timing)\n const under = useDerivedValue(() => 1 - fade.get())\n\n return (\n <>\n <IndicatorLine\n activeOpacity={waves ? under : undefined}\n colors={colors}\n percentage={shown}\n width={width}\n >\n {buffer === undefined ? undefined : (\n <Buffer colors={colors} share={buffer} width={width} />\n )}\n </IndicatorLine>\n {waves ? (\n <LineWave colors={colors} fade={fade} shown={shown} width={width} />\n ) : null}\n </>\n )\n}\n\n// One key for each dot the buffer draws across `width`.\nfunction dotsFor(width: number) {\n return Array.from(\n { length: Math.ceil(width / PITCH) + 1 },\n (_, index) => index,\n )\n}\n\n// The flat bars of the indeterminate line.\nfunction IndeterminateBars({\n clock,\n colors,\n width,\n}: {\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const primary = useBarStyle(clock, PRIMARY_BAR, width)\n const secondary = useBarStyle(clock, SECONDARY_BAR, width)\n\n return (\n <>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n primary,\n )}\n />\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n secondary,\n )}\n />\n </>\n )\n}\n\n/**\n * The line indeterminate: the track, with two bars crossing it, or for the\n * wavy shape two stretches of a wave crossing it where the bars would be. The\n * row is mirrored under a right-to-left layout, which makes the sweep travel\n * the way the line reads while the bars move as Material's keyframes say.\n */\nfunction IndeterminateLine({\n colors,\n waves,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly waves: boolean\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const reduceMotion = useReducedMotion()\n const clock = useLoop(\n INDETERMINATE_MS * (reduceMotion ? LINE_SLOWDOWN : 1),\n true,\n )\n const mirrored = I18nManager.isRTL ? styles.mirrored : undefined\n\n return (\n <>\n <View style={composeStyles<ViewStyle>(styles.row, own.row, mirrored)}>\n <View\n style={composeStyles<ViewStyle>(styles.track, fillOf(colors.track))}\n />\n {waves ? null : (\n <IndeterminateBars clock={clock} colors={colors} width={width} />\n )}\n </View>\n {waves ? (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(styles.wave, mirrored)}\n width={width}\n >\n <WaveBar\n bar={PRIMARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n <WaveBar\n bar={SECONDARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n </Svg>\n ) : null}\n </>\n )\n}\n\n// Whether a determinate wave stands at this value; see `WAVE_FROM`.\nfunction isWaving(percentage: number) {\n return percentage > WAVE_FROM && percentage < WAVE_UNTIL\n}\n\n/**\n * The line, measured: the row is laid out first and the line drawn to its\n * width, which is what web's `calc()` and container units do without a\n * measurement.\n */\nfunction LinearTrack({\n buffer,\n colors,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { onLayout, width } = useMeasuredWidth()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion && width <= WAVE_REACH\n\n return (\n <View onLayout={onLayout} style={wavy ? styles.wavyLine : styles.line}>\n {isIndeterminate ? (\n <IndeterminateLine colors={colors} waves={waves} width={width} />\n ) : (\n <DeterminateLine\n buffer={buffer}\n colors={colors}\n percentage={percentage}\n waves={waves}\n width={width}\n />\n )}\n </View>\n )\n}\n\n/** The determinate line's wave, cut to the active indicator's length. */\nfunction LineWave({\n colors,\n fade,\n shown,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly fade: SharedValue<number>\n readonly shown: SharedValue<number>\n readonly width: number\n}) {\n // The active indicator's length less the half stroke each round cap adds at\n // either end, as web's `waveAt` gives it.\n const wave = useAnimatedProps(() => {\n 'worklet'\n const length = Math.max(0, activeLength(width, shown.get()) - THICKNESS)\n return {\n d: wavePath(WAVE_WAVELENGTH, WAVE_ORIGIN, WAVE_ORIGIN + length),\n opacity: fade.get(),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(\n styles.wave,\n I18nManager.isRTL ? styles.mirrored : undefined,\n )}\n width={width}\n >\n <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n </Svg>\n )\n}\n\n/**\n * Progress through a task, as a line or a ring. Pass `value` between\n * `minValue` and `maxValue`, or set `isIndeterminate` for work whose length is\n * not known. `formatOptions` says how the value reads, in `locale`, and\n * `buffer` marks how far the work is loaded ahead of it.\n *\n * ```tsx\n * <ProgressIndicator label=\"Label\" showValue value={40} />\n * ```\n *\n * A screen reader hears it as a progress bar named by its label, with its\n * value as `formatOptions` writes it, and no value while it is indeterminate.\n * `style`, `ref` and `testID` land on the indicator as a whole, which is the\n * view a layout positions.\n */\nfunction ProgressIndicator({\n 'aria-label': ariaLabel,\n buffer,\n diameter,\n formatOptions,\n isIndeterminate = false,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n shape = 'flat',\n showValue = false,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n variant = 'linear',\n ...props\n}: ProgressIndicatorProps) {\n const theme = useTheme()\n const colors = useIndicatorColors(tone)\n const reading = readingOf({\n formatOptions,\n locale,\n maxValue,\n minValue,\n value,\n valueLabel,\n })\n const text = isIndeterminate ? undefined : reading.text\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={isIndeterminate ? undefined : reading.value}\n aria-valuetext={text}\n role=\"progressbar\"\n {...props}\n style={composeStyles<ViewStyle>(\n indicatorStylesOf(theme).root,\n variant === 'circular' ? styles.rootCircular : undefined,\n style,\n )}\n >\n <IndicatorLabels label={label} value={showValue ? text : undefined} />\n {variant === 'circular' ? (\n <CircularTrack\n colors={colors}\n diameter={\n (diameter === undefined ? undefined : parseLength(diameter)) ??\n (shape === 'wavy' ? WAVY_SIZE : CIRCULAR_SIZE)\n }\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n ) : (\n <LinearTrack\n buffer={bufferShare(buffer, reading.percentage, minValue, maxValue)}\n colors={colors}\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n )}\n </View>\n )\n}\n\n/**\n * The wave over the ring's active arc, cut by the same lengths, or running\n * round as the indeterminate arc does. Its crests turn with the ring.\n */\nfunction RingWavePath({\n arc,\n colors,\n cycle,\n fade,\n isIndeterminate,\n shown,\n turn,\n}: {\n readonly arc: SharedValue<number>\n readonly colors: IndicatorColors\n readonly cycle: SharedValue<number>\n readonly fade: SharedValue<number>\n readonly isIndeterminate: boolean\n readonly shown: SharedValue<number>\n readonly turn: SharedValue<number>\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n if (isIndeterminate) {\n const phase = TURN / 4 + TURN * turn.get()\n return {\n d: wavyArcPath(\n RING_WAVE,\n phase,\n phase + TURN * keyframeAt(TRAVEL_ARC, cycle.get()),\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity: fade.get(),\n }\n }\n return {\n d: wavyArcPath(RING_WAVE, 0, 0, (TURN * shown.get()) / 100),\n opacity: fade.get(),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// What every curve of the indicator is stroked with: the colour, at the 4dp\n// thickness, with round ends and joins, and no fill.\nfunction strokeOf(color: string) {\n return {\n fill: 'none',\n stroke: color,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: THICKNESS,\n } as const\n}\n\n/**\n * A bar of the indeterminate line where the clock has it: its start, and its\n * scale from there, both as web's keyframes give them in shares of the row.\n */\nfunction useBarStyle(clock: SharedValue<number>, bar: Bar, width: number) {\n return useAnimatedStyle(() => {\n 'worklet'\n const time = clock.get()\n return {\n transform: [\n { translateX: (bar.start + keyframeAt(bar.translate, time)) * width },\n { scaleX: keyframeAt(bar.scale, time) },\n ],\n }\n })\n}\n\n/**\n * A bar of the indeterminate line drawn as a stretch of the wave: from where\n * the flat bar starts, as long as the flat bar is, and nothing of it before\n * the wave's own start.\n */\nfunction WaveBar({\n bar,\n clock,\n colors,\n width,\n}: {\n readonly bar: Bar\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n const time = clock.get()\n const from =\n WAVE_ORIGIN + (bar.start + keyframeAt(bar.translate, time)) * width\n const to = from + keyframeAt(bar.scale, time) * width\n return {\n d: wavePath(\n INDETERMINATE_WAVELENGTH,\n Math.max(WAVE_ORIGIN, from),\n Math.min(WAVE_ORIGIN + width, to),\n ),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// A view's width, built by a call rather than written inline at the prop,\n// which is what react-perf's no-new-object-as-prop is after.\nfunction widthOf(width: DimensionValue) {\n return { width }\n}\n\nexport { ProgressIndicator }\nexport type {\n ProgressIndicatorProps,\n ProgressIndicatorShape,\n ProgressIndicatorTone,\n ProgressIndicatorVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;AAmNA,MAAM4E,gB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CAWf,MAAAP,OAAajI,uBAAiB;EAAA;EAE5B,MAAAiO,OAAajF,MAAKK,IAAK;EACvB,MAAAuC,OACEnK,eAAe4E,IAAG9D,QAASnB,WAAWiF,IAAG7D,WAAYyL,IAAI,KAAKnH;EAChE,MAAAqH,KAAWvC,OAAOxK,WAAWiF,IAAG/D,OAAQ2L,IAAI,IAAInH;EAAK,OAC9C,EAAA+E,GACFnK,SACDqD,0BACAT,KAAImG,IAAKhJ,aAAamK,IAAI,GAC1BtH,KAAIkG,IAAK/I,cAAcqF,OAAOqH,EAAE,CAClC,EACF;CAAC,CACF;CAAC,IAAA7E;CAAA,IAAAb,EAAA,OAAAE,OAAA+C,QAAA;EAE4CpC,KAAAyC,SAASpD,OAAM+C,MAAO;EAACjD,EAAA,KAAAE,OAAA+C;EAAAjD,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,OAAAa,MAAAb,EAAA,OAAAR,MAAA;EAA9DuB,KAAA,oBAAC,cAAD;GAA6BvB,eAAAA;GAAI,GAAMqB;EAAuB,CAAA;EAAIb,EAAA,KAAAa;EAAAb,EAAA,KAAAR;EAAAQ,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAAlEe;AAAkE;AAK3E,SAASD,QAAQzC,OAAuB;CACtC,OAAO,EAAEA,MAAM;AACjB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","Ref","DimensionValue","StyleProp","ViewProps","ViewStyle","AnimatedStyle","SharedValue","I18nManager","StyleSheet","View","Animated","useAnimatedProps","useAnimatedStyle","useDerivedValue","useReducedMotion","Svg","Path","IndicatorColors","IndicatorTone","Curve","Keyframe","RingWave","HIDDEN","activeLength","fillOf","IndicatorLabels","IndicatorLine","readingOf","useEased","useIndicatorColors","useMeasuredWidth","keyframeAt","useLoop","arcPath","TURN","WAVE_HEIGHT","WAVE_ORIGIN","wavePath","wavyArcPath","DETERMINATE_EASING","GAP","stylesOf","indicatorStylesOf","THICKNESS","parseLength","useTheme","composeStyles","themedStyles","Bar","scale","start","translate","ProgressIndicatorProps","Omit","buffer","diameter","formatOptions","Intl","NumberFormatOptions","isIndeterminate","label","locale","maxValue","minValue","ref","shape","ProgressIndicatorShape","showValue","style","tone","ProgressIndicatorTone","value","valueLabel","variant","ProgressIndicatorVariant","Extract","CIRCULAR_SIZE","RADIUS","ARC_MS","CYCLE_MS","ROTATE_MS","Math","round","RING_EASING","RING_SETTLE","INDETERMINATE_MS","BUFFER_MS","LINE_SLOWDOWN","RING_SLOWDOWN","WAVE_WAVELENGTH","INDETERMINATE_WAVELENGTH","WAVE_REACH","WAVE_FROM","WAVE_UNTIL","WAVY_SIZE","RING_AMPLITUDE","RING_WAVELENGTH","WAVY_RADIUS","RING_WAVE","amplitude","centre","radius","waves","PITCH","PRIMARY_BAR","SECONDARY_BAR","EXPAND_ARC","TRAVEL_ARC","AnimatedPath","createAnimatedComponent","styles","create","bar","height","left","position","top","transformOrigin","buffered","flexShrink","dot","width","dotRow","flexDirection","gap","dots","flexGrow","minWidth","overflow","line","alignSelf","justifyContent","mirrored","transform","scaleX","rootCircular","alignItems","row","track","absoluteFill","wave","wavyLine","radii","borderRadius","pill","circle","Buffer","t0","$","_c","colors","share","theme","own","reduceMotion","clock","direction","isRTL","scroll","translateX","get","t1","widthOf","t2","T0","t4","t5","t6","dotsFor","map","t7","t8","t3","t9","bufferShare","percentage","undefined","range","remaining","min","max","CircularTrack","motion","wavy","box","circumference","durationLong2","duration","easing","timing","shown","fade","isWaving","slowdown","arc","cycle","turn","active","opacity","from","d","length","strokeOf","DeterminateLine","durationMedium1","under","Array","ceil","_","index","IndeterminateBars","primary","useBarStyle","secondary","IndeterminateLine","LinearTrack","onLayout","LineWave","Symbol","for","ProgressIndicator","ariaLabel","props","reading","text","t10","root","RingWavePath","phase","color","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","const","time","WaveBar","to","_c","indicatorStylesOf"],"sources":["../../../src/components/progress-indicator/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type {\n DimensionValue,\n StyleProp,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport { I18nManager, StyleSheet, View } from 'react-native'\nimport Animated, {\n useAnimatedProps,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n} from 'react-native-reanimated'\nimport Svg, { Path } from 'react-native-svg'\n\nimport type { IndicatorColors, IndicatorTone } from '../../indicator'\nimport type { Curve, Keyframe } from '../../indicator/motion'\nimport type { RingWave } from '../../indicator/paths'\n\nimport { HIDDEN } from '../../glyphs/hidden'\nimport {\n activeLength,\n fillOf,\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n} from '../../indicator'\nimport { keyframeAt, useLoop } from '../../indicator/motion'\nimport {\n arcPath,\n TURN,\n WAVE_HEIGHT,\n WAVE_ORIGIN,\n wavePath,\n wavyArcPath,\n} from '../../indicator/paths'\nimport {\n DETERMINATE_EASING,\n GAP,\n stylesOf as indicatorStylesOf,\n THICKNESS,\n} from '../../indicator/styles'\nimport { parseLength } from '../../theme/resolve'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// The progress indicators page's indicator, as kanso-ui's ProgressIndicator\n// draws it: a line or a ring, in either of the page's two shapes, flat and\n// wavy. Both carry the three parts the page's anatomy names, the active\n// indicator in primary, the track in secondary container and, on the line,\n// the stop indicator in primary at the end, at the page's 4dp thickness with\n// the 4dp gap its measurements give either side of the track. The flat ring\n// is the page's default 40dp of the four sizes it draws, and the wavy ring the\n// 48dp its wave needs room for.\n//\n// The determinate line is src/indicator's, which Meter draws too: the active\n// indicator takes the value's share of what the gaps and the stop leave, and\n// the track takes the rest. The determinate ring is two arcs of one circle:\n// the active arc runs clockwise from the top for its share of the\n// circumference, and the track picks up 4dp past it and stops 4dp before it\n// comes back round, which is the same gap measured along the curve.\n//\n// The animations are Material's own, with web's numbers: the line's two bars\n// and their four keyframe sets, the buffer's scrolling dots, the ring's 1333ms\n// arc, its four-arc cycle and its 1568ms rotation, and the 250ms and 500ms a\n// determinate value moves over. React Native has no CSS keyframes, so each\n// set is a list of the same frames read off a looping clock on the UI thread,\n// in src/indicator/motion.ts.\n//\n// Under reduced motion the motion slows rather than stopping, as web's does:\n// an indicator that freezes stops saying the work is going on, and a frozen\n// arc caught at its short end reads as broken. The multipliers are web's, two\n// for the line and a quarter more for the ring. A determinate value jumps\n// there instead of easing, as web's transition drops to `0s`.\n//\n// The wavy shape draws the active indicator as a wave and leaves the track and\n// the stop flat, as the page does, with web's numbers, which are Material's\n// own: on the line a 3dp amplitude, a 40dp wavelength and a 10dp row, with a\n// 20dp wavelength while indeterminate; on the ring a 1.6dp amplitude and a\n// 15dp wavelength, rounded to a whole number of waves so the wave closes on\n// itself. A determinate wave lies flat up to a tenth of the way and from 95%\n// on, and is drawn over the flat drawing, the two crossfading as the value\n// crosses those bounds. The flat drawing is also what a reader who has asked\n// for reduced motion sees, since a wave is motion even standing still, and\n// what a line wider than `WAVE_REACH` is drawn as.\n//\n// Web cuts its arcs and waves out of whole curves with dash patterns; here\n// each is a path built from where it starts and how far it runs, for the\n// reason src/indicator/paths.ts gives.\n//\n// The root carries the role, the range, the value and its text, which React\n// Aria's `useProgressBar` gives web's, so a screen reader hears the label and\n// the value as one element. The value is read as React Aria reads it: clamped\n// to the range, and written as a percentage unless `formatOptions` says\n// otherwise, in `locale`.\n\n/** A bar of the indeterminate line, as web's keyframes move it. */\ntype Bar = {\n /** Its scale across, from its start. */\n readonly scale: readonly Keyframe[]\n /** Where it starts, as a share of the row before the row's own start. */\n readonly start: number\n /** How far it has travelled from there, as a share of the row. */\n readonly translate: readonly Keyframe[]\n}\n\ntype ProgressIndicatorProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * How far the work is loaded ahead of the value, a video's buffered\n * seconds or a queue's fetched pages. Read on the same scale as `value`:\n * the track is solid up to it and dotted beyond. Ignored while the\n * indicator is indeterminate and by the ring, and left out for work with\n * nothing to buffer.\n */\n readonly buffer?: number\n /**\n * How wide the ring is drawn, as a CSS length read the way a theme's\n * lengths are. Everything inside scales with it, so a ring in a button can\n * take the button's icon size. The length is in px, since a relative unit\n * has nothing on native to be relative to. Ignored by the line, which fills\n * the width it is given.\n * @default '40px', or '48px' for the wavy ring\n */\n readonly diameter?: `${number}px`\n /**\n * How the value reads.\n * @default { style: 'percent' }\n */\n readonly formatOptions?: Intl.NumberFormatOptions\n /**\n * For work whose length is not known: the indicator runs on its own, and\n * has no value to show or announce.\n * @default false\n */\n readonly isIndeterminate?: boolean\n /**\n * What the work is, shown above the indicator. A screen reader reads it as\n * the indicator's name; an indicator whose surroundings name it takes\n * `aria-label` instead and leaves this out.\n */\n readonly label?: string\n /**\n * The BCP 47 locale the value is written in. Defaults to the device's.\n */\n readonly locale?: string\n /**\n * The value at which the work is done.\n * @default 100\n */\n readonly maxValue?: number\n /**\n * The value at which the work starts.\n * @default 0\n */\n readonly minValue?: number\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The page's two shapes. `wavy` draws the active indicator as a wave, which\n * lies flat near either end of a determinate value, and leaves the track\n * and the stop flat; the wavy ring is 48dp across rather than 40. Under\n * reduced motion a wavy indicator is drawn flat.\n * @default 'flat'\n */\n readonly shape?: ProgressIndicatorShape\n /**\n * Whether the value is shown beside the label. Ignored while the indicator\n * is indeterminate, which has no value to show.\n * @default false\n */\n readonly showValue?: boolean\n readonly style?: StyleProp<ViewStyle>\n /**\n * Which colours it is drawn in. `primary` is the page's own pair, the active\n * indicator in primary over a secondary container track, and `inherit`\n * takes the colour of the slot it sits in, for an indicator inside something\n * that already has one, such as a button, where primary would be the fill.\n * @default 'primary'\n */\n readonly tone?: ProgressIndicatorTone\n /**\n * How far the work has gone, between `minValue` and `maxValue`.\n * @default 0\n */\n readonly value?: number\n /** The value as words, in place of the number `formatOptions` writes. */\n readonly valueLabel?: string\n /**\n * The line the page draws, or the ring: `linear` fills the width it is\n * given, `circular` is 40dp across.\n * @default 'linear'\n */\n readonly variant?: ProgressIndicatorVariant\n}\n\ntype ProgressIndicatorShape = 'flat' | 'wavy'\n\n// The two of the shared line's four tones an indicator draws. The other two\n// say how a measurement reads, which is a meter's business rather than a\n// running task's.\ntype ProgressIndicatorTone = Extract<IndicatorTone, 'inherit' | 'primary'>\n\ntype ProgressIndicatorVariant = 'circular' | 'linear'\n\n// The flat ring. The radius is the diameter less the stroke, halved, so the\n// stroke sits inside the 40dp box rather than straddling its edge.\nconst CIRCULAR_SIZE = 40\nconst RADIUS = (CIRCULAR_SIZE - THICKNESS) / 2\n\n// The ring's timings. The arc is 1333ms; a full cycle is four of them; and the\n// rotation is the arc scaled by 360/306, which is the arc's start rotation plus\n// the circle less the arc's size. A determinate ring moves on Material's own\n// curve rather than the line's.\nconst ARC_MS = 1333\nconst CYCLE_MS = ARC_MS * 4\nconst ROTATE_MS = Math.round((ARC_MS * 360) / 306)\nconst RING_EASING: Curve = [0.4, 0, 0.2, 1]\nconst RING_SETTLE: Curve = [0, 0, 0.2, 1]\n\n// The line's own: 2s for an indeterminate pass, and the 250ms the buffer's\n// dots take to scroll one pitch.\nconst INDETERMINATE_MS = 2000\nconst BUFFER_MS = 250\n\n// What reduced motion slows each shape by.\nconst LINE_SLOWDOWN = 2\nconst RING_SLOWDOWN = 1.25\n\n// The wavy line's two wavelengths, and how far the wave runs: a row wider than\n// that draws flat, as web's does.\nconst WAVE_WAVELENGTH = 40\nconst INDETERMINATE_WAVELENGTH = 20\nconst WAVE_REACH = 2048\n\n// Where a determinate wave stands up and where it lies down again, as\n// percentages of the way.\nconst WAVE_FROM = 10\nconst WAVE_UNTIL = 95\n\n// The wavy ring: the 48dp box, and the wave round the circle pulled in by the\n// amplitude so its crests stay inside the box. The wave count is the\n// wavelength's share of that circle, rounded, which is nine.\nconst WAVY_SIZE = 48\nconst RING_AMPLITUDE = 1.6\nconst RING_WAVELENGTH = 15\nconst WAVY_RADIUS = (WAVY_SIZE - THICKNESS) / 2 - RING_AMPLITUDE\n\nconst RING_WAVE: RingWave = {\n amplitude: RING_AMPLITUDE,\n centre: WAVY_SIZE / 2,\n radius: WAVY_RADIUS,\n waves: Math.round((TURN * WAVY_RADIUS) / RING_WAVELENGTH),\n}\n\n// The buffer's dots: the track's colour, at the stroke's size, one pitch of\n// two and a half strokes apart.\nconst PITCH = THICKNESS * 2.5\n\n// The two bars of the indeterminate line, translated and scaled at once, with\n// web's keyframes, which are Material's.\nconst PRIMARY_BAR: Bar = {\n scale: [\n [0, 0.08],\n [0.3665, 0.08, [0.334731, 0.12482, 0.785844, 1]],\n [0.6915, 0.661479, [0.06, 0.11, 0.6, 1]],\n [1, 0.08],\n ],\n start: -1.45167,\n translate: [\n [0, 0],\n [0.2, 0, [0.5, 0, 0.701732, 0.495819]],\n [0.5915, 0.836714, [0.302435, 0.381352, 0.55, 0.956352]],\n [1, 2.00611],\n ],\n}\n\nconst SECONDARY_BAR: Bar = {\n scale: [\n [0, 0.08, [0.205028, 0.057051, 0.57661, 0.453971]],\n [0.1915, 0.457104, [0.152313, 0.196432, 0.648374, 1.00432]],\n [0.4415, 0.72796, [0.257759, -0.003163, 0.211762, 1.38179]],\n [1, 0.08],\n ],\n start: -0.548889,\n translate: [\n [0, 0, [0.15, 0, 0.515058, 0.409685]],\n [0.25, 0.376519, [0.31033, 0.284058, 0.8, 0.733712]],\n [0.4835, 0.843862, [0.4, 0.627035, 0.6, 0.902026]],\n [1, 1.60278],\n ],\n}\n\n// The indeterminate ring's arc, as a share of the way round. Material\n// contracts it to 10 degrees of turn and grows it to 270; web draws the short\n// end at 8% rather than 10 degrees, since a round cap on so short an arc draws\n// a dot, and this is web's.\nconst EXPAND_ARC: readonly Keyframe[] = [\n [0, 0.08, RING_EASING],\n [0.5, 0.75, RING_EASING],\n [1, 0.08],\n]\n\n// Where the arc starts, in turns. Material turns it in eight steps of 135\n// degrees rather than at a constant rate, each on the arc's own curve, so it\n// settles at each position and springs to the next: three full turns over the\n// cycle, under the rotation's own single turn.\nconst TRAVEL_ARC: readonly Keyframe[] = [\n [0, 0, RING_EASING],\n [0.125, 0.375, RING_EASING],\n [0.25, 0.75, RING_EASING],\n [0.375, 1.125, RING_EASING],\n [0.5, 1.5, RING_EASING],\n [0.625, 1.875, RING_EASING],\n [0.75, 2.25, RING_EASING],\n [0.875, 2.625, RING_EASING],\n [1, 3],\n]\n\nconst AnimatedPath = Animated.createAnimatedComponent(Path)\n\nconst styles = StyleSheet.create({\n // A bar of the indeterminate line: the row's width, scaled from its start\n // and travelling across. Physical rather than logical, as web's are: the\n // keyframes move one way only, so the direction is handled once, by\n // mirroring the row.\n bar: {\n height: THICKNESS,\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'left center',\n },\n // The solid part of a buffered track, as far as the buffer reaches.\n buffered: {\n flexShrink: 0,\n height: THICKNESS,\n },\n dot: {\n height: THICKNESS,\n width: THICKNESS,\n },\n // The dots, scrolling one pitch toward the start of the line and starting\n // again.\n dotRow: {\n flexDirection: 'row',\n gap: PITCH - THICKNESS,\n },\n // What the buffer leaves of the track, which the dots fill.\n dots: {\n flexGrow: 1,\n flexShrink: 1,\n height: THICKNESS,\n minWidth: 0,\n overflow: 'hidden',\n },\n // The flat line's row, whose width the line is drawn to.\n line: {\n alignSelf: 'stretch',\n justifyContent: 'center',\n },\n mirrored: {\n transform: [{ scaleX: -1 }],\n },\n // A circular indicator is its own size rather than the room it is given.\n rootCircular: {\n alignItems: 'flex-start',\n },\n // The indeterminate line's row, which clips its bars at both ends.\n row: {\n alignSelf: 'stretch',\n height: THICKNESS,\n overflow: 'hidden',\n },\n // The track behind the indeterminate line's bars.\n track: {\n ...StyleSheet.absoluteFill,\n },\n // A wave over the line: the row's whole box, mirrored under a right-to-left\n // layout so it starts at the start of the line.\n wave: {\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n },\n // The wavy line's row: the wave's 10dp, with the flat line through its\n // middle.\n wavyLine: {\n alignSelf: 'stretch',\n height: WAVE_HEIGHT,\n justifyContent: 'center',\n },\n})\n\nconst stylesOf = themedStyles(({ radii }) =>\n StyleSheet.create({\n // The bars carry the pill every other part of the line draws. It is drawn\n // under the bar's own scale, so it flattens as the bar narrows, as web's\n // and Material's do.\n bar: { borderRadius: radii.pill },\n dot: { borderRadius: radii.circle },\n row: { borderRadius: radii.pill },\n }),\n)\n\n/**\n * The dots beyond the buffer, scrolling toward the start of the line. There\n * is one more of them than the row has room for, so the row stays full as\n * they move.\n */\nfunction Buffer({\n colors,\n share,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly share: number\n readonly width: number\n}) {\n const theme = useTheme()\n const own = stylesOf(theme)\n const reduceMotion = useReducedMotion()\n const clock = useLoop(BUFFER_MS * (reduceMotion ? LINE_SLOWDOWN : 1), true)\n // A translation is not mirrored under a right-to-left layout, though the\n // row is, so the dots travel the other way there.\n const direction = I18nManager.isRTL ? -1 : 1\n const scroll = useAnimatedStyle(() => {\n 'worklet'\n return { transform: [{ translateX: -PITCH * clock.get() * direction }] }\n })\n\n return (\n <>\n <View\n style={composeStyles<ViewStyle>(\n styles.buffered,\n fillOf(colors.track),\n widthOf(`${share}%`),\n )}\n />\n <View style={styles.dots}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(styles.dotRow, scroll)}\n >\n {dotsFor(width).map((dot) => (\n <View\n key={dot}\n style={composeStyles<ViewStyle>(\n styles.dot,\n own.dot,\n fillOf(colors.track),\n )}\n />\n ))}\n </Animated.View>\n </View>\n </>\n )\n}\n\n// How much of the track the buffer covers. The buffer is read on the value's\n// scale, and the track holds what the value has not taken, so the solid part\n// is the buffer's share of that remainder, as web's `bufferShare` gives it.\nfunction bufferShare(\n buffer: number | undefined,\n percentage: number,\n minValue: number,\n maxValue: number,\n) {\n if (buffer === undefined) {\n return undefined\n }\n const range = maxValue - minValue\n const buffered = range === 0 ? 0 : ((buffer - minValue) / range) * 100\n const remaining = 100 - percentage\n if (remaining <= 0) {\n return 0\n }\n return Math.min(100, Math.max(0, ((buffered - percentage) / remaining) * 100))\n}\n\n/**\n * The ring: two arcs of one circle while determinate, one arc growing,\n * shrinking and travelling round while indeterminate, and for the wavy shape a\n * wave over the active arc. Drawn on a box of its own size and scaled to the\n * diameter, so the stroke and the gap scale with it.\n */\nfunction CircularTrack({\n colors,\n diameter,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly colors: IndicatorColors\n readonly diameter: number\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion\n const box = wavy ? WAVY_SIZE : CIRCULAR_SIZE\n const centre = box / 2\n const radius = wavy ? WAVY_RADIUS : RADIUS\n const circumference = TURN * radius\n const timing = { duration: motion.durationLong2, easing: RING_SETTLE }\n const shown = useEased(percentage, timing)\n const fade = useEased(\n waves && (isIndeterminate || isWaving(percentage)) ? 1 : 0,\n timing,\n )\n const slowdown = reduceMotion ? RING_SLOWDOWN : 1\n const arc = useLoop(ARC_MS * slowdown, isIndeterminate)\n const cycle = useLoop(CYCLE_MS * slowdown, isIndeterminate)\n const turn = useLoop(Math.round(ROTATE_MS * slowdown), isIndeterminate)\n\n // The active arc, or the indeterminate one: it grows and shrinks over the\n // arc's duration, its start travels the circle over the cycle, and the\n // whole of it turns over the rotation's. An indeterminate ring starts at\n // three o'clock, as web's does once its spin replaces the quarter turn back\n // that puts a determinate one's start at the top.\n const active = useAnimatedProps(() => {\n 'worklet'\n const opacity = 1 - fade.get()\n if (isIndeterminate) {\n const from =\n TURN / 4 + TURN * (turn.get() + keyframeAt(TRAVEL_ARC, cycle.get()))\n return {\n d: arcPath(\n centre,\n radius,\n from,\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity,\n }\n }\n return {\n d: arcPath(centre, radius, 0, (TURN * shown.get()) / 100),\n opacity,\n }\n })\n // The track picks up a gap past the active arc and stops a gap before the\n // top.\n const track = useAnimatedProps(() => {\n 'worklet'\n const length = (circumference * shown.get()) / 100\n return {\n d: arcPath(\n centre,\n radius,\n (length + GAP) / radius,\n Math.max(0, circumference - length - 2 * GAP) / radius,\n ),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={diameter}\n viewBox={`0 0 ${box} ${box}`}\n width={diameter}\n >\n {isIndeterminate ? null : (\n <AnimatedPath animatedProps={track} {...strokeOf(colors.track)} />\n )}\n <AnimatedPath animatedProps={active} {...strokeOf(colors.active)} />\n {waves ? (\n <RingWavePath\n arc={arc}\n colors={colors}\n cycle={cycle}\n fade={fade}\n isIndeterminate={isIndeterminate}\n shown={shown}\n turn={turn}\n />\n ) : null}\n </Svg>\n )\n}\n\n/**\n * The line determinate: src/indicator's, with the buffer in its track, and\n * for the wavy shape a wave over its active indicator, crossfading with it as\n * the value crosses the bounds the wave stands between.\n */\nfunction DeterminateLine({\n buffer,\n colors,\n percentage,\n waves,\n width,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly percentage: number\n readonly waves: boolean\n readonly width: number\n}) {\n const { motion } = useTheme()\n const timing = {\n duration: motion.durationMedium1,\n easing: DETERMINATE_EASING,\n }\n const shown = useEased(percentage, timing)\n const fade = useEased(waves && isWaving(percentage) ? 1 : 0, timing)\n const under = useDerivedValue(() => 1 - fade.get())\n\n return (\n <>\n <IndicatorLine\n activeOpacity={waves ? under : undefined}\n colors={colors}\n percentage={shown}\n width={width}\n >\n {buffer === undefined ? undefined : (\n <Buffer colors={colors} share={buffer} width={width} />\n )}\n </IndicatorLine>\n {waves ? (\n <LineWave colors={colors} fade={fade} shown={shown} width={width} />\n ) : null}\n </>\n )\n}\n\n// One key for each dot the buffer draws across `width`.\nfunction dotsFor(width: number) {\n return Array.from(\n { length: Math.ceil(width / PITCH) + 1 },\n (_, index) => index,\n )\n}\n\n// The flat bars of the indeterminate line.\nfunction IndeterminateBars({\n clock,\n colors,\n width,\n}: {\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const primary = useBarStyle(clock, PRIMARY_BAR, width)\n const secondary = useBarStyle(clock, SECONDARY_BAR, width)\n\n return (\n <>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n primary,\n )}\n />\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.bar,\n own.bar,\n widthOf(width),\n fillOf(colors.active),\n secondary,\n )}\n />\n </>\n )\n}\n\n/**\n * The line indeterminate: the track, with two bars crossing it, or for the\n * wavy shape two stretches of a wave crossing it where the bars would be. The\n * row is mirrored under a right-to-left layout, which makes the sweep travel\n * the way the line reads while the bars move as Material's keyframes say.\n */\nfunction IndeterminateLine({\n colors,\n waves,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly waves: boolean\n readonly width: number\n}) {\n const own = stylesOf(useTheme())\n const reduceMotion = useReducedMotion()\n const clock = useLoop(\n INDETERMINATE_MS * (reduceMotion ? LINE_SLOWDOWN : 1),\n true,\n )\n const mirrored = I18nManager.isRTL ? styles.mirrored : undefined\n\n return (\n <>\n <View style={composeStyles<ViewStyle>(styles.row, own.row, mirrored)}>\n <View\n style={composeStyles<ViewStyle>(styles.track, fillOf(colors.track))}\n />\n {waves ? null : (\n <IndeterminateBars clock={clock} colors={colors} width={width} />\n )}\n </View>\n {waves ? (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(styles.wave, mirrored)}\n width={width}\n >\n <WaveBar\n bar={PRIMARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n <WaveBar\n bar={SECONDARY_BAR}\n clock={clock}\n colors={colors}\n width={width}\n />\n </Svg>\n ) : null}\n </>\n )\n}\n\n// Whether a determinate wave stands at this value; see `WAVE_FROM`.\nfunction isWaving(percentage: number) {\n return percentage > WAVE_FROM && percentage < WAVE_UNTIL\n}\n\n/**\n * The line, measured: the row is laid out first and the line drawn to its\n * width, which is what web's `calc()` and container units do without a\n * measurement.\n */\nfunction LinearTrack({\n buffer,\n colors,\n isIndeterminate,\n percentage,\n shape,\n}: {\n readonly buffer: number | undefined\n readonly colors: IndicatorColors\n readonly isIndeterminate: boolean\n readonly percentage: number\n readonly shape: ProgressIndicatorShape\n}) {\n const { onLayout, width } = useMeasuredWidth()\n const reduceMotion = useReducedMotion()\n const wavy = shape === 'wavy'\n const waves = wavy && !reduceMotion && width <= WAVE_REACH\n\n return (\n <View onLayout={onLayout} style={wavy ? styles.wavyLine : styles.line}>\n {isIndeterminate ? (\n <IndeterminateLine colors={colors} waves={waves} width={width} />\n ) : (\n <DeterminateLine\n buffer={buffer}\n colors={colors}\n percentage={percentage}\n waves={waves}\n width={width}\n />\n )}\n </View>\n )\n}\n\n/** The determinate line's wave, cut to the active indicator's length. */\nfunction LineWave({\n colors,\n fade,\n shown,\n width,\n}: {\n readonly colors: IndicatorColors\n readonly fade: SharedValue<number>\n readonly shown: SharedValue<number>\n readonly width: number\n}) {\n // The active indicator's length less the half stroke each round cap adds at\n // either end, as web's `waveAt` gives it.\n const wave = useAnimatedProps(() => {\n 'worklet'\n const length = Math.max(0, activeLength(width, shown.get()) - THICKNESS)\n return {\n d: wavePath(WAVE_WAVELENGTH, WAVE_ORIGIN, WAVE_ORIGIN + length),\n opacity: fade.get(),\n }\n })\n\n return (\n <Svg\n {...HIDDEN}\n height={WAVE_HEIGHT}\n style={composeStyles<ViewStyle>(\n styles.wave,\n I18nManager.isRTL ? styles.mirrored : undefined,\n )}\n width={width}\n >\n <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n </Svg>\n )\n}\n\n/**\n * Progress through a task, as a line or a ring. Pass `value` between\n * `minValue` and `maxValue`, or set `isIndeterminate` for work whose length is\n * not known. `formatOptions` says how the value reads, in `locale`, and\n * `buffer` marks how far the work is loaded ahead of it.\n *\n * ```tsx\n * <ProgressIndicator label=\"Label\" showValue value={40} />\n * ```\n *\n * A screen reader hears it as a progress bar named by its label, with its\n * value as `formatOptions` writes it, and no value while it is indeterminate.\n * `style`, `ref` and `testID` land on the indicator as a whole, which is the\n * view a layout positions.\n */\nfunction ProgressIndicator({\n 'aria-label': ariaLabel,\n buffer,\n diameter,\n formatOptions,\n isIndeterminate = false,\n label,\n locale,\n maxValue = 100,\n minValue = 0,\n shape = 'flat',\n showValue = false,\n style,\n tone = 'primary',\n value = 0,\n valueLabel,\n variant = 'linear',\n ...props\n}: ProgressIndicatorProps) {\n const theme = useTheme()\n const colors = useIndicatorColors(tone)\n const reading = readingOf({\n formatOptions,\n locale,\n maxValue,\n minValue,\n value,\n valueLabel,\n })\n const text = isIndeterminate ? undefined : reading.text\n\n return (\n <View\n accessible\n aria-label={label ?? ariaLabel}\n aria-valuemax={maxValue}\n aria-valuemin={minValue}\n aria-valuenow={isIndeterminate ? undefined : reading.value}\n aria-valuetext={text}\n role=\"progressbar\"\n {...props}\n style={composeStyles<ViewStyle>(\n indicatorStylesOf(theme).root,\n variant === 'circular' ? styles.rootCircular : undefined,\n style,\n )}\n >\n <IndicatorLabels label={label} value={showValue ? text : undefined} />\n {variant === 'circular' ? (\n <CircularTrack\n colors={colors}\n diameter={\n (diameter === undefined ? undefined : parseLength(diameter)) ??\n (shape === 'wavy' ? WAVY_SIZE : CIRCULAR_SIZE)\n }\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n ) : (\n <LinearTrack\n buffer={bufferShare(buffer, reading.percentage, minValue, maxValue)}\n colors={colors}\n isIndeterminate={isIndeterminate}\n percentage={reading.percentage}\n shape={shape}\n />\n )}\n </View>\n )\n}\n\n/**\n * The wave over the ring's active arc, cut by the same lengths, or running\n * round as the indeterminate arc does. Its crests turn with the ring.\n */\nfunction RingWavePath({\n arc,\n colors,\n cycle,\n fade,\n isIndeterminate,\n shown,\n turn,\n}: {\n readonly arc: SharedValue<number>\n readonly colors: IndicatorColors\n readonly cycle: SharedValue<number>\n readonly fade: SharedValue<number>\n readonly isIndeterminate: boolean\n readonly shown: SharedValue<number>\n readonly turn: SharedValue<number>\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n if (isIndeterminate) {\n const phase = TURN / 4 + TURN * turn.get()\n return {\n d: wavyArcPath(\n RING_WAVE,\n phase,\n phase + TURN * keyframeAt(TRAVEL_ARC, cycle.get()),\n TURN * keyframeAt(EXPAND_ARC, arc.get()),\n ),\n opacity: fade.get(),\n }\n }\n return {\n d: wavyArcPath(RING_WAVE, 0, 0, (TURN * shown.get()) / 100),\n opacity: fade.get(),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// What every curve of the indicator is stroked with: the colour, at the 4dp\n// thickness, with round ends and joins, and no fill.\nfunction strokeOf(color: string) {\n return {\n fill: 'none',\n stroke: color,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: THICKNESS,\n } as const\n}\n\n/**\n * A bar of the indeterminate line where the clock has it: its start, and its\n * scale from there, both as web's keyframes give them in shares of the row.\n */\nfunction useBarStyle(clock: SharedValue<number>, bar: Bar, width: number) {\n return useAnimatedStyle(() => {\n 'worklet'\n const time = clock.get()\n return {\n transform: [\n { translateX: (bar.start + keyframeAt(bar.translate, time)) * width },\n { scaleX: keyframeAt(bar.scale, time) },\n ],\n }\n })\n}\n\n/**\n * A bar of the indeterminate line drawn as a stretch of the wave: from where\n * the flat bar starts, as long as the flat bar is, and nothing of it before\n * the wave's own start.\n */\nfunction WaveBar({\n bar,\n clock,\n colors,\n width,\n}: {\n readonly bar: Bar\n readonly clock: SharedValue<number>\n readonly colors: IndicatorColors\n readonly width: number\n}) {\n const wave = useAnimatedProps(() => {\n 'worklet'\n const time = clock.get()\n const from =\n WAVE_ORIGIN + (bar.start + keyframeAt(bar.translate, time)) * width\n const to = from + keyframeAt(bar.scale, time) * width\n return {\n d: wavePath(\n INDETERMINATE_WAVELENGTH,\n Math.max(WAVE_ORIGIN, from),\n Math.min(WAVE_ORIGIN + width, to),\n ),\n }\n })\n\n return <AnimatedPath animatedProps={wave} {...strokeOf(colors.active)} />\n}\n\n// A view's width, built by a call rather than written inline at the prop,\n// which is what react-perf's no-new-object-as-prop is after.\nfunction widthOf(width: DimensionValue) {\n return { width }\n}\n\nexport { ProgressIndicator }\nexport type {\n ProgressIndicatorProps,\n ProgressIndicatorShape,\n ProgressIndicatorTone,\n ProgressIndicatorVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;AAmNA,MAAM6E,gBAAgB;AACtB,MAAMC,SAAAA;AAMN,MAAMC,SAAS;AACf,MAAMC,WAAWD,SAAS;AAC1B,MAAME,YAAYC,KAAKC,MAAOJ,SAAS,MAAO,GAAG;AACjD,MAAMK,cAAqB;CAAC;CAAK;CAAG;CAAK;AAAC;AAC1C,MAAMC,cAAqB;CAAC;CAAG;CAAG;CAAK;AAAC;AAIxC,MAAMC,mBAAmB;AACzB,MAAMC,YAAY;AAGlB,MAAMC,gBAAgB;AACtB,MAAMC,gBAAgB;AAItB,MAAMC,kBAAkB;AACxB,MAAMC,2BAA2B;AACjC,MAAMC,aAAa;AAInB,MAAMC,YAAY;AAClB,MAAMC,aAAa;AAKnB,MAAMC,YAAY;AAClB,MAAMC,iBAAiB;AACvB,MAAMC,kBAAkB;AACxB,MAAMC,cAAAA;AAEN,MAAMC,YAAsB;CAC1BC,WAAWJ;CACXK,QAAQN,YAAY;CACpBO,QAAQJ;CACRK,OAAOrB,KAAKC,MAAOhD,OAAO+D,cAAeD,eAAe;AAC1D;AAIA,MAAMO,QAAAA;AAIN,MAAMC,cAAmB;CACvBvD,OAAO;EACL,CAAC,GAAG,GAAI;EACR;GAAC;GAAQ;GAAM;IAAC;IAAU;IAAS;IAAU;GAAC;EAAC;EAC/C;GAAC;GAAQ;GAAU;IAAC;IAAM;IAAM;IAAK;GAAC;EAAC;EACvC,CAAC,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AAM;AACjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
-
import { ReactNode, Ref } from "react";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
3
|
//#region src/components/radio-group/index.d.ts
|
|
4
4
|
/** Which way a `RadioGroup` lays out its buttons. */
|
|
5
5
|
type RadioGroupOrientation = 'horizontal' | 'vertical';
|
|
@@ -41,7 +41,7 @@ type RadioGroupProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
|
41
41
|
* @default 'vertical'
|
|
42
42
|
*/
|
|
43
43
|
readonly orientation?: RadioGroupOrientation;
|
|
44
|
-
readonly ref?: Ref<View
|
|
44
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
45
45
|
readonly style?: StyleProp<ViewStyle>;
|
|
46
46
|
/**
|
|
47
47
|
* The selected value, for a call site holding the state itself with
|
|
@@ -62,7 +62,7 @@ type RadioProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
|
62
62
|
* @default false
|
|
63
63
|
*/
|
|
64
64
|
readonly isDisabled?: boolean;
|
|
65
|
-
readonly ref?: Ref<View
|
|
65
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
66
66
|
readonly style?: StyleProp<ViewStyle>;
|
|
67
67
|
/** The entry this button stands for, which the group reports when chosen. */
|
|
68
68
|
readonly value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","Ref","StyleProp","TextStyle","ViewProps","ViewStyle","AnimatedStyle","RadioGroupState","createContext","use","useId","useMemo","Text","NativeText","Platform","Pressable","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","withTiming","useRadioGroupState","ResolvedTheme","ControlLabel","ControlMessage","describedBy","LAYER_SIZE","messageOf","controlStylesOf","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","RadioGroupContextValue","horizontal","state","RadioGroupOrientation","RadioGroupProps","Omit","children","defaultValue","description","error","isDisabled","isReadOnly","label","onChange","value","orientation","ref","style","RadioProps","Tone","RING_SIZE","RING_RULE","DOT_SIZE","LAYERS","Readonly","Record","hover","pressed","selected","unselected","RadioGroupContext","styles","create","dot","height","width","ring","alignItems","borderWidth","justifyContent","shrink","flexShrink","groupStylesOf","colors","radii","spacing","stateLayerOpacity","borderRadius","circle","items","flexDirection","itemsHorizontal","columnGap","lg","flexWrap","color","onSurfaceVariant","labelDisabled","onSurface","disabledContent","labelError","message","messageError","messageLine","marginTop","xs","root","rowGap","colorOf","active","isSelected","primary","lineOf","id","OS","undefined","Radio","t0","$","_c","ariaLabel","props","t1","ownDisabled","theme","group","messageId","Error","selectedValue","interactive","tone","t2","t3","t4","t5","t6","corners","disabled","disc","pressedColor","feedback","hovered","t7","useRingColor","T0","T1","T2","T3","t10","t11","t12","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","t8","t9","handlers","layer","own","t23","Symbol","for","selectOf","t24","row","backgroundColor","t25","t26","t27","t28","RadioGroup","labelId","labelRole","messageRole","context","invalid","setSelectedValue","motion","reduceMotion","timing","duration","durationShort2","easing","bezier","easingStandard","borderColor","_c","NativeText"],"sources":["../../../src/components/radio-group/index.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react'\nimport type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { RadioGroupState } from 'react-stately/useRadioGroupState'\n\nimport { createContext, use, useId, useMemo } from 'react'\nimport {\n Text as NativeText,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n withTiming,\n} from 'react-native-reanimated'\nimport { useRadioGroupState } from 'react-stately/useRadioGroupState'\n\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport {\n ControlLabel,\n ControlMessage,\n describedBy,\n LAYER_SIZE,\n messageOf,\n} from '../../control'\nimport { controlStylesOf } from '../../control/styles'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The radio button page, as kanso-ui's Radio draws it: a 20dp ring inside a\n// 40dp state layer, with a 48dp target. Unselected, the ring is 2dp of on\n// surface variant that turns on surface while hovered, pressed or focused;\n// selected, the ring and the 10dp dot inside it are primary. Disabled is on\n// surface at the disabled opacity for both. The state layer is on surface over\n// an unselected button and primary over a selected one while hovered, and the\n// two swap once pressed. The page draws no error state for the button itself:\n// an invalid group says so through its label and message, and the buttons\n// keep their colours.\n//\n// The ring eases between its colours over the motion tokens' short duration\n// on the standard curve, as web's transition does, and at once for a reader\n// who asks the device for reduced motion. The dot arrives with the selection,\n// as web's does.\n//\n// Two components from one module, since neither means anything without the\n// other: a radio button is a member of a group, and the group is what holds\n// the value. The group hands its React Stately state to its buttons through\n// context. Each button's row, label and the line under it are src/control's,\n// as Checkbox's are.\n//\n// The group is a column: its label in label large, the buttons, and the line\n// under them, 4dp apart, with the line a further 4dp down, as web's field\n// chrome sets them out. The label is on surface variant, error while the\n// group has one, and on surface at the disabled opacity while disabled.\n\ntype RadioGroupContextValue = {\n readonly horizontal: boolean\n readonly state: RadioGroupState\n}\n\n/** Which way a `RadioGroup` lays out its buttons. */\ntype RadioGroupOrientation = 'horizontal' | 'vertical'\n\ntype RadioGroupProps = Omit<ViewProps, 'children' | 'style'> & {\n /** The radio buttons, each with a `value` of its own. */\n readonly children?: ReactNode\n /** The value selected at first, when the group keeps its own state. */\n readonly defaultValue?: null | string\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state: the message and the label's colour\n * both follow from it.\n */\n readonly error?: string\n /**\n * Draws every button disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Shows the selection without letting a press change it.\n * @default false\n */\n readonly isReadOnly?: boolean\n /**\n * What the group is for. Required rather than optional: a set of radio\n * buttons with no name is a set a screen reader cannot introduce.\n */\n readonly label: string\n /** Called with the newly selected value whenever a press changes it. */\n readonly onChange?: (value: string) => void\n /**\n * Lays the buttons one under another, or along a line that wraps.\n * @default 'vertical'\n */\n readonly orientation?: RadioGroupOrientation\n readonly ref?: Ref<View>\n readonly style?: StyleProp<ViewStyle>\n /**\n * The selected value, for a call site holding the state itself with\n * `onChange`. `null` selects nothing.\n */\n readonly value?: null | string\n}\n\ntype RadioProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * The label, beside the button. A button that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n */\n readonly children?: ReactNode\n /** A hint under the label, read with the button. */\n readonly description?: string\n /**\n * Draws this button disabled, and takes no presses on it.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<View>\n readonly style?: StyleProp<ViewStyle>\n /** The entry this button stands for, which the group reports when chosen. */\n readonly value: string\n}\n\ntype Tone = 'selected' | 'unselected'\n\n// The ring's side and rule, and the dot's side, from the page.\nconst RING_SIZE = 20\nconst RING_RULE = 2\nconst DOT_SIZE = 10\n\n// The state layer's colour roles, hovered or focused and pressed. The two\n// swap once pressed.\nconst LAYERS: Readonly<\n Record<\n Tone,\n {\n readonly hover: keyof ResolvedTheme['colors']\n readonly pressed: keyof ResolvedTheme['colors']\n }\n >\n> = {\n selected: { hover: 'primary', pressed: 'onSurface' },\n unselected: { hover: 'onSurface', pressed: 'primary' },\n}\n\nconst RadioGroupContext = createContext<null | RadioGroupContextValue>(null)\n\nconst styles = StyleSheet.create({\n dot: {\n height: DOT_SIZE,\n width: DOT_SIZE,\n },\n ring: {\n alignItems: 'center',\n borderWidth: RING_RULE,\n height: RING_SIZE,\n justifyContent: 'center',\n width: RING_SIZE,\n },\n // A button along a line gives up width before it widens the line, so a\n // label longer than the line breaks inside it.\n shrink: {\n flexShrink: 1,\n },\n})\n\nconst groupStylesOf = themedStyles(\n ({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n dot: {\n borderRadius: radii.circle,\n },\n // The group's buttons, one under another.\n items: {\n flexDirection: 'column',\n },\n // Along a line instead, 16dp apart, wrapping when the line runs out.\n itemsHorizontal: {\n columnGap: spacing.lg,\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n label: {\n color: colors.onSurfaceVariant,\n },\n labelDisabled: {\n color: withOpacity(colors.onSurface, stateLayerOpacity.disabledContent),\n },\n labelError: {\n color: colors.error,\n },\n message: {\n color: colors.onSurfaceVariant,\n },\n messageError: {\n color: colors.error,\n },\n messageLine: {\n marginTop: spacing.xs,\n },\n ring: {\n borderRadius: radii.circle,\n },\n root: {\n flexDirection: 'column',\n rowGap: spacing.xs,\n },\n }),\n)\n\n/**\n * The colour the ring and the dot are drawn in. Hover, press and focus darken\n * only an unselected ring, and only one a press can change.\n */\nfunction colorOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n active,\n isDisabled,\n isSelected,\n }: {\n readonly active: boolean\n readonly isDisabled: boolean\n readonly isSelected: boolean\n },\n) {\n if (isDisabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n }\n\n if (isSelected) {\n return colors.primary\n }\n\n return active ? colors.onSurface : colors.onSurfaceVariant\n}\n\n/**\n * How the group is described by the line under it. On the web it points at\n * the line with `aria-describedby`, as web's group does. iOS and Android\n * focus the buttons rather than the group, so there the line is left where a\n * screen reader reaches it in order, after the last button.\n */\nfunction lineOf(id: string, message: string | undefined) {\n return Platform.OS === 'web' && message !== undefined\n ? { 'aria-describedby': id }\n : undefined\n}\n\n/**\n * One option of a `RadioGroup`, with its label and optionally a description\n * under it. It names the entry it stands for with `value`; the selection is\n * the group's, so a `Radio` is only ever drawn inside one.\n *\n * A screen reader hears it as a radio button named by its label, checked or\n * not, followed by the line under it. A press anywhere on the button or the\n * label selects it, and the row takes presses over the 48dp target the page\n * asks of the button. `style`, `ref` and `testID` land on the view holding\n * the row and the line under it, which is the element a layout positions.\n */\nfunction Radio({\n 'aria-label': ariaLabel,\n children,\n description,\n isDisabled: ownDisabled = false,\n style,\n value,\n ...props\n}: RadioProps) {\n const theme = useTheme()\n const group = use(RadioGroupContext)\n const messageId = useId()\n\n if (group === null) {\n throw new Error(\n 'A Radio is drawn inside a RadioGroup, which holds its selection.',\n )\n }\n\n const { colors, radii } = theme\n const { horizontal, state } = group\n const isDisabled = ownDisabled || state.isDisabled\n const isSelected = state.selectedValue === value\n const interactive = !isDisabled && !state.isReadOnly\n const tone: Tone = isSelected ? 'selected' : 'unselected'\n\n const feedback = usePressFeedback({\n color: colors[LAYERS[tone].hover],\n corners: { borderRadius: radii.circle },\n disabled: !interactive,\n disc: LAYER_SIZE,\n pressedColor: colors[LAYERS[tone].pressed],\n })\n const active =\n feedback.hovered || feedback.pressed || feedback.ring !== undefined\n const color = colorOf(theme, { active, isDisabled, isSelected })\n const ring = useRingColor(color)\n const own = groupStylesOf(theme)\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n horizontal ? styles.shrink : undefined,\n style,\n )}\n >\n <Pressable\n aria-checked={isSelected}\n aria-label={ariaLabel}\n role=\"radio\"\n {...describedBy(messageId, messageOf(description, undefined))}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop(LAYER_SIZE, LAYER_SIZE)}\n onPress={selectOf(state, value)}\n style={controlStylesOf(theme).row}\n >\n <View\n style={composeStyles<ViewStyle>(\n controlStylesOf(theme).disc,\n feedback.ring,\n )}\n >\n {feedback.layer}\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.ring,\n own.ring,\n ring,\n )}\n >\n {isSelected ? (\n <View\n style={composeStyles<ViewStyle>(styles.dot, own.dot, {\n backgroundColor: color,\n })}\n />\n ) : null}\n </Animated.View>\n </View>\n <ControlLabel isDisabled={isDisabled}>{children}</ControlLabel>\n </Pressable>\n <ControlMessage description={description} id={messageId} />\n </View>\n )\n}\n\n/**\n * A labelled set of radio buttons with one selected value between them. The\n * value is React Stately's, as web's is: pass `value` with `onChange` to\n * control it, or `defaultValue` to let the group keep its own, and each\n * `Radio` inside names the entry it stands for. Disabled, read-only and the\n * error state reach every button from here, and `orientation=\"horizontal\"`\n * lays the buttons along a line.\n *\n * ```tsx\n * <RadioGroup defaultValue=\"first\" label=\"Label\">\n * <Radio value=\"first\">First item</Radio>\n * <Radio value=\"second\">Second item</Radio>\n * </RadioGroup>\n * ```\n *\n * A screen reader hears it as a radio group named by its label. On the web\n * the line under it describes the group, as web's does; on iOS and Android\n * it is read after the buttons, where it sits. `style`, `ref` and `testID`\n * land on the group as a whole, which is the element a layout positions.\n */\nfunction RadioGroup({\n children,\n defaultValue,\n description,\n error,\n isDisabled = false,\n isReadOnly = false,\n label,\n onChange,\n orientation = 'vertical',\n style,\n value,\n ...props\n}: RadioGroupProps) {\n const theme = useTheme()\n const state = useRadioGroupState({\n defaultValue,\n isDisabled,\n isReadOnly,\n onChange,\n orientation,\n value,\n })\n const labelId = useId()\n const messageId = useId()\n const labelRole = useTypeRole('labelLarge')\n const messageRole = useTypeRole('bodySmall')\n\n const own = groupStylesOf(theme)\n const horizontal = orientation === 'horizontal'\n const context = useMemo(() => ({ horizontal, state }), [horizontal, state])\n const invalid = error !== undefined\n const message = messageOf(description, error)\n\n return (\n <View\n {...props}\n aria-labelledby={labelId}\n role=\"radiogroup\"\n {...lineOf(messageId, message)}\n style={composeStyles<ViewStyle>(own.root, style)}\n >\n <NativeText\n id={labelId}\n style={composeStyles<TextStyle>(\n labelRole,\n own.label,\n isDisabled ? own.labelDisabled : undefined,\n invalid ? own.labelError : undefined,\n )}\n >\n {label}\n </NativeText>\n <View\n style={composeStyles<ViewStyle>(\n own.items,\n horizontal ? own.itemsHorizontal : undefined,\n )}\n >\n <RadioGroupContext value={context}>{children}</RadioGroupContext>\n </View>\n {message === undefined ? null : (\n <View style={own.messageLine}>\n <NativeText\n id={messageId}\n style={composeStyles<TextStyle>(\n messageRole,\n own.message,\n invalid ? own.messageError : undefined,\n )}\n >\n {message}\n </NativeText>\n </View>\n )}\n </View>\n )\n}\n\n// A press's selection. Built by a call rather than declared in the\n// component, which is what react-perf's jsx-no-new-function-as-prop is after;\n// the React Compiler memoises the result on its inputs.\nfunction selectOf(state: RadioGroupState, value: string) {\n return () => {\n state.setSelectedValue(value)\n }\n}\n\n// The ring's colour, eased to as the state changes.\nfunction useRingColor(color: string) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n return useAnimatedStyle(() => {\n 'worklet'\n return {\n borderColor: reduceMotion ? color : withTiming(color, timing),\n }\n })\n}\n\nexport { Radio, RadioGroup }\nexport type { RadioGroupOrientation, RadioGroupProps, RadioProps }\n"],"mappings":";;;;;;;;;;;;;;AA4IA,MAAM0D,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,WAAW;AAIjB,MAAMC,SAQF;CACFK,UAAU;EAAEF,OAAO;EAAWC,SAAS;CAAY;CACnDE,YAAY;EAAEH,OAAO;EAAaC,SAAS;CAAU;AACvD;AAEA,MAAMG,oBAAoB5D,cAA6C,IAAI;AAE3E,MAAM6D,SAASrD,WAAWsD,OAAO;CAC/BC,KAAK;EACHC,QAAQZ;EACRa,OAAOb;CACT;CACAc,MAAM;EACJC,YAAY;EACZC,aAAajB;EACba,QAAQd;EACRmB,gBAAgB;EAChBJ,OAAOf;CACT;CAGAoB,QAAQ,EACNC,YAAY,EACd;AACF,CAAC;AAED,MAAMC,gBAAgB5C,cACnB,EAAE6C,QAAQC,OAAOC,SAASC,wBACzBpE,WAAWsD,OAAO;CAChBC,KAAK,EACHc,cAAcH,MAAMI,OACtB;CAEAC,OAAO,EACLC,eAAe,SACjB;CAEAC,iBAAiB;EACfC,WAAWP,QAAQQ;EACnBH,eAAe;EACfI,UAAU;CACZ;CACA1C,OAAO,EACL2C,O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AMO,cAAe;CAChD;CAAC,OAEMzK,uBAAiB;EAAA;EAAA,OAEf,EAAA0K,aACQP,eAAA1F,QAAuBvE,WAAWuE,OAAO2F,MAAM,EAC9D;CAAC,CACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","StyleProp","TextStyle","ViewProps","ViewStyle","AnimatedStyle","RadioGroupState","createContext","use","useId","useMemo","Text","NativeText","Platform","Pressable","StyleSheet","View","Animated","Easing","useAnimatedStyle","useReducedMotion","withTiming","useRadioGroupState","ResolvedTheme","ControlLabel","ControlMessage","describedBy","LAYER_SIZE","messageOf","controlStylesOf","hitSlop","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","useTypeRole","RadioGroupContextValue","horizontal","state","RadioGroupOrientation","RadioGroupProps","Omit","children","defaultValue","description","error","isDisabled","isReadOnly","label","onChange","value","orientation","ref","style","RadioProps","Tone","RING_SIZE","RING_RULE","DOT_SIZE","LAYERS","Readonly","Record","hover","pressed","selected","unselected","RadioGroupContext","styles","create","dot","height","width","ring","alignItems","borderWidth","justifyContent","shrink","flexShrink","groupStylesOf","colors","radii","spacing","stateLayerOpacity","borderRadius","circle","items","flexDirection","itemsHorizontal","columnGap","lg","flexWrap","color","onSurfaceVariant","labelDisabled","onSurface","disabledContent","labelError","message","messageError","messageLine","marginTop","xs","root","rowGap","colorOf","active","isSelected","primary","lineOf","id","OS","undefined","Radio","t0","$","_c","ariaLabel","props","t1","ownDisabled","theme","group","messageId","Error","selectedValue","interactive","tone","t2","t3","t4","t5","t6","corners","disabled","disc","pressedColor","feedback","hovered","t7","useRingColor","T0","T1","T2","T3","t10","t11","t12","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","t8","t9","handlers","layer","own","t23","Symbol","for","selectOf","t24","row","backgroundColor","t25","t26","t27","t28","RadioGroup","labelId","labelRole","messageRole","context","invalid","setSelectedValue","motion","reduceMotion","timing","duration","durationShort2","easing","bezier","easingStandard","borderColor","_c","NativeText"],"sources":["../../../src/components/radio-group/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { RadioGroupState } from 'react-stately/useRadioGroupState'\n\nimport { createContext, use, useId, useMemo } from 'react'\nimport {\n Text as NativeText,\n Platform,\n Pressable,\n StyleSheet,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n withTiming,\n} from 'react-native-reanimated'\nimport { useRadioGroupState } from 'react-stately/useRadioGroupState'\n\nimport type { ResolvedTheme } from '../../theme/scope'\n\nimport {\n ControlLabel,\n ControlMessage,\n describedBy,\n LAYER_SIZE,\n messageOf,\n} from '../../control'\nimport { controlStylesOf } from '../../control/styles'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The radio button page, as kanso-ui's Radio draws it: a 20dp ring inside a\n// 40dp state layer, with a 48dp target. Unselected, the ring is 2dp of on\n// surface variant that turns on surface while hovered, pressed or focused;\n// selected, the ring and the 10dp dot inside it are primary. Disabled is on\n// surface at the disabled opacity for both. The state layer is on surface over\n// an unselected button and primary over a selected one while hovered, and the\n// two swap once pressed. The page draws no error state for the button itself:\n// an invalid group says so through its label and message, and the buttons\n// keep their colours.\n//\n// The ring eases between its colours over the motion tokens' short duration\n// on the standard curve, as web's transition does, and at once for a reader\n// who asks the device for reduced motion. The dot arrives with the selection,\n// as web's does.\n//\n// Two components from one module, since neither means anything without the\n// other: a radio button is a member of a group, and the group is what holds\n// the value. The group hands its React Stately state to its buttons through\n// context. Each button's row, label and the line under it are src/control's,\n// as Checkbox's are.\n//\n// The group is a column: its label in label large, the buttons, and the line\n// under them, 4dp apart, with the line a further 4dp down, as web's field\n// chrome sets them out. The label is on surface variant, error while the\n// group has one, and on surface at the disabled opacity while disabled.\n\ntype RadioGroupContextValue = {\n readonly horizontal: boolean\n readonly state: RadioGroupState\n}\n\n/** Which way a `RadioGroup` lays out its buttons. */\ntype RadioGroupOrientation = 'horizontal' | 'vertical'\n\ntype RadioGroupProps = Omit<ViewProps, 'children' | 'style'> & {\n /** The radio buttons, each with a `value` of its own. */\n readonly children?: ReactNode\n /** The value selected at first, when the group keeps its own state. */\n readonly defaultValue?: null | string\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state: the message and the label's colour\n * both follow from it.\n */\n readonly error?: string\n /**\n * Draws every button disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Shows the selection without letting a press change it.\n * @default false\n */\n readonly isReadOnly?: boolean\n /**\n * What the group is for. Required rather than optional: a set of radio\n * buttons with no name is a set a screen reader cannot introduce.\n */\n readonly label: string\n /** Called with the newly selected value whenever a press changes it. */\n readonly onChange?: (value: string) => void\n /**\n * Lays the buttons one under another, or along a line that wraps.\n * @default 'vertical'\n */\n readonly orientation?: RadioGroupOrientation\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n /**\n * The selected value, for a call site holding the state itself with\n * `onChange`. `null` selects nothing.\n */\n readonly value?: null | string\n}\n\ntype RadioProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * The label, beside the button. A button that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n */\n readonly children?: ReactNode\n /** A hint under the label, read with the button. */\n readonly description?: string\n /**\n * Draws this button disabled, and takes no presses on it.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n /** The entry this button stands for, which the group reports when chosen. */\n readonly value: string\n}\n\ntype Tone = 'selected' | 'unselected'\n\n// The ring's side and rule, and the dot's side, from the page.\nconst RING_SIZE = 20\nconst RING_RULE = 2\nconst DOT_SIZE = 10\n\n// The state layer's colour roles, hovered or focused and pressed. The two\n// swap once pressed.\nconst LAYERS: Readonly<\n Record<\n Tone,\n {\n readonly hover: keyof ResolvedTheme['colors']\n readonly pressed: keyof ResolvedTheme['colors']\n }\n >\n> = {\n selected: { hover: 'primary', pressed: 'onSurface' },\n unselected: { hover: 'onSurface', pressed: 'primary' },\n}\n\nconst RadioGroupContext = createContext<null | RadioGroupContextValue>(null)\n\nconst styles = StyleSheet.create({\n dot: {\n height: DOT_SIZE,\n width: DOT_SIZE,\n },\n ring: {\n alignItems: 'center',\n borderWidth: RING_RULE,\n height: RING_SIZE,\n justifyContent: 'center',\n width: RING_SIZE,\n },\n // A button along a line gives up width before it widens the line, so a\n // label longer than the line breaks inside it.\n shrink: {\n flexShrink: 1,\n },\n})\n\nconst groupStylesOf = themedStyles(\n ({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n dot: {\n borderRadius: radii.circle,\n },\n // The group's buttons, one under another.\n items: {\n flexDirection: 'column',\n },\n // Along a line instead, 16dp apart, wrapping when the line runs out.\n itemsHorizontal: {\n columnGap: spacing.lg,\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n label: {\n color: colors.onSurfaceVariant,\n },\n labelDisabled: {\n color: withOpacity(colors.onSurface, stateLayerOpacity.disabledContent),\n },\n labelError: {\n color: colors.error,\n },\n message: {\n color: colors.onSurfaceVariant,\n },\n messageError: {\n color: colors.error,\n },\n messageLine: {\n marginTop: spacing.xs,\n },\n ring: {\n borderRadius: radii.circle,\n },\n root: {\n flexDirection: 'column',\n rowGap: spacing.xs,\n },\n }),\n)\n\n/**\n * The colour the ring and the dot are drawn in. Hover, press and focus darken\n * only an unselected ring, and only one a press can change.\n */\nfunction colorOf(\n { colors, stateLayerOpacity }: ResolvedTheme,\n {\n active,\n isDisabled,\n isSelected,\n }: {\n readonly active: boolean\n readonly isDisabled: boolean\n readonly isSelected: boolean\n },\n) {\n if (isDisabled) {\n return withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n }\n\n if (isSelected) {\n return colors.primary\n }\n\n return active ? colors.onSurface : colors.onSurfaceVariant\n}\n\n/**\n * How the group is described by the line under it. On the web it points at\n * the line with `aria-describedby`, as web's group does. iOS and Android\n * focus the buttons rather than the group, so there the line is left where a\n * screen reader reaches it in order, after the last button.\n */\nfunction lineOf(id: string, message: string | undefined) {\n return Platform.OS === 'web' && message !== undefined\n ? { 'aria-describedby': id }\n : undefined\n}\n\n/**\n * One option of a `RadioGroup`, with its label and optionally a description\n * under it. It names the entry it stands for with `value`; the selection is\n * the group's, so a `Radio` is only ever drawn inside one.\n *\n * A screen reader hears it as a radio button named by its label, checked or\n * not, followed by the line under it. A press anywhere on the button or the\n * label selects it, and the row takes presses over the 48dp target the page\n * asks of the button. `style`, `ref` and `testID` land on the view holding\n * the row and the line under it, which is the element a layout positions.\n */\nfunction Radio({\n 'aria-label': ariaLabel,\n children,\n description,\n isDisabled: ownDisabled = false,\n style,\n value,\n ...props\n}: RadioProps) {\n const theme = useTheme()\n const group = use(RadioGroupContext)\n const messageId = useId()\n\n if (group === null) {\n throw new Error(\n 'A Radio is drawn inside a RadioGroup, which holds its selection.',\n )\n }\n\n const { colors, radii } = theme\n const { horizontal, state } = group\n const isDisabled = ownDisabled || state.isDisabled\n const isSelected = state.selectedValue === value\n const interactive = !isDisabled && !state.isReadOnly\n const tone: Tone = isSelected ? 'selected' : 'unselected'\n\n const feedback = usePressFeedback({\n color: colors[LAYERS[tone].hover],\n corners: { borderRadius: radii.circle },\n disabled: !interactive,\n disc: LAYER_SIZE,\n pressedColor: colors[LAYERS[tone].pressed],\n })\n const active =\n feedback.hovered || feedback.pressed || feedback.ring !== undefined\n const color = colorOf(theme, { active, isDisabled, isSelected })\n const ring = useRingColor(color)\n const own = groupStylesOf(theme)\n\n return (\n <View\n {...props}\n style={composeStyles<ViewStyle>(\n horizontal ? styles.shrink : undefined,\n style,\n )}\n >\n <Pressable\n aria-checked={isSelected}\n aria-label={ariaLabel}\n role=\"radio\"\n {...describedBy(messageId, messageOf(description, undefined))}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={hitSlop(LAYER_SIZE, LAYER_SIZE)}\n onPress={selectOf(state, value)}\n style={controlStylesOf(theme).row}\n >\n <View\n style={composeStyles<ViewStyle>(\n controlStylesOf(theme).disc,\n feedback.ring,\n )}\n >\n {feedback.layer}\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.ring,\n own.ring,\n ring,\n )}\n >\n {isSelected ? (\n <View\n style={composeStyles<ViewStyle>(styles.dot, own.dot, {\n backgroundColor: color,\n })}\n />\n ) : null}\n </Animated.View>\n </View>\n <ControlLabel isDisabled={isDisabled}>{children}</ControlLabel>\n </Pressable>\n <ControlMessage description={description} id={messageId} />\n </View>\n )\n}\n\n/**\n * A labelled set of radio buttons with one selected value between them. The\n * value is React Stately's, as web's is: pass `value` with `onChange` to\n * control it, or `defaultValue` to let the group keep its own, and each\n * `Radio` inside names the entry it stands for. Disabled, read-only and the\n * error state reach every button from here, and `orientation=\"horizontal\"`\n * lays the buttons along a line.\n *\n * ```tsx\n * <RadioGroup defaultValue=\"first\" label=\"Label\">\n * <Radio value=\"first\">First item</Radio>\n * <Radio value=\"second\">Second item</Radio>\n * </RadioGroup>\n * ```\n *\n * A screen reader hears it as a radio group named by its label. On the web\n * the line under it describes the group, as web's does; on iOS and Android\n * it is read after the buttons, where it sits. `style`, `ref` and `testID`\n * land on the group as a whole, which is the element a layout positions.\n */\nfunction RadioGroup({\n children,\n defaultValue,\n description,\n error,\n isDisabled = false,\n isReadOnly = false,\n label,\n onChange,\n orientation = 'vertical',\n style,\n value,\n ...props\n}: RadioGroupProps) {\n const theme = useTheme()\n const state = useRadioGroupState({\n defaultValue,\n isDisabled,\n isReadOnly,\n onChange,\n orientation,\n value,\n })\n const labelId = useId()\n const messageId = useId()\n const labelRole = useTypeRole('labelLarge')\n const messageRole = useTypeRole('bodySmall')\n\n const own = groupStylesOf(theme)\n const horizontal = orientation === 'horizontal'\n const context = useMemo(() => ({ horizontal, state }), [horizontal, state])\n const invalid = error !== undefined\n const message = messageOf(description, error)\n\n return (\n <View\n {...props}\n aria-labelledby={labelId}\n role=\"radiogroup\"\n {...lineOf(messageId, message)}\n style={composeStyles<ViewStyle>(own.root, style)}\n >\n <NativeText\n id={labelId}\n style={composeStyles<TextStyle>(\n labelRole,\n own.label,\n isDisabled ? own.labelDisabled : undefined,\n invalid ? own.labelError : undefined,\n )}\n >\n {label}\n </NativeText>\n <View\n style={composeStyles<ViewStyle>(\n own.items,\n horizontal ? own.itemsHorizontal : undefined,\n )}\n >\n <RadioGroupContext value={context}>{children}</RadioGroupContext>\n </View>\n {message === undefined ? null : (\n <View style={own.messageLine}>\n <NativeText\n id={messageId}\n style={composeStyles<TextStyle>(\n messageRole,\n own.message,\n invalid ? own.messageError : undefined,\n )}\n >\n {message}\n </NativeText>\n </View>\n )}\n </View>\n )\n}\n\n// A press's selection. Built by a call rather than declared in the\n// component, which is what react-perf's jsx-no-new-function-as-prop is after;\n// the React Compiler memoises the result on its inputs.\nfunction selectOf(state: RadioGroupState, value: string) {\n return () => {\n state.setSelectedValue(value)\n }\n}\n\n// The ring's colour, eased to as the state changes.\nfunction useRingColor(color: string) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n return useAnimatedStyle(() => {\n 'worklet'\n return {\n borderColor: reduceMotion ? color : withTiming(color, timing),\n }\n })\n}\n\nexport { Radio, RadioGroup }\nexport type { RadioGroupOrientation, RadioGroupProps, RadioProps }\n"],"mappings":";;;;;;;;;;;;;;AA4IA,MAAM2D,YAAY;AAClB,MAAMC,YAAY;AAClB,MAAMC,WAAW;AAIjB,MAAMC,SAQF;CACFK,UAAU;EAAEF,OAAO;EAAWC,SAAS;CAAY;CACnDE,YAAY;EAAEH,OAAO;EA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,EAAA,MAAA6D;EAAA7D,EAAA,MAAAQ;EAAAR,EAAA,MAAA8D;EAAA9D,EAAA,MAAA/D;EAAA+D,EAAA,MAAAG;EAAAH,EAAA,MAAA5E;EAAA4E,EAAA,MAAA7D;EAAA6D,EAAA,MAAAM;EAAAN,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAxCPgB;AAwCO;AAOX,SAASmC,SAAS/H,OAAwBY,OAAe;CACvD,aAAa;EACXZ,MAAM6I,iBAAiBjI,KAAK;CAC9B;AACF;AAGA,SAAAyF,aAAAhD,OAAA;CACE,MAAA,EAAAyF,WAAmBpJ,SAAS;CAC5B,MAAAqJ,eAAqBlK,iBAAiB;CACtC,MAAAmK,SAAe;EAAAC,UACHH,OAAMI;EAAeC,QACvBxK,OAAMyK,OAAO,GAAIN,OAAMO,cAAe;CAChD;CAAC,OAEMzK,uBAAiB;EAAA;EAAA,OAEf,EAAA0K,aACQP,eAAA1F,QAAuBvE,WAAWuE,OAAO2F,MAAM,EAC9D;CAAC,CACF;AAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidationResult } from "../../form/index.js";
|
|
2
2
|
import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
|
|
3
|
-
import { Ref } from "react";
|
|
3
|
+
import { ComponentRef, Ref } from "react";
|
|
4
4
|
//#region src/components/search-field/index.d.ts
|
|
5
5
|
type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholderTextColor' | 'readOnly' | 'returnKeyType' | 'role' | 'selectionColor' | 'style' | 'underlineColorAndroid' | 'value'> & {
|
|
6
6
|
/**
|
|
@@ -29,7 +29,7 @@ type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
|
|
|
29
29
|
* A ref to the field's own `TextInput`, which is what a call site moves
|
|
30
30
|
* focus to. `ref` is the field as a whole.
|
|
31
31
|
*/
|
|
32
|
-
readonly inputRef?: Ref<TextInput
|
|
32
|
+
readonly inputRef?: Ref<ComponentRef<typeof TextInput>>;
|
|
33
33
|
/**
|
|
34
34
|
* Draws the field disabled: it takes no focus and no input, and its clear
|
|
35
35
|
* button no press.
|
|
@@ -62,7 +62,7 @@ type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilit
|
|
|
62
62
|
readonly onSubmit?: (value: string) => void;
|
|
63
63
|
/** The supporting text in the empty bar, which is what a person reads. */
|
|
64
64
|
readonly placeholder?: string;
|
|
65
|
-
readonly ref?: Ref<View
|
|
65
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
66
66
|
/** Positions and sizes the field as a whole. */
|
|
67
67
|
readonly style?: StyleProp<ViewStyle>;
|
|
68
68
|
/**
|