@xaui/native 0.9.1-alpha.93 → 0.9.1-beta.95

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 (238) hide show
  1. package/dist/{chunk-PAQZOD2L.js → chunk-2JFMCW5E.js} +1 -1
  2. package/dist/chunk-2TLPFGGR.cjs +251 -0
  3. package/dist/{chunk-TPYOQSKT.js → chunk-2UNLQRXY.js} +1 -1
  4. package/dist/{chunk-JKDWYNSG.js → chunk-2XEQDQAN.js} +109 -107
  5. package/dist/{chunk-RXEUKYM5.js → chunk-33BA4LVN.js} +1 -1
  6. package/dist/{chunk-ODQHAPQW.js → chunk-4AIIAF6U.js} +24 -22
  7. package/dist/{chunk-QCH7X7O2.cjs → chunk-4LRVB6WR.cjs} +14 -14
  8. package/dist/{chunk-QUSQEYLP.cjs → chunk-53E2E7GS.cjs} +26 -28
  9. package/dist/{chunk-2B6PUYTP.cjs → chunk-55KGHYYU.cjs} +4 -4
  10. package/dist/{chunk-B33OU34Z.cjs → chunk-5O7E73QP.cjs} +12 -12
  11. package/dist/{chunk-FVEMTBU4.js → chunk-5XTF2JDK.js} +2 -2
  12. package/dist/{chunk-V2CEKPJ6.js → chunk-6MVKLRLZ.js} +1 -1
  13. package/dist/{chunk-RSIWSVXI.js → chunk-6NAZ2IHL.js} +1 -1
  14. package/dist/{chunk-LPJ3UBSO.cjs → chunk-6NRWZR7T.cjs} +2 -2
  15. package/dist/{chunk-FXN32S75.cjs → chunk-6SRFQSPR.cjs} +3 -3
  16. package/dist/{chunk-7EVW6O2Q.js → chunk-6W45YHTF.js} +1 -1
  17. package/dist/{chunk-7NQL5DXY.js → chunk-6XY3XAEQ.js} +1 -1
  18. package/dist/{chunk-UEW3GAP5.cjs → chunk-6ZWQDTGQ.cjs} +5 -5
  19. package/dist/{chunk-VMPCXS4S.js → chunk-7OVYYZ7H.js} +22 -20
  20. package/dist/{chunk-CYOUOQXT.cjs → chunk-AHJLQJOE.cjs} +5 -5
  21. package/dist/{chunk-OPLPLFGK.cjs → chunk-AHKKEM3K.cjs} +66 -23
  22. package/dist/{chunk-WIX4SYZI.cjs → chunk-AIHKBSQ5.cjs} +2 -2
  23. package/dist/{chunk-WRZV6ORJ.js → chunk-AYOJXFHR.js} +1 -1
  24. package/dist/{chunk-OD6H7ANY.js → chunk-B5DBFS6M.js} +1 -1
  25. package/dist/{chunk-VQGNLX5C.js → chunk-BYDGJU5A.js} +1 -1
  26. package/dist/{chunk-NVODH2PR.js → chunk-CCTAJXZ3.js} +63 -61
  27. package/dist/{chunk-ORXVXYKC.cjs → chunk-CHGBWFDI.cjs} +63 -26
  28. package/dist/{chunk-WLJPO3AS.cjs → chunk-CZ2NUGUI.cjs} +357 -201
  29. package/dist/{chunk-PYQ2P3M5.cjs → chunk-CZEWWCWG.cjs} +58 -58
  30. package/dist/{chunk-PDSR42YC.cjs → chunk-D22K3NZU.cjs} +3 -3
  31. package/dist/{chunk-TRWZEOCO.js → chunk-DBP5CA5R.js} +2 -2
  32. package/dist/{chunk-QN2D5ZCS.cjs → chunk-DE4RSR7Q.cjs} +3 -3
  33. package/dist/{chunk-FOOXBVOQ.js → chunk-E5E2QA4K.js} +22 -20
  34. package/dist/{chunk-LECYGVIH.js → chunk-EQUD3NHO.js} +50 -48
  35. package/dist/chunk-ERIGD4SE.cjs +686 -0
  36. package/dist/{chunk-62AYYMZP.cjs → chunk-FDYPWVNP.cjs} +3 -3
  37. package/dist/chunk-GN7BWYXP.cjs +627 -0
  38. package/dist/chunk-GWTURY4S.cjs +999 -0
  39. package/dist/{chunk-OW4N2C3M.cjs → chunk-HBYT7B47.cjs} +88 -61
  40. package/dist/{chunk-XWIPLZTD.cjs → chunk-HOV25N3M.cjs} +2 -2
  41. package/dist/{chunk-5MMBEDZG.cjs → chunk-I3XIZWCV.cjs} +29 -29
  42. package/dist/{chunk-EDNCHCIN.cjs → chunk-IAJG7GYE.cjs} +2 -2
  43. package/dist/{chunk-P7OHZCU3.js → chunk-IAWLQN2W.js} +2 -2
  44. package/dist/{chunk-RCSEVEIR.js → chunk-ICVIWXK4.js} +1 -1
  45. package/dist/{chunk-RREJUSAS.cjs → chunk-IMIY34F4.cjs} +3 -3
  46. package/dist/{chunk-ZWS3FQ3J.js → chunk-IUDQG3JI.js} +57 -57
  47. package/dist/{chunk-O6B72H4B.js → chunk-K7VDLVLE.js} +6 -8
  48. package/dist/{chunk-P2CJNTAP.js → chunk-KFB24VYT.js} +22 -20
  49. package/dist/chunk-KHPODIQV.cjs +540 -0
  50. package/dist/{chunk-CBRW53GN.cjs → chunk-KMK6FUTK.cjs} +39 -23
  51. package/dist/{chunk-2AFA5HA2.js → chunk-KQW25RCC.js} +77 -75
  52. package/dist/{chunk-X4CZYJZ6.cjs → chunk-LCGJA37L.cjs} +12 -12
  53. package/dist/{chunk-SUJLTC2K.js → chunk-LPGY2IDX.js} +1 -1
  54. package/dist/{chunk-P5M5URAB.js → chunk-LSZW4G7B.js} +31 -31
  55. package/dist/{chunk-GYEQEF5H.js → chunk-LUPU7FJK.js} +1 -1
  56. package/dist/chunk-MNBEUNC5.cjs +792 -0
  57. package/dist/{chunk-AIND5F7P.js → chunk-MTQGFUW5.js} +29 -29
  58. package/dist/chunk-NGXLJ5ZF.cjs +395 -0
  59. package/dist/{chunk-DYQB54JA.cjs → chunk-NPAGA6SH.cjs} +2 -2
  60. package/dist/{chunk-QELEKXN3.cjs → chunk-OMI2FRCU.cjs} +5 -5
  61. package/dist/{chunk-EBCAPIBD.js → chunk-OX23MW5E.js} +70 -50
  62. package/dist/{chunk-MMFIMQMQ.js → chunk-OZLOYXLW.js} +2 -2
  63. package/dist/{chunk-JBZ7SBRV.cjs → chunk-Q3ZKZ2Y6.cjs} +3 -3
  64. package/dist/{chunk-TCWW7JI2.js → chunk-QT7KLGO3.js} +65 -63
  65. package/dist/{chunk-6RU6GUJP.js → chunk-QZF7RSVV.js} +1 -1
  66. package/dist/{chunk-UYQLW7OD.js → chunk-RAYO2TJL.js} +2 -2
  67. package/dist/{chunk-FRLWG5LM.js → chunk-RFT5MGJC.js} +25 -25
  68. package/dist/chunk-SIOSYITD.cjs +1039 -0
  69. package/dist/{chunk-USIWPESU.js → chunk-SIX5AVXG.js} +1 -1
  70. package/dist/{chunk-52XUGOLD.js → chunk-SX5U5UJQ.js} +3 -3
  71. package/dist/{chunk-GGP2ERSV.js → chunk-T5ES7FOL.js} +1 -1
  72. package/dist/{chunk-MSORLKO7.cjs → chunk-V3C3ATRO.cjs} +2 -2
  73. package/dist/{chunk-BI5ME4QP.cjs → chunk-VBS6VWW4.cjs} +5 -5
  74. package/dist/{chunk-2SHWOFQV.js → chunk-VQ4OTVET.js} +29 -29
  75. package/dist/{chunk-6GQ7UTJ7.cjs → chunk-VXAIFOXL.cjs} +2 -2
  76. package/dist/{chunk-BJVO7DWJ.js → chunk-W4F4NQXM.js} +1 -1
  77. package/dist/{chunk-ZE4IHUUO.cjs → chunk-WNEDQTH6.cjs} +2 -2
  78. package/dist/{chunk-CBXILKQZ.cjs → chunk-WPYJW3WM.cjs} +3 -3
  79. package/dist/{chunk-QHXTO525.js → chunk-WYJHDTU7.js} +1 -1
  80. package/dist/{chunk-PROLOLZ5.cjs → chunk-X22PLAP6.cjs} +2 -2
  81. package/dist/chunk-X6GT4H4I.cjs +662 -0
  82. package/dist/{chunk-RLC3EXMV.js → chunk-XM4IN4Q6.js} +2 -2
  83. package/dist/{chunk-ZKGVOXLQ.js → chunk-XOZMGNVS.js} +1 -1
  84. package/dist/chunk-XXXR2AD3.cjs +94 -0
  85. package/dist/{chunk-JC4YCKKL.js → chunk-YI5D4QZP.js} +22 -20
  86. package/dist/{chunk-AR7667VN.cjs → chunk-YJA7OQQZ.cjs} +4 -4
  87. package/dist/{chunk-PAQD6UUF.cjs → chunk-YJIVPYMG.cjs} +3 -3
  88. package/dist/{chunk-JJYHW4PV.js → chunk-YOPWQHNO.js} +1 -1
  89. package/dist/{chunk-LKRQUQZQ.cjs → chunk-YRANVNJG.cjs} +2 -2
  90. package/dist/chunk-ZDJQ643D.js +62 -0
  91. package/dist/components/accordion/index.cjs +3 -3
  92. package/dist/components/accordion/index.js +2 -2
  93. package/dist/components/agenda-calendar/index.cjs +4 -4
  94. package/dist/components/agenda-calendar/index.js +3 -3
  95. package/dist/components/alert/index.cjs +4 -4
  96. package/dist/components/alert/index.js +3 -3
  97. package/dist/components/autocomplete/index.cjs +3 -3
  98. package/dist/components/autocomplete/index.js +2 -2
  99. package/dist/components/bottom-sheet/index.cjs +3 -3
  100. package/dist/components/bottom-sheet/index.js +2 -2
  101. package/dist/components/button/index.cjs +3 -3
  102. package/dist/components/button/index.js +2 -2
  103. package/dist/components/calendar/index.cjs +3 -3
  104. package/dist/components/calendar/index.js +2 -2
  105. package/dist/components/card/index.cjs +3 -3
  106. package/dist/components/card/index.js +2 -2
  107. package/dist/components/carousel/index.cjs +3 -3
  108. package/dist/components/carousel/index.js +2 -2
  109. package/dist/components/checkbox/index.cjs +3 -3
  110. package/dist/components/checkbox/index.js +2 -2
  111. package/dist/components/chip/index.cjs +4 -4
  112. package/dist/components/chip/index.js +3 -3
  113. package/dist/components/close-button/index.cjs +4 -4
  114. package/dist/components/close-button/index.js +3 -3
  115. package/dist/components/color-picker/index.cjs +6 -6
  116. package/dist/components/color-picker/index.js +5 -5
  117. package/dist/components/combobox/index.cjs +4 -4
  118. package/dist/components/combobox/index.js +3 -3
  119. package/dist/components/date-picker/index.cjs +4 -4
  120. package/dist/components/date-picker/index.js +3 -3
  121. package/dist/components/date-range-picker/index.cjs +6 -6
  122. package/dist/components/date-range-picker/index.js +5 -5
  123. package/dist/components/date-time-picker/date-time-picker-indicator.d.cts +2 -2
  124. package/dist/components/date-time-picker/date-time-picker-indicator.d.ts +2 -2
  125. package/dist/components/date-time-picker/date-time-picker.type.d.cts +3 -2
  126. package/dist/components/date-time-picker/date-time-picker.type.d.ts +3 -2
  127. package/dist/components/date-time-picker/index.cjs +8 -9
  128. package/dist/components/date-time-picker/index.d.cts +1 -1
  129. package/dist/components/date-time-picker/index.d.ts +1 -1
  130. package/dist/components/date-time-picker/index.js +7 -8
  131. package/dist/components/dialog/index.cjs +4 -4
  132. package/dist/components/dialog/index.js +3 -3
  133. package/dist/components/dummy-field/index.cjs +3 -3
  134. package/dist/components/dummy-field/index.js +2 -2
  135. package/dist/components/fab/index.cjs +3 -3
  136. package/dist/components/fab/index.js +2 -2
  137. package/dist/components/flip-card/index.cjs +3 -3
  138. package/dist/components/flip-card/index.js +2 -2
  139. package/dist/components/index.d.cts +0 -1
  140. package/dist/components/index.d.ts +0 -1
  141. package/dist/components/list-box/index.cjs +2 -2
  142. package/dist/components/list-box/index.js +1 -1
  143. package/dist/components/menu/index.cjs +3 -3
  144. package/dist/components/menu/index.js +2 -2
  145. package/dist/components/morph-button/index.cjs +3 -3
  146. package/dist/components/morph-button/index.js +2 -2
  147. package/dist/components/number-field/number-field-increment.d.cts +2 -2
  148. package/dist/components/number-field/number-field-increment.d.ts +2 -2
  149. package/dist/components/number-pad/index.cjs +3 -3
  150. package/dist/components/number-pad/index.js +2 -2
  151. package/dist/components/number-stepper/index.cjs +3 -3
  152. package/dist/components/number-stepper/index.js +2 -2
  153. package/dist/components/pager/index.cjs +2 -2
  154. package/dist/components/pager/index.js +1 -1
  155. package/dist/components/phone-number-field/index.cjs +14 -14
  156. package/dist/components/phone-number-field/index.js +3 -3
  157. package/dist/components/popover/index.cjs +3 -3
  158. package/dist/components/popover/index.js +2 -2
  159. package/dist/components/radio/index.cjs +3 -3
  160. package/dist/components/radio/index.js +2 -2
  161. package/dist/components/range-calendar/index.cjs +4 -4
  162. package/dist/components/range-calendar/index.js +3 -3
  163. package/dist/components/rating/index.cjs +3 -3
  164. package/dist/components/rating/index.js +2 -2
  165. package/dist/components/search-field/index.cjs +4 -4
  166. package/dist/components/search-field/index.js +3 -3
  167. package/dist/components/segment/index.cjs +4 -4
  168. package/dist/components/segment/index.js +2 -2
  169. package/dist/components/select/index.cjs +3 -3
  170. package/dist/components/select/index.js +2 -2
  171. package/dist/components/slider/index.cjs +2 -2
  172. package/dist/components/slider/index.js +1 -1
  173. package/dist/components/snackbar/index.cjs +3 -3
  174. package/dist/components/snackbar/index.js +2 -2
  175. package/dist/components/switch/index.cjs +3 -3
  176. package/dist/components/switch/index.js +2 -2
  177. package/dist/components/table/index.cjs +4 -4
  178. package/dist/components/table/index.js +3 -3
  179. package/dist/components/tabs/index.cjs +4 -4
  180. package/dist/components/tabs/index.js +3 -3
  181. package/dist/components/tag-group/index.cjs +4 -4
  182. package/dist/components/tag-group/index.js +3 -3
  183. package/dist/components/time-picker/index.cjs +4 -5
  184. package/dist/components/time-picker/index.d.cts +1 -1
  185. package/dist/components/time-picker/index.d.ts +1 -1
  186. package/dist/components/time-picker/index.js +3 -4
  187. package/dist/components/time-picker/time-picker-display.d.cts +3 -3
  188. package/dist/components/time-picker/time-picker-display.d.ts +3 -3
  189. package/dist/components/time-picker/time-picker-indicator.d.cts +2 -2
  190. package/dist/components/time-picker/time-picker-indicator.d.ts +2 -2
  191. package/dist/components/time-picker/time-picker.d.cts +1 -1
  192. package/dist/components/time-picker/time-picker.d.ts +1 -1
  193. package/dist/components/time-picker/time-picker.type.d.cts +11 -1
  194. package/dist/components/time-picker/time-picker.type.d.ts +11 -1
  195. package/dist/components/toast/index.cjs +3 -3
  196. package/dist/components/toast/index.js +2 -2
  197. package/dist/components/toggle-button/index.cjs +3 -3
  198. package/dist/components/toggle-button/index.js +2 -2
  199. package/dist/components/wheel-picker/index.cjs +2 -2
  200. package/dist/components/wheel-picker/index.js +1 -1
  201. package/dist/index.cjs +47 -60
  202. package/dist/index.js +50 -63
  203. package/dist/system/index.cjs +3 -3
  204. package/dist/system/index.js +2 -2
  205. package/dist/utils/time.d.cts +29 -0
  206. package/dist/utils/time.d.ts +29 -0
  207. package/package.json +1 -11
  208. package/dist/chunk-3MRCSXGT.js +0 -73
  209. package/dist/chunk-5E6SHYEQ.cjs +0 -631
  210. package/dist/chunk-6JAGPPZU.cjs +0 -788
  211. package/dist/chunk-CEPX7CKM.cjs +0 -365
  212. package/dist/chunk-CHFPFYNV.js +0 -60
  213. package/dist/chunk-ECR6GPJ6.js +0 -198
  214. package/dist/chunk-GBTNFQXN.cjs +0 -33
  215. package/dist/chunk-GZAGWNQM.cjs +0 -719
  216. package/dist/chunk-ILXKBDC6.cjs +0 -209
  217. package/dist/chunk-IPD3IUE2.cjs +0 -640
  218. package/dist/chunk-P2V6PIM7.cjs +0 -478
  219. package/dist/chunk-Q2BWXT55.cjs +0 -1011
  220. package/dist/chunk-UFKSUELU.cjs +0 -453
  221. package/dist/chunk-W4IPOWLY.cjs +0 -198
  222. package/dist/chunk-YSTLHVQV.cjs +0 -73
  223. package/dist/components/time-field/index.cjs +0 -27
  224. package/dist/components/time-field/index.d.cts +0 -52
  225. package/dist/components/time-field/index.d.ts +0 -52
  226. package/dist/components/time-field/index.js +0 -27
  227. package/dist/components/time-field/time-field-field.d.cts +0 -11
  228. package/dist/components/time-field/time-field-field.d.ts +0 -11
  229. package/dist/components/time-field/time-field-period.d.cts +0 -34
  230. package/dist/components/time-field/time-field-period.d.ts +0 -34
  231. package/dist/components/time-field/time-field.context.d.cts +0 -9
  232. package/dist/components/time-field/time-field.context.d.ts +0 -9
  233. package/dist/components/time-field/time-field.d.cts +0 -56
  234. package/dist/components/time-field/time-field.d.ts +0 -56
  235. package/dist/components/time-field/time-field.type.d.cts +0 -72
  236. package/dist/components/time-field/time-field.type.d.ts +0 -72
  237. package/dist/utils/time-mask.d.cts +0 -68
  238. package/dist/utils/time-mask.d.ts +0 -68
