@ktnpm_devops/react-component 0.4.1 → 0.6.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 (382) hide show
  1. package/dist/charts/Sparkline/Sparkline.d.ts +4 -0
  2. package/dist/charts/Sparkline/Sparkline.d.ts.map +1 -0
  3. package/dist/charts/Sparkline/Sparkline.types.d.ts +15 -0
  4. package/dist/charts/Sparkline/Sparkline.types.d.ts.map +1 -0
  5. package/dist/charts/Sparkline/index.d.ts +3 -0
  6. package/dist/charts/Sparkline/index.d.ts.map +1 -0
  7. package/dist/composites/Accordion/Accordion.d.ts +5 -0
  8. package/dist/composites/Accordion/Accordion.d.ts.map +1 -0
  9. package/dist/composites/Accordion/Accordion.types.d.ts +15 -0
  10. package/dist/composites/Accordion/Accordion.types.d.ts.map +1 -0
  11. package/dist/composites/Accordion/index.d.ts +3 -0
  12. package/dist/composites/Accordion/index.d.ts.map +1 -0
  13. package/dist/composites/DatePickerDropdown/DatePickerDropdown.d.ts +7 -0
  14. package/dist/composites/DatePickerDropdown/DatePickerDropdown.d.ts.map +1 -0
  15. package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts +20 -0
  16. package/dist/composites/DatePickerDropdown/DatePickerDropdown.types.d.ts.map +1 -0
  17. package/dist/composites/DatePickerDropdown/index.d.ts +3 -0
  18. package/dist/composites/DatePickerDropdown/index.d.ts.map +1 -0
  19. package/dist/composites/FilterDropdown/FilterDropdown.d.ts +7 -0
  20. package/dist/composites/FilterDropdown/FilterDropdown.d.ts.map +1 -0
  21. package/dist/composites/FilterDropdown/FilterDropdown.types.d.ts +29 -0
  22. package/dist/composites/FilterDropdown/FilterDropdown.types.d.ts.map +1 -0
  23. package/dist/composites/FilterDropdown/index.d.ts +3 -0
  24. package/dist/composites/FilterDropdown/index.d.ts.map +1 -0
  25. package/dist/constants.d.ts +9 -0
  26. package/dist/constants.d.ts.map +1 -1
  27. package/dist/data/HeatmapMatrix/HeatmapMatrix.d.ts +4 -0
  28. package/dist/data/HeatmapMatrix/HeatmapMatrix.d.ts.map +1 -0
  29. package/dist/data/HeatmapMatrix/HeatmapMatrix.types.d.ts +40 -0
  30. package/dist/data/HeatmapMatrix/HeatmapMatrix.types.d.ts.map +1 -0
  31. package/dist/data/HeatmapMatrix/index.d.ts +3 -0
  32. package/dist/data/HeatmapMatrix/index.d.ts.map +1 -0
  33. package/dist/index.cjs +51 -29
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.ts +18 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +52 -30
  38. package/dist/index.js.map +1 -1
  39. package/dist/index10.cjs +14 -15
  40. package/dist/index10.cjs.map +1 -1
  41. package/dist/index10.js +15 -16
  42. package/dist/index10.js.map +1 -1
  43. package/dist/index11.cjs +15 -4
  44. package/dist/index11.cjs.map +1 -1
  45. package/dist/index11.js +15 -4
  46. package/dist/index11.js.map +1 -1
  47. package/dist/index12.cjs +4 -16
  48. package/dist/index12.cjs.map +1 -1
  49. package/dist/index12.js +4 -16
  50. package/dist/index12.js.map +1 -1
  51. package/dist/index13.cjs +16 -10
  52. package/dist/index13.cjs.map +1 -1
  53. package/dist/index13.js +16 -10
  54. package/dist/index13.js.map +1 -1
  55. package/dist/index14.cjs +10 -100
  56. package/dist/index14.cjs.map +1 -1
  57. package/dist/index14.js +11 -101
  58. package/dist/index14.js.map +1 -1
  59. package/dist/index15.cjs +100 -20
  60. package/dist/index15.cjs.map +1 -1
  61. package/dist/index15.js +101 -21
  62. package/dist/index15.js.map +1 -1
  63. package/dist/index16.cjs +20 -43
  64. package/dist/index16.cjs.map +1 -1
  65. package/dist/index16.js +21 -44
  66. package/dist/index16.js.map +1 -1
  67. package/dist/index17.cjs +38 -85
  68. package/dist/index17.cjs.map +1 -1
  69. package/dist/index17.js +40 -87
  70. package/dist/index17.js.map +1 -1
  71. package/dist/index18.cjs +85 -153
  72. package/dist/index18.cjs.map +1 -1
  73. package/dist/index18.js +87 -155
  74. package/dist/index18.js.map +1 -1
  75. package/dist/index19.cjs +150 -128
  76. package/dist/index19.cjs.map +1 -1
  77. package/dist/index19.js +150 -128
  78. package/dist/index19.js.map +1 -1
  79. package/dist/index20.cjs +121 -106
  80. package/dist/index20.cjs.map +1 -1
  81. package/dist/index20.js +122 -107
  82. package/dist/index20.js.map +1 -1
  83. package/dist/index21.cjs +121 -17
  84. package/dist/index21.cjs.map +1 -1
  85. package/dist/index21.js +121 -17
  86. package/dist/index21.js.map +1 -1
  87. package/dist/index22.cjs +17 -8
  88. package/dist/index22.cjs.map +1 -1
  89. package/dist/index22.js +18 -9
  90. package/dist/index22.js.map +1 -1
  91. package/dist/index23.cjs +152 -119
  92. package/dist/index23.cjs.map +1 -1
  93. package/dist/index23.js +153 -120
  94. package/dist/index23.js.map +1 -1
  95. package/dist/index24.cjs +125 -33
  96. package/dist/index24.cjs.map +1 -1
  97. package/dist/index24.js +126 -34
  98. package/dist/index24.js.map +1 -1
  99. package/dist/index25.cjs +71 -218
  100. package/dist/index25.cjs.map +1 -1
  101. package/dist/index25.js +73 -220
  102. package/dist/index25.js.map +1 -1
  103. package/dist/index26.cjs +6 -32
  104. package/dist/index26.cjs.map +1 -1
  105. package/dist/index26.js +7 -33
  106. package/dist/index26.js.map +1 -1
  107. package/dist/index27.cjs +120 -67
  108. package/dist/index27.cjs.map +1 -1
  109. package/dist/index27.js +121 -68
  110. package/dist/index27.js.map +1 -1
  111. package/dist/index28.cjs +37 -58
  112. package/dist/index28.cjs.map +1 -1
  113. package/dist/index28.js +38 -59
  114. package/dist/index28.js.map +1 -1
  115. package/dist/index29.cjs +208 -137
  116. package/dist/index29.cjs.map +1 -1
  117. package/dist/index29.js +209 -138
  118. package/dist/index29.js.map +1 -1
  119. package/dist/index30.cjs +32 -6
  120. package/dist/index30.cjs.map +1 -1
  121. package/dist/index30.js +33 -7
  122. package/dist/index30.js.map +1 -1
  123. package/dist/index31.cjs +110 -17
  124. package/dist/index31.cjs.map +1 -1
  125. package/dist/index31.js +111 -18
  126. package/dist/index31.js.map +1 -1
  127. package/dist/index32.cjs +72 -71
  128. package/dist/index32.cjs.map +1 -1
  129. package/dist/index32.js +74 -73
  130. package/dist/index32.js.map +1 -1
  131. package/dist/index33.cjs +57 -141
  132. package/dist/index33.cjs.map +1 -1
  133. package/dist/index33.js +59 -143
  134. package/dist/index33.js.map +1 -1
  135. package/dist/index34.cjs +128 -80
  136. package/dist/index34.cjs.map +1 -1
  137. package/dist/index34.js +126 -78
  138. package/dist/index34.js.map +1 -1
  139. package/dist/index35.cjs +72 -6
  140. package/dist/index35.cjs.map +1 -1
  141. package/dist/index35.js +72 -6
  142. package/dist/index35.js.map +1 -1
  143. package/dist/index36.cjs +7 -215
  144. package/dist/index36.cjs.map +1 -1
  145. package/dist/index36.js +8 -216
  146. package/dist/index36.js.map +1 -1
  147. package/dist/index37.cjs +17 -8
  148. package/dist/index37.cjs.map +1 -1
  149. package/dist/index37.js +18 -9
  150. package/dist/index37.js.map +1 -1
  151. package/dist/index38.cjs +79 -16
  152. package/dist/index38.cjs.map +1 -1
  153. package/dist/index38.js +78 -15
  154. package/dist/index38.js.map +1 -1
  155. package/dist/index39.cjs +144 -27
  156. package/dist/index39.cjs.map +1 -1
  157. package/dist/index39.js +143 -26
  158. package/dist/index39.js.map +1 -1
  159. package/dist/index40.cjs +66 -70
  160. package/dist/index40.cjs.map +1 -1
  161. package/dist/index40.js +65 -69
  162. package/dist/index40.js.map +1 -1
  163. package/dist/index41.cjs +106 -15
  164. package/dist/index41.cjs.map +1 -1
  165. package/dist/index41.js +105 -14
  166. package/dist/index41.js.map +1 -1
  167. package/dist/index42.cjs +49 -25
  168. package/dist/index42.cjs.map +1 -1
  169. package/dist/index42.js +48 -24
  170. package/dist/index42.js.map +1 -1
  171. package/dist/index43.cjs +8 -7
  172. package/dist/index43.cjs.map +1 -1
  173. package/dist/index43.js +7 -6
  174. package/dist/index43.js.map +1 -1
  175. package/dist/index44.cjs +218 -7
  176. package/dist/index44.cjs.map +1 -1
  177. package/dist/index44.js +217 -6
  178. package/dist/index44.js.map +1 -1
  179. package/dist/index45.cjs +9 -67
  180. package/dist/index45.cjs.map +1 -1
  181. package/dist/index45.js +9 -67
  182. package/dist/index45.js.map +1 -1
  183. package/dist/index46.cjs +19 -19
  184. package/dist/index46.cjs.map +1 -1
  185. package/dist/index46.js +18 -18
  186. package/dist/index46.js.map +1 -1
  187. package/dist/index47.cjs +67 -57
  188. package/dist/index47.cjs.map +1 -1
  189. package/dist/index47.js +66 -56
  190. package/dist/index47.js.map +1 -1
  191. package/dist/index48.cjs +15 -39
  192. package/dist/index48.cjs.map +1 -1
  193. package/dist/index48.js +15 -39
  194. package/dist/index48.js.map +1 -1
  195. package/dist/index49.cjs +2 -50
  196. package/dist/index49.cjs.map +1 -1
  197. package/dist/index49.js +3 -51
  198. package/dist/index49.js.map +1 -1
  199. package/dist/index50.cjs +15 -18
  200. package/dist/index50.cjs.map +1 -1
  201. package/dist/index50.js +15 -18
  202. package/dist/index50.js.map +1 -1
  203. package/dist/index51.cjs +76 -33
  204. package/dist/index51.cjs.map +1 -1
  205. package/dist/index51.js +75 -32
  206. package/dist/index51.js.map +1 -1
  207. package/dist/index52.cjs +13 -13
  208. package/dist/index52.js +14 -14
  209. package/dist/index53.cjs +22 -10
  210. package/dist/index53.cjs.map +1 -1
  211. package/dist/index53.js +23 -11
  212. package/dist/index53.js.map +1 -1
  213. package/dist/index54.cjs +20 -2
  214. package/dist/index54.cjs.map +1 -1
  215. package/dist/index54.js +21 -3
  216. package/dist/index54.js.map +1 -1
  217. package/dist/index55.cjs +23 -2
  218. package/dist/index55.cjs.map +1 -1
  219. package/dist/index55.js +24 -3
  220. package/dist/index55.js.map +1 -1
  221. package/dist/index56.cjs +2 -20
  222. package/dist/index56.cjs.map +1 -1
  223. package/dist/index56.js +3 -21
  224. package/dist/index56.js.map +1 -1
  225. package/dist/index57.cjs +20 -5
  226. package/dist/index57.cjs.map +1 -1
  227. package/dist/index57.js +20 -5
  228. package/dist/index57.js.map +1 -1
  229. package/dist/index58.cjs +5 -80
  230. package/dist/index58.cjs.map +1 -1
  231. package/dist/index58.js +6 -81
  232. package/dist/index58.js.map +1 -1
  233. package/dist/index59.cjs +8 -8
  234. package/dist/index59.js +8 -8
  235. package/dist/index60.cjs +10 -28
  236. package/dist/index60.cjs.map +1 -1
  237. package/dist/index60.js +11 -29
  238. package/dist/index60.js.map +1 -1
  239. package/dist/index61.cjs +64 -34
  240. package/dist/index61.cjs.map +1 -1
  241. package/dist/index61.js +64 -34
  242. package/dist/index61.js.map +1 -1
  243. package/dist/index62.cjs +10 -16
  244. package/dist/index62.cjs.map +1 -1
  245. package/dist/index62.js +10 -16
  246. package/dist/index62.js.map +1 -1
  247. package/dist/index63.cjs +2 -38
  248. package/dist/index63.cjs.map +1 -1
  249. package/dist/index63.js +3 -39
  250. package/dist/index63.js.map +1 -1
  251. package/dist/index64.cjs +32 -50
  252. package/dist/index64.cjs.map +1 -1
  253. package/dist/index64.js +32 -50
  254. package/dist/index64.js.map +1 -1
  255. package/dist/index65.cjs +19 -13
  256. package/dist/index65.cjs.map +1 -1
  257. package/dist/index65.js +20 -14
  258. package/dist/index65.js.map +1 -1
  259. package/dist/index66.cjs +13 -16
  260. package/dist/index66.cjs.map +1 -1
  261. package/dist/index66.js +14 -17
  262. package/dist/index66.js.map +1 -1
  263. package/dist/index67.cjs +22 -31
  264. package/dist/index67.cjs.map +1 -1
  265. package/dist/index67.js +23 -32
  266. package/dist/index67.js.map +1 -1
  267. package/dist/index68.cjs +40 -134
  268. package/dist/index68.cjs.map +1 -1
  269. package/dist/index68.js +39 -133
  270. package/dist/index68.js.map +1 -1
  271. package/dist/index69.cjs +15 -36
  272. package/dist/index69.cjs.map +1 -1
  273. package/dist/index69.js +16 -37
  274. package/dist/index69.js.map +1 -1
  275. package/dist/index70.cjs +21 -0
  276. package/dist/index70.cjs.map +1 -0
  277. package/dist/index70.js +21 -0
  278. package/dist/index70.js.map +1 -0
  279. package/dist/index71.cjs +24 -0
  280. package/dist/index71.cjs.map +1 -0
  281. package/dist/index71.js +24 -0
  282. package/dist/index71.js.map +1 -0
  283. package/dist/index72.cjs +12 -0
  284. package/dist/index72.cjs.map +1 -0
  285. package/dist/index72.js +12 -0
  286. package/dist/index72.js.map +1 -0
  287. package/dist/index73.cjs +45 -0
  288. package/dist/index73.cjs.map +1 -0
  289. package/dist/index73.js +45 -0
  290. package/dist/index73.js.map +1 -0
  291. package/dist/index74.cjs +24 -0
  292. package/dist/index74.cjs.map +1 -0
  293. package/dist/index74.js +24 -0
  294. package/dist/index74.js.map +1 -0
  295. package/dist/index75.cjs +45 -0
  296. package/dist/index75.cjs.map +1 -0
  297. package/dist/index75.js +45 -0
  298. package/dist/index75.js.map +1 -0
  299. package/dist/index76.cjs +9 -0
  300. package/dist/index76.cjs.map +1 -0
  301. package/dist/index76.js +9 -0
  302. package/dist/index76.js.map +1 -0
  303. package/dist/index77.cjs +60 -0
  304. package/dist/index77.cjs.map +1 -0
  305. package/dist/index77.js +60 -0
  306. package/dist/index77.js.map +1 -0
  307. package/dist/index78.cjs +33 -0
  308. package/dist/index78.cjs.map +1 -0
  309. package/dist/index78.js +33 -0
  310. package/dist/index78.js.map +1 -0
  311. package/dist/index79.cjs +57 -0
  312. package/dist/index79.cjs.map +1 -0
  313. package/dist/index79.js +57 -0
  314. package/dist/index79.js.map +1 -0
  315. package/dist/index80.cjs +54 -0
  316. package/dist/index80.cjs.map +1 -0
  317. package/dist/index80.js +54 -0
  318. package/dist/index80.js.map +1 -0
  319. package/dist/index81.cjs +39 -0
  320. package/dist/index81.cjs.map +1 -0
  321. package/dist/index81.js +39 -0
  322. package/dist/index81.js.map +1 -0
  323. package/dist/index82.cjs +24 -0
  324. package/dist/index82.cjs.map +1 -0
  325. package/dist/index82.js +24 -0
  326. package/dist/index82.js.map +1 -0
  327. package/dist/index83.cjs +60 -0
  328. package/dist/index83.cjs.map +1 -0
  329. package/dist/index83.js +60 -0
  330. package/dist/index83.js.map +1 -0
  331. package/dist/index84.cjs +24 -0
  332. package/dist/index84.cjs.map +1 -0
  333. package/dist/index84.js +24 -0
  334. package/dist/index84.js.map +1 -0
  335. package/dist/index85.cjs +87 -0
  336. package/dist/index85.cjs.map +1 -0
  337. package/dist/index85.js +87 -0
  338. package/dist/index85.js.map +1 -0
  339. package/dist/index86.cjs +136 -0
  340. package/dist/index86.cjs.map +1 -0
  341. package/dist/index86.js +136 -0
  342. package/dist/index86.js.map +1 -0
  343. package/dist/index87.cjs +48 -0
  344. package/dist/index87.cjs.map +1 -0
  345. package/dist/index87.js +48 -0
  346. package/dist/index87.js.map +1 -0
  347. package/dist/index88.cjs +36 -0
  348. package/dist/index88.cjs.map +1 -0
  349. package/dist/index88.js +36 -0
  350. package/dist/index88.js.map +1 -0
  351. package/dist/index9.cjs +45 -14
  352. package/dist/index9.cjs.map +1 -1
  353. package/dist/index9.js +46 -15
  354. package/dist/index9.js.map +1 -1
  355. package/dist/primitives/Pagination/Pagination.d.ts +4 -0
  356. package/dist/primitives/Pagination/Pagination.d.ts.map +1 -0
  357. package/dist/primitives/Pagination/Pagination.types.d.ts +21 -0
  358. package/dist/primitives/Pagination/Pagination.types.d.ts.map +1 -0
  359. package/dist/primitives/Pagination/index.d.ts +3 -0
  360. package/dist/primitives/Pagination/index.d.ts.map +1 -0
  361. package/dist/primitives/SegmentedControl/SegmentedControl.d.ts +8 -0
  362. package/dist/primitives/SegmentedControl/SegmentedControl.d.ts.map +1 -0
  363. package/dist/primitives/SegmentedControl/SegmentedControl.types.d.ts +25 -0
  364. package/dist/primitives/SegmentedControl/SegmentedControl.types.d.ts.map +1 -0
  365. package/dist/primitives/SegmentedControl/index.d.ts +3 -0
  366. package/dist/primitives/SegmentedControl/index.d.ts.map +1 -0
  367. package/dist/primitives/StatCard/StatCard.d.ts +4 -0
  368. package/dist/primitives/StatCard/StatCard.d.ts.map +1 -0
  369. package/dist/primitives/StatCard/StatCard.types.d.ts +16 -0
  370. package/dist/primitives/StatCard/StatCard.types.d.ts.map +1 -0
  371. package/dist/primitives/StatCard/index.d.ts +3 -0
  372. package/dist/primitives/StatCard/index.d.ts.map +1 -0
  373. package/dist/primitives/Toast/Toast.d.ts +5 -0
  374. package/dist/primitives/Toast/Toast.d.ts.map +1 -0
  375. package/dist/primitives/Toast/Toast.types.d.ts +28 -0
  376. package/dist/primitives/Toast/Toast.types.d.ts.map +1 -0
  377. package/dist/primitives/Toast/ToastProvider.d.ts +5 -0
  378. package/dist/primitives/Toast/ToastProvider.d.ts.map +1 -0
  379. package/dist/primitives/Toast/index.d.ts +4 -0
  380. package/dist/primitives/Toast/index.d.ts.map +1 -0
  381. package/dist/style.css +626 -0
  382. package/package.json +1 -1
