@kanso-labs/react-native-kanso-ui 0.9.0 → 0.11.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 (217) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1358 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/chip/index.d.ts +4 -1
  42. package/dist/components/chip/index.js +229 -161
  43. package/dist/components/chip/index.js.map +1 -1
  44. package/dist/components/color-area/index.d.ts +85 -0
  45. package/dist/components/color-area/index.js +630 -0
  46. package/dist/components/color-area/index.js.map +1 -0
  47. package/dist/components/color-field/index.d.ts +144 -0
  48. package/dist/components/color-field/index.js +516 -0
  49. package/dist/components/color-field/index.js.map +1 -0
  50. package/dist/components/color-picker/index.d.ts +74 -0
  51. package/dist/components/color-picker/index.js +317 -0
  52. package/dist/components/color-picker/index.js.map +1 -0
  53. package/dist/components/color-slider/index.d.ts +82 -0
  54. package/dist/components/color-slider/index.js +456 -0
  55. package/dist/components/color-slider/index.js.map +1 -0
  56. package/dist/components/color-swatch/index.d.ts +46 -0
  57. package/dist/components/color-swatch/index.js +127 -0
  58. package/dist/components/color-swatch/index.js.map +1 -0
  59. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  60. package/dist/components/color-swatch-picker/index.js +287 -0
  61. package/dist/components/color-swatch-picker/index.js.map +1 -0
  62. package/dist/components/color-wheel/index.d.ts +71 -0
  63. package/dist/components/color-wheel/index.js +407 -0
  64. package/dist/components/color-wheel/index.js.map +1 -0
  65. package/dist/components/combo-box/index.d.ts +193 -0
  66. package/dist/components/combo-box/index.js +616 -0
  67. package/dist/components/combo-box/index.js.map +1 -0
  68. package/dist/components/date-field/index.d.ts +120 -0
  69. package/dist/components/date-field/index.js +111 -0
  70. package/dist/components/date-field/index.js.map +1 -0
  71. package/dist/components/date-picker/index.d.ts +130 -0
  72. package/dist/components/date-picker/index.js +310 -0
  73. package/dist/components/date-picker/index.js.map +1 -0
  74. package/dist/components/date-range-picker/index.d.ts +139 -0
  75. package/dist/components/date-range-picker/index.js +421 -0
  76. package/dist/components/date-range-picker/index.js.map +1 -0
  77. package/dist/components/dialog/index.d.ts +5 -5
  78. package/dist/components/dialog/index.js +5 -5
  79. package/dist/components/dialog/index.js.map +1 -1
  80. package/dist/components/disclosure/index.d.ts +94 -0
  81. package/dist/components/disclosure/index.js +365 -0
  82. package/dist/components/disclosure/index.js.map +1 -0
  83. package/dist/components/disclosure-group/index.d.ts +61 -0
  84. package/dist/components/disclosure-group/index.js +100 -0
  85. package/dist/components/disclosure-group/index.js.map +1 -0
  86. package/dist/components/drop-zone/index.d.ts +113 -0
  87. package/dist/components/drop-zone/index.js +304 -0
  88. package/dist/components/drop-zone/index.js.map +1 -0
  89. package/dist/components/fab/index.d.ts +1 -1
  90. package/dist/components/fab/index.js +91 -76
  91. package/dist/components/fab/index.js.map +1 -1
  92. package/dist/components/form/index.d.ts +3 -2
  93. package/dist/components/form/index.js.map +1 -1
  94. package/dist/components/icon-button/index.d.ts +4 -2
  95. package/dist/components/icon-button/index.js +204 -171
  96. package/dist/components/icon-button/index.js.map +1 -1
  97. package/dist/components/list/index.d.ts +15 -158
  98. package/dist/components/list/index.js +21 -1047
  99. package/dist/components/list/index.js.map +1 -1
  100. package/dist/components/list-box/index.d.ts +73 -0
  101. package/dist/components/list-box/index.js +82 -0
  102. package/dist/components/list-box/index.js.map +1 -0
  103. package/dist/components/loading-indicator/index.d.ts +32 -0
  104. package/dist/components/loading-indicator/index.js +174 -0
  105. package/dist/components/loading-indicator/index.js.map +1 -0
  106. package/dist/components/menu/index.d.ts +3 -3
  107. package/dist/components/menu/index.js +3 -3
  108. package/dist/components/menu/index.js.map +1 -1
  109. package/dist/components/navigation-tree/index.d.ts +117 -0
  110. package/dist/components/navigation-tree/index.js +135 -0
  111. package/dist/components/navigation-tree/index.js.map +1 -0
  112. package/dist/components/number-field/index.js +132 -143
  113. package/dist/components/number-field/index.js.map +1 -1
  114. package/dist/components/popover/index.d.ts +2 -2
  115. package/dist/components/popover/index.js +2 -2
  116. package/dist/components/popover/index.js.map +1 -1
  117. package/dist/components/range-calendar/index.d.ts +69 -0
  118. package/dist/components/range-calendar/index.js +144 -0
  119. package/dist/components/range-calendar/index.js.map +1 -0
  120. package/dist/components/search-view/index.d.ts +79 -0
  121. package/dist/components/search-view/index.js +571 -0
  122. package/dist/components/search-view/index.js.map +1 -0
  123. package/dist/components/select/index.d.ts +152 -0
  124. package/dist/components/select/index.js +419 -0
  125. package/dist/components/select/index.js.map +1 -0
  126. package/dist/components/sheet/index.d.ts +16 -7
  127. package/dist/components/sheet/index.js +157 -152
  128. package/dist/components/sheet/index.js.map +1 -1
  129. package/dist/components/slider/index.d.ts +111 -0
  130. package/dist/components/slider/index.js +673 -0
  131. package/dist/components/slider/index.js.map +1 -0
  132. package/dist/components/split-button/index.d.ts +77 -0
  133. package/dist/components/split-button/index.js +354 -0
  134. package/dist/components/split-button/index.js.map +1 -0
  135. package/dist/components/table/index.d.ts +391 -0
  136. package/dist/components/table/index.js +1708 -0
  137. package/dist/components/table/index.js.map +1 -0
  138. package/dist/components/tabs/index.d.ts +196 -0
  139. package/dist/components/tabs/index.js +1137 -0
  140. package/dist/components/tabs/index.js.map +1 -0
  141. package/dist/components/time-field/index.d.ts +43 -0
  142. package/dist/components/time-field/index.js +107 -0
  143. package/dist/components/time-field/index.js.map +1 -0
  144. package/dist/components/time-picker/index.d.ts +65 -0
  145. package/dist/components/time-picker/index.js +1168 -0
  146. package/dist/components/time-picker/index.js.map +1 -0
  147. package/dist/components/token-field/index.d.ts +105 -0
  148. package/dist/components/token-field/index.js +574 -0
  149. package/dist/components/token-field/index.js.map +1 -0
  150. package/dist/components/tooltip/index.d.ts +102 -0
  151. package/dist/components/tooltip/index.js +223 -0
  152. package/dist/components/tooltip/index.js.map +1 -0
  153. package/dist/components/tree/index.d.ts +112 -0
  154. package/dist/components/tree/index.js +157 -0
  155. package/dist/components/tree/index.js.map +1 -0
  156. package/dist/disclosure/chevron.js +75 -0
  157. package/dist/disclosure/chevron.js.map +1 -0
  158. package/dist/disclosure/index.js +7 -0
  159. package/dist/disclosure/index.js.map +1 -0
  160. package/dist/drop/index.d.ts +54 -0
  161. package/dist/drop/index.js +161 -0
  162. package/dist/drop/index.js.map +1 -0
  163. package/dist/field/chevron.js +74 -0
  164. package/dist/field/chevron.js.map +1 -0
  165. package/dist/field/index.d.ts +2 -1
  166. package/dist/field/index.js +359 -154
  167. package/dist/field/index.js.map +1 -1
  168. package/dist/field/styles.js +18 -1
  169. package/dist/field/styles.js.map +1 -1
  170. package/dist/files/index.d.ts +18 -0
  171. package/dist/files/index.js +107 -0
  172. package/dist/files/index.js.map +1 -0
  173. package/dist/form/index.d.ts +5 -2
  174. package/dist/form/index.js +64 -85
  175. package/dist/form/index.js.map +1 -1
  176. package/dist/glyphs/index.js +128 -1
  177. package/dist/glyphs/index.js.map +1 -1
  178. package/dist/i18n/index.js +36 -1
  179. package/dist/i18n/index.js.map +1 -1
  180. package/dist/i18n/messages.js +1734 -34
  181. package/dist/i18n/messages.js.map +1 -1
  182. package/dist/index.d.ts +37 -3
  183. package/dist/index.js +36 -3
  184. package/dist/indicator/paths.js +23 -1
  185. package/dist/indicator/paths.js.map +1 -1
  186. package/dist/modal/index.js +92 -77
  187. package/dist/modal/index.js.map +1 -1
  188. package/dist/number/keyboard.js +16 -0
  189. package/dist/number/keyboard.js.map +1 -0
  190. package/dist/overlay/anchored.js +68 -38
  191. package/dist/overlay/anchored.js.map +1 -1
  192. package/dist/overlay/keyboard.js +57 -0
  193. package/dist/overlay/keyboard.js.map +1 -0
  194. package/dist/overlay/panel.js +173 -19
  195. package/dist/overlay/panel.js.map +1 -1
  196. package/dist/overlay/placement.js +13 -1
  197. package/dist/overlay/placement.js.map +1 -1
  198. package/dist/picker/index.js +322 -0
  199. package/dist/picker/index.js.map +1 -0
  200. package/dist/press/index.d.ts +2 -0
  201. package/dist/press/index.js +102 -100
  202. package/dist/press/index.js.map +1 -1
  203. package/dist/row/index.js +77 -69
  204. package/dist/row/index.js.map +1 -1
  205. package/dist/row/styles.js +13 -2
  206. package/dist/row/styles.js.map +1 -1
  207. package/dist/segments/field.js +277 -0
  208. package/dist/segments/field.js.map +1 -0
  209. package/dist/segments/index.js +574 -0
  210. package/dist/segments/index.js.map +1 -0
  211. package/dist/segments/styles.js +24 -0
  212. package/dist/segments/styles.js.map +1 -0
  213. package/dist/slider/index.js +145 -0
  214. package/dist/slider/index.js.map +1 -0
  215. package/dist/swatch/index.js +56 -0
  216. package/dist/swatch/index.js.map +1 -0
  217. package/package.json +11 -2
