@kanso-labs/react-native-kanso-ui 0.1.1 → 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.
Files changed (49) hide show
  1. package/dist/button/index.d.ts +24 -2
  2. package/dist/button/index.js.map +1 -1
  3. package/dist/button/pending.js +144 -0
  4. package/dist/button/pending.js.map +1 -0
  5. package/dist/components/button/index.d.ts +1 -1
  6. package/dist/components/button/index.js +154 -112
  7. package/dist/components/button/index.js.map +1 -1
  8. package/dist/components/icon-button/index.d.ts +1 -1
  9. package/dist/components/icon-button/index.js +160 -110
  10. package/dist/components/icon-button/index.js.map +1 -1
  11. package/dist/components/meter/index.d.ts +73 -0
  12. package/dist/components/meter/index.js +179 -0
  13. package/dist/components/meter/index.js.map +1 -0
  14. package/dist/components/number-field/index.js +1 -9
  15. package/dist/components/number-field/index.js.map +1 -1
  16. package/dist/components/progress-indicator/index.d.ts +113 -0
  17. package/dist/components/progress-indicator/index.js +1024 -0
  18. package/dist/components/progress-indicator/index.js.map +1 -0
  19. package/dist/components/snackbar/index.d.ts +120 -0
  20. package/dist/components/snackbar/index.js +540 -0
  21. package/dist/components/snackbar/index.js.map +1 -0
  22. package/dist/glyphs/hidden.js +13 -0
  23. package/dist/glyphs/hidden.js.map +1 -0
  24. package/dist/glyphs/index.js +2 -8
  25. package/dist/glyphs/index.js.map +1 -1
  26. package/dist/i18n/index.js +23 -0
  27. package/dist/i18n/index.js.map +1 -0
  28. package/dist/i18n/messages.js +41 -0
  29. package/dist/i18n/messages.js.map +1 -0
  30. package/dist/index.d.ts +4 -1
  31. package/dist/index.js +6 -3
  32. package/dist/indicator/index.d.ts +15 -0
  33. package/dist/indicator/index.js +256 -0
  34. package/dist/indicator/index.js.map +1 -0
  35. package/dist/indicator/motion.js +86 -0
  36. package/dist/indicator/motion.js.map +1 -0
  37. package/dist/indicator/paths.js +72 -0
  38. package/dist/indicator/paths.js.map +1 -0
  39. package/dist/indicator/styles.js +62 -0
  40. package/dist/indicator/styles.js.map +1 -0
  41. package/dist/number/locale.js +14 -0
  42. package/dist/number/locale.js.map +1 -0
  43. package/dist/overlay/host.js +65 -2
  44. package/dist/overlay/host.js.map +1 -1
  45. package/dist/press/index.js +10 -9
  46. package/dist/press/index.js.map +1 -1
  47. package/dist/theme/resolve.js +1 -1
  48. package/dist/theme/resolve.js.map +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","ColorValue","StyleProp","ViewStyle","SvgProps","I18nManager","Platform","StyleSheet","Svg","Path","useIconStyle","glyphStyles","GlyphProps","color","size","style","testID","HIDDEN","select","default","accessibilityElementsHidden","importantForAccessibility","web","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","ChevronDownGlyph","ChevronEndGlyph","ClockGlyph","CloseGlyph","Glyph","children","mirrored","undefined","slot","side","t2","t3","compose","isRTL","t4","KeyboardGlyph","MinusGlyph","IndeterminateGlyph","PersonGlyph","PlusGlyph","SearchGlyph","_c"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { ColorValue, StyleProp, ViewStyle } from 'react-native'\nimport type { SvgProps } from 'react-native-svg'\n\nimport { I18nManager, Platform, StyleSheet } from 'react-native'\nimport Svg, { Path } from 'react-native-svg'\n\nimport { useIconStyle } from './icon-style'\nimport { glyphStyles } from './styles'\n\n// The glyphs the library's own controls draw, the same set kanso-ui draws on\n// web: the check and the dash a checkbox shows, the plus and minus a number\n// field's steppers show, the magnifier and cross a search field shows, and the\n// rest named beside each one. Private to the library, as on web: a call site\n// with icons of its own passes them to the slots that take a node, and reads\n// the slot's colour and size through `useIconStyle()`.\n//\n// The paths are kanso-ui's, unchanged: Material Symbols on their 24-unit grid,\n// which is what the checkbox page draws at 18dp, the icon buttons page at 20\n// and the search, menus, date picker and time picker pages at 24.\n\ntype GlyphProps = {\n /** The fill. Defaults to the colour of the slot the glyph sits in. */\n readonly color?: ColorValue\n /** The square's side in dp. Defaults to the size of the slot. */\n readonly size?: number\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\n// What hides a glyph from screen readers. On iOS and Android that is React\n// Native's two props, one for VoiceOver and one for TalkBack. Under React\n// Native Web, react-native-svg hands its props to the `<svg>` as they are, so\n// it is `aria-hidden` there, which is the one the browser reads.\nconst HIDDEN = Platform.select<SvgProps>({\n default: {\n accessibilityElementsHidden: true,\n importantForAccessibility: 'no-hide-descendants',\n },\n web: { 'aria-hidden': true },\n})\n\n// What a search view's back button draws, pointing at the page it returns to.\n// It says \"back\" rather than \"to the left\", so it mirrors under a right-to-left\n// layout.\nfunction ArrowBackGlyph(props: GlyphProps) {\n return (\n <Glyph {...props} mirrored>\n <Path d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" />\n </Glyph>\n )\n}\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending. Neither mirrors under a right-to-left layout: they say \"up\" and\n// \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </Glyph>\n )\n}\n\n// What a menu button draws after its label, pointing at the list it opens.\n// Down is down in either writing direction, so it does not mirror.\nfunction ArrowDropDownGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M7 10l5 5 5-5z\" />\n </Glyph>\n )\n}\n\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </Glyph>\n )\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>\n )\n}\n\nfunction CheckGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </Glyph>\n )\n}\n\n// Points down at the menu a split button's second half opens.\nfunction ChevronDownGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\" />\n </Glyph>\n )\n}\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so it mirrors under a right-to-left layout.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return (\n <Glyph {...props} mirrored>\n <Path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>\n )\n}\n\n// What the time picker's trigger draws, and the button that takes its keyboard\n// entry back to the dial: the clock a time is picked from.\nfunction ClockGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z\" />\n </Glyph>\n )\n}\n\nfunction CloseGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </Glyph>\n )\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, a square of the\n * slot's size filled in the slot's colour, and nothing a screen reader\n * announces, since the control around a glyph carries the name. A glyph whose\n * direction means \"onward\" or \"back\" passes `mirrored`, which turns it over\n * under a right-to-left layout as `:dir(rtl)` does on web.\n */\nfunction Glyph({\n children,\n color,\n mirrored = false,\n size,\n style,\n testID,\n}: GlyphProps & { readonly children: ReactNode; readonly mirrored?: boolean }) {\n const slot = useIconStyle()\n const side = size ?? slot.size\n return (\n <Svg\n {...HIDDEN}\n color={color ?? slot.color}\n fill=\"currentColor\"\n height={side}\n style={StyleSheet.compose(\n mirrored && I18nManager.isRTL ? glyphStyles.mirrored : undefined,\n style,\n )}\n testID={testID}\n viewBox=\"0 0 24 24\"\n width={side}\n >\n {children}\n </Svg>\n )\n}\n\n// What the time picker's dial draws on the button that switches it to typed\n// entry.\nfunction KeyboardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H4V7h16v10zm-9-9h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-3 0h2v2H5zm0-3h2v2H5zm3 6h8v2H8zm6-3h2v2h-2zm0-3h2v2h-2zm3 3h2v2h-2zm0-3h2v2h-2z\" />\n </Glyph>\n )\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 13H5v-2h14v2z\" />\n </Glyph>\n )\n}\n\nconst IndeterminateGlyph = MinusGlyph\n\n// What an avatar with no name to take initials from draws: Material Design's\n// anonymous person, a head over shoulders.\nfunction PersonGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" />\n </Glyph>\n )\n}\n\nfunction PlusGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>\n )\n}\n\nfunction SearchGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>\n )\n}\n\nexport {\n ArrowBackGlyph,\n ArrowDownwardGlyph,\n ArrowDropDownGlyph,\n ArrowUpwardGlyph,\n CalendarGlyph,\n CheckGlyph,\n ChevronDownGlyph,\n ChevronEndGlyph,\n ClockGlyph,\n CloseGlyph,\n IndeterminateGlyph,\n KeyboardGlyph,\n MinusGlyph,\n PersonGlyph,\n PlusGlyph,\n SearchGlyph,\n}\nexport type { GlyphProps }\n"],"mappings":";;;;;;;AAkCA,MAAMiB,SAASX,SAASY,OAAiB;CACvCC,SAAS;EACPC,6BAA6B;EAC7BC,2BAA2B;CAC7B;CACAC,KAAK,EAAE,eAAe,KAAK;AAC7B,CAAC;AAmDD,SAAAa,WAAAX,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAGMF,KAAA,oBAAC,MAAD,EAAQ,GAAA,oDAAmD,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADhEM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ;AAiCZ,SAAAS,WAAAf,O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CAAqC,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADlDM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ;AAIZ,SAAA0B,YAAAhC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAGMF,KAAA,oBAAC,MAAD,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADzNM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","ColorValue","StyleProp","ViewStyle","I18nManager","StyleSheet","Svg","Path","HIDDEN","useIconStyle","glyphStyles","GlyphProps","color","size","style","testID","ArrowBackGlyph","props","$","_c","t0","Symbol","for","t1","ArrowDownwardGlyph","ArrowDropDownGlyph","ArrowUpwardGlyph","CalendarGlyph","CheckGlyph","ChevronDownGlyph","ChevronEndGlyph","ClockGlyph","CloseGlyph","Glyph","children","mirrored","undefined","slot","side","t2","t3","compose","isRTL","t4","KeyboardGlyph","MinusGlyph","IndeterminateGlyph","PersonGlyph","PlusGlyph","SearchGlyph","_c"],"sources":["../../src/glyphs/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { ColorValue, StyleProp, ViewStyle } from 'react-native'\n\nimport { I18nManager, StyleSheet } from 'react-native'\nimport Svg, { Path } from 'react-native-svg'\n\nimport { HIDDEN } from './hidden'\nimport { useIconStyle } from './icon-style'\nimport { glyphStyles } from './styles'\n\n// The glyphs the library's own controls draw, the same set kanso-ui draws on\n// web: the check and the dash a checkbox shows, the plus and minus a number\n// field's steppers show, the magnifier and cross a search field shows, and the\n// rest named beside each one. Private to the library, as on web: a call site\n// with icons of its own passes them to the slots that take a node, and reads\n// the slot's colour and size through `useIconStyle()`.\n//\n// The paths are kanso-ui's, unchanged: Material Symbols on their 24-unit grid,\n// which is what the checkbox page draws at 18dp, the icon buttons page at 20\n// and the search, menus, date picker and time picker pages at 24.\n\ntype GlyphProps = {\n /** The fill. Defaults to the colour of the slot the glyph sits in. */\n readonly color?: ColorValue\n /** The square's side in dp. Defaults to the size of the slot. */\n readonly size?: number\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\n// What a search view's back button draws, pointing at the page it returns to.\n// It says \"back\" rather than \"to the left\", so it mirrors under a right-to-left\n// layout.\nfunction ArrowBackGlyph(props: GlyphProps) {\n return (\n <Glyph {...props} mirrored>\n <Path d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\" />\n </Glyph>\n )\n}\n\n// Which way a sorted column is ordered. Up is ascending and down is\n// descending. Neither mirrors under a right-to-left layout: they say \"up\" and\n// \"down\" rather than \"onward\", and those do not flip.\nfunction ArrowDownwardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\" />\n </Glyph>\n )\n}\n\n// What a menu button draws after its label, pointing at the list it opens.\n// Down is down in either writing direction, so it does not mirror.\nfunction ArrowDropDownGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M7 10l5 5 5-5z\" />\n </Glyph>\n )\n}\n\nfunction ArrowUpwardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\" />\n </Glyph>\n )\n}\n\n// What the date picker's trigger draws: the calendar a date is picked from.\nfunction CalendarGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </Glyph>\n )\n}\n\nfunction CheckGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\" />\n </Glyph>\n )\n}\n\n// Points down at the menu a split button's second half opens.\nfunction ChevronDownGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\" />\n </Glyph>\n )\n}\n\n// Points at the submenu a menu item opens. It says \"further in\" rather than\n// \"to the right\", so it mirrors under a right-to-left layout.\nfunction ChevronEndGlyph(props: GlyphProps) {\n return (\n <Glyph {...props} mirrored>\n <Path d=\"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" />\n </Glyph>\n )\n}\n\n// What the time picker's trigger draws, and the button that takes its keyboard\n// entry back to the dial: the clock a time is picked from.\nfunction ClockGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z\" />\n </Glyph>\n )\n}\n\nfunction CloseGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n </Glyph>\n )\n}\n\n/**\n * The svg every glyph draws: the 24-unit grid its path is on, a square of the\n * slot's size filled in the slot's colour, and nothing a screen reader\n * announces, since the control around a glyph carries the name. A glyph whose\n * direction means \"onward\" or \"back\" passes `mirrored`, which turns it over\n * under a right-to-left layout as `:dir(rtl)` does on web.\n */\nfunction Glyph({\n children,\n color,\n mirrored = false,\n size,\n style,\n testID,\n}: GlyphProps & { readonly children: ReactNode; readonly mirrored?: boolean }) {\n const slot = useIconStyle()\n const side = size ?? slot.size\n return (\n <Svg\n {...HIDDEN}\n color={color ?? slot.color}\n fill=\"currentColor\"\n height={side}\n style={StyleSheet.compose(\n mirrored && I18nManager.isRTL ? glyphStyles.mirrored : undefined,\n style,\n )}\n testID={testID}\n viewBox=\"0 0 24 24\"\n width={side}\n >\n {children}\n </Svg>\n )\n}\n\n// What the time picker's dial draws on the button that switches it to typed\n// entry.\nfunction KeyboardGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H4V7h16v10zm-9-9h2v2h-2zm0 3h2v2h-2zM8 8h2v2H8zm0 3h2v2H8zm-3 0h2v2H5zm0-3h2v2H5zm3 6h8v2H8zm6-3h2v2h-2zm0-3h2v2h-2zm3 3h2v2h-2zm0-3h2v2h-2z\" />\n </Glyph>\n )\n}\n\n// The same rule stands for a partly selected checkbox and for a stepper's\n// decrement; the two names say which is meant at the call site.\nfunction MinusGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 13H5v-2h14v2z\" />\n </Glyph>\n )\n}\n\nconst IndeterminateGlyph = MinusGlyph\n\n// What an avatar with no name to take initials from draws: Material Design's\n// anonymous person, a head over shoulders.\nfunction PersonGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\" />\n </Glyph>\n )\n}\n\nfunction PlusGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" />\n </Glyph>\n )\n}\n\nfunction SearchGlyph(props: GlyphProps) {\n return (\n <Glyph {...props}>\n <Path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\" />\n </Glyph>\n )\n}\n\nexport {\n ArrowBackGlyph,\n ArrowDownwardGlyph,\n ArrowDropDownGlyph,\n ArrowUpwardGlyph,\n CalendarGlyph,\n CheckGlyph,\n ChevronDownGlyph,\n ChevronEndGlyph,\n ClockGlyph,\n CloseGlyph,\n IndeterminateGlyph,\n KeyboardGlyph,\n MinusGlyph,\n PersonGlyph,\n PlusGlyph,\n SearchGlyph,\n}\nexport type { GlyphProps }\n"],"mappings":";;;;;;;;AA+EA,SAAA4B,WAAAX,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAGMF,KAAA,oBAAC,MAAD,EAAQ,GAAA,oDAAmD,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADhEM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ;AAiCZ,SAAAS,WAAAf,OAAA;CAA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A;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADlDM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ;AAIZ,SAAA0B,YAAAhC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAGMF,KAAA,oBAAC,MAAD,EAAQ,GAAA,6MAA4M,CAAA;EAAGF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAD,OAAA;EADzNM,KAAA,oBAAC,OAAD;GAAM,GAAKN;GACTG,UAAAA;EADI,CAAA;EAEEF,EAAA,KAAAD;EAAAC,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFRK;AAEQ"}
