panelui-native 0.25.0 → 0.30.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 (242) hide show
  1. package/README.md +18 -1
  2. package/lib/module/components/accordion/index.js +8 -8
  3. package/lib/module/components/accordion/index.js.map +1 -1
  4. package/lib/module/components/alert/index.js +2 -2
  5. package/lib/module/components/alert/index.js.map +1 -1
  6. package/lib/module/components/area-chart/index.js +182 -50
  7. package/lib/module/components/area-chart/index.js.map +1 -1
  8. package/lib/module/components/attachment/index.js +2 -1
  9. package/lib/module/components/attachment/index.js.map +1 -1
  10. package/lib/module/components/avatar/index.js +3 -3
  11. package/lib/module/components/avatar/index.js.map +1 -1
  12. package/lib/module/components/badge/index.js +4 -4
  13. package/lib/module/components/badge/index.js.map +1 -1
  14. package/lib/module/components/bar-chart/index.js +197 -56
  15. package/lib/module/components/bar-chart/index.js.map +1 -1
  16. package/lib/module/components/bottom-sheet/index.js +15 -10
  17. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  18. package/lib/module/components/breadcrumb/index.js +6 -6
  19. package/lib/module/components/breadcrumb/index.js.map +1 -1
  20. package/lib/module/components/button/index.js +11 -6
  21. package/lib/module/components/button/index.js.map +1 -1
  22. package/lib/module/components/calendar/index.js +792 -0
  23. package/lib/module/components/calendar/index.js.map +1 -0
  24. package/lib/module/components/carousel/index.js +680 -0
  25. package/lib/module/components/carousel/index.js.map +1 -0
  26. package/lib/module/components/chip/index.js +4 -4
  27. package/lib/module/components/chip/index.js.map +1 -1
  28. package/lib/module/components/code-block/highlight.js +363 -0
  29. package/lib/module/components/code-block/highlight.js.map +1 -0
  30. package/lib/module/components/code-block/index.js +313 -0
  31. package/lib/module/components/code-block/index.js.map +1 -0
  32. package/lib/module/components/date-picker/index.js +165 -0
  33. package/lib/module/components/date-picker/index.js.map +1 -0
  34. package/lib/module/components/dialog/index.js +7 -2
  35. package/lib/module/components/dialog/index.js.map +1 -1
  36. package/lib/module/components/direction/index.js +2 -1
  37. package/lib/module/components/direction/index.js.map +1 -1
  38. package/lib/module/components/empty-state/index.js +2 -2
  39. package/lib/module/components/empty-state/index.js.map +1 -1
  40. package/lib/module/components/field/index.js +5 -5
  41. package/lib/module/components/field/index.js.map +1 -1
  42. package/lib/module/components/flow/index.js +3 -3
  43. package/lib/module/components/flow/index.js.map +1 -1
  44. package/lib/module/components/frame/index.js +5 -5
  45. package/lib/module/components/frame/index.js.map +1 -1
  46. package/lib/module/components/input-group/index.js +3 -2
  47. package/lib/module/components/input-group/index.js.map +1 -1
  48. package/lib/module/components/item/index.js +9 -9
  49. package/lib/module/components/item/index.js.map +1 -1
  50. package/lib/module/components/label/index.js +4 -4
  51. package/lib/module/components/label/index.js.map +1 -1
  52. package/lib/module/components/line-chart/index.js +167 -44
  53. package/lib/module/components/line-chart/index.js.map +1 -1
  54. package/lib/module/components/map/index.js +7 -7
  55. package/lib/module/components/map/index.js.map +1 -1
  56. package/lib/module/components/marker/index.js +3 -3
  57. package/lib/module/components/marker/index.js.map +1 -1
  58. package/lib/module/components/menu/index.js +714 -0
  59. package/lib/module/components/menu/index.js.map +1 -0
  60. package/lib/module/components/message/index.js +7 -7
  61. package/lib/module/components/message/index.js.map +1 -1
  62. package/lib/module/components/message-scroller/index.js +5 -4
  63. package/lib/module/components/message-scroller/index.js.map +1 -1
  64. package/lib/module/components/plan/index.js +296 -0
  65. package/lib/module/components/plan/index.js.map +1 -0
  66. package/lib/module/components/popover/index.js +73 -10
  67. package/lib/module/components/popover/index.js.map +1 -1
  68. package/lib/module/components/radio-group/index.js +15 -10
  69. package/lib/module/components/radio-group/index.js.map +1 -1
  70. package/lib/module/components/reasoning/index.js +244 -0
  71. package/lib/module/components/reasoning/index.js.map +1 -0
  72. package/lib/module/components/section-rail/index.js +4 -4
  73. package/lib/module/components/section-rail/index.js.map +1 -1
  74. package/lib/module/components/select/index.js +10 -4
  75. package/lib/module/components/select/index.js.map +1 -1
  76. package/lib/module/components/sources/index.js +221 -0
  77. package/lib/module/components/sources/index.js.map +1 -0
  78. package/lib/module/components/steps/index.js +4 -4
  79. package/lib/module/components/steps/index.js.map +1 -1
  80. package/lib/module/components/tabs/index.js +7 -7
  81. package/lib/module/components/tabs/index.js.map +1 -1
  82. package/lib/module/components/task/index.js +300 -0
  83. package/lib/module/components/task/index.js.map +1 -0
  84. package/lib/module/components/textarea/index.js +295 -0
  85. package/lib/module/components/textarea/index.js.map +1 -0
  86. package/lib/module/components/timeline/index.js +4 -4
  87. package/lib/module/components/timeline/index.js.map +1 -1
  88. package/lib/module/components/toast/index.js +2 -2
  89. package/lib/module/components/toast/index.js.map +1 -1
  90. package/lib/module/components/toggle-button/index.js +5 -5
  91. package/lib/module/components/toggle-button/index.js.map +1 -1
  92. package/lib/module/components/tooltip/index.js +648 -0
  93. package/lib/module/components/tooltip/index.js.map +1 -0
  94. package/lib/module/components/typography/index.js +2 -2
  95. package/lib/module/components/typography/index.js.map +1 -1
  96. package/lib/module/hooks/index.js +1 -0
  97. package/lib/module/hooks/index.js.map +1 -1
  98. package/lib/module/hooks/use-back-handler.js +37 -0
  99. package/lib/module/hooks/use-back-handler.js.map +1 -0
  100. package/lib/module/icons/index.js +202 -0
  101. package/lib/module/icons/index.js.map +1 -1
  102. package/lib/module/index.js +13 -1
  103. package/lib/module/index.js.map +1 -1
  104. package/lib/module/primitives/collapse.js +112 -0
  105. package/lib/module/primitives/collapse.js.map +1 -0
  106. package/lib/module/primitives/keyboard-avoider.js +2 -1
  107. package/lib/module/primitives/keyboard-avoider.js.map +1 -1
  108. package/lib/module/primitives/text.js +25 -1
  109. package/lib/module/primitives/text.js.map +1 -1
  110. package/lib/module/utils/date.js +386 -0
  111. package/lib/module/utils/date.js.map +1 -0
  112. package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
  113. package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
  114. package/lib/typescript/src/components/area-chart/index.d.ts +41 -1
  115. package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
  116. package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
  117. package/lib/typescript/src/components/bar-chart/index.d.ts +44 -2
  118. package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
  119. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  120. package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
  121. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  122. package/lib/typescript/src/components/calendar/index.d.ts +173 -0
  123. package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
  124. package/lib/typescript/src/components/carousel/index.d.ts +179 -0
  125. package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
  126. package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
  127. package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
  128. package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
  129. package/lib/typescript/src/components/code-block/index.d.ts +113 -0
  130. package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
  131. package/lib/typescript/src/components/date-picker/index.d.ts +97 -0
  132. package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
  133. package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
  134. package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
  135. package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
  136. package/lib/typescript/src/components/field/index.d.ts.map +1 -1
  137. package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
  138. package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
  139. package/lib/typescript/src/components/item/index.d.ts.map +1 -1
  140. package/lib/typescript/src/components/label/index.d.ts.map +1 -1
  141. package/lib/typescript/src/components/line-chart/index.d.ts +41 -2
  142. package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
  143. package/lib/typescript/src/components/map/index.d.ts.map +1 -1
  144. package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
  145. package/lib/typescript/src/components/menu/index.d.ts +261 -0
  146. package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
  147. package/lib/typescript/src/components/message/index.d.ts.map +1 -1
  148. package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
  149. package/lib/typescript/src/components/plan/index.d.ts +127 -0
  150. package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
  151. package/lib/typescript/src/components/popover/index.d.ts +35 -1
  152. package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
  153. package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
  154. package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
  155. package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
  156. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  157. package/lib/typescript/src/components/sources/index.d.ts +85 -0
  158. package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
  159. package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
  160. package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
  161. package/lib/typescript/src/components/task/index.d.ts +103 -0
  162. package/lib/typescript/src/components/task/index.d.ts.map +1 -0
  163. package/lib/typescript/src/components/textarea/index.d.ts +175 -0
  164. package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
  165. package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
  166. package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
  167. package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
  168. package/lib/typescript/src/components/tooltip/index.d.ts +180 -0
  169. package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
  170. package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
  171. package/lib/typescript/src/hooks/index.d.ts +1 -0
  172. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  173. package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
  174. package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
  175. package/lib/typescript/src/icons/index.d.ts +17 -0
  176. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  177. package/lib/typescript/src/index.d.ts +16 -4
  178. package/lib/typescript/src/index.d.ts.map +1 -1
  179. package/lib/typescript/src/primitives/collapse.d.ts +42 -0
  180. package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
  181. package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
  182. package/lib/typescript/src/primitives/text.d.ts +20 -0
  183. package/lib/typescript/src/primitives/text.d.ts.map +1 -1
  184. package/lib/typescript/src/utils/date.d.ts +116 -0
  185. package/lib/typescript/src/utils/date.d.ts.map +1 -0
  186. package/package.json +1 -1
  187. package/src/components/accordion/index.tsx +8 -12
  188. package/src/components/alert/index.tsx +2 -2
  189. package/src/components/area-chart/index.tsx +208 -55
  190. package/src/components/attachment/index.tsx +2 -2
  191. package/src/components/avatar/index.tsx +3 -3
  192. package/src/components/badge/index.tsx +6 -6
  193. package/src/components/bar-chart/index.tsx +214 -54
  194. package/src/components/bottom-sheet/index.tsx +17 -16
  195. package/src/components/breadcrumb/index.tsx +6 -8
  196. package/src/components/button/index.tsx +12 -8
  197. package/src/components/calendar/index.tsx +970 -0
  198. package/src/components/carousel/index.tsx +788 -0
  199. package/src/components/chip/index.tsx +4 -6
  200. package/src/components/code-block/highlight.ts +278 -0
  201. package/src/components/code-block/index.tsx +341 -0
  202. package/src/components/date-picker/index.tsx +255 -0
  203. package/src/components/dialog/index.tsx +7 -2
  204. package/src/components/direction/index.tsx +2 -1
  205. package/src/components/empty-state/index.tsx +2 -2
  206. package/src/components/field/index.tsx +3 -5
  207. package/src/components/flow/index.tsx +3 -3
  208. package/src/components/frame/index.tsx +5 -7
  209. package/src/components/input-group/index.tsx +3 -2
  210. package/src/components/item/index.tsx +9 -9
  211. package/src/components/label/index.tsx +2 -2
  212. package/src/components/line-chart/index.tsx +189 -50
  213. package/src/components/map/index.tsx +7 -9
  214. package/src/components/marker/index.tsx +3 -3
  215. package/src/components/menu/index.tsx +812 -0
  216. package/src/components/message/index.tsx +7 -7
  217. package/src/components/message-scroller/index.tsx +5 -4
  218. package/src/components/plan/index.tsx +325 -0
  219. package/src/components/popover/index.tsx +111 -8
  220. package/src/components/radio-group/index.tsx +13 -4
  221. package/src/components/reasoning/index.tsx +297 -0
  222. package/src/components/section-rail/index.tsx +4 -4
  223. package/src/components/select/index.tsx +10 -4
  224. package/src/components/sources/index.tsx +278 -0
  225. package/src/components/steps/index.tsx +4 -4
  226. package/src/components/tabs/index.tsx +7 -9
  227. package/src/components/task/index.tsx +329 -0
  228. package/src/components/textarea/index.tsx +381 -0
  229. package/src/components/timeline/index.tsx +4 -4
  230. package/src/components/toast/index.tsx +2 -2
  231. package/src/components/toggle-button/index.tsx +5 -7
  232. package/src/components/tooltip/index.tsx +793 -0
  233. package/src/components/typography/index.tsx +2 -2
  234. package/src/hooks/index.ts +1 -0
  235. package/src/hooks/use-back-handler.ts +37 -0
  236. package/src/icons/index.tsx +147 -0
  237. package/src/index.ts +116 -0
  238. package/src/primitives/collapse.tsx +128 -0
  239. package/src/primitives/keyboard-avoider.tsx +2 -1
  240. package/src/primitives/text.tsx +28 -1
  241. package/src/utils/date.ts +446 -0
  242. package/theme.css +112 -0