@@ -1 +1 @@
1
- {"version":3,"file":"placement.js","names":["Edge","OverlayAlign","OverlaySide","Placement","maxHeight","side","x","y","PlacementInput","align","alignOffset","anchor","Rect","bounds","rtl","sideOffset","surface","Size","height","width","OPPOSITE","bottom","left","right","top","const","Record","along","start","length","size","edge","offset","lined","Math","min","max","boundsOf","window","insets","padding","edgeOf","inline","fromRight","isVertical","place","preferred","room","on","spaceOn","opposite","within","position"],"sources":["../../src/overlay/placement.ts"],"sourcesContent":["// Which end of the anchor the surface lines up with, along the side.\ntype Edge = 'center' | 'far' | 'near'\n\n/** Where along that side it lines up with the anchor. */\ntype OverlayAlign = 'center' | 'end' | 'start'\n\n/** Which side of the anchor a surface opens on. */\ntype OverlaySide = 'bottom' | 'left' | 'right' | 'top'\n\n/** Where an anchored surface sits, in the coordinates its inputs were in. */\ntype Placement = {\n /**\n * The height the surface may take before it would pass the edge of the\n * bounds on the side it opened on. A surface taller than this scrolls.\n */\n readonly maxHeight: number\n /** The side it opened on, which is the opposite one after a flip. */\n readonly side: OverlaySide\n readonly x: number\n readonly y: number\n}\n\ntype PlacementInput = {\n readonly align: OverlayAlign\n /** Moves the surface along the side, in dp: right or down when positive. */\n readonly alignOffset: number\n readonly anchor: Rect\n /** The area the surface stays inside, padding already taken off. */\n readonly bounds: Rect\n /** Whether `start` and `end` read from the right, on `top` and `bottom`. */\n readonly rtl: boolean\n readonly side: OverlaySide\n /** The gap between the anchor and the surface, in dp. */\n readonly sideOffset: number\n readonly surface: Size\n}\n\ntype Rect = Size & { readonly x: number; readonly y: number }\n\ntype Size = { readonly height: number; readonly width: number }\n\nconst OPPOSITE = {\n bottom: 'top',\n left: 'right',\n right: 'left',\n top: 'bottom',\n} as const satisfies Record<OverlaySide, OverlaySide>\n\n/**\n * Where a surface of a given length starts along the anchor, for an edge,\n * moved by the offset. However far the offset moves it, it keeps overlapping\n * the anchor, as React Aria's placement does on web.\n */\nfunction along(\n start: number,\n length: number,\n size: number,\n edge: Edge,\n offset: number,\n) {\n const lined =\n edge === 'near'\n ? start\n : edge === 'far'\n ? start + length - size\n : start + (length - size) / 2\n\n return Math.min(Math.max(lined + offset, start - size), start + length)\n}\n\n/**\n * Bounds a surface stays inside: the window, less the safe area's insets and\n * a padding on every side.\n */\nfunction boundsOf(\n window: Size,\n insets: { bottom: number; left: number; right: number; top: number },\n padding: number,\n): Rect {\n return {\n height: window.height - insets.top - insets.bottom - padding * 2,\n width: window.width - insets.left - insets.right - padding * 2,\n x: insets.left + padding,\n y: insets.top + padding,\n }\n}\n\n// Which end of the anchor an alignment names. On `top` and `bottom` the\n// surface lines up along the inline axis, so `start` is the left edge, or the\n// right one in a right-to-left layout; on `left` and `right` it lines up along\n// the block axis, where `start` is the top edge in both.\n//\n// `rtl` is read for its truth rather than compared with a boolean: it comes\n// from `I18nManager.isRTL`, which React Native Web leaves undefined, and an\n// equality with undefined put every `end` at the start there.\nfunction edgeOf(align: OverlayAlign, inline: boolean, rtl: boolean): Edge {\n if (align === 'center') {\n return 'center'\n }\n\n const fromRight = inline && rtl\n\n if (align === 'start') {\n return fromRight ? 'far' : 'near'\n }\n\n return fromRight ? 'near' : 'far'\n}\n\nfunction isVertical(side: OverlaySide) {\n return side === 'bottom' || side === 'top'\n}\n\n/**\n * Places a surface beside its anchor, as React Aria places a popover on web.\n *\n * It opens on `side`, lined up along it by `align`, and flips to the opposite\n * side when it does not fit and that side has more room. Along the side it is\n * shifted to stay inside the bounds; across it, on `top` and `bottom`, it\n * stays inside them through `maxHeight`, and on `left` and `right`, where a\n * surface wider than both sides has nowhere to go, it is shifted over the\n * anchor rather than past the edge.\n */\nfunction place({\n align,\n alignOffset,\n anchor,\n bounds,\n rtl,\n side: preferred,\n sideOffset,\n surface,\n}: PlacementInput): Placement {\n const room = (on: OverlaySide) => spaceOn(on, anchor, bounds, sideOffset)\n const opposite = OPPOSITE[preferred]\n const length = isVertical(preferred) ? surface.height : surface.width\n const side =\n length > room(preferred) && room(opposite) > room(preferred)\n ? opposite\n : preferred\n\n if (isVertical(side)) {\n const maxHeight = Math.max(0, room(side))\n const height = Math.min(surface.height, maxHeight)\n const x = along(\n anchor.x,\n anchor.width,\n surface.width,\n edgeOf(align, true, rtl),\n alignOffset,\n )\n\n return {\n maxHeight,\n side,\n x: within(x, bounds.x, bounds.width, surface.width),\n y:\n side === 'bottom'\n ? anchor.y + anchor.height + sideOffset\n : anchor.y - sideOffset - height,\n }\n }\n\n const maxHeight = Math.max(0, bounds.height)\n const height = Math.min(surface.height, maxHeight)\n const x =\n side === 'right'\n ? anchor.x + anchor.width + sideOffset\n : anchor.x - sideOffset - surface.width\n const y = along(\n anchor.y,\n anchor.height,\n height,\n edgeOf(align, false, rtl),\n alignOffset,\n )\n\n return {\n maxHeight,\n side,\n x: within(x, bounds.x, bounds.width, surface.width),\n y: within(y, bounds.y, bounds.height, height),\n }\n}\n\n// The room between the anchor and the edge of the bounds on a side, less the\n// gap the surface keeps from the anchor.\nfunction spaceOn(\n side: OverlaySide,\n anchor: Rect,\n bounds: Rect,\n sideOffset: number,\n) {\n const room = {\n bottom: bounds.y + bounds.height - anchor.y - anchor.height,\n left: anchor.x - bounds.x,\n right: bounds.x + bounds.width - anchor.x - anchor.width,\n top: anchor.y - bounds.y,\n }\n\n return room[side] - sideOffset\n}\n\n// Shifts a surface along an axis until it is inside the bounds, or, when it is\n// longer than they are, until it starts where they start.\nfunction within(position: number, start: number, length: number, size: number) {\n if (position < start) {\n return start\n }\n\n if (position + size > start + length) {\n return Math.max(start + length - size, start)\n }\n\n return position\n}\n\nexport type { OverlayAlign, OverlaySide, Placement, PlacementInput, Rect, Size }\n\nexport { boundsOf, place }\n"],"mappings":";AAyCA,MAAM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AWxB,OACb,OAAOA;CAGT,IAAIwB,WAAWtB,OAAOF,QAAQC,QAC5B,OAAOK,KAAKE,IAAIR,QAAQC,SAASC,MAAMF,KAAK;CAG9C,OAAOwB;AACT"}
1
+ {"version":3,"file":"placement.js","names":["Edge","OverlayAlign","OverlaySide","Placement","maxHeight","side","x","y","PlacementInput","align","alignOffset","anchor","Rect","bounds","rtl","sideOffset","surface","Size","height","width","OPPOSITE","bottom","left","right","top","const","Record","aboveKeyboard","keyboardTop","padding","Math","min","max","along","start","length","size","edge","offset","lined","boundsOf","window","insets","edgeOf","inline","fromRight","isVertical","place","preferred","room","on","spaceOn","opposite","within","position"],"sources":["../../src/overlay/placement.ts"],"sourcesContent":["// Which end of the anchor the surface lines up with, along the side.\ntype Edge = 'center' | 'far' | 'near'\n\n/** Where along that side it lines up with the anchor. */\ntype OverlayAlign = 'center' | 'end' | 'start'\n\n/** Which side of the anchor a surface opens on. */\ntype OverlaySide = 'bottom' | 'left' | 'right' | 'top'\n\n/** Where an anchored surface sits, in the coordinates its inputs were in. */\ntype Placement = {\n /**\n * The height the surface may take before it would pass the edge of the\n * bounds on the side it opened on. A surface taller than this scrolls.\n */\n readonly maxHeight: number\n /** The side it opened on, which is the opposite one after a flip. */\n readonly side: OverlaySide\n readonly x: number\n readonly y: number\n}\n\ntype PlacementInput = {\n readonly align: OverlayAlign\n /** Moves the surface along the side, in dp: right or down when positive. */\n readonly alignOffset: number\n readonly anchor: Rect\n /** The area the surface stays inside, padding already taken off. */\n readonly bounds: Rect\n /** Whether `start` and `end` read from the right, on `top` and `bottom`. */\n readonly rtl: boolean\n readonly side: OverlaySide\n /** The gap between the anchor and the surface, in dp. */\n readonly sideOffset: number\n readonly surface: Size\n}\n\ntype Rect = Size & { readonly x: number; readonly y: number }\n\ntype Size = { readonly height: number; readonly width: number }\n\nconst OPPOSITE = {\n bottom: 'top',\n left: 'right',\n right: 'left',\n top: 'bottom',\n} as const satisfies Record<OverlaySide, OverlaySide>\n\n/**\n * Bounds that end above the software keyboard, with the same padding above\n * it, where one is shown: its top edge in the window, or null.\n */\nfunction aboveKeyboard(\n bounds: Rect,\n keyboardTop: null | number,\n padding: number,\n): Rect {\n if (keyboardTop === null) {\n return bounds\n }\n\n const bottom = Math.min(bounds.y + bounds.height, keyboardTop - padding)\n\n return { ...bounds, height: Math.max(0, bottom - bounds.y) }\n}\n\n/**\n * Where a surface of a given length starts along the anchor, for an edge,\n * moved by the offset. However far the offset moves it, it keeps overlapping\n * the anchor, as React Aria's placement does on web.\n */\nfunction along(\n start: number,\n length: number,\n size: number,\n edge: Edge,\n offset: number,\n) {\n const lined =\n edge === 'near'\n ? start\n : edge === 'far'\n ? start + length - size\n : start + (length - size) / 2\n\n return Math.min(Math.max(lined + offset, start - size), start + length)\n}\n\n/**\n * Bounds a surface stays inside: the window, less the safe area's insets and\n * a padding on every side.\n */\nfunction boundsOf(\n window: Size,\n insets: { bottom: number; left: number; right: number; top: number },\n padding: number,\n): Rect {\n return {\n height: window.height - insets.top - insets.bottom - padding * 2,\n width: window.width - insets.left - insets.right - padding * 2,\n x: insets.left + padding,\n y: insets.top + padding,\n }\n}\n\n// Which end of the anchor an alignment names. On `top` and `bottom` the\n// surface lines up along the inline axis, so `start` is the left edge, or the\n// right one in a right-to-left layout; on `left` and `right` it lines up along\n// the block axis, where `start` is the top edge in both.\n//\n// `rtl` is read for its truth rather than compared with a boolean: it comes\n// from `I18nManager.isRTL`, which React Native Web leaves undefined, and an\n// equality with undefined put every `end` at the start there.\nfunction edgeOf(align: OverlayAlign, inline: boolean, rtl: boolean): Edge {\n if (align === 'center') {\n return 'center'\n }\n\n const fromRight = inline && rtl\n\n if (align === 'start') {\n return fromRight ? 'far' : 'near'\n }\n\n return fromRight ? 'near' : 'far'\n}\n\nfunction isVertical(side: OverlaySide) {\n return side === 'bottom' || side === 'top'\n}\n\n/**\n * Places a surface beside its anchor, as React Aria places a popover on web.\n *\n * It opens on `side`, lined up along it by `align`, and flips to the opposite\n * side when it does not fit and that side has more room. Along the side it is\n * shifted to stay inside the bounds; across it, on `top` and `bottom`, it\n * stays inside them through `maxHeight`, and on `left` and `right`, where a\n * surface wider than both sides has nowhere to go, it is shifted over the\n * anchor rather than past the edge.\n */\nfunction place({\n align,\n alignOffset,\n anchor,\n bounds,\n rtl,\n side: preferred,\n sideOffset,\n surface,\n}: PlacementInput): Placement {\n const room = (on: OverlaySide) => spaceOn(on, anchor, bounds, sideOffset)\n const opposite = OPPOSITE[preferred]\n const length = isVertical(preferred) ? surface.height : surface.width\n const side =\n length > room(preferred) && room(opposite) > room(preferred)\n ? opposite\n : preferred\n\n if (isVertical(side)) {\n const maxHeight = Math.max(0, room(side))\n const height = Math.min(surface.height, maxHeight)\n const x = along(\n anchor.x,\n anchor.width,\n surface.width,\n edgeOf(align, true, rtl),\n alignOffset,\n )\n\n return {\n maxHeight,\n side,\n x: within(x, bounds.x, bounds.width, surface.width),\n y:\n side === 'bottom'\n ? anchor.y + anchor.height + sideOffset\n : anchor.y - sideOffset - height,\n }\n }\n\n const maxHeight = Math.max(0, bounds.height)\n const height = Math.min(surface.height, maxHeight)\n const x =\n side === 'right'\n ? anchor.x + anchor.width + sideOffset\n : anchor.x - sideOffset - surface.width\n const y = along(\n anchor.y,\n anchor.height,\n height,\n edgeOf(align, false, rtl),\n alignOffset,\n )\n\n return {\n maxHeight,\n side,\n x: within(x, bounds.x, bounds.width, surface.width),\n y: within(y, bounds.y, bounds.height, height),\n }\n}\n\n// The room between the anchor and the edge of the bounds on a side, less the\n// gap the surface keeps from the anchor.\nfunction spaceOn(\n side: OverlaySide,\n anchor: Rect,\n bounds: Rect,\n sideOffset: number,\n) {\n const room = {\n bottom: bounds.y + bounds.height - anchor.y - anchor.height,\n left: anchor.x - bounds.x,\n right: bounds.x + bounds.width - anchor.x - anchor.width,\n top: anchor.y - bounds.y,\n }\n\n return room[side] - sideOffset\n}\n\n// Shifts a surface along an axis until it is inside the bounds, or, when it is\n// longer than they are, until it starts where they start.\nfunction within(position: number, start: number, length: number, size: number) {\n if (position < start) {\n return start\n }\n\n if (position + size > start + length) {\n return Math.max(start + length - size, start)\n }\n\n return position\n}\n\nexport type { OverlayAlign, OverlaySide, Placement, PlacementInput, Rect, Size }\n\nexport { aboveKeyboard, boundsOf, place }\n"],"mappings":";AAyCA,MAAMoB,WAAW;CACfC,QAAQ;CACRC,MAAM;CACNC,OAAO;CACPC,KAAK;AACP;;;;;AAMA,SAASG,cACPd,QACAe,aACAC,SACM;CACN,IAAID,gBAAgB,MAClB,OAAOf;CAGT,MAAMQ,SAASS,KAAKC,IAAIlB,OAAON,IAAIM,OAAOK,QAAQU,cAAcC,OAAO;CAEvE,OAAO;EAAE,GAAGhB;EAAQK,QAAQY,KAAKE,IAAI,GAAGX,SAASR,OAAON,CAAC;CAAE;AAC7D;;;;;;AAOA,SAAS0B,MACPC,OACAC,QACAC,MACAC,MACAC,QACA;CACA,MAAMC,QACJF,SAAS,SACLH,QACAG,SAAS,QACPH,QAAQC,SAASC,OACjBF,SAASC,SAASC,QAAQ;CAElC,OAAON,KAAKC,IAAID,KAAKE,IAAIO,QAAQD,QAAQJ,QAAQE,IAAI,GAAGF,QAAQC,MAAM;AACxE;;;;;AAMA,SAASK,SACPC,QACAC,QACAb,SACM;CACN,OAAO;EACLX,QAAQuB,OAAOvB,SAASwB,OAAOlB,MAAMkB,OAAOrB,SAASQ,UAAU;EAC/DV,OAAOsB,OAAOtB,QAAQuB,OAAOpB,OAAOoB,OAAOnB,QAAQM,UAAU;EAC7DvB,GAAGoC,OAAOpB,OAAOO;EACjBtB,GAAGmC,OAAOlB,MAAMK;CAClB;AACF;AAUA,SAASc,OAAOlC,OAAqBmC,QAAiB9B,KAAoB;CACxE,IAAIL,UAAU,UACZ,OAAO;CAGT,MAAMoC,YAAYD,UAAU9B;CAE5B,IAAIL,UAAU,SACZ,OAAOoC,YAAY,QAAQ;CAG7B,OAAOA,YAAY,SAAS;AAC9B;AAEA,SAASC,WAAWzC,MAAmB;CACrC,OA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,GAAG8C,OAAO9C,GAAGM,OAAON,GAAGM,OAAOK,QAAQA,MAAM;CAC9C;AACF;AAIA,SAASiC,QACP9C,MACAM,QACAE,QACAE,YACA;CAQA,OAAOkC;EANL5B,QAAQR,OAAON,IAAIM,OAAOK,SAASP,OAAOJ,IAAII,OAAOO;EACrDI,MAAMX,OAAOL,IAAIO,OAAOP;EACxBiB,OAAOV,OAAOP,IAAIO,OAAOM,QAAQR,OAAOL,IAAIK,OAAOQ;EACnDK,KAAKb,OAAOJ,IAAIM,OAAON;CAGlB0C,EAAK5C,QAAQU;AACtB;AAIA,SAASsC,OAAOC,UAAkBpB,OAAeC,QAAgBC,MAAc;CAC7E,IAAIkB,WAAWpB,OACb,OAAOA;CAGT,IAAIoB,WAAWlB,OAAOF,QAAQC,QAC5B,OAAOL,KAAKE,IAAIE,QAAQC,SAASC,MAAMF,KAAK;CAG9C,OAAOoB;AACT"}
@@ -0,0 +1,322 @@
1
+ import { useTheme } from "../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../theme/styles.js";
3
+ import { CalendarGlyph } from "../glyphs/index.js";
4
+ import { IconButton } from "../components/icon-button/index.js";
5
+ import { useWindowSizeClass } from "../hooks/useWindowSizeClass.js";
6
+ import { DismissLayer, PANEL_ORIGINS, useBackToClose, usePanelShown, usePanelStyle, useReturnFocus } from "../overlay/panel.js";
7
+ import { CalendarFocusContext } from "../calendar/index.js";
8
+ import { Overlay } from "../overlay/host.js";
9
+ import { useAnchoredPlacement } from "../overlay/anchored.js";
10
+ import { ModalWindow, NO_INSETS, insetsOf, panelRoleOf } from "../modal/index.js";
11
+ import { c } from "react/compiler-runtime";
12
+ import { AccessibilityInfo, Platform, StyleSheet, View } from "react-native";
13
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
14
+ import { SafeAreaInsetsContext } from "react-native-safe-area-context";
15
+ import { use, useEffect, useEffectEvent, useState } from "react";
16
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
+ //#region src/picker/index.tsx
18
+ const stylesOf = themedStyles(({ colors, radii, shadows }) => StyleSheet.create({
19
+ layout: {
20
+ alignItems: "center",
21
+ bottom: 0,
22
+ justifyContent: "center",
23
+ left: 0,
24
+ pointerEvents: "box-none",
25
+ position: "absolute",
26
+ right: 0,
27
+ top: 0
28
+ },
29
+ modal: {
30
+ maxHeight: "100%",
31
+ maxWidth: "100%",
32
+ transformOrigin: "center"
33
+ },
34
+ surface: {
35
+ backgroundColor: colors.surfaceContainerHigh,
36
+ borderRadius: radii.lg,
37
+ boxShadow: shadows.elevation3,
38
+ overflow: "hidden"
39
+ }
40
+ }));
41
+ function PickerDocked(t0) {
42
+ const $ = c(19);
43
+ const { anchor, children, close, isOpen, label, setPresent } = t0;
44
+ const styles = stylesOf(useTheme());
45
+ let t1;
46
+ if ($[0] !== anchor) {
47
+ t1 = {
48
+ align: "start",
49
+ anchor
50
+ };
51
+ $[0] = anchor;
52
+ $[1] = t1;
53
+ } else t1 = $[1];
54
+ const placement = useAnchoredPlacement(t1);
55
+ const shown = usePanelShown(isOpen, placement.placed, setPresent);
56
+ const motion = usePanelStyle(shown);
57
+ const [panel, setPanel] = useState(null);
58
+ const [cell, setCell] = useState(null);
59
+ useBackToClose(close, isOpen);
60
+ useFocusOnceReady(isOpen && placement.placed, cell ?? panel);
61
+ let t2;
62
+ if ($[2] !== close || $[3] !== isOpen) {
63
+ t2 = isOpen ? /* @__PURE__ */ jsx(DismissLayer, { onPress: close }) : null;
64
+ $[2] = close;
65
+ $[3] = isOpen;
66
+ $[4] = t2;
67
+ } else t2 = $[4];
68
+ const t3 = Animated;
69
+ const t4 = placement.onLayout;
70
+ const t5 = "dialog";
71
+ const t6 = composeStyles(styles.surface, placement.style, { transformOrigin: PANEL_ORIGINS[placement.side] }, motion);
72
+ let t7;
73
+ if ($[5] !== children || $[6] !== setCell) {
74
+ t7 = /* @__PURE__ */ jsx(CalendarFocusContext, {
75
+ value: setCell,
76
+ children
77
+ });
78
+ $[5] = children;
79
+ $[6] = setCell;
80
+ $[7] = t7;
81
+ } else t7 = $[7];
82
+ let t8;
83
+ if ($[8] !== close || $[9] !== label || $[10] !== placement.onLayout || $[11] !== setPanel || $[12] !== t3.View || $[13] !== t6 || $[14] !== t7) {
84
+ t8 = /* @__PURE__ */ jsx(t3.View, {
85
+ "aria-label": label,
86
+ onAccessibilityEscape: close,
87
+ onLayout: t4,
88
+ ref: setPanel,
89
+ role: t5,
90
+ style: t6,
91
+ children: t7
92
+ });
93
+ $[8] = close;
94
+ $[9] = label;
95
+ $[10] = placement.onLayout;
96
+ $[11] = setPanel;
97
+ $[12] = t3.View;
98
+ $[13] = t6;
99
+ $[14] = t7;
100
+ $[15] = t8;
101
+ } else t8 = $[15];
102
+ let t9;
103
+ if ($[16] !== t2 || $[17] !== t8) {
104
+ t9 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t2, t8] });
105
+ $[16] = t2;
106
+ $[17] = t8;
107
+ $[18] = t9;
108
+ } else t9 = $[18];
109
+ return t9;
110
+ }
111
+ function PickerModal(t0) {
112
+ const $ = c(25);
113
+ const { children, close, isOpen, label, setPresent } = t0;
114
+ const theme = useTheme();
115
+ const { spacing } = theme;
116
+ const styles = stylesOf(theme);
117
+ const insets = use(SafeAreaInsetsContext) ?? NO_INSETS;
118
+ const shown = usePanelShown(isOpen, true, setPresent);
119
+ const motion = usePanelStyle(shown);
120
+ const scrim = useAnimatedStyle(() => {
121
+ "worklet";
122
+ return { opacity: shown.get() };
123
+ });
124
+ const [panel, setPanel] = useState(null);
125
+ const [cell, setCell] = useState(null);
126
+ const T0 = ModalWindow;
127
+ const t1 = false;
128
+ const t2 = void 0;
129
+ const t3 = isOpen ? close : void 0;
130
+ const t4 = cell ?? panel;
131
+ const T1 = View;
132
+ const t5 = composeStyles(styles.layout, insetsOf(roomOf(insets, spacing.lg)));
133
+ const t6 = Animated;
134
+ let t7;
135
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
136
+ t7 = panelRoleOf("dialog", void 0);
137
+ $[0] = t7;
138
+ } else t7 = $[0];
139
+ const t8 = Platform.OS === "web" ? void 0 : label;
140
+ const t9 = composeStyles(styles.surface, styles.modal, motion);
141
+ let t10;
142
+ if ($[1] !== children || $[2] !== setCell) {
143
+ t10 = /* @__PURE__ */ jsx(CalendarFocusContext, {
144
+ value: setCell,
145
+ children
146
+ });
147
+ $[1] = children;
148
+ $[2] = setCell;
149
+ $[3] = t10;
150
+ } else t10 = $[3];
151
+ let t11;
152
+ if ($[4] !== close || $[5] !== setPanel || $[6] !== t10 || $[7] !== t6.View || $[8] !== t7 || $[9] !== t8 || $[10] !== t9) {
153
+ t11 = /* @__PURE__ */ jsx(t6.View, {
154
+ ...t7,
155
+ "aria-label": t8,
156
+ onAccessibilityEscape: close,
157
+ ref: setPanel,
158
+ style: t9,
159
+ children: t10
160
+ });
161
+ $[4] = close;
162
+ $[5] = setPanel;
163
+ $[6] = t10;
164
+ $[7] = t6.View;
165
+ $[8] = t7;
166
+ $[9] = t8;
167
+ $[10] = t9;
168
+ $[11] = t11;
169
+ } else t11 = $[11];
170
+ let t12;
171
+ if ($[12] !== T1 || $[13] !== t11 || $[14] !== t5) {
172
+ t12 = /* @__PURE__ */ jsx(T1, {
173
+ style: t5,
174
+ children: t11
175
+ });
176
+ $[12] = T1;
177
+ $[13] = t11;
178
+ $[14] = t5;
179
+ $[15] = t12;
180
+ } else t12 = $[15];
181
+ let t13;
182
+ if ($[16] !== T0 || $[17] !== close || $[18] !== label || $[19] !== scrim || $[20] !== t12 || $[21] !== t2 || $[22] !== t3 || $[23] !== t4) {
183
+ t13 = /* @__PURE__ */ jsx(T0, {
184
+ isKeyboardDismissDisabled: t1,
185
+ label,
186
+ labelledBy: t2,
187
+ onClose: close,
188
+ onScrimPress: t3,
189
+ scrim,
190
+ title: t4,
191
+ children: t12
192
+ });
193
+ $[16] = T0;
194
+ $[17] = close;
195
+ $[18] = label;
196
+ $[19] = scrim;
197
+ $[20] = t12;
198
+ $[21] = t2;
199
+ $[22] = t3;
200
+ $[23] = t4;
201
+ $[24] = t13;
202
+ } else t13 = $[24];
203
+ return t13;
204
+ }
205
+ /**
206
+ * The calendar's surface while it is open and while its exit runs: mounted
207
+ * the moment the picker opens, and kept until it has faded out, docked under
208
+ * the field or modal in the middle of the window by the window's size. A
209
+ * screen reader goes back to the trigger once it has gone.
210
+ */
211
+ function PickerPopup(t0) {
212
+ const $ = c(8);
213
+ let props;
214
+ let trigger;
215
+ if ($[0] !== t0) {
216
+ ({trigger, ...props} = t0);
217
+ $[0] = t0;
218
+ $[1] = props;
219
+ $[2] = trigger;
220
+ } else {
221
+ props = $[1];
222
+ trigger = $[2];
223
+ }
224
+ const [present, setPresent] = useState(props.isOpen);
225
+ const modal = useWindowSizeClass() === "compact";
226
+ if (props.isOpen && !present) setPresent(true);
227
+ let t1;
228
+ if ($[3] !== trigger) {
229
+ t1 = { current: trigger };
230
+ $[3] = trigger;
231
+ $[4] = t1;
232
+ } else t1 = $[4];
233
+ useReturnFocus(present, false, t1);
234
+ if (!present) return null;
235
+ let t2;
236
+ if ($[5] !== modal || $[6] !== props) {
237
+ t2 = modal ? /* @__PURE__ */ jsx(PickerModal, {
238
+ ...props,
239
+ setPresent
240
+ }) : /* @__PURE__ */ jsx(Overlay, { children: /* @__PURE__ */ jsx(PickerDocked, {
241
+ ...props,
242
+ setPresent
243
+ }) });
244
+ $[5] = modal;
245
+ $[6] = props;
246
+ $[7] = t2;
247
+ } else t2 = $[7];
248
+ return t2;
249
+ }
250
+ /**
251
+ * The button in the field's trailing slot that opens the calendar: the icon
252
+ * buttons page's 40dp standard button holding the calendar icon, reporting
253
+ * whether the calendar is open. A disabled or read-only field disables it,
254
+ * since neither takes a date from the calendar either.
255
+ */
256
+ function PickerTrigger(t0) {
257
+ const $ = c(7);
258
+ const { isDisabled, isOpen, label, onPress, ref } = t0;
259
+ let t1;
260
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
261
+ t1 = /* @__PURE__ */ jsx(CalendarGlyph, {});
262
+ $[0] = t1;
263
+ } else t1 = $[0];
264
+ let t2;
265
+ if ($[1] !== isDisabled || $[2] !== isOpen || $[3] !== label || $[4] !== onPress || $[5] !== ref) {
266
+ t2 = /* @__PURE__ */ jsx(IconButton, {
267
+ "aria-expanded": isOpen,
268
+ "aria-label": label,
269
+ isDisabled,
270
+ onPress,
271
+ ref,
272
+ children: t1
273
+ });
274
+ $[1] = isDisabled;
275
+ $[2] = isOpen;
276
+ $[3] = label;
277
+ $[4] = onPress;
278
+ $[5] = ref;
279
+ $[6] = t2;
280
+ } else t2 = $[6];
281
+ return t2;
282
+ }
283
+ function roomOf(insets, room) {
284
+ return {
285
+ bottom: insets.bottom + room,
286
+ left: insets.left + room,
287
+ right: insets.right + room,
288
+ top: insets.top + room
289
+ };
290
+ }
291
+ function useFocusOnceReady(ready, target) {
292
+ const $ = c(7);
293
+ let t0;
294
+ if ($[0] !== target) {
295
+ t0 = () => {
296
+ if (target !== null && Platform.OS !== "web") AccessibilityInfo.sendAccessibilityEvent(target, "focus");
297
+ };
298
+ $[0] = target;
299
+ $[1] = t0;
300
+ } else t0 = $[1];
301
+ const sendFocus = useEffectEvent(t0);
302
+ let t1;
303
+ if ($[2] !== ready || $[3] !== sendFocus) {
304
+ t1 = () => {
305
+ if (ready) sendFocus();
306
+ };
307
+ $[2] = ready;
308
+ $[3] = sendFocus;
309
+ $[4] = t1;
310
+ } else t1 = $[4];
311
+ let t2;
312
+ if ($[5] !== ready) {
313
+ t2 = [ready];
314
+ $[5] = ready;
315
+ $[6] = t2;
316
+ } else t2 = $[6];
317
+ useEffect(t1, t2);
318
+ }
319
+ //#endregion
320
+ export { PickerPopup, PickerTrigger, roomOf };
321
+
322
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","HostInstance","View","ViewStyle","AnimatedStyle","EdgeInsets","use","useEffect","useEffectEvent","useState","AccessibilityInfo","NativeView","Platform","StyleSheet","Animated","useAnimatedStyle","SafeAreaInsetsContext","ResolvedTheme","CalendarFocusContext","IconButton","CalendarGlyph","useWindowSizeClass","insetsOf","ModalWindow","NO_INSETS","panelRoleOf","Overlay","useAnchoredPlacement","DismissLayer","PANEL_ORIGINS","useBackToClose","usePanelShown","usePanelStyle","useReturnFocus","useTheme","composeStyles","themedStyles","PickerPopupProps","anchor","children","close","isOpen","label","trigger","PickerSurfaceProps","Omit","setPresent","present","PickerTriggerProps","isDisabled","onPress","ref","stylesOf","colors","radii","shadows","create","layout","alignItems","bottom","justifyContent","left","pointerEvents","position","right","top","modal","maxHeight","maxWidth","transformOrigin","surface","backgroundColor","surfaceContainerHigh","borderRadius","lg","boxShadow","elevation3","overflow","PickerDocked","t0","$","_c","styles","t1","align","placement","shown","placed","motion","panel","setPanel","cell","setCell","useFocusOnceReady","t2","t3","t4","onLayout","t5","t6","style","side","t7","t8","t9","PickerModal","theme","spacing","insets","scrim","opacity","get","T0","undefined","T1","roomOf","Symbol","for","OS","t10","t11","t12","t13","PickerPopup","props","current","PickerTrigger","room","ready","target","sendAccessibilityEvent","sendFocus","_c","NativeView"],"sources":["../../src/picker/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type { HostInstance, View, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\nimport type { EdgeInsets } from 'react-native-safe-area-context'\n\nimport { use, useEffect, useEffectEvent, useState } from 'react'\nimport {\n AccessibilityInfo,\n View as NativeView,\n Platform,\n StyleSheet,\n} from 'react-native'\nimport Animated, { useAnimatedStyle } from 'react-native-reanimated'\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context'\n\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { CalendarFocusContext } from '../calendar'\nimport { IconButton } from '../components/icon-button'\nimport { CalendarGlyph } from '../glyphs'\nimport { useWindowSizeClass } from '../hooks/useWindowSizeClass'\nimport { insetsOf, ModalWindow, NO_INSETS, panelRoleOf } from '../modal'\nimport { Overlay, useAnchoredPlacement } from '../overlay'\nimport {\n DismissLayer,\n PANEL_ORIGINS,\n useBackToClose,\n usePanelShown,\n usePanelStyle,\n useReturnFocus,\n} from '../overlay/panel'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles, themedStyles } from '../theme/styles'\n\n// What a date picker and a date range picker draw in common: the button in\n// the field's trailing slot that opens the calendar, and the surface the\n// calendar opens on, as kanso-ui's src/styles/picker.ts holds the two for\n// web's pickers. Both pickers put the same two on screen, and a docked\n// picker and a range picker that disagreed about where the modal sits would\n// be two bugs rather than one. Internal: nothing here is exported from the\n// package.\n//\n// **The surface is docked from the medium window size up and modal below\n// it**, the pairing the date pickers page draws: in a compact window the\n// picker is a dialog, centred over the scrim with 16dp of room around it,\n// and from 600dp up it hangs under the field, placed by src/overlay as every\n// anchored panel here is, and flipped above it where the window has no room\n// below. Docked, a 360dp calendar anchored to a field is out of reach on a\n// phone; modal, a centred calendar on a tablet covers a form for no reason.\n//\n// **The surface is the calendar's own fill and corner**, surface container\n// high at the large corner, at the third elevation, the docked and the modal\n// picker's level alike, so the calendar inside it draws no second edge.\n//\n// **It fades and scales in and out** as every anchored panel here does, from\n// the edge facing the field docked and from its own centre modal, and the\n// scrim fades with it, both ways. Under reduced motion both arrive and leave\n// at once.\n//\n// **A screen reader goes to the date the calendar is on as it opens**, the\n// date held or else the one the calendar opens on, as web's focus does,\n// through the calendar's CalendarFocusContext. A surface holding no calendar\n// sends it to the surface itself.\n\ntype PickerPopupProps = {\n /** The field's box, which a docked surface is placed under. */\n readonly anchor: RefObject<HostInstance | null>\n /** The calendar. */\n readonly children?: ReactNode\n readonly close: () => void\n readonly isOpen: boolean\n /** The surface's name, which is the trigger's. */\n readonly label: string\n /** The trigger, which a screen reader goes back to once the surface has gone. */\n readonly trigger: HostInstance | null\n}\n\ntype PickerSurfaceProps = Omit<PickerPopupProps, 'trigger'> & {\n readonly setPresent: (present: boolean) => void\n}\n\ntype PickerTriggerProps = {\n readonly isDisabled: boolean\n /** Whether the calendar is open, which the button reports. */\n readonly isOpen: boolean\n /** The button's name: what opens the calendar, then the field's label. */\n readonly label: string\n readonly onPress: () => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\nconst stylesOf = themedStyles(({ colors, radii, shadows }: ResolvedTheme) =>\n StyleSheet.create({\n // The modal surface's room: centred in the window, its padding 16dp\n // clear of every edge inside the safe area. It takes no touches itself,\n // so a press around the surface reaches the scrim under it.\n layout: {\n alignItems: 'center',\n bottom: 0,\n justifyContent: 'center',\n left: 0,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n // As wide as the calendar, and no wider than the room the layout leaves,\n // which a calendar narrows to.\n modal: {\n maxHeight: '100%',\n maxWidth: '100%',\n transformOrigin: 'center',\n },\n // The page's docked container: the calendar's own fill and corner, at\n // the third elevation, clipping the calendar to the corner.\n surface: {\n backgroundColor: colors.surfaceContainerHigh,\n borderRadius: radii.lg,\n boxShadow: shadows.elevation3,\n overflow: 'hidden',\n },\n }),\n)\n\n// The surface docked under the field, in the overlay host above the screen:\n// placed at the field's start edge, flipped above it at the window's edge,\n// over a layer a press outside it lands on.\nfunction PickerDocked({\n anchor,\n children,\n close,\n isOpen,\n label,\n setPresent,\n}: PickerSurfaceProps) {\n const styles = stylesOf(useTheme())\n const placement = useAnchoredPlacement({ align: 'start', anchor })\n const shown = usePanelShown(isOpen, placement.placed, setPresent)\n const motion = usePanelStyle(shown)\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [cell, setCell] = useState<HostInstance | null>(null)\n\n useBackToClose(close, isOpen)\n useFocusOnceReady(isOpen && placement.placed, cell ?? panel)\n\n return (\n <>\n {isOpen ? <DismissLayer onPress={close} /> : null}\n <Animated.View\n aria-label={label}\n onAccessibilityEscape={close}\n onLayout={placement.onLayout}\n ref={setPanel}\n role=\"dialog\"\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n placement.style,\n { transformOrigin: PANEL_ORIGINS[placement.side] },\n motion,\n )}\n >\n <CalendarFocusContext value={setCell}>{children}</CalendarFocusContext>\n </Animated.View>\n </>\n )\n}\n\n// The surface as the page's modal picker: in a `Modal`, through src/modal,\n// centred over the scrim, which fades with it. A press on the scrim, the back\n// gesture and VoiceOver's escape gesture close it.\nfunction PickerModal({\n children,\n close,\n isOpen,\n label,\n setPresent,\n}: PickerSurfaceProps) {\n const theme = useTheme()\n const { spacing } = theme\n const styles = stylesOf(theme)\n const insets = use(SafeAreaInsetsContext) ?? NO_INSETS\n const shown = usePanelShown(isOpen, true, setPresent)\n const motion = usePanelStyle(shown)\n const scrim = useAnimatedStyle(() => {\n 'worklet'\n return { opacity: shown.get() }\n })\n const [panel, setPanel] = useState<HostInstance | null>(null)\n const [cell, setCell] = useState<HostInstance | null>(null)\n\n return (\n <ModalWindow\n isKeyboardDismissDisabled={false}\n label={label}\n labelledBy={undefined}\n onClose={close}\n onScrimPress={isOpen ? close : undefined}\n scrim={scrim}\n title={cell ?? panel}\n >\n <NativeView\n style={composeStyles<ViewStyle>(\n styles.layout,\n insetsOf(roomOf(insets, spacing.lg)),\n )}\n >\n <Animated.View\n {...panelRoleOf('dialog', undefined)}\n aria-label={Platform.OS === 'web' ? undefined : label}\n onAccessibilityEscape={close}\n ref={setPanel}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.surface,\n styles.modal,\n motion,\n )}\n >\n <CalendarFocusContext value={setCell}>\n {children}\n </CalendarFocusContext>\n </Animated.View>\n </NativeView>\n </ModalWindow>\n )\n}\n\n/**\n * The calendar's surface while it is open and while its exit runs: mounted\n * the moment the picker opens, and kept until it has faded out, docked under\n * the field or modal in the middle of the window by the window's size. A\n * screen reader goes back to the trigger once it has gone.\n */\nfunction PickerPopup({ trigger, ...props }: PickerPopupProps) {\n const [present, setPresent] = useState(props.isOpen)\n const modal = useWindowSizeClass() === 'compact'\n\n // Mounted the moment it opens, and kept until its exit has run.\n if (props.isOpen && !present) {\n setPresent(true)\n }\n\n useReturnFocus(present, false, { current: trigger })\n\n if (!present) {\n return null\n }\n\n return modal ? (\n <PickerModal {...props} setPresent={setPresent} />\n ) : (\n <Overlay>\n <PickerDocked {...props} setPresent={setPresent} />\n </Overlay>\n )\n}\n\n/**\n * The button in the field's trailing slot that opens the calendar: the icon\n * buttons page's 40dp standard button holding the calendar icon, reporting\n * whether the calendar is open. A disabled or read-only field disables it,\n * since neither takes a date from the calendar either.\n */\nfunction PickerTrigger({\n isDisabled,\n isOpen,\n label,\n onPress,\n ref,\n}: PickerTriggerProps) {\n return (\n <IconButton\n aria-expanded={isOpen}\n aria-label={label}\n isDisabled={isDisabled}\n onPress={onPress}\n ref={ref}\n >\n <CalendarGlyph />\n </IconButton>\n )\n}\n\n// The safe area with `room` more on every side, which the modal surface\n// keeps clear of the window's edges.\nfunction roomOf(insets: EdgeInsets, room: number): EdgeInsets {\n return {\n bottom: insets.bottom + room,\n left: insets.left + room,\n right: insets.right + room,\n top: insets.top + room,\n }\n}\n\n// Sends a screen reader to `target` as the docked surface is placed, once\n// each time it opens. The date the calendar is on moves with the month shown\n// and with a date pressed while the surface stays open, and a reader on the\n// next month's button stays there rather than being sent after it.\nfunction useFocusOnceReady(ready: boolean, target: HostInstance | null) {\n const sendFocus = useEffectEvent(() => {\n if (target !== null && Platform.OS !== 'web') {\n AccessibilityInfo.sendAccessibilityEvent(target, 'focus')\n }\n })\n\n useEffect(() => {\n if (ready) {\n sendFocus()\n }\n }, [ready])\n}\n\nexport { PickerPopup, PickerTrigger, roomOf }\nexport type { PickerPopupProps, PickerTriggerProps }\n"],"mappings":";;;;;;;;;;;;;;;;;AA2FA,MAAMuD,WAAWhB,cAAc,EAAEiB,QAAQC,OAAOC,cAC9C1C,WAAW2C,OAAO;CAIhBC,QAAQ;EACNC,YAAY;EACZC,QAAQ;EACRC,gBAAgB;EAChBC,MAAM;EACNC,eAAe;EACfC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;CAGAC,OAAO;EACLC,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