@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,67 @@
1
+ import { W as Theme } from "./index-CJhK7JND.mjs";
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 };
@@ -0,0 +1,354 @@
1
+ import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
2
+ import { n as useDefaultProps } from "./theme-Z9_QludW.mjs";
3
+ import { Typography } from "./Typography.mjs";
4
+ import { t as Icon } from "./Icon-BihOAP4u.mjs";
5
+ import { Button } from "./Button.mjs";
6
+ import { Paper } from "./Paper.mjs";
7
+ import { useFormControl } from "./FormControl.mjs";
8
+ import { Checkbox } from "./Checkbox.mjs";
9
+ import { t as useControlled } from "./useControlled-CBRLsO-H.mjs";
10
+ import { useId, useState } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ //#region src/TransferList/hooks/useTransferList.ts
13
+ const isEnabled = (item) => !item.disabled;
14
+ /**
15
+ * A transfer list's state: which items are on the right (controlled or not), which are checked,
16
+ * and the moves between the sides. A move takes the checked, enabled items of its source - or all
17
+ * the enabled ones, which its button is off without - and unchecks what it moves; the items keep their own order on each side.
18
+ */
19
+ function useTransferList({ items, value, defaultValue, onChange }) {
20
+ const [rightValues, setRightValues] = useControlled({
21
+ controlled: value,
22
+ default: defaultValue ?? []
23
+ });
24
+ const [checked, setChecked] = useState([]);
25
+ const isRight = (item) => rightValues.includes(item.value);
26
+ const left = items.filter((item) => !isRight(item));
27
+ const right = items.filter(isRight);
28
+ const sides = {
29
+ left,
30
+ right
31
+ };
32
+ const isChecked = (item) => !item.disabled && checked.includes(item.value);
33
+ const getChecked = (side) => sides[side].filter(isChecked);
34
+ const getEnabled = (side) => sides[side].filter(isEnabled);
35
+ const commit = (next) => {
36
+ setRightValues(next);
37
+ onChange?.(next);
38
+ };
39
+ const toggle = (item) => {
40
+ setChecked((current) => current.includes(item.value) ? current.filter((entry) => entry !== item.value) : [...current, item.value]);
41
+ };
42
+ const toggleAll = (side) => {
43
+ const enabled = getEnabled(side).map((item) => item.value);
44
+ setChecked((current) => {
45
+ const isAll = enabled.every((entry) => current.includes(entry));
46
+ const rest = current.filter((entry) => !enabled.includes(entry));
47
+ return isAll ? rest : [...rest, ...enabled];
48
+ });
49
+ };
50
+ const move = (to, moving) => {
51
+ const moved = moving.map((item) => item.value);
52
+ setChecked((current) => current.filter((entry) => !moved.includes(entry)));
53
+ commit(to === "right" ? [...rightValues, ...moved] : rightValues.filter((entry) => !moved.includes(entry)));
54
+ };
55
+ return {
56
+ items,
57
+ left,
58
+ right,
59
+ isChecked,
60
+ getChecked,
61
+ getEnabled,
62
+ toggle,
63
+ toggleAll,
64
+ moveRight: () => move("right", getChecked("left")),
65
+ moveLeft: () => move("left", getChecked("right")),
66
+ moveAllRight: () => move("right", getEnabled("left")),
67
+ moveAllLeft: () => move("left", getEnabled("right"))
68
+ };
69
+ }
70
+ //#endregion
71
+ //#region src/TransferList/TransferList.tsx
72
+ const TransferListRoot = styled("div", {
73
+ name: "TransferList",
74
+ label: "TransferList",
75
+ shouldForwardProp: createShouldForwardProp([...props, "isDisabled"]),
76
+ systemProps: [src_exports.space]
77
+ })(({ theme, isDisabled }) => ({
78
+ display: "flex",
79
+ alignItems: "stretch",
80
+ gap: theme.space[2],
81
+ ...isDisabled && { opacity: .5 }
82
+ }));
83
+ const TransferListList = styled(Paper, {
84
+ name: "TransferList",
85
+ slot: "list",
86
+ label: "TransferListList",
87
+ shouldForwardProp: createShouldForwardProp(["isError"])
88
+ })(({ theme, isError }) => ({
89
+ flex: "1 1 0",
90
+ minWidth: 0,
91
+ overflow: "hidden",
92
+ border: `${theme.borderWidths.thin} solid ${(0, src_exports.get)(theme, isError ? "palette.error.main" : "border.default")}`
93
+ }));
94
+ const TransferListHeader = styled("div", {
95
+ name: "TransferList",
96
+ slot: "header",
97
+ label: "TransferListHeader"
98
+ })(({ theme }) => ({
99
+ display: "flex",
100
+ alignItems: "center",
101
+ gap: theme.space[1],
102
+ padding: `${theme.space[1]} ${theme.space[2]}`,
103
+ borderBottom: `${theme.borderWidths.thin} solid ${(0, src_exports.get)(theme, "border.default")}`
104
+ }));
105
+ const TransferListTitle = styled("span", {
106
+ name: "TransferList",
107
+ slot: "title",
108
+ label: "TransferListTitle"
109
+ })({
110
+ flex: 1,
111
+ minWidth: 0
112
+ });
113
+ const TransferListCount = styled("span", {
114
+ name: "TransferList",
115
+ slot: "count",
116
+ label: "TransferListCount"
117
+ })(({ theme }) => ({
118
+ color: theme.text.secondary,
119
+ whiteSpace: "nowrap"
120
+ }));
121
+ const TransferListItems = styled("div", {
122
+ name: "TransferList",
123
+ slot: "items",
124
+ label: "TransferListItems"
125
+ })({
126
+ height: "14rem",
127
+ overflowY: "auto"
128
+ });
129
+ const TransferListRow = styled("div", {
130
+ name: "TransferList",
131
+ slot: "item",
132
+ label: "TransferListItem"
133
+ })(({ theme }) => ({
134
+ display: "flex",
135
+ "&:hover": { backgroundColor: (0, src_exports.get)(theme, "background.secondary") },
136
+ "& > label": {
137
+ flex: 1,
138
+ padding: `${theme.space[1]} ${theme.space[2]}`,
139
+ boxSizing: "border-box"
140
+ }
141
+ }));
142
+ const TransferListControls = styled("div", {
143
+ name: "TransferList",
144
+ slot: "controls",
145
+ label: "TransferListControls"
146
+ })(({ theme }) => ({
147
+ display: "flex",
148
+ flexDirection: "column",
149
+ justifyContent: "center",
150
+ alignItems: "stretch",
151
+ gap: theme.space[1]
152
+ }));
153
+ const TransferListIcon = styled("span", {
154
+ name: "TransferList",
155
+ slot: "icon",
156
+ label: "TransferListIcon"
157
+ })({
158
+ display: "inline-flex",
159
+ alignItems: "center",
160
+ "[dir=\"rtl\"] &": { transform: "scaleX(-1)" },
161
+ "& > :nth-of-type(2)": { marginInlineStart: "-0.5em" }
162
+ });
163
+ function List({ side, title, baseId, state, hasSelectAll, getCountLabel, size, color, disabled, isError }) {
164
+ const items = state[side];
165
+ const titleId = `${baseId}-${side}-title`;
166
+ const enabledCount = state.getEnabled(side).length;
167
+ const checkedCount = state.getChecked(side).length;
168
+ const isAll = enabledCount > 0 && checkedCount === enabledCount;
169
+ return /* @__PURE__ */ jsxs(TransferListList, {
170
+ elevation: 0,
171
+ p: 0,
172
+ isError,
173
+ "data-side": side,
174
+ children: [/* @__PURE__ */ jsxs(TransferListHeader, { children: [
175
+ hasSelectAll && /* @__PURE__ */ jsx(Checkbox, {
176
+ id: `${baseId}-${side}-all`,
177
+ "aria-labelledby": titleId,
178
+ size,
179
+ color,
180
+ disabled: disabled || enabledCount === 0,
181
+ checked: isAll,
182
+ indeterminate: checkedCount > 0 && !isAll,
183
+ onChange: () => state.toggleAll(side)
184
+ }),
185
+ /* @__PURE__ */ jsx(TransferListTitle, {
186
+ id: titleId,
187
+ children: /* @__PURE__ */ jsx(Typography, {
188
+ variant: "subtitle2",
189
+ as: "span",
190
+ children: title
191
+ })
192
+ }),
193
+ hasSelectAll && /* @__PURE__ */ jsx(TransferListCount, { children: /* @__PURE__ */ jsx(Typography, {
194
+ variant: "caption",
195
+ children: getCountLabel(checkedCount, items.length)
196
+ }) })
197
+ ] }), /* @__PURE__ */ jsx(TransferListItems, {
198
+ role: "list",
199
+ "aria-labelledby": title ? titleId : void 0,
200
+ children: items.map((item) => {
201
+ const position = state.items.indexOf(item);
202
+ const labelId = `${baseId}-${position}-label`;
203
+ return /* @__PURE__ */ jsx(TransferListRow, {
204
+ role: "listitem",
205
+ children: /* @__PURE__ */ jsx(Checkbox, {
206
+ id: `${baseId}-${position}`,
207
+ "aria-labelledby": labelId,
208
+ size,
209
+ color,
210
+ disabled: disabled || item.disabled,
211
+ checked: state.isChecked(item),
212
+ onChange: () => state.toggle(item),
213
+ children: /* @__PURE__ */ jsx(Typography, {
214
+ variant: "body2",
215
+ as: "span",
216
+ id: labelId,
217
+ children: item.label
218
+ })
219
+ })
220
+ }, item.value);
221
+ })
222
+ })]
223
+ });
224
+ }
225
+ /**
226
+ * @description A transfer list: two lists, and the buttons that move the checked items from one
227
+ * to the other. Each list is a list of rows whose checkbox is the row, so it is one tab stop and
228
+ * the label toggles it. The value is the values on the right; the items keep their own order on
229
+ * each side. A disabled item stays where it is. Every name - the lists' titles, the four buttons -
230
+ * is the app's, so it carries no language of its own. In a `FormControl` it takes the field's
231
+ * size, color, error and disabled state, and its `FormLabel` names the group.
232
+ */
233
+ 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 }) {
234
+ const dp = useDefaultProps("TransferList");
235
+ const fc = useFormControl({
236
+ id: idProp,
237
+ error: errorProp,
238
+ disabled: disabledProp,
239
+ size: sizeProp ?? dp.size,
240
+ color: colorProp ?? dp.color
241
+ });
242
+ const baseId = useId();
243
+ const moveAllRightLabel = moveAllRightLabelProp ?? dp.moveAllRightLabel;
244
+ const moveRightLabel = moveRightLabelProp ?? dp.moveRightLabel;
245
+ const moveLeftLabel = moveLeftLabelProp ?? dp.moveLeftLabel;
246
+ const moveAllLeftLabel = moveAllLeftLabelProp ?? dp.moveAllLeftLabel;
247
+ const shouldShowMoveAll = shouldShowMoveAllProp ?? dp.shouldShowMoveAll ?? false;
248
+ const hasSelectAll = hasSelectAllProp ?? dp.hasSelectAll ?? false;
249
+ const state = useTransferList({
250
+ items,
251
+ value,
252
+ defaultValue,
253
+ onChange
254
+ });
255
+ const buttonProps = {
256
+ variant: "outlined",
257
+ size: fc.size,
258
+ color: fc.color
259
+ };
260
+ const isOff = (side, ofChecked) => fc.disabled || (ofChecked ? state.getChecked(side).length === 0 : state.getEnabled(side).length === 0);
261
+ return /* @__PURE__ */ jsxs(TransferListRoot, {
262
+ id: fc.id,
263
+ role: "group",
264
+ isDisabled: fc.disabled,
265
+ className,
266
+ "data-testid": dataTestid,
267
+ "aria-label": ariaLabel,
268
+ "aria-labelledby": ariaLabelledby ?? fc.labelId,
269
+ "aria-describedby": ariaDescribedby ?? fc["aria-describedby"],
270
+ ...spaceProps,
271
+ children: [
272
+ /* @__PURE__ */ jsx(List, {
273
+ side: "left",
274
+ title: leftLabel,
275
+ baseId,
276
+ state,
277
+ hasSelectAll,
278
+ getCountLabel,
279
+ size: fc.size,
280
+ color: fc.color,
281
+ disabled: fc.disabled,
282
+ isError: fc.error
283
+ }),
284
+ /* @__PURE__ */ jsxs(TransferListControls, { children: [
285
+ shouldShowMoveAll && /* @__PURE__ */ jsx(Button, {
286
+ ...buttonProps,
287
+ "aria-label": moveAllRightLabel,
288
+ disabled: isOff("left", false),
289
+ onClick: state.moveAllRight,
290
+ children: /* @__PURE__ */ jsxs(TransferListIcon, { children: [/* @__PURE__ */ jsx(Icon, {
291
+ name: "chevron_right",
292
+ size: "1em",
293
+ color: "inherit"
294
+ }), /* @__PURE__ */ jsx(Icon, {
295
+ name: "chevron_right",
296
+ size: "1em",
297
+ color: "inherit"
298
+ })] })
299
+ }),
300
+ /* @__PURE__ */ jsx(Button, {
301
+ ...buttonProps,
302
+ "aria-label": moveRightLabel,
303
+ disabled: isOff("left", true),
304
+ onClick: state.moveRight,
305
+ children: /* @__PURE__ */ jsx(TransferListIcon, { children: /* @__PURE__ */ jsx(Icon, {
306
+ name: "chevron_right",
307
+ size: "1em",
308
+ color: "inherit"
309
+ }) })
310
+ }),
311
+ /* @__PURE__ */ jsx(Button, {
312
+ ...buttonProps,
313
+ "aria-label": moveLeftLabel,
314
+ disabled: isOff("right", true),
315
+ onClick: state.moveLeft,
316
+ children: /* @__PURE__ */ jsx(TransferListIcon, { children: /* @__PURE__ */ jsx(Icon, {
317
+ name: "chevron_left",
318
+ size: "1em",
319
+ color: "inherit"
320
+ }) })
321
+ }),
322
+ shouldShowMoveAll && /* @__PURE__ */ jsx(Button, {
323
+ ...buttonProps,
324
+ "aria-label": moveAllLeftLabel,
325
+ disabled: isOff("right", false),
326
+ onClick: state.moveAllLeft,
327
+ children: /* @__PURE__ */ jsxs(TransferListIcon, { children: [/* @__PURE__ */ jsx(Icon, {
328
+ name: "chevron_left",
329
+ size: "1em",
330
+ color: "inherit"
331
+ }), /* @__PURE__ */ jsx(Icon, {
332
+ name: "chevron_left",
333
+ size: "1em",
334
+ color: "inherit"
335
+ })] })
336
+ })
337
+ ] }),
338
+ /* @__PURE__ */ jsx(List, {
339
+ side: "right",
340
+ title: rightLabel,
341
+ baseId,
342
+ state,
343
+ hasSelectAll,
344
+ getCountLabel,
345
+ size: fc.size,
346
+ color: fc.color,
347
+ disabled: fc.disabled,
348
+ isError: fc.error
349
+ })
350
+ ]
351
+ });
352
+ }
353
+ //#endregion
354
+ export { TransferList };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_src = require("./src-DU81aGy9.cjs");
3
- const require_theme = require("./theme-BXlAP3xf.cjs");
3
+ const require_theme = require("./theme-BxXuXRgQ.cjs");
4
4
  require("react");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
@@ -1,3 +1,3 @@
1
- import { Y as TypographyVariant } from "./themes-Kbk9h5cN.cjs";
2
- import { a as TypographyProps, i as TypographyAlign, n as TextColorToken, r as Typography, t as BackgroundToken } from "./index-BSqet8aO.cjs";
1
+ import { ht as TypographyVariant } from "./index-DJ0f69wh.cjs";
2
+ import { a as TypographyProps, i as TypographyAlign, n as TextColorToken, r as Typography, t as BackgroundToken } from "./index-K5exjvnX.cjs";
3
3
  export { BackgroundToken, TextColorToken, Typography, TypographyAlign, TypographyProps, type TypographyVariant };
@@ -1,3 +1,3 @@
1
- import { Y as TypographyVariant } from "./themes-RX2UX5gD.mjs";
2
- import { a as TypographyProps, i as TypographyAlign, n as TextColorToken, r as Typography, t as BackgroundToken } from "./index-smqjMLAZ.mjs";
1
+ import { ht as TypographyVariant } from "./index-CJhK7JND.mjs";
2
+ import { a as TypographyProps, i as TypographyAlign, n as TextColorToken, r as Typography, t as BackgroundToken } from "./index-ClZyaZrR.mjs";
3
3
  export { BackgroundToken, TextColorToken, Typography, TypographyAlign, TypographyProps, type TypographyVariant };
@@ -1,5 +1,5 @@
1
1
  import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "./src-DLGYOJMh.mjs";
2
- import { r as useTheme } from "./theme-CDVxig_g.mjs";
2
+ import { r as useTheme } from "./theme-Z9_QludW.mjs";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/Typography/Typography.tsx
package/dist/View.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ViewBorderWidthToken, i as ViewBorderRadiusToken, n as ViewBackgroundToken, o as ViewColorToken, r as ViewBorderColorToken, s as ViewProps, t as View } from "./index-nB94D7UM.cjs";
1
+ import { $t as ViewBorderRadiusToken, Qt as ViewBorderColorToken, Xt as View, Zt as ViewBackgroundToken, en as ViewBorderWidthToken, nn as ViewProps, tn as ViewColorToken } from "./index-DJ0f69wh.cjs";
2
2
  export { View, ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewProps };
package/dist/View.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ViewBorderWidthToken, i as ViewBorderRadiusToken, n as ViewBackgroundToken, o as ViewColorToken, r as ViewBorderColorToken, s as ViewProps, t as View } from "./index-cuv3o-L7.mjs";
1
+ import { $t as ViewBorderRadiusToken, Qt as ViewBorderColorToken, Xt as View, Zt as ViewBackgroundToken, en as ViewBorderWidthToken, nn as ViewProps, tn as ViewColorToken } from "./index-CJhK7JND.mjs";
2
2
  export { View, ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewProps };