@mrpelz/uikit-ish 7.8.0 → 7.10.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 (308) hide show
  1. package/dist/components/accordion/main.d.ts +12 -0
  2. package/dist/components/accordion/main.d.ts.map +1 -0
  3. package/dist/components/accordion/main.js +20 -0
  4. package/dist/components/accordion/main.js.map +1 -0
  5. package/dist/components/accordion/style.css +23 -0
  6. package/dist/components/action-sheet/main.d.ts +22 -16
  7. package/dist/components/action-sheet/main.d.ts.map +1 -1
  8. package/dist/components/action-sheet/main.js +89 -19
  9. package/dist/components/action-sheet/main.js.map +1 -1
  10. package/dist/components/action-sheet/props.d.ts +17 -5
  11. package/dist/components/action-sheet/props.d.ts.map +1 -1
  12. package/dist/components/action-sheet/style.css +24 -0
  13. package/dist/components/activity-view/main.d.ts +15 -4
  14. package/dist/components/activity-view/main.d.ts.map +1 -1
  15. package/dist/components/activity-view/main.js +27 -14
  16. package/dist/components/activity-view/main.js.map +1 -1
  17. package/dist/components/activity-view/props.d.ts +2 -10
  18. package/dist/components/activity-view/props.d.ts.map +1 -1
  19. package/dist/components/activity-view/style.css +29 -67
  20. package/dist/components/alert/main.d.ts +8 -7
  21. package/dist/components/alert/main.d.ts.map +1 -1
  22. package/dist/components/alert/main.js +32 -19
  23. package/dist/components/alert/main.js.map +1 -1
  24. package/dist/components/alert/props.d.ts +13 -2
  25. package/dist/components/alert/props.d.ts.map +1 -1
  26. package/dist/components/alert/style.css +36 -50
  27. package/dist/components/avatar/main.d.ts +5 -3
  28. package/dist/components/avatar/main.d.ts.map +1 -1
  29. package/dist/components/avatar/main.js +10 -8
  30. package/dist/components/avatar/main.js.map +1 -1
  31. package/dist/components/avatar/props.d.ts +4 -0
  32. package/dist/components/avatar/props.d.ts.map +1 -1
  33. package/dist/components/avatar/style.css +1 -7
  34. package/dist/components/badge/main.d.ts +3 -3
  35. package/dist/components/badge/main.d.ts.map +1 -1
  36. package/dist/components/badge/main.js +9 -9
  37. package/dist/components/badge/main.js.map +1 -1
  38. package/dist/components/badge/props.d.ts +4 -3
  39. package/dist/components/badge/props.d.ts.map +1 -1
  40. package/dist/components/badge/style.css +10 -4
  41. package/dist/components/button/main.d.ts.map +1 -1
  42. package/dist/components/button/main.js +15 -15
  43. package/dist/components/button/main.js.map +1 -1
  44. package/dist/components/button/props.d.ts +8 -8
  45. package/dist/components/button/props.d.ts.map +1 -1
  46. package/dist/components/button/style.css +37 -55
  47. package/dist/components/checkbox/main.d.ts.map +1 -1
  48. package/dist/components/checkbox/main.js +5 -7
  49. package/dist/components/checkbox/main.js.map +1 -1
  50. package/dist/components/checkbox/style.css +5 -8
  51. package/dist/components/collapsible/main.d.ts +9 -0
  52. package/dist/components/collapsible/main.d.ts.map +1 -0
  53. package/dist/components/collapsible/main.js +19 -0
  54. package/dist/components/collapsible/main.js.map +1 -0
  55. package/dist/components/collapsible/style.css +23 -0
  56. package/dist/components/color-picker/main.d.ts +27 -4
  57. package/dist/components/color-picker/main.d.ts.map +1 -1
  58. package/dist/components/color-picker/main.js +292 -110
  59. package/dist/components/color-picker/main.js.map +1 -1
  60. package/dist/components/color-picker/props.d.ts +64 -15
  61. package/dist/components/color-picker/props.d.ts.map +1 -1
  62. package/dist/components/color-picker/style.css +133 -65
  63. package/dist/components/contextual-menu/main.d.ts +11 -7
  64. package/dist/components/contextual-menu/main.d.ts.map +1 -1
  65. package/dist/components/contextual-menu/main.js +207 -202
  66. package/dist/components/contextual-menu/main.js.map +1 -1
  67. package/dist/components/contextual-menu/props.d.ts +21 -34
  68. package/dist/components/contextual-menu/props.d.ts.map +1 -1
  69. package/dist/components/contextual-menu/style.css +63 -34
  70. package/dist/components/date-picker/handle.d.ts +41 -0
  71. package/dist/components/date-picker/handle.d.ts.map +1 -0
  72. package/dist/components/date-picker/handle.js +47 -0
  73. package/dist/components/date-picker/handle.js.map +1 -0
  74. package/dist/components/date-picker/main.d.ts +31 -49
  75. package/dist/components/date-picker/main.d.ts.map +1 -1
  76. package/dist/components/date-picker/main.js +373 -178
  77. package/dist/components/date-picker/main.js.map +1 -1
  78. package/dist/components/date-picker/pager.d.ts +24 -0
  79. package/dist/components/date-picker/pager.d.ts.map +1 -0
  80. package/dist/components/date-picker/pager.js +307 -0
  81. package/dist/components/date-picker/pager.js.map +1 -0
  82. package/dist/components/date-picker/props.d.ts +98 -27
  83. package/dist/components/date-picker/props.d.ts.map +1 -1
  84. package/dist/components/date-picker/style.css +110 -118
  85. package/dist/components/drawer/main.d.ts +31 -0
  86. package/dist/components/drawer/main.d.ts.map +1 -0
  87. package/dist/components/drawer/main.js +119 -0
  88. package/dist/components/drawer/main.js.map +1 -0
  89. package/dist/components/drawer/props.d.ts +39 -0
  90. package/dist/components/drawer/props.d.ts.map +1 -0
  91. package/dist/components/drawer/props.js +2 -0
  92. package/dist/components/drawer/props.js.map +1 -0
  93. package/dist/components/drawer/style.css +135 -0
  94. package/dist/components/edit-menu/main.d.ts +7 -7
  95. package/dist/components/edit-menu/main.d.ts.map +1 -1
  96. package/dist/components/edit-menu/main.js +57 -40
  97. package/dist/components/edit-menu/main.js.map +1 -1
  98. package/dist/components/edit-menu/props.d.ts +14 -1
  99. package/dist/components/edit-menu/props.d.ts.map +1 -1
  100. package/dist/components/edit-menu/style.css +15 -8
  101. package/dist/components/form/main.d.ts +8 -0
  102. package/dist/components/form/main.d.ts.map +1 -1
  103. package/dist/components/form/main.js +18 -5
  104. package/dist/components/form/main.js.map +1 -1
  105. package/dist/components/form/props.d.ts +1 -2
  106. package/dist/components/form/props.d.ts.map +1 -1
  107. package/dist/components/glass/main.d.ts +1 -1
  108. package/dist/components/glass/main.js +4 -4
  109. package/dist/components/glass/main.js.map +1 -1
  110. package/dist/components/glass/props.d.ts +5 -5
  111. package/dist/components/glass/props.d.ts.map +1 -1
  112. package/dist/components/glass/style.css +176 -161
  113. package/dist/components/header/main.d.ts +5 -4
  114. package/dist/components/header/main.d.ts.map +1 -1
  115. package/dist/components/header/main.js +64 -34
  116. package/dist/components/header/main.js.map +1 -1
  117. package/dist/components/header/props.d.ts +2 -3
  118. package/dist/components/header/props.d.ts.map +1 -1
  119. package/dist/components/header/style.css +46 -65
  120. package/dist/components/index.d.ts +27 -23
  121. package/dist/components/index.d.ts.map +1 -1
  122. package/dist/components/index.js +17 -13
  123. package/dist/components/index.js.map +1 -1
  124. package/dist/components/layout/main.d.ts +2 -2
  125. package/dist/components/layout/main.d.ts.map +1 -1
  126. package/dist/components/layout/main.js +63 -167
  127. package/dist/components/layout/main.js.map +1 -1
  128. package/dist/components/layout/props.d.ts +2 -20
  129. package/dist/components/layout/props.d.ts.map +1 -1
  130. package/dist/components/layout/style.css +20 -91
  131. package/dist/components/list/main.d.ts +58 -10
  132. package/dist/components/list/main.d.ts.map +1 -1
  133. package/dist/components/list/main.js +1022 -465
  134. package/dist/components/list/main.js.map +1 -1
  135. package/dist/components/list/props.d.ts +211 -21
  136. package/dist/components/list/props.d.ts.map +1 -1
  137. package/dist/components/list/reorder.d.ts +146 -0
  138. package/dist/components/list/reorder.d.ts.map +1 -0
  139. package/dist/components/list/reorder.js +819 -0
  140. package/dist/components/list/reorder.js.map +1 -0
  141. package/dist/components/list/select.d.ts +6 -0
  142. package/dist/components/list/select.d.ts.map +1 -0
  143. package/dist/components/list/select.js +141 -0
  144. package/dist/components/list/select.js.map +1 -0
  145. package/dist/components/list/style.css +492 -507
  146. package/dist/components/list/swipe-actions-handle.d.ts +40 -0
  147. package/dist/components/list/swipe-actions-handle.d.ts.map +1 -0
  148. package/dist/components/list/swipe-actions-handle.js +51 -0
  149. package/dist/components/list/swipe-actions-handle.js.map +1 -0
  150. package/dist/components/menu/main.d.ts +102 -32
  151. package/dist/components/menu/main.d.ts.map +1 -1
  152. package/dist/components/menu/main.js +510 -99
  153. package/dist/components/menu/main.js.map +1 -1
  154. package/dist/components/menu/props.d.ts +5 -5
  155. package/dist/components/menu/props.d.ts.map +1 -1
  156. package/dist/components/menu/style.css +35 -43
  157. package/dist/components/navigation/main.d.ts +14 -2
  158. package/dist/components/navigation/main.d.ts.map +1 -1
  159. package/dist/components/navigation/main.js +437 -119
  160. package/dist/components/navigation/main.js.map +1 -1
  161. package/dist/components/navigation/props.d.ts +53 -3
  162. package/dist/components/navigation/props.d.ts.map +1 -1
  163. package/dist/components/navigation/style.css +56 -9
  164. package/dist/components/page/main.d.ts.map +1 -1
  165. package/dist/components/page/main.js +13 -8
  166. package/dist/components/page/main.js.map +1 -1
  167. package/dist/components/page/props.d.ts +8 -0
  168. package/dist/components/page/props.d.ts.map +1 -1
  169. package/dist/components/page/style.css +39 -4
  170. package/dist/components/page-control/main.d.ts +2 -2
  171. package/dist/components/page-control/main.d.ts.map +1 -1
  172. package/dist/components/page-control/main.js +66 -32
  173. package/dist/components/page-control/main.js.map +1 -1
  174. package/dist/components/page-control/props.d.ts +10 -2
  175. package/dist/components/page-control/props.d.ts.map +1 -1
  176. package/dist/components/page-control/style.css +7 -2
  177. package/dist/components/popover/main.d.ts +11 -6
  178. package/dist/components/popover/main.d.ts.map +1 -1
  179. package/dist/components/popover/main.js +63 -38
  180. package/dist/components/popover/main.js.map +1 -1
  181. package/dist/components/popover/props.d.ts +7 -6
  182. package/dist/components/popover/props.d.ts.map +1 -1
  183. package/dist/components/popover/style.css +54 -4
  184. package/dist/components/progress/main.d.ts +2 -3
  185. package/dist/components/progress/main.d.ts.map +1 -1
  186. package/dist/components/progress/main.js +148 -29
  187. package/dist/components/progress/main.js.map +1 -1
  188. package/dist/components/progress/props.d.ts +43 -9
  189. package/dist/components/progress/props.d.ts.map +1 -1
  190. package/dist/components/progress/style.css +82 -50
  191. package/dist/components/roll/main.d.ts +1 -1
  192. package/dist/components/roll/main.d.ts.map +1 -1
  193. package/dist/components/roll/main.js +90 -34
  194. package/dist/components/roll/main.js.map +1 -1
  195. package/dist/components/roll/props.d.ts +25 -8
  196. package/dist/components/roll/props.d.ts.map +1 -1
  197. package/dist/components/roll/style.css +12 -24
  198. package/dist/components/segmented/main.d.ts.map +1 -1
  199. package/dist/components/segmented/main.js +47 -30
  200. package/dist/components/segmented/main.js.map +1 -1
  201. package/dist/components/segmented/style.css +16 -23
  202. package/dist/components/sheet/main.d.ts +25 -15
  203. package/dist/components/sheet/main.d.ts.map +1 -1
  204. package/dist/components/sheet/main.js +66 -78
  205. package/dist/components/sheet/main.js.map +1 -1
  206. package/dist/components/sheet/props.d.ts +37 -3
  207. package/dist/components/sheet/props.d.ts.map +1 -1
  208. package/dist/components/sheet/style.css +183 -45
  209. package/dist/components/sidebar/main.d.ts.map +1 -1
  210. package/dist/components/sidebar/main.js +9 -13
  211. package/dist/components/sidebar/main.js.map +1 -1
  212. package/dist/components/sidebar/style.css +20 -14
  213. package/dist/components/slider/main.d.ts.map +1 -1
  214. package/dist/components/slider/main.js +23 -22
  215. package/dist/components/slider/main.js.map +1 -1
  216. package/dist/components/slider/props.d.ts +1 -2
  217. package/dist/components/slider/props.d.ts.map +1 -1
  218. package/dist/components/slider/style.css +27 -53
  219. package/dist/components/stepper/main.d.ts +4 -6
  220. package/dist/components/stepper/main.d.ts.map +1 -1
  221. package/dist/components/stepper/main.js +29 -25
  222. package/dist/components/stepper/main.js.map +1 -1
  223. package/dist/components/stepper/style.css +12 -16
  224. package/dist/components/switch/main.d.ts.map +1 -1
  225. package/dist/components/switch/main.js +40 -28
  226. package/dist/components/switch/main.js.map +1 -1
  227. package/dist/components/switch/props.d.ts +7 -5
  228. package/dist/components/switch/props.d.ts.map +1 -1
  229. package/dist/components/switch/style.css +40 -17
  230. package/dist/components/symbol/main.d.ts +2 -2
  231. package/dist/components/symbol/main.d.ts.map +1 -1
  232. package/dist/components/symbol/main.js +36 -28
  233. package/dist/components/symbol/main.js.map +1 -1
  234. package/dist/components/symbol/props.d.ts +39 -4
  235. package/dist/components/symbol/props.d.ts.map +1 -1
  236. package/dist/components/symbol/style.css +26 -5
  237. package/dist/components/tab-bar/main.d.ts +2 -2
  238. package/dist/components/tab-bar/main.d.ts.map +1 -1
  239. package/dist/components/tab-bar/main.js +133 -101
  240. package/dist/components/tab-bar/main.js.map +1 -1
  241. package/dist/components/tab-bar/props.d.ts +6 -6
  242. package/dist/components/tab-bar/props.d.ts.map +1 -1
  243. package/dist/components/tab-bar/style.css +113 -99
  244. package/dist/components/text-field/main.d.ts +3 -2
  245. package/dist/components/text-field/main.d.ts.map +1 -1
  246. package/dist/components/text-field/main.js +29 -30
  247. package/dist/components/text-field/main.js.map +1 -1
  248. package/dist/components/text-field/props.d.ts +23 -1
  249. package/dist/components/text-field/props.d.ts.map +1 -1
  250. package/dist/components/text-field/style.css +122 -82
  251. package/dist/components/toolbar/main.js +27 -27
  252. package/dist/components/toolbar/main.js.map +1 -1
  253. package/dist/components/toolbar/props.d.ts +10 -4
  254. package/dist/components/toolbar/props.d.ts.map +1 -1
  255. package/dist/components/toolbar/style.css +39 -33
  256. package/dist/components/tooltip/main.d.ts +10 -9
  257. package/dist/components/tooltip/main.d.ts.map +1 -1
  258. package/dist/components/tooltip/main.js +39 -10
  259. package/dist/components/tooltip/main.js.map +1 -1
  260. package/dist/components/tooltip/props.d.ts +2 -0
  261. package/dist/components/tooltip/props.d.ts.map +1 -1
  262. package/dist/components/tooltip/style.css +16 -16
  263. package/dist/components/typography/main.d.ts +2 -2
  264. package/dist/components/typography/main.d.ts.map +1 -1
  265. package/dist/components/typography/main.js +24 -16
  266. package/dist/components/typography/main.js.map +1 -1
  267. package/dist/components/typography/props.d.ts +11 -18
  268. package/dist/components/typography/props.d.ts.map +1 -1
  269. package/dist/components/typography/style.css +503 -623
  270. package/dist/components/utils/main.d.ts +78 -8
  271. package/dist/components/utils/main.d.ts.map +1 -1
  272. package/dist/components/utils/main.js +235 -16
  273. package/dist/components/utils/main.js.map +1 -1
  274. package/dist/components/utils/props.d.ts +27 -4
  275. package/dist/components/utils/props.d.ts.map +1 -1
  276. package/dist/components/utils/style.css +31 -18
  277. package/dist/components/viewport/edge-effect.d.ts +10 -0
  278. package/dist/components/viewport/edge-effect.d.ts.map +1 -0
  279. package/dist/components/viewport/edge-effect.js +100 -0
  280. package/dist/components/viewport/edge-effect.js.map +1 -0
  281. package/dist/components/viewport/edge.d.ts +39 -0
  282. package/dist/components/viewport/edge.d.ts.map +1 -0
  283. package/dist/components/viewport/edge.js +151 -0
  284. package/dist/components/viewport/edge.js.map +1 -0
  285. package/dist/components/viewport/input.d.ts +39 -0
  286. package/dist/components/viewport/input.d.ts.map +1 -0
  287. package/dist/components/viewport/input.js +280 -0
  288. package/dist/components/viewport/input.js.map +1 -0
  289. package/dist/components/viewport/main.d.ts +47 -9
  290. package/dist/components/viewport/main.d.ts.map +1 -1
  291. package/dist/components/viewport/main.js +745 -86
  292. package/dist/components/viewport/main.js.map +1 -1
  293. package/dist/components/viewport/padding.d.ts +78 -0
  294. package/dist/components/viewport/padding.d.ts.map +1 -0
  295. package/dist/components/viewport/padding.js +321 -0
  296. package/dist/components/viewport/padding.js.map +1 -0
  297. package/dist/components/viewport/props.d.ts +220 -11
  298. package/dist/components/viewport/props.d.ts.map +1 -1
  299. package/dist/components/viewport/style.css +377 -6
  300. package/dist/main.d.ts +0 -1
  301. package/dist/main.d.ts.map +1 -1
  302. package/dist/main.js.map +1 -1
  303. package/dist/styles.css +318 -302
  304. package/dist/styles.d.ts +2 -1
  305. package/dist/styles.d.ts.map +1 -1
  306. package/dist/styles.js +2 -1
  307. package/dist/styles.js.map +1 -1
  308. package/package.json +8 -16