@@ -0,0 +1,23 @@
1
+ import { localeOf } from "../number/locale.js";
2
+ import { MESSAGES } from "./messages.js";
3
+ //#region src/i18n/index.ts
4
+ const TABLE = new Map(Object.entries(MESSAGES));
5
+ const cache = /* @__PURE__ */ new Map();
6
+ function lookUp(locale) {
7
+ const tag = locale.split("-u-")[0];
8
+ const language = tag.split("-")[0];
9
+ return TABLE.get(tag) ?? [...TABLE].find(([key]) => key.startsWith(`${language}-`))?.[1] ?? MESSAGES["en-US"];
10
+ }
11
+ /** The library's words in `locale`, or in the device's when given none. */
12
+ function messagesFor(locale) {
13
+ const resolved = localeOf(locale);
14
+ const cached = cache.get(resolved);
15
+ if (cached !== void 0) return cached;
16
+ const messages = lookUp(resolved);
17
+ cache.set(resolved, messages);
18
+ return messages;
19
+ }
20
+ //#endregion
21
+ export { messagesFor };
22
+
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["LibraryMessages","localeOf","MESSAGES","TABLE","Map","Object","entries","cache","lookUp","locale","tag","split","language","get","find","key","startsWith","messagesFor","resolved","cached","undefined","messages","set"],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import type { LibraryMessages } from './messages'\n\nimport { localeOf } from '../number/locale'\nimport { MESSAGES } from './messages'\n\n// The words the library writes itself, in the locale a component is given or\n// the device's. Web reads them through React Aria's dictionary, in the\n// I18nProvider's locale, and this falls back the way that dictionary does: the\n// table's entry for the locale, then the first for its language, then English,\n// so `fr-CA` reads French and a locale the table lacks reads English.\n\nconst TABLE = new Map(Object.entries(MESSAGES))\n\n// One set per locale an app renders in, looked up the first time a component\n// asks for it.\nconst cache = new Map<string, LibraryMessages>()\n\n// A device's locale can carry a Unicode extension, `pt-PT-u-nu-latn`, which\n// says how numbers are written rather than which words; it is set aside, or\n// `pt-PT` would match no entry and read the first Portuguese one, Brazil's.\nfunction lookUp(locale: string): LibraryMessages {\n const tag = locale.split('-u-')[0]\n const language = tag.split('-')[0]\n\n return (\n TABLE.get(tag) ??\n [...TABLE].find(([key]) => key.startsWith(`${language}-`))?.[1] ??\n MESSAGES['en-US']\n )\n}\n\n/** The library's words in `locale`, or in the device's when given none. */\nfunction messagesFor(locale?: string): LibraryMessages {\n const resolved = localeOf(locale)\n const cached = cache.get(resolved)\n\n if (cached !== undefined) {\n return cached\n }\n\n const messages = lookUp(resolved)\n cache.set(resolved, messages)\n return messages\n}\n\nexport { messagesFor }\nexport type { LibraryMessages }\n"],"mappings":";;;AAWA,MAAMG,QAAQ,IAAIC,IAAIC,OAAOC,QAAQJ,QAAQ,CAAC;AAI9C,MAAMK,wBAAQ,IAAIH,IAA6B;AAK/C,SAASI,OAAOC,QAAiC;CAC/C,MAAMC,MAAMD,OAAOE,MAAM,KAAK,CAAC,CAAC;CAChC,MAAMC,WAAWF,IAAIC,MAAM,GAAG,CAAC,CAAC;CAEhC,OACER,MAAMU,IAAIH,GAAG,KACb,CAAC,GAAGP,KAAK,CAAC,CAACW,MAAM,CAACC,SAASA,IAAIC,WAAW,GAAGJ,SAAQ,EAAG,CAAC,CAAC,GAAG,MAC7DV,SAAS;AAEb;;AAGA,SAASe,YAAYR,QAAkC;CACrD,MAAMS,WAAWjB,SAASQ,MAAM;CAChC,MAAMU,SAASZ,MAAMM,IAAIK,QAAQ;CAEjC,IAAIC,WAAWC,KAAAA,GACb,OAAOD;CAGT,MAAME,WAAWb,OAAOU,QAAQ;CAChCX,MAAMe,IAAIJ,UAAUG,QAAQ;CAC5B,OAAOA;AACT"}
@@ -0,0 +1,41 @@
1
+ //#region src/i18n/messages.ts
2
+ const MESSAGES = {
3
+ "ar-AE": { loading: "جارٍ التحميل" },
4
+ "bg-BG": { loading: "Зареждане" },
5
+ "cs-CZ": { loading: "Načítání" },
6
+ "da-DK": { loading: "Indlæser" },
7
+ "de-DE": { loading: "Wird geladen" },
8
+ "el-GR": { loading: "Φόρτωση" },
9
+ "en-US": { loading: "Loading" },
10
+ "es-ES": { loading: "Cargando" },
11
+ "et-EE": { loading: "Laadimine" },
12
+ "fi-FI": { loading: "Ladataan" },
13
+ "fr-FR": { loading: "Chargement" },
14
+ "he-IL": { loading: "טוען" },
15
+ "hr-HR": { loading: "Učitavanje" },
16
+ "hu-HU": { loading: "Betöltés" },
17
+ "it-IT": { loading: "Caricamento" },
18
+ "ja-JP": { loading: "読み込み中" },
19
+ "ko-KR": { loading: "로드 중" },
20
+ "lt-LT": { loading: "Įkeliama" },
21
+ "lv-LV": { loading: "Notiek ielāde" },
22
+ "nb-NO": { loading: "Laster inn" },
23
+ "nl-NL": { loading: "Laden" },
24
+ "pl-PL": { loading: "Ładowanie" },
25
+ "pt-BR": { loading: "Carregando" },
26
+ "pt-PT": { loading: "A carregar" },
27
+ "ro-RO": { loading: "Se încarcă" },
28
+ "ru-RU": { loading: "Загрузка" },
29
+ "sk-SK": { loading: "Načítava sa" },
30
+ "sl-SI": { loading: "Nalaganje" },
31
+ "sr-SP": { loading: "Učitavanje" },
32
+ "sv-SE": { loading: "Läser in" },
33
+ "tr-TR": { loading: "Yükleniyor" },
34
+ "uk-UA": { loading: "Завантаження" },
35
+ "zh-CN": { loading: "正在加载" },
36
+ "zh-TW": { loading: "正在載入" }
37
+ };
38
+ //#endregion
39
+ export { MESSAGES };
40
+
41
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","names":["LibraryMessages","loading","MESSAGES","Readonly","Record"],"sources":["../../src/i18n/messages.ts"],"sourcesContent":["// The words the library writes itself: the pending ring's name. Each one\n// stands behind a prop that names it otherwise, `pendingLabel` for this one.\n//\n// Copied from kanso-ui's src/i18n/messages.ts, one entry per locale React\n// Aria ships, and kept in step with it by hand: the web library publishes no\n// copy of its table, and a word that differs between the two would name the\n// same ring two ways. The translations were drafted for that table rather\n// than taken from a translation service, and each one wants a native\n// speaker's eye before it is trusted; a call site can always pass its own\n// words through the prop.\n\ntype LibraryMessages = {\n /** What a pending button's ring is called. */\n readonly loading: string\n}\n\nconst MESSAGES: Readonly<Record<string, LibraryMessages>> = {\n 'ar-AE': { loading: 'جارٍ التحميل' },\n 'bg-BG': { loading: 'Зареждане' },\n 'cs-CZ': { loading: 'Načítání' },\n 'da-DK': { loading: 'Indlæser' },\n 'de-DE': { loading: 'Wird geladen' },\n 'el-GR': { loading: 'Φόρτωση' },\n 'en-US': { loading: 'Loading' },\n 'es-ES': { loading: 'Cargando' },\n 'et-EE': { loading: 'Laadimine' },\n 'fi-FI': { loading: 'Ladataan' },\n 'fr-FR': { loading: 'Chargement' },\n 'he-IL': { loading: 'טוען' },\n 'hr-HR': { loading: 'Učitavanje' },\n 'hu-HU': { loading: 'Betöltés' },\n 'it-IT': { loading: 'Caricamento' },\n 'ja-JP': { loading: '読み込み中' },\n 'ko-KR': { loading: '로드 중' },\n 'lt-LT': { loading: 'Įkeliama' },\n 'lv-LV': { loading: 'Notiek ielāde' },\n 'nb-NO': { loading: 'Laster inn' },\n 'nl-NL': { loading: 'Laden' },\n 'pl-PL': { loading: 'Ładowanie' },\n 'pt-BR': { loading: 'Carregando' },\n 'pt-PT': { loading: 'A carregar' },\n 'ro-RO': { loading: 'Se încarcă' },\n 'ru-RU': { loading: 'Загрузка' },\n 'sk-SK': { loading: 'Načítava sa' },\n 'sl-SI': { loading: 'Nalaganje' },\n 'sr-SP': { loading: 'Učitavanje' },\n 'sv-SE': { loading: 'Läser in' },\n 'tr-TR': { loading: 'Yükleniyor' },\n 'uk-UA': { loading: 'Завантаження' },\n 'zh-CN': { loading: '正在加载' },\n 'zh-TW': { loading: '正在載入' },\n}\n\nexport { MESSAGES }\nexport type { LibraryMessages }\n"],"mappings":";AAgBA,MAAME,WAAsD;CAC1D,SAAS,EAAED,SAAS,eAAe;CACnC,SAAS,EAAEA,SAAS,YAAY;CAChC,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,eAAe;CACnC,SAAS,EAAEA,SAAS,UAAU;CAC9B,SAAS,EAAEA,SAAS,UAAU;CAC9B,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,YAAY;CAChC,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,OAAO;CAC3B,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,cAAc;CAClC,SAAS,EAAEA,SAAS,QAAQ;CAC5B,SAAS,EAAEA,SAAS,OAAO;CAC3B,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,gBAAgB;CACpC,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,QAAQ;CAC5B,SAAS,EAAEA,SAAS,YAAY;CAChC,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,cAAc;CAClC,SAAS,EAAEA,SAAS,YAAY;CAChC,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,WAAW;CAC/B,SAAS,EAAEA,SAAS,aAAa;CACjC,SAAS,EAAEA,SAAS,eAAe;CACnC,SAAS,EAAEA,SAAS,OAAO;CAC3B,SAAS,EAAEA,SAAS,OAAO;AAC7B"}
package/dist/index.d.ts CHANGED
@@ -9,13 +9,16 @@ import { Currency, CurrencyProps, CurrencySignDisplay, CurrencyTone } from "./co
9
9
  import { Form, FormHandle, FormProps } from "./components/form/index.js";
