@fangxinyan/lumina 0.6.13 → 0.6.15

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 (239) hide show
  1. package/dist/Alert.cjs +3 -3
  2. package/dist/Alert.js +2 -2
  3. package/dist/AppShell.cjs +5 -5
  4. package/dist/AppShell.js +1 -1
  5. package/dist/AutoComplete.cjs +5 -5
  6. package/dist/AutoComplete.js +4 -4
  7. package/dist/Avatar.cjs +2 -2
  8. package/dist/Avatar.js +1 -1
  9. package/dist/Badge.cjs +2 -2
  10. package/dist/Badge.js +1 -1
  11. package/dist/Button.cjs +4 -4
  12. package/dist/Button.js +2 -2
  13. package/dist/{Calendar-RUTPKREW.css → Calendar-I6NHCXIB.css} +65 -0
  14. package/dist/Calendar.cjs +3 -3
  15. package/dist/Calendar.d.cts +2 -0
  16. package/dist/Calendar.d.ts +2 -0
  17. package/dist/Calendar.js +2 -2
  18. package/dist/Card.cjs +3 -3
  19. package/dist/Card.js +2 -2
  20. package/dist/Cascader.cjs +5 -5
  21. package/dist/Cascader.js +4 -4
  22. package/dist/Checkbox.cjs +3 -3
  23. package/dist/Checkbox.js +2 -2
  24. package/dist/Collapse.cjs +3 -3
  25. package/dist/Collapse.js +2 -2
  26. package/dist/ColorPicker.cjs +2 -2
  27. package/dist/ColorPicker.js +1 -1
  28. package/dist/CommandPalette.cjs +5 -5
  29. package/dist/CommandPalette.js +4 -4
  30. package/dist/ContextMenu.cjs +2 -2
  31. package/dist/ContextMenu.js +1 -1
  32. package/dist/DatePicker-VDVSIARF.css +60 -0
  33. package/dist/DatePicker.cjs +16 -0
  34. package/dist/DatePicker.d.cts +49 -0
  35. package/dist/DatePicker.d.ts +49 -0
  36. package/dist/DatePicker.js +7 -0
  37. package/dist/DateTimePicker-77ZLZIWO.css +224 -0
  38. package/dist/DateTimePicker.cjs +16 -0
  39. package/dist/DateTimePicker.d.cts +61 -0
  40. package/dist/DateTimePicker.d.ts +61 -0
  41. package/dist/DateTimePicker.js +7 -0
  42. package/dist/Divider.cjs +2 -2
  43. package/dist/Divider.js +1 -1
  44. package/dist/{Drawer-7N3URAJ6.css → Drawer-7KICRM4L.css} +1 -1
  45. package/dist/Drawer.cjs +3 -3
  46. package/dist/Drawer.d.cts +4 -0
  47. package/dist/Drawer.d.ts +4 -0
  48. package/dist/Drawer.js +2 -2
  49. package/dist/Empty.cjs +2 -2
  50. package/dist/Empty.js +1 -1
  51. package/dist/Form.cjs +4 -4
  52. package/dist/Form.js +1 -1
  53. package/dist/Icon.cjs +49 -49
  54. package/dist/Icon.js +1 -1
  55. package/dist/{Image-SGSRTHQX.css → Image-TDCXJISG.css} +1 -1
  56. package/dist/Image.cjs +6 -6
  57. package/dist/Image.d.cts +4 -0
  58. package/dist/Image.d.ts +4 -0
  59. package/dist/Image.js +2 -2
  60. package/dist/Input.cjs +5 -5
  61. package/dist/Input.js +3 -3
  62. package/dist/InputNumber.cjs +5 -5
  63. package/dist/InputNumber.js +4 -4
  64. package/dist/List.cjs +2 -2
  65. package/dist/List.js +1 -1
  66. package/dist/Message.cjs +6 -6
  67. package/dist/Message.js +2 -2
  68. package/dist/{Modal-MCFDYVUQ.css → Modal-ZFWNFEA5.css} +1 -1
  69. package/dist/Modal.cjs +4 -4
  70. package/dist/Modal.d.cts +4 -0
  71. package/dist/Modal.d.ts +4 -0
  72. package/dist/Modal.js +3 -3
  73. package/dist/Pagination.cjs +7 -7
  74. package/dist/Pagination.js +6 -6
  75. package/dist/Popover.cjs +2 -2
  76. package/dist/Popover.js +1 -1
  77. package/dist/Progress.cjs +2 -2
  78. package/dist/Progress.js +1 -1
  79. package/dist/Radio.cjs +3 -3
  80. package/dist/Radio.js +1 -1
  81. package/dist/Select.cjs +6 -6
  82. package/dist/Select.js +5 -5
  83. package/dist/Skeleton.cjs +2 -2
  84. package/dist/Skeleton.js +1 -1
  85. package/dist/Slider.cjs +2 -2
  86. package/dist/Slider.js +1 -1
  87. package/dist/Spin.cjs +2 -2
  88. package/dist/Spin.js +1 -1
  89. package/dist/Splitter.cjs +2 -2
  90. package/dist/Splitter.js +1 -1
  91. package/dist/StatusBar.cjs +3 -3
  92. package/dist/StatusBar.js +1 -1
  93. package/dist/Surface.cjs +4 -4
  94. package/dist/Surface.js +2 -2
  95. package/dist/Switch.cjs +2 -2
  96. package/dist/Switch.js +1 -1
  97. package/dist/Table.cjs +9 -9
  98. package/dist/Table.js +8 -8
  99. package/dist/TablePro.cjs +10 -10
  100. package/dist/TablePro.js +9 -9
  101. package/dist/Tabs.cjs +2 -2
  102. package/dist/Tabs.js +1 -1
  103. package/dist/Tag.cjs +3 -3
  104. package/dist/Tag.js +2 -2
  105. package/dist/Textarea.cjs +4 -4
  106. package/dist/Textarea.js +2 -2
  107. package/dist/Theme.cjs +11 -11
  108. package/dist/Theme.js +1 -1
  109. package/dist/ThemePanel.cjs +13 -13
  110. package/dist/ThemePanel.js +10 -10
  111. package/dist/TimePicker-6URACYEH.css +151 -0
  112. package/dist/TimePicker.cjs +15 -0
  113. package/dist/TimePicker.d.cts +63 -0
  114. package/dist/TimePicker.d.ts +63 -0
  115. package/dist/TimePicker.js +6 -0
  116. package/dist/Timeline.cjs +3 -3
  117. package/dist/Timeline.js +2 -2
  118. package/dist/Tooltip.cjs +2 -2
  119. package/dist/Tooltip.js +1 -1
  120. package/dist/Typography.cjs +7 -7
  121. package/dist/Typography.js +2 -2
  122. package/dist/{chunk-J7VYTDFN.cjs → chunk-262ED6WQ.cjs} +3 -3
  123. package/dist/chunk-26AJ7OY3.cjs +505 -0
  124. package/dist/{chunk-BX45WJRT.js → chunk-3VSHGM54.js} +9 -9
  125. package/dist/{chunk-KRVWQKTZ.js → chunk-3VXGZ3SJ.js} +3 -3
  126. package/dist/{chunk-VJVXXCNL.js → chunk-4HJBF4GY.js} +3 -3
  127. package/dist/chunk-4KDABJSY.cjs +241 -0
  128. package/dist/{chunk-ONHYDQFP.cjs → chunk-4TTRHEGM.cjs} +3 -3
  129. package/dist/{chunk-GVULVTWO.js → chunk-4YSGGZDB.js} +4 -4
  130. package/dist/{chunk-HNP7KEQP.cjs → chunk-5A6KSYWA.cjs} +1 -1
  131. package/dist/{chunk-RFFP6J6O.cjs → chunk-5ERD3W24.cjs} +4 -4
  132. package/dist/{chunk-TTXYZDQ3.js → chunk-5MOYKVB7.js} +2 -2
  133. package/dist/{chunk-X2NY3YQS.cjs → chunk-5QEI7GGA.cjs} +6 -6
  134. package/dist/{chunk-O7OPFKAM.js → chunk-6HF6UF73.js} +2 -2
  135. package/dist/{chunk-DCATZUT3.js → chunk-6K5YI4ZE.js} +2 -2
  136. package/dist/{chunk-EVKLGNVR.js → chunk-6LC4QROE.js} +3 -3
  137. package/dist/{chunk-6Z4PZWND.js → chunk-6LN4VVX7.js} +2 -2
  138. package/dist/{chunk-7RNT6KN4.js → chunk-6MEOLYNQ.js} +1 -1
  139. package/dist/{chunk-UMLRSKBE.js → chunk-6PHPRZTT.js} +4 -4
  140. package/dist/{chunk-4VPRY4EM.cjs → chunk-6Q76VLCE.cjs} +3 -3
  141. package/dist/{chunk-SWMQ2GKT.cjs → chunk-7IO3EOHN.cjs} +3 -3
  142. package/dist/{chunk-B55XILNY.cjs → chunk-7QXP6DXC.cjs} +4 -4
  143. package/dist/{chunk-56GNNOOT.cjs → chunk-7YJV45U6.cjs} +11 -11
  144. package/dist/{chunk-AJ44ZLJY.cjs → chunk-A4Z7PLHV.cjs} +59 -59
  145. package/dist/{chunk-RUE3QE6T.js → chunk-A6O25EP2.js} +2 -2
  146. package/dist/{chunk-ZNR6LWTQ.js → chunk-AAPZLBHQ.js} +1 -1
  147. package/dist/{chunk-Q4IAUKAW.js → chunk-ARUPS7JH.js} +2 -2
  148. package/dist/{chunk-VAOAAWGI.cjs → chunk-ATUPFAPZ.cjs} +3 -3
  149. package/dist/{chunk-GKBCXYDF.cjs → chunk-BNY2NVTL.cjs} +3 -3
  150. package/dist/{chunk-7J26GI3T.cjs → chunk-BT2RXFT4.cjs} +15 -13
  151. package/dist/{chunk-WY6AEPFW.js → chunk-BVQOJKRX.js} +8 -6
  152. package/dist/{chunk-QPZCDZWI.cjs → chunk-BW76ENTW.cjs} +1 -1
  153. package/dist/{chunk-EKNDL2XB.js → chunk-CFZVWY5N.js} +2 -2
  154. package/dist/chunk-CUBKHQ63.js +483 -0
  155. package/dist/chunk-CYBBUXUK.cjs +415 -0
  156. package/dist/{chunk-JST4HJ3I.js → chunk-D7GK6H6V.js} +1 -1
  157. package/dist/{chunk-T7RV2UMU.js → chunk-DSLYWX4O.js} +1 -1
  158. package/dist/{chunk-JKFGLYMM.js → chunk-EQ4FPOQQ.js} +14 -4
  159. package/dist/{chunk-ZZH4UIPN.cjs → chunk-ES7AWMNH.cjs} +1 -1
  160. package/dist/{chunk-ZLMJVSBO.cjs → chunk-FDUQPAQE.cjs} +1 -1
  161. package/dist/{chunk-HHBXCBZP.js → chunk-FDZG27IG.js} +1 -1
  162. package/dist/chunk-FKP5D5IS.js +271 -0
  163. package/dist/{chunk-EEHZRPPF.cjs → chunk-FQJY4D3T.cjs} +1 -1
  164. package/dist/{chunk-LA62SD2F.js → chunk-FYSXJXNW.js} +1 -1
  165. package/dist/{chunk-DEXYWDHF.js → chunk-GNV6W4BN.js} +1 -1
  166. package/dist/{chunk-NZBOHEQA.js → chunk-HBO7ZDEQ.js} +1 -1
  167. package/dist/{chunk-BAWP2QVY.js → chunk-I777JTTG.js} +1 -1
  168. package/dist/chunk-I7TOBKJO.js +219 -0
  169. package/dist/{chunk-IZGHMMX7.js → chunk-IOAOG5L7.js} +3 -3
  170. package/dist/{chunk-QQROR2RU.cjs → chunk-IOUAZYK2.cjs} +1 -1
  171. package/dist/{chunk-CQKQ7KS2.js → chunk-IPSNC5VZ.js} +2 -2
  172. package/dist/{chunk-7X7FXV5E.cjs → chunk-IVFVLRWJ.cjs} +14 -14
  173. package/dist/{chunk-LM5XXSGE.js → chunk-IZHH6CVY.js} +1 -1
  174. package/dist/{chunk-GGNBMIZ2.js → chunk-JFL2WMJZ.js} +2 -2
  175. package/dist/{chunk-XRIXQM3Z.cjs → chunk-JMFHL7GN.cjs} +1 -1
  176. package/dist/chunk-KHRYPNUV.cjs +293 -0
  177. package/dist/{chunk-LFPFFSN2.js → chunk-KMPFESEV.js} +1 -1
  178. package/dist/{chunk-TAHZH6DJ.js → chunk-KYV75JPQ.js} +1 -1
  179. package/dist/{chunk-2A2XM7D5.cjs → chunk-LEMMFFEY.cjs} +4 -4
  180. package/dist/{chunk-MZIZGYA4.cjs → chunk-M4NJTJKV.cjs} +1 -1
  181. package/dist/{chunk-HYXA7S43.js → chunk-MOZ52KN6.js} +1 -1
  182. package/dist/{chunk-E5MSFY5H.cjs → chunk-MPOO5VPW.cjs} +1 -1
  183. package/dist/{chunk-MPJLGYFV.cjs → chunk-MYW7LNB2.cjs} +1 -1
  184. package/dist/chunk-N7CHFKRS.js +393 -0
  185. package/dist/{chunk-VBTASJ3Y.cjs → chunk-N7OQNSII.cjs} +1 -1
  186. package/dist/{chunk-VGERRI4S.js → chunk-OTSDPQPV.js} +2 -2
  187. package/dist/{chunk-7NAN7OVX.cjs → chunk-P2OQTJZP.cjs} +1 -1
  188. package/dist/{chunk-HAA5C5YW.js → chunk-P64NPZBG.js} +2 -2
  189. package/dist/{chunk-QP6RNHGR.cjs → chunk-PBT4UKPL.cjs} +3 -3
  190. package/dist/{chunk-FUR5SDP7.cjs → chunk-PKNRTFNE.cjs} +1 -1
  191. package/dist/{chunk-FPXBY2MY.cjs → chunk-POU3W5J3.cjs} +1 -1
  192. package/dist/{chunk-SOY3LB7W.cjs → chunk-PSQ3HNZP.cjs} +1 -1
  193. package/dist/{chunk-BK4XKZUO.js → chunk-PU7VXDAS.js} +1 -1
  194. package/dist/{chunk-OCQC2ZSV.cjs → chunk-QMX67CVT.cjs} +1 -1
  195. package/dist/{chunk-R3JCW3ES.js → chunk-QNN3YV2P.js} +2 -2
  196. package/dist/{chunk-V5HMQGFD.js → chunk-R3DTXVP2.js} +1 -1
  197. package/dist/{chunk-EQGNKCBY.cjs → chunk-RFI5R42I.cjs} +4 -4
  198. package/dist/{chunk-FROWMHDP.cjs → chunk-RMFSX7DO.cjs} +18 -8
  199. package/dist/{chunk-TCWGIRAW.js → chunk-RR2BKV65.js} +1 -1
  200. package/dist/{chunk-YHFGMI7T.cjs → chunk-RSSOX4RQ.cjs} +8 -8
  201. package/dist/{chunk-3XV4LGQ7.cjs → chunk-RZEFKXL3.cjs} +3 -3
  202. package/dist/{chunk-GDWAQGOH.cjs → chunk-S2ZGXBUH.cjs} +1 -1
  203. package/dist/{chunk-M63HWVOS.js → chunk-S7IHWY24.js} +2 -2
  204. package/dist/{chunk-NLX2RB4L.cjs → chunk-SOQ56ZI2.cjs} +1 -1
  205. package/dist/{chunk-RV37BGW3.cjs → chunk-SW2HMNCA.cjs} +4 -4
  206. package/dist/{chunk-UVL5SIAQ.cjs → chunk-TBNPJPYG.cjs} +1 -1
  207. package/dist/{chunk-QVWCUKEY.js → chunk-TJECLLN4.js} +1 -1
  208. package/dist/{chunk-E2OC4CUE.js → chunk-TYLDISRK.js} +1 -1
  209. package/dist/{chunk-23HN42SP.cjs → chunk-ULUD3FED.cjs} +9 -6
  210. package/dist/{chunk-LINUXKS7.cjs → chunk-V5KUC5VH.cjs} +1 -1
  211. package/dist/{chunk-U2543OZS.cjs → chunk-VA2I7ZAL.cjs} +1 -1
  212. package/dist/{chunk-7TWL3SJ5.cjs → chunk-VS3I5OKA.cjs} +8 -8
  213. package/dist/{chunk-A7BI7YWZ.js → chunk-WMGMIE2D.js} +8 -5
  214. package/dist/{chunk-CCBEHIRU.cjs → chunk-X5MYHDEQ.cjs} +6 -6
  215. package/dist/{chunk-QSGH4FCS.cjs → chunk-X7XP6GEI.cjs} +1 -1
  216. package/dist/{chunk-UROQO2HR.js → chunk-XCXUGHDF.js} +1 -1
  217. package/dist/{chunk-2M5WJENK.js → chunk-YAFDVNXT.js} +1 -1
  218. package/dist/{chunk-PDYM26IC.cjs → chunk-ZBWUIR2J.cjs} +6 -6
  219. package/dist/{chunk-5GKALAMP.js → chunk-ZD3L4V3H.js} +2 -2
  220. package/dist/{chunk-XJTDCWKP.js → chunk-ZR4IMROK.js} +1 -1
  221. package/dist/{chunk-5MCFW2HC.js → chunk-ZTCRD2FL.js} +1 -1
  222. package/dist/index.cjs +214 -199
  223. package/dist/index.d.cts +4 -1
  224. package/dist/index.d.ts +4 -1
  225. package/dist/index.js +51 -48
  226. package/dist/styles.css +445 -3
  227. package/dist/{tokens-OJLK3XMZ.css → tokens-RYJ3DFTU.css} +3 -0
  228. package/dist/tokens.css +3 -0
  229. package/docs/llms/calendar.md +2 -1
  230. package/docs/llms/datepicker.md +69 -0
  231. package/docs/llms/datetimepicker.md +83 -0
  232. package/docs/llms/drawer.md +13 -0
  233. package/docs/llms/image.md +14 -0
  234. package/docs/llms/modal.md +13 -0
  235. package/docs/llms/timepicker.md +81 -0
  236. package/docs/llms.md +5 -2
  237. package/package.json +7 -3
  238. package/dist/chunk-56U4P7QA.cjs +0 -112
  239. package/dist/chunk-J3LUTXVO.js +0 -90
