@fluxus-ui/native 0.0.0-stage → 0.3.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 (230) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -2
  3. package/lib/module/AudioPlayer.js +174 -0
  4. package/lib/module/AudioPlayer.js.map +1 -0
  5. package/lib/module/Avatar.js +58 -0
  6. package/lib/module/Avatar.js.map +1 -0
  7. package/lib/module/Badge.js +72 -0
  8. package/lib/module/Badge.js.map +1 -0
  9. package/lib/module/BottomSheet.js +159 -0
  10. package/lib/module/BottomSheet.js.map +1 -0
  11. package/lib/module/Bubble.js +182 -0
  12. package/lib/module/Bubble.js.map +1 -0
  13. package/lib/module/Button.js +209 -0
  14. package/lib/module/Button.js.map +1 -0
  15. package/lib/module/Card.js +79 -0
  16. package/lib/module/Card.js.map +1 -0
  17. package/lib/module/Dialog.js +137 -0
  18. package/lib/module/Dialog.js.map +1 -0
  19. package/lib/module/Disclosure.js +153 -0
  20. package/lib/module/Disclosure.js.map +1 -0
  21. package/lib/module/EmptyState.js +71 -0
  22. package/lib/module/EmptyState.js.map +1 -0
  23. package/lib/module/Link.js +97 -0
  24. package/lib/module/Link.js.map +1 -0
  25. package/lib/module/ListItem.js +89 -0
  26. package/lib/module/ListItem.js.map +1 -0
  27. package/lib/module/Menu.js +76 -0
  28. package/lib/module/Menu.js.map +1 -0
  29. package/lib/module/Message.js +51 -0
  30. package/lib/module/Message.js.map +1 -0
  31. package/lib/module/Popover.js +153 -0
  32. package/lib/module/Popover.js.map +1 -0
  33. package/lib/module/Progress.js +54 -0
  34. package/lib/module/Progress.js.map +1 -0
  35. package/lib/module/Select.js +146 -0
  36. package/lib/module/Select.js.map +1 -0
  37. package/lib/module/Skeleton.js +40 -0
  38. package/lib/module/Skeleton.js.map +1 -0
  39. package/lib/module/Slider.js +137 -0
  40. package/lib/module/Slider.js.map +1 -0
  41. package/lib/module/Spinner.js +30 -0
  42. package/lib/module/Spinner.js.map +1 -0
  43. package/lib/module/Swap.js +87 -0
  44. package/lib/module/Swap.js.map +1 -0
  45. package/lib/module/Tabs.js +118 -0
  46. package/lib/module/Tabs.js.map +1 -0
  47. package/lib/module/Text.js +47 -0
  48. package/lib/module/Text.js.map +1 -0
  49. package/lib/module/TextField.js +190 -0
  50. package/lib/module/TextField.js.map +1 -0
  51. package/lib/module/Toast.js +157 -0
  52. package/lib/module/Toast.js.map +1 -0
  53. package/lib/module/audio.js +54 -0
  54. package/lib/module/audio.js.map +1 -0
  55. package/lib/module/blur.js +55 -0
  56. package/lib/module/blur.js.map +1 -0
  57. package/lib/module/controls.js +292 -0
  58. package/lib/module/controls.js.map +1 -0
  59. package/lib/module/feel.js +24 -0
  60. package/lib/module/feel.js.map +1 -0
  61. package/lib/module/generated/tokens.js +484 -0
  62. package/lib/module/generated/tokens.js.map +1 -0
  63. package/lib/module/haptics.js +25 -0
  64. package/lib/module/haptics.js.map +1 -0
  65. package/lib/module/icon-host.js +42 -0
  66. package/lib/module/icon-host.js.map +1 -0
  67. package/lib/module/icon-shape.js +222 -0
  68. package/lib/module/icon-shape.js.map +1 -0
  69. package/lib/module/icon.js +331 -0
  70. package/lib/module/icon.js.map +1 -0
  71. package/lib/module/index.js +39 -0
  72. package/lib/module/index.js.map +1 -0
  73. package/lib/module/layout.js +75 -0
  74. package/lib/module/layout.js.map +1 -0
  75. package/lib/module/marks.js +99 -0
  76. package/lib/module/marks.js.map +1 -0
  77. package/lib/module/motion.js +95 -0
  78. package/lib/module/motion.js.map +1 -0
  79. package/lib/module/overlay.js +99 -0
  80. package/lib/module/overlay.js.map +1 -0
  81. package/lib/module/package.json +1 -0
  82. package/lib/module/pending.js +181 -0
  83. package/lib/module/pending.js.map +1 -0
  84. package/lib/module/presence.js +71 -0
  85. package/lib/module/presence.js.map +1 -0
  86. package/lib/module/press.js +32 -0
  87. package/lib/module/press.js.map +1 -0
  88. package/lib/module/screen.js +50 -0
  89. package/lib/module/screen.js.map +1 -0
  90. package/lib/module/success.js +59 -0
  91. package/lib/module/success.js.map +1 -0
  92. package/lib/module/theme.js +41 -0
  93. package/lib/module/theme.js.map +1 -0
  94. package/lib/typescript/AudioPlayer.d.ts +26 -0
  95. package/lib/typescript/AudioPlayer.d.ts.map +1 -0
  96. package/lib/typescript/Avatar.d.ts +17 -0
  97. package/lib/typescript/Avatar.d.ts.map +1 -0
  98. package/lib/typescript/Badge.d.ts +21 -0
  99. package/lib/typescript/Badge.d.ts.map +1 -0
  100. package/lib/typescript/BottomSheet.d.ts +27 -0
  101. package/lib/typescript/BottomSheet.d.ts.map +1 -0
  102. package/lib/typescript/Bubble.d.ts +23 -0
  103. package/lib/typescript/Bubble.d.ts.map +1 -0
  104. package/lib/typescript/Button.d.ts +29 -0
  105. package/lib/typescript/Button.d.ts.map +1 -0
  106. package/lib/typescript/Card.d.ts +17 -0
  107. package/lib/typescript/Card.d.ts.map +1 -0
  108. package/lib/typescript/Dialog.d.ts +34 -0
  109. package/lib/typescript/Dialog.d.ts.map +1 -0
  110. package/lib/typescript/Disclosure.d.ts +39 -0
  111. package/lib/typescript/Disclosure.d.ts.map +1 -0
  112. package/lib/typescript/EmptyState.d.ts +14 -0
  113. package/lib/typescript/EmptyState.d.ts.map +1 -0
  114. package/lib/typescript/Link.d.ts +23 -0
  115. package/lib/typescript/Link.d.ts.map +1 -0
  116. package/lib/typescript/ListItem.d.ts +20 -0
  117. package/lib/typescript/ListItem.d.ts.map +1 -0
  118. package/lib/typescript/Menu.d.ts +23 -0
  119. package/lib/typescript/Menu.d.ts.map +1 -0
  120. package/lib/typescript/Message.d.ts +14 -0
  121. package/lib/typescript/Message.d.ts.map +1 -0
  122. package/lib/typescript/Popover.d.ts +71 -0
  123. package/lib/typescript/Popover.d.ts.map +1 -0
  124. package/lib/typescript/Progress.d.ts +12 -0
  125. package/lib/typescript/Progress.d.ts.map +1 -0
  126. package/lib/typescript/Select.d.ts +30 -0
  127. package/lib/typescript/Select.d.ts.map +1 -0
  128. package/lib/typescript/Skeleton.d.ts +13 -0
  129. package/lib/typescript/Skeleton.d.ts.map +1 -0
  130. package/lib/typescript/Slider.d.ts +21 -0
  131. package/lib/typescript/Slider.d.ts.map +1 -0
  132. package/lib/typescript/Spinner.d.ts +12 -0
  133. package/lib/typescript/Spinner.d.ts.map +1 -0
  134. package/lib/typescript/Swap.d.ts +25 -0
  135. package/lib/typescript/Swap.d.ts.map +1 -0
  136. package/lib/typescript/Tabs.d.ts +18 -0
  137. package/lib/typescript/Tabs.d.ts.map +1 -0
  138. package/lib/typescript/Text.d.ts +20 -0
  139. package/lib/typescript/Text.d.ts.map +1 -0
  140. package/lib/typescript/TextField.d.ts +36 -0
  141. package/lib/typescript/TextField.d.ts.map +1 -0
  142. package/lib/typescript/Toast.d.ts +25 -0
  143. package/lib/typescript/Toast.d.ts.map +1 -0
  144. package/lib/typescript/audio.d.ts +10 -0
  145. package/lib/typescript/audio.d.ts.map +1 -0
  146. package/lib/typescript/blur.d.ts +4 -0
  147. package/lib/typescript/blur.d.ts.map +1 -0
  148. package/lib/typescript/controls.d.ts +37 -0
  149. package/lib/typescript/controls.d.ts.map +1 -0
  150. package/lib/typescript/feel.d.ts +10 -0
  151. package/lib/typescript/feel.d.ts.map +1 -0
  152. package/lib/typescript/generated/tokens.d.ts +499 -0
  153. package/lib/typescript/generated/tokens.d.ts.map +1 -0
  154. package/lib/typescript/haptics.d.ts +7 -0
  155. package/lib/typescript/haptics.d.ts.map +1 -0
  156. package/lib/typescript/icon-host.d.ts +30 -0
  157. package/lib/typescript/icon-host.d.ts.map +1 -0
  158. package/lib/typescript/icon-shape.d.ts +28 -0
  159. package/lib/typescript/icon-shape.d.ts.map +1 -0
  160. package/lib/typescript/icon.d.ts +24 -0
  161. package/lib/typescript/icon.d.ts.map +1 -0
  162. package/lib/typescript/index.d.ts +37 -0
  163. package/lib/typescript/index.d.ts.map +1 -0
  164. package/lib/typescript/layout.d.ts +24 -0
  165. package/lib/typescript/layout.d.ts.map +1 -0
  166. package/lib/typescript/marks.d.ts +23 -0
  167. package/lib/typescript/marks.d.ts.map +1 -0
  168. package/lib/typescript/motion.d.ts +30 -0
  169. package/lib/typescript/motion.d.ts.map +1 -0
  170. package/lib/typescript/overlay.d.ts +33 -0
  171. package/lib/typescript/overlay.d.ts.map +1 -0
  172. package/lib/typescript/package.json +1 -0
  173. package/lib/typescript/pending.d.ts +26 -0
  174. package/lib/typescript/pending.d.ts.map +1 -0
  175. package/lib/typescript/presence.d.ts +37 -0
  176. package/lib/typescript/presence.d.ts.map +1 -0
  177. package/lib/typescript/press.d.ts +12 -0
  178. package/lib/typescript/press.d.ts.map +1 -0
  179. package/lib/typescript/screen.d.ts +21 -0
  180. package/lib/typescript/screen.d.ts.map +1 -0
  181. package/lib/typescript/success.d.ts +13 -0
  182. package/lib/typescript/success.d.ts.map +1 -0
  183. package/lib/typescript/theme.d.ts +32 -0
  184. package/lib/typescript/theme.d.ts.map +1 -0
  185. package/package.json +123 -3
  186. package/src/AudioPlayer.tsx +106 -0
  187. package/src/Avatar.tsx +44 -0
  188. package/src/Badge.tsx +45 -0
  189. package/src/BottomSheet.tsx +109 -0
  190. package/src/Bubble.tsx +112 -0
  191. package/src/Button.tsx +168 -0
  192. package/src/Card.tsx +70 -0
  193. package/src/Dialog.tsx +93 -0
  194. package/src/Disclosure.tsx +108 -0
  195. package/src/EmptyState.tsx +51 -0
  196. package/src/Link.tsx +61 -0
  197. package/src/ListItem.tsx +78 -0
  198. package/src/Menu.tsx +57 -0
  199. package/src/Message.tsx +43 -0
  200. package/src/Popover.tsx +145 -0
  201. package/src/Progress.tsx +33 -0
  202. package/src/Select.tsx +118 -0
  203. package/src/Skeleton.tsx +28 -0
  204. package/src/Slider.tsx +107 -0
  205. package/src/Spinner.tsx +18 -0
  206. package/src/Swap.tsx +74 -0
  207. package/src/Tabs.tsx +84 -0
  208. package/src/Text.tsx +44 -0
  209. package/src/TextField.tsx +137 -0
  210. package/src/Toast.tsx +122 -0
  211. package/src/audio.tsx +56 -0
  212. package/src/blur.tsx +33 -0
  213. package/src/controls.tsx +224 -0
  214. package/src/feel.ts +22 -0
  215. package/src/generated/tokens.ts +653 -0
  216. package/src/haptics.tsx +26 -0
  217. package/src/icon-host.tsx +46 -0
  218. package/src/icon-shape.ts +213 -0
  219. package/src/icon.tsx +276 -0
  220. package/src/index.ts +36 -0
  221. package/src/layout.tsx +40 -0
  222. package/src/marks.tsx +79 -0
  223. package/src/motion.ts +94 -0
  224. package/src/overlay.tsx +77 -0
  225. package/src/pending.tsx +135 -0
  226. package/src/presence.tsx +68 -0
  227. package/src/press.ts +23 -0
  228. package/src/screen.tsx +37 -0
  229. package/src/success.tsx +48 -0
  230. package/src/theme.tsx +49 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ import { type ViewProps, type ViewStyle } from 'react-native';