package/dist/index31.cjs CHANGED
@@ -1,21 +1,114 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const clsx = require("./index38.cjs");
5
- const SettingsLayout_module = require("./index66.cjs");
6
- const SettingsLayout = ({
7
- sidebar,
8
- children,
9
- title,
10
- maxWidth = "48rem",
11
- sidebarCollapsed = false,
12
- className
13
- }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(SettingsLayout_module.default.root, className), children: [
14
- sidebar && /* @__PURE__ */ jsxRuntime.jsx("aside", { className: clsx.clsx(SettingsLayout_module.default.sidebar, { [SettingsLayout_module.default.sidebarCollapsed]: sidebarCollapsed }), children: sidebar }),
15
- /* @__PURE__ */ jsxRuntime.jsx("main", { className: SettingsLayout_module.default.main, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: SettingsLayout_module.default.content, style: { maxWidth }, children: [
16
- title && /* @__PURE__ */ jsxRuntime.jsx("h1", { className: SettingsLayout_module.default.title, children: title }),
17
- children
18
- ] }) })
19
- ] });
20
- exports.SettingsLayout = SettingsLayout;
4
+ const react = require("react");
5
+ const clsx = require("./index48.cjs");
6
+ const constants = require("./index51.cjs");
7
+ const Pagination_module = require("./index74.cjs");
8
+ function range(start, end) {
9
+ const out = [];
10
+ for (let page = start; page <= end; page += 1) out.push(page);
11
+ return out;
12
+ }
13
+ function getPaginationItems(currentPage, totalPages, siblingCount, boundaryCount) {
14
+ const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;
15
+ if (totalPages <= totalNumbers) return range(1, totalPages);
16
+ const startPages = range(1, boundaryCount);
17
+ const endPages = range(totalPages - boundaryCount + 1, totalPages);
18
+ const siblingsStart = Math.max(
19
+ Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
20
+ boundaryCount + 2
21
+ );
22
+ const siblingsEnd = Math.min(
23
+ Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
24
+ endPages[0] - 2
25
+ );
26
+ const items = [...startPages];
27
+ items.push(siblingsStart > boundaryCount + 2 ? "ellipsis" : boundaryCount + 1);
28
+ items.push(...range(siblingsStart, siblingsEnd));
29
+ items.push(siblingsEnd < totalPages - boundaryCount - 1 ? "ellipsis" : totalPages - boundaryCount);
30
+ items.push(...endPages);
31
+ return items;
32
+ }
33
+ function Chevron({ direction }) {
34
+ return /* @__PURE__ */ jsxRuntime.jsx(
35
+ "svg",
36
+ {
37
+ width: constants.ICON_SIZE.MD,
38
+ height: constants.ICON_SIZE.MD,
39
+ viewBox: constants.SVG_VIEWBOX,
40
+ fill: "none",
41
+ stroke: "currentColor",
42
+ strokeWidth: constants.SVG_STROKE_WIDTH,
43
+ strokeLinecap: "round",
44
+ strokeLinejoin: "round",
45
+ "aria-hidden": "true",
46
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: direction === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
47
+ }
48
+ );
49
+ }
50
+ const Pagination = react.forwardRef(
51
+ ({
52
+ currentPage,
53
+ totalItems,
54
+ pageSize,
55
+ onPageChange,
56
+ siblingCount = constants.PAGINATION.SIBLING_COUNT,
57
+ boundaryCount = constants.PAGINATION.BOUNDARY_COUNT,
58
+ showPrevNext = true,
59
+ className,
60
+ "aria-label": ariaLabel = "Pagination",
61
+ ...props
62
+ }, ref) => {
63
+ const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));
64
+ const page = Math.min(Math.max(currentPage, 1), totalPages);
65
+ const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);
66
+ const goTo = (target) => {
67
+ const next = Math.min(Math.max(target, 1), totalPages);
68
+ if (next !== page) onPageChange(next);
69
+ };
70
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": ariaLabel, className: clsx.clsx(Pagination_module.default.root, className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: Pagination_module.default.list, children: [
71
+ showPrevNext && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
72
+ "button",
73
+ {
74
+ type: "button",
75
+ className: Pagination_module.default.arrow,
76
+ onClick: () => goTo(page - 1),
77
+ disabled: page <= 1,
78
+ "aria-label": "Go to previous page",
79
+ children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { direction: "left" })
80
+ }
81
+ ) }),
82
+ items.map(
83
+ (item, index) => item === "ellipsis" ? (
84
+ // eslint-disable-next-line react/no-array-index-key
85
+ /* @__PURE__ */ jsxRuntime.jsx("li", { className: Pagination_module.default.ellipsis, "aria-hidden": "true", children: "…" }, `ellipsis-${index}`)
86
+ ) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ className: clsx.clsx(Pagination_module.default.page, item === page && Pagination_module.default.isActive),
91
+ onClick: () => goTo(item),
92
+ "aria-current": item === page ? "page" : void 0,
93
+ "aria-label": `Go to page ${item}`,
94
+ children: item
95
+ }
96
+ ) }, item)
97
+ ),
98
+ showPrevNext && /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ className: Pagination_module.default.arrow,
103
+ onClick: () => goTo(page + 1),
104
+ disabled: page >= totalPages,
105
+ "aria-label": "Go to next page",
106
+ children: /* @__PURE__ */ jsxRuntime.jsx(Chevron, { direction: "right" })
107
+ }
108
+ ) })
109
+ ] }) });
110
+ }
111
+ );
112
+ Pagination.displayName = "Pagination";
113
+ exports.Pagination = Pagination;
21
114
  //# sourceMappingURL=index31.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index31.cjs","sources":["../src/layouts/SettingsLayout/SettingsLayout.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport type { SettingsLayoutProps } from './SettingsLayout.types';\nimport styles from './SettingsLayout.module.css';\n\nexport const SettingsLayout = ({\n sidebar,\n children,\n title,\n maxWidth = '48rem',\n sidebarCollapsed = false,\n className,\n}: SettingsLayoutProps) => (\n <div className={clsx(styles.root, className)}>\n {sidebar && (\n <aside className={clsx(styles.sidebar, { [styles.sidebarCollapsed]: sidebarCollapsed })}>\n {sidebar}\n </aside>\n )}\n <main className={styles.main}>\n <div className={styles.content} style={{ maxWidth }}>\n {title && <h1 className={styles.title}>{title}</h1>}\n {children}\n </div>\n </main>\n </div>\n);\n"],"names":["clsx","styles","jsx","jsxs"],"mappings":";;;;;AAIO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB;AACF,sCACG,OAAA,EAAI,WAAWA,KAAAA,KAAKC,sBAAAA,QAAO,MAAM,SAAS,GACxC,UAAA;AAAA,EAAA,WACCC,2BAAAA,IAAC,SAAA,EAAM,WAAWF,KAAAA,KAAKC,sBAAAA,QAAO,SAAS,EAAE,CAACA,sBAAAA,QAAO,gBAAgB,GAAG,iBAAA,CAAkB,GACnF,UAAA,SACH;AAAA,EAEFC,2BAAAA,IAAC,QAAA,EAAK,WAAWD,sBAAAA,QAAO,MACtB,UAAAE,2BAAAA,KAAC,OAAA,EAAI,WAAWF,sBAAAA,QAAO,SAAS,OAAO,EAAE,YACtC,UAAA;AAAA,IAAA,SAASC,2BAAAA,IAAC,MAAA,EAAG,WAAWD,sBAAAA,QAAO,OAAQ,UAAA,OAAM;AAAA,IAC7C;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAAA,EAAA,CACF;;"}
1
+ {"version":3,"file":"index31.cjs","sources":["../src/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { ICON_SIZE, PAGINATION, SVG_STROKE_WIDTH, SVG_VIEWBOX } from '../../constants';\nimport type { PaginationItem, PaginationProps } from './Pagination.types';\nimport styles from './Pagination.module.css';\n\nfunction range(start: number, end: number): number[] {\n const out: number[] = [];\n for (let page = start; page <= end; page += 1) out.push(page);\n return out;\n}\n\n/**\n * Builds the sequence of page numbers and ellipsis gaps to render, keeping the\n * first/last boundaries and a window of siblings around the current page.\n */\nfunction getPaginationItems(\n currentPage: number,\n totalPages: number,\n siblingCount: number,\n boundaryCount: number,\n): PaginationItem[] {\n const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;\n if (totalPages <= totalNumbers) return range(1, totalPages);\n\n const startPages = range(1, boundaryCount);\n const endPages = range(totalPages - boundaryCount + 1, totalPages);\n\n const siblingsStart = Math.max(\n Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n );\n const siblingsEnd = Math.min(\n Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages[0] - 2,\n );\n\n const items: PaginationItem[] = [...startPages];\n items.push(siblingsStart > boundaryCount + 2 ? 'ellipsis' : boundaryCount + 1);\n items.push(...range(siblingsStart, siblingsEnd));\n items.push(siblingsEnd < totalPages - boundaryCount - 1 ? 'ellipsis' : totalPages - boundaryCount);\n items.push(...endPages);\n\n return items;\n}\n\nfunction Chevron({ direction }: { direction: 'left' | 'right' }) {\n return (\n <svg\n width={ICON_SIZE.MD}\n height={ICON_SIZE.MD}\n viewBox={SVG_VIEWBOX}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={SVG_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points={direction === 'left' ? '15 18 9 12 15 6' : '9 18 15 12 9 6'} />\n </svg>\n );\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n currentPage,\n totalItems,\n pageSize,\n onPageChange,\n siblingCount = PAGINATION.SIBLING_COUNT,\n boundaryCount = PAGINATION.BOUNDARY_COUNT,\n showPrevNext = true,\n className,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n ) => {\n const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));\n const page = Math.min(Math.max(currentPage, 1), totalPages);\n const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);\n\n const goTo = (target: number) => {\n const next = Math.min(Math.max(target, 1), totalPages);\n if (next !== page) onPageChange(next);\n };\n\n return (\n <nav ref={ref} aria-label={ariaLabel} className={clsx(styles.root, className)} {...props}>\n <ul className={styles.list}>\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page - 1)}\n disabled={page <= 1}\n aria-label=\"Go to previous page\"\n >\n <Chevron direction=\"left\" />\n </button>\n </li>\n )}\n\n {items.map((item, index) =>\n item === 'ellipsis' ? (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`ellipsis-${index}`} className={styles.ellipsis} aria-hidden=\"true\">\n &hellip;\n </li>\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === page && styles.isActive)}\n onClick={() => goTo(item)}\n aria-current={item === page ? 'page' : undefined}\n aria-label={`Go to page ${item}`}\n >\n {item}\n </button>\n </li>\n ),\n )}\n\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page + 1)}\n disabled={page >= totalPages}\n aria-label=\"Go to next page\"\n >\n <Chevron direction=\"right\" />\n </button>\n </li>\n )}\n </ul>\n </nav>\n );\n },\n);\n\nPagination.displayName = 'Pagination';\n"],"names":["jsx","ICON_SIZE","SVG_VIEWBOX","SVG_STROKE_WIDTH","forwardRef","PAGINATION","clsx","styles"],"mappings":";;;;;;;AAMA,SAAS,MAAM,OAAe,KAAuB;AACnD,QAAM,MAAgB,CAAA;AACtB,WAAS,OAAO,OAAO,QAAQ,KAAK,QAAQ,EAAG,KAAI,KAAK,IAAI;AAC5D,SAAO;AACT;AAMA,SAAS,mBACP,aACA,YACA,cACA,eACkB;AAClB,QAAM,eAAe,gBAAgB,IAAI,eAAe,IAAI;AAC5D,MAAI,cAAc,aAAc,QAAO,MAAM,GAAG,UAAU;AAE1D,QAAM,aAAa,MAAM,GAAG,aAAa;AACzC,QAAM,WAAW,MAAM,aAAa,gBAAgB,GAAG,UAAU;AAEjE,QAAM,gBAAgB,KAAK;AAAA,IACzB,KAAK,IAAI,cAAc,cAAc,aAAa,gBAAgB,eAAe,IAAI,CAAC;AAAA,IACtF,gBAAgB;AAAA,EAAA;AAElB,QAAM,cAAc,KAAK;AAAA,IACvB,KAAK,IAAI,cAAc,cAAc,gBAAgB,eAAe,IAAI,CAAC;AAAA,IACzE,SAAS,CAAC,IAAI;AAAA,EAAA;AAGhB,QAAM,QAA0B,CAAC,GAAG,UAAU;AAC9C,QAAM,KAAK,gBAAgB,gBAAgB,IAAI,aAAa,gBAAgB,CAAC;AAC7E,QAAM,KAAK,GAAG,MAAM,eAAe,WAAW,CAAC;AAC/C,QAAM,KAAK,cAAc,aAAa,gBAAgB,IAAI,aAAa,aAAa,aAAa;AACjG,QAAM,KAAK,GAAG,QAAQ;AAEtB,SAAO;AACT;AAEA,SAAS,QAAQ,EAAE,aAA8C;AAC/D,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAOC,UAAAA,UAAU;AAAA,MACjB,QAAQ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AA,UAEX,UAAAP,2BAAAA,IAAC,SAAA,EAAQ,WAAU,OAAA,CAAO;AAAA,QAAA;AAAA,MAAA,GAE9B;AAAA,MAGD,MAAM;AAAA,QAAI,CAAC,MAAM,UAChB,SAAS;AAAA;AAAA,UAEPA,2BAAAA,IAAC,MAAA,EAA6B,WAAWO,kBAAAA,QAAO,UAAU,eAAY,QAAO,UAAA,IAAA,GAApE,YAAY,KAAK,EAE1B;AAAA,2CAEC,MAAA,EACC,UAAAP,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAWM,KAAAA,KAAKC,0BAAO,MAAM,SAAS,QAAQA,kBAAAA,QAAO,QAAQ;AAAA,YAC7D,SAAS,MAAM,KAAK,IAAI;AAAA,YACxB,gBAAc,SAAS,OAAO,SAAS;AAAA,YACvC,cAAY,cAAc,IAAI;AAAA,YAE7B,UAAA;AAAA,UAAA;AAAA,QAAA,KARI,IAUT;AAAA,MAAA;AAAA,MAIH,+CACE,MAAA,EACC,UAAAP,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAWO,kBAAAA,QAAO;AAAA,UAClB,SAAS,MAAM,KAAK,OAAO,CAAC;AAAA,UAC5B,UAAU,QAAQ;AAAA,UAClB,cAAW;AAAA,UAEX,UAAAP,2BAAAA,IAAC,SAAA,EAAQ,WAAU,QAAA,CAAQ;AAAA,QAAA;AAAA,MAAA,EAC7B,CACF;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;"}
package/dist/index31.js CHANGED
@@ -1,21 +1,114 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { clsx } from "./index38.js";
3
- import styles from "./index66.js";
4
- const SettingsLayout = ({
5
- sidebar,
6
- children,
7
- title,
8
- maxWidth = "48rem",
9
- sidebarCollapsed = false,
10
- className
11
- }) => /* @__PURE__ */ jsxs("div", { className: clsx(styles.root, className), children: [
12
- sidebar && /* @__PURE__ */ jsx("aside", { className: clsx(styles.sidebar, { [styles.sidebarCollapsed]: sidebarCollapsed }), children: sidebar }),
13
- /* @__PURE__ */ jsx("main", { className: styles.main, children: /* @__PURE__ */ jsxs("div", { className: styles.content, style: { maxWidth }, children: [
14
- title && /* @__PURE__ */ jsx("h1", { className: styles.title, children: title }),
15
- children
16
- ] }) })
17
- ] });
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { clsx } from "./index48.js";
4
+ import { PAGINATION, SVG_STROKE_WIDTH, SVG_VIEWBOX, ICON_SIZE } from "./index51.js";
5
+ import styles from "./index74.js";
6
+ function range(start, end) {
7
+ const out = [];
8
+ for (let page = start; page <= end; page += 1) out.push(page);
9
+ return out;
10
+ }
11
+ function getPaginationItems(currentPage, totalPages, siblingCount, boundaryCount) {
12
+ const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;
13
+ if (totalPages <= totalNumbers) return range(1, totalPages);
14
+ const startPages = range(1, boundaryCount);
15
+ const endPages = range(totalPages - boundaryCount + 1, totalPages);
16
+ const siblingsStart = Math.max(
17
+ Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),
18
+ boundaryCount + 2
19
+ );
20
+ const siblingsEnd = Math.min(
21
+ Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),
22
+ endPages[0] - 2
23
+ );
24
+ const items = [...startPages];
25
+ items.push(siblingsStart > boundaryCount + 2 ? "ellipsis" : boundaryCount + 1);
26
+ items.push(...range(siblingsStart, siblingsEnd));
27
+ items.push(siblingsEnd < totalPages - boundaryCount - 1 ? "ellipsis" : totalPages - boundaryCount);
28
+ items.push(...endPages);
29
+ return items;
30
+ }
31
+ function Chevron({ direction }) {
32
+ return /* @__PURE__ */ jsx(
33
+ "svg",
34
+ {
35
+ width: ICON_SIZE.MD,
36
+ height: ICON_SIZE.MD,
37
+ viewBox: SVG_VIEWBOX,
38
+ fill: "none",
39
+ stroke: "currentColor",
40
+ strokeWidth: SVG_STROKE_WIDTH,
41
+ strokeLinecap: "round",
42
+ strokeLinejoin: "round",
43
+ "aria-hidden": "true",
44
+ children: /* @__PURE__ */ jsx("polyline", { points: direction === "left" ? "15 18 9 12 15 6" : "9 18 15 12 9 6" })
45
+ }
46
+ );
47
+ }
48
+ const Pagination = forwardRef(
49
+ ({
50
+ currentPage,
51
+ totalItems,
52
+ pageSize,
53
+ onPageChange,
54
+ siblingCount = PAGINATION.SIBLING_COUNT,
55
+ boundaryCount = PAGINATION.BOUNDARY_COUNT,
56
+ showPrevNext = true,
57
+ className,
58
+ "aria-label": ariaLabel = "Pagination",
59
+ ...props
60
+ }, ref) => {
61
+ const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));
62
+ const page = Math.min(Math.max(currentPage, 1), totalPages);
63
+ const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);
64
+ const goTo = (target) => {
65
+ const next = Math.min(Math.max(target, 1), totalPages);
66
+ if (next !== page) onPageChange(next);
67
+ };
68
+ return /* @__PURE__ */ jsx("nav", { ref, "aria-label": ariaLabel, className: clsx(styles.root, className), ...props, children: /* @__PURE__ */ jsxs("ul", { className: styles.list, children: [
69
+ showPrevNext && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
70
+ "button",
71
+ {
72
+ type: "button",
73
+ className: styles.arrow,
74
+ onClick: () => goTo(page - 1),
75
+ disabled: page <= 1,
76
+ "aria-label": "Go to previous page",
77
+ children: /* @__PURE__ */ jsx(Chevron, { direction: "left" })
78
+ }
79
+ ) }),
80
+ items.map(
81
+ (item, index) => item === "ellipsis" ? (
82
+ // eslint-disable-next-line react/no-array-index-key
83
+ /* @__PURE__ */ jsx("li", { className: styles.ellipsis, "aria-hidden": "true", children: "…" }, `ellipsis-${index}`)
84
+ ) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
85
+ "button",
86
+ {
87
+ type: "button",
88
+ className: clsx(styles.page, item === page && styles.isActive),
89
+ onClick: () => goTo(item),
90
+ "aria-current": item === page ? "page" : void 0,
91
+ "aria-label": `Go to page ${item}`,
92
+ children: item
93
+ }
94
+ ) }, item)
95
+ ),
96
+ showPrevNext && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
97
+ "button",
98
+ {
99
+ type: "button",
100
+ className: styles.arrow,
101
+ onClick: () => goTo(page + 1),
102
+ disabled: page >= totalPages,
103
+ "aria-label": "Go to next page",
104
+ children: /* @__PURE__ */ jsx(Chevron, { direction: "right" })
105
+ }
106
+ ) })
107
+ ] }) });
108
+ }
109
+ );
110
+ Pagination.displayName = "Pagination";
18
111
  export {
19
- SettingsLayout
112
+ Pagination
20
113
  };
21
114
  //# sourceMappingURL=index31.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index31.js","sources":["../src/layouts/SettingsLayout/SettingsLayout.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport type { SettingsLayoutProps } from './SettingsLayout.types';\nimport styles from './SettingsLayout.module.css';\n\nexport const SettingsLayout = ({\n sidebar,\n children,\n title,\n maxWidth = '48rem',\n sidebarCollapsed = false,\n className,\n}: SettingsLayoutProps) => (\n <div className={clsx(styles.root, className)}>\n {sidebar && (\n <aside className={clsx(styles.sidebar, { [styles.sidebarCollapsed]: sidebarCollapsed })}>\n {sidebar}\n </aside>\n )}\n <main className={styles.main}>\n <div className={styles.content} style={{ maxWidth }}>\n {title && <h1 className={styles.title}>{title}</h1>}\n {children}\n </div>\n </main>\n </div>\n);\n"],"names":[],"mappings":";;;AAIO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB;AACF,2BACG,OAAA,EAAI,WAAW,KAAK,OAAO,MAAM,SAAS,GACxC,UAAA;AAAA,EAAA,WACC,oBAAC,SAAA,EAAM,WAAW,KAAK,OAAO,SAAS,EAAE,CAAC,OAAO,gBAAgB,GAAG,iBAAA,CAAkB,GACnF,UAAA,SACH;AAAA,EAEF,oBAAC,QAAA,EAAK,WAAW,OAAO,MACtB,UAAA,qBAAC,OAAA,EAAI,WAAW,OAAO,SAAS,OAAO,EAAE,YACtC,UAAA;AAAA,IAAA,SAAS,oBAAC,MAAA,EAAG,WAAW,OAAO,OAAQ,UAAA,OAAM;AAAA,IAC7C;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAAA,EAAA,CACF;"}
1
+ {"version":3,"file":"index31.js","sources":["../src/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { ICON_SIZE, PAGINATION, SVG_STROKE_WIDTH, SVG_VIEWBOX } from '../../constants';\nimport type { PaginationItem, PaginationProps } from './Pagination.types';\nimport styles from './Pagination.module.css';\n\nfunction range(start: number, end: number): number[] {\n const out: number[] = [];\n for (let page = start; page <= end; page += 1) out.push(page);\n return out;\n}\n\n/**\n * Builds the sequence of page numbers and ellipsis gaps to render, keeping the\n * first/last boundaries and a window of siblings around the current page.\n */\nfunction getPaginationItems(\n currentPage: number,\n totalPages: number,\n siblingCount: number,\n boundaryCount: number,\n): PaginationItem[] {\n const totalNumbers = boundaryCount * 2 + siblingCount * 2 + 3;\n if (totalPages <= totalNumbers) return range(1, totalPages);\n\n const startPages = range(1, boundaryCount);\n const endPages = range(totalPages - boundaryCount + 1, totalPages);\n\n const siblingsStart = Math.max(\n Math.min(currentPage - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n );\n const siblingsEnd = Math.min(\n Math.max(currentPage + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages[0] - 2,\n );\n\n const items: PaginationItem[] = [...startPages];\n items.push(siblingsStart > boundaryCount + 2 ? 'ellipsis' : boundaryCount + 1);\n items.push(...range(siblingsStart, siblingsEnd));\n items.push(siblingsEnd < totalPages - boundaryCount - 1 ? 'ellipsis' : totalPages - boundaryCount);\n items.push(...endPages);\n\n return items;\n}\n\nfunction Chevron({ direction }: { direction: 'left' | 'right' }) {\n return (\n <svg\n width={ICON_SIZE.MD}\n height={ICON_SIZE.MD}\n viewBox={SVG_VIEWBOX}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={SVG_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points={direction === 'left' ? '15 18 9 12 15 6' : '9 18 15 12 9 6'} />\n </svg>\n );\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n currentPage,\n totalItems,\n pageSize,\n onPageChange,\n siblingCount = PAGINATION.SIBLING_COUNT,\n boundaryCount = PAGINATION.BOUNDARY_COUNT,\n showPrevNext = true,\n className,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n ) => {\n const totalPages = Math.max(1, Math.ceil(totalItems / Math.max(1, pageSize)));\n const page = Math.min(Math.max(currentPage, 1), totalPages);\n const items = getPaginationItems(page, totalPages, siblingCount, boundaryCount);\n\n const goTo = (target: number) => {\n const next = Math.min(Math.max(target, 1), totalPages);\n if (next !== page) onPageChange(next);\n };\n\n return (\n <nav ref={ref} aria-label={ariaLabel} className={clsx(styles.root, className)} {...props}>\n <ul className={styles.list}>\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page - 1)}\n disabled={page <= 1}\n aria-label=\"Go to previous page\"\n >\n <Chevron direction=\"left\" />\n </button>\n </li>\n )}\n\n {items.map((item, index) =>\n item === 'ellipsis' ? (\n // eslint-disable-next-line react/no-array-index-key\n <li key={`ellipsis-${index}`} className={styles.ellipsis} aria-hidden=\"true\">\n &hellip;\n </li>\n ) : (\n <li key={item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === page && styles.isActive)}\n onClick={() => goTo(item)}\n aria-current={item === page ? 'page' : undefined}\n aria-label={`Go to page ${item}`}\n >\n {item}\n </button>\n </li>\n ),\n )}\n\n {showPrevNext && (\n <li>\n <button\n type=\"button\"\n className={styles.arrow}\n onClick={() => goTo(page + 1)}\n disabled={page >= totalPages}\n aria-label=\"Go to next page\"\n >\n <Chevron direction=\"right\" />\n </button>\n </li>\n )}\n </ul>\n </nav>\n );\n },\n);\n\nPagination.displayName = 'Pagination';\n"],"names":[],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,KAAuB;AACnD,QAAM,MAAgB,CAAA;AACtB,WAAS,OAAO,OAAO,QAAQ,KAAK,QAAQ,EAAG,KAAI,KAAK,IAAI;AAC5D,SAAO;AACT;AAMA,SAAS,mBACP,aACA,YACA,cACA,eACkB;AAClB,QAAM,eAAe,gBAAgB,IAAI,eAAe,IAAI;AAC5D,MAAI,cAAc,aAAc,QAAO,MAAM,GAAG,UAAU;AAE1D,QAAM,aAAa,MAAM,GAAG,aAAa;AACzC,QAAM,WAAW,MAAM,aAAa,gBAAgB,GAAG,UAAU;AAEjE,QAAM,gBAAgB,KAAK;AAAA,IACzB,KAAK,IAAI,cAAc,cAAc,aAAa,gBAAgB,eAAe,IAAI,CAAC;AAAA,IACtF,gBAAgB;AAAA,EAAA;AAElB,QAAM,cAAc,KAAK;AAAA,IACvB,KAAK,IAAI,cAAc,cAAc,gBAAgB,eAAe,IAAI,CAAC;AAAA,IACzE,SAAS,CAAC,IAAI;AAAA,EAAA;AAGhB,QAAM,QAA0B,CAAC,GAAG,UAAU;AAC9C,QAAM,KAAK,gBAAgB,gBAAgB,IAAI,aAAa,gBAAgB,CAAC;AAC7E,QAAM,KAAK,GAAG,MAAM,eAAe,WAAW,CAAC;AAC/C,QAAM,KAAK,cAAc,aAAa,gBAAgB,IAAI,aAAa,aAAa,aAAa;AACjG,QAAM,KAAK,GAAG,QAAQ;AAEtB,SAAO;AACT;AAEA,SAAS,QAAQ,EAAE,aAA8C;AAC/D,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,UAAU;AAAA,MACjB,QAAQ,UAAU;AAAA,MAClB,SAAS;AAAA,M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,UAChB,SAAS;AAAA;AAAA,UAEP,oBAAC,MAAA,EAA6B,WAAW,OAAO,UAAU,eAAY,QAAO,UAAA,IAAA,GAApE,YAAY,KAAK,EAE1B;AAAA,gCAEC,MAAA,EACC,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAW,KAAK,OAAO,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAAA,YAC7D,SAAS,MAAM,KAAK,IAAI;AAAA,YACxB,gBAAc,SAAS,OAAO,SAAS;AAAA,YACvC,cAAY,cAAc,IAAI;AAAA,YAE7B,UAAA;AAAA,UAAA;AAAA,QAAA,KARI,IAUT;AAAA,MAAA;AAAA,MAIH,oCACE,MAAA,EACC,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAW,OAAO;AAAA,UAClB,SAAS,MAAM,KAAK,OAAO,CAAC;AAAA,UAC5B,UAAU,QAAQ;AAAA,UAClB,cAAW;AAAA,UAEX,UAAA,oBAAC,SAAA,EAAQ,WAAU,QAAA,CAAQ;AAAA,QAAA;AAAA,MAAA,EAC7B,CACF;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;"}
package/dist/index32.cjs CHANGED
@@ -2,80 +2,81 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const clsx = require("./index38.cjs");
6
- const constants = require("./index45.cjs");
7
- const Sidebar_module = require("./index48.cjs");
8
- const SidebarContext = react.createContext({ isCollapsed: false });
9
- const useSidebarContext = () => react.useContext(SidebarContext);
10
- const SidebarSection = ({
11
- title,
12
- children,
13
- collapsible = false,
14
- defaultCollapsed = false
5
+ const constants = require("./index51.cjs");
6
+ const ResizableSplitPanel_module = require("./index66.cjs");
7
+ const FULL_PERCENT = 100;
8
+ const ResizableSplitPanel = ({
9
+ leftPanel,
10
+ rightPanel,
11
+ defaultLeftWidth = 50,
12
+ minLeftWidth = 30,
13
+ minRightWidth = 30
15
14
  }) => {
16
- const { isCollapsed: sidebarCollapsed } = useSidebarContext();
17
- const [sectionCollapsed, setSectionCollapsed] = react.useState(defaultCollapsed);
18
- const titleId = react.useId();
19
- const isOpen = !collapsible || !sectionCollapsed;
20
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Sidebar_module.default.section, role: "group", "aria-labelledby": title ? titleId : void 0, children: [
21
- title && !sidebarCollapsed && (collapsible ? /* @__PURE__ */ jsxRuntime.jsxs(
22
- "button",
15
+ const [leftWidth, setLeftWidth] = react.useState(defaultLeftWidth);
16
+ const [isDragging, setIsDragging] = react.useState(false);
17
+ const containerRef = react.useRef(null);
18
+ const clampWidth = react.useCallback(
19
+ (w) => Math.max(minLeftWidth, Math.min(FULL_PERCENT - minRightWidth, w)),
20
+ [minLeftWidth, minRightWidth]
21
+ );
22
+ const handleMouseDown = react.useCallback((e) => {
23
+ e.preventDefault();
24
+ setIsDragging(true);
25
+ }, []);
26
+ const handleMouseMove = react.useCallback(
27
+ (e) => {
28
+ if (!isDragging || !containerRef.current) return;
29
+ const rect = containerRef.current.getBoundingClientRect();
30
+ const pct = (e.clientX - rect.left) / rect.width * FULL_PERCENT;
31
+ setLeftWidth(clampWidth(pct));
32
+ },
33
+ [isDragging, clampWidth]
34
+ );
35
+ const handleMouseUp = react.useCallback(() => setIsDragging(false), []);
36
+ react.useEffect(() => {
37
+ if (!isDragging) return;
38
+ document.addEventListener("mousemove", handleMouseMove);
39
+ document.addEventListener("mouseup", handleMouseUp);
40
+ document.body.style.cursor = "col-resize";
41
+ document.body.style.userSelect = "none";
42
+ return () => {
43
+ document.removeEventListener("mousemove", handleMouseMove);
44
+ document.removeEventListener("mouseup", handleMouseUp);
45
+ document.body.style.cursor = "";
46
+ document.body.style.userSelect = "";
47
+ };
48
+ }, [isDragging, handleMouseMove, handleMouseUp]);
49
+ const handleKeyDown = (e) => {
50
+ if (e.key === "ArrowRight") {
51
+ e.preventDefault();
52
+ setLeftWidth((w) => clampWidth(w + constants.KEYBOARD_STEP));
53
+ } else if (e.key === "ArrowLeft") {
54
+ e.preventDefault();
55
+ setLeftWidth((w) => clampWidth(w - constants.KEYBOARD_STEP));
56
+ }
57
+ };
58
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResizableSplitPanel_module.default.root, ref: containerRef, children: [
59
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ResizableSplitPanel_module.default.left, style: { width: `${leftWidth}%` }, children: leftPanel }),
60
+ /* @__PURE__ */ jsxRuntime.jsx(
61
+ "div",
23
62
  {
24
- id: titleId,
25
- type: "button",
26
- className: Sidebar_module.default.sectionToggle,
27
- onClick: () => setSectionCollapsed((prev) => !prev),
28
- "aria-expanded": isOpen,
29
- children: [
30
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Sidebar_module.default.sectionTitle, children: title }),
31
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx.clsx(Sidebar_module.default.sectionChevron, { [Sidebar_module.default.sectionChevronOpen]: isOpen }), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) }) })
32
- ]
63
+ className: ResizableSplitPanel_module.default.divider,
64
+ onMouseDown: handleMouseDown,
65
+ onKeyDown: handleKeyDown,
66
+ role: "separator",
67
+ "aria-orientation": "vertical",
68
+ "aria-valuenow": Math.round(leftWidth),
69
+ "aria-label": "Resize panels",
70
+ tabIndex: 0,
71
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: ResizableSplitPanel_module.default.dividerHandle, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: 4, height: 24, viewBox: "0 0 4 24", fill: "none", children: [
72
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 2, cy: 6, r: 1.5, fill: "currentColor" }),
73
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 2, cy: 12, r: 1.5, fill: "currentColor" }),
74
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 2, cy: 18, r: 1.5, fill: "currentColor" })
75
+ ] }) })
33
76
  }
34
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { id: titleId, className: Sidebar_module.default.sectionTitle, children: title })),
35
- isOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sidebar_module.default.sectionItems, children })
77
+ ),
78
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ResizableSplitPanel_module.default.right, style: { width: `${FULL_PERCENT - leftWidth}%` }, children: rightPanel })
36
79
  ] });
37
80
  };
38
- SidebarSection.displayName = "Sidebar.Section";
39
- const SidebarRoot = ({
40
- isCollapsed = false,
41
- onToggleCollapse,
42
- width = constants.SIDEBAR.WIDTH,
43
- collapsedWidth = constants.SIDEBAR.COLLAPSED_WIDTH,
44
- header,
45
- footer,
46
- children,
47
- className
48
- }) => {
49
- const currentWidth = isCollapsed ? collapsedWidth : width;
50
- return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: { isCollapsed }, children: /* @__PURE__ */ jsxRuntime.jsxs(
51
- "nav",
52
- {
53
- className: clsx.clsx(Sidebar_module.default.root, { [Sidebar_module.default.collapsed]: isCollapsed }, className),
54
- style: { width: `${currentWidth}px` },
55
- "aria-label": "Main navigation",
56
- children: [
57
- header && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sidebar_module.default.header, children: header }),
58
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sidebar_module.default.body, children }),
59
- footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sidebar_module.default.footer, children: footer }),
60
- onToggleCollapse && /* @__PURE__ */ jsxRuntime.jsx(
61
- "button",
62
- {
63
- type: "button",
64
- className: Sidebar_module.default.toggle,
65
- onClick: onToggleCollapse,
66
- "aria-expanded": !isCollapsed,
67
- "aria-label": "Toggle sidebar",
68
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: isCollapsed ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 3L11 8L6 13", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 3L5 8L10 13", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }) })
69
- }
70
- )
71
- ]
72
- }
73
- ) });
74
- };
75
- SidebarRoot.displayName = "Sidebar";
76
- const Sidebar = Object.assign(SidebarRoot, {
77
- Section: SidebarSection
78
- });
79
- exports.Sidebar = Sidebar;
80
- exports.useSidebarContext = useSidebarContext;
81
+ exports.ResizableSplitPanel = ResizableSplitPanel;
81
82
  //# sourceMappingURL=index32.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index32.cjs","sources":["../src/composites/Sidebar/Sidebar.tsx"],"sourcesContent":["import { createContext, useContext, useId, useState } from 'react';\nimport clsx from 'clsx';\nimport { SIDEBAR } from '../../constants';\nimport type { SidebarProps, SidebarSectionProps } from './Sidebar.types';\nimport styles from './Sidebar.module.css';\n\ninterface SidebarContextValue {\n isCollapsed: boolean;\n}\n\nconst SidebarContext = createContext<SidebarContextValue>({ isCollapsed: false });\n\n/** Hook to read sidebar collapsed state from context. */\nexport const useSidebarContext = () => useContext(SidebarContext);\n\n/* ------------------------------------------------------------------ */\n/* Sidebar.Section */\n/* ------------------------------------------------------------------ */\n\nconst SidebarSection = ({\n title,\n children,\n collapsible = false,\n defaultCollapsed = false,\n}: SidebarSectionProps) => {\n const { isCollapsed: sidebarCollapsed } = useSidebarContext();\n const [sectionCollapsed, setSectionCollapsed] = useState(defaultCollapsed);\n const titleId = useId();\n\n const isOpen = !collapsible || !sectionCollapsed;\n\n return (\n <div className={styles.section} role=\"group\" aria-labelledby={title ? titleId : undefined}>\n {title && !sidebarCollapsed && (\n collapsible ? (\n <button\n id={titleId}\n type=\"button\"\n className={styles.sectionToggle}\n onClick={() => setSectionCollapsed((prev) => !prev)}\n aria-expanded={isOpen}\n >\n <span className={styles.sectionTitle}>{title}</span>\n <span className={clsx(styles.sectionChevron, { [styles.sectionChevronOpen]: isOpen })}>\n <svg width={12} height={12} viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M3 4.5L6 7.5L9 4.5\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </span>\n </button>\n ) : (\n <span id={titleId} className={styles.sectionTitle}>\n {title}\n </span>\n )\n )}\n {isOpen && <div className={styles.sectionItems}>{children}</div>}\n </div>\n );\n};\n\nSidebarSection.displayName = 'Sidebar.Section';\n\n/* ------------------------------------------------------------------ */\n/* Sidebar */\n/* ------------------------------------------------------------------ */\n\nconst SidebarRoot = ({\n isCollapsed = false,\n onToggleCollapse,\n width = SIDEBAR.WIDTH,\n collapsedWidth = SIDEBAR.COLLAPSED_WIDTH,\n header,\n footer,\n children,\n className,\n}: SidebarProps) => {\n const currentWidth = isCollapsed ? collapsedWidth : width;\n\n return (\n <SidebarContext.Provider value={{ isCollapsed }}>\n <nav\n className={clsx(styles.root, { [styles.collapsed]: isCollapsed }, className)}\n style={{ width: `${currentWidth}px` }}\n aria-label=\"Main navigation\"\n >\n {header && <div className={styles.header}>{header}</div>}\n\n <div className={styles.body}>{children}</div>\n\n {footer && <div className={styles.footer}>{footer}</div>}\n\n {onToggleCollapse && (\n <button\n type=\"button\"\n className={styles.toggle}\n onClick={onToggleCollapse}\n aria-expanded={!isCollapsed}\n aria-label=\"Toggle sidebar\"\n >\n <svg width={16} height={16} viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n {isCollapsed ? (\n <path d=\"M6 3L11 8L6 13\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n ) : (\n <path d=\"M10 3L5 8L10 13\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n )}\n </svg>\n </button>\n )}\n </nav>\n </SidebarContext.Provider>\n );\n};\n\nSidebarRoot.displayName = 'Sidebar';\n\n/** Compound Sidebar component. */\nexport const Sidebar = Object.assign(SidebarRoot, {\n Section: SidebarSection,\n});\n"],"names":["createContext","useContext","useState","useId","jsxs","styles","jsx","clsx","SIDEBAR"],"mappings":";;;;;;;AAUA,MAAM,iBAAiBA,MAAAA,cAAmC,EAAE,aAAa,OAAO;AAGzE,MAAM,oBAAoB,MAAMC,MAAAA,WAAW,cAAc;AAMhE,MAAM,iBAAiB,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB;AACrB,MAA2B;AACzB,QAAM,EAAE,aAAa,iBAAA,IAAqB,kBAAA;AAC1C,QAAM,CAAC,kBAAkB,mBAAmB,IAAIC,MAAAA,SAAS,gBAAgB;AACzE,QAAM,UAAUC,MAAAA,MAAA;AAEhB,QAAM,SAAS,CAAC,eAAe,CAAC;AAEhC,SACEC,2BAAAA,KAAC,OAAA,EAAI,WAAWC,eAAAA,QAAO,SAAS,MAAK,SAAQ,mBAAiB,QAAQ,UAAU,QAC7E,UAAA;AAAA,IAAA,SAAS,CAAC,qBACT,cACED,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,QACJ,MAAK;AAAA,QACL,WAAWC,eAAAA,QAAO;AAAA,QAClB,SAAS,MAAM,oBAAoB,CAAC,SAAS,CAAC,IAAI;AAAA,QAClD,iBAAe;AAAA,QAEf,UAAA;AAAA,UAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAWD,eAAAA,QAAO,cAAe,UAAA,OAAM;AAAA,yCAC5C,QAAA,EAAK,WAAWE,KAAAA,KAAKF,e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AA,QAAO,QAAS,UAAA,QAAO;AAAA,QAEjD,oBACCC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAWD,eAAAA,QAAO;AAAA,YAClB,SAAS;AAAA,YACT,iBAAe,CAAC;AAAA,YAChB,cAAW;AAAA,YAEX,yCAAC,OAAA,EAAI,OAAO,IAAI,QAAQ,IAAI,SAAQ,aAAY,MAAK,QAAO,eAAY,QACrE,UAAA,6CACE,QAAA,EAAK,GAAE,kBAAiB,QAAO,gBAAe,aAAa,KAAK,eAAc,SAAQ,gBAAe,SAAQ,mCAE7G,QAAA,EAAK,GAAE,mBAAkB,QAAO,gBAAe,aAAa,KAAK,eAAc,SAAQ,gBAAe,SAAQ,EAAA,CAEnH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEA,YAAY,cAAc;AAGnB,MAAM,UAAU,OAAO,OAAO,aAAa;AAAA,EAChD,SAAS;AACX,CAAC;;;"}
1
+ {"version":3,"file":"index32.cjs","sources":["../src/composites/ResizableSplitPanel/ResizableSplitPanel.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';\nimport { KEYBOARD_STEP } from '../../constants';\nimport styles from './ResizableSplitPanel.module.css';\n\nexport interface ResizableSplitPanelProps {\n /** Content for the left panel. */\n leftPanel: ReactNode;\n /** Content for the right panel. */\n rightPanel: ReactNode;\n /** Default left panel width as a percentage (0-100). */\n defaultLeftWidth?: number;\n /** Minimum left panel width as a percentage. */\n minLeftWidth?: number;\n /** Minimum right panel width as a percentage. */\n minRightWidth?: number;\n}\n\nconst FULL_PERCENT = 100;\n\nexport const ResizableSplitPanel = ({\n leftPanel,\n rightPanel,\n defaultLeftWidth = 50,\n minLeftWidth = 30,\n minRightWidth = 30,\n}: ResizableSplitPanelProps) => {\n const [leftWidth, setLeftWidth] = useState(defaultLeftWidth);\n const [isDragging, setIsDragging] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const clampWidth = useCallback(\n (w: number) => Math.max(minLeftWidth, Math.min(FULL_PERCENT - minRightWidth, w)),\n [minLeftWidth, minRightWidth],\n );\n\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n setIsDragging(true);\n }, []);\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isDragging || !containerRef.current) return;\n const rect = containerRef.current.getBoundingClientRect();\n const pct = ((e.clientX - rect.left) / rect.width) * FULL_PERCENT;\n setLeftWidth(clampWidth(pct));\n },\n [isDragging, clampWidth],\n );\n\n const handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n useEffect(() => {\n if (!isDragging) return;\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n document.body.style.cursor = 'col-resize';\n document.body.style.userSelect = 'none';\n return () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n };\n }, [isDragging, handleMouseMove, handleMouseUp]);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n setLeftWidth((w) => clampWidth(w + KEYBOARD_STEP));\n } else if (e.key === 'ArrowLeft') {\n e.preventDefault();\n setLeftWidth((w) => clampWidth(w - KEYBOARD_STEP));\n }\n };\n\n return (\n <div className={styles.root} ref={containerRef}>\n <div className={styles.left} style={{ width: `${leftWidth}%` }}>\n {leftPanel}\n </div>\n <div\n className={styles.divider}\n onMouseDown={handleMouseDown}\n onKeyDown={handleKeyDown}\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-valuenow={Math.round(leftWidth)}\n aria-label=\"Resize panels\"\n tabIndex={0}\n >\n <div className={styles.dividerHandle}>\n <svg width={4} height={24} viewBox=\"0 0 4 24\" fill=\"none\">\n <circle cx={2} cy={6} r={1.5} fill=\"currentColor\" />\n <circle cx={2} cy={12} r={1.5} fill=\"currentColor\" />\n <circle cx={2} cy={18} r={1.5} fill=\"currentColor\" />\n </svg>\n </div>\n </div>\n <div className={styles.right} style={{ width: `${FULL_PERCENT - leftWidth}%` }}>\n {rightPanel}\n </div>\n </div>\n );\n};\n"],"names":["useState","useRef","useCallback","useEffect","KEYBOARD_STEP","styles","jsx","jsxs"],"mappings":";;;;;;AAiBA,MAAM,eAAe;AAEd,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,gBAAgB;AAClB,MAAgC;AAC9B,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAS,gBAAgB;AAC3D,QAAM,CAAC,YAAY,aAAa,IAAIA,MAAAA,SAAS,KAAK;AAClD,QAAM,eAAeC,MAAAA,OAAuB,IAAI;AAEhD,QAAM,aAAaC,MAAAA;AAAAA,IACjB,CAAC,MAAc,KAAK,IAAI,cAAc,KAAK,IAAI,eAAe,eAAe,CAAC,CAAC;AAAA,IAC/E,CAAC,cAAc,aAAa;AAAA,EAAA;AAG9B,QAAM,kBAAkBA,kBAAY,CAAC,MAAwB;AAC3D,MAAE,eAAA;AACF,kBAAc,IAAI;AAAA,EACpB,GAAG,CAAA,CAAE;AAEL,QAAM,kBAAkBA,MAAAA;AAAAA,IACtB,CAAC,MAAkB;AACjB,UAAI,CAAC,cAAc,CAAC,aAAa,QAAS;AAC1C,YAAM,OAAO,aAAa,QAAQ,sBAAA;AAClC,YAAM,OAAQ,EAAE,UAAU,KAAK,QAAQ,KAAK,QAAS;AACrD,mBAAa,WAAW,GAAG,CAAC;AAAA,IAC9B;AAAA,IACA,CAAC,YAAY,UAAU;AAAA,EAAA;AAGzB,QAAM,gBAAgBA,MAAAA,YAAY,MAAM,cAAc,KAAK,GAAG,CAAA,CAAE;AAEhEC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,WAAY;AACjB,aAAS,iBAAiB,aAAa,eAAe;AACtD,aAAS,iB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