@@ -0,0 +1,415 @@
1
+ 'use strict';
2
+
3
+ var chunkYB3IWIOJ_cjs = require('./chunk-YB3IWIOJ.cjs');
4
+ var chunkVS3I5OKA_cjs = require('./chunk-VS3I5OKA.cjs');
5
+ var chunkSW2HMNCA_cjs = require('./chunk-SW2HMNCA.cjs');
6
+ require('./tokens-RYJ3DFTU.css');
7
+ require('./shared-NJHRNLRH.css');
8
+ require('./TimePicker-6URACYEH.css');
9
+ var React = require('react');
10
+ var reactDom = require('react-dom');
11
+ var jsxRuntime = require('react/jsx-runtime');
12
+
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
+
33
+ var clampStep = (value) => {
34
+ if (!Number.isFinite(value) || !value || value < 1) return 1;
35
+ return Math.floor(value);
36
+ };
37
+ var pad = (value) => String(value).padStart(2, "0");
38
+ var parseTime = (value) => {
39
+ if (!value) return null;
40
+ const match = value.trim().match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);
41
+ if (!match) return null;
42
+ const hour = Number(match[1]);
43
+ const minute = Number(match[2]);
44
+ const second = match[3] == null ? 0 : Number(match[3]);
45
+ if (hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 59) {
46
+ return null;
47
+ }
48
+ return { hour, minute, second };
49
+ };
50
+ var formatTime = (time, includeSecond) => {
51
+ const base = `${pad(time.hour)}:${pad(time.minute)}`;
52
+ return includeSecond ? `${base}:${pad(time.second)}` : base;
53
+ };
54
+ var normalizeTime = (value, includeSecond) => {
55
+ const parsed = parseTime(value);
56
+ return parsed ? formatTime(parsed, includeSecond) : null;
57
+ };
58
+ var toSeconds = (time) => time.hour * 3600 + time.minute * 60 + time.second;
59
+ var getNow = () => {
60
+ const now = /* @__PURE__ */ new Date();
61
+ return {
62
+ hour: now.getHours(),
63
+ minute: now.getMinutes(),
64
+ second: now.getSeconds()
65
+ };
66
+ };
67
+ var buildOptions = (max, step, selected) => {
68
+ const safeStep = clampStep(step);
69
+ const values = [];
70
+ for (let value = 0; value <= max; value += safeStep) {
71
+ values.push(value);
72
+ }
73
+ if (selected != null && !values.includes(selected)) {
74
+ values.push(selected);
75
+ values.sort((a, b) => a - b);
76
+ }
77
+ return values;
78
+ };
79
+ var compose = (base, key, value) => ({
80
+ hour: key === "hour" ? value : base.hour,
81
+ minute: key === "minute" ? value : base.minute,
82
+ second: key === "second" ? value : base.second
83
+ });
84
+ var byDistanceFrom = (preferred) => (a, b) => Math.abs(a - preferred) - Math.abs(b - preferred) || a - b;
85
+ var TimePicker = React__namespace.forwardRef(
86
+ ({
87
+ value,
88
+ defaultValue = null,
89
+ onChange,
90
+ format = "HH:mm",
91
+ showSecond,
92
+ placeholder = "\u8BF7\u9009\u62E9\u65F6\u95F4",
93
+ disabled,
94
+ readOnly,
95
+ invalid,
96
+ size = "md",
97
+ allowClear,
98
+ hourStep = 1,
99
+ minuteStep = 1,
100
+ secondStep = 1,
101
+ min,
102
+ max,
103
+ disabledTime,
104
+ placement = "bottom",
105
+ open: openProp,
106
+ defaultOpen = false,
107
+ onOpenChange,
108
+ popupClassName = "",
109
+ dropdownClassName = "",
110
+ className = "",
111
+ onKeyDown,
112
+ ...rest
113
+ }, ref) => {
114
+ const includeSecond = showSecond ?? format === "HH:mm:ss";
115
+ const controlled = value !== void 0;
116
+ const initial = normalizeTime(defaultValue, includeSecond);
117
+ const [inner, setInner] = React__namespace.useState(initial);
118
+ const current = controlled ? normalizeTime(value, includeSecond) : inner;
119
+ const scrollSignature = current ?? "";
120
+ const currentParts = parseTime(current);
121
+ const [draft, setDraft] = React__namespace.useState(current ?? "");
122
+ React__namespace.useEffect(() => {
123
+ setDraft(current ?? "");
124
+ }, [current]);
125
+ const openControlled = openProp !== void 0;
126
+ const [innerOpen, setInnerOpen] = React__namespace.useState(defaultOpen);
127
+ const open = openControlled ? !!openProp : innerOpen;
128
+ const wasOpenRef = React__namespace.useRef(false);
129
+ const scrollSignatureRef = React__namespace.useRef(null);
130
+ const scrollFramesRef = React__namespace.useRef(/* @__PURE__ */ new Map());
131
+ const setOpen = React__namespace.useCallback(
132
+ (next) => {
133
+ if (disabled || readOnly) return;
134
+ if (!openControlled) setInnerOpen(next);
135
+ onOpenChange?.(next);
136
+ },
137
+ [disabled, onOpenChange, openControlled, readOnly]
138
+ );
139
+ const rootRef = React__namespace.useRef(null);
140
+ const panelRef = React__namespace.useRef(null);
141
+ const { triggerRef, floatingStyle } = chunkYB3IWIOJ_cjs.useFloating({
142
+ open,
143
+ placement,
144
+ panelWidth: includeSecond ? 312 : 236,
145
+ panelHeight: 330
146
+ });
147
+ const setRootRef = React__namespace.useCallback(
148
+ (node) => {
149
+ rootRef.current = node;
150
+ triggerRef.current = node;
151
+ if (typeof ref === "function") ref(node);
152
+ else if (ref) ref.current = node;
153
+ },
154
+ [ref, triggerRef]
155
+ );
156
+ const minParts = React__namespace.useMemo(() => parseTime(min), [min]);
157
+ const maxParts = React__namespace.useMemo(() => parseTime(max), [max]);
158
+ const minSeconds = minParts ? toSeconds(minParts) : null;
159
+ const maxSeconds = maxParts ? toSeconds(maxParts) : null;
160
+ const isDisabledTime = React__namespace.useCallback(
161
+ (time) => {
162
+ const seconds = toSeconds(time);
163
+ if (minSeconds != null && seconds < minSeconds) return true;
164
+ if (maxSeconds != null && seconds > maxSeconds) return true;
165
+ return disabledTime?.(time) ?? false;
166
+ },
167
+ [disabledTime, maxSeconds, minSeconds]
168
+ );
169
+ const commit = React__namespace.useCallback(
170
+ (next) => {
171
+ if (!next) {
172
+ if (!controlled) setInner(null);
173
+ setDraft("");
174
+ onChange?.(null, null);
175
+ return;
176
+ }
177
+ if (isDisabledTime(next)) return;
178
+ const nextValue = formatTime(next, includeSecond);
179
+ if (!controlled) setInner(nextValue);
180
+ setDraft(nextValue);
181
+ onChange?.(nextValue, next);
182
+ },
183
+ [controlled, includeSecond, isDisabledTime, onChange]
184
+ );
185
+ React__namespace.useEffect(() => {
186
+ if (!open) return;
187
+ const onDown = (event) => {
188
+ const target = event.target;
189
+ if (rootRef.current?.contains(target)) return;
190
+ if (panelRef.current?.contains(target)) return;
191
+ setOpen(false);
192
+ };
193
+ const onDocKey = (event) => {
194
+ if (event.key === "Escape") setOpen(false);
195
+ };
196
+ document.addEventListener("mousedown", onDown);
197
+ document.addEventListener("keydown", onDocKey);
198
+ return () => {
199
+ document.removeEventListener("mousedown", onDown);
200
+ document.removeEventListener("keydown", onDocKey);
201
+ };
202
+ }, [open, setOpen]);
203
+ const scrollListTo = React__namespace.useCallback(
204
+ (list, top, animate) => {
205
+ const frame = scrollFramesRef.current.get(list);
206
+ if (frame != null) cancelAnimationFrame(frame);
207
+ if (!animate) {
208
+ list.scrollTop = top;
209
+ return;
210
+ }
211
+ const start = list.scrollTop;
212
+ const distance = top - start;
213
+ if (Math.abs(distance) < 1) {
214
+ list.scrollTop = top;
215
+ return;
216
+ }
217
+ const startedAt = performance.now();
218
+ const duration = 180;
219
+ const tick = (now2) => {
220
+ const progress = Math.min((now2 - startedAt) / duration, 1);
221
+ const eased = 1 - Math.pow(1 - progress, 3);
222
+ list.scrollTop = start + distance * eased;
223
+ if (progress < 1) {
224
+ scrollFramesRef.current.set(list, requestAnimationFrame(tick));
225
+ return;
226
+ }
227
+ scrollFramesRef.current.delete(list);
228
+ list.scrollTop = top;
229
+ };
230
+ scrollFramesRef.current.set(list, requestAnimationFrame(tick));
231
+ },
232
+ []
233
+ );
234
+ React__namespace.useEffect(() => {
235
+ if (!open) return;
236
+ const shouldAnimate = wasOpenRef.current && scrollSignatureRef.current != null && scrollSignatureRef.current !== scrollSignature;
237
+ requestAnimationFrame(() => {
238
+ panelRef.current?.querySelectorAll(".time-picker-list").forEach((list) => {
239
+ const selected = list.querySelector(".time-picker-option.selected");
240
+ if (!selected) return;
241
+ const top = selected.offsetTop - list.offsetTop - list.clientHeight / 2 + selected.offsetHeight / 2;
242
+ scrollListTo(list, top, shouldAnimate);
243
+ });
244
+ });
245
+ wasOpenRef.current = open;
246
+ scrollSignatureRef.current = scrollSignature;
247
+ }, [open, scrollListTo, scrollSignature]);
248
+ React__namespace.useEffect(() => {
249
+ if (open) return;
250
+ wasOpenRef.current = false;
251
+ scrollSignatureRef.current = null;
252
+ }, [open]);
253
+ React__namespace.useEffect(
254
+ () => () => {
255
+ scrollFramesRef.current.forEach((frame) => cancelAnimationFrame(frame));
256
+ scrollFramesRef.current.clear();
257
+ },
258
+ []
259
+ );
260
+ const panelBase = currentParts ?? getNow();
261
+ const hourOptions = buildOptions(23, hourStep, currentParts?.hour);
262
+ const minuteOptions = buildOptions(59, minuteStep, currentParts?.minute);
263
+ const secondOptions = buildOptions(59, secondStep, currentParts?.second);
264
+ const findAvailableTime = (key, value2) => {
265
+ const preferred = compose(panelBase, key, value2);
266
+ if (!isDisabledTime(preferred)) return preferred;
267
+ const hours = key === "hour" ? [value2] : [...hourOptions].sort(byDistanceFrom(panelBase.hour));
268
+ const minutes = key === "minute" ? [value2] : [...minuteOptions].sort(byDistanceFrom(panelBase.minute));
269
+ const seconds = key === "second" ? [value2] : includeSecond ? [...secondOptions].sort(byDistanceFrom(panelBase.second)) : [0];
270
+ for (const hour of hours) {
271
+ for (const minute of minutes) {
272
+ for (const second of seconds) {
273
+ const candidate = { hour, minute, second };
274
+ if (!isDisabledTime(candidate)) return candidate;
275
+ }
276
+ }
277
+ }
278
+ return null;
279
+ };
280
+ const pick = (key, nextValue) => {
281
+ const next = findAvailableTime(key, nextValue);
282
+ if (next) commit(next);
283
+ };
284
+ const handleInputChange = (next) => {
285
+ setDraft(next);
286
+ if (next.trim() === "") commit(null);
287
+ };
288
+ const handleInputBlur = () => {
289
+ if (!draft.trim()) {
290
+ setDraft(current ?? "");
291
+ return;
292
+ }
293
+ const parsed = parseTime(draft);
294
+ if (!parsed || isDisabledTime(parsed)) {
295
+ setDraft(current ?? "");
296
+ return;
297
+ }
298
+ commit(parsed);
299
+ };
300
+ const handleRootKeyDown = (event) => {
301
+ onKeyDown?.(event);
302
+ if (event.defaultPrevented) return;
303
+ if ((event.key === "ArrowDown" || event.key === "Enter") && !open) {
304
+ event.preventDefault();
305
+ setOpen(true);
306
+ }
307
+ if (event.key === "Escape" && open) {
308
+ event.preventDefault();
309
+ setOpen(false);
310
+ }
311
+ };
312
+ const renderColumn = (label, key, options) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "time-picker-column", children: [
313
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-picker-column-label", children: label }),
314
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-picker-list", role: "listbox", "aria-label": label, children: options.map((option) => {
315
+ const selected = currentParts?.[key] === option;
316
+ const optionDisabled = findAvailableTime(key, option) == null;
317
+ return /* @__PURE__ */ jsxRuntime.jsx(
318
+ "button",
319
+ {
320
+ type: "button",
321
+ role: "option",
322
+ "aria-selected": selected,
323
+ disabled: optionDisabled,
324
+ className: `time-picker-option ${selected ? "selected" : ""}`,
325
+ onClick: () => pick(key, option),
326
+ children: pad(option)
327
+ },
328
+ option
329
+ );
330
+ }) })
331
+ ] });
332
+ const mergedPanelClassName = [popupClassName, dropdownClassName].filter(Boolean).join(" ");
333
+ const now = getNow();
334
+ const nowDisabled = isDisabledTime(now);
335
+ const rootClassName = [
336
+ "time-picker",
337
+ size,
338
+ open && "open",
339
+ disabled && "disabled",
340
+ readOnly && "readonly",
341
+ invalid && "invalid",
342
+ className
343
+ ].filter(Boolean).join(" ");
344
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: setRootRef, className: rootClassName, onKeyDown: handleRootKeyDown, ...rest, children: [
345
+ /* @__PURE__ */ jsxRuntime.jsx(
346
+ chunkVS3I5OKA_cjs.Input,
347
+ {
348
+ value: draft,
349
+ size,
350
+ placeholder,
351
+ disabled,
352
+ readOnly,
353
+ invalid,
354
+ allowClear,
355
+ leadingIcon: "clock",
356
+ onFocus: () => setOpen(true),
357
+ onClick: () => setOpen(true),
358
+ onValueChange: handleInputChange,
359
+ onBlur: handleInputBlur,
360
+ inputMode: "numeric",
361
+ "aria-expanded": open,
362
+ "aria-haspopup": "dialog"
363
+ }
364
+ ),
365
+ open && !disabled && !readOnly && typeof document !== "undefined" && reactDom.createPortal(
366
+ /* @__PURE__ */ jsxRuntime.jsxs(
367
+ "div",
368
+ {
369
+ ref: panelRef,
370
+ className: `time-picker-panel ${includeSecond ? "with-second" : "without-second"} ${mergedPanelClassName}`,
371
+ role: "dialog",
372
+ style: floatingStyle,
373
+ children: [
374
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "time-picker-columns", children: [
375
+ renderColumn("\u65F6", "hour", hourOptions),
376
+ renderColumn("\u5206", "minute", minuteOptions),
377
+ includeSecond && renderColumn("\u79D2", "second", secondOptions)
378
+ ] }),
379
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "time-picker-footer", children: [
380
+ /* @__PURE__ */ jsxRuntime.jsx(
381
+ chunkSW2HMNCA_cjs.Button,
382
+ {
383
+ size: "sm",
384
+ variant: "ghost",
385
+ disabled: nowDisabled,
386
+ onClick: () => commit(now),
387
+ children: "\u73B0\u5728"
388
+ }
389
+ ),
390
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "time-picker-footer-spacer" }),
391
+ allowClear && /* @__PURE__ */ jsxRuntime.jsx(
392
+ chunkSW2HMNCA_cjs.Button,
393
+ {
394
+ size: "sm",
395
+ variant: "ghost",
396
+ onClick: () => {
397
+ commit(null);
398
+ setOpen(false);
399
+ },
400
+ children: "\u6E05\u7A7A"
401
+ }
402
+ ),
403
+ /* @__PURE__ */ jsxRuntime.jsx(chunkSW2HMNCA_cjs.Button, { size: "sm", variant: "primary", onClick: () => setOpen(false), children: "\u786E\u5B9A" })
404
+ ] })
405
+ ]
406
+ }
407
+ ),
408
+ document.body
409
+ )
410
+ ] });
411
+ }
412
+ );
413
+ TimePicker.displayName = "TimePicker";
414
+
415
+ exports.TimePicker = TimePicker;
@@ -1,4 +1,4 @@
1
- import './tokens-OJLK3XMZ.css';
1
+ import './tokens-RYJ3DFTU.css';
2
2
  import './shared-NJHRNLRH.css';