@@ -0,0 +1,648 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Tooltip — a small label that names the thing under your finger.
5
+ *
6
+ * A popover is a panel you open and deal with; a tooltip is a whisper. It
7
+ * carries a word or two about what a control does, appears without taking the
8
+ * screen, and goes away on its own. That is why it is inverted by default, why
9
+ * it is not dismissible with a scrim, and why it closes after a beat instead of
10
+ * waiting to be told.
11
+ *
12
+ * The inversion is a default rather than a rule, because the whisper has a
13
+ * larger sibling: a tooltip that carries a heading and a sentence stops reading
14
+ * as a different layer and starts reading as a panel with the wrong colours.
15
+ * `variant="surface"` makes it one, and the sizing props — `width`,
16
+ * `minWidth`, `maxHeight`, `scrollable` — are what let it hold that much.
17
+ *
18
+ * On touch there is no hover to open it, so the gesture is a long press by
19
+ * default — the platform's own "tell me more" gesture — with `openOn="press"`
20
+ * for the cases where a tap should reveal it instead.
21
+ *
22
+ * ```tsx
23
+ * <Tooltip label="Copy link">
24
+ * <Tooltip.Trigger>
25
+ * <IconButton icon={<LinkIcon />} />
26
+ * </Tooltip.Trigger>
27
+ * <Tooltip.Content>
28
+ * <Tooltip.Arrow />
29
+ * Copy link
30
+ * </Tooltip.Content>
31
+ * </Tooltip>
32
+ * ```
33
+ *
34
+ * Placement is a preference, not a promise: the trigger is measured when it is
35
+ * pressed, the label measures itself on its first layout, and the two are
36
+ * reconciled against the safe area — so `placement="top"` means *above, if
37
+ * above fits*, and a trigger near the top edge shows its tooltip below instead.
38
+ */
39
+ import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
40
+ import { Pressable, ScrollView, useWindowDimensions, View } from 'react-native';
41
+ import Animated, { FadeOut, useAnimatedStyle, useReducedMotion, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
42
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
43
+ import { tv } from 'tailwind-variants';
44
+ import { Portal } from "../../primitives/portal.js";
45
+ import { Text } from "../../primitives/text.js";
46
+ import { cn } from "../../utils/cn.js";
47
+
48
+ /** Gap between the trigger and the label. */
49
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
50
+ const DEFAULT_OFFSET = 6;
51
+ /** Smallest gap allowed between the label and the edge of the safe area. */
52
+ const SCREEN_MARGIN = 12;
53
+ /** Side of the arrow square before it is rotated 45°. */
54
+ const ARROW_SIZE = 10;
55
+ /** How long the label stays up before hiding itself, in milliseconds. */
56
+ const DEFAULT_DURATION = 1500;
57
+ /**
58
+ * Every colour the tooltip has, in one place.
59
+ *
60
+ * They were three literals at three call sites — the panel, the arrow and the
61
+ * default text — which meant retheming a tooltip took three `className`
62
+ * overrides that each had to be kept in step with the others. As a variant it
63
+ * is one prop, and the arrow and the text read it off the context rather than
64
+ * being told again.
65
+ */
66
+ const tooltipVariants = tv({
67
+ slots: {
68
+ content: 'rounded-lg px-2.5 py-1.5 shadow-md',
69
+ text: 'text-sm font-medium',
70
+ title: 'text-sm font-semibold',
71
+ description: 'text-sm',
72
+ arrow: 'rounded-[1px]'
73
+ },
74
+ variants: {
75
+ variant: {
76
+ /*
77
+ * The default, and deliberately not a surface colour: a whisper over the
78
+ * page should read as a different layer rather than as another panel of
79
+ * it. It is the treatment a one-line label wants.
80
+ */
81
+ inverted: {
82
+ content: 'bg-foreground',
83
+ text: 'text-background',
84
+ title: 'text-background',
85
+ description: 'text-background/70',
86
+ arrow: 'bg-foreground'
87
+ },
88
+ /*
89
+ * For a tooltip carrying more than a label — a heading, a sentence, a row
90
+ * of controls. At that size the inversion stops reading as a whisper and
91
+ * starts reading as a panel with the wrong colours, so it becomes one.
92
+ */
93
+ surface: {
94
+ content: 'border border-border bg-popover',
95
+ text: 'text-popover-foreground',
96
+ title: 'text-popover-foreground',
97
+ description: 'text-muted-foreground',
98
+ arrow: 'border-border bg-popover'
99
+ }
100
+ }
101
+ },
102
+ defaultVariants: {
103
+ variant: 'inverted'
104
+ }
105
+ });
106
+ const TooltipContext = /*#__PURE__*/createContext(null);
107
+ function useTooltip(component) {
108
+ const context = useContext(TooltipContext);
109
+ if (!context) {
110
+ throw new Error(`${component} must be used within a <Tooltip>`);
111
+ }
112
+ return context;
113
+ }
114
+ function TooltipRoot({
115
+ children,
116
+ open,
117
+ onOpenChange,
118
+ defaultOpen = false,
119
+ openOn = 'longPress',
120
+ duration = DEFAULT_DURATION,
121
+ label
122
+ }) {
123
+ const [internalOpen, setInternalOpen] = useState(defaultOpen);
124
+ const [trigger, setTrigger] = useState(null);
125
+ const [placement, setPlacement] = useState('top');
126
+ const [arrowOffset, setArrowOffset] = useState(0);
127
+ /*
128
+ * Published by Content rather than passed to it, because the arrow and the
129
+ * text sit beside the panel in the tree and would otherwise each have to be
130
+ * told which colours to use.
131
+ */
132
+ const [variant, setVariant] = useState('inverted');
133
+ const isControlled = open !== undefined;
134
+ const resolvedOpen = isControlled ? open : internalOpen;
135
+ const setOpen = useCallback(next => {
136
+ if (!isControlled) setInternalOpen(next);
137
+ onOpenChange?.(next);
138
+ }, [isControlled, onOpenChange]);
139
+ const show = useCallback(() => setOpen(true), [setOpen]);
140
+ const hide = useCallback(() => setOpen(false), [setOpen]);
141
+
142
+ // A tooltip is not a thing you deal with, so it hides itself after a beat.
143
+ // The timer is armed on open and cleared on close, and `duration` of 0 opts
144
+ // out — for a tooltip that stays until the next tap.
145
+ useEffect(() => {
146
+ if (!resolvedOpen || duration <= 0) return;
147
+ const timer = setTimeout(() => setOpen(false), duration);
148
+ return () => clearTimeout(timer);
149
+ }, [resolvedOpen, duration, setOpen]);
150
+ const context = useMemo(() => ({
151
+ open: resolvedOpen,
152
+ show,
153
+ hide,
154
+ trigger,
155
+ setTrigger,
156
+ placement,
157
+ setPlacement,
158
+ arrowOffset,
159
+ setArrowOffset,
160
+ openOn,
161
+ label,
162
+ variant,
163
+ setVariant
164
+ }), [resolvedOpen, show, hide, trigger, placement, arrowOffset, openOn, label, variant]);
165
+ return /*#__PURE__*/_jsx(TooltipContext.Provider, {
166
+ value: context,
167
+ children: children
168
+ });
169
+ }
170
+ /**
171
+ * Wraps its child and reveals the label on it — a long press by default, a
172
+ * press when the root asks for one. It is also what gets measured, so the
173
+ * label knows where to sit.
174
+ *
175
+ * The child is wrapped in a view rather than handed a ref: the ref has to
176
+ * survive whatever the child is — a button, a plain Pressable, an icon — and
177
+ * only a wrapper we own is guaranteed to be measurable.
178
+ *
179
+ * That wrapper shrinks to its child on purpose. A view stretches to its parent
180
+ * by default, and a wrapper that filled the row would be measured as the whole
181
+ * row — putting a centred label over the middle of the screen rather than over
182
+ * the control it names.
183
+ */
184
+ function TooltipTrigger({
185
+ className,
186
+ children
187
+ }) {
188
+ const {
189
+ open,
190
+ show,
191
+ hide,
192
+ setTrigger,
193
+ openOn,
194
+ label
195
+ } = useTooltip('Tooltip.Trigger');
196
+ const ref = useRef(null);
197
+ const measureThenShow = () => {
198
+ // Measured on every open rather than on layout: the trigger may have
199
+ // scrolled since it was laid out, and a stale rect anchors the label to
200
+ // where the trigger used to be.
201
+ ref.current?.measureInWindow((x, y, width, height) => {
202
+ setTrigger({
203
+ x,
204
+ y,
205
+ width,
206
+ height
207
+ });
208
+ show();
209
+ });
210
+ };
211
+ const handleLongPress = (...args) => {
212
+ if (/*#__PURE__*/isValidElement(children)) children.props.onLongPress?.(...args);
213
+ if (openOn === 'longPress') measureThenShow();
214
+ };
215
+ const handlePress = (...args) => {
216
+ if (/*#__PURE__*/isValidElement(children)) children.props.onPress?.(...args);
217
+ if (openOn !== 'press') return;
218
+ if (open) hide();else measureThenShow();
219
+ };
220
+
221
+ // A trigger that is not an element has nothing to clone handlers onto, so it
222
+ // is passed through — wrapped, if it is bare text, since a string cannot be
223
+ // a child of a view.
224
+ if (! /*#__PURE__*/isValidElement(children)) {
225
+ return typeof children === 'string' || typeof children === 'number' ? /*#__PURE__*/_jsx(Text, {
226
+ children: children
227
+ }) : /*#__PURE__*/_jsx(_Fragment, {
228
+ children: children
229
+ });
230
+ }
231
+ return /*#__PURE__*/_jsx(View, {
232
+ ref: ref,
233
+ collapsable: false,
234
+ className: cn('self-start', className),
235
+ children: /*#__PURE__*/cloneElement(children, {
236
+ onPress: handlePress,
237
+ onLongPress: handleLongPress,
238
+ // An icon-only trigger has nothing for a screen reader to read; the
239
+ // label fills that in without the sighted user having to open it.
240
+ accessibilityLabel: children.props.accessibilityLabel ?? label
241
+ })
242
+ });
243
+ }
244
+ function TooltipContent({
245
+ className,
246
+ placement = 'top',
247
+ align = 'center',
248
+ offset = DEFAULT_OFFSET,
249
+ alignOffset = 0,
250
+ variant = 'inverted',
251
+ width = 'content-fit',
252
+ minWidth,
253
+ maxHeight,
254
+ scrollable = false,
255
+ children,
256
+ onLayout: onLayoutProp,
257
+ style,
258
+ ...props
259
+ }) {
260
+ const context = useTooltip('Tooltip.Content');
261
+ const {
262
+ open,
263
+ hide,
264
+ trigger,
265
+ setPlacement,
266
+ setArrowOffset,
267
+ setVariant
268
+ } = context;
269
+ const slots = tooltipVariants({
270
+ variant
271
+ });
272
+
273
+ // The arrow and the text sit beside this panel in the tree, so the chosen
274
+ // colours are published rather than passed down.
275
+ useEffect(() => {
276
+ setVariant(variant);
277
+ }, [variant, setVariant]);
278
+ const {
279
+ width: screenWidth,
280
+ height: screenHeight
281
+ } = useWindowDimensions();
282
+ const insets = useSafeAreaInsets();
283
+ const [size, setSize] = useState(null);
284
+
285
+ // Label size changes with its text, so it is re-measured rather than measured
286
+ // once — a tooltip whose text is swapped should not stay the old size.
287
+ const onLayout = event => {
288
+ const {
289
+ width: w,
290
+ height: h
291
+ } = event.nativeEvent.layout;
292
+ setSize(current => current && Math.abs(current.width - w) < 1 && Math.abs(current.height - h) < 1 ? current : {
293
+ width: w,
294
+ height: h
295
+ });
296
+ onLayoutProp?.(event);
297
+ };
298
+
299
+ /*
300
+ * Forgetting the size on close is what makes the second open behave like the
301
+ * first. Held, it would place the reopened label using the last label's
302
+ * dimensions for a frame — and, because the entrance is driven off whether a
303
+ * position exists at all, a size that never went away means a tooltip that
304
+ * animates in once and afterwards just appears.
305
+ */
306
+ useEffect(() => {
307
+ if (!open) setSize(null);
308
+ }, [open]);
309
+ const bounds = {
310
+ left: insets.left + SCREEN_MARGIN,
311
+ right: screenWidth - insets.right - SCREEN_MARGIN,
312
+ top: insets.top + SCREEN_MARGIN,
313
+ bottom: screenHeight - insets.bottom - SCREEN_MARGIN
314
+ };
315
+ const available = bounds.right - bounds.left;
316
+ const requestedWidth = width === 'content-fit' ? undefined : width === 'trigger' ? trigger?.width : width === 'full' ? available : width;
317
+
318
+ // The floor never wins past the space there actually is — a panel wider than
319
+ // the screen is worse than a cramped one.
320
+ const resolvedWidth = requestedWidth === undefined ? minWidth === undefined ? undefined : Math.min(minWidth, available) : Math.min(Math.max(requestedWidth, minWidth ?? 0), available);
321
+ const room = bounds.bottom - bounds.top;
322
+ const resolvedMaxHeight = Math.min(maxHeight ?? room, room);
323
+ const position = trigger && size ? place({
324
+ trigger,
325
+ size,
326
+ placement,
327
+ align,
328
+ offset,
329
+ alignOffset,
330
+ bounds
331
+ }) : null;
332
+
333
+ // Publish the side actually used and where the trigger centre landed, so the
334
+ // arrow points at the trigger even after a flip or a clamp.
335
+ const resolvedPlacement = position?.placement;
336
+ const resolvedArrow = position?.arrowOffset;
337
+ useEffect(() => {
338
+ if (resolvedPlacement) setPlacement(resolvedPlacement);
339
+ if (resolvedArrow !== undefined) setArrowOffset(resolvedArrow);
340
+ }, [resolvedPlacement, resolvedArrow, setPlacement, setArrowOffset]);
341
+
342
+ /*
343
+ * The entrance is driven by hand rather than by an `entering` preset, and the
344
+ * reason is the measuring frame. A layout animation fires on mount — which
345
+ * here is the frame *before* the label knows where it goes, so the whole
346
+ * animation would play at the origin, invisibly, and the label would then
347
+ * snap into place fully formed. Holding the values until a position exists is
348
+ * the only way to have both the animation and the correct position.
349
+ */
350
+ const appear = useSharedValue(0);
351
+ const settle = useSharedValue(0);
352
+ const reducedMotion = useReducedMotion();
353
+ const placed = !!position;
354
+ useEffect(() => {
355
+ if (!placed) {
356
+ appear.value = 0;
357
+ settle.value = 0;
358
+ return;
359
+ }
360
+ if (reducedMotion) {
361
+ appear.value = 1;
362
+ settle.value = 1;
363
+ return;
364
+ }
365
+ appear.value = withTiming(1, {
366
+ duration: 100
367
+ });
368
+ settle.value = withSpring(1, {
369
+ damping: 20,
370
+ stiffness: 300,
371
+ mass: 0.5
372
+ });
373
+ }, [placed, reducedMotion, appear, settle]);
374
+
375
+ // Starts slightly small and shifted towards the trigger, so the label
376
+ // appears to unfold from it rather than fade in over it.
377
+ const origin = ENTRY_SHIFT[resolvedPlacement ?? placement];
378
+ const labelStyle = useAnimatedStyle(() => ({
379
+ opacity: appear.value,
380
+ transform: [{
381
+ translateX: origin.x * (1 - settle.value)
382
+ }, {
383
+ translateY: origin.y * (1 - settle.value)
384
+ }, {
385
+ scale: 0.9 + 0.1 * settle.value
386
+ }]
387
+ }));
388
+ if (!open || !trigger) return null;
389
+ return /*#__PURE__*/_jsx(Portal, {
390
+ children: /*#__PURE__*/_jsx(TooltipContext.Provider, {
391
+ value: context,
392
+ children: /*#__PURE__*/_jsxs(View, {
393
+ className: "absolute inset-0",
394
+ children: [/*#__PURE__*/_jsx(Pressable, {
395
+ accessibilityLabel: "Dismiss",
396
+ className: "absolute inset-0",
397
+ onPress: hide
398
+ }), /*#__PURE__*/_jsx(Animated.View, {
399
+ exiting: FadeOut.duration(100),
400
+ onLayout: onLayout,
401
+ style: {
402
+ position: 'absolute',
403
+ pointerEvents: 'box-none',
404
+ // Until it has measured itself the label has no honest position,
405
+ // so it is laid out off-screen rather than at the origin.
406
+ top: position?.top ?? -9999,
407
+ left: position?.left ?? -9999,
408
+ maxWidth: available,
409
+ maxHeight: resolvedMaxHeight,
410
+ width: resolvedWidth
411
+ },
412
+ children: /*#__PURE__*/_jsx(Animated.View, {
413
+ // A panel with a heading and a paragraph is a group, not a run of
414
+ // text — the flat role would have a screen reader read it as one
415
+ // string with no structure.
416
+ accessibilityRole: scrollable || width !== 'content-fit' ? undefined : 'text',
417
+ style: [labelStyle, style],
418
+ className: cn(slots.content(), scrollable ? 'overflow-hidden' : undefined, className),
419
+ ...props,
420
+ children: scrollable ? /*#__PURE__*/_jsx(ScrollView, {
421
+ bounces: false,
422
+ showsVerticalScrollIndicator: false,
423
+ children: wrapTooltipText(children)
424
+ }) : wrapTooltipText(children)
425
+ })
426
+ })]
427
+ })
428
+ })
429
+ });
430
+ }
431
+
432
+ /** Bare strings become the label's default text; elements speak for themselves. */
433
+ function wrapTooltipText(children) {
434
+ return Children.map(children, child => typeof child === 'string' || typeof child === 'number' ? /*#__PURE__*/_jsx(TooltipText, {
435
+ children: child
436
+ }) : child);
437
+ }
438
+
439
+ /** The label's default text, coloured to whatever the panel is made of. */
440
+ function TooltipText({
441
+ className,
442
+ ...props
443
+ }) {
444
+ const {
445
+ variant
446
+ } = useTooltip('Tooltip.Text');
447
+ const {
448
+ text
449
+ } = tooltipVariants({
450
+ variant
451
+ });
452
+ return /*#__PURE__*/_jsx(Text, {
453
+ className: cn(text(), className),
454
+ ...props
455
+ });
456
+ }
457
+ TooltipText.displayName = 'Tooltip.Text';
458
+ TooltipTitle.displayName = 'Tooltip.Title';
459
+ TooltipDescription.displayName = 'Tooltip.Description';
460
+ /** A heading, for a tooltip carrying more than a label. */
461
+ function TooltipTitle({
462
+ className,
463
+ ...props
464
+ }) {
465
+ const {
466
+ variant
467
+ } = useTooltip('Tooltip.Title');
468
+ const {
469
+ title
470
+ } = tooltipVariants({
471
+ variant
472
+ });
473
+ return /*#__PURE__*/_jsx(Text, {
474
+ accessibilityRole: "header",
475
+ className: cn(title(), className),
476
+ ...props
477
+ });
478
+ }
479
+ /** The sentence under a `Tooltip.Title`, in the panel's secondary colour. */
480
+ function TooltipDescription({
481
+ className,
482
+ ...props
483
+ }) {
484
+ const {
485
+ variant
486
+ } = useTooltip('Tooltip.Description');
487
+ const {
488
+ description
489
+ } = tooltipVariants({
490
+ variant
491
+ });
492
+ return /*#__PURE__*/_jsx(Text, {
493
+ className: cn(description(), className),
494
+ ...props
495
+ });
496
+ }
497
+ /**
498
+ * A small square rotated into a diamond, half-buried under the label so only
499
+ * the point shows. It shares the label's fill and points at the trigger's
500
+ * centre, which Content resolves and publishes — so when `align` shifts the
501
+ * label off-centre, or a clamp slides it back on screen, the arrow stays over
502
+ * the trigger rather than over the label's middle.
503
+ */
504
+ function TooltipArrow({
505
+ className,
506
+ style,
507
+ ...props
508
+ }) {
509
+ const {
510
+ trigger,
511
+ placement,
512
+ arrowOffset,
513
+ variant
514
+ } = useTooltip('Tooltip.Arrow');
515
+ const {
516
+ arrow
517
+ } = tooltipVariants({
518
+ variant
519
+ });
520
+ if (!trigger) return null;
521
+ const vertical = placement === 'top' || placement === 'bottom';
522
+ // The arrow sits on the edge facing the trigger, the opposite edge to the
523
+ // placement: a label placed above the trigger has its arrow on the bottom.
524
+ const edge = {
525
+ top: 'bottom',
526
+ bottom: 'top',
527
+ left: 'right',
528
+ right: 'left'
529
+ }[placement];
530
+ return /*#__PURE__*/_jsx(View, {
531
+ accessibilityElementsHidden: true,
532
+ importantForAccessibility: "no-hide-descendants",
533
+ style: [{
534
+ position: 'absolute',
535
+ pointerEvents: 'none',
536
+ [edge]: -ARROW_SIZE / 2,
537
+ width: ARROW_SIZE,
538
+ height: ARROW_SIZE,
539
+ transform: [{
540
+ rotate: '45deg'
541
+ }],
542
+ // Centred on the trigger along the cross axis. `marginLeft/Top` backs
543
+ // it off by half its own size so `arrowOffset` lands on its centre.
544
+ ...(vertical ? {
545
+ left: arrowOffset,
546
+ marginLeft: -ARROW_SIZE / 2
547
+ } : {
548
+ top: arrowOffset,
549
+ marginTop: -ARROW_SIZE / 2
550
+ })
551
+ }, style],
552
+ className: cn(arrow(), className),
553
+ ...props
554
+ });
555
+ }
556
+
557
+ /* -------------------------------------------------------------------------- */
558
+ /* Placement */
559
+ /* -------------------------------------------------------------------------- */
560
+
561
+ /**
562
+ * Resolves the label's window position.
563
+ *
564
+ * Two passes, in this order: the flip picks a *side* and only fires when the
565
+ * preferred one genuinely has less room than its opposite; the clamp then
566
+ * slides the label along the other axis to keep it on screen. Doing the clamp
567
+ * first would let a label be nudged inside the bounds and so look like it fits,
568
+ * hiding the fact that the wrong side was chosen.
569
+ */
570
+ function place({
571
+ trigger,
572
+ size,
573
+ placement,
574
+ align,
575
+ offset,
576
+ alignOffset,
577
+ bounds
578
+ }) {
579
+ const roomAfter = {
580
+ bottom: bounds.bottom - (trigger.y + trigger.height + offset),
581
+ top: trigger.y - offset - bounds.top,
582
+ right: bounds.right - (trigger.x + trigger.width + offset),
583
+ left: trigger.x - offset - bounds.left
584
+ };
585
+ const opposite = {
586
+ top: 'bottom',
587
+ bottom: 'top',
588
+ left: 'right',
589
+ right: 'left'
590
+ };
591
+ const needed = placement === 'top' || placement === 'bottom' ? size.height : size.width;
592
+ const resolved = roomAfter[placement] < needed && roomAfter[opposite[placement]] > roomAfter[placement] ? opposite[placement] : placement;
593
+ const clamp = (value, min, max) => Math.max(min, Math.min(value, Math.max(min, max)));
594
+ if (resolved === 'top' || resolved === 'bottom') {
595
+ const top = resolved === 'bottom' ? trigger.y + trigger.height + offset : trigger.y - size.height - offset;
596
+ const left = align === 'start' ? trigger.x + alignOffset : align === 'end' ? trigger.x + trigger.width - size.width + alignOffset : trigger.x + trigger.width / 2 - size.width / 2 + alignOffset;
597
+ const clampedLeft = clamp(left, bounds.left, bounds.right - size.width);
598
+ const triggerCentreX = trigger.x + trigger.width / 2;
599
+ return {
600
+ placement: resolved,
601
+ top: clamp(top, bounds.top, bounds.bottom - size.height),
602
+ left: clampedLeft,
603
+ arrowOffset: clamp(triggerCentreX - clampedLeft, ARROW_SIZE, size.width - ARROW_SIZE)
604
+ };
605
+ }
606
+ const left = resolved === 'right' ? trigger.x + trigger.width + offset : trigger.x - size.width - offset;
607
+ const top = align === 'start' ? trigger.y + alignOffset : align === 'end' ? trigger.y + trigger.height - size.height + alignOffset : trigger.y + trigger.height / 2 - size.height / 2 + alignOffset;
608
+ const clampedTop = clamp(top, bounds.top, bounds.bottom - size.height);
609
+ const triggerCentreY = trigger.y + trigger.height / 2;
610
+ return {
611
+ placement: resolved,
612
+ top: clampedTop,
613
+ left: clamp(left, bounds.left, bounds.right - size.width),
614
+ arrowOffset: clamp(triggerCentreY - clampedTop, ARROW_SIZE, size.height - ARROW_SIZE)
615
+ };
616
+ }
617
+
618
+ /**
619
+ * Where the label starts, relative to where it ends: towards the trigger, on
620
+ * whichever side was resolved, so it appears to grow out of the control.
621
+ */
622
+ const ENTRY_SHIFT = {
623
+ bottom: {
624
+ x: 0,
625
+ y: -6
626
+ },
627
+ top: {
628
+ x: 0,
629
+ y: 6
630
+ },
631
+ right: {
632
+ x: -6,
633
+ y: 0
634
+ },
635
+ left: {
636
+ x: 6,
637
+ y: 0
638
+ }
639
+ };
640
+ export const Tooltip = Object.assign(TooltipRoot, {
641
+ Trigger: TooltipTrigger,
642
+ Content: TooltipContent,
643
+ Arrow: TooltipArrow,
644
+ Title: TooltipTitle,
645
+ Description: TooltipDescription,
646
+ Text: TooltipText
647
+ });
648
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Children","cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useRef","useState","Pressable","ScrollView","useWindowDimensions","View","Animated","FadeOut","useAnimatedStyle","useReducedMotion","useSharedValue","withSpring","withTiming","useSafeAreaInsets","tv","Portal","Text","cn","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_OFFSET","SCREEN_MARGIN","ARROW_SIZE","DEFAULT_DURATION","tooltipVariants","slots","content","text","title","description","arrow","variants","variant","inverted","surface","defaultVariants","TooltipContext","useTooltip","component","context","Error","TooltipRoot","children","open","onOpenChange","defaultOpen","openOn","duration","label","internalOpen","setInternalOpen","trigger","setTrigger","placement","setPlacement","arrowOffset","setArrowOffset","setVariant","isControlled","undefined","resolvedOpen","setOpen","next","show","hide","timer","setTimeout","clearTimeout","Provider","value","TooltipTrigger","className","ref","measureThenShow","current","measureInWindow","x","y","width","height","handleLongPress","args","props","onLongPress","handlePress","onPress","collapsable","accessibilityLabel","TooltipContent","align","offset","alignOffset","minWidth","maxHeight","scrollable","onLayout","onLayoutProp","style","screenWidth","screenHeight","insets","size","setSize","event","w","h","nativeEvent","layout","Math","abs","bounds","left","right","top","bottom","available","requestedWidth","resolvedWidth","min","max","room","resolvedMaxHeight","position","place","resolvedPlacement","resolvedArrow","appear","settle","reducedMotion","placed","damping","stiffness","mass","origin","ENTRY_SHIFT","labelStyle","opacity","transform","translateX","translateY","scale","exiting","pointerEvents","maxWidth","accessibilityRole","bounces","showsVerticalScrollIndicator","wrapTooltipText","map","child","TooltipText","displayName","TooltipTitle","TooltipDescription","TooltipArrow","vertical","edge","accessibilityElementsHidden","importantForAccessibility","rotate","marginLeft","marginTop","roomAfter","opposite","needed","resolved","clamp","clampedLeft","triggerCentreX","clampedTop","triggerCentreY","Tooltip","Object","assign","Trigger","Content","Arrow","Title","Description"],"sourceRoot":"../../../../src","sources":["components/tooltip/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAGH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAGC,cAAc;AACrB,OAAOC,QAAQ,IACbC,OAAO,EACPC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,IAAI,QAAwB,0BAAuB;AAC5D,SAASC,EAAE,QAAQ,mBAAgB;;AAEnC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,cAAc,GAAG,CAAC;AACxB;AACA,MAAMC,aAAa,GAAG,EAAE;AACxB;AACA,MAAMC,UAAU,GAAG,EAAE;AACrB;AACA,MAAMC,gBAAgB,GAAG,IAAI;AAM7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGd,EAAE,CAAC;EACzBe,KAAK,EAAE;IACLC,OAAO,EAAE,oCAAoC;IAC7CC,IAAI,EAAE,qBAAqB;IAC3BC,KAAK,EAAE,uBAAuB;IAC9BC,WAAW,EAAE,SAAS;IACtBC,KA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