@@ -1,1011 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkUEW3GAP5cjs = require('./chunk-UEW3GAP5.cjs');
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
- var _chunkISHMSP6Pcjs = require('./chunk-ISHMSP6P.cjs');
17
-
18
-
19
- var _chunkWFEMJCXOcjs = require('./chunk-WFEMJCXO.cjs');
20
-
21
-
22
- var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
23
-
24
-
25
- var _chunkOW4N2C3Mcjs = require('./chunk-OW4N2C3M.cjs');
26
-
27
-
28
- var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
29
-
30
-
31
-
32
-
33
- var _chunkGSZDN6EZcjs = require('./chunk-GSZDN6EZ.cjs');
34
-
35
-
36
- var _chunkFHNIGHN5cjs = require('./chunk-FHNIGHN5.cjs');
37
-
38
-
39
-
40
- var _chunkSL3V7R2Ycjs = require('./chunk-SL3V7R2Y.cjs');
41
-
42
-
43
-
44
- var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
45
-
46
-
47
- var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
48
-
49
-
50
- var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
51
-
52
- // src/components/agenda-calendar/agenda-calendar-day.tsx
53
- var _react = require('react');
54
- var _reactnative = require('react-native');
55
-
56
- // src/components/agenda-calendar/agenda-calendar.context.ts
57
- var [AgendaCalendarProvider, useAgendaCalendar] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "AgendaCalendar");
58
-
59
- // src/components/agenda-calendar/agenda-calendar-day.tsx
60
- var _jsxruntime = require('react/jsx-runtime');
61
- var AgendaCalendarDay = _react.forwardRef.call(void 0,
62
- function AgendaCalendarDay2({
63
- date,
64
- children,
65
- isDisabled,
66
- accessibilityRole,
67
- accessibilityState,
68
- accessibilityLabel,
69
- style,
70
- onPress,
71
- onPressIn,
72
- onPressOut,
73
- ...props
74
- }, ref) {
75
- const {
76
- dayStyle,
77
- daySelectedStyle,
78
- dayLabelStyle,
79
- dayLabelSelectedStyle,
80
- dayLabelMutedStyle,
81
- dotStyle,
82
- dotSelectedStyle,
83
- value,
84
- locale,
85
- hasEvent,
86
- isDayEnabled,
87
- select
88
- } = useAgendaCalendar();
89
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
90
- const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
91
- const isSelected = value !== void 0 && _chunkISHMSP6Pcjs.isSameDay.call(void 0, date, value);
92
- const disabled = _nullishCoalesce(isDisabled, () => ( !isDayEnabled(date)));
93
- const marked = hasEvent(date);
94
- const handlePress = _react.useCallback.call(void 0,
95
- (event) => {
96
- select(date);
97
- _optionalChain([onPress, 'optionalCall', _2 => _2(event)]);
98
- },
99
- [date, onPress, select]
100
- );
101
- const label = _react.useMemo.call(void 0, () => fullDate(date, locale), [date, locale]);
102
- const content = _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
103
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
104
- _reactnative.Text,
105
- {
106
- style: [
107
- dayLabelStyle,
108
- disabled && dayLabelMutedStyle,
109
- isSelected && dayLabelSelectedStyle
110
- ],
111
- children: date.getDate()
112
- }
113
- ),
114
- marked ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: isSelected ? dotSelectedStyle : dotStyle }) : null
115
- ] })));
116
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
117
- _chunkOW4N2C3Mcjs.PressableFeedback,
118
- {
119
- ref,
120
- isPressed,
121
- isDisabled: disabled,
122
- accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "button")),
123
- accessibilityLabel: _nullishCoalesce(accessibilityLabel, () => ( (marked ? `${label} \u2014 ${MARKED_SUFFIX}` : label))),
124
- accessibilityState: {
125
- disabled,
126
- selected: isSelected,
127
- ...accessibilityState
128
- },
129
- ...rest,
130
- style: [
131
- dayStyle,
132
- isSelected && daySelectedStyle,
133
- styleProps,
134
- typeof style === "function" ? style({ pressed: isPressed }) : style
135
- ],
136
- onPress: handlePress,
137
- onPressIn: press.onPressIn,
138
- onPressOut: press.onPressOut,
139
- children: content
140
- }
141
- );
142
- }
143
- );
144
- AgendaCalendarDay.displayName = "XAUI.AgendaCalendar.Day";
145
- var MARKED_SUFFIX = "has events";
146
- function fullDate(date, locale) {
147
- try {
148
- return new Intl.DateTimeFormat(locale, {
149
- weekday: "long",
150
- day: "numeric",
151
- month: "long",
152
- year: "numeric"
153
- }).format(date);
154
- } catch (e) {
155
- return `${date.getDate()} ${_chunkISHMSP6Pcjs.monthLabel.call(void 0, date, locale)}`;
156
- }
157
- }
158
-
159
- // src/components/agenda-calendar/agenda-calendar-header.tsx
160
-
161
-
162
-
163
- var AgendaCalendarHeader = _react.forwardRef.call(void 0,
164
- function AgendaCalendarHeader2({ children, style, ...props }, ref) {
165
- const { headerStyle, glyph } = useAgendaCalendar();
166
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
167
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.IconContext.Provider, { value: glyph, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [headerStyle, styleProps, style], children }) });
168
- }
169
- );
170
- AgendaCalendarHeader.displayName = "XAUI.AgendaCalendar.Header";
171
-
172
- // src/components/agenda-calendar/agenda-calendar-month-picker.tsx
173
-
174
-
175
- var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
176
-
177
- var AnimatedScrollView = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.ScrollView);
178
- var MIDDLE = 3;
179
- var OPEN_MS = 160;
180
- var AgendaCalendarMonthPicker = _react.forwardRef.call(void 0, function AgendaCalendarMonthPicker2({ format = "short", style, contentContainerStyle, ...props }, ref) {
181
- const {
182
- pickerStyle,
183
- pickerItemStyle,
184
- pickerItemSelectedStyle,
185
- pickerItemLabelStyle,
186
- pickerItemLabelSelectedStyle,
187
- days,
188
- locale,
189
- canGoByMonths,
190
- goToMonthInYear
191
- } = useAgendaCalendar();
192
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
193
- const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0, );
194
- const names = _react.useMemo.call(void 0, () => _chunkISHMSP6Pcjs.monthNames.call(void 0, locale, format), [locale, format]);
195
- const shownMonth = days[MIDDLE].getMonth();
196
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
197
- AnimatedScrollView,
198
- {
199
- ref,
200
- ...rest,
201
- horizontal: true,
202
- style: [pickerStyle, styleProps, style],
203
- contentContainerStyle: [
204
- { alignItems: "center", gap: theme.spacing(2) },
205
- contentContainerStyle
206
- ],
207
- showsHorizontalScrollIndicator: false,
208
- entering: _reactnativereanimated.FadeIn.duration(OPEN_MS),
209
- children: names.map((name, index) => {
210
- const disabled = !canGoByMonths(index - shownMonth);
211
- const isSelected = index === shownMonth;
212
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
213
- _chunkOW4N2C3Mcjs.PressableFeedback,
214
- {
215
- isDisabled: disabled,
216
- accessibilityRole: "button",
217
- accessibilityLabel: name,
218
- accessibilityState: { selected: isSelected, disabled },
219
- style: [
220
- pickerItemStyle,
221
- isSelected && pickerItemSelectedStyle
222
- ],
223
- onPress: () => goToMonthInYear(index),
224
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
225
- _reactnative.Text,
226
- {
227
- numberOfLines: 1,
228
- style: [
229
- pickerItemLabelStyle,
230
- isSelected && pickerItemLabelSelectedStyle
231
- ],
232
- children: name
233
- }
234
- )
235
- },
236
- name
237
- );
238
- })
239
- }
240
- );
241
- });
242
- AgendaCalendarMonthPicker.displayName = "XAUI.AgendaCalendar.MonthPicker";
243
-
244
- // src/components/agenda-calendar/agenda-calendar-nav.tsx
245
-
246
-
247
-
248
- var AgendaCalendarNav = _react.forwardRef.call(void 0,
249
- function AgendaCalendarNav2({ children, style, ...props }, ref) {
250
- const { navStyle } = useAgendaCalendar();
251
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
252
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [navStyle, styleProps, style], children });
253
- }
254
- );
255
- AgendaCalendarNav.displayName = "XAUI.AgendaCalendar.Nav";
256
-
257
- // src/components/agenda-calendar/agenda-calendar-nav-button.tsx
258
-
259
-
260
-
261
- var sheet = _reactnative.StyleSheet.create({
262
- back: { transform: [{ rotate: "90deg" }] },
263
- forward: { transform: [{ rotate: "-90deg" }] }
264
- });
265
- function navButton(step, name, rotation) {
266
- const Component = _react.forwardRef.call(void 0,
267
- function NavButton({
268
- children,
269
- step: overrideStep,
270
- accessibilityRole,
271
- accessibilityState,
272
- style,
273
- onPress,
274
- onPressIn,
275
- onPressOut,
276
- ...props
277
- }, ref) {
278
- const { navButtonStyle, page, canPage, isDisabled } = useAgendaCalendar();
279
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
280
- const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
281
- const steps = _nullishCoalesce(overrideStep, () => ( step));
282
- const disabled = isDisabled || !canPage(steps);
283
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
284
- _chunkOW4N2C3Mcjs.PressableFeedback,
285
- {
286
- ref,
287
- isPressed,
288
- isDisabled: disabled,
289
- accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "button")),
290
- accessibilityState: { disabled, ...accessibilityState },
291
- ...rest,
292
- style: [navButtonStyle, styleProps, style],
293
- onPress: (event) => {
294
- _optionalChain([onPress, 'optionalCall', _3 => _3(event)]);
295
- page(steps);
296
- },
297
- onPressIn: press.onPressIn,
298
- onPressOut: press.onPressOut,
299
- children: _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: rotation, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.Icon, { as: _chunkGSZDN6EZcjs.ChevronDownIcon }) })))
300
- }
301
- );
302
- }
303
- );
304
- Component.displayName = name;
305
- return Component;
306
- }
307
- var AgendaCalendarPreviousButton = navButton(
308
- -1,
309
- "XAUI.AgendaCalendar.PreviousButton",
310
- sheet.back
311
- );
312
- var AgendaCalendarNextButton = navButton(
313
- 1,
314
- "XAUI.AgendaCalendar.NextButton",
315
- sheet.forward
316
- );
317
-
318
- // src/components/agenda-calendar/agenda-calendar.tsx
319
-
320
-
321
-
322
- // src/components/agenda-calendar/agenda-calendar.recipe.ts
323
- var SLOTS = [
324
- "root",
325
- "header",
326
- "nav",
327
- "navButton",
328
- "today",
329
- "todayDisabled",
330
- "todayLabel",
331
- "week",
332
- "picker",
333
- "pickerItem"
334
- ];
335
- var VARIANT_TOKENS = {
336
- // One entry, and it is still a table: `resolveTint` only maps roles a variant declared,
337
- // and without one the `color` a caller writes would never reach the pill's word. `fg` is
338
- // `accent` — the word reads as the accent by default and takes the tint when there is
339
- // one; `foreground` here left it plain, and left it `undefined` (RN's black) in dark
340
- // wherever the token failed to resolve.
341
- default: { bg: "default", fg: "accent" }
342
- };
343
- var SIZES = {
344
- sm: { button: 32, today: "xs" },
345
- md: { button: 36, today: "sm" },
346
- lg: { button: 40, today: "md" }
347
- };
348
- function sizeAxis(step) {
349
- const { button, today } = step;
350
- return (theme) => ({
351
- navButton: { width: button, height: button, borderRadius: button / 2 },
352
- // A pill the height of the strip's own cell and a nav button, so the row of months
353
- // sits where the row of days did without the header shifting.
354
- pickerItem: {
355
- height: button,
356
- paddingHorizontal: theme.spacing(3),
357
- borderRadius: button / 2
358
- },
359
- today: {
360
- height: button,
361
- paddingHorizontal: theme.spacing(3),
362
- borderRadius: button / 2
363
- },
364
- todayLabel: {
365
- fontSize: theme.fontSizes[today],
366
- lineHeight: theme.lineHeights[today]
367
- },
368
- // The header is at least a button tall whether or not it holds one, so a card with a
369
- // bare title does not sit shorter than the one beside it.
370
- header: { minHeight: button },
371
- root: { gap: theme.spacing(2) }
372
- });
373
- }
374
- var agendaCalendarRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
375
- slots: SLOTS,
376
- base: (theme) => ({
377
- root: {
378
- width: "100%",
379
- backgroundColor: theme.colors.surface,
380
- borderRadius: theme.radius["2xl"],
381
- padding: theme.spacing(3)
382
- },
383
- header: {
384
- flexDirection: "row",
385
- alignItems: "center",
386
- justifyContent: "space-between",
387
- gap: theme.spacing(2)
388
- },
389
- /** The cluster on the trailing end: back, today, forward. */
390
- nav: { flexDirection: "row", alignItems: "center", gap: theme.spacing(1) },
391
- navButton: { alignItems: "center", justifyContent: "center" },
392
- // A bordered pill rather than a filled one: it sits between two bare chevrons, and a
393
- // filled button there would read as the primary action of the whole card.
394
- today: {
395
- alignItems: "center",
396
- justifyContent: "center",
397
- borderWidth: theme.borderWidth.default,
398
- borderColor: theme.colors.border
399
- },
400
- todayLabel: {
401
- fontFamily: theme.fontFamilies.body,
402
- fontWeight: theme.fontWeights.medium,
403
- color: theme.colors.accent
404
- },
405
- week: { flexDirection: "row" },
406
- // A row that scrolls sideways where the week was. `flexGrow: 0` so the `ScrollView`
407
- // does not eat the height the card gives it; the gap between pills is the
408
- // `contentContainerStyle`'s, which a `ScrollView` refuses on its own style.
409
- picker: { flexGrow: 0 },
410
- pickerItem: { alignItems: "center", justifyContent: "center" },
411
- // The pill goes dead once this week is the one on screen, and that is a **per-button**
412
- // state rather than the recipe's `disabled` — which dims the whole card. Without a look
413
- // of its own it would read as pressable and do nothing, which is the state the button
414
- // exists to avoid on the chevrons beside it.
415
- todayDisabled: { opacity: theme.opacity.disabled }
416
- }),
417
- variantTokens: VARIANT_TOKENS,
418
- // The word is the one thing here a variant colours: the accent by default, the tint when
419
- // a `color` is set. Guarded because a resolve pass with no variant token leaves `fg`
420
- // unset, and spreading `{ color: undefined }` over the base would drop it to RN's black.
421
- paint: (_theme, colors) => colors.fg ? { todayLabel: { color: colors.fg } } : {},
422
- variants: {
423
- size: {
424
- sm: sizeAxis(SIZES.sm),
425
- md: sizeAxis(SIZES.md),
426
- lg: sizeAxis(SIZES.lg)
427
- },
428
- /** The card's own corner, not the chosen day's — that one is the calendar's. */
429
- radius: _chunkSL3V7R2Ycjs.radiusAxis.call(void 0, "root")
430
- },
431
- states: {
432
- disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
433
- },
434
- // `variant: 'default'` so both passes resolve the one token — without it `resolve` runs
435
- // `paint` with no colours and `tint` bails before the word, so a `color` prop never
436
- // reached the pill and dark mode fell through to black.
437
- defaultVariants: { variant: "default", size: "md" }
438
- });
439
-
440
- // src/components/agenda-calendar/agenda-calendar.tsx
441
-
442
- var DAYS_IN_WEEK = 7;
443
- var MONTHS_IN_YEAR = 12;
444
- var DEFAULT_YEAR_SPAN = 50;
445
- var AgendaCalendarRoot = _react.forwardRef.call(void 0,
446
- function AgendaCalendar({
447
- children,
448
- variant,
449
- size = "md",
450
- radius,
451
- color,
452
- value: controlledValue,
453
- defaultValue,
454
- onValueChange,
455
- week: controlledWeek,
456
- defaultWeek,
457
- onWeekChange,
458
- view: controlledView,
459
- defaultView,
460
- onViewChange,
461
- events,
462
- minValue,
463
- maxValue,
464
- firstDayOfWeek,
465
- locale,
466
- isDisabled = false,
467
- asChild = false,
468
- style,
469
- ...props
470
- }, ref) {
471
- const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0, );
472
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
473
- const [value, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
474
- value: controlledValue,
475
- defaultValue,
476
- onChange: onValueChange
477
- });
478
- const [fallbackWeek] = _react.useState.call(void 0, () => _chunkISHMSP6Pcjs.startOfDay.call(void 0, _nullishCoalesce(defaultValue, () => ( /* @__PURE__ */ new Date()))));
479
- const [week, setWeek] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
480
- value: controlledWeek,
481
- defaultValue: _nullishCoalesce(defaultWeek, () => ( fallbackWeek)),
482
- onChange: onWeekChange
483
- });
484
- const [view, setView] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
485
- value: controlledView,
486
- defaultValue: _nullishCoalesce(defaultView, () => ( "week")),
487
- onChange: onViewChange
488
- });
489
- const resolvedLocale = _nullishCoalesce(locale, () => ( deviceLocale()));
490
- const weekStart = _nullishCoalesce(firstDayOfWeek, () => ( _chunkISHMSP6Pcjs.firstDayOfWeekFor.call(void 0, resolvedLocale)));
491
- const cellSelection = { variant, size, radius };
492
- const cells = _chunkUEW3GAP5cjs.calendarRecipe.resolve({
493
- theme,
494
- selection: cellSelection,
495
- states: { disabled: isDisabled }
496
- });
497
- const cellTint = color ? _chunkUEW3GAP5cjs.calendarRecipe.tint({ theme, color, selection: cellSelection }) : void 0;
498
- const selection = { size, radius };
499
- const styles = agendaCalendarRecipe.resolve({
500
- theme,
501
- selection,
502
- states: { disabled: isDisabled }
503
- });
504
- const tint = color ? agendaCalendarRecipe.tint({ theme, color, selection }) : void 0;
505
- const days = _react.useMemo.call(void 0, () => _chunkISHMSP6Pcjs.weekGrid.call(void 0, week, weekStart), [week, weekStart]);
506
- const marked = _react.useMemo.call(void 0, () => {
507
- const keys = /* @__PURE__ */ new Set();
508
- for (const event of _nullishCoalesce(events, () => ( []))) keys.add(_chunkISHMSP6Pcjs.startOfDay.call(void 0, event).getTime());
509
- return keys;
510
- }, [events]);
511
- const bounds = _react.useMemo.call(void 0,
512
- () => ({ min: minValue, max: maxValue }),
513
- [minValue, maxValue]
514
- );
515
- const hasEvent = _react.useCallback.call(void 0,
516
- (date) => marked.has(_chunkISHMSP6Pcjs.startOfDay.call(void 0, date).getTime()),
517
- [marked]
518
- );
519
- const isDayEnabled = _react.useCallback.call(void 0,
520
- (date) => !isDisabled && _chunkISHMSP6Pcjs.isWithinBounds.call(void 0, date, bounds),
521
- [bounds, isDisabled]
522
- );
523
- const select = _react.useCallback.call(void 0,
524
- (date) => {
525
- if (!_chunkISHMSP6Pcjs.isWithinBounds.call(void 0, date, bounds)) return;
526
- setValue(_chunkISHMSP6Pcjs.startOfDay.call(void 0, date));
527
- },
528
- [bounds, setValue]
529
- );
530
- const goByWeeks = _react.useCallback.call(void 0,
531
- (step) => {
532
- if (step === 0) return;
533
- setWeek((current) => _chunkISHMSP6Pcjs.addDays.call(void 0, current, step * DAYS_IN_WEEK));
534
- },
535
- [setWeek]
536
- );
537
- const canGoByWeeks = _react.useCallback.call(void 0,
538
- (step) => {
539
- const target = _chunkISHMSP6Pcjs.weekGrid.call(void 0, _chunkISHMSP6Pcjs.addDays.call(void 0, week, step * DAYS_IN_WEEK), weekStart);
540
- return target.some((day) => _chunkISHMSP6Pcjs.isWithinBounds.call(void 0, day, bounds));
541
- },
542
- [bounds, week, weekStart]
543
- );
544
- const goByMonths = _react.useCallback.call(void 0,
545
- (step) => {
546
- if (step === 0) return;
547
- setWeek((current) => _chunkISHMSP6Pcjs.addMonths.call(void 0, current, step));
548
- },
549
- [setWeek]
550
- );
551
- const canGoByMonths = _react.useCallback.call(void 0,
552
- (step) => {
553
- const target = _chunkISHMSP6Pcjs.weekGrid.call(void 0, _chunkISHMSP6Pcjs.addMonths.call(void 0, week, step), weekStart);
554
- return target.some((day) => _chunkISHMSP6Pcjs.isWithinBounds.call(void 0, day, bounds));
555
- },
556
- [bounds, week, weekStart]
557
- );
558
- const goByYears = _react.useCallback.call(void 0,
559
- (step) => {
560
- if (step === 0) return;
561
- setWeek((current) => _chunkISHMSP6Pcjs.addMonths.call(void 0, current, step * MONTHS_IN_YEAR));
562
- },
563
- [setWeek]
564
- );
565
- const canGoByYears = _react.useCallback.call(void 0,
566
- (step) => {
567
- const target = _chunkISHMSP6Pcjs.weekGrid.call(void 0, _chunkISHMSP6Pcjs.addMonths.call(void 0, week, step * MONTHS_IN_YEAR), weekStart);
568
- return target.some((day) => _chunkISHMSP6Pcjs.isWithinBounds.call(void 0, day, bounds));
569
- },
570
- [bounds, week, weekStart]
571
- );
572
- const page = _react.useCallback.call(void 0,
573
- (step) => {
574
- if (view === "year") goByYears(step);
575
- else if (view === "month") goByMonths(step);
576
- else goByWeeks(step);
577
- },
578
- [view, goByYears, goByMonths, goByWeeks]
579
- );
580
- const canPage = _react.useCallback.call(void 0,
581
- (step) => {
582
- if (view === "year") return canGoByYears(step);
583
- if (view === "month") return canGoByMonths(step);
584
- return canGoByWeeks(step);
585
- },
586
- [view, canGoByYears, canGoByMonths, canGoByWeeks]
587
- );
588
- const goToYear = _react.useCallback.call(void 0,
589
- (year) => {
590
- setWeek(
591
- (current) => _chunkISHMSP6Pcjs.addMonths.call(void 0, current, (year - current.getFullYear()) * MONTHS_IN_YEAR)
592
- );
593
- setView("month");
594
- },
595
- [setWeek, setView]
596
- );
597
- const goToMonthInYear = _react.useCallback.call(void 0,
598
- (monthIndex) => {
599
- setWeek((current) => _chunkISHMSP6Pcjs.addMonths.call(void 0, current, monthIndex - current.getMonth()));
600
- setView("week");
601
- },
602
- [setWeek, setView]
603
- );
604
- const yearRange = _react.useMemo.call(void 0, () => {
605
- const now = (/* @__PURE__ */ new Date()).getFullYear();
606
- return {
607
- first: _nullishCoalesce(_optionalChain([bounds, 'access', _4 => _4.min, 'optionalAccess', _5 => _5.getFullYear, 'call', _6 => _6()]), () => ( now - DEFAULT_YEAR_SPAN)),
608
- last: _nullishCoalesce(_optionalChain([bounds, 'access', _7 => _7.max, 'optionalAccess', _8 => _8.getFullYear, 'call', _9 => _9()]), () => ( now + DEFAULT_YEAR_SPAN))
609
- };
610
- }, [bounds.min, bounds.max]);
611
- const goToToday = _react.useCallback.call(void 0, () => {
612
- const today = _chunkISHMSP6Pcjs.startOfDay.call(void 0, /* @__PURE__ */ new Date());
613
- setWeek(today);
614
- setView("week");
615
- select(today);
616
- }, [setWeek, setView, select]);
617
- const isOnToday = _react.useMemo.call(void 0,
618
- () => _chunkISHMSP6Pcjs.isSameDay.call(void 0, _chunkISHMSP6Pcjs.startOfWeek.call(void 0, week, weekStart), _chunkISHMSP6Pcjs.startOfWeek.call(void 0, /* @__PURE__ */ new Date(), weekStart)),
619
- [week, weekStart]
620
- );
621
- const isTodayResolved = _react.useMemo.call(void 0,
622
- () => view === "week" && isOnToday && value !== void 0 && _chunkISHMSP6Pcjs.isSameDay.call(void 0, value, /* @__PURE__ */ new Date()),
623
- [view, isOnToday, value]
624
- );
625
- const context = _react.useMemo.call(void 0, () => {
626
- const title = _reactnative.StyleSheet.flatten([cells.title]);
627
- const disc = _reactnative.StyleSheet.flatten([
628
- cells.daySelected,
629
- _optionalChain([cellTint, 'optionalAccess', _10 => _10.daySelected])
630
- ]);
631
- return {
632
- headerStyle: styles.header,
633
- navStyle: styles.nav,
634
- navButtonStyle: styles.navButton,
635
- pickerStyle: styles.picker,
636
- pickerItemStyle: styles.pickerItem,
637
- pickerItemSelectedStyle: { backgroundColor: disc.backgroundColor },
638
- pickerItemLabelStyle: cells.dayLabel,
639
- pickerItemLabelSelectedStyle: cellTint ? [cells.dayLabelSelected, cellTint.dayLabelSelected] : cells.dayLabelSelected,
640
- todayStyle: styles.today,
641
- todayDisabledStyle: styles.todayDisabled,
642
- todayLabelStyle: tint ? [styles.todayLabel, tint.todayLabel] : styles.todayLabel,
643
- weekStyle: styles.week,
644
- // The four below are the calendar's own slots, unchanged: same title, same column
645
- // headings, same cell, same mark.
646
- titleStyle: cells.title,
647
- weekdaysStyle: cells.weekdays,
648
- weekdayStyle: cells.weekday,
649
- dayStyle: cells.day,
650
- daySelectedStyle: cellTint ? [cells.daySelected, cellTint.daySelected] : cells.daySelected,
651
- dayLabelStyle: cells.dayLabel,
652
- dayLabelSelectedStyle: cellTint ? [cells.dayLabelSelected, cellTint.dayLabelSelected] : cells.dayLabelSelected,
653
- dayLabelMutedStyle: cells.dayLabelMuted,
654
- dotStyle: cells.dot,
655
- // `dot` first, because the size axis puts the mark's width and corner there and a
656
- // `dotSelected` handed over alone is a coloured node with no size.
657
- dotSelectedStyle: [
658
- cells.dot,
659
- cellTint ? cellTint.dotSelected : cells.dotSelected
660
- ],
661
- glyph: {
662
- size: title.fontSize,
663
- color: typeof title.color === "string" ? title.color : void 0
664
- },
665
- days,
666
- value,
667
- locale: resolvedLocale,
668
- isDisabled,
669
- view,
670
- setView,
671
- hasEvent,
672
- isDayEnabled,
673
- select,
674
- goByWeeks,
675
- canGoByWeeks,
676
- goByMonths,
677
- canGoByMonths,
678
- goByYears,
679
- canGoByYears,
680
- page,
681
- canPage,
682
- goToYear,
683
- goToMonthInYear,
684
- yearRange,
685
- goToToday,
686
- isOnToday,
687
- isTodayResolved
688
- };
689
- }, [
690
- styles,
691
- tint,
692
- cells,
693
- cellTint,
694
- days,
695
- value,
696
- resolvedLocale,
697
- isDisabled,
698
- view,
699
- setView,
700
- hasEvent,
701
- isDayEnabled,
702
- select,
703
- goByWeeks,
704
- canGoByWeeks,
705
- goByMonths,
706
- canGoByMonths,
707
- goByYears,
708
- canGoByYears,
709
- page,
710
- canPage,
711
- goToYear,
712
- goToMonthInYear,
713
- yearRange,
714
- goToToday,
715
- isOnToday,
716
- isTodayResolved
717
- ]);
718
- const rootStyle = [styles.root, styleProps, style];
719
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgendaCalendarProvider, { value: context, children: asChild ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCDRGTUYFcjs.Slot, { ref, ...rest, style: rootStyle, children }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: rootStyle, children }) });
720
- }
721
- );
722
- AgendaCalendarRoot.displayName = "XAUI.AgendaCalendar.Root";
723
- function deviceLocale() {
724
- try {
725
- return new Intl.DateTimeFormat().resolvedOptions().locale;
726
- } catch (e2) {
727
- return "en";
728
- }
729
- }
730
-
731
- // src/components/agenda-calendar/agenda-calendar-title.tsx
732
-
733
-
734
-
735
- var MIDDLE2 = 3;
736
- var AgendaCalendarTitle = _react.forwardRef.call(void 0,
737
- function AgendaCalendarTitle2({ children, accessibilityRole, style, ...props }, ref) {
738
- const { titleStyle, days, locale } = useAgendaCalendar();
739
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
740
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
741
- _reactnative.Text,
742
- {
743
- ref,
744
- accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "header")),
745
- style: [titleStyle, styleProps, style],
746
- ...rest,
747
- children: _nullishCoalesce(children, () => ( _chunkISHMSP6Pcjs.monthLabel.call(void 0, days[MIDDLE2], locale)))
748
- }
749
- );
750
- }
751
- );
752
- AgendaCalendarTitle.displayName = "XAUI.AgendaCalendar.Title";
753
-
754
- // src/components/agenda-calendar/agenda-calendar-today-button.tsx
755
-
756
-
757
-
758
- var AgendaCalendarTodayButton = _react.forwardRef.call(void 0, function AgendaCalendarTodayButton2({
759
- children,
760
- accessibilityRole,
761
- accessibilityState,
762
- style,
763
- onPress,
764
- onPressIn,
765
- onPressOut,
766
- ...props
767
- }, ref) {
768
- const {
769
- todayStyle,
770
- todayDisabledStyle,
771
- todayLabelStyle,
772
- goToToday,
773
- isTodayResolved,
774
- isDisabled
775
- } = useAgendaCalendar();
776
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
777
- const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
778
- const disabled = isDisabled || isTodayResolved;
779
- const text = _chunkFHNIGHN5cjs.childrenToString.call(void 0, children);
780
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
781
- _chunkOW4N2C3Mcjs.PressableFeedback,
782
- {
783
- ref,
784
- isPressed,
785
- isDisabled: disabled,
786
- accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "button")),
787
- accessibilityState: { disabled, ...accessibilityState },
788
- ...rest,
789
- style: [todayStyle, disabled && todayDisabledStyle, styleProps, style],
790
- onPress: (event) => {
791
- _optionalChain([onPress, 'optionalCall', _11 => _11(event)]);
792
- goToToday();
793
- },
794
- onPressIn: press.onPressIn,
795
- onPressOut: press.onPressOut,
796
- children: text !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: todayLabelStyle, children: text }) : children
797
- }
798
- );
799
- });
800
- AgendaCalendarTodayButton.displayName = "XAUI.AgendaCalendar.TodayButton";
801
-
802
- // src/components/agenda-calendar/agenda-calendar-week.tsx
803
-
804
-
805
- var _reactnativegesturehandler = require('react-native-gesture-handler');
806
-
807
-
808
-
809
-
810
-
811
-
812
-
813
- var SWIPE_DISTANCE = 48;
814
- var SWIPE_VELOCITY = 360;
815
- var DRAG_FOLLOW = 0.5;
816
- var SPRING = { damping: 18, stiffness: 220, mass: 0.6 };
817
- var AgendaCalendarWeek = _react.forwardRef.call(void 0,
818
- function AgendaCalendarWeek2({ children, swipeable = true, style, ...props }, ref) {
819
- const { weekStyle, days, goByWeeks, canGoByWeeks, isDisabled } = useAgendaCalendar();
820
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
821
- const drag = _reactnativereanimated.useSharedValue.call(void 0, 0);
822
- const page = _react.useCallback.call(void 0,
823
- (direction) => {
824
- if (canGoByWeeks(direction)) goByWeeks(direction);
825
- },
826
- [canGoByWeeks, goByWeeks]
827
- );
828
- const pan = _reactnativegesturehandler.Gesture.Pan().enabled(swipeable && !isDisabled).activeOffsetX([-12, 12]).failOffsetY([-16, 16]).onUpdate((event) => {
829
- drag.set(event.translationX * DRAG_FOLLOW);
830
- }).onEnd((event) => {
831
- const forward = event.translationX <= -SWIPE_DISTANCE || event.velocityX <= -SWIPE_VELOCITY;
832
- const backward = event.translationX >= SWIPE_DISTANCE || event.velocityX >= SWIPE_VELOCITY;
833
- if (forward) _reactnativereanimated.runOnJS.call(void 0, page)(1);
834
- else if (backward) _reactnativereanimated.runOnJS.call(void 0, page)(-1);
835
- drag.set(_reactnativereanimated.withSpring.call(void 0, 0, SPRING));
836
- }).onFinalize(() => {
837
- drag.set(_reactnativereanimated.withSpring.call(void 0, 0, SPRING));
838
- });
839
- const slide = _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
840
- transform: [{ translateX: drag.get() }]
841
- }));
842
- const cells = days.map((date) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: CELL, children: typeof children === "function" ? children(date) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AgendaCalendarDay, { date }) }, date.getTime()));
843
- if (!swipeable) {
844
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [weekStyle, styleProps, style], children: cells });
845
- }
846
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativegesturehandler.GestureDetector, { gesture: pan, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
847
- _reactnativereanimated2.default.View,
848
- {
849
- ref,
850
- ...rest,
851
- style: [weekStyle, slide, styleProps, style],
852
- children: cells
853
- }
854
- ) });
855
- }
856
- );
857
- AgendaCalendarWeek.displayName = "XAUI.AgendaCalendar.Week";
858
- var CELL = { width: "14.2857%", alignItems: "center" };
859
-
860
- // src/components/agenda-calendar/agenda-calendar-weekdays.tsx
861
-
862
-
863
-
864
- var AgendaCalendarWeekdays = _react.forwardRef.call(void 0,
865
- function AgendaCalendarWeekdays2({ children, style, ...props }, ref) {
866
- const { weekdaysStyle, weekdayStyle, days, locale } = useAgendaCalendar();
867
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
868
- const names = _chunkISHMSP6Pcjs.weekdayNames.call(void 0, locale, days[0].getDay());
869
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
870
- _reactnative.View,
871
- {
872
- ref,
873
- accessibilityElementsHidden: true,
874
- importantForAccessibility: "no-hide-descendants",
875
- ...rest,
876
- style: [weekdaysStyle, styleProps, style],
877
- children: _nullishCoalesce(children, () => ( names.map((name, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: weekdayStyle, children: name }, days[index].getTime()))))
878
- }
879
- );
880
- }
881
- );
882
- AgendaCalendarWeekdays.displayName = "XAUI.AgendaCalendar.Weekdays";
883
-
884
- // src/components/agenda-calendar/agenda-calendar-year-picker.tsx
885
-
886
-
887
-
888
-
889
- var AnimatedScrollView2 = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.ScrollView);
890
- var MIDDLE3 = 3;
891
- var OPEN_MS2 = 160;
892
- var AgendaCalendarYearPicker = _react.forwardRef.call(void 0, function AgendaCalendarYearPicker2({ firstYear, lastYear, style, onLayout, contentContainerStyle, ...props }, ref) {
893
- const {
894
- pickerStyle,
895
- pickerItemStyle,
896
- pickerItemSelectedStyle,
897
- pickerItemLabelStyle,
898
- pickerItemLabelSelectedStyle,
899
- days,
900
- yearRange,
901
- canGoByYears,
902
- goToYear
903
- } = useAgendaCalendar();
904
- const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
905
- const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0, );
906
- const first = _nullishCoalesce(firstYear, () => ( yearRange.first));
907
- const last = _nullishCoalesce(lastYear, () => ( yearRange.last));
908
- const shownYear = days[MIDDLE3].getFullYear();
909
- const years = _react.useMemo.call(void 0,
910
- () => Array.from({ length: last - first + 1 }, (_, index) => first + index),
911
- [first, last]
912
- );
913
- const scroller = _react.useRef.call(void 0, null);
914
- const refs = _chunkWFEMJCXOcjs.useMergedRef.call(void 0, scroller, ref);
915
- const selectedX = _react.useRef.call(void 0, 0);
916
- const [isPlaced, setIsPlaced] = _react.useState.call(void 0, false);
917
- const centre = (viewportWidth) => {
918
- if (isPlaced || viewportWidth === 0) return;
919
- _optionalChain([scroller, 'access', _12 => _12.current, 'optionalAccess', _13 => _13.scrollTo, 'call', _14 => _14({
920
- x: Math.max(0, selectedX.current - viewportWidth / 2),
921
- animated: false
922
- })]);
923
- setIsPlaced(true);
924
- };
925
- const place = (event) => {
926
- _optionalChain([onLayout, 'optionalCall', _15 => _15(event)]);
927
- centre(event.nativeEvent.layout.width);
928
- };
929
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
930
- AnimatedScrollView2,
931
- {
932
- ref: refs,
933
- ...rest,
934
- horizontal: true,
935
- style: [pickerStyle, styleProps, style],
936
- contentContainerStyle: [
937
- { alignItems: "center", gap: theme.spacing(2) },
938
- contentContainerStyle
939
- ],
940
- showsHorizontalScrollIndicator: false,
941
- onLayout: place,
942
- entering: _reactnativereanimated.FadeIn.duration(OPEN_MS2),
943
- children: years.map((year) => {
944
- const disabled = !canGoByYears(year - shownYear);
945
- const isSelected = year === shownYear;
946
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
947
- _chunkOW4N2C3Mcjs.PressableFeedback,
948
- {
949
- isDisabled: disabled,
950
- accessibilityRole: "button",
951
- accessibilityLabel: `${year}`,
952
- accessibilityState: { selected: isSelected, disabled },
953
- style: [
954
- pickerItemStyle,
955
- isSelected && pickerItemSelectedStyle
956
- ],
957
- onLayout: isSelected ? (event) => {
958
- selectedX.current = event.nativeEvent.layout.x;
959
- } : void 0,
960
- onPress: () => goToYear(year),
961
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
962
- _reactnative.Text,
963
- {
964
- style: [
965
- pickerItemLabelStyle,
966
- isSelected && pickerItemLabelSelectedStyle
967
- ],
968
- children: year
969
- }
970
- )
971
- },
972
- year
973
- );
974
- })
975
- }
976
- );
977
- });
978
- AgendaCalendarYearPicker.displayName = "XAUI.AgendaCalendar.YearPicker";
979
-
980
- // src/components/agenda-calendar/index.ts
981
- var AgendaCalendar2 = Object.assign(AgendaCalendarRoot, {
982
- Header: AgendaCalendarHeader,
983
- Title: AgendaCalendarTitle,
984
- Nav: AgendaCalendarNav,
985
- PreviousButton: AgendaCalendarPreviousButton,
986
- NextButton: AgendaCalendarNextButton,
987
- TodayButton: AgendaCalendarTodayButton,
988
- Weekdays: AgendaCalendarWeekdays,
989
- Week: AgendaCalendarWeek,
990
- Day: AgendaCalendarDay,
991
- MonthPicker: AgendaCalendarMonthPicker,
992
- YearPicker: AgendaCalendarYearPicker
993
- });
994
-
995
-
996
-
997
-
998
-
999
-
1000
-
1001
-
1002
-
1003
-
1004
-
1005
-
1006
-
1007
-
1008
-
1009
-
1010
-
1011
- exports.useAgendaCalendar = useAgendaCalendar; exports.AgendaCalendarDay = AgendaCalendarDay; exports.AgendaCalendarHeader = AgendaCalendarHeader; exports.AgendaCalendarMonthPicker = AgendaCalendarMonthPicker; exports.AgendaCalendarNav = AgendaCalendarNav; exports.AgendaCalendarPreviousButton = AgendaCalendarPreviousButton; exports.AgendaCalendarNextButton = AgendaCalendarNextButton; exports.agendaCalendarRecipe = agendaCalendarRecipe; exports.AgendaCalendarRoot = AgendaCalendarRoot; exports.AgendaCalendarTitle = AgendaCalendarTitle; exports.AgendaCalendarTodayButton = AgendaCalendarTodayButton; exports.AgendaCalendarWeek = AgendaCalendarWeek; exports.AgendaCalendarWeekdays = AgendaCalendarWeekdays; exports.AgendaCalendarYearPicker = AgendaCalendarYearPicker; exports.AgendaCalendar = AgendaCalendar2;