3
3
  import './Slider-UM2IZZBH.css';
4
4
  import * as React from 'react';
@@ -1,4 +1,4 @@
1
- import './tokens-OJLK3XMZ.css';
1
+ import './tokens-RYJ3DFTU.css';
2
2
  import './shared-NJHRNLRH.css';
3
3
  import './Badge-DPGLV3D3.css';
4
4
  import * as React from 'react';
@@ -1,7 +1,7 @@
1
- import { Icon } from './chunk-HHBXCBZP.js';
2
- import './tokens-OJLK3XMZ.css';
1
+ import { Icon } from './chunk-FDZG27IG.js';
2
+ import './tokens-RYJ3DFTU.css';
3
3
  import './shared-NJHRNLRH.css';
4
- import './Image-SGSRTHQX.css';
4
+ import './Image-TDCXJISG.css';
5
5
  import * as React from 'react';
6
6
  import ReactDOM from 'react-dom';
7
7
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -17,6 +17,8 @@ var Image = React.forwardRef(({
17
17
  objectFit,
18
18
  objectPosition,
19
19
  preview,
20
+ previewClassName = "",
21
+ previewStyle,
20
22
  hover = true,
21
23
  placeholder,
22
24
  imgProps,
@@ -96,7 +98,15 @@ var Image = React.forwardRef(({
96
98
  }
97
99
  ),
98
100
  open && typeof document !== "undefined" && ReactDOM.createPortal(
99
- /* @__PURE__ */ jsx("div", { className: "image-preview-overlay", onClick: () => setOpen(false), children: /* @__PURE__ */ jsx("img", { src, alt, onClick: (e) => e.stopPropagation() }) }),
101
+ /* @__PURE__ */ jsx(
102
+ "div",
103
+ {
104
+ className: ["image-preview-overlay", previewClassName].filter(Boolean).join(" "),
105
+ style: previewStyle,
106
+ onClick: () => setOpen(false),
107
+ children: /* @__PURE__ */ jsx("img", { src, alt, onClick: (e) => e.stopPropagation() })
108
+ }
109
+ ),
100
110
  document.body
101
111
  )
102
112
  ] });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./tokens-OJLK3XMZ.css');
3
+ require('./tokens-RYJ3DFTU.css');
4
4
  require('./shared-NJHRNLRH.css');
5
5
  require('./Empty-CZTRZMZQ.css');
6
6
  var React = require('react');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('./tokens-OJLK3XMZ.css');
3
+ require('./tokens-RYJ3DFTU.css');
4
4
  require('./shared-NJHRNLRH.css');
5
5
  require('./Form-NGCQWTMZ.css');
6
6
  var React = require('react');
@@ -1,4 +1,4 @@
1
- import './tokens-OJLK3XMZ.css';
1
+ import './tokens-RYJ3DFTU.css';
2
2
  import './shared-NJHRNLRH.css';
3
3
  import * as React from 'react';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';