2
+ /**
3
+ * For what takes the room left in a row. Not `flex: 1`: that has no width of its own, and in what is only as
4
+ * wide as what it holds (a menu, a popover) the text would break letter by letter. (SPEC §15.8)
5
+ */
6
+ export declare const fill: ViewStyle;
7
+ /** A step of the space scale: `space.3` is 12 points. */
8
+ export type Space = '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12' | '16';
9
+ export interface StackProps extends ViewProps {
10
+ gap?: Space;
11
+ align?: ViewStyle['alignItems'];
12
+ justify?: ViewStyle['justifyContent'];
13
+ }
14
+ /** What it holds, one under the other. */
15
+ export declare function Stack({ gap, align, justify, style, ...rest }: StackProps): import("react").JSX.Element;
16
+ export interface RowProps extends StackProps {
17
+ /** It goes on to the next line when it does not fit. */
18
+ wrap?: boolean;
19
+ }
20
+ /** What it holds, side by side, in the direction of the language. */
21
+ export declare function Row({ gap, align, justify, wrap, style, ...rest }: RowProps): import("react").JSX.Element;
22
+ /** A rule between two things. It is not there for a screen reader. */
23
+ export declare function Divider({ style, ...rest }: ViewProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,SAA6D,CAAC;AAEjF,yDAAyD;AACzD,MAAM,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjF,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;CACvC;AAED,0CAA0C;AAC1C,wBAAgB,KAAK,CAAC,EAAE,GAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,+BAG9E;AAED,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,qEAAqE;AACrE,wBAAgB,GAAG,CAAC,EAAE,GAAS,EAAE,KAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,+BAG3F;AAED,sEAAsE;AACtE,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,+BAGpD"}
@@ -0,0 +1,23 @@
1
+ import { type StyleProp, type ViewStyle } from 'react-native';
2
+ /** x1 y1 x2 y2, on the 16 × 16 grid of the icons. */
3
+ type Segment = readonly [number, number, number, number];
4
+ /** As the icon `tick`. */
5
+ export declare const TICK: readonly Segment[];
6
+ export declare const DASH: readonly Segment[];
7
+ /** A bar, then its dot. */
8
+ export declare const BANG: readonly Segment[];
9
+ export interface MarkProps {
10
+ segments: readonly Segment[];
11
+ /** Drawn, or not; it draws and undraws on the snappy spring. */
12
+ shown: boolean;
13
+ /** Its side, in points. Default: 16. */
14
+ size?: number;
15
+ color: string;
16
+ /** The width of its stroke, in points. Default: 1.5 of every 16. */
17
+ stroke?: number;
18
+ style?: StyleProp<ViewStyle>;
19
+ testID?: string;
20
+ }
21
+ export declare function Mark({ segments, shown, size, color, stroke, style, testID }: MarkProps): import("react").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=marks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/marks.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,qDAAqD;AACrD,KAAK,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzD,0BAA0B;AAC1B,eAAO,MAAM,IAAI,EAAE,SAAS,OAAO,EAGlC,CAAC;AACF,eAAO,MAAM,IAAI,EAAE,SAAS,OAAO,EAAoB,CAAC;AACxD,2BAA2B;AAC3B,eAAO,MAAM,IAAI,EAAE,SAAS,OAAO,EAGlC,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7B,gEAAgE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,+BAmB3F"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The motion vocabulary of Fluxus on Reanimated: the same names, durations and
3
+ * springs as the web (core/src/tokens.ts). With reduced motion on in the system,
4
+ * a value goes to its end at once. (SPEC §15, §15.12)
5
+ */
6
+ import { type AnimationCallback } from 'react-native-reanimated';
7
+ import { motion } from './generated/tokens.js';
8
+ export type SpringPreset = keyof typeof motion.spring;
9
+ export type DurationToken = keyof typeof motion.duration;
10
+ export type EasingToken = keyof typeof motion.easing;
11
+ /** For a screen that shows the motion, or to look at it closely: 4 makes everything four times slower. */
12
+ export declare const setMotionScale: (k: number) => void;
13
+ /** A duration in ms, at the speed the motion runs. On the JS thread, and safe while rendering. */
14
+ export declare const ms: (duration: number) => number;
15
+ export declare const spring: (to: number, preset?: SpringPreset) => number;
16
+ export declare const timing: (to: number, duration?: DurationToken, easing?: EasingToken) => number;
17
+ export interface FluxSpringConfig {
18
+ stiffness: number;
19
+ damping: number;
20
+ /** Units per second, added to the speed it already has. */
21
+ velocity?: number;
22
+ restDelta?: number;
23
+ restSpeed?: number;
24
+ }
25
+ /**
26
+ * The spring of the web (core/src/spring.ts): semi-implicit Euler in steps of 1/120 s. Started over another,
27
+ * it keeps its speed, wherever that points: a value sent back turns round, as `retarget` does on the web.
28
+ */
29
+ export declare function withFluxSpring(toValue: number, config: FluxSpringConfig, callback?: AnimationCallback): number;
30
+ //# sourceMappingURL=motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/motion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA8E,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7I,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAoB,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,MAAM,CAAC,QAAQ,CAAC;AACzD,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;AAMrD,0GAA0G;AAC1G,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,KAAG,IAG1C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,EAAE,GAAI,UAAU,MAAM,KAAG,MAA0B,CAAC;AAEjE,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,EAAE,SAAQ,YAAuB,KAAG,MAMpE,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,EAAE,WAAU,aAAwB,EAAE,SAAQ,WAAwB,KAAG,MAIzG,CAAC;AAYF,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CA+B9G"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * What opens above everything: a window of React Native (`Modal`) that paints and moves nothing of its own,
3
+ * where Fluxus draws the veil and moves the panel. Back on Android, Escape in a browser and the scrub of
4
+ * VoiceOver close it. (SPEC §15.8)
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import { type ViewStyle } from 'react-native';
8
+ import { type SharedValue } from 'react-native-reanimated';
9
+ import { type Theme } from './theme.js';
10
+ /** A screen reader goes to it: to the title on opening, back to what opened it on closing. */
11
+ export declare const focusOn: (target: unknown) => void;
12
+ /** The surface of what floats: raised, edged, and with the one shadow of the package. */
13
+ export declare const floating: (theme: Theme) => ViewStyle;
14
+ /** `mounted` outlives `open` by the time it takes to go; `t` goes 0 → 1 as it comes and back as it goes. */
15
+ export declare function useOverlay(open: boolean): {
16
+ mounted: boolean;
17
+ t: SharedValue<number>;
18
+ };
19
+ export interface OverlayProps {
20
+ open: boolean;
21
+ /** Back on Android, Escape in a browser, the scrub of VoiceOver, and a press outside if `dismissible`. */
22
+ onClose: () => void;
23
+ /** It darkens what is behind. Default: true. */
24
+ veil?: boolean;
25
+ /** A press outside closes it. Default: true. */
26
+ dismissible?: boolean;
27
+ /** Once the window is on the screen. */
28
+ onShow?: () => void;
29
+ /** The panel, given `t`, in a box as big as the screen. */
30
+ children: (t: SharedValue<number>) => ReactNode;
31
+ }
32
+ export declare function Overlay({ open, onClose, veil, dismissible, onShow, children }: OverlayProps): import("react").JSX.Element | null;
33
+ //# sourceMappingURL=overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/overlay.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAsF,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAClI,OAAiB,EAAsD,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGzH,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,YAAS,CAAC;AAG/C,8FAA8F;AAC9F,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,KAAG,IAEzC,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,KAAG,SAMtC,CAAC;AAEH,4GAA4G;AAC5G,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAetF;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,0GAA0G;IAC1G,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gDAAgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;CACjD;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAW,EAAE,WAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY,sCAiBzG"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The wait is born from the finger, as on the web (core/src/pending.ts, SPEC §14.35): what was pressed and now
3
+ * waits fills slowly from where it was touched, never to the whole; when the answer comes it fills and goes,
4
+ * and if it failed it drains back to the finger. A wait shorter than 150 ms shows nothing; once seen, it lasts
5
+ * 400 ms at least. (SPEC §15.6, §15.9)
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ import type { GestureResponderEvent, LayoutChangeEvent } from 'react-native';
9
+ /**
10
+ * `onPress` may return a promise: until it settles, what was pressed waits. If it is rejected, it failed: the
11
+ * third value is true until the next press. The rejection goes no further: the app has its own `catch`. `onEnd`
12
+ * hears how it ended, even when it ends before a render shows it waiting.
13
+ */
14
+ export declare function useAsyncPress<E>(onPress: ((event: E) => unknown) | null | undefined, onEnd?: (failed: boolean) => void): [waiting: boolean, run: (event: E) => void, failed: boolean];
15
+ /** `done` runs once `result` is fulfilled if it is a promise, and at once if it is not. If it fails, it does not run. */
16
+ export declare function settle(result: unknown, done: () => void): void | Promise<void>;
17
+ /**
18
+ * For what is pressed and may wait. Give it `onPressIn` and `onLayout`, put `fill` first inside it, and clip it
19
+ * (`overflow: 'hidden'`). `ink` is the colour of its text; `failed`, whether the wait that ends now did.
20
+ */
21
+ export declare function usePending(waiting: boolean, ink: string, failed?: boolean): {
22
+ onPressIn: (e: GestureResponderEvent) => void;
23
+ onLayout: (e: LayoutChangeEvent) => void;
24
+ fill: ReactNode;
25
+ };
26
+ //# sourceMappingURL=pending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../src/pending.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAW7E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAqBrL;AAED,yHAAyH;AACzH,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9E;AA+BD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG;IAAE,SAAS,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAgDtL"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Nothing jumps: what comes fades in as it rises, what goes fades out, and what
3
+ * stays glides to its new place. The values of the web (core/src/stagger.ts),
4
+ * on the layout animations of Reanimated. With reduced motion on in the system
5
+ * they are immediate. (SPEC §15.4)
6
+ */
7
+ import type { ComponentRef, Ref } from 'react';
8
+ import { type ViewProps } from 'react-native';
9
+ import Animated, { FadeInDown, FadeOut, LinearTransition } from 'react-native-reanimated';
10
+ /** How far it rises as it comes, and how long the nth of a group waits for the one before. */
11
+ export declare const RISE = 12;
12
+ export declare const STAGGER = 70;
13
+ /** For `entering`: it fades in as it rises; `index` is its place in a group that comes together. */
14
+ export declare const enter: (index?: number) => FadeInDown;
15
+ /** For `exiting`: it fades out, fast. */
16
+ export declare const exit: () => FadeOut;
17
+ /** For `layout`: it glides to where it is now, on the smooth spring. */
18
+ export declare const shift: () => LinearTransition;
19
+ interface Presence {
20
+ entering: ReturnType<typeof enter>;
21
+ exiting: ReturnType<typeof exit>;
22
+ layout: ReturnType<typeof shift>;
23
+ }
24
+ /**
25
+ * The three, for a view that comes, goes and moves. In a browser they are off: there Reanimated pins a view
26
+ * that has them where it first was (`position: absolute`, seen with 4.7.1), and the layout breaks.
27
+ */
28
+ export declare const presence: (index?: number) => Partial<Presence>;
29
+ export interface AppearProps extends ViewProps {
30
+ /** Its place in a group that comes together: each waits a little for the one before. */
31
+ index?: number;
32
+ ref?: Ref<ComponentRef<typeof Animated.View>>;
33
+ }
34
+ /** A view that comes, goes and moves without a jump. Its siblings glide too when each is an Appear. */
35
+ export declare function Appear({ index, ...rest }: AppearProps): import("react").JSX.Element;
36
+ export {};
37
+ //# sourceMappingURL=presence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../../src/presence.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,QAAQ,EAAE,EAAU,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAQhH,8FAA8F;AAC9F,eAAO,MAAM,IAAI,KAAK,CAAC;AACvB,eAAO,MAAM,OAAO,KAAK,CAAC;AAE1B,oGAAoG;AACpG,eAAO,MAAM,KAAK,GAAI,cAAS,eAKO,CAAC;AAEvC,yCAAyC;AACzC,eAAO,MAAM,IAAI,eAAiH,CAAC;AAEnI,wEAAwE;AACxE,eAAO,MAAM,KAAK,wBAIjB,CAAC;AAEF,UAAU,QAAQ;IAChB,QAAQ,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;IACnC,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;IACjC,MAAM,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;CAClC;AAGD;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,cAAS,KAAG,OAAO,CAAC,QAAQ,CAOpD,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;CAC/C;AAED,uGAAuG;AACvG,wBAAgB,MAAM,CAAC,EAAE,KAAS,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAEzD"}
@@ -0,0 +1,12 @@
1
+ import type { GestureResponderEvent, PressableProps } from 'react-native';
2
+ /** The style and the two handlers of something that gives when pressed; the handlers of the app still run. */
3
+ export declare function usePress({ onPressIn, onPressOut }: Pick<PressableProps, 'onPressIn' | 'onPressOut'>): {
4
+ style: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
5
+ transform: {
6
+ scale: number;
7
+ }[];
8
+ }>;
9
+ onPressIn: (e: GestureResponderEvent) => void;
10
+ onPressOut: (e: GestureResponderEvent) => void;
11
+ };
12
+ //# sourceMappingURL=press.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"press.d.ts","sourceRoot":"","sources":["../../src/press.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAO1E,8GAA8G;AAC9G,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,YAAY,CAAC;;;;;;mBAKjF,qBAAqB;oBAIpB,qBAAqB;EAKxC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `@fluxus-ui/native/screen`: the ground of a screen, inside the safe area. Its own entry, so that an app that
3
+ * lays out its screens some other way does not need react-native-safe-area-context. (SPEC §15.5)
4
+ */
5
+ import type { ComponentRef, Ref } from 'react';
6
+ import { ScrollView, type ScrollViewProps, type ViewProps } from 'react-native';
7
+ import { type Edge } from 'react-native-safe-area-context';
8
+ export interface ScreenProps extends ViewProps {
9
+ /** It scrolls, and the keyboard does not cover the field in use. */
10
+ scroll?: boolean;
11
+ /** Which sides keep clear of the notch and the bars. Default: all. With a header or a tab bar, leave theirs out. */
12
+ edges?: readonly Edge[];
13
+ /** The gutter of the theme around what it holds, and its gap between. Default: true. */
14
+ padded?: boolean;
15
+ /** With `scroll`: its ScrollView, to take it somewhere (`scrollToEnd` in a chat). */
16
+ scrollRef?: Ref<ComponentRef<typeof ScrollView>>;
17
+ /** With `scroll`: what else its ScrollView takes (`onScroll`, `testID`…). Its padding stays the one of the theme. */
18
+ scrollProps?: Omit<ScrollViewProps, 'children'>;
19
+ }
20
+ export declare function Screen({ scroll, edges, padded, scrollRef, scrollProps, style, children, ...rest }: ScreenProps): import("react").JSX.Element;
21
+ //# sourceMappingURL=screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/screen.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAQ,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAGzE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oHAAoH;IACpH,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACxB,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qFAAqF;IACrF,SAAS,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;IACjD,qHAAqH;IACrH,WAAW,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;CACjD;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAc,EAAE,KAAK,EAAE,MAAa,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAc7H"}
@@ -0,0 +1,13 @@
1
+ export interface SuccessProps {
2
+ /** What went well, for a screen reader. */
3
+ label: string;
4
+ /** Points. Default: 64. */
5
+ size?: number;
6
+ /** Default: the solid colour of success. */
7
+ color?: string;
8
+ /** When the tick is there: after `slow`. */
9
+ onShown?: () => void;
10
+ testID?: string;
11
+ }
12
+ export declare function Success({ label, size, color, onShown, testID }: SuccessProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=success.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../src/success.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,IAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,+BAoBjF"}
@@ -0,0 +1,32 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ThemeTokens } from './generated/tokens.js';
3
+ export type Mode = 'light' | 'dark';
4
+ /**
5
+ * The faces the app loaded (with expo-font, or linked), by weight. With a face for a weight, text takes
6
+ * that family and no `fontWeight`: Android would thicken it again. Without, the regular one and the weight.
7
+ */
8
+ export interface Fonts {
9
+ regular: string;
10
+ medium?: string;
11
+ bold?: string;
12
+ }
13
+ /** A theme in one mode: what a component reads. `Theme<typeof theme>` has the tokens of the app too, by name. */
14
+ export type Theme<T extends ThemeTokens = ThemeTokens> = Omit<T, 'color'> & {
15
+ mode: Mode;
16
+ color: T['color']['light'];
17
+ /** Without it, the font of the system. */
18
+ font?: Fonts;
19
+ };
20
+ export interface ThemeProviderProps {
21
+ /** Default: the base theme. */
22
+ theme?: ThemeTokens;
23
+ /** Default: what the system says. */
24
+ mode?: Mode;
25
+ /** Default: the font of the system. */
26
+ fonts?: Fonts;
27
+ children?: ReactNode;
28
+ }
29
+ export declare function ThemeProvider({ theme, mode, fonts, children }: ThemeProviderProps): import("react").JSX.Element;
30
+ /** The theme, in the mode it is in. `useTheme<typeof theme>()` gives the app its own tokens (`app.…`), checked by name. */
31
+ export declare function useTheme<T extends ThemeTokens = ThemeTokens>(): Theme<T>;
32
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,uBAAoB,CAAC;AAE9D,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iHAAiH;AACjH,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAC1E,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3B,0CAA0C;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAIF,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,uCAAuC;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAmB,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAK/F;AAED,2HAA2H;AAC3H,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAIxE"}
package/package.json CHANGED
@@ -1,6 +1,126 @@
1
1
  {
2
2
  "name": "@fluxus-ui/native",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.3.0",
4
+ "description": "Fluxus for React Native: the same tokens and motion vocabulary, on Reanimated.",
5
+ "license": "MIT",
6
+ "author": "Jhony0709 (https://github.com/Jhony0709)",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Jhony0709/fluxus.git",
10
+ "directory": "packages/native"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "sideEffects": false,
16
+ "main": "./lib/module/index.js",
17
+ "types": "./lib/typescript/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./lib/typescript/index.d.ts",
21
+ "default": "./lib/module/index.js"
22
+ },
23
+ "./icon": {
24
+ "types": "./lib/typescript/icon.d.ts",
25
+ "default": "./lib/module/icon.js"
26
+ },
27
+ "./screen": {
28
+ "types": "./lib/typescript/screen.d.ts",
29
+ "default": "./lib/module/screen.js"
30
+ },
31
+ "./blur": {
32
+ "types": "./lib/typescript/blur.d.ts",
33
+ "default": "./lib/module/blur.js"
34
+ },
35
+ "./audio": {
36
+ "types": "./lib/typescript/audio.d.ts",
37
+ "default": "./lib/module/audio.js"
38
+ },
39
+ "./haptics": {
40
+ "types": "./lib/typescript/haptics.d.ts",
41
+ "default": "./lib/module/haptics.js"
42
+ },
43
+ "./package.json": "./package.json"
44
+ },
45
+ "files": [
46
+ "lib",
47
+ "src"
48
+ ],
49
+ "peerDependencies": {
50
+ "expo-blur": ">=58",
51
+ "react": ">=19",
52
+ "react-native": ">=0.86",
53
+ "react-native-reanimated": ">=4.5",
54
+ "react-native-safe-area-context": ">=5",
55
+ "react-native-svg": ">=15",
56
+ "react-native-worklets": ">=0.10",
57
+ "expo-audio": ">=58",
58
+ "@fluxus-ui/icons": ">=0.3.0",
59
+ "expo-haptics": ">=58"
60
+ },
61
+ "devDependencies": {
62
+ "@babel/core": "^7.29.13",
63
+ "@react-native/babel-preset": "0.88.1",
64
+ "@react-native/jest-preset": "0.88.1",
65
+ "@testing-library/react-native": "14.1.0",
66
+ "@types/jest": "^29.5.14",
67
+ "@types/react": "^19.3.3",
68
+ "expo-audio": "~58.0.12",
69
+ "expo-blur": "~58.0.6",
70
+ "expo-haptics": "~58.0.8",
71
+ "jest": "^29.7.0",
72
+ "react": "19.3.0",
73
+ "react-native": "0.88.1",
74
+ "react-native-builder-bob": "^0.44.1",
75
+ "react-native-reanimated": "4.8.0",
76
+ "react-native-safe-area-context": "~5.11.1",
77
+ "react-native-svg": "15.16.0",
78
+ "react-native-worklets": "0.14.0",
79
+ "test-renderer": "^1.3.1",
80
+ "typescript": "^5.9.3",
81
+ "@fluxus-ui/icons": "^0.3.0"
82
+ },
83
+ "peerDependenciesMeta": {
84
+ "react-native-safe-area-context": {
85
+ "optional": true
86
+ },
87
+ "react-native-svg": {
88
+ "optional": true
89
+ },
90
+ "expo-blur": {
91
+ "optional": true
92
+ },
93
+ "expo-audio": {
94
+ "optional": true
95
+ },
96
+ "@fluxus-ui/icons": {
97
+ "optional": true
98
+ },
99
+ "expo-haptics": {
100
+ "optional": true
101
+ }
102
+ },
103
+ "react-native-builder-bob": {
104
+ "source": "src",
105
+ "output": "lib",
106
+ "targets": [
107
+ [
108
+ "module",
109
+ {
110
+ "esm": true
111
+ }
112
+ ],
113
+ [
114
+ "typescript",
115
+ {
116
+ "project": "tsconfig.build.json"
117
+ }
118
+ ]
119
+ ]
120
+ },
121
+ "scripts": {
122
+ "build": "bob build",
123
+ "typecheck": "tsc --noEmit",
124
+ "test": "jest"
125
+ }
6
126
  }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * What plays a sound: a round button, how far it is and the time. It plays nothing by itself: the app, or