@@ -1,7 +1,21 @@
1
1
  import type { ComponentProps, ReactNode, RefObject } from 'react';
2
+ import type { PortalContainer } from '../utils/main.js';
3
+ import type { ViewportAnchorHandle } from './padding.js';
4
+ /**
5
+ * The window's horizontal size class: `regular` from 768px (a tablet's
6
+ * window, full or split), `compact` below (a phone's).
7
+ */
8
+ export type SizeClass = 'compact' | 'regular';
2
9
  /** The visual viewport, and the keyboard's height (0 without one). */
3
10
  export type VisualViewportState = {
4
11
  height: number;
12
+ /**
13
+ * The page hidden (the Page Visibility API: e.g. another tab, the app
14
+ * left, also a Home Screen app's). Meanwhile the rest is kept as it was
15
+ * (e.g. the keyboard's height: its field focused again as it's shown, see
16
+ * `preventFocusShift`); shown, read anew once the keyboard has settled.
17
+ */
18
+ isHidden: boolean;
5
19
  /** What the visual viewport doesn't show of the layout viewport's bottom. */
6
20
  keyboardInset: number;
7
21
  left: number;
@@ -13,24 +27,52 @@ export type ViewportScrollEvent = {
13
27
  atBottom: boolean;
14
28
  /** Scrolled to (or past) the start. */
15
29
  atTop: boolean;
16
- /** The direction scrolled in, past the threshold (until then: none). */
30
+ /**
31
+ * The direction scrolled in, past the threshold (until then: none); not
32
+ * changed by overscrolling (e.g. bouncing back from the end).
33
+ */
17
34
  direction: 'down' | 'up' | undefined;
18
- /** The scroll position. */
35
+ /**
36
+ * Overscrolling held: a touch, or a wheel (until quiet), pulling it (e.g.
37
+ * to act on release); once not, it's released, bouncing back.
38
+ */
39
+ isHeld: boolean;
40
+ /**
41
+ * How far it's pulled past an end (px, damped as rubber-banding):
42
+ * negative past the start (e.g. pulling to refresh), positive past the
43
+ * end; 0 within. Safari's own bounce, or (elsewhere) touches and wheels
44
+ * at an end.
45
+ */
46
+ overscroll: number;
47
+ /** The scroll position, within the scroll range (overscrolled: its end). */
19
48
  position: number;
20
49
  };
21
50
  export type Listener = (event: ViewportScrollEvent) => void;
51
+ export type ViewportScrollOptions = {
52
+ /**
53
+ * How far to scroll before the direction changes (px): more for a
54
+ * steadier direction (e.g. over a device's jitter).
55
+ * @default 8
56
+ */
57
+ threshold?: number;
58
+ };
22
59
  export type ViewportProviderProps = {
23
60
  children?: ReactNode;
24
61
  /**
25
- * The scroll container tracked.
26
- * @default the document's scrolling element
62
+ * The app's screen, when it isn't the window (e.g. a device's frame in a
63
+ * page): the visual viewport within it (the keyboard's inset over its
64
+ * bottom), its custom properties on it.
65
+ * @default the provided portal container (`PortalContainerContext`), or
66
+ * none: the window
27
67
  */
28
- scroller?: RefObject<HTMLElement | null>;
68
+ screen?: PortalContainer | null;
29
69
  /**
30
- * How far to scroll before the direction changes (px).
31
- * @default 8
70
+ * The scroll container tracked.
71
+ * @default the page filling its screen (the registered scroller there:
72
+ * a `Page.Root`, a sheet's content, the content layer), or the
73
+ * document's scrolling element
32
74
  */
33
- threshold?: number;
75
+ scroller?: RefObject<HTMLElement | null>;
34
76
  };
35
77
  /** The edge of the viewport an anchor floats at. */
36
78
  export type ViewportEdge = 'block-end' | 'block-start' | 'inline-end' | 'inline-start';
@@ -39,12 +81,42 @@ export type ViewportEdge = 'block-end' | 'block-start' | 'inline-end' | 'inline-
39
81
  * (top, bottom) or inline (left, right) dimension only, or none.
40
82
  */
41
83
  export type ViewportSafeArea = 'all' | 'block' | 'inline' | 'none';
84
+ /**
85
+ * The safe area insets a content layer keeps clear: as any layer's (see
86
+ * `ViewportSafeArea`), or `auto`, by what it holds (see
87
+ * `ViewportContentProps['safeArea']`).
88
+ */
89
+ export type ViewportContentSafeArea = ViewportSafeArea | 'auto';
90
+ /**
91
+ * A bar's scroll edge effect, as content scrolls under it:
92
+ * `soft`, a blur fading out away from the edge; `hard`, a solid backing
93
+ * with a dividing line; `none`.
94
+ */
95
+ export type ViewportEdgeEffect = 'hard' | 'none' | 'soft';
42
96
  export type ViewportAnchorProps = ComponentProps<'div'> & {
43
97
  /**
44
98
  * The edge it floats at (e.g. `block-start`: a toolbar; `block-end`: a tab
45
99
  * bar).
46
100
  */
47
101
  edge: ViewportEdge;
102
+ /**
103
+ * At the block start or end: its scroll edge effect, as content scrolls
104
+ * under it (and under what's stuck to it, see `useViewportEdgeElement`).
105
+ * @default 'soft'
106
+ */
107
+ edgeEffect?: ViewportEdgeEffect;
108
+ /**
109
+ * At the block start or end: a color for its edge effect (e.g. to tell a
110
+ * state for a while), shown at rest too: `soft`, under its fade; `hard`,
111
+ * as its backing. Changes crossfade.
112
+ */
113
+ edgeTint?: string;
114
+ /**
115
+ * Its handle (see `Viewport.createAnchorHandle`), linking it to the
116
+ * paddings given it (`anchor`, alone or among others): as high as it, or
117
+ * the tallest of their anchors.
118
+ */
119
+ handle?: ViewportAnchorHandle;
48
120
  /**
49
121
  * At the block end: pushed up by the on-screen keyboard (default, e.g.
50
122
  * a message field), or covered by it (e.g. a tab bar).
@@ -56,16 +128,153 @@ export type ViewportAnchorProps = ComponentProps<'div'> & {
56
128
  */
57
129
  safeArea?: ViewportSafeArea;
58
130
  };
131
+ export type ViewportOverscrollProps = ComponentProps<'div'> & {
132
+ /**
133
+ * The bars it's below (or above, at the end): their handles, one or
134
+ * several (the tallest of them, see `Viewport.createAnchorHandle`);
135
+ * instead of the tallest at its edge. `null`: none (from the screen's
136
+ * edge, inside the safe area).
137
+ */
138
+ anchor?: ViewportAnchorHandle | readonly ViewportAnchorHandle[] | null;
139
+ /**
140
+ * The end it's at: past the content's start (e.g. pulling to refresh), or
141
+ * its end.
142
+ * @default 'block-start'
143
+ */
144
+ edge?: 'block-end' | 'block-start';
145
+ /**
146
+ * Kept shown at rest, e.g. while refreshing: the
147
+ * `Viewport.Padding` at its edge making room for it beyond the bars,
148
+ * settling there (and back once closed).
149
+ * @default false
150
+ */
151
+ open?: boolean;
152
+ /**
153
+ * The safe area insets it shows only clear of while pulled in (as
154
+ * `Content`'s: all, those of the block dimension, top and bottom, or the
155
+ * inline one, left and right, only, or none). Not kept clear, it shows in
156
+ * the inset too (e.g. behind the status bar), there even at rest, just
157
+ * past the content's end (e.g. faded by its progress, see
158
+ * `--uikit-viewport-overscroll-progress`); open, it rests clear of it all
159
+ * the same.
160
+ * @default 'all'
161
+ */
162
+ safeArea?: ViewportSafeArea;
163
+ };
164
+ export type ViewportPaddingProps = Omit<ComponentProps<'div'>, 'children'> & {
165
+ /**
166
+ * The anchors it's as high as (the tallest of them): their handles, one
167
+ * or several (see `Viewport.createAnchorHandle`), wherever they are;
168
+ * instead of the tallest at its edge. `null`: none, whatever anchors are
169
+ * in its scope (its margin alone, e.g. a gap of the app's).
170
+ */
171
+ anchor?: ViewportAnchorHandle | readonly ViewportAnchorHandle[] | null;
172
+ /**
173
+ * The edge whose anchors it makes room for (the tallest of them, in its
174
+ * scope): its scroll container's start (`block-start`, e.g. a bar) or end
175
+ * (`block-end`, e.g. a tab bar).
176
+ * @default 'block-start'
177
+ */
178
+ edge?: ViewportEdge;
179
+ /**
180
+ * The gap between the content and its container's edge, beyond the
181
+ * anchors (px, or a CSS length): instead of the library's content margin
182
+ * (`--uikit-content-margin-block-start`/`-end`, 16px; none before a large
183
+ * title).
184
+ */
185
+ margin?: number | string;
186
+ };
187
+ export type ViewportKeyboardAccessoryProps = ComponentProps<'div'> & {
188
+ /**
189
+ * How far above the keyboard it's kept, lifted (px).
190
+ * @default 8
191
+ */
192
+ gap?: number;
193
+ };
59
194
  export type ViewportContentProps = ComponentProps<'div'> & {
195
+ /**
196
+ * Bouncing even when its content fits:
197
+ * at least 1px to scroll, so a drag on it is its own (rubber-banding
198
+ * here, the bars staying), not the document's (on iOS, moving the whole
199
+ * app). Off: only content taller than it scrolls.
200
+ * @default while it holds its content itself; not while its child
201
+ * scrolls on its own (a `Page`, a `Header` around one, a `Layout`, a
202
+ * `Navigation`: bouncing it would move them whole)
203
+ */
204
+ alwaysBounce?: boolean;
60
205
  /**
61
206
  * With the on-screen keyboard: resized to what's above it (default, so
62
207
  * its end scrolls into view), or overlaid by it.
63
208
  */
64
209
  keyboard?: 'overlay' | 'resize';
65
210
  /**
66
- * The safe area insets kept clear.
67
- * @default 'all'
211
+ * The safe area insets kept clear (as its padding), or `auto`, by what it
212
+ * holds (as `alwaysBounce`'s default):
213
+ * - Its content itself (e.g. a list after a `Viewport.Padding`): `all`.
214
+ * Its content starts clear of them (the status bar, the home
215
+ * indicator) and scrolls on under them, its paddings not counting
216
+ * them again.
217
+ * - A child scrolling on its own (a `Page`, a `Header` around one, a
218
+ * `Layout`, a `Navigation`, as its direct child, e.g. a tab bar's panel
219
+ * rendered as one): `none`. That child fills the screen, under the
220
+ * status bar too, its own bars and paddings keeping its content clear
221
+ * (kept clear here, it would stop at their border).
222
+ * @default 'auto'
68
223
  */
69
- safeArea?: ViewportSafeArea;
224
+ safeArea?: ViewportContentSafeArea;
225
+ };
226
+ export type ElementVisibilityOptions = {
227
+ /**
228
+ * Grows (or shrinks) the area counted as visible, as CSS margins (e.g.
229
+ * `'100% 0px'`: a screen above and below).
230
+ * @default '0px'
231
+ */
232
+ rootMargin?: string;
233
+ /**
234
+ * The scroll container whose box is the visible area.
235
+ * @default the viewport (the layout viewport)
236
+ */
237
+ scroller?: RefObject<HTMLElement | null>;
238
+ /**
239
+ * How much of the element (0–1) must be visible to count (0: any of it,
240
+ * even an edge).
241
+ * @default 0
242
+ */
243
+ threshold?: number;
244
+ };
245
+ export type ElementGeometryOptions = {
246
+ /**
247
+ * The scroll container whose box is the visible area.
248
+ * @default the viewport (the layout viewport)
249
+ */
250
+ scroller?: RefObject<HTMLElement | null>;
251
+ };
252
+ /**
253
+ * Where an element is in the visible area (px; distances positive while
254
+ * the element's edge is inside the area's, negative past it).
255
+ */
256
+ export type ElementGeometry = {
257
+ /** From the area's bottom edge to the element's. */
258
+ bottom: number;
259
+ /** The element's height. */
260
+ height: number;
261
+ /** From the area's left edge to the element's. */
262
+ left: number;
263
+ /** From the area's right edge to the element's. */
264
+ right: number;
265
+ /** From the area's top edge to the element's. */
266
+ top: number;
267
+ /** How much of the element's height is visible. */
268
+ visibleHeight: number;
269
+ /** How much of the element's height is visible (0–1). */
270
+ visibleHeightRatio: number;
271
+ /** How much of the element's area is visible (0–1). */
272
+ visibleRatio: number;
273
+ /** How much of the element's width is visible. */
274
+ visibleWidth: number;
275
+ /** How much of the element's width is visible (0–1). */
276
+ visibleWidthRatio: number;
277
+ /** The element's width. */
278
+ width: number;
70
279
  };
71
280
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/components/viewport/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MA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