@kanso-labs/react-native-kanso-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/index.d.ts +24 -2
- package/dist/button/index.js.map +1 -1
- package/dist/button/pending.js +144 -0
- package/dist/button/pending.js.map +1 -0
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +154 -112
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.js +160 -110
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +73 -0
- package/dist/components/meter/index.js +179 -0
- package/dist/components/meter/index.js.map +1 -0
- package/dist/components/number-field/index.js +1 -9
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +113 -0
- package/dist/components/progress-indicator/index.js +1024 -0
- package/dist/components/progress-indicator/index.js.map +1 -0
- package/dist/components/snackbar/index.d.ts +120 -0
- package/dist/components/snackbar/index.js +540 -0
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/glyphs/hidden.js +13 -0
- package/dist/glyphs/hidden.js.map +1 -0
- package/dist/glyphs/index.js +2 -8
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +23 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/messages.js +41 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -3
- package/dist/indicator/index.d.ts +15 -0
- package/dist/indicator/index.js +256 -0
- package/dist/indicator/index.js.map +1 -0
- package/dist/indicator/motion.js +86 -0
- package/dist/indicator/motion.js.map +1 -0
- package/dist/indicator/paths.js +72 -0
- package/dist/indicator/paths.js.map +1 -0
- package/dist/indicator/styles.js +62 -0
- package/dist/indicator/styles.js.map +1 -0
- package/dist/number/locale.js +14 -0
- package/dist/number/locale.js.map +1 -0
- package/dist/overlay/host.js +65 -2
- package/dist/overlay/host.js.map +1 -1
- package/dist/press/index.js +10 -9
- package/dist/press/index.js.map +1 -1
- package/dist/theme/resolve.js +1 -1
- package/dist/theme/resolve.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +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,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,2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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"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { Ref } from "react";
|
|
3
|
+
//#region src/components/snackbar/index.d.ts
|
|
4
|
+
type ShownMessage = {
|
|
5
|
+
readonly action: SnackbarAction | undefined;
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly onClose: (() => void) | undefined;
|
|
9
|
+
readonly showCloseButton: boolean;
|
|
10
|
+
readonly timeout: number;
|
|
11
|
+
};
|
|
12
|
+
type SnackbarAction = {
|
|
13
|
+
/** What the action says. The page gives it a single word where it can. */
|
|
14
|
+
readonly label: string;
|
|
15
|
+
/** Run when the action is pressed, just before the snackbar closes. */
|
|
16
|
+
readonly onPress: () => void;
|
|
17
|
+
};
|
|
18
|
+
type SnackbarOptions = {
|
|
19
|
+
/**
|
|
20
|
+
* A single action shown after the message. Pressing it runs `onPress` and
|
|
21
|
+
* closes the snackbar, which is what the page draws.
|
|
22
|
+
*/
|
|
23
|
+
readonly action?: SnackbarAction;
|
|
24
|
+
/**
|
|
25
|
+
* Run when the snackbar closes, however it was closed: by its timer, its
|
|
26
|
+
* action or close button, `close`, `clear`, or a newer message added in its
|
|
27
|
+
* place.
|
|
28
|
+
*/
|
|
29
|
+
readonly onClose?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a close button is shown at the end. The page draws one for a
|
|
32
|
+
* message a reader may want out of the way before it expires.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
readonly showCloseButton?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* How long the snackbar is shown, in milliseconds. Defaults to five seconds
|
|
38
|
+
* for a message alone, which Android lengthens from the reader's own
|
|
39
|
+
* accessibility setting. A message with an action defaults to `0` and stays
|
|
40
|
+
* until the action is taken or something closes it, as Material Design asks
|
|
41
|
+
* of an actionable snackbar. The timer is paused while a pointer is over the
|
|
42
|
+
* snackbar or one of its controls has focus, so a message never expires
|
|
43
|
+
* while it is being read.
|
|
44
|
+
*
|
|
45
|
+
* `0` is the page's indefinite length: the snackbar stays until something
|
|
46
|
+
* closes it. Give one of those an action or `showCloseButton`, or there is
|
|
47
|
+
* no way to be rid of it.
|
|
48
|
+
*/
|
|
49
|
+
readonly timeout?: number;
|
|
50
|
+
};
|
|
51
|
+
type SnackbarProps = Omit<ViewProps, 'children' | 'style'> & {
|
|
52
|
+
/**
|
|
53
|
+
* What a screen reader calls the button that dismisses a snackbar. It sits
|
|
54
|
+
* here rather than on a message's own options because it does not vary by
|
|
55
|
+
* message.
|
|
56
|
+
* @default 'Close'
|
|
57
|
+
*/
|
|
58
|
+
readonly closeLabel?: string;
|
|
59
|
+
/** The queue the snackbar shows messages from. */
|
|
60
|
+
readonly queue: SnackbarQueue;
|
|
61
|
+
readonly ref?: Ref<View>;
|
|
62
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The queue a snackbar is shown from. Make one where the app can reach it, a
|
|
66
|
+
* module of its own being the usual place, mount `Snackbar` once with it, and
|
|
67
|
+
* call `add` from anywhere.
|
|
68
|
+
*
|
|
69
|
+
* ```ts
|
|
70
|
+
* const messages = new Snackbar.Queue()
|
|
71
|
+
* messages.add('Label', { action: { label: 'Undo', onPress: undo } })
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare class SnackbarQueue {
|
|
75
|
+
#private;
|
|
76
|
+
/**
|
|
77
|
+
* Shows a message in place of the one on screen, and returns the key that
|
|
78
|
+
* closes it. The message it replaces is closed, so its `onClose` runs, and
|
|
79
|
+
* it does not come back.
|
|
80
|
+
*/
|
|
81
|
+
add(message: string, options?: SnackbarOptions): string;
|
|
82
|
+
/** Closes the snackbar on screen, running its `onClose`. */
|
|
83
|
+
clear(): void;
|
|
84
|
+
/** Closes one snackbar, by the key `add` returned. */
|
|
85
|
+
close(key: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* Calls `listener` whenever the message on screen changes, and returns what
|
|
88
|
+
* stops it. `Snackbar` reads the queue through this and `visible`, and
|
|
89
|
+
* neither is meant for a call site.
|
|
90
|
+
*/
|
|
91
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
92
|
+
/** The message on screen, or `null`. */
|
|
93
|
+
readonly visible: () => ShownMessage | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A brief message at the bottom of the screen, with an optional action, with
|
|
97
|
+
* web's props and values. Mount one of these with a `Snackbar.Queue`, and
|
|
98
|
+
* call the queue's `add` to show a message from anywhere.
|
|
99
|
+
*
|
|
100
|
+
* ```tsx
|
|
101
|
+
* const messages = new Snackbar.Queue()
|
|
102
|
+
*
|
|
103
|
+
* <Snackbar queue={messages} />
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* It draws in the overlay host of the app's outermost `ThemeScope`, above the
|
|
107
|
+
* screen, and needs one around it. It is one region rather than one per
|
|
108
|
+
* message, so mount it once, near the root, inside the `SafeAreaProvider`
|
|
109
|
+
* whose insets it keeps clear of.
|
|
110
|
+
*
|
|
111
|
+
* `style`, `ref` and `testID` land on that region, a view along the bottom of
|
|
112
|
+
* the screen that holds the message.
|
|
113
|
+
*/
|
|
114
|
+
declare function Snackbar({ closeLabel, queue, style, ...props }: SnackbarProps): import("react").JSX.Element;
|
|
115
|
+
declare namespace Snackbar {
|
|
116
|
+
var Queue: typeof SnackbarQueue;
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue };
|
|
120
|
+
//# sourceMappingURL=index.d.ts.map
|