@soroush.tech/design-system 2.0.0-rc.1 → 2.0.0-rc.3

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 (324) hide show
  1. package/README.md +30 -10
  2. package/dist/AppBar.d.cts +1 -3
  3. package/dist/AppBar.d.mts +1 -3
  4. package/dist/Avatar.cjs +1 -1
  5. package/dist/Avatar.d.cts +1 -3
  6. package/dist/Avatar.d.mts +1 -3
  7. package/dist/Avatar.mjs +1 -1
  8. package/dist/Backdrop.d.cts +1 -1
  9. package/dist/Backdrop.d.mts +1 -1
  10. package/dist/Breadcrumbs.cjs +132 -0
  11. package/dist/Breadcrumbs.d.cts +40 -0
  12. package/dist/Breadcrumbs.d.mts +40 -0
  13. package/dist/Breadcrumbs.mjs +131 -0
  14. package/dist/Button.cjs +1 -1
  15. package/dist/Button.d.cts +1 -1
  16. package/dist/Button.d.mts +1 -1
  17. package/dist/Button.mjs +1 -1
  18. package/dist/ButtonGroup.d.cts +1 -1
  19. package/dist/ButtonGroup.d.mts +1 -1
  20. package/dist/Card.cjs +3 -3
  21. package/dist/Card.d.cts +4 -3
  22. package/dist/Card.d.mts +4 -3
  23. package/dist/Card.mjs +3 -3
  24. package/dist/Checkbox.d.cts +1 -2
  25. package/dist/Checkbox.d.mts +1 -2
  26. package/dist/CircularProgress.d.cts +2 -3
  27. package/dist/CircularProgress.d.mts +2 -3
  28. package/dist/Drawer.d.cts +3 -2
  29. package/dist/Drawer.d.mts +3 -2
  30. package/dist/Flex.d.cts +1 -1
  31. package/dist/Flex.d.mts +1 -1
  32. package/dist/Form.d.cts +1 -1
  33. package/dist/Form.d.mts +1 -1
  34. package/dist/FormControl.cjs +10 -2
  35. package/dist/FormControl.d.cts +9 -2
  36. package/dist/FormControl.d.mts +9 -2
  37. package/dist/FormControl.mjs +10 -2
  38. package/dist/FormHelperText.d.cts +1 -1
  39. package/dist/FormHelperText.d.mts +1 -1
  40. package/dist/FormLabel.cjs +9 -1
  41. package/dist/FormLabel.d.cts +2 -2
  42. package/dist/FormLabel.d.mts +2 -2
  43. package/dist/FormLabel.mjs +10 -2
  44. package/dist/Grid.d.cts +1 -3
  45. package/dist/Grid.d.mts +1 -3
  46. package/dist/{Icon-CH3asUJu.mjs → Icon-BihOAP4u.mjs} +52 -2
  47. package/dist/{Icon-CI6q2Eyi.cjs → Icon-D-EWsBVg.cjs} +52 -2
  48. package/dist/Icon.cjs +1 -1
  49. package/dist/Icon.d.cts +1 -1
  50. package/dist/Icon.d.mts +1 -1
  51. package/dist/Icon.mjs +1 -1
  52. package/dist/Image.d.cts +1 -2
  53. package/dist/Image.d.mts +1 -2
  54. package/dist/InputRange.cjs +675 -0
  55. package/dist/InputRange.d.cts +79 -0
  56. package/dist/InputRange.d.mts +79 -0
  57. package/dist/InputRange.mjs +673 -0
  58. package/dist/LinearProgress.d.cts +2 -3
  59. package/dist/LinearProgress.d.mts +2 -3
  60. package/dist/Link.cjs +1 -1
  61. package/dist/Link.d.cts +1 -1
  62. package/dist/Link.d.mts +1 -1
  63. package/dist/Link.mjs +1 -1
  64. package/dist/Menu/ContextMenu.cjs +146 -0
  65. package/dist/Menu/ContextMenu.d.cts +52 -0
  66. package/dist/Menu/ContextMenu.d.mts +52 -0
  67. package/dist/Menu/ContextMenu.mjs +145 -0
  68. package/dist/Menu/Menu.cjs +3 -0
  69. package/dist/Menu/Menu.d.cts +2 -0
  70. package/dist/Menu/Menu.d.mts +2 -0
  71. package/dist/Menu/Menu.mjs +2 -0
  72. package/dist/Menu/MenuDivider.cjs +29 -0
  73. package/dist/Menu/MenuDivider.d.cts +12 -0
  74. package/dist/Menu/MenuDivider.d.mts +12 -0
  75. package/dist/Menu/MenuDivider.mjs +28 -0
  76. package/dist/Menu/MenuItems.cjs +29 -0
  77. package/dist/Menu/MenuItems.d.cts +2 -0
  78. package/dist/Menu/MenuItems.d.mts +2 -0
  79. package/dist/Menu/MenuItems.mjs +28 -0
  80. package/dist/Menu/MenuList.cjs +3 -0
  81. package/dist/Menu/MenuList.d.cts +38 -0
  82. package/dist/Menu/MenuList.d.mts +38 -0
  83. package/dist/Menu/MenuList.mjs +2 -0
  84. package/dist/Menu-Cgg-sX4W.cjs +173 -0
  85. package/dist/Menu-CrzHc_cn.mjs +168 -0
  86. package/dist/Menu.cjs +13 -0
  87. package/dist/Menu.d.cts +7 -0
  88. package/dist/Menu.d.mts +7 -0
  89. package/dist/Menu.mjs +6 -0
  90. package/dist/MenuItem-BTP7Ijwi.cjs +673 -0
  91. package/dist/MenuItem-DUn4IZKK.mjs +649 -0
  92. package/dist/MenuItem.cjs +2 -148
  93. package/dist/MenuItem.d.cts +2 -52
  94. package/dist/MenuItem.d.mts +2 -52
  95. package/dist/MenuItem.mjs +1 -147
  96. package/dist/MenuList-B7msJ1IG.mjs +187 -0
  97. package/dist/MenuList-D4imLXAa.cjs +223 -0
  98. package/dist/MenuListContext-DKUOhNyw.d.cts +21 -0
  99. package/dist/MenuListContext-x-7lH4CH.d.mts +21 -0
  100. package/dist/Modal.d.cts +1 -1
  101. package/dist/Modal.d.mts +1 -1
  102. package/dist/NativeSelect.cjs +9 -8
  103. package/dist/NativeSelect.d.cts +3 -4
  104. package/dist/NativeSelect.d.mts +3 -4
  105. package/dist/NativeSelect.mjs +9 -8
  106. package/dist/NumberField.cjs +476 -0
  107. package/dist/NumberField.d.cts +74 -0
  108. package/dist/NumberField.d.mts +74 -0
  109. package/dist/NumberField.mjs +474 -0
  110. package/dist/Pagination/PaginationItem.cjs +1 -1
  111. package/dist/Pagination/PaginationItem.d.cts +1 -1
  112. package/dist/Pagination/PaginationItem.d.mts +1 -1
  113. package/dist/Pagination/PaginationItem.mjs +1 -1
  114. package/dist/Pagination.d.cts +2 -2
  115. package/dist/Pagination.d.mts +2 -2
  116. package/dist/Paper.cjs +1 -1
  117. package/dist/Paper.d.cts +2 -1
  118. package/dist/Paper.d.mts +2 -1
  119. package/dist/Paper.mjs +1 -1
  120. package/dist/{Popover-TpwRSORC.cjs → Popover-CiZfgiKE.cjs} +5 -125
  121. package/dist/Popover-QjM5Z1CR.mjs +133 -0
  122. package/dist/Popover.cjs +1 -1
  123. package/dist/Popover.d.cts +6 -7
  124. package/dist/Popover.d.mts +6 -7
  125. package/dist/Popover.mjs +1 -1
  126. package/dist/Pressable.cjs +1 -1
  127. package/dist/Pressable.d.cts +1 -1
  128. package/dist/Pressable.d.mts +1 -1
  129. package/dist/Pressable.mjs +1 -1
  130. package/dist/Quote.d.cts +2 -3
  131. package/dist/Quote.d.mts +2 -3
  132. package/dist/Radio.d.cts +1 -2
  133. package/dist/Radio.d.mts +1 -2
  134. package/dist/Rating.cjs +373 -0
  135. package/dist/Rating.d.cts +57 -0
  136. package/dist/Rating.d.mts +57 -0
  137. package/dist/Rating.mjs +371 -0
  138. package/dist/Select.cjs +5 -4
  139. package/dist/Select.d.cts +3 -4
  140. package/dist/Select.d.mts +3 -4
  141. package/dist/Select.mjs +7 -6
  142. package/dist/Sidebar/Sidebar.d.cts +1 -1
  143. package/dist/Sidebar/Sidebar.d.mts +1 -1
  144. package/dist/Sidebar/SidebarItem.cjs +1 -1
  145. package/dist/Sidebar/SidebarItem.d.cts +3 -4
  146. package/dist/Sidebar/SidebarItem.d.mts +3 -4
  147. package/dist/Sidebar/SidebarItem.mjs +3 -3
  148. package/dist/Skeleton.d.cts +1 -2
  149. package/dist/Skeleton.d.mts +1 -2
  150. package/dist/Switch.cjs +23 -16
  151. package/dist/Switch.d.cts +2 -3
  152. package/dist/Switch.d.mts +2 -3
  153. package/dist/Switch.mjs +25 -18
  154. package/dist/Table/Table.d.cts +2 -3
  155. package/dist/Table/Table.d.mts +2 -3
  156. package/dist/Table/TableBody.d.cts +1 -2
  157. package/dist/Table/TableBody.d.mts +1 -2
  158. package/dist/Table/TableCell.d.cts +1 -1
  159. package/dist/Table/TableCell.d.mts +1 -1
  160. package/dist/Table/TableContainer.d.cts +1 -3
  161. package/dist/Table/TableContainer.d.mts +1 -3
  162. package/dist/Table/TableControl.d.cts +1 -1
  163. package/dist/Table/TableControl.d.mts +1 -1
  164. package/dist/Table/TableControl.mjs +2 -2
  165. package/dist/Table/TableFooter.d.cts +1 -2
  166. package/dist/Table/TableFooter.d.mts +1 -2
  167. package/dist/Table/TableHead.d.cts +1 -2
  168. package/dist/Table/TableHead.d.mts +1 -2
  169. package/dist/Table/TablePagination.d.cts +2 -2
  170. package/dist/Table/TablePagination.d.mts +2 -2
  171. package/dist/Table/TablePaginationActions.cjs +1 -1
  172. package/dist/Table/TablePaginationActions.d.cts +1 -1
  173. package/dist/Table/TablePaginationActions.d.mts +1 -1
  174. package/dist/Table/TablePaginationActions.mjs +1 -1
  175. package/dist/Table/TableRow.d.cts +1 -2
  176. package/dist/Table/TableRow.d.mts +1 -2
  177. package/dist/Table/TableSortLabel.cjs +1 -1
  178. package/dist/Table/TableSortLabel.d.cts +1 -1
  179. package/dist/Table/TableSortLabel.d.mts +1 -1
  180. package/dist/Table/TableSortLabel.mjs +1 -1
  181. package/dist/Table/hooks.d.cts +1 -1
  182. package/dist/Table/hooks.d.mts +1 -1
  183. package/dist/Table.d.cts +5 -5
  184. package/dist/Table.d.mts +5 -5
  185. package/dist/{TableContext-BeCxbtHH.d.cts → TableContext-DhuRf6Wy.d.mts} +1 -1
  186. package/dist/{TableContext-BiRiYkVZ.d.mts → TableContext-Duj1nVG7.d.cts} +1 -1
  187. package/dist/Tabs/Tab.cjs +306 -0
  188. package/dist/Tabs/Tab.d.cts +62 -0
  189. package/dist/Tabs/Tab.d.mts +62 -0
  190. package/dist/Tabs/Tab.mjs +305 -0
  191. package/dist/Tabs/TabContext.cjs +34 -0
  192. package/dist/Tabs/TabContext.d.cts +20 -0
  193. package/dist/Tabs/TabContext.d.mts +20 -0
  194. package/dist/Tabs/TabContext.mjs +33 -0
  195. package/dist/Tabs/TabList.cjs +31 -0
  196. package/dist/Tabs/TabList.d.cts +11 -0
  197. package/dist/Tabs/TabList.d.mts +11 -0
  198. package/dist/Tabs/TabList.mjs +30 -0
  199. package/dist/Tabs/TabPanel.cjs +40 -0
  200. package/dist/Tabs/TabPanel.d.cts +27 -0
  201. package/dist/Tabs/TabPanel.d.mts +27 -0
  202. package/dist/Tabs/TabPanel.mjs +38 -0
  203. package/dist/Tabs/TabScrollButton.cjs +93 -0
  204. package/dist/Tabs/TabScrollButton.d.cts +2 -0
  205. package/dist/Tabs/TabScrollButton.d.mts +2 -0
  206. package/dist/Tabs/TabScrollButton.mjs +91 -0
  207. package/dist/Tabs/Tabs.cjs +3 -0
  208. package/dist/Tabs/Tabs.d.cts +3 -0
  209. package/dist/Tabs/Tabs.d.mts +3 -0
  210. package/dist/Tabs/Tabs.mjs +2 -0
  211. package/dist/Tabs-BTNOJx5v.mjs +634 -0
  212. package/dist/Tabs-D4tWCq78.cjs +646 -0
  213. package/dist/Tabs.cjs +13 -0
  214. package/dist/Tabs.d.cts +8 -0
  215. package/dist/Tabs.d.mts +8 -0
  216. package/dist/Tabs.mjs +7 -0
  217. package/dist/TabsContext-B_XHbjcS.d.cts +6 -0
  218. package/dist/TabsContext-Dn2kqUwr.d.mts +6 -0
  219. package/dist/TabsValueContext-D40zGCpE.cjs +19 -0
  220. package/dist/TabsValueContext-DvL3inf7.mjs +8 -0
  221. package/dist/TextInput.cjs +4 -4
  222. package/dist/TextInput.d.cts +2 -3
  223. package/dist/TextInput.d.mts +2 -3
  224. package/dist/TextInput.mjs +4 -4
  225. package/dist/ToggleButton/ToggleButton.cjs +1 -1
  226. package/dist/ToggleButton/ToggleButton.d.cts +1 -1
  227. package/dist/ToggleButton/ToggleButton.d.mts +1 -1
  228. package/dist/ToggleButton/ToggleButton.mjs +1 -1
  229. package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
  230. package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
  231. package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
  232. package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
  233. package/dist/TransferList.cjs +356 -0
  234. package/dist/TransferList.d.cts +67 -0
  235. package/dist/TransferList.d.mts +67 -0
  236. package/dist/TransferList.mjs +354 -0
  237. package/dist/Typography.cjs +1 -1
  238. package/dist/Typography.d.cts +2 -2
  239. package/dist/Typography.d.mts +2 -2
  240. package/dist/Typography.mjs +1 -1
  241. package/dist/View.d.cts +1 -1
  242. package/dist/View.d.mts +1 -1
  243. package/dist/catalog.cjs +4568 -0
  244. package/dist/catalog.d.cts +90 -0
  245. package/dist/catalog.d.mts +90 -0
  246. package/dist/catalog.mjs +4567 -0
  247. package/dist/computePopoverPosition-BIprs_xo.mjs +123 -0
  248. package/dist/computePopoverPosition-DiyEOHnU.cjs +128 -0
  249. package/dist/dividerLine-BNljcGlv.cjs +66 -0
  250. package/dist/dividerLine-FahY-M6_.mjs +31 -0
  251. package/dist/engine.d.cts +1 -1
  252. package/dist/engine.d.mts +1 -1
  253. package/dist/index-B1RFybA_.d.mts +72 -0
  254. package/dist/index-B4TeaB7b.d.cts +72 -0
  255. package/dist/{index-BUoVTCqX.d.mts → index-BGbTuHP9.d.mts} +1 -2
  256. package/dist/{index-Celm-8iN.d.cts → index-BHKgEOZJ.d.cts} +2 -3
  257. package/dist/{index-Chg6pSrr.d.mts → index-BQWjh4rK.d.mts} +2 -3
  258. package/dist/{index-B78VkB0-.d.cts → index-BelFIizY.d.cts} +2 -3
  259. package/dist/index-BkzZxHVj.d.mts +35 -0
  260. package/dist/{index-DbEnSf2m.d.cts → index-BrgwkY6z.d.mts} +3 -4
  261. package/dist/{index-Wnv6jCR3.d.mts → index-Bx0-6yeX.d.mts} +1 -2
  262. package/dist/index-BxVTIMnB.d.cts +1 -0
  263. package/dist/{index-BfZuh9c2.d.mts → index-ByYxVl9O.d.mts} +2 -3
  264. package/dist/index-CE5JG1us.d.mts +34 -0
  265. package/dist/{index-BhibLnZ0.d.cts → index-CG_1uPrD.d.mts} +2 -3
  266. package/dist/{themes-RX2UX5gD.d.mts → index-CJhK7JND.d.mts} +265 -8
  267. package/dist/{index-BB-dLv5V.d.mts → index-CQfJZADG.d.cts} +3 -4
  268. package/dist/{index-CxUsrlg1.d.cts → index-CUz2h5xY.d.mts} +2 -3
  269. package/dist/{index-Bid71KeF.d.cts → index-CbFaWtjK.d.mts} +2 -2
  270. package/dist/{index-DdqdSOct.d.cts → index-ChXeKJCk.d.cts} +1 -2
  271. package/dist/index-CknoXDLQ.d.cts +35 -0
  272. package/dist/{index-BSqet8aO.d.cts → index-ClZyaZrR.d.mts} +2 -3
  273. package/dist/{index-DXvQ-JVZ.d.mts → index-DAwcmIjN.d.cts} +2 -3
  274. package/dist/index-DGnXJwLj.d.mts +72 -0
  275. package/dist/{themes-Kbk9h5cN.d.cts → index-DJ0f69wh.d.cts} +262 -5
  276. package/dist/index-DWjz5ZzG.d.cts +72 -0
  277. package/dist/{index-DNwF3DUX.d.cts → index-DYF8sRE-.d.cts} +2 -3
  278. package/dist/index-DaIIo5QU.d.mts +1 -0
  279. package/dist/{index-CrN4MSUF.d.cts → index-DchHf5cF.d.cts} +1 -1
  280. package/dist/{index-S-ClM6WM.d.mts → index-DtYjdBvO.d.cts} +2 -2
  281. package/dist/{index-Ctqajtac.d.cts → index-Dv_fk1_F.d.cts} +27 -3
  282. package/dist/{index-smqjMLAZ.d.mts → index-K5exjvnX.d.cts} +2 -3
  283. package/dist/index-KnXhlKMr.d.cts +34 -0
  284. package/dist/index-WHFhjfgy.d.cts +98 -0
  285. package/dist/{index-GpnmW6vu.d.mts → index-YKrfFC_I.d.cts} +2 -3
  286. package/dist/index-bpnLB_4K.d.mts +98 -0
  287. package/dist/{index-VOsBSWEu.d.mts → index-h4dYtVrp.d.mts} +1 -1
  288. package/dist/{index-DO9J-Fla.d.mts → index-ha1WjSZ5.d.mts} +27 -3
  289. package/dist/{index-Belxmt1X.d.cts → index-nqUA_6J_.d.cts} +1 -2
  290. package/dist/{index-nc4Sxiy9.d.mts → index-pTNq3iQn.d.mts} +2 -3
  291. package/dist/index.d.cts +1 -2
  292. package/dist/index.d.mts +1 -2
  293. package/dist/isRtl-BJDtm86G.mjs +7 -0
  294. package/dist/isRtl-DTkYHRPo.cjs +12 -0
  295. package/dist/precision-B1lhxnnO.mjs +25 -0
  296. package/dist/precision-B58cTPB2.cjs +48 -0
  297. package/dist/style.cjs +1 -1
  298. package/dist/style.d.cts +2 -2
  299. package/dist/style.d.mts +2 -2
  300. package/dist/style.mjs +1 -1
  301. package/dist/surfaceSystem-BGQBoXv_.cjs +38 -0
  302. package/dist/surfaceSystem-D8TbmKy3.mjs +21 -0
  303. package/dist/theme-BxXuXRgQ.cjs +137 -0
  304. package/dist/theme-Z9_QludW.mjs +102 -0
  305. package/dist/theme.cjs +25 -24
  306. package/dist/theme.d.cts +3 -3
  307. package/dist/theme.d.mts +3 -3
  308. package/dist/theme.mjs +2 -1
  309. package/dist/{theme-CDVxig_g.mjs → themes-L-dE7_ck.mjs} +10 -110
  310. package/dist/{theme-BXlAP3xf.cjs → themes-gd6tcmqS.cjs} +0 -136
  311. package/dist/useControlled-C666KpQ0.cjs +18 -0
  312. package/dist/useControlled-CBRLsO-H.mjs +13 -0
  313. package/dist/{useTablePagination-COTiNH_8.d.mts → useTablePagination-C-u3ru4N.d.cts} +1 -1
  314. package/dist/{useTablePagination-WFkaUZu8.d.cts → useTablePagination-D-39ZmQh.d.mts} +1 -1
  315. package/package.json +83 -2
  316. package/dist/Popover-DwnSLpp1.mjs +0 -253
  317. package/dist/index-B_dKjEDR.d.mts +0 -23
  318. package/dist/index-C1WqEDtQ.d.mts +0 -69
  319. package/dist/index-CA7HnbtH.d.cts +0 -21
  320. package/dist/index-CKZaErxJ.d.mts +0 -21
  321. package/dist/index-DBUwu65Z.d.cts +0 -69
  322. package/dist/index-DzQJSYIh.d.cts +0 -23
  323. package/dist/index-cuv3o-L7.d.mts +0 -34
  324. package/dist/index-nB94D7UM.d.cts +0 -34
@@ -0,0 +1,6 @@
1
+ import "./index-DchHf5cF.cjs";
2
+ //#region src/Tabs/TabsContext.d.ts
3
+ /** A tab's value: what it is chosen as. A `Tab` without one takes its position. */
4
+ type TabValue = string | number;
5
+ //#endregion
6
+ export { TabValue as t };
@@ -0,0 +1,6 @@
1
+ import "./index-h4dYtVrp.mjs";
2
+ //#region src/Tabs/TabsContext.d.ts
3
+ /** A tab's value: what it is chosen as. A `Tab` without one takes its position. */
4
+ type TabValue = string | number;
5
+ //#endregion
6
+ export { TabValue as t };
@@ -0,0 +1,19 @@
1
+ let react = require("react");
2
+ //#region src/Tabs/TabsValueContext.ts
3
+ /** Set by a `TabContext`. */
4
+ const TabsValueContext = (0, react.createContext)(null);
5
+ /** The surrounding `TabContext`'s value, if there is one. */
6
+ const useTabsValue = () => (0, react.useContext)(TabsValueContext);
7
+ //#endregion
8
+ Object.defineProperty(exports, "TabsValueContext", {
9
+ enumerable: true,
10
+ get: function() {
11
+ return TabsValueContext;
12
+ }
13
+ });
14
+ Object.defineProperty(exports, "useTabsValue", {
15
+ enumerable: true,
16
+ get: function() {
17
+ return useTabsValue;
18
+ }
19
+ });
@@ -0,0 +1,8 @@
1
+ import { createContext, useContext } from "react";
2
+ //#region src/Tabs/TabsValueContext.ts
3
+ /** Set by a `TabContext`. */
4
+ const TabsValueContext = createContext(null);
5
+ /** The surrounding `TabContext`'s value, if there is one. */
6
+ const useTabsValue = () => useContext(TabsValueContext);
7
+ //#endregion
8
+ export { useTabsValue as n, TabsValueContext as t };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_src = require("./src-DU81aGy9.cjs");
3
3
  const require_themeDefault = require("./themeDefault-Cebi08Cv.cjs");