10
10
  import { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from "./components/icon-button/index.js";
11
11
  import { Link, LinkProps, LinkTone, LinkUnderline } from "./components/link/index.js";
12
+ import { Meter, MeterProps, MeterTone } from "./components/meter/index.js";
12
13
  import { FieldVariant } from "./field/index.js";
13
14
  import { NumberField, NumberFieldProps } from "./components/number-field/index.js";
14
15
  import { ProductIcon, ProductIconProps } from "./components/product-icon/index.js";
16
+ import { ProgressIndicator, ProgressIndicatorProps, ProgressIndicatorShape, ProgressIndicatorTone, ProgressIndicatorVariant } from "./components/progress-indicator/index.js";
15
17
  import { Radio, RadioGroup, RadioGroupOrientation, RadioGroupProps, RadioProps } from "./components/radio-group/index.js";
16
18
  import { SearchField, SearchFieldProps } from "./components/search-field/index.js";
17
19
  import { SegmentedButton, SegmentedButtonProps, SegmentedButtonSegment, SegmentedButtonSegmentProps } from "./components/segmented-button/index.js";
18
20
  import { Separator, SeparatorInset, SeparatorProps } from "./components/separator/index.js";
21
+ import { Snackbar, SnackbarAction, SnackbarOptions, SnackbarProps, SnackbarQueue } from "./components/snackbar/index.js";
19
22
  import { Stack, StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
20
23
  import { Switch, SwitchProps } from "./components/switch/index.js";
21
24
  import { TypeRole } from "./typography/roles.js";
@@ -28,4 +31,4 @@ import { RouterProvider, RouterProviderProps } from "./router/index.js";
28
31
  import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
29
32
  import { ResolvedTheme, useTheme } from "./theme/scope.js";
30
33
  import { Key, Selection } from "react-stately";
31
- export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
34
+ export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
package/dist/index.js CHANGED
@@ -2,6 +2,8 @@ import { useIconStyle } from "./glyphs/icon-style.js";
2
2
  import { useTheme } from "./theme/scope.js";
3
3
  import { Avatar } from "./components/avatar/index.js";
4
4
  import { RouterProvider } from "./router/index.js";
5
+ import { Text } from "./components/text/index.js";
6
+ import { ProgressIndicator } from "./components/progress-indicator/index.js";
5
7
  import { Button } from "./components/button/index.js";
6
8
  import { Card } from "./components/card/index.js";
7
9
  import { Checkbox } from "./components/checkbox/index.js";
@@ -12,16 +14,17 @@ import { Currency } from "./components/currency/index.js";
12
14
  import { Form } from "./components/form/index.js";
13
15
  import { IconButton } from "./components/icon-button/index.js";
14
16
  import { Link } from "./components/link/index.js";
17
+ import { Meter } from "./components/meter/index.js";
15
18
  import { NumberField } from "./components/number-field/index.js";
16
19
  import { ProductIcon } from "./components/product-icon/index.js";
17
20
  import { Radio, RadioGroup } from "./components/radio-group/index.js";
18
21
  import { SearchField } from "./components/search-field/index.js";
19
22
  import { SegmentedButton, SegmentedButtonSegment } from "./components/segmented-button/index.js";
20
23
  import { Separator } from "./components/separator/index.js";
24
+ import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
25
+ import { Snackbar } from "./components/snackbar/index.js";
21
26
  import { Stack } from "./components/stack/index.js";
22
27
  import { Switch } from "./components/switch/index.js";
23
- import { Text } from "./components/text/index.js";
24
28
  import { TextField } from "./components/text-field/index.js";
25
- import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
26
29
  import { ThemeScope } from "./theme-scope.js";
27
- export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Form, IconButton, Link, NumberField, ProductIcon, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
30
+ export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
@@ -0,0 +1,15 @@
1
+ import "react-native";
2
+ import { ReactNode } from "react";
3
+ import "react-native-reanimated";
4
+ //#region src/indicator/index.d.ts
5
+ /**
6
+ * The line's colour. `primary` is the page's own pair. `negative` and
7
+ * `positive` swap the active indicator and the stop indicator alone, leaving
8
+ * the track in secondary container, so a column of meters reads as one scale
9
+ * with bars of different colours. `inherit` takes the colour of the slot the
10
+ * line sits in for both, and gives the track a quarter of it.
11
+ */
12
+ type IndicatorTone = 'inherit' | 'negative' | 'positive' | 'primary';
13
+ //#endregion
14
+ export type { IndicatorTone };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,256 @@
1
+ import { useIconStyle } from "../glyphs/icon-style.js";
2
+ import { useTheme } from "../theme/scope.js";
3
+ import { composeStyles } from "../theme/styles.js";
4
+ import { withOpacity } from "../theme/color.js";
5
+ import { Text as Text$1 } from "../components/text/index.js";
6
+ import { localeOf } from "../number/locale.js";
7
+ import { styles, stylesOf } from "./styles.js";
8
+ import { c } from "react/compiler-runtime";
9
+ import { View } from "react-native";
10
+ import { useEffect, useState } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
13
+ import { NumberFormatter } from "@internationalized/number";
14
+ //#region src/indicator/index.tsx
15
+ /**
16
+ * The active indicator's length at a value: the value's share of what the two
17
+ * gaps and the stop leave of the row, as web's `activeAt` gives it. A share of
18
+ * the whole row would run the row 12dp long at the maximum, with the stop
19
+ * drawn past its end.
20
+ */
21
+ function activeLength(width, percentage) {
22
+ "worklet";
23
+ return Math.max(0, width - 12) * percentage / 100;
24
+ }
25
+ function fillOf(color) {
26
+ return { backgroundColor: color };
27
+ }
28
+ /**
29
+ * The label and, optionally, the value, on a row above the indicator, both in
30
+ * the label-large role and on-surface-variant. Renders nothing when there is
31
+ * neither to show.
32
+ */
33
+ function IndicatorLabels(t0) {
34
+ const $ = c(12);
35
+ const { label, value } = t0;
36
+ const theme = useTheme();
37
+ const hasLabel = label !== void 0 && label !== "";
38
+ const hasValue = value !== void 0 && value !== "";
39
+ if (!hasLabel && !hasValue) return null;
40
+ let t1;
41
+ if ($[0] !== theme) {
42
+ t1 = stylesOf(theme);
43
+ $[0] = theme;
44
+ $[1] = t1;
45
+ } else t1 = $[1];
46
+ let t2;
47
+ if ($[2] !== hasLabel || $[3] !== label) {
48
+ t2 = hasLabel ? /* @__PURE__ */ jsx(Text$1, {
49
+ style: styles.label,
50
+ tone: "muted",
51
+ variant: "labelLarge",
52
+ children: label
53
+ }) : null;
54
+ $[2] = hasLabel;
55
+ $[3] = label;
56
+ $[4] = t2;
57
+ } else t2 = $[4];
58
+ let t3;
59
+ if ($[5] !== hasValue || $[6] !== value) {
60
+ t3 = hasValue ? /* @__PURE__ */ jsx(Text$1, {
61
+ numberOfLines: 1,
62
+ style: styles.value,
63
+ tone: "muted",
64
+ variant: "labelLarge",
65
+ children: value
66
+ }) : null;
67
+ $[5] = hasValue;
68
+ $[6] = value;
69
+ $[7] = t3;
70
+ } else t3 = $[7];
71
+ let t4;
72
+ if ($[8] !== t1.labels || $[9] !== t2 || $[10] !== t3) {
73
+ t4 = /* @__PURE__ */ jsxs(View, {
74
+ style: t1.labels,
75
+ children: [t2, t3]
76
+ });
77
+ $[8] = t1.labels;
78
+ $[9] = t2;
79
+ $[10] = t3;
80
+ $[11] = t4;
81
+ } else t4 = $[11];
82
+ return t4;
83
+ }
84
+ /**
85
+ * The page's line: the active indicator at its share of the measured width,
86
+ * the track taking what is left, and the stop indicator at the end. Anything
87
+ * passed as `children` is drawn inside the track, which is what the progress
88
+ * indicator's buffer fills it with; with none the track is solid.
89
+ * `activeOpacity` is how far the active indicator shows, which is how the
90
+ * progress indicator fades it under a wave.
91
+ */
92
+ function IndicatorLine(t0) {
93
+ const $ = c(3);
94
+ const { activeOpacity, children, colors, percentage, width } = t0;
95
+ const theme = useTheme();
96
+ const sheet = stylesOf(theme);
97
+ const active = useAnimatedStyle(() => {
98
+ "worklet";
99
+ return {
100
+ opacity: activeOpacity === void 0 ? 1 : activeOpacity.get(),
101
+ width: activeLength(width, percentage.get())
102
+ };
103
+ });
104
+ const T0 = View;
105
+ const t1 = composeStyles(styles.stop, sheet.stop, fillOf(colors.active));
106
+ let t2;
107
+ if ($[0] !== T0 || $[1] !== t1) {
108
+ t2 = /* @__PURE__ */ jsx(T0, { style: t1 });
109
+ $[0] = T0;
110
+ $[1] = t1;
111
+ $[2] = t2;
112
+ } else t2 = $[2];
113
+ return /* @__PURE__ */ jsxs(View, {
114
+ style: styles.line,
115
+ children: [
116
+ /* @__PURE__ */ jsx(Animated.View, { style: composeStyles(styles.active, sheet.active, fillOf(colors.active), active) }),
117
+ /* @__PURE__ */ jsx(View, {
118
+ style: composeStyles(styles.track, sheet.track, children === void 0 ? fillOf(colors.track) : void 0),
119
+ children
120
+ }),
121
+ t2
122
+ ]
123
+ });
124
+ }
125
+ /**
126
+ * The value as React Aria's `useProgressBar` and `useMeter` read it: clamped to the range,
127
+ * as a percentage of it, and written out by `formatOptions` in the locale,
128
+ * the share of the range under a percent style and the value itself under
129
+ * any other, unless `valueLabel` says it in words.
130
+ */
131
+ function readingOf({ formatOptions = { style: "percent" }, locale, maxValue, minValue, value, valueLabel }) {
132
+ const clamped = Math.min(Math.max(value, minValue), maxValue);
133
+ const range = maxValue - minValue;
134
+ const share = range === 0 ? 0 : (clamped - minValue) / range;
135
+ const text = valueLabel ?? new NumberFormatter(localeOf(locale), formatOptions).format(formatOptions.style === "percent" ? share : clamped);
136
+ return {
137
+ percentage: share * 100,
138
+ text,
139
+ value: clamped
140
+ };
141
+ }
142
+ /**
143
+ * A value that moves to each new target over `timing`, or jumps to it while
144
+ * the reader has asked for reduced motion, as web's transition drops to `0s`
145
+ * there. It starts at its first target, so nothing moves as it mounts.
146
+ */
147
+ function useEased(target, timing) {
148
+ const $ = c(10);
149
+ const reduceMotion = useReducedMotion();
150
+ const shown = useSharedValue(target);
151
+ const { duration } = timing;
152
+ const [x1, y1, x2, y2] = timing.easing;
153
+ let t0;
154
+ let t1;
155
+ if ($[0] !== duration || $[1] !== reduceMotion || $[2] !== shown || $[3] !== target || $[4] !== x1 || $[5] !== x2 || $[6] !== y1 || $[7] !== y2) {
156
+ t0 = () => {
157
+ shown.set(reduceMotion ? target : withTiming(target, {
158
+ duration,
159
+ easing: Easing.bezier(x1, y1, x2, y2)
160
+ }));
161
+ };
162
+ t1 = [
163
+ duration,
164
+ reduceMotion,
165
+ shown,
166
+ target,
167
+ x1,
168
+ x2,
169
+ y1,
170
+ y2
171
+ ];
172
+ $[0] = duration;
173
+ $[1] = reduceMotion;
174
+ $[2] = shown;
175
+ $[3] = target;
176
+ $[4] = x1;
177
+ $[5] = x2;
178
+ $[6] = y1;
179
+ $[7] = y2;
180
+ $[8] = t0;
181
+ $[9] = t1;
182
+ } else {
183
+ t0 = $[8];
184
+ t1 = $[9];
185
+ }
186
+ useEffect(t0, t1);
187
+ return shown;
188
+ }
189
+ /**
190
+ * The colours a tone draws the line in. `inherit` reads the colour of the
191
+ * slot the line sits in, as a button hands its content colour to what it
192
+ * holds, and falls back to on-surface outside one.
193
+ */
194
+ function useIndicatorColors(tone) {
195
+ const $ = c(8);
196
+ const { colors } = useTheme();
197
+ const slot = useIconStyle().color;
198
+ if (tone === "inherit") {
199
+ const color = typeof slot === "string" ? slot : colors.onSurface;
200
+ let t0;
201
+ if ($[0] !== color) {
202
+ t0 = withOpacity(color, .25);
203
+ $[0] = color;
204
+ $[1] = t0;
205
+ } else t0 = $[1];
206
+ let t1;
207
+ if ($[2] !== color || $[3] !== t0) {
208
+ t1 = {
209
+ active: color,
210
+ track: t0
211
+ };
212
+ $[2] = color;
213
+ $[3] = t0;
214
+ $[4] = t1;
215
+ } else t1 = $[4];
216
+ return t1;
217
+ }
218
+ const t0 = colors[tone];
219
+ let t1;
220
+ if ($[5] !== colors.secondaryContainer || $[6] !== t0) {
221
+ t1 = {
222
+ active: t0,
223
+ track: colors.secondaryContainer
224
+ };
225
+ $[5] = colors.secondaryContainer;
226
+ $[6] = t0;
227
+ $[7] = t1;
228
+ } else t1 = $[7];
229
+ return t1;
230
+ }
231
+ /** The width a view was last laid out at, and the handler that reads it. */
232
+ function useMeasuredWidth() {
233
+ const $ = c(3);
234
+ const [width, setWidth] = useState(0);
235
+ let t0;
236
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
237
+ t0 = (event) => {
238
+ setWidth(event.nativeEvent.layout.width);
239
+ };
240
+ $[0] = t0;
241
+ } else t0 = $[0];
242
+ let t1;
243
+ if ($[1] !== width) {
244
+ t1 = {
245
+ onLayout: t0,
246
+ width
247
+ };
248
+ $[1] = width;
249
+ $[2] = t1;
250
+ } else t1 = $[2];
251
+ return t1;
252
+ }
253
+ //#endregion
254
+ export { IndicatorLabels, IndicatorLine, activeLength, fillOf, readingOf, useEased, useIndicatorColors, useMeasuredWidth };
255
+
256
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","LayoutChangeEvent","ViewStyle","AnimatedStyle","SharedValue","NumberFormatter","useEffect","useState","View","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","Text","useIconStyle","localeOf","withOpacity","useTheme","composeStyles","RESERVED","styles","stylesOf","IndicatorColors","active","track","IndicatorTiming","duration","easing","IndicatorTone","activeLength","width","percentage","Math","max","fillOf","color","backgroundColor","IndicatorLabels","t0","$","_c","label","value","theme","hasLabel","undefined","hasValue","t1","t2","t3","t4","labels","IndicatorLine","activeOpacity","children","colors","sheet","opacity","get","T0","stop","line","readingOf","formatOptions","style","locale","maxValue","minValue","valueLabel","Intl","NumberFormatOptions","clamped","min","range","share","text","format","useEased","target","timing","reduceMotion","shown","x1","y1","x2","y2","set","bezier","useIndicatorColors","tone","slot","onSurface","secondaryContainer","useMeasuredWidth","setWidth","Symbol","for","event","nativeEvent","layout","onLayout","_c","Text"],"sources":["../../src/indicator/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native'\nimport type { AnimatedStyle, SharedValue } from 'react-native-reanimated'\n\nimport { NumberFormatter } from '@internationalized/number'\nimport { useEffect, useState } from 'react'\nimport { View } from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\n\nimport { Text } from '../components/text'\nimport { useIconStyle } from '../glyphs/icon-style'\nimport { localeOf } from '../number/locale'\nimport { withOpacity } from '../theme/color'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles } from '../theme/styles'\nimport { RESERVED, styles, stylesOf } from './styles'\n\n// The pieces a linear indicator is drawn from, shared by ProgressIndicator and\n// Meter as web's src/indicator is. The styles they use are in ./styles.ts.\n//\n// Web lays the line out with `calc()` against the row's own width. React\n// Native has no `calc()`, so the row is measured through `onLayout` and the\n// active indicator's width worked out from that, which is also the length a\n// wave along the line follows.\n\n/** What a line draws its parts in. */\ntype IndicatorColors = {\n /** The active indicator and the stop indicator. */\n readonly active: string\n /** The track. */\n readonly track: string\n}\n\n/** How a value that changes moves: a duration in ms and a cubic Bézier. */\ntype IndicatorTiming = {\n readonly duration: number\n readonly easing: readonly [number, number, number, number]\n}\n\n/**\n * The line's colour. `primary` is the page's own pair. `negative` and\n * `positive` swap the active indicator and the stop indicator alone, leaving\n * the track in secondary container, so a column of meters reads as one scale\n * with bars of different colours. `inherit` takes the colour of the slot the\n * line sits in for both, and gives the track a quarter of it.\n */\ntype IndicatorTone = 'inherit' | 'negative' | 'positive' | 'primary'\n\n/**\n * The active indicator's length at a value: the value's share of what the two\n * gaps and the stop leave of the row, as web's `activeAt` gives it. A share of\n * the whole row would run the row 12dp long at the maximum, with the stop\n * drawn past its end.\n */\nfunction activeLength(width: number, percentage: number) {\n 'worklet'\n return (Math.max(0, width - RESERVED) * percentage) / 100\n}\n\n// A view's fill, 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 fillOf(color: string) {\n return { backgroundColor: color }\n}\n\n/**\n * The label and, optionally, the value, on a row above the indicator, both in\n * the label-large role and on-surface-variant. Renders nothing when there is\n * neither to show.\n */\nfunction IndicatorLabels({\n label,\n value,\n}: {\n readonly label: string | undefined\n readonly value: string | undefined\n}) {\n const theme = useTheme()\n const hasLabel = label !== undefined && label !== ''\n const hasValue = value !== undefined && value !== ''\n\n if (!hasLabel && !hasValue) {\n return null\n }\n\n return (\n <View style={stylesOf(theme).labels}>\n {hasLabel ? (\n <Text style={styles.label} tone=\"muted\" variant=\"labelLarge\">\n {label}\n </Text>\n ) : null}\n {hasValue ? (\n <Text\n numberOfLines={1}\n style={styles.value}\n tone=\"muted\"\n variant=\"labelLarge\"\n >\n {value}\n </Text>\n ) : null}\n </View>\n )\n}\n\n/**\n * The page's line: the active indicator at its share of the measured width,\n * the track taking what is left, and the stop indicator at the end. Anything\n * passed as `children` is drawn inside the track, which is what the progress\n * indicator's buffer fills it with; with none the track is solid.\n * `activeOpacity` is how far the active indicator shows, which is how the\n * progress indicator fades it under a wave.\n */\nfunction IndicatorLine({\n activeOpacity,\n children,\n colors,\n percentage,\n width,\n}: {\n readonly activeOpacity?: SharedValue<number>\n readonly children?: ReactNode\n readonly colors: IndicatorColors\n readonly percentage: SharedValue<number>\n readonly width: number\n}) {\n const theme = useTheme()\n const sheet = stylesOf(theme)\n const active = useAnimatedStyle(() => {\n 'worklet'\n return {\n opacity: activeOpacity === undefined ? 1 : activeOpacity.get(),\n width: activeLength(width, percentage.get()),\n }\n })\n\n return (\n <View style={styles.line}>\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.active,\n sheet.active,\n fillOf(colors.active),\n active,\n )}\n />\n <View\n style={composeStyles<ViewStyle>(\n styles.track,\n sheet.track,\n children === undefined ? fillOf(colors.track) : undefined,\n )}\n >\n {children}\n </View>\n <View\n style={composeStyles<ViewStyle>(\n styles.stop,\n sheet.stop,\n fillOf(colors.active),\n )}\n />\n </View>\n )\n}\n\n/**\n * The value as React Aria's `useProgressBar` and `useMeter` read it: clamped to the range,\n * as a percentage of it, and written out by `formatOptions` in the locale,\n * the share of the range under a percent style and the value itself under\n * any other, unless `valueLabel` says it in words.\n */\nfunction readingOf({\n formatOptions = { style: 'percent' },\n locale,\n maxValue,\n minValue,\n value,\n valueLabel,\n}: {\n readonly formatOptions: Intl.NumberFormatOptions | undefined\n readonly locale: string | undefined\n readonly maxValue: number\n readonly minValue: number\n readonly value: number\n readonly valueLabel: string | undefined\n}) {\n const clamped = Math.min(Math.max(value, minValue), maxValue)\n const range = maxValue - minValue\n const share = range === 0 ? 0 : (clamped - minValue) / range\n const text =\n valueLabel ??\n new NumberFormatter(localeOf(locale), formatOptions).format(\n formatOptions.style === 'percent' ? share : clamped,\n )\n\n return { percentage: share * 100, text, value: clamped }\n}\n\n/**\n * A value that moves to each new target over `timing`, or jumps to it while\n * the reader has asked for reduced motion, as web's transition drops to `0s`\n * there. It starts at its first target, so nothing moves as it mounts.\n */\nfunction useEased(target: number, timing: IndicatorTiming) {\n const reduceMotion = useReducedMotion()\n const shown = useSharedValue(target)\n const { duration } = timing\n const [x1, y1, x2, y2] = timing.easing\n\n useEffect(() => {\n shown.set(\n reduceMotion\n ? target\n : withTiming(target, {\n duration,\n easing: Easing.bezier(x1, y1, x2, y2),\n }),\n )\n }, [duration, reduceMotion, shown, target, x1, x2, y1, y2])\n\n return shown\n}\n\n/**\n * The colours a tone draws the line in. `inherit` reads the colour of the\n * slot the line sits in, as a button hands its content colour to what it\n * holds, and falls back to on-surface outside one.\n */\nfunction useIndicatorColors(tone: IndicatorTone): IndicatorColors {\n const { colors } = useTheme()\n const slot = useIconStyle().color\n\n if (tone === 'inherit') {\n const color = typeof slot === 'string' ? slot : colors.onSurface\n\n return { active: color, track: withOpacity(color, 0.25) }\n }\n\n return { active: colors[tone], track: colors.secondaryContainer }\n}\n\n/** The width a view was last laid out at, and the handler that reads it. */\nfunction useMeasuredWidth() {\n const [width, setWidth] = useState(0)\n\n return {\n onLayout: (event: LayoutChangeEvent) => {\n setWidth(event.nativeEvent.layout.width)\n },\n width,\n }\n}\n\nexport {\n activeLength,\n fillOf,\n IndicatorLabels,\n IndicatorLine,\n readingOf,\n useEased,\n useIndicatorColors,\n useMeasuredWidth,\n}\nexport type { IndicatorColors, IndicatorTiming, IndicatorTone }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4DA,SAAS+B,aAAaC,OAAeC,YAAoB;CACvD;CACA,OAAQC,KAAKC,IAAI,GAAGH,QAAAA,EAAgB,IAAIC,aAAc;AACxD;AAIA,SAASG,OAAOC,OAAe;CAC7B,OAAO,EAAEC,iBAAiBD,MAAM;AAClC;;;;;;AAOA,SAAAE,gBAAAC,IAAA;CAA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AAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAT,OAAA;EAHIiB,KAAA;GAAAqD,UACK9D;GAETR;EAEH;EAACS,EAAA,KAAAT;EAAAS,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OALMQ;AAKN"}
@@ -0,0 +1,86 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { useEffect } from "react";
3
+ import { Easing, ReduceMotion, cancelAnimation, useSharedValue, withRepeat, withTiming } from "react-native-reanimated";
4
+ //#region src/indicator/motion.ts
5
+ const SEARCH_STEPS = 24;
6
+ /**
7
+ * The value `frames` give at `time`, a share of the loop: the frames either
8
+ * side of it, and the curve between them.
9
+ *
10
+ * A curve is a function of its parameter rather than of the time, so the
11
+ * parameter is found by halving the interval until the curve's own `x` is the
12
+ * share of the segment gone, which holds for every curve whose control points
13
+ * lie inside the unit interval across, as every timing function's do. The
14
+ * search is nested here rather than beside it: a worklet captures what it
15
+ * calls when the module is evaluated, so one calling another declared below it
16
+ * would be handed nothing, and the linter orders declarations by name.
17
+ */
18
+ function keyframeAt(frames, time) {
19
+ "worklet";
20
+ let index = 0;
21
+ while (index < frames.length - 2 && time >= frames[index + 1][0]) index++;
22
+ const [from, start, curve] = frames[index];
23
+ const [to, end] = frames[index + 1];
24
+ const share = Math.min(1, Math.max(0, (time - from) / (to - from)));
25
+ if (curve === void 0 || share === 0 || share === 1) return start + (end - start) * share;
26
+ function coordinateAt(first, second, parameter) {
27
+ const rest = 1 - parameter;
28
+ return 3 * rest * rest * parameter * first + 3 * rest * parameter * parameter * second + parameter * parameter * parameter;
29
+ }
30
+ const [x1, y1, x2, y2] = curve;
31
+ let low = 0;
32
+ let high = 1;
33
+ let parameter = share;
34
+ for (let step = 0; step < SEARCH_STEPS; step++) {
35
+ if (coordinateAt(x1, x2, parameter) < share) low = parameter;
36
+ else high = parameter;
37
+ parameter = (low + high) / 2;
38
+ }
39
+ return start + (end - start) * coordinateAt(y1, y2, parameter);
40
+ }
41
+ /**
42
+ * A clock running from 0 to 1 over `duration` ms and starting again, for as
43
+ * long as `running` holds. It runs whatever the device says about reduced
44
+ * motion: Reanimated would otherwise jump a looping animation to its end,
45
+ * which freezes an indeterminate indicator, so a component slows its loop
46
+ * there by lengthening `duration` instead, as web's does.
47
+ */
48
+ function useLoop(duration, running) {
49
+ const $ = c(5);
50
+ const clock = useSharedValue(0);
51
+ let t0;
52
+ let t1;
53
+ if ($[0] !== clock || $[1] !== duration || $[2] !== running) {
54
+ t0 = () => {
55
+ if (!running) return;
56
+ clock.set(0);
57
+ clock.set(withRepeat(withTiming(1, {
58
+ duration,
59
+ easing: Easing.linear,
60
+ reduceMotion: ReduceMotion.Never
61
+ }), -1, false, void 0, ReduceMotion.Never));
62
+ return () => {
63
+ cancelAnimation(clock);
64
+ };
65
+ };
66
+ t1 = [
67
+ clock,
68
+ duration,
69
+ running
70
+ ];
71
+ $[0] = clock;
72
+ $[1] = duration;
73
+ $[2] = running;
74
+ $[3] = t0;
75
+ $[4] = t1;
76
+ } else {
77
+ t0 = $[3];
78
+ t1 = $[4];
79
+ }
80
+ useEffect(t0, t1);
81
+ return clock;
82
+ }
83
+ //#endregion
84
+ export { keyframeAt, useLoop };
85
+
86
+ //# sourceMappingURL=motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.js","names":["SharedValue","useEffect","cancelAnimation","Easing","ReduceMotion","useSharedValue","withRepeat","withTiming","Curve","Keyframe","at","value","curve","SEARCH_STEPS","keyframeAt","frames","time","index","length","from","start","to","end","share","Math","min","max","undefined","coordinateAt","first","second","parameter","rest","x1","y1","x2","y2","low","high","step","useLoop","duration","running","$","_c","clock","t0","t1","set","easing","linear","reduceMotion","Never","_c"],"sources":["../../src/indicator/motion.ts"],"sourcesContent":["import type { SharedValue } from 'react-native-reanimated'\n\nimport { useEffect } from 'react'\nimport {\n cancelAnimation,\n Easing,\n ReduceMotion,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated'\n\n// The machinery an indeterminate indicator's choreography runs on: a clock\n// that loops from 0 to 1, and the keyframes read off it. Web writes the same\n// choreography as CSS keyframes, each segment on a curve of its own; React\n// Native has no keyframes, so each property here is a list of the same\n// frames, read at the clock's time on the UI thread.\n\n/** A cubic Bézier's four control coordinates, in the order CSS writes them. */\ntype Curve = readonly [number, number, number, number]\n\n/**\n * One keyframe: where it falls in the loop, from 0 to 1, the value there,\n * and the curve the value takes to the next frame. A frame with no curve\n * moves to the next one at a constant rate, as a CSS keyframe with no timing\n * function does under a linear animation.\n */\ntype Keyframe = readonly [at: number, value: number, curve?: Curve]\n\n// How finely a curve's progress is searched for. Twenty-four halvings leave\n// it a sixteen-millionth out, far finer than a frame can show.\nconst SEARCH_STEPS = 24\n\n/**\n * The value `frames` give at `time`, a share of the loop: the frames either\n * side of it, and the curve between them.\n *\n * A curve is a function of its parameter rather than of the time, so the\n * parameter is found by halving the interval until the curve's own `x` is the\n * share of the segment gone, which holds for every curve whose control points\n * lie inside the unit interval across, as every timing function's do. The\n * search is nested here rather than beside it: a worklet captures what it\n * calls when the module is evaluated, so one calling another declared below it\n * would be handed nothing, and the linter orders declarations by name.\n */\nfunction keyframeAt(frames: readonly Keyframe[], time: number) {\n 'worklet'\n let index = 0\n while (index < frames.length - 2 && time >= frames[index + 1][0]) {\n index++\n }\n\n const [from, start, curve] = frames[index]\n const [to, end] = frames[index + 1]\n const share = Math.min(1, Math.max(0, (time - from) / (to - from)))\n\n if (curve === undefined || share === 0 || share === 1) {\n return start + (end - start) * share\n }\n\n // One coordinate of the curve from (0, 0) to (1, 1) at a parameter, given\n // the same coordinate of its two control points.\n // oxlint-disable-next-line unicorn/consistent-function-scoping -- a worklet captures what it calls when the module is evaluated; see above\n function coordinateAt(first: number, second: number, parameter: number) {\n const rest = 1 - parameter\n return (\n 3 * rest * rest * parameter * first +\n 3 * rest * parameter * parameter * second +\n parameter * parameter * parameter\n )\n }\n\n const [x1, y1, x2, y2] = curve\n let low = 0\n let high = 1\n let parameter = share\n for (let step = 0; step < SEARCH_STEPS; step++) {\n if (coordinateAt(x1, x2, parameter) < share) {\n low = parameter\n } else {\n high = parameter\n }\n parameter = (low + high) / 2\n }\n\n return start + (end - start) * coordinateAt(y1, y2, parameter)\n}\n\n/**\n * A clock running from 0 to 1 over `duration` ms and starting again, for as\n * long as `running` holds. It runs whatever the device says about reduced\n * motion: Reanimated would otherwise jump a looping animation to its end,\n * which freezes an indeterminate indicator, so a component slows its loop\n * there by lengthening `duration` instead, as web's does.\n */\nfunction useLoop(duration: number, running: boolean): SharedValue<number> {\n const clock = useSharedValue(0)\n\n useEffect(() => {\n if (!running) {\n return undefined\n }\n\n clock.set(0)\n clock.set(\n withRepeat(\n withTiming(1, {\n duration,\n easing: Easing.linear,\n reduceMotion: ReduceMotion.Never,\n }),\n -1,\n false,\n undefined,\n ReduceMotion.Never,\n ),\n )\n\n return () => {\n cancelAnimation(clock)\n }\n }, [clock, duration, running])\n\n return clock\n}\n\nexport { keyframeAt, useLoop }\nexport type { Curve, Keyframe }\n"],"mappings":";;;;AA+BA,MAAMa,eAAe;;;;;;;;;;;;;AAcrB,SAASC,WAAWC,QAA6BC,MAAc;CAC7D;CACA,IAAIC,QAAQ;CACZ,OAAOA,QAAQF,OAAOG,SAAS,KAAKF,QAAQD,OAAOE,QAAQ,EAAE,CAAC,IAC5DA;CAGF,MAAM,CAACE,MAAMC,OAAOR,SAASG,OAAOE;CACpC,MAAM,CAACI,IAAIC,OAAOP,OAAOE,QAAQ;CACjC,MAAMM,QAAQC,KAAKC,IAAI,GAAGD,KAAKE,IAAI,IAAIV,OAAOG,SAASE,KAAKF,KAAK,CAAC;CAElE,IAAIP,UAAUe,KAAAA,KAAaJ,UAAU,KAAKA,UAAU,GAClD,OAAOH,SAASE,MAAMF,SAASG;CAMjC,SAASK,aAAaC,OAAeC,QAAgBC,WAAmB;EACtE,MAAMC,OAAO,IAAID;EACjB,OACE,IAAIC,OAAOA,OAA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