3
+ * `@fluxus-ui/native/audio`, tells it where the sound is. The triangle and the bars are drawn with edges,
4
+ * and give way to each other without moving anything else. (SPEC §15.10)
5
+ */
6
+ import { useEffect } from 'react';
7
+ import { ActivityIndicator, Pressable, View, type StyleProp, type ViewProps, type ViewStyle } from 'react-native';
8
+ import Animated, { useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
9
+ import { fill } from './layout';
10
+ import { spring } from './motion';
11
+ import { usePress } from './press';
12
+ import { Progress } from './Progress';
13
+ import { Slider } from './Slider';
14
+ import { Text } from './Text';
15
+ import { useTheme } from './theme';
16
+
17
+ export interface AudioPlayerProps extends Omit<ViewProps, 'children' | 'style'> {
18
+ playing: boolean;
19
+ /** Where it is, in seconds. */
20
+ position: number;
21
+ /** How long it is, in seconds; 0 while it is not known. */
22
+ duration: number;
23
+ onToggle: () => void;
24
+ /** With it, the bar is dragged to go to a second; without, it only shows how far it is. */
25
+ onSeek?: (seconds: number) => void;
26
+ /** The names of the button, and of the bar. Default of the bar: 'Position'. */
27
+ labels: { play: string; pause: string; position?: string };
28
+ /** It was asked to play and the sound is not here yet: the button waits, and still takes the press that calls it off. */
29
+ loading?: boolean;
30
+ /** Nothing to play yet. */
31
+ disabled?: boolean;
32
+ style?: StyleProp<ViewStyle>;
33
+ }
34
+
35
+ /** Seconds as `1:04`. */
36
+ export const clock = (seconds: number): string => {
37
+ const whole = Math.max(0, Math.floor(seconds));
38
+ return `${Math.floor(whole / 60)}:${String(whole % 60).padStart(2, '0')}`;
39
+ };
40
+
41
+ /** What the bar asks for where its row is as wide as what it holds (a bubble); it gives it up where there is no room. */
42
+ const BAR = 160;
43
+
44
+ const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
45
+
46
+ export function AudioPlayer({ playing, position, duration, onToggle, onSeek, labels, loading = false, disabled = false, style, ...rest }: AudioPlayerProps) {
47
+ const theme = useTheme();
48
+ const press = usePress({});
49
+ const on = useSharedValue(playing ? 1 : 0);
50
+ useEffect(() => {
51
+ on.value = spring(playing ? 1 : 0, 'snappy');
52
+ }, [playing, on]);
53
+ const wait = useSharedValue(loading ? 1 : 0);
54
+ useEffect(() => {
55
+ wait.value = spring(loading ? 1 : 0, 'snappy');
56
+ }, [loading, wait]);
57
+ // While it waits, neither mark is seen: the spinner is where they were.
58
+ const play = useAnimatedStyle(() => ({ opacity: (1 - on.value) * (1 - wait.value), transform: [{ scale: 1 - 0.4 * on.value }] }));
59
+ const pause = useAnimatedStyle(() => ({ opacity: on.value * (1 - wait.value), transform: [{ scale: 0.6 + 0.4 * on.value }] }));
60
+ const waiting = useAnimatedStyle(() => ({ opacity: wait.value }));
61
+ const side = theme.size['target.min'];
62
+ const ink = theme.color['button.fg'];
63
+ const unit = theme.size['space.1'];
64
+ const name = labels.position ?? 'Position';
65
+ const told = `${clock(position)} / ${clock(duration)}`;
66
+ const at = Math.min(position, duration);
67
+ return (
68
+ <View {...rest} style={[{ flexDirection: 'row', alignItems: 'center', gap: theme.size['space.3'], opacity: disabled ? 0.5 : 1 }, style]}>
69
+ <AnimatedPressable
70
+ role="button"
71
+ aria-label={playing ? labels.pause : labels.play}
72
+ aria-disabled={disabled}
73
+ aria-busy={loading}
74
+ disabled={disabled}
75
+ onPress={onToggle}
76
+ onPressIn={press.onPressIn}
77
+ onPressOut={press.onPressOut}
78
+ style={[{ width: side, height: side, borderRadius: side / 2, alignItems: 'center', justifyContent: 'center', backgroundColor: theme.color['button.bg'] }, press.style]}
79
+ >
80
+ {/* The triangle: three edges of a box with no size. It leans a little to the right, where its weight is. */}
81
+ <Animated.View style={[{ position: 'absolute', marginLeft: unit / 2, width: 0, height: 0, borderTopWidth: unit * 1.75, borderBottomWidth: unit * 1.75, borderLeftWidth: unit * 2.75, borderTopColor: 'transparent', borderBottomColor: 'transparent', borderLeftColor: ink }, play]} />
82
+ <Animated.View style={[{ position: 'absolute', flexDirection: 'row', gap: unit }, pause]}>
83
+ <View style={{ width: unit, height: unit * 3.5, borderRadius: 1, backgroundColor: ink }} />
84
+ <View style={{ width: unit, height: unit * 3.5, borderRadius: 1, backgroundColor: ink }} />
85
+ </Animated.View>
86
+ {/* The spinner of the system, only while it waits: a thread has many players. */}
87
+ {loading && (
88
+ <Animated.View aria-hidden importantForAccessibility="no-hide-descendants" style={[{ position: 'absolute' }, waiting]}>
89
+ <ActivityIndicator size="small" color={ink} />
90
+ </Animated.View>
91
+ )}
92
+ </AnimatedPressable>
93
+ <View style={[fill, { width: BAR, minWidth: theme.size['space.16'] }]}>
94
+ {onSeek && duration > 0 ? (
95
+ <Slider label={name} min={0} max={Math.max(1, Math.floor(duration))} step={1} value={Math.floor(at)} onChange={onSeek} valueText={() => told} disabled={disabled} />
96
+ ) : (
97
+ <Progress label={name} value={at} max={duration || 1} />
98
+ )}
99
+ </View>
100
+ {/* Figures of one width, and room for the longest: the time does not push the bar as it runs. */}
101
+ <Text variant="caption" tone="muted" aria-hidden={!!onSeek && duration > 0} style={{ fontVariant: ['tabular-nums'], minWidth: theme.size['space.16'], textAlign: 'right' }}>
102
+ {told}
103
+ </Text>
104
+ </View>
105
+ );
106
+ }
package/src/Avatar.tsx ADDED
@@ -0,0 +1,44 @@
1
+ import { Image, View, type StyleProp, type ViewProps, type ViewStyle } from 'react-native';
2
+ import { Text } from './Text';
3
+ import { useTheme } from './theme';
4
+
5
+ export interface AvatarProps extends Omit<ViewProps, 'style' | 'children'> {
6
+ /** Gives the initials. */
7
+ name: string;
8
+ /** A picture over the initials. */
9
+ src?: string;
10
+ /** Who it is, for a screen reader. Without it the avatar is decoration: the name is usually beside it. */
11
+ label?: string;
12
+ /** Default: 'md'. */
13
+ size?: 'sm' | 'md' | 'lg';
14
+ style?: StyleProp<ViewStyle>;
15
+ }
16
+
17
+ /** As the web: the first letter of the first two words that start with a letter or a figure. */
18
+ export const initials = (name: string): string =>
19
+ name
20
+ .trim()
21
+ .split(/\s+/)
22
+ .filter((w) => /^[\p{L}\p{N}]/u.test(w))
23
+ .slice(0, 2)
24
+ .map((w) => Array.from(w)[0] ?? '')
25
+ .join('')
26
+ .toUpperCase();
27
+
28
+ /** Who someone is, in a circle: the picture, or the initials. */
29
+ export function Avatar({ name, src, label, size = 'md', style, ...rest }: AvatarProps) {
30
+ const theme = useTheme();
31
+ const side = theme.size[`control.h.${size}`];
32
+ const a11y = label ? ({ accessible: true, role: 'img', 'aria-label': label } as const) : ({ 'aria-hidden': true, importantForAccessibility: 'no-hide-descendants' } as const);
33
+ return (
34
+ <View {...a11y} {...rest} style={[{ width: side, height: side, borderRadius: side, alignItems: 'center', justifyContent: 'center', overflow: 'hidden', backgroundColor: theme.color['accent.subtle'] }, style]}>
35
+ {src ? (
36
+ <Image source={{ uri: src }} style={{ width: side, height: side }} />
37
+ ) : (
38
+ <Text variant={size === 'sm' ? 'caption' : 'label'} weight="medium" tone="accent" allowFontScaling={false}>
39
+ {initials(name)}
40
+ </Text>
41
+ )}
42
+ </View>
43
+ );
44
+ }