4
- const require_theme = require("./theme-BXlAP3xf.cjs");
4
+ const require_theme = require("./theme-BxXuXRgQ.cjs");
5
5
  const require_FormControl = require("./FormControl.cjs");
6
6
  const require_inputVariantStyles = require("./inputVariantStyles-BBkkYQtE.cjs");
7
7
  let react = require("react");
@@ -65,10 +65,10 @@ const baseStyle = {
65
65
  alignItems: "center",
66
66
  transition: "border-color 0.15s ease"
67
67
  };
68
- const backgroundStyle = ({ theme, textColor = require_themeDefault.themeDefault(theme, "accentTextColor", "primary") }) => {
68
+ const backgroundStyle = ({ theme, textColor, color = require_themeDefault.themeDefault(theme, "color", "primary") }) => {
69
69
  return {
70
70
  backgroundColor: (0, require_src.src_exports.get)(theme, `background.${require_themeDefault.themeDefault(theme, "inputBg", "terminal")}`),
71
- color: (0, require_src.src_exports.get)(theme, `text.${textColor}`),
71
+ color: textColor ? (0, require_src.src_exports.get)(theme, `text.${textColor}`) : (0, require_src.src_exports.get)(theme, `palette.${color}.main`),
72
72
  fontFamily: (0, require_src.src_exports.get)(theme, "fonts.body"),
73
73
  fontSize: (0, require_src.src_exports.get)(theme, "fontSizes.1"),
74
74
  lineHeight: (0, require_src.src_exports.get)(theme, "lineHeights.base")
@@ -178,7 +178,7 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
178
178
  const { id, error, disabled, required, size, fullWidth } = fc;
179
179
  const theme = require_theme.useTheme();
180
180
  const color = fc.color ?? require_themeDefault.themeDefault(theme, "color", "primary");
181
- const textColor = fc.textColor ?? require_themeDefault.themeDefault(theme, "accentTextColor", "primary");
181
+ const textColor = fc.textColor;
182
182
  const variant = variantProp ?? require_themeDefault.themeDefault(theme, "inputVariant", "default");
183
183
  const isAutoResize = resize;
184
184
  const isMultiline = multiline || rows !== void 0 && Number(rows) > 1;
@@ -1,5 +1,4 @@
1
- import { T as Theme } from "./themes-Kbk9h5cN.cjs";
2
- import "./index-DBUwu65Z.cjs";
1
+ import { W as Theme } from "./index-DJ0f69wh.cjs";
3
2
  import { ChangeEventHandler, ElementType, InputHTMLAttributes, TextareaHTMLAttributes } from "react";
4
3
  import { LayoutProps, SpaceProps } from "@soroush.tech/styled-system";
5
4
  //#region src/TextInput/TextInput.d.ts
@@ -25,7 +24,7 @@ interface TextInputProps extends SpaceProps<Theme>, Pick<LayoutProps<Theme>, 'wi
25
24
  };
26
25
  /** Focus/active border color - resolves to `theme.palette[color].main`. Default: 'primary', overridable via `theme.defaults.color`. */
27
26
  color?: TextInputColor;
28
- /** Text color of the typed value - resolves against `theme.text`. Default: 'primary', overridable via `theme.defaults.accentTextColor`. */
27
+ /** Text color of the typed value - resolves against `theme.text`. Default: the accent `color`'s `main`. */
29
28
  textColor?: TextInputTextColor;
30
29
  /** Disables the input. */
31
30
  disabled?: boolean;
@@ -1,5 +1,4 @@
1
- import { T as Theme } from "./themes-RX2UX5gD.mjs";
2
- import "./index-C1WqEDtQ.mjs";
1
+ import { W as Theme } from "./index-CJhK7JND.mjs";
3
2
  import { LayoutProps, SpaceProps } from "@soroush.tech/styled-system";
4
3
  import { ChangeEventHandler, ElementType, InputHTMLAttributes, TextareaHTMLAttributes } from "react";
5
4
  //#region src/TextInput/TextInput.d.ts
@@ -25,7 +24,7 @@ interface TextInputProps extends SpaceProps<Theme>, Pick<LayoutProps<Theme>, 'wi
25
24
  };
26
25
  /** Focus/active border color - resolves to `theme.palette[color].main`. Default: 'primary', overridable via `theme.defaults.color`. */
27
26
  color?: TextInputColor;
28
- /** Text color of the typed value - resolves against `theme.text`. Default: 'primary', overridable via `theme.defaults.accentTextColor`. */
27
+ /** Text color of the typed value - resolves against `theme.text`. Default: the accent `color`'s `main`. */
29
28
  textColor?: TextInputTextColor;
30
29
  /** Disables the input. */
31
30
  disabled?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
2
2
  import { t as themeDefault } from "./themeDefault-Z3KmyIbm.mjs";
3
- import { r as useTheme } from "./theme-CDVxig_g.mjs";
3
+ import { r as useTheme } from "./theme-Z9_QludW.mjs";
4
4
  import { useFormControl } from "./FormControl.mjs";
5
5
  import { t as inputVariantStyles } from "./inputVariantStyles-CcqpGfuP.mjs";
6
6
  import { forwardRef, useCallback, useLayoutEffect, useRef } from "react";
@@ -63,10 +63,10 @@ const baseStyle = {
63
63
  alignItems: "center",
64
64
  transition: "border-color 0.15s ease"
65
65
  };
66
- const backgroundStyle = ({ theme, textColor = themeDefault(theme, "accentTextColor", "primary") }) => {
66
+ const backgroundStyle = ({ theme, textColor, color = themeDefault(theme, "color", "primary") }) => {
67
67
  return {
68
68
  backgroundColor: (0, src_exports.get)(theme, `background.${themeDefault(theme, "inputBg", "terminal")}`),
69
- color: (0, src_exports.get)(theme, `text.${textColor}`),
69
+ color: textColor ? (0, src_exports.get)(theme, `text.${textColor}`) : (0, src_exports.get)(theme, `palette.${color}.main`),
70
70
  fontFamily: (0, src_exports.get)(theme, "fonts.body"),
71
71
  fontSize: (0, src_exports.get)(theme, "fontSizes.1"),
72
72
  lineHeight: (0, src_exports.get)(theme, "lineHeights.base")
@@ -176,7 +176,7 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
176
176
  const { id, error, disabled, required, size, fullWidth } = fc;
177
177
  const theme = useTheme();
178
178
  const color = fc.color ?? themeDefault(theme, "color", "primary");
179
- const textColor = fc.textColor ?? themeDefault(theme, "accentTextColor", "primary");
179
+ const textColor = fc.textColor;
180
180
  const variant = variantProp ?? themeDefault(theme, "inputVariant", "default");
181
181
  const isAutoResize = resize;
182
182
  const isMultiline = multiline || rows !== void 0 && Number(rows) > 1;
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_src = require("../src-DU81aGy9.cjs");
3
3
  const require_themeDefault = require("../themeDefault-Cebi08Cv.cjs");
4
4
  const require_utils = require("../utils.cjs");
5
- const require_theme = require("../theme-BXlAP3xf.cjs");
5
+ const require_theme = require("../theme-BxXuXRgQ.cjs");
6
6
  const require_ButtonGroupContext = require("../ButtonGroupContext-NtkVeDVE.cjs");
7
7
  const require_Button = require("../Button.cjs");
8
8
  const require_ToggleButtonGroupContext = require("../ToggleButtonGroupContext-Ewc5Ixas.cjs");
@@ -1,4 +1,4 @@
1
- import { i as ButtonProps } from "../index-BhibLnZ0.cjs";
1
+ import { i as ButtonProps } from "../index-DAwcmIjN.cjs";
2
2
  import { r as ToggleButtonValue } from "../ToggleButtonGroupContext-10jEsQdg.cjs";
3
3
  //#region src/ToggleButton/ToggleButton/ToggleButton.d.ts
4
4
  interface ToggleButtonProps extends Omit<ButtonProps, 'variant' | 'href' | 'target' | 'rel' | 'value' | 'onChange'> {
@@ -1,4 +1,4 @@
1
- import { i as ButtonProps } from "../index-DXvQ-JVZ.mjs";
1
+ import { i as ButtonProps } from "../index-CG_1uPrD.mjs";
2
2
  import { r as ToggleButtonValue } from "../ToggleButtonGroupContext-10jEsQdg.mjs";
3
3
  //#region src/ToggleButton/ToggleButton/ToggleButton.d.ts
4
4
  interface ToggleButtonProps extends Omit<ButtonProps, 'variant' | 'href' | 'target' | 'rel' | 'value' | 'onChange'> {
@@ -1,7 +1,7 @@
1
1
  import { a as src_exports, o as styled } from "../src-DLGYOJMh.mjs";
2
2
  import { t as themeDefault } from "../themeDefault-Z3KmyIbm.mjs";
3
3
  import { alpha } from "../utils.mjs";
4
- import { r as useTheme } from "../theme-CDVxig_g.mjs";
4
+ import { r as useTheme } from "../theme-Z9_QludW.mjs";
5
5
  import { t as ButtonGroupContext } from "../ButtonGroupContext-DS-kl9lG.mjs";
6
6
  import { Button } from "../Button.mjs";
7
7
  import { t as ToggleButtonGroupContext } from "../ToggleButtonGroupContext-DxIyy8ze.mjs";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_src = require("../src-DU81aGy9.cjs");
3
3
  const require_themeDefault = require("../themeDefault-Cebi08Cv.cjs");
4
- const require_theme = require("../theme-BXlAP3xf.cjs");
4
+ const require_theme = require("../theme-BxXuXRgQ.cjs");
5
5
  const require_ButtonGroup = require("../ButtonGroup.cjs");
6
6
  const require_ToggleButtonGroupContext = require("../ToggleButtonGroupContext-Ewc5Ixas.cjs");
7
7
  let react = require("react");
@@ -1,4 +1,4 @@
1
- import { a as ButtonGroupProps } from "../index-DbEnSf2m.cjs";
1
+ import { a as ButtonGroupProps } from "../index-CQfJZADG.cjs";
2
2
  import { r as ToggleButtonValue } from "../ToggleButtonGroupContext-10jEsQdg.cjs";
3
3
  //#region src/ToggleButton/ToggleButtonGroup/ToggleButtonGroup.d.ts
4
4
  interface ToggleButtonGroupProps extends Omit<ButtonGroupProps, 'variant' | 'onChange'> {
@@ -1,4 +1,4 @@
1
- import { a as ButtonGroupProps } from "../index-BB-dLv5V.mjs";
1
+ import { a as ButtonGroupProps } from "../index-BrgwkY6z.mjs";
2
2
  import { r as ToggleButtonValue } from "../ToggleButtonGroupContext-10jEsQdg.mjs";
3
3
  //#region src/ToggleButton/ToggleButtonGroup/ToggleButtonGroup.d.ts
4
4
  interface ToggleButtonGroupProps extends Omit<ButtonGroupProps, 'variant' | 'onChange'> {
@@ -1,6 +1,6 @@
1
1
  import { o as styled } from "../src-DLGYOJMh.mjs";
2
2
  import { t as themeDefault } from "../themeDefault-Z3KmyIbm.mjs";
3
- import { r as useTheme } from "../theme-CDVxig_g.mjs";
3
+ import { r as useTheme } from "../theme-Z9_QludW.mjs";
4
4
  import { ButtonGroup } from "../ButtonGroup.mjs";
5
5
  import { t as ToggleButtonGroupContext } from "../ToggleButtonGroupContext-DxIyy8ze.mjs";
6
6
  import { useMemo } from "react";
@@ -0,0 +1,356 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_src = require("./src-DU81aGy9.cjs");
3
+ const require_theme = require("./theme-BxXuXRgQ.cjs");
4
+ const require_Typography = require("./Typography.cjs");
5
+ const require_Icon = require("./Icon-D-EWsBVg.cjs");
6
+ const require_Button = require("./Button.cjs");
7
+ const require_Paper = require("./Paper.cjs");
8
+ const require_FormControl = require("./FormControl.cjs");
9
+ const require_Checkbox = require("./Checkbox.cjs");
10
+ const require_useControlled = require("./useControlled-C666KpQ0.cjs");
11
+ let react = require("react");
12
+ let react_jsx_runtime = require("react/jsx-runtime");
13
+ let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
14
+ //#region src/TransferList/hooks/useTransferList.ts
15
+ const isEnabled = (item) => !item.disabled;
16
+ /**
17
+ * A transfer list's state: which items are on the right (controlled or not), which are checked,
18
+ * and the moves between the sides. A move takes the checked, enabled items of its source - or all
19
+ * the enabled ones, which its button is off without - and unchecks what it moves; the items keep their own order on each side.
20
+ */
21
+ function useTransferList({ items, value, defaultValue, onChange }) {
22
+ const [rightValues, setRightValues] = require_useControlled.useControlled({
23
+ controlled: value,
24
+ default: defaultValue ?? []
25
+ });
26
+ const [checked, setChecked] = (0, react.useState)([]);
27
+ const isRight = (item) => rightValues.includes(item.value);
28
+ const left = items.filter((item) => !isRight(item));
29
+ const right = items.filter(isRight);
30
+ const sides = {
31
+ left,
32
+ right
33
+ };
34
+ const isChecked = (item) => !item.disabled && checked.includes(item.value);
35
+ const getChecked = (side) => sides[side].filter(isChecked);
36
+ const getEnabled = (side) => sides[side].filter(isEnabled);
37
+ const commit = (next) => {
38
+ setRightValues(next);
39
+ onChange?.(next);
40
+ };
41
+ const toggle = (item) => {
42
+ setChecked((current) => current.includes(item.value) ? current.filter((entry) => entry !== item.value) : [...current, item.value]);
43
+ };
44
+ const toggleAll = (side) => {
45
+ const enabled = getEnabled(side).map((item) => item.value);
46
+ setChecked((current) => {
47
+ const isAll = enabled.every((entry) => current.includes(entry));
48
+ const rest = current.filter((entry) => !enabled.includes(entry));
49
+ return isAll ? rest : [...rest, ...enabled];
50
+ });
51
+ };
52
+ const move = (to, moving) => {
53
+ const moved = moving.map((item) => item.value);
54
+ setChecked((current) => current.filter((entry) => !moved.includes(entry)));
55
+ commit(to === "right" ? [...rightValues, ...moved] : rightValues.filter((entry) => !moved.includes(entry)));
56
+ };
57
+ return {
58
+ items,
59
+ left,
60
+ right,
61
+ isChecked,
62
+ getChecked,
63
+ getEnabled,
64
+ toggle,
65
+ toggleAll,
66
+ moveRight: () => move("right", getChecked("left")),
67
+ moveLeft: () => move("left", getChecked("right")),
68
+ moveAllRight: () => move("right", getEnabled("left")),
69
+ moveAllLeft: () => move("left", getEnabled("right"))
70
+ };
71
+ }
72
+ //#endregion
73
+ //#region src/TransferList/TransferList.tsx
74
+ const TransferListRoot = require_src.styled("div", {
75
+ name: "TransferList",
76
+ label: "TransferList",
77
+ shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([..._soroush_tech_styled_system_should_forward_prop.props, "isDisabled"]),
78
+ systemProps: [require_src.src_exports.space]
79
+ })(({ theme, isDisabled }) => ({
80
+ display: "flex",
81
+ alignItems: "stretch",
82
+ gap: theme.space[2],
83
+ ...isDisabled && { opacity: .5 }
84
+ }));
85
+ const TransferListList = require_src.styled(require_Paper.Paper, {
86
+ name: "TransferList",
87
+ slot: "list",
88
+ label: "TransferListList",
89
+ shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)(["isError"])
90
+ })(({ theme, isError }) => ({
91
+ flex: "1 1 0",
92
+ minWidth: 0,
93
+ overflow: "hidden",
94
+ border: `${theme.borderWidths.thin} solid ${(0, require_src.src_exports.get)(theme, isError ? "palette.error.main" : "border.default")}`
95
+ }));
96
+ const TransferListHeader = require_src.styled("div", {
97
+ name: "TransferList",
98
+ slot: "header",
99
+ label: "TransferListHeader"
100
+ })(({ theme }) => ({
101
+ display: "flex",
102
+ alignItems: "center",
103
+ gap: theme.space[1],
104
+ padding: `${theme.space[1]} ${theme.space[2]}`,
105
+ borderBottom: `${theme.borderWidths.thin} solid ${(0, require_src.src_exports.get)(theme, "border.default")}`
106
+ }));
107
+ const TransferListTitle = require_src.styled("span", {
108
+ name: "TransferList",
109
+ slot: "title",
110
+ label: "TransferListTitle"
111
+ })({
112
+ flex: 1,
113
+ minWidth: 0
114
+ });
115
+ const TransferListCount = require_src.styled("span", {
116
+ name: "TransferList",
117
+ slot: "count",
118
+ label: "TransferListCount"
119
+ })(({ theme }) => ({
120
+ color: theme.text.secondary,
121
+ whiteSpace: "nowrap"
122
+ }));
123
+ const TransferListItems = require_src.styled("div", {
124
+ name: "TransferList",
125
+ slot: "items",
126
+ label: "TransferListItems"
127
+ })({
128
+ height: "14rem",
129
+ overflowY: "auto"
130
+ });
131
+ const TransferListRow = require_src.styled("div", {
132
+ name: "TransferList",
133
+ slot: "item",
134
+ label: "TransferListItem"
135
+ })(({ theme }) => ({
136
+ display: "flex",
137
+ "&:hover": { backgroundColor: (0, require_src.src_exports.get)(theme, "background.secondary") },
138
+ "& > label": {
139
+ flex: 1,
140
+ padding: `${theme.space[1]} ${theme.space[2]}`,
141
+ boxSizing: "border-box"
142
+ }
143
+ }));
144
+ const TransferListControls = require_src.styled("div", {
145
+ name: "TransferList",
146
+ slot: "controls",
147
+ label: "TransferListControls"
148
+ })(({ theme }) => ({
149
+ display: "flex",
150
+ flexDirection: "column",
151
+ justifyContent: "center",
152
+ alignItems: "stretch",
153
+ gap: theme.space[1]
154
+ }));
155
+ const TransferListIcon = require_src.styled("span", {
156
+ name: "TransferList",
157
+ slot: "icon",
158
+ label: "TransferListIcon"
159
+ })({
160
+ display: "inline-flex",
161
+ alignItems: "center",
162
+ "[dir=\"rtl\"] &": { transform: "scaleX(-1)" },
163
+ "& > :nth-of-type(2)": { marginInlineStart: "-0.5em" }
164
+ });
165
+ function List({ side, title, baseId, state, hasSelectAll, getCountLabel, size, color, disabled, isError }) {
166
+ const items = state[side];
167
+ const titleId = `${baseId}-${side}-title`;
168
+ const enabledCount = state.getEnabled(side).length;
169
+ const checkedCount = state.getChecked(side).length;
170
+ const isAll = enabledCount > 0 && checkedCount === enabledCount;
171
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListList, {
172
+ elevation: 0,
173
+ p: 0,
174
+ isError,
175
+ "data-side": side,
176
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListHeader, { children: [
177
+ hasSelectAll && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Checkbox.Checkbox, {
178
+ id: `${baseId}-${side}-all`,
179
+ "aria-labelledby": titleId,
180
+ size,
181
+ color,
182
+ disabled: disabled || enabledCount === 0,
183
+ checked: isAll,
184
+ indeterminate: checkedCount > 0 && !isAll,
185
+ onChange: () => state.toggleAll(side)
186
+ }),
187
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListTitle, {
188
+ id: titleId,
189
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
190
+ variant: "subtitle2",
191
+ as: "span",
192
+ children: title
193
+ })
194
+ }),
195
+ hasSelectAll && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListCount, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
196
+ variant: "caption",
197
+ children: getCountLabel(checkedCount, items.length)
198
+ }) })
199
+ ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListItems, {
200
+ role: "list",
201
+ "aria-labelledby": title ? titleId : void 0,
202
+ children: items.map((item) => {
203
+ const position = state.items.indexOf(item);
204
+ const labelId = `${baseId}-${position}-label`;
205
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListRow, {
206
+ role: "listitem",
207
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Checkbox.Checkbox, {
208
+ id: `${baseId}-${position}`,
209
+ "aria-labelledby": labelId,
210
+ size,
211
+ color,
212
+ disabled: disabled || item.disabled,
213
+ checked: state.isChecked(item),
214
+ onChange: () => state.toggle(item),
215
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
216
+ variant: "body2",
217
+ as: "span",
218
+ id: labelId,
219
+ children: item.label
220
+ })
221
+ })
222
+ }, item.value);
223
+ })
224
+ })]
225
+ });
226
+ }
227
+ /**
228
+ * @description A transfer list: two lists, and the buttons that move the checked items from one
229
+ * to the other. Each list is a list of rows whose checkbox is the row, so it is one tab stop and
230
+ * the label toggles it. The value is the values on the right; the items keep their own order on
231
+ * each side. A disabled item stays where it is. Every name - the lists' titles, the four buttons -
232
+ * is the app's, so it carries no language of its own. In a `FormControl` it takes the field's
233
+ * size, color, error and disabled state, and its `FormLabel` names the group.
234
+ */
235
+ function TransferList({ items, value, defaultValue, onChange, leftLabel, rightLabel, moveAllRightLabel: moveAllRightLabelProp, moveRightLabel: moveRightLabelProp, moveLeftLabel: moveLeftLabelProp, moveAllLeftLabel: moveAllLeftLabelProp, shouldShowMoveAll: shouldShowMoveAllProp, hasSelectAll: hasSelectAllProp, getCountLabel = (checked, total) => `${checked}/${total}`, size: sizeProp, color: colorProp, disabled: disabledProp, error: errorProp, id: idProp, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-testid": dataTestid, ...spaceProps }) {
236
+ const dp = require_theme.useDefaultProps("TransferList");
237
+ const fc = require_FormControl.useFormControl({
238
+ id: idProp,
239
+ error: errorProp,
240
+ disabled: disabledProp,
241
+ size: sizeProp ?? dp.size,
242
+ color: colorProp ?? dp.color
243
+ });
244
+ const baseId = (0, react.useId)();
245
+ const moveAllRightLabel = moveAllRightLabelProp ?? dp.moveAllRightLabel;
246
+ const moveRightLabel = moveRightLabelProp ?? dp.moveRightLabel;
247
+ const moveLeftLabel = moveLeftLabelProp ?? dp.moveLeftLabel;
248
+ const moveAllLeftLabel = moveAllLeftLabelProp ?? dp.moveAllLeftLabel;
249
+ const shouldShowMoveAll = shouldShowMoveAllProp ?? dp.shouldShowMoveAll ?? false;
250
+ const hasSelectAll = hasSelectAllProp ?? dp.hasSelectAll ?? false;
251
+ const state = useTransferList({
252
+ items,
253
+ value,
254
+ defaultValue,
255
+ onChange
256
+ });
257
+ const buttonProps = {
258
+ variant: "outlined",
259
+ size: fc.size,
260
+ color: fc.color
261
+ };
262
+ const isOff = (side, ofChecked) => fc.disabled || (ofChecked ? state.getChecked(side).length === 0 : state.getEnabled(side).length === 0);
263
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListRoot, {
264
+ id: fc.id,
265
+ role: "group",
266
+ isDisabled: fc.disabled,
267
+ className,
268
+ "data-testid": dataTestid,
269
+ "aria-label": ariaLabel,
270
+ "aria-labelledby": ariaLabelledby ?? fc.labelId,
271
+ "aria-describedby": ariaDescribedby ?? fc["aria-describedby"],
272
+ ...spaceProps,
273
+ children: [
274
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(List, {
275
+ side: "left",
276
+ title: leftLabel,
277
+ baseId,
278
+ state,
279
+ hasSelectAll,
280
+ getCountLabel,
281
+ size: fc.size,
282
+ color: fc.color,
283
+ disabled: fc.disabled,
284
+ isError: fc.error
285
+ }),
286
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListControls, { children: [
287
+ shouldShowMoveAll && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
288
+ ...buttonProps,
289
+ "aria-label": moveAllRightLabel,
290
+ disabled: isOff("left", false),
291
+ onClick: state.moveAllRight,
292
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListIcon, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
293
+ name: "chevron_right",
294
+ size: "1em",
295
+ color: "inherit"
296
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
297
+ name: "chevron_right",
298
+ size: "1em",
299
+ color: "inherit"
300
+ })] })
301
+ }),
302
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
303
+ ...buttonProps,
304
+ "aria-label": moveRightLabel,
305
+ disabled: isOff("left", true),
306
+ onClick: state.moveRight,
307
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
308
+ name: "chevron_right",
309
+ size: "1em",
310
+ color: "inherit"
311
+ }) })
312
+ }),
313
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
314
+ ...buttonProps,
315
+ "aria-label": moveLeftLabel,
316
+ disabled: isOff("right", true),
317
+ onClick: state.moveLeft,
318
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TransferListIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
319
+ name: "chevron_left",
320
+ size: "1em",
321
+ color: "inherit"
322
+ }) })
323
+ }),
324
+ shouldShowMoveAll && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
325
+ ...buttonProps,
326
+ "aria-label": moveAllLeftLabel,
327
+ disabled: isOff("right", false),
328
+ onClick: state.moveAllLeft,
329
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TransferListIcon, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
330
+ name: "chevron_left",
331
+ size: "1em",
332
+ color: "inherit"
333
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
334
+ name: "chevron_left",
335
+ size: "1em",
336
+ color: "inherit"
337
+ })] })
338
+ })
339
+ ] }),
340
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(List, {
341
+ side: "right",
342
+ title: rightLabel,
343
+ baseId,
344
+ state,
345
+ hasSelectAll,
346
+ getCountLabel,
347
+ size: fc.size,
348
+ color: fc.color,
349
+ disabled: fc.disabled,
350
+ isError: fc.error
351
+ })
352
+ ]
353
+ });
354
+ }
355
+ //#endregion
356
+ exports.TransferList = TransferList;
@@ -0,0 +1,67 @@
1
+ import { W as Theme } from "./index-DJ0f69wh.cjs";
2
+ import { SpaceProps } from "@soroush.tech/styled-system";
3
+ //#region src/TransferList/hooks/useTransferList.d.ts
4
+ type TransferListValue = string | number;
5
+ interface TransferListItem {
6
+ /** What `value` holds for it - unique among the items. */
7
+ value: TransferListValue;
8
+ /** What the row says, and what names its checkbox. */
9
+ label: string;
10
+ /** Stays where it is and can't be checked. */
11
+ disabled?: boolean;
12
+ }
13
+ //#endregion
14
+ //#region src/TransferList/TransferList.d.ts
15
+ interface TransferListProps extends SpaceProps<Theme> {
16
+ /** Every item, on either side. */
17
+ items: readonly TransferListItem[];
18
+ /** The values on the right. Controlled with `onChange`. */
19
+ value?: readonly TransferListValue[];
20
+ /** The values on the right at first, when uncontrolled. Default: none. */
21
+ defaultValue?: readonly TransferListValue[];
22
+ /** Fired as items move, with the values now on the right. */
23
+ onChange?: (value: TransferListValue[]) => void;
24
+ /** The left list's title, which names it. */
25
+ leftLabel?: string;
26
+ /** The right list's title, which names it. */
27
+ rightLabel?: string;
28
+ /** Names the button that moves every item right. */
29
+ moveAllRightLabel?: string;
30
+ /** Names the button that moves the checked items right. */
31
+ moveRightLabel?: string;
32
+ /** Names the button that moves the checked items left. */
33
+ moveLeftLabel?: string;
34
+ /** Names the button that moves every item left. */
35
+ moveAllLeftLabel?: string;
36
+ /** Adds the buttons that move every enabled item at once. Default: `false`. */
37
+ shouldShowMoveAll?: boolean;
38
+ /** A checkbox in each list's header - all, some or none checked - and the count beside it. Default: `false`. */
39
+ hasSelectAll?: boolean;
40
+ /** The count in a header: what is checked, of how many. Default: `n/total`. */
41
+ getCountLabel?: (checked: number, total: number) => string;
42
+ /** The checkboxes' and buttons' size. Default: its `FormControl`'s, else `'md'`. */
43
+ size?: keyof Theme['sizes'];
44
+ /** The checkboxes' and buttons' color - resolves to `theme.palette`. Default: its `FormControl`'s. */
45
+ color?: keyof Theme['palette'];
46
+ disabled?: boolean;
47
+ /** The lists take the error color. */
48
+ error?: boolean;
49
+ /** On the group, which a `FormLabel` names it by. Default: its `FormControl`'s. */
50
+ id?: string;
51
+ className?: string;
52
+ 'aria-label'?: string;
53
+ 'aria-labelledby'?: string;
54
+ 'aria-describedby'?: string;
55
+ 'data-testid'?: string;
56
+ }
57
+ /**
58
+ * @description A transfer list: two lists, and the buttons that move the checked items from one
59
+ * to the other. Each list is a list of rows whose checkbox is the row, so it is one tab stop and
60
+ * the label toggles it. The value is the values on the right; the items keep their own order on
61
+ * each side. A disabled item stays where it is. Every name - the lists' titles, the four buttons -
62
+ * is the app's, so it carries no language of its own. In a `FormControl` it takes the field's
63
+ * size, color, error and disabled state, and its `FormLabel` names the group.
64
+ */
65
+ declare function TransferList({ items, value, defaultValue, onChange, leftLabel, rightLabel, moveAllRightLabel: moveAllRightLabelProp, moveRightLabel: moveRightLabelProp, moveLeftLabel: moveLeftLabelProp, moveAllLeftLabel: moveAllLeftLabelProp, shouldShowMoveAll: shouldShowMoveAllProp, hasSelectAll: hasSelectAllProp, getCountLabel, size: sizeProp, color: colorProp, disabled: disabledProp, error: errorProp, id: idProp, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'data-testid': dataTestid, ...spaceProps }: Readonly<TransferListProps>): import("react").JSX.Element;
66
+ //#endregion
67
+ export { TransferList, type TransferListItem, TransferListProps, type TransferListValue };