@crisp-ui-kit/crisp 0.2.0 → 0.7.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 (590) hide show
  1. package/README.md +20 -0
  2. package/dist/accordion.css +9 -1
  3. package/dist/appshell.css +12 -4
  4. package/dist/authshell.css +57 -0
  5. package/dist/authshell.d.ts +7 -0
  6. package/dist/avatargroup.css +2 -2
  7. package/dist/badge.css +4 -4
  8. package/dist/barchart.css +13 -5
  9. package/dist/base.css +25 -0
  10. package/dist/board.css +9 -1
  11. package/dist/bulkbar.css +11 -3
  12. package/dist/button.css +16 -2
  13. package/dist/button.d.ts +2 -1
  14. package/dist/card.css +8 -0
  15. package/dist/checkbox.css +17 -1
  16. package/dist/cjs/components/accordion/accordion.js +69 -0
  17. package/dist/cjs/components/accordion/accordion.recipe.js +26 -0
  18. package/dist/cjs/components/accordion/index.js +7 -0
  19. package/dist/cjs/components/avatar/avatar.js +44 -0
  20. package/dist/cjs/components/avatar/avatar.recipe.js +42 -0
  21. package/dist/cjs/components/avatar/index.js +7 -0
  22. package/dist/cjs/components/avatargroup/avatargroup.js +52 -0
  23. package/dist/cjs/components/avatargroup/avatargroup.recipe.js +18 -0
  24. package/dist/cjs/components/avatargroup/index.js +7 -0
  25. package/dist/cjs/components/badge/badge.js +44 -0
  26. package/dist/cjs/components/badge/badge.recipe.js +68 -0
  27. package/dist/cjs/components/badge/index.js +7 -0
  28. package/dist/cjs/components/barchart/barchart.js +45 -0
  29. package/dist/cjs/components/barchart/barchart.recipe.js +34 -0
  30. package/dist/cjs/components/barchart/index.js +7 -0
  31. package/dist/cjs/components/breadcrumb/breadcrumb.js +53 -0
  32. package/dist/cjs/components/breadcrumb/breadcrumb.recipe.js +21 -0
  33. package/dist/cjs/components/breadcrumb/index.js +7 -0
  34. package/dist/cjs/components/bulkbar/bulkbar.js +53 -0
  35. package/dist/cjs/components/bulkbar/bulkbar.recipe.js +31 -0
  36. package/dist/cjs/components/bulkbar/index.js +8 -0
  37. package/dist/cjs/components/button/button.js +62 -0
  38. package/dist/cjs/components/button/button.recipe.js +58 -0
  39. package/dist/cjs/components/button/index.js +7 -0
  40. package/dist/cjs/components/callout/callout.js +25 -0
  41. package/dist/cjs/components/callout/callout.recipe.js +29 -0
  42. package/dist/cjs/components/callout/index.js +7 -0
  43. package/dist/cjs/components/card/card.js +54 -0
  44. package/dist/cjs/components/card/card.recipe.js +31 -0
  45. package/dist/cjs/components/card/index.js +10 -0
  46. package/dist/cjs/components/checkbox/checkbox.js +56 -0
  47. package/dist/cjs/components/checkbox/checkbox.recipe.js +34 -0
  48. package/dist/cjs/components/checkbox/index.js +7 -0
  49. package/dist/cjs/components/columncalc/columncalc.js +139 -0
  50. package/dist/cjs/components/columncalc/columncalc.recipe.js +33 -0
  51. package/dist/cjs/components/columncalc/index.js +10 -0
  52. package/dist/cjs/components/contextmenu/contextmenu.js +78 -0
  53. package/dist/cjs/components/contextmenu/contextmenu.recipe.js +24 -0
  54. package/dist/cjs/components/contextmenu/index.js +7 -0
  55. package/dist/cjs/components/datatable/datatable.js +508 -0
  56. package/dist/cjs/components/datatable/datatable.recipe.js +113 -0
  57. package/dist/cjs/components/datatable/index.js +7 -0
  58. package/dist/cjs/components/datepicker/datepicker.js +153 -0
  59. package/dist/cjs/components/datepicker/datepicker.recipe.js +180 -0
  60. package/dist/cjs/components/datepicker/index.js +19 -0
  61. package/dist/cjs/components/datepickerfield/datepickerfield.js +85 -0
  62. package/dist/cjs/components/datepickerfield/datepickerfield.recipe.js +44 -0
  63. package/dist/cjs/components/datepickerfield/index.js +7 -0
  64. package/dist/cjs/components/dialog/dialog.js +86 -0
  65. package/dist/cjs/components/dialog/dialog.recipe.js +35 -0
  66. package/dist/cjs/components/dialog/index.js +9 -0
  67. package/dist/cjs/components/divider/divider.js +10 -0
  68. package/dist/cjs/components/divider/divider.recipe.js +17 -0
  69. package/dist/cjs/components/divider/index.js +7 -0
  70. package/dist/cjs/components/donutchart/donutchart.js +41 -0
  71. package/dist/cjs/components/donutchart/donutchart.recipe.js +30 -0
  72. package/dist/cjs/components/donutchart/index.js +7 -0
  73. package/dist/cjs/components/drawer/drawer.js +80 -0
  74. package/dist/cjs/components/drawer/drawer.recipe.js +30 -0
  75. package/dist/cjs/components/drawer/index.js +9 -0
  76. package/dist/cjs/components/emptystate/emptystate.js +10 -0
  77. package/dist/cjs/components/emptystate/emptystate.recipe.js +34 -0
  78. package/dist/cjs/components/emptystate/index.js +7 -0
  79. package/dist/cjs/components/formfield/formfield.js +50 -0
  80. package/dist/cjs/components/formfield/formfield.recipe.js +22 -0
  81. package/dist/cjs/components/formfield/index.js +7 -0
  82. package/dist/cjs/components/input/index.js +7 -0
  83. package/dist/cjs/components/input/input.js +47 -0
  84. package/dist/cjs/components/input/input.recipe.js +59 -0
  85. package/dist/cjs/components/kbd/index.js +7 -0
  86. package/dist/cjs/components/kbd/kbd.js +44 -0
  87. package/dist/cjs/components/kbd/kbd.recipe.js +23 -0
  88. package/dist/cjs/components/linechart/index.js +7 -0
  89. package/dist/cjs/components/linechart/linechart.js +57 -0
  90. package/dist/cjs/components/linechart/linechart.recipe.js +35 -0
  91. package/dist/cjs/components/menu/index.js +14 -0
  92. package/dist/cjs/components/menu/menu-keyboard.js +117 -0
  93. package/dist/cjs/components/menu/menu.js +144 -0
  94. package/dist/cjs/components/menu/menu.recipe.js +54 -0
  95. package/dist/cjs/components/multiselect/index.js +7 -0
  96. package/dist/cjs/components/multiselect/multiselect.js +161 -0
  97. package/dist/cjs/components/multiselect/multiselect.recipe.js +71 -0
  98. package/dist/cjs/components/popover/index.js +7 -0
  99. package/dist/cjs/components/popover/popover.js +106 -0
  100. package/dist/cjs/components/popover/popover.recipe.js +21 -0
  101. package/dist/cjs/components/progress/index.js +7 -0
  102. package/dist/cjs/components/progress/progress.js +26 -0
  103. package/dist/cjs/components/progress/progress.recipe.js +20 -0
  104. package/dist/cjs/components/radiogroup/index.js +8 -0
  105. package/dist/cjs/components/radiogroup/radiogroup.js +83 -0
  106. package/dist/cjs/components/radiogroup/radiogroup.recipe.js +40 -0
  107. package/dist/cjs/components/resizablepanel/index.js +12 -0
  108. package/dist/cjs/components/resizablepanel/resizablepanel.js +176 -0
  109. package/dist/cjs/components/resizablepanel/resizablepanel.recipe.js +69 -0
  110. package/dist/cjs/components/segmented/index.js +7 -0
  111. package/dist/cjs/components/segmented/segmented.js +95 -0
  112. package/dist/cjs/components/segmented/segmented.recipe.js +23 -0
  113. package/dist/cjs/components/select/index.js +7 -0
  114. package/dist/cjs/components/select/select.js +180 -0
  115. package/dist/cjs/components/select/select.recipe.js +79 -0
  116. package/dist/cjs/components/skeleton/index.js +7 -0
  117. package/dist/cjs/components/skeleton/skeleton.js +13 -0
  118. package/dist/cjs/components/skeleton/skeleton.recipe.js +17 -0
  119. package/dist/cjs/components/spinner/index.js +7 -0
  120. package/dist/cjs/components/spinner/spinner.js +15 -0
  121. package/dist/cjs/components/spinner/spinner.recipe.js +16 -0
  122. package/dist/cjs/components/stagebar/index.js +7 -0
  123. package/dist/cjs/components/stagebar/stagebar.js +26 -0
  124. package/dist/cjs/components/stagebar/stagebar.recipe.js +17 -0
  125. package/dist/cjs/components/statcard/index.js +7 -0
  126. package/dist/cjs/components/statcard/statcard.js +15 -0
  127. package/dist/cjs/components/statcard/statcard.recipe.js +37 -0
  128. package/dist/cjs/components/switch/index.js +7 -0
  129. package/dist/cjs/components/switch/switch.js +58 -0
  130. package/dist/cjs/components/switch/switch.recipe.js +29 -0
  131. package/dist/cjs/components/table/index.js +14 -0
  132. package/dist/cjs/components/table/table.js +66 -0
  133. package/dist/cjs/components/table/table.recipe.js +43 -0
  134. package/dist/cjs/components/tabletoolbar/index.js +20 -0
  135. package/dist/cjs/components/tabletoolbar/tabletoolbar.chrome.js +84 -0
  136. package/dist/cjs/components/tabletoolbar/tabletoolbar.js +237 -0
  137. package/dist/cjs/components/tabletoolbar/tabletoolbar.recipe.js +26 -0
  138. package/dist/cjs/components/tabs/index.js +7 -0
  139. package/dist/cjs/components/tabs/tabs.js +106 -0
  140. package/dist/cjs/components/tabs/tabs.recipe.js +36 -0
  141. package/dist/cjs/components/textarea/index.js +7 -0
  142. package/dist/cjs/components/textarea/textarea.js +56 -0
  143. package/dist/cjs/components/textarea/textarea.recipe.js +46 -0
  144. package/dist/cjs/components/toast/index.js +8 -0
  145. package/dist/cjs/components/toast/toast.js +95 -0
  146. package/dist/cjs/components/toast/toast.recipe.js +31 -0
  147. package/dist/cjs/components/tooltip/index.js +7 -0
  148. package/dist/cjs/components/tooltip/tooltip.js +95 -0
  149. package/dist/cjs/components/tooltip/tooltip.recipe.js +16 -0
  150. package/dist/cjs/components/wheelpicker/index.js +7 -0
  151. package/dist/cjs/components/wheelpicker/wheelpicker.js +134 -0
  152. package/dist/cjs/components/wheelpicker/wheelpicker.recipe.js +95 -0
  153. package/dist/cjs/core/cx.js +8 -0
  154. package/dist/cjs/core/define.js +6 -0
  155. package/dist/cjs/core/index.js +11 -0
  156. package/dist/cjs/core/primitive.js +49 -0
  157. package/dist/cjs/core/resolve.js +44 -0
  158. package/dist/cjs/core/types.js +2 -0
  159. package/dist/cjs/index.js +92 -0
  160. package/dist/cjs/package.json +3 -0
  161. package/dist/cjs/product/appshell/appshell.js +104 -0
  162. package/dist/cjs/product/appshell/appshell.recipe.js +30 -0
  163. package/dist/cjs/product/appshell/index.js +7 -0
  164. package/dist/cjs/product/authshell/authshell.js +21 -0
  165. package/dist/cjs/product/authshell/authshell.recipe.js +67 -0
  166. package/dist/cjs/product/authshell/index.js +7 -0
  167. package/dist/cjs/product/board/board.js +78 -0
  168. package/dist/cjs/product/board/board.recipe.js +31 -0
  169. package/dist/cjs/product/board/index.js +7 -0
  170. package/dist/cjs/product/command/command.js +238 -0
  171. package/dist/cjs/product/command/command.recipe.js +47 -0
  172. package/dist/cjs/product/command/index.js +8 -0
  173. package/dist/cjs/product/entitycard/entitycard.js +14 -0
  174. package/dist/cjs/product/entitycard/entitycard.recipe.js +32 -0
  175. package/dist/cjs/product/entitycard/index.js +7 -0
  176. package/dist/cjs/product/flowcanvas/flowcanvas.js +121 -0
  177. package/dist/cjs/product/flowcanvas/flowcanvas.recipe.js +28 -0
  178. package/dist/cjs/product/flowcanvas/index.js +7 -0
  179. package/dist/cjs/product/inbox/inbox.js +16 -0
  180. package/dist/cjs/product/inbox/inbox.recipe.js +46 -0
  181. package/dist/cjs/product/inbox/index.js +7 -0
  182. package/dist/cjs/product/listpage/index.js +8 -0
  183. package/dist/cjs/product/listpage/listpage.js +25 -0
  184. package/dist/cjs/product/listpage/listpage.recipe.js +46 -0
  185. package/dist/cjs/product/navitem/index.js +5 -0
  186. package/dist/cjs/product/navitem/navitem.js +44 -0
  187. package/dist/cjs/product/navitem/navitem.recipe.js +36 -0
  188. package/dist/cjs/product/onboarding/index.js +7 -0
  189. package/dist/cjs/product/onboarding/onboarding.js +17 -0
  190. package/dist/cjs/product/onboarding/onboarding.recipe.js +44 -0
  191. package/dist/cjs/product/recordpage/index.js +7 -0
  192. package/dist/cjs/product/recordpage/recordpage.js +409 -0
  193. package/dist/cjs/product/recordpage/recordpage.recipe.js +162 -0
  194. package/dist/cjs/product/recordpanel/index.js +7 -0
  195. package/dist/cjs/product/recordpanel/recordpanel.js +83 -0
  196. package/dist/cjs/product/recordpanel/recordpanel.recipe.js +51 -0
  197. package/dist/cjs/product/recordstable/company-logos.js +29 -0
  198. package/dist/cjs/product/recordstable/index.js +10 -0
  199. package/dist/cjs/product/recordstable/recordstable.js +1092 -0
  200. package/dist/cjs/product/recordstable/recordstable.recipe.js +152 -0
  201. package/dist/cjs/product/recordstable/recordstable.tag.js +21 -0
  202. package/dist/cjs/product/richtext/index.js +7 -0
  203. package/dist/cjs/product/richtext/richtext.js +147 -0
  204. package/dist/cjs/product/richtext/richtext.recipe.js +43 -0
  205. package/dist/cjs/product/settingssection/index.js +7 -0
  206. package/dist/cjs/product/settingssection/settingssection.js +14 -0
  207. package/dist/cjs/product/settingssection/settingssection.recipe.js +23 -0
  208. package/dist/cjs/product/settingsshell/index.js +7 -0
  209. package/dist/cjs/product/settingsshell/settingsshell.js +59 -0
  210. package/dist/cjs/product/settingsshell/settingsshell.recipe.js +46 -0
  211. package/dist/cjs/product/sidebar/index.js +13 -0
  212. package/dist/cjs/product/sidebar/sidebar.js +148 -0
  213. package/dist/cjs/product/sidebar/sidebar.recipe.js +46 -0
  214. package/dist/cjs/product/tasklist/index.js +7 -0
  215. package/dist/cjs/product/tasklist/tasklist.js +19 -0
  216. package/dist/cjs/product/tasklist/tasklist.recipe.js +38 -0
  217. package/dist/cjs/product/trialbanner/index.js +7 -0
  218. package/dist/cjs/product/trialbanner/trialbanner.js +13 -0
  219. package/dist/cjs/product/trialbanner/trialbanner.recipe.js +32 -0
  220. package/dist/cjs/product/viewtoggle/index.js +7 -0
  221. package/dist/cjs/product/viewtoggle/viewtoggle.js +55 -0
  222. package/dist/cjs/product/viewtoggle/viewtoggle.recipe.js +27 -0
  223. package/dist/cjs/tokens/contract.js +21 -0
  224. package/dist/cjs/tokens/elevation.js +47 -0
  225. package/dist/cjs/tokens/index.js +18 -0
  226. package/dist/cjs/tokens/palette.js +63 -0
  227. package/dist/cjs/tokens/scale.js +70 -0
  228. package/dist/cjs/tokens/semantic.js +57 -0
  229. package/dist/columncalc.css +26 -0
  230. package/dist/columncalc.d.ts +7 -0
  231. package/dist/command.css +34 -1
  232. package/dist/contextmenu.css +11 -3
  233. package/dist/datatable.css +106 -0
  234. package/dist/datatable.d.ts +7 -0
  235. package/dist/datepicker.css +165 -19
  236. package/dist/datepicker.d.ts +2 -2
  237. package/dist/datepickerfield.css +27 -0
  238. package/dist/datepickerfield.d.ts +7 -0
  239. package/dist/dialog.css +11 -3
  240. package/dist/donutchart.css +8 -0
  241. package/dist/drawer.css +13 -5
  242. package/dist/entitycard.css +10 -2
  243. package/dist/esm/components/accordion/accordion.js +33 -0
  244. package/dist/esm/components/accordion/accordion.recipe.js +23 -0
  245. package/dist/esm/components/accordion/index.js +2 -0
  246. package/dist/esm/components/avatar/avatar.js +8 -0
  247. package/dist/esm/components/avatar/avatar.recipe.js +39 -0
  248. package/dist/esm/components/avatar/index.js +2 -0
  249. package/dist/esm/components/avatargroup/avatargroup.js +16 -0
  250. package/dist/esm/components/avatargroup/avatargroup.recipe.js +15 -0
  251. package/dist/esm/components/avatargroup/index.js +2 -0
  252. package/dist/esm/components/badge/badge.js +8 -0
  253. package/dist/esm/components/badge/badge.recipe.js +65 -0
  254. package/dist/esm/components/badge/index.js +2 -0
  255. package/dist/esm/components/barchart/barchart.js +42 -0
  256. package/dist/esm/components/barchart/barchart.recipe.js +31 -0
  257. package/dist/esm/components/barchart/index.js +2 -0
  258. package/dist/esm/components/breadcrumb/breadcrumb.js +17 -0
  259. package/dist/esm/components/breadcrumb/breadcrumb.recipe.js +18 -0
  260. package/dist/esm/components/breadcrumb/index.js +2 -0
  261. package/dist/esm/components/bulkbar/bulkbar.js +16 -0
  262. package/dist/esm/components/bulkbar/bulkbar.recipe.js +28 -0
  263. package/dist/esm/components/bulkbar/index.js +2 -0
  264. package/dist/esm/components/button/button.js +26 -0
  265. package/dist/esm/components/button/button.recipe.js +55 -0
  266. package/dist/esm/components/button/index.js +2 -0
  267. package/dist/esm/components/callout/callout.js +22 -0
  268. package/dist/esm/components/callout/callout.recipe.js +26 -0
  269. package/dist/esm/components/callout/index.js +2 -0
  270. package/dist/esm/components/card/card.js +15 -0
  271. package/dist/esm/components/card/card.recipe.js +28 -0
  272. package/dist/esm/components/card/index.js +2 -0
  273. package/dist/esm/components/checkbox/checkbox.js +20 -0
  274. package/dist/esm/components/checkbox/checkbox.recipe.js +31 -0
  275. package/dist/esm/components/checkbox/index.js +2 -0
  276. package/dist/esm/components/columncalc/columncalc.js +100 -0
  277. package/dist/esm/components/columncalc/columncalc.recipe.js +30 -0
  278. package/dist/esm/components/columncalc/index.js +1 -0
  279. package/dist/esm/components/contextmenu/contextmenu.js +42 -0
  280. package/dist/esm/components/contextmenu/contextmenu.recipe.js +21 -0
  281. package/dist/esm/components/contextmenu/index.js +2 -0
  282. package/dist/esm/components/datatable/datatable.js +472 -0
  283. package/dist/esm/components/datatable/datatable.recipe.js +110 -0
  284. package/dist/esm/components/datatable/index.js +2 -0
  285. package/dist/esm/components/datepicker/datepicker.js +108 -0
  286. package/dist/esm/components/datepicker/datepicker.recipe.js +177 -0
  287. package/dist/esm/components/datepicker/index.js +2 -0
  288. package/dist/esm/components/datepickerfield/datepickerfield.js +49 -0
  289. package/dist/esm/components/datepickerfield/datepickerfield.recipe.js +41 -0
  290. package/dist/esm/components/datepickerfield/index.js +2 -0
  291. package/dist/esm/components/dialog/dialog.js +48 -0
  292. package/dist/esm/components/dialog/dialog.recipe.js +32 -0
  293. package/dist/esm/components/dialog/index.js +2 -0
  294. package/dist/esm/components/divider/divider.js +7 -0
  295. package/dist/esm/components/divider/divider.recipe.js +14 -0
  296. package/dist/esm/components/divider/index.js +2 -0
  297. package/dist/esm/components/donutchart/donutchart.js +38 -0
  298. package/dist/esm/components/donutchart/donutchart.recipe.js +27 -0
  299. package/dist/esm/components/donutchart/index.js +2 -0
  300. package/dist/esm/components/drawer/drawer.js +42 -0
  301. package/dist/esm/components/drawer/drawer.recipe.js +27 -0
  302. package/dist/esm/components/drawer/index.js +2 -0
  303. package/dist/esm/components/emptystate/emptystate.js +7 -0
  304. package/dist/esm/components/emptystate/emptystate.recipe.js +31 -0
  305. package/dist/esm/components/emptystate/index.js +2 -0
  306. package/dist/esm/components/formfield/formfield.js +14 -0
  307. package/dist/esm/components/formfield/formfield.recipe.js +19 -0
  308. package/dist/esm/components/formfield/index.js +2 -0
  309. package/dist/esm/components/input/index.js +2 -0
  310. package/dist/esm/components/input/input.js +11 -0
  311. package/dist/esm/components/input/input.recipe.js +56 -0
  312. package/dist/esm/components/kbd/index.js +2 -0
  313. package/dist/esm/components/kbd/kbd.js +8 -0
  314. package/dist/esm/components/kbd/kbd.recipe.js +20 -0
  315. package/dist/esm/components/linechart/index.js +2 -0
  316. package/dist/esm/components/linechart/linechart.js +54 -0
  317. package/dist/esm/components/linechart/linechart.recipe.js +32 -0
  318. package/dist/esm/components/menu/index.js +3 -0
  319. package/dist/esm/components/menu/menu-keyboard.js +80 -0
  320. package/dist/esm/components/menu/menu.js +104 -0
  321. package/dist/esm/components/menu/menu.recipe.js +51 -0
  322. package/dist/esm/components/multiselect/index.js +2 -0
  323. package/dist/esm/components/multiselect/multiselect.js +125 -0
  324. package/dist/esm/components/multiselect/multiselect.recipe.js +68 -0
  325. package/dist/esm/components/popover/index.js +2 -0
  326. package/dist/esm/components/popover/popover.js +70 -0
  327. package/dist/esm/components/popover/popover.recipe.js +18 -0
  328. package/dist/esm/components/progress/index.js +2 -0
  329. package/dist/esm/components/progress/progress.js +23 -0
  330. package/dist/esm/components/progress/progress.recipe.js +17 -0
  331. package/dist/esm/components/radiogroup/index.js +2 -0
  332. package/dist/esm/components/radiogroup/radiogroup.js +46 -0
  333. package/dist/esm/components/radiogroup/radiogroup.recipe.js +37 -0
  334. package/dist/esm/components/resizablepanel/index.js +2 -0
  335. package/dist/esm/components/resizablepanel/resizablepanel.js +135 -0
  336. package/dist/esm/components/resizablepanel/resizablepanel.recipe.js +66 -0
  337. package/dist/esm/components/segmented/index.js +2 -0
  338. package/dist/esm/components/segmented/segmented.js +59 -0
  339. package/dist/esm/components/segmented/segmented.recipe.js +20 -0
  340. package/dist/esm/components/select/index.js +2 -0
  341. package/dist/esm/components/select/select.js +144 -0
  342. package/dist/esm/components/select/select.recipe.js +76 -0
  343. package/dist/esm/components/skeleton/index.js +2 -0
  344. package/dist/esm/components/skeleton/skeleton.js +10 -0
  345. package/dist/esm/components/skeleton/skeleton.recipe.js +14 -0
  346. package/dist/esm/components/spinner/index.js +2 -0
  347. package/dist/esm/components/spinner/spinner.js +12 -0
  348. package/dist/esm/components/spinner/spinner.recipe.js +13 -0
  349. package/dist/esm/components/stagebar/index.js +2 -0
  350. package/dist/esm/components/stagebar/stagebar.js +23 -0
  351. package/dist/esm/components/stagebar/stagebar.recipe.js +14 -0
  352. package/dist/esm/components/statcard/index.js +2 -0
  353. package/dist/esm/components/statcard/statcard.js +12 -0
  354. package/dist/esm/components/statcard/statcard.recipe.js +34 -0
  355. package/dist/esm/components/switch/index.js +2 -0
  356. package/dist/esm/components/switch/switch.js +22 -0
  357. package/dist/esm/components/switch/switch.recipe.js +26 -0
  358. package/dist/esm/components/table/index.js +2 -0
  359. package/dist/esm/components/table/table.js +30 -0
  360. package/dist/esm/components/table/table.recipe.js +40 -0
  361. package/dist/esm/components/tabletoolbar/index.js +2 -0
  362. package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +79 -0
  363. package/dist/esm/components/tabletoolbar/tabletoolbar.js +199 -0
  364. package/dist/esm/components/tabletoolbar/tabletoolbar.recipe.js +23 -0
  365. package/dist/esm/components/tabs/index.js +2 -0
  366. package/dist/esm/components/tabs/tabs.js +70 -0
  367. package/dist/esm/components/tabs/tabs.recipe.js +33 -0
  368. package/dist/esm/components/textarea/index.js +2 -0
  369. package/dist/esm/components/textarea/textarea.js +20 -0
  370. package/dist/esm/components/textarea/textarea.recipe.js +43 -0
  371. package/dist/esm/components/toast/index.js +2 -0
  372. package/dist/esm/components/toast/toast.js +58 -0
  373. package/dist/esm/components/toast/toast.recipe.js +28 -0
  374. package/dist/esm/components/tooltip/index.js +2 -0
  375. package/dist/esm/components/tooltip/tooltip.js +59 -0
  376. package/dist/esm/components/tooltip/tooltip.recipe.js +13 -0
  377. package/dist/esm/components/wheelpicker/index.js +2 -0
  378. package/dist/esm/components/wheelpicker/wheelpicker.js +98 -0
  379. package/dist/esm/components/wheelpicker/wheelpicker.recipe.js +92 -0
  380. package/dist/esm/core/cx.js +1 -0
  381. package/dist/esm/core/define.js +3 -0
  382. package/dist/esm/core/index.js +4 -0
  383. package/dist/esm/core/primitive.js +13 -0
  384. package/dist/esm/core/resolve.js +41 -0
  385. package/dist/esm/core/types.js +1 -0
  386. package/dist/esm/index.js +76 -0
  387. package/dist/esm/product/appshell/appshell.js +68 -0
  388. package/dist/esm/product/appshell/appshell.recipe.js +27 -0
  389. package/dist/esm/product/appshell/index.js +2 -0
  390. package/dist/esm/product/authshell/authshell.js +18 -0
  391. package/dist/esm/product/authshell/authshell.recipe.js +64 -0
  392. package/dist/esm/product/authshell/index.js +2 -0
  393. package/dist/esm/product/board/board.js +42 -0
  394. package/dist/esm/product/board/board.recipe.js +28 -0
  395. package/dist/esm/product/board/index.js +2 -0
  396. package/dist/esm/product/command/command.js +201 -0
  397. package/dist/esm/product/command/command.recipe.js +44 -0
  398. package/dist/esm/product/command/index.js +2 -0
  399. package/dist/esm/product/entitycard/entitycard.js +11 -0
  400. package/dist/esm/product/entitycard/entitycard.recipe.js +29 -0
  401. package/dist/esm/product/entitycard/index.js +2 -0
  402. package/dist/esm/product/flowcanvas/flowcanvas.js +85 -0
  403. package/dist/esm/product/flowcanvas/flowcanvas.recipe.js +25 -0
  404. package/dist/esm/product/flowcanvas/index.js +2 -0
  405. package/dist/esm/product/inbox/inbox.js +13 -0
  406. package/dist/esm/product/inbox/inbox.recipe.js +43 -0
  407. package/dist/esm/product/inbox/index.js +2 -0
  408. package/dist/esm/product/listpage/index.js +2 -0
  409. package/dist/esm/product/listpage/listpage.js +21 -0
  410. package/dist/esm/product/listpage/listpage.recipe.js +43 -0
  411. package/dist/esm/product/navitem/index.js +1 -0
  412. package/dist/esm/product/navitem/navitem.js +8 -0
  413. package/dist/esm/product/navitem/navitem.recipe.js +33 -0
  414. package/dist/esm/product/onboarding/index.js +2 -0
  415. package/dist/esm/product/onboarding/onboarding.js +14 -0
  416. package/dist/esm/product/onboarding/onboarding.recipe.js +41 -0
  417. package/dist/esm/product/recordpage/index.js +2 -0
  418. package/dist/esm/product/recordpage/recordpage.js +372 -0
  419. package/dist/esm/product/recordpage/recordpage.recipe.js +159 -0
  420. package/dist/esm/product/recordpanel/index.js +2 -0
  421. package/dist/esm/product/recordpanel/recordpanel.js +47 -0
  422. package/dist/esm/product/recordpanel/recordpanel.recipe.js +48 -0
  423. package/dist/esm/product/recordstable/company-logos.js +26 -0
  424. package/dist/esm/product/recordstable/index.js +2 -0
  425. package/dist/esm/product/recordstable/recordstable.js +1054 -0
  426. package/dist/esm/product/recordstable/recordstable.recipe.js +149 -0
  427. package/dist/esm/product/recordstable/recordstable.tag.js +18 -0
  428. package/dist/esm/product/richtext/index.js +2 -0
  429. package/dist/esm/product/richtext/richtext.js +111 -0
  430. package/dist/esm/product/richtext/richtext.recipe.js +40 -0
  431. package/dist/esm/product/settingssection/index.js +2 -0
  432. package/dist/esm/product/settingssection/settingssection.js +11 -0
  433. package/dist/esm/product/settingssection/settingssection.recipe.js +20 -0
  434. package/dist/esm/product/settingsshell/index.js +2 -0
  435. package/dist/esm/product/settingsshell/settingsshell.js +23 -0
  436. package/dist/esm/product/settingsshell/settingsshell.recipe.js +43 -0
  437. package/dist/esm/product/sidebar/index.js +2 -0
  438. package/dist/esm/product/sidebar/sidebar.js +112 -0
  439. package/dist/esm/product/sidebar/sidebar.recipe.js +43 -0
  440. package/dist/esm/product/tasklist/index.js +2 -0
  441. package/dist/esm/product/tasklist/tasklist.js +16 -0
  442. package/dist/esm/product/tasklist/tasklist.recipe.js +35 -0
  443. package/dist/esm/product/trialbanner/index.js +2 -0
  444. package/dist/esm/product/trialbanner/trialbanner.js +10 -0
  445. package/dist/esm/product/trialbanner/trialbanner.recipe.js +29 -0
  446. package/dist/esm/product/viewtoggle/index.js +2 -0
  447. package/dist/esm/product/viewtoggle/viewtoggle.js +19 -0
  448. package/dist/esm/product/viewtoggle/viewtoggle.recipe.js +24 -0
  449. package/dist/esm/tokens/contract.js +18 -0
  450. package/dist/esm/tokens/elevation.js +44 -0
  451. package/dist/esm/tokens/index.js +5 -0
  452. package/dist/esm/tokens/palette.js +60 -0
  453. package/dist/esm/tokens/scale.js +67 -0
  454. package/dist/esm/tokens/semantic.js +54 -0
  455. package/dist/inbox.css +9 -1
  456. package/dist/input.css +32 -4
  457. package/dist/linechart.css +5 -5
  458. package/dist/listpage.css +11 -3
  459. package/dist/menu.css +13 -5
  460. package/dist/multiselect.css +17 -9
  461. package/dist/native/tokens.d.ts +16 -0
  462. package/dist/native/tokens.js +221 -0
  463. package/dist/navitem.css +21 -1
  464. package/dist/onboarding.css +10 -2
  465. package/dist/popover.css +9 -1
  466. package/dist/progress.css +8 -0
  467. package/dist/radiogroup.css +9 -1
  468. package/dist/recordpage.css +26 -16
  469. package/dist/recordpanel.css +25 -15
  470. package/dist/recordstable.css +41 -27
  471. package/dist/resizablepanel.css +53 -0
  472. package/dist/resizablepanel.d.ts +7 -0
  473. package/dist/richtext.css +11 -3
  474. package/dist/segmented.css +8 -0
  475. package/dist/select.css +22 -8
  476. package/dist/select.d.ts +2 -1
  477. package/dist/settingsshell.css +15 -2
  478. package/dist/sidebar.css +34 -1
  479. package/dist/skeleton.css +8 -0
  480. package/dist/spinner.css +8 -0
  481. package/dist/stagebar.css +8 -0
  482. package/dist/statcard.css +6 -0
  483. package/dist/statcard.d.ts +2 -2
  484. package/dist/styles.css +2134 -999
  485. package/dist/switch.css +8 -0
  486. package/dist/table.css +34 -0
  487. package/dist/table.d.ts +8 -0
  488. package/dist/tabletoolbar.css +78 -0
  489. package/dist/tabletoolbar.d.ts +7 -0
  490. package/dist/tabs.css +12 -4
  491. package/dist/tasklist.css +8 -0
  492. package/dist/textarea.css +23 -3
  493. package/dist/toast.css +10 -2
  494. package/dist/tokens.css +53 -0
  495. package/dist/tokens.json +217 -0
  496. package/dist/tooltip.css +8 -0
  497. package/dist/trialbanner.css +8 -0
  498. package/dist/types/components/accordion/accordion.d.ts +10 -8
  499. package/dist/types/components/avatargroup/avatargroup.d.ts +2 -2
  500. package/dist/types/components/barchart/barchart.d.ts +4 -2
  501. package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
  502. package/dist/types/components/bulkbar/bulkbar.d.ts +4 -2
  503. package/dist/types/components/button/button.d.ts +8 -0
  504. package/dist/types/components/button/button.recipe.d.ts +12 -0
  505. package/dist/types/components/callout/callout.d.ts +2 -2
  506. package/dist/types/components/columncalc/columncalc.d.ts +49 -0
  507. package/dist/types/components/columncalc/columncalc.recipe.d.ts +3 -0
  508. package/dist/types/components/columncalc/index.d.ts +1 -0
  509. package/dist/types/components/datatable/datatable.d.ts +153 -0
  510. package/dist/types/components/datatable/datatable.recipe.d.ts +3 -0
  511. package/dist/types/components/datatable/index.d.ts +2 -0
  512. package/dist/types/components/datepicker/datepicker.d.ts +41 -18
  513. package/dist/types/components/datepicker/datepicker.recipe.d.ts +25 -2
  514. package/dist/types/components/datepicker/index.d.ts +1 -1
  515. package/dist/types/components/datepickerfield/datepickerfield.d.ts +35 -0
  516. package/dist/types/components/datepickerfield/datepickerfield.recipe.d.ts +5 -0
  517. package/dist/types/components/datepickerfield/index.d.ts +2 -0
  518. package/dist/types/components/dialog/dialog.d.ts +3 -1
  519. package/dist/types/components/divider/divider.d.ts +2 -2
  520. package/dist/types/components/donutchart/donutchart.d.ts +2 -2
  521. package/dist/types/components/drawer/drawer.d.ts +3 -1
  522. package/dist/types/components/emptystate/emptystate.d.ts +2 -2
  523. package/dist/types/components/formfield/formfield.d.ts +7 -4
  524. package/dist/types/components/input/input.d.ts +8 -2
  525. package/dist/types/components/linechart/linechart.d.ts +4 -2
  526. package/dist/types/components/menu/index.d.ts +1 -0
  527. package/dist/types/components/menu/menu-keyboard.d.ts +33 -0
  528. package/dist/types/components/menu/menu.d.ts +7 -1
  529. package/dist/types/components/multiselect/multiselect.d.ts +8 -4
  530. package/dist/types/components/popover/popover.d.ts +4 -1
  531. package/dist/types/components/progress/progress.d.ts +2 -2
  532. package/dist/types/components/radiogroup/radiogroup.d.ts +2 -2
  533. package/dist/types/components/resizablepanel/index.d.ts +2 -0
  534. package/dist/types/components/resizablepanel/resizablepanel.d.ts +75 -0
  535. package/dist/types/components/resizablepanel/resizablepanel.recipe.d.ts +3 -0
  536. package/dist/types/components/segmented/segmented.d.ts +2 -2
  537. package/dist/types/components/select/select.d.ts +4 -2
  538. package/dist/types/components/select/select.recipe.d.ts +12 -0
  539. package/dist/types/components/skeleton/skeleton.d.ts +2 -2
  540. package/dist/types/components/spinner/spinner.d.ts +2 -2
  541. package/dist/types/components/stagebar/stagebar.d.ts +2 -2
  542. package/dist/types/components/statcard/statcard.d.ts +7 -2
  543. package/dist/types/components/statcard/statcard.recipe.d.ts +12 -2
  544. package/dist/types/components/table/index.d.ts +2 -0
  545. package/dist/types/components/table/table.d.ts +53 -0
  546. package/dist/types/components/table/table.recipe.d.ts +21 -0
  547. package/dist/types/components/tabletoolbar/index.d.ts +2 -0
  548. package/dist/types/components/tabletoolbar/tabletoolbar.chrome.d.ts +2 -0
  549. package/dist/types/components/tabletoolbar/tabletoolbar.d.ts +89 -0
  550. package/dist/types/components/tabletoolbar/tabletoolbar.recipe.d.ts +3 -0
  551. package/dist/types/components/tabs/tabs.d.ts +2 -2
  552. package/dist/types/components/toast/toast.d.ts +7 -1
  553. package/dist/types/components/tooltip/tooltip.d.ts +8 -1
  554. package/dist/types/components/wheelpicker/index.d.ts +2 -0
  555. package/dist/types/components/wheelpicker/wheelpicker.d.ts +37 -0
  556. package/dist/types/components/wheelpicker/wheelpicker.recipe.d.ts +26 -0
  557. package/dist/types/index.d.ts +8 -0
  558. package/dist/types/product/appshell/appshell.d.ts +16 -2
  559. package/dist/types/product/authshell/authshell.d.ts +28 -0
  560. package/dist/types/product/authshell/authshell.recipe.d.ts +3 -0
  561. package/dist/types/product/authshell/index.d.ts +2 -0
  562. package/dist/types/product/board/board.d.ts +2 -2
  563. package/dist/types/product/command/command.d.ts +25 -1
  564. package/dist/types/product/entitycard/entitycard.d.ts +2 -2
  565. package/dist/types/product/flowcanvas/flowcanvas.d.ts +9 -1
  566. package/dist/types/product/onboarding/onboarding.d.ts +7 -1
  567. package/dist/types/product/recordpage/recordpage.d.ts +65 -1
  568. package/dist/types/product/recordpanel/recordpanel.d.ts +8 -2
  569. package/dist/types/product/recordstable/company-logos.d.ts +1 -0
  570. package/dist/types/product/recordstable/recordstable.d.ts +131 -1
  571. package/dist/types/product/recordstable/recordstable.tag.d.ts +10 -0
  572. package/dist/types/product/richtext/richtext.d.ts +5 -1
  573. package/dist/types/product/settingssection/settingssection.d.ts +2 -2
  574. package/dist/types/product/settingsshell/settingsshell.d.ts +6 -2
  575. package/dist/types/product/sidebar/index.d.ts +1 -1
  576. package/dist/types/product/sidebar/sidebar.d.ts +93 -0
  577. package/dist/types/product/tasklist/tasklist.d.ts +5 -1
  578. package/dist/types/product/trialbanner/trialbanner.d.ts +2 -2
  579. package/dist/types/product/viewtoggle/viewtoggle.d.ts +11 -5
  580. package/dist/types/tokens/contract.d.ts +26 -3
  581. package/dist/types/tokens/elevation.d.ts +44 -0
  582. package/dist/types/tokens/index.d.ts +1 -0
  583. package/dist/types/tokens/palette.d.ts +88 -0
  584. package/dist/types/tokens/scale.d.ts +7 -0
  585. package/dist/types/tokens/semantic.d.ts +31 -0
  586. package/dist/viewtoggle.css +11 -3
  587. package/dist/wheelpicker.css +68 -0
  588. package/dist/wheelpicker.d.ts +7 -0
  589. package/package.json +351 -9
  590. package/dist/index.js +0 -9690
@@ -0,0 +1,472 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ArrowDown, ArrowUp, Check, ChevronsUpDown, GripVertical, Plus, Search, SlidersHorizontal, } from "lucide-react";
3
+ import * as React from "react";
4
+ import { Checkbox } from "../checkbox/index.js";
5
+ import { Menu, MenuItem } from "../menu/index.js";
6
+ import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "../table/index.js";
7
+ import { datatableRecipe } from "./datatable.recipe.js";
8
+ /** A `date` input needs `yyyy-mm-dd`; cells may hold a Date, an ISO string or
9
+ * a display string. Returns "" when it cannot be parsed, so the field opens
10
+ * empty rather than showing an invalid value. */
11
+ function toDateInputValue(v) {
12
+ if (v instanceof Date && !Number.isNaN(v.getTime()))
13
+ return v.toISOString().slice(0, 10);
14
+ if (typeof v === "string" || typeof v === "number") {
15
+ const d = new Date(v);
16
+ if (!Number.isNaN(d.getTime()))
17
+ return d.toISOString().slice(0, 10);
18
+ }
19
+ return "";
20
+ }
21
+ function cellValue(col, row) {
22
+ if (col.accessor)
23
+ return col.accessor(row);
24
+ return row[col.key];
25
+ }
26
+ function asText(v) {
27
+ if (v == null)
28
+ return "";
29
+ if (typeof v === "object" && "name" in v)
30
+ return v.name ?? "";
31
+ if (Array.isArray(v))
32
+ return v.join(", ");
33
+ return String(v);
34
+ }
35
+ // stable pastel tone per string value — colour-coded tags/statuses, like Attio
36
+ const TAG_TONES = [
37
+ "brand",
38
+ "success",
39
+ "warning",
40
+ "danger",
41
+ "purple",
42
+ "cyan",
43
+ "orange",
44
+ ];
45
+ function toneFor(t) {
46
+ let h = 0;
47
+ for (let i = 0; i < t.length; i++)
48
+ h = (h * 31 + t.charCodeAt(i)) >>> 0;
49
+ return TAG_TONES[h % TAG_TONES.length];
50
+ }
51
+ function initials(name) {
52
+ const p = name.trim().split(/\s+/);
53
+ return ((p[0]?.[0] ?? "") + (p[1]?.[0] ?? "")).toUpperCase() || "?";
54
+ }
55
+ const DATE_FMT = new Intl.DateTimeFormat("en-US", {
56
+ month: "short",
57
+ day: "numeric",
58
+ year: "numeric",
59
+ });
60
+ function formatCell(type, v, symbol) {
61
+ if (type === "number")
62
+ return typeof v === "number" ? v.toLocaleString("en-US") : asText(v);
63
+ if (type === "currency")
64
+ return typeof v === "number"
65
+ ? `${symbol ?? "$"}${v.toLocaleString("en-US")}`
66
+ : asText(v);
67
+ if (type === "date") {
68
+ const d = v ? new Date(v) : null;
69
+ return d && !Number.isNaN(d.getTime()) ? DATE_FMT.format(d) : asText(v);
70
+ }
71
+ return asText(v);
72
+ }
73
+ /** Built-in typed-cell renderer (used when a column has no custom `render`). */
74
+ function renderTyped(col, value, avatarTone) {
75
+ const empty = _jsx("span", { className: "datatable-muted", children: "\u2014" });
76
+ switch (col.type) {
77
+ case "entity": {
78
+ const e = (typeof value === "object" && value ? value : { name: asText(value) });
79
+ if (!e.name)
80
+ return empty;
81
+ return (_jsxs("span", { className: "datatable-entity", children: [_jsx("span", { className: "datatable-avatar", "data-tone": avatarTone === "hashed" ? toneFor(e.name) : undefined, children: e.avatar ? (_jsx("img", { src: e.avatar, alt: "" })) : (initials(e.name).slice(0, 2)) }), _jsx("span", { className: "datatable-entity-name", children: e.name })] }));
82
+ }
83
+ case "tags": {
84
+ const tags = Array.isArray(value) ? value : [];
85
+ if (!tags.length)
86
+ return empty;
87
+ return (_jsx("span", { className: "datatable-tags", children: tags.map((t) => (_jsx("span", { className: "datatable-tag", "data-tone": col.tones?.[t] ?? toneFor(t), children: t }, t))) }));
88
+ }
89
+ case "status": {
90
+ const s = asText(value);
91
+ if (!s)
92
+ return empty;
93
+ return (_jsx("span", { className: "datatable-tag", "data-tone": col.tones?.[s] ?? toneFor(s), children: s }));
94
+ }
95
+ default: {
96
+ const text = formatCell(col.type, value, col.symbol);
97
+ const isNum = col.type === "number" || col.type === "currency";
98
+ if (!text)
99
+ return empty;
100
+ return isNum ? _jsx("span", { className: "datatable-num", children: text }) : text;
101
+ }
102
+ }
103
+ }
104
+ const CHECK_W = 40;
105
+ export function DataTable({ columns: columnsProp, data, selectable = false, selectedIds, onSelectionChange, selectAllLabel = "Select all rows", selectRowLabel = (row) => `Select row ${row.id}`, columnMenu = false, onColumnsChange, groupBy, onRowsReorder, error, sort: sortProp, defaultSort, onSortChange, filterable = false, searchPlaceholder = "Search…", searchLabel = "Search table", onEdit, stickyFirst = true, avatarTone = "brand", surface, interactive = false, onRowClick, onAddRow, addRowLabel = "New record", empty = "No results.", showCount = true, countLabel = (shown, total) => shown === total
106
+ ? `${total} ${total === 1 ? "row" : "rows"}`
107
+ : `${shown} of ${total}`, toolbar, className, reorderRowLabel = "Reorder row", ...rest }) {
108
+ const [query, setQuery] = React.useState("");
109
+ const [internalSort, setInternalSort] = React.useState(defaultSort ?? null);
110
+ // Column list the table actually renders. Seeded from `columns`; the header
111
+ // menu mutates this copy and reports upward via `onColumnsChange`.
112
+ const [internalCols, setInternalCols] = React.useState(columnsProp);
113
+ React.useEffect(() => setInternalCols(columnsProp), [columnsProp]);
114
+ /** Every column, hidden ones included — what the column manager lists. */
115
+ const allColumns = internalCols;
116
+ /** What the grid actually renders. */
117
+ const columns = React.useMemo(() => internalCols.filter((c) => !c.hidden), [internalCols]);
118
+ const applyColumns = React.useCallback((next) => {
119
+ setInternalCols(next);
120
+ onColumnsChange?.(next);
121
+ }, [onColumnsChange]);
122
+ const moveColumn = React.useCallback((key, dir) => {
123
+ const i = allColumns.findIndex((c) => c.key === key);
124
+ const j = i + dir;
125
+ if (i < 0 || j < 0 || j >= allColumns.length)
126
+ return;
127
+ const next = [...allColumns];
128
+ [next[i], next[j]] = [next[j], next[i]];
129
+ applyColumns(next);
130
+ }, [allColumns, applyColumns]);
131
+ const hideColumn = React.useCallback((key) => applyColumns(allColumns.map((c) => (c.key === key ? { ...c, hidden: true } : c))), [allColumns, applyColumns]);
132
+ const renameColumn = React.useCallback((key, header) => applyColumns(allColumns.map((c) => (c.key === key ? { ...c, header } : c))), [allColumns, applyColumns]);
133
+ const [renaming, setRenaming] = React.useState(null);
134
+ const showColumn = React.useCallback((key) => applyColumns(allColumns.map((c) => (c.key === key ? { ...c, hidden: false } : c))), [allColumns, applyColumns]);
135
+ const [selCell, setSelCell] = React.useState(null);
136
+ const gridRef = React.useRef(null);
137
+ const sort = sortProp !== undefined ? sortProp : internalSort;
138
+ // One shape downstream: [] when unsorted, ordered by precedence otherwise.
139
+ const sorts = React.useMemo(() => (sort == null ? [] : Array.isArray(sort) ? sort : [sort]), [sort]);
140
+ const sortDirByKey = React.useMemo(() => new Map(sorts.map((s) => [s.key, s.dir])), [sorts]);
141
+ const setSort = React.useCallback((next) => {
142
+ onSortChange?.(next);
143
+ if (sortProp === undefined)
144
+ setInternalSort(next);
145
+ }, [onSortChange, sortProp]);
146
+ // Row drag-to-reorder is meaningless once a sort or grouping decides row
147
+ // order — the grip would let the user drag a row the comparator/group
148
+ // would immediately put it back to. Hide the affordance rather than let it
149
+ // lie.
150
+ const showGrip = Boolean(onRowsReorder) && sorts.length === 0 && !groupBy;
151
+ const GRIP_W = 20;
152
+ // key of the row currently being dragged, and the row currently hovered as
153
+ // the drop target — mirrors RecordsTable's `dragCol`/`dragSort` state.
154
+ const [dragRowId, setDragRowId] = React.useState(null);
155
+ const [dropRowId, setDropRowId] = React.useState(null);
156
+ // Drop the dragged row immediately before `toId`. Operates on the full
157
+ // `data` prop (not the filtered/sorted `rows`) so the callback always gets
158
+ // the complete array in its new order, and a filtered-out row keeps its
159
+ // relative position. Splice-then-re-find-index (same shape as
160
+ // RecordsTable's reorderColumn) so dropping above vs. below the dragged
161
+ // row's origin both land in the right slot.
162
+ function reorderRows(fromId, toId) {
163
+ setDragRowId(null);
164
+ setDropRowId(null);
165
+ if (!onRowsReorder || fromId === toId)
166
+ return;
167
+ const from = data.findIndex((r) => r.id === fromId);
168
+ let to = data.findIndex((r) => r.id === toId);
169
+ if (from < 0 || to < 0)
170
+ return;
171
+ const next = [...data];
172
+ const [moved] = next.splice(from, 1);
173
+ to = next.findIndex((r) => r.id === toId);
174
+ next.splice(to, 0, moved);
175
+ onRowsReorder(next);
176
+ }
177
+ const [internalSel, setInternalSel] = React.useState(new Set());
178
+ const selected = React.useMemo(() => (selectedIds ? new Set(selectedIds) : internalSel), [selectedIds, internalSel]);
179
+ const setSelected = React.useCallback((next) => {
180
+ onSelectionChange?.([...next]);
181
+ if (!selectedIds)
182
+ setInternalSel(next);
183
+ }, [onSelectionChange, selectedIds]);
184
+ const [editing, setEditing] = React.useState(null);
185
+ const [scrolledX, setScrolledX] = React.useState(false);
186
+ // column widths (drag-to-resize) + fixed-layout sizing
187
+ const [widths, setWidths] = React.useState({});
188
+ const [resizingKey, setResizingKey] = React.useState(null);
189
+ const resizeRef = React.useRef(null);
190
+ const colWidth = (col) => widths[col.key] ?? col.width ?? (col.type === "entity" ? 220 : 160);
191
+ const minWidth = (showGrip ? GRIP_W : 0) +
192
+ (selectable ? CHECK_W : 0) +
193
+ columns.reduce((sum, col) => sum + colWidth(col), 0);
194
+ const colByKey = React.useMemo(() => {
195
+ const m = new Map();
196
+ for (const c of columns)
197
+ m.set(c.key, c);
198
+ return m;
199
+ }, [columns]);
200
+ const filtered = React.useMemo(() => {
201
+ const q = query.trim().toLowerCase();
202
+ if (!q)
203
+ return data;
204
+ const cols = columns.filter((c) => c.filterable !== false);
205
+ return data.filter((row) => cols.some((c) => asText(cellValue(c, row)).toLowerCase().includes(q)));
206
+ }, [data, columns, query]);
207
+ const rows = React.useMemo(() => {
208
+ const active = sorts
209
+ .map((s) => ({ col: colByKey.get(s.key), dir: s.dir === "asc" ? 1 : -1 }))
210
+ .filter((s) => Boolean(s.col));
211
+ if (active.length === 0)
212
+ return filtered;
213
+ return [...filtered].sort((a, b) => {
214
+ for (const { col, dir } of active) {
215
+ const av = cellValue(col, a);
216
+ const bv = cellValue(col, b);
217
+ const cmp = typeof av === "number" && typeof bv === "number"
218
+ ? av - bv
219
+ : asText(av).localeCompare(asText(bv));
220
+ if (cmp !== 0)
221
+ return cmp * dir;
222
+ }
223
+ return 0;
224
+ });
225
+ }, [filtered, sorts, colByKey]);
226
+ /**
227
+ * Rows bucketed under a heading, preserving first-seen group order (Attio
228
+ * groups a view without reordering within a group). One bucket with a null
229
+ * group when `groupBy` is absent, so the render path is identical either way.
230
+ */
231
+ const groupedRows = React.useMemo(() => {
232
+ if (!groupBy)
233
+ return [{ group: null, rows }];
234
+ const buckets = new Map();
235
+ for (const row of rows) {
236
+ const g = groupBy(row);
237
+ const bucket = buckets.get(g);
238
+ if (bucket)
239
+ bucket.push(row);
240
+ else
241
+ buckets.set(g, [row]);
242
+ }
243
+ return [...buckets].map(([group, groupRows]) => ({
244
+ group,
245
+ rows: groupRows,
246
+ }));
247
+ }, [rows, groupBy]);
248
+ const allSelected = rows.length > 0 && rows.every((r) => selected.has(r.id));
249
+ const someSelected = selected.size > 0 && !allSelected;
250
+ function toggleAll() {
251
+ setSelected(allSelected ? new Set() : new Set(rows.map((r) => r.id)));
252
+ }
253
+ function toggleRow(id) {
254
+ const next = new Set(selected);
255
+ next.has(id) ? next.delete(id) : next.add(id);
256
+ setSelected(next);
257
+ }
258
+ function cycleSort(key) {
259
+ // Clicking a header drives a single sort, as before. Multi-sort is supplied
260
+ // by the caller through the `sort` prop (Attio builds it in its sort popover).
261
+ const dir = sortDirByKey.get(key);
262
+ if (!dir)
263
+ setSort({ key, dir: "asc" });
264
+ else if (dir === "asc")
265
+ setSort({ key, dir: "desc" });
266
+ else
267
+ setSort(null);
268
+ }
269
+ /**
270
+ * Which editor a column gets. Mirrors RecordsTable — the Attio-measured
271
+ * sibling — rather than giving every type the same text box:
272
+ * number/currency numeric, with a decimal keypad on touch
273
+ * date a native date field
274
+ * text/entity a plain text field
275
+ * `status`, `reference` and `tags` are pickers in RecordsTable, not
276
+ * double-click editors, so they are not editable here either.
277
+ */
278
+ function editorFor(col) {
279
+ switch (col.type) {
280
+ case "number":
281
+ case "currency":
282
+ return { type: "number", inputMode: "decimal", step: "any" };
283
+ case "date":
284
+ return { type: "date" };
285
+ default:
286
+ return { type: "text", inputMode: "text" };
287
+ }
288
+ }
289
+ /**
290
+ * Spreadsheet keyboard model, ported from RecordsTable: arrows move the
291
+ * selected cell, Enter opens its editor, Escape clears, and Cmd/Ctrl+C
292
+ * copies the cell's RENDERED text (what the user sees, not the raw value).
293
+ */
294
+ function onGridKeyDown(e) {
295
+ if (!selCell || editing)
296
+ return;
297
+ if ((e.metaKey || e.ctrlKey) && (e.key === "c" || e.key === "C")) {
298
+ const row = rows.find((rw) => rw.id === selCell.id);
299
+ const col = columns.find((cc) => cc.key === selCell.key);
300
+ if (row && col)
301
+ navigator.clipboard?.writeText(formatCell(col.type, cellValue(col, row), col.symbol));
302
+ e.preventDefault();
303
+ return;
304
+ }
305
+ const r = rows.findIndex((row) => row.id === selCell.id);
306
+ const c = columns.findIndex((col) => col.key === selCell.key);
307
+ if (r < 0 || c < 0)
308
+ return;
309
+ let nr = r;
310
+ let nc = c;
311
+ if (e.key === "ArrowUp")
312
+ nr = Math.max(0, r - 1);
313
+ else if (e.key === "ArrowDown")
314
+ nr = Math.min(rows.length - 1, r + 1);
315
+ else if (e.key === "ArrowLeft")
316
+ nc = Math.max(0, c - 1);
317
+ else if (e.key === "ArrowRight")
318
+ nc = Math.min(columns.length - 1, c + 1);
319
+ else if (e.key === "Escape") {
320
+ setSelCell(null);
321
+ return;
322
+ }
323
+ else if (e.key === "Enter") {
324
+ if (columns[c]?.editable) {
325
+ e.preventDefault();
326
+ setEditing({ id: selCell.id, key: selCell.key });
327
+ }
328
+ return;
329
+ }
330
+ else
331
+ return;
332
+ e.preventDefault();
333
+ setSelCell({ id: rows[nr].id, key: columns[nc].key });
334
+ }
335
+ function commitEdit(id, key, value) {
336
+ onEdit?.(id, key, value);
337
+ setEditing(null);
338
+ }
339
+ const totalCols = columns.length + (selectable ? 1 : 0) + (showGrip ? 1 : 0);
340
+ const hasSummary = columns.some((c) => c.summary);
341
+ // sticky attrs for the leading column(s): grip col (index -2) + selection
342
+ // col (-1) + first data column (0). Each offsets by whatever leading
343
+ // columns come before it, so the group stays contiguous when scrolled.
344
+ const stickyCol = (index) => {
345
+ if (!stickyFirst)
346
+ return {};
347
+ if (showGrip && index === -2)
348
+ return { "data-sticky": "", style: { left: 0 } };
349
+ if (selectable && index === -1)
350
+ return {
351
+ "data-sticky": "",
352
+ style: { left: showGrip ? GRIP_W : 0 },
353
+ };
354
+ if (index === 0)
355
+ return {
356
+ "data-sticky": "",
357
+ "data-sticky-edge": "",
358
+ style: { left: (showGrip ? GRIP_W : 0) + (selectable ? CHECK_W : 0) },
359
+ };
360
+ return {};
361
+ };
362
+ const alignFor = (col) => col.align ??
363
+ (col.type === "number" || col.type === "currency" ? "right" : undefined);
364
+ function startResize(col, e) {
365
+ e.preventDefault();
366
+ e.stopPropagation();
367
+ e.target.setPointerCapture(e.pointerId);
368
+ resizeRef.current = {
369
+ key: col.key,
370
+ startX: e.clientX,
371
+ startW: colWidth(col),
372
+ };
373
+ setResizingKey(col.key);
374
+ }
375
+ function moveResize(e) {
376
+ const r = resizeRef.current;
377
+ if (!r)
378
+ return;
379
+ const w = Math.max(64, r.startW + (e.clientX - r.startX));
380
+ setWidths((prev) => ({ ...prev, [r.key]: w }));
381
+ }
382
+ function endResize(e) {
383
+ resizeRef.current = null;
384
+ setResizingKey(null);
385
+ e.target.releasePointerCapture(e.pointerId);
386
+ }
387
+ function ChevronFor({ colKey }) {
388
+ const dir = sortDirByKey.get(colKey);
389
+ if (dir)
390
+ return dir === "asc" ? (_jsx(ArrowUp, { className: "datatable-chevron", size: 13, strokeWidth: 2 })) : (_jsx(ArrowDown, { className: "datatable-chevron", size: 13, strokeWidth: 2 }));
391
+ return (_jsx(ChevronsUpDown, { className: "datatable-chevron", size: 13, strokeWidth: 2 }));
392
+ }
393
+ return (_jsxs("div", { ref: gridRef, className: datatableRecipe({ className }), tabIndex: -1, onKeyDown: onGridKeyDown, ...rest, children: [(filterable || showCount || toolbar || columnMenu) && (_jsxs("div", { className: "datatable-toolbar", children: [columnMenu && (_jsxs(Menu, { align: "start", trigger: _jsxs("button", { type: "button", className: "datatable-viewsettings", children: [_jsx(SlidersHorizontal, { size: 14, strokeWidth: 1.75 }), "View settings"] }), children: [_jsx("div", { className: "datatable-group-label", children: "Columns" }), allColumns.map((c) => (_jsxs(MenuItem, { onSelect: () => c.hidden ? showColumn(c.key) : hideColumn(c.key), children: [_jsx(Check, { size: 14, strokeWidth: 2, style: { opacity: c.hidden ? 0 : 1 } }), typeof c.header === "string" ? c.header : c.key] }, c.key)))] })), filterable && (_jsxs("span", { className: "datatable-search", children: [_jsx(Search, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), _jsx("input", { type: "search", placeholder: searchPlaceholder, value: query, onChange: (e) => setQuery(e.target.value), "aria-label": searchLabel })] })), showCount && (_jsx("span", { className: "datatable-count", children: countLabel(rows.length, data.length) })), toolbar] })), _jsxs(Table, { interactive: interactive, surface: surface, style: { minWidth }, scrollProps: {
394
+ onScroll: (e) => setScrolledX(e.currentTarget.scrollLeft > 0),
395
+ ...(scrolledX ? { "data-scrolled-x": "" } : {}),
396
+ }, children: [_jsxs("colgroup", { children: [showGrip && _jsx("col", { style: { width: GRIP_W } }), selectable && _jsx("col", { style: { width: CHECK_W } }), columns.map((col) => (_jsx("col", { style: { width: colWidth(col) } }, col.key)))] }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [showGrip && (_jsx(TableHead, { className: "datatable-col-grip", ...stickyCol(-2) })), selectable && (_jsx(TableHead, { className: "datatable-col-check", ...stickyCol(-1), children: _jsx("span", { className: "datatable-check", children: _jsx(Checkbox, { "aria-label": selectAllLabel, checked: allSelected, indeterminate: someSelected, onChange: toggleAll }) }) })), columns.map((col, i) => {
397
+ const Icon = col.icon;
398
+ const inner = (_jsxs("span", { className: "datatable-th-inner", children: [Icon ? _jsx(Icon, { size: 14, strokeWidth: 1.75 }) : null, _jsx("span", { className: "datatable-th-label", children: col.header }), col.sortable ? _jsx(ChevronFor, { colKey: col.key }) : null] }));
399
+ return (_jsxs(TableHead, { align: alignFor(col), ...stickyCol(i), children: [renaming === col.key ? (_jsx("input", {
400
+ // biome-ignore lint/a11y/noAutofocus: the rename item opens this field
401
+ autoFocus: true, className: "datatable-th-rename", defaultValue: typeof col.header === "string" ? col.header : "", "aria-label": `Rename column`, onBlur: (e) => {
402
+ renameColumn(col.key, e.currentTarget.value);
403
+ setRenaming(null);
404
+ }, onKeyDown: (e) => {
405
+ if (e.key === "Enter") {
406
+ renameColumn(col.key, e.currentTarget.value);
407
+ setRenaming(null);
408
+ }
409
+ else if (e.key === "Escape")
410
+ setRenaming(null);
411
+ } })) : columnMenu ? (_jsxs(Menu, { align: "start", trigger: _jsx("button", { type: "button", className: "datatable-sort", "data-sorted": sortDirByKey.get(col.key), "aria-label": `${typeof col.header === "string"
412
+ ? col.header
413
+ : col.key} column options`, children: inner }), children: [_jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "asc" }), children: "Sort ascending" }), _jsx(MenuItem, { onSelect: () => setSort({ key: col.key, dir: "desc" }), children: "Sort descending" }), col.managed === false ? null : (_jsxs(_Fragment, { children: [_jsx(MenuItem, { onSelect: () => moveColumn(col.key, -1), children: "Move left" }), _jsx(MenuItem, { onSelect: () => moveColumn(col.key, 1), children: "Move right" }), _jsx(MenuItem, { onSelect: () => setRenaming(col.key), children: "Edit column label" }), _jsx(MenuItem, { onSelect: () => hideColumn(col.key), children: "Hide from view" })] }))] })) : col.sortable ? (_jsx("button", { type: "button", className: "datatable-sort", "data-sorted": sortDirByKey.get(col.key), onClick: () => cycleSort(col.key), children: inner })) : (inner), col.resizable !== false && (_jsx("span", { className: "datatable-resize", "data-resizing": resizingKey === col.key ? "" : undefined, onPointerDown: (e) => startResize(col, e), onPointerMove: moveResize, onPointerUp: endResize }))] }, col.key));
414
+ })] }) }), _jsx(TableBody, { children: error ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "datatable-empty", children: error }) }) })) : rows.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: totalCols, children: _jsx("div", { className: "datatable-empty", children: empty }) }) })) : (groupedRows.map(({ group, rows: groupRows }) => (_jsxs(React.Fragment, { children: [group !== null && (_jsx(TableRow, { children: _jsxs(TableCell, { colSpan: totalCols, className: "datatable-group", children: [_jsx("span", { className: "datatable-group-label", children: group }), _jsx("span", { className: "datatable-group-count", children: groupRows.length })] }) })), groupRows.map((row) => (_jsxs(TableRow, { "data-selected": selected.has(row.id) ? "" : undefined, "data-drop-target": showGrip &&
415
+ dragRowId &&
416
+ dragRowId !== row.id &&
417
+ dropRowId === row.id
418
+ ? ""
419
+ : undefined, onClick: onRowClick ? () => onRowClick(row) : undefined, style: onRowClick ? { cursor: "pointer" } : undefined, onDragOver: showGrip && dragRowId
420
+ ? (e) => {
421
+ e.preventDefault();
422
+ if (dropRowId !== row.id)
423
+ setDropRowId(row.id);
424
+ }
425
+ : undefined, onDrop: showGrip && dragRowId
426
+ ? (e) => {
427
+ e.preventDefault();
428
+ reorderRows(dragRowId, row.id);
429
+ }
430
+ : undefined, children: [showGrip && (_jsx(TableCell, { className: "datatable-col-grip", ...stickyCol(-2), onClick: (e) => e.stopPropagation(), children: _jsx("button", { type: "button", className: "datatable-grip", "aria-label": reorderRowLabel, draggable: true, onDragStart: (e) => {
431
+ setDragRowId(row.id);
432
+ e.dataTransfer.effectAllowed = "move";
433
+ }, onDragEnd: () => {
434
+ setDragRowId(null);
435
+ setDropRowId(null);
436
+ }, children: _jsx(GripVertical, { size: 16, strokeWidth: 1.75, "aria-hidden": "true" }) }) })), selectable && (_jsx(TableCell, { className: "datatable-col-check", ...stickyCol(-1), onClick: (e) => e.stopPropagation(), children: _jsx("span", { className: "datatable-check", children: _jsx(Checkbox, { "aria-label": selectRowLabel(row), checked: selected.has(row.id), onChange: () => toggleRow(row.id) }) }) })), columns.map((col, i) => {
437
+ const isEditing = editing?.id === row.id && editing?.key === col.key;
438
+ const value = cellValue(col, row);
439
+ const sticky = stickyCol(i);
440
+ if (isEditing) {
441
+ return (_jsx(TableCell, { align: alignFor(col), ...sticky, onClick: (e) => e.stopPropagation(), children: _jsx("input", { className: "datatable-edit",
442
+ // biome-ignore lint/a11y/noAutofocus: focus the field the moment it opens
443
+ autoFocus: true, ...editorFor(col), "data-editor": editorFor(col).type, defaultValue: col.type === "date"
444
+ ? toDateInputValue(value)
445
+ : asText(value), "aria-label": `Edit ${col.key}`, onKeyDown: (e) => {
446
+ if (e.key === "Enter")
447
+ commitEdit(row.id, col.key, e.currentTarget.value);
448
+ else if (e.key === "Escape")
449
+ setEditing(null);
450
+ }, onBlur: (e) => commitEdit(row.id, col.key, e.currentTarget.value) }) }, col.key));
451
+ }
452
+ return (_jsx(TableCell, { align: alignFor(col), ...sticky, className: col.editable ? "datatable-editable" : undefined, "data-selected": selCell?.id === row.id && selCell?.key === col.key
453
+ ? ""
454
+ : undefined, onClick: (e) => {
455
+ // the keyboard model's anchor; also opens the
456
+ // editor when the column allows it
457
+ setSelCell({ id: row.id, key: col.key });
458
+ gridRef.current?.focus({ preventScroll: true });
459
+ if (col.editable) {
460
+ // Opening the inline editor must not also fire
461
+ // the row's onRowClick and navigate away. Every
462
+ // other cell click has to keep bubbling, or
463
+ // onRowClick never fires at all.
464
+ e.stopPropagation();
465
+ setEditing({ id: row.id, key: col.key });
466
+ }
467
+ }, children: col.render
468
+ ? col.render(value, row)
469
+ : renderTyped(col, col.format ? col.format(value, row) : value, avatarTone) }, col.key));
470
+ })] }, row.id)))] }, group ?? "__ungrouped")))) }), (hasSummary || onAddRow) && (_jsxs(TableFooter, { children: [hasSummary && (_jsxs(TableRow, { children: [showGrip && _jsx(TableCell, { ...stickyCol(-2) }), selectable && _jsx(TableCell, { ...stickyCol(-1) }), columns.map((col, i) => (_jsx(TableCell, { align: alignFor(col), ...stickyCol(i), children: col.summary ? col.summary(rows) : null }, col.key)))] })), onAddRow && (_jsx(TableRow, { children: _jsx(TableCell, { className: "datatable-addcell", colSpan: totalCols, children: _jsxs("button", { type: "button", className: "datatable-addrow", onClick: onAddRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), addRowLabel] }) }) }))] }))] })] }));
471
+ }
472
+ DataTable.displayName = "DataTable";
@@ -0,0 +1,110 @@
1
+ import { defineRecipe, resolveRecipe } from "../../core/index.js";
2
+ import { contract as c, elevation as e } from "../../tokens/index.js";
3
+ // The feature-rich, config-driven data grid (sort / filter / selection /
4
+ // inline edit) built on the composable `Table` primitives. This recipe adds the
5
+ // toolbar, sortable header buttons, selection cells, selected-row tint, and the
6
+ // inline-edit input on top of the base `.table` styling.
7
+ const config = defineRecipe({
8
+ name: "datatable",
9
+ base: `display: flex; flex-direction: column; gap: ${c.space["2.5"]}; font-family: ${c.font.sans};
10
+ & .datatable-toolbar { display: flex; align-items: center; gap: ${c.space["2"]}; }
11
+ & .datatable-search { position: relative; flex: 1; max-width: 280px; display: inline-flex; align-items: center; }
12
+ & .datatable-search svg { position: absolute; inset-inline-start: ${c.space["2"]}; color: ${c.fgMuted}; pointer-events: none; }
13
+ & .datatable-search input { width: 100%; height: 32px; padding: 0 ${c.space["2"]} 0 ${c.space["6"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: ${e.field}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; transition: box-shadow .15s; }
14
+ & .datatable-search input::placeholder { color: ${c.fgMuted}; }
15
+ & .datatable-search input:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
16
+ & .datatable-count { margin-inline-start: auto; font-size: ${c.text.md}; color: ${c.fgMuted}; }
17
+ /* Attio's header cell has no padding of its own -- the button owns the
18
+ full cell so the whole header is clickable (its own inset is 12px).
19
+ Mirrors the summary-row fix. */
20
+ & th { padding: 0; }
21
+ /* Same wrapper trap as AUTHORING.md Lesson 40 (ColumnCalc's summary trigger):
22
+ Menu wraps its trigger in a flex div that sizes to its content, so a
23
+ long header grew past the column instead of filling it -- with nothing
24
+ left to squeeze, the label's own ellipsis CSS (below) had no properly
25
+ -sized box to truncate against, and the th's own overflow hard-clipped
26
+ it with no "...". Fill the wrapper, scoped to th so Menu's default
27
+ (correct everywhere else) is untouched. */
28
+ & th .menu { width: 100%; height: 100%; }
29
+ & .datatable-th-inner { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; }
30
+ & .datatable-th-inner > svg { flex-shrink: 0; color: ${c.fgMuted}; }
31
+ /* Attio's summary cell has NO padding of its own -- the calculation trigger
32
+ owns the whole 246x37 area so a click anywhere in the cell opens the
33
+ menu. Zero the cell's inset and let ColumnCalc supply the 12px. */
34
+ & tfoot td { padding: 0; }
35
+ /* Group heading row -- Attio groups a view under a subtle label with the
36
+ bucket's count beside it. */
37
+ & .datatable-viewsettings { display: inline-flex; align-items: center; gap: ${c.space["1.5"]}; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["2"]}; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
38
+ & .datatable-viewsettings:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, transparent); color: ${c.fgPrimary}; }
39
+ & .datatable-group-label { padding: ${c.space["1.5"]} ${c.space["2"]} ${c.space["1"]}; font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; }
40
+ & .datatable-group { height: ${c.size.menuRow}; padding: 0 ${c.space["3"]}; background: ${c.bgSubtle}; border-bottom: 1px solid ${c.borderSubtle}; font-size: ${c.text.md}; font-weight: ${c.weight.medium}; color: color-mix(in srgb, ${c.fgPrimary} 63%, transparent); }
41
+ & .datatable-group-count { margin-inline-start: ${c.space["1.5"]}; color: ${c.fgMuted}; font-variant-numeric: tabular-nums; }
42
+ & .datatable-th-rename { width: 100%; min-width: 0; height: ${c.size.row}; margin: 0; padding: 0 ${c.space["1"]}; border: none; border-radius: ${c.radius.md}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; font-weight: ${c.weight.medium}; color: ${c.fgPrimary}; outline: none; }
43
+ & .datatable-th-rename:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
44
+ & .datatable-th-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
45
+ & .datatable-sort { display: flex; align-items: center; gap: ${c.space["1.5"]}; width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0 ${c.space["2"]}; border: none; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: start; cursor: pointer; }
46
+ & th[data-align="right"] .datatable-sort { justify-content: flex-end; }
47
+ & .datatable-chevron { margin-inline-start: auto; flex-shrink: 0; color: ${c.fgMuted}; opacity: 0; transition: opacity .12s; }
48
+ & th[data-align="right"] .datatable-chevron { margin-inline-start: 0; }
49
+ & .datatable-sort:hover .datatable-chevron { opacity: 0.6; }
50
+ & .datatable-sort[data-sorted] .datatable-chevron { opacity: 1; color: ${c.fgPrimary}; }
51
+ /* sticky first column(s) + horizontal scroll shadow — RecordsTable's feel */
52
+ & th[data-sticky], & td[data-sticky] { position: sticky; z-index: 1; background: ${c.bgSurface}; }
53
+ & th[data-sticky] { z-index: 3; }
54
+ & tbody tr[data-selected] td[data-sticky] { background: color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface}); }
55
+ & tbody tr:hover td[data-sticky] { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); }
56
+ & .table-scroll[data-scrolled-x] [data-sticky-edge] { clip-path: inset(0 -38px 0 0); box-shadow: 6px 0 16px 4px rgba(0,0,0,0.12); }
57
+ /* add-row + summary footer */
58
+ & .datatable-addcell { padding: 0; border-top: none; }
59
+ & .datatable-addrow { display: flex; align-items: center; gap: ${c.space["2"]}; width: 100%; height: ${c.size.tableRow}; padding: 0 ${c.space["2"]}; border: none; border-top: 1px solid ${c.borderSubtle}; background: ${c.bgSurface}; color: ${c.fgMuted}; font-family: inherit; font-size: ${c.text.lg}; cursor: pointer; transition: background-color .12s; }
60
+ & .datatable-addrow:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
61
+ & .datatable-addrow svg { flex-shrink: 0; }
62
+ & .datatable-check { display: flex; align-items: center; justify-content: center; }
63
+ & .datatable-col-check { width: 40px; padding: 0; text-align: center; }
64
+ & tbody tr[data-selected] td { background: color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface}); }
65
+ & tbody tr[data-selected]:hover td { background: color-mix(in srgb, ${c.fgPrimary} 4%, color-mix(in srgb, ${c.bgBrandSolid} 10%, ${c.bgSurface})); }
66
+ & .datatable-editable:hover { background: color-mix(in srgb, ${c.fgPrimary} 4%, ${c.bgSurface}); cursor: text; }
67
+ & .datatable-edit { width: 100%; height: 28px; margin: 0; padding: 0 ${c.space["1.5"]}; border: none; border-radius: ${c.radius.sm}; background: ${c.bgSurface}; box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; font-family: inherit; font-size: ${c.text.lg}; color: ${c.fgPrimary}; outline: none; vertical-align: middle; }
68
+ & .datatable-edit:focus { box-shadow: inset 0 0 0 1px ${c.bgBrandSolid}; }
69
+ & .datatable-empty { padding: ${c.space["8"]} ${c.space["3"]}; text-align: center; color: ${c.fgMuted}; font-size: ${c.text.lg}; }
70
+ /* fixed layout so column widths (and resize) are exact — like RecordsTable */
71
+ & table { table-layout: fixed; }
72
+ /* column resize grip */
73
+ & .datatable-resize { position: absolute; top: 0; right: -3px; width: 9px; height: 100%; cursor: col-resize; z-index: 6; touch-action: none; }
74
+ & .datatable-resize::after { content: ""; position: absolute; top: 0; left: 3px; width: 2px; height: 100%; background: ${c.bgBrandSolid}; opacity: 0; transition: opacity .12s; }
75
+ & .datatable-resize:hover::after, & .datatable-resize[data-resizing]::after { opacity: 1; }
76
+ /* typed cells — entity (avatar + name), colour-coded tags, numbers, dates */
77
+ & .datatable-entity { display: flex; align-items: center; gap: ${c.space["1.5"]}; min-width: 0; color: ${c.fgPrimary}; font-weight: ${c.weight.medium}; }
78
+ & .datatable-entity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
79
+ & .datatable-avatar { width: ${c.size.icon}; height: ${c.size.icon}; border-radius: ${c.radius.sm}; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; font-weight: ${c.weight.semibold}; text-transform: uppercase; color: ${c.fgOnBrand}; background: ${c.bgBrandSolid}; }
80
+ & .datatable-avatar[data-tone="success"] { background: ${c.bgSuccess}; } & .datatable-avatar[data-tone="warning"] { background: ${c.bgWarning}; } & .datatable-avatar[data-tone="danger"] { background: ${c.bgDanger}; } & .datatable-avatar[data-tone="purple"] { background: ${c.bgPurple}; } & .datatable-avatar[data-tone="cyan"] { background: ${c.bgCyan}; } & .datatable-avatar[data-tone="orange"] { background: ${c.bgOrange}; }
81
+ & .datatable-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
82
+ & .datatable-tags { display: flex; align-items: center; gap: ${c.space["1"]}; overflow: hidden; }
83
+ & .datatable-tag { display: inline-flex; align-items: center; height: ${c.size.chip}; padding: 0 ${c.space["1"]}; border-radius: ${c.radius.chip}; font-size: ${c.text.lg}; line-height: 20px; font-weight: ${c.weight.medium}; white-space: nowrap; background: color-mix(in srgb, ${c.fgPrimary} 6%, transparent); color: color-mix(in srgb, ${c.fgPrimary} 82%, transparent); }
84
+ & .datatable-tag[data-tone="brand"] { background: color-mix(in srgb, ${c.bgBrandSolid} 14%, transparent); color: color-mix(in srgb, ${c.bgBrandSolid} 82%, ${c.fgPrimary}); }
85
+ & .datatable-tag[data-tone="success"] { background: color-mix(in srgb, ${c.bgSuccess} 16%, transparent); color: color-mix(in srgb, ${c.bgSuccess} 78%, ${c.fgPrimary}); }
86
+ & .datatable-tag[data-tone="warning"] { background: color-mix(in srgb, ${c.bgWarning} 18%, transparent); color: color-mix(in srgb, ${c.bgWarning} 82%, ${c.fgPrimary}); }
87
+ & .datatable-tag[data-tone="danger"] { background: color-mix(in srgb, ${c.bgDanger} 15%, transparent); color: color-mix(in srgb, ${c.bgDanger} 80%, ${c.fgPrimary}); }
88
+ & .datatable-tag[data-tone="purple"] { background: color-mix(in srgb, ${c.bgPurple} 16%, transparent); color: color-mix(in srgb, ${c.bgPurple} 80%, ${c.fgPrimary}); }
89
+ & .datatable-tag[data-tone="cyan"] { background: color-mix(in srgb, ${c.bgCyan} 18%, transparent); color: color-mix(in srgb, ${c.bgCyan} 82%, ${c.fgPrimary}); }
90
+ & .datatable-tag[data-tone="orange"] { background: color-mix(in srgb, ${c.bgOrange} 16%, transparent); color: color-mix(in srgb, ${c.bgOrange} 82%, ${c.fgPrimary}); }
91
+ & .datatable-num { font-variant-numeric: tabular-nums; }
92
+ & .datatable-muted { color: ${c.fgMuted}; }
93
+ /* row drag-to-reorder -- Attio's Settings > Objects > Attributes measures
94
+ a leading 20px grip column, a 16px grip icon, and the row's own
95
+ hairline doubling as the drop indicator (it tints toward the brand
96
+ colour as the active drop target). The affordance + geometry are
97
+ measured; the drag MECHANISM is crisp's existing house idiom -- HTML5
98
+ draggable + dataTransfer, the same one column reorder already uses
99
+ (RecordsTable's reorderColumn) -- not Attio's own proprietary
100
+ pointer-events implementation. */
101
+ & .datatable-col-grip { width: 20px; padding: 0; text-align: center; }
102
+ & .datatable-grip { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; border: none; border-radius: 0; background: none; font-family: inherit; color: ${c.fgMuted}; cursor: grab; }
103
+ & .datatable-grip:active { cursor: grabbing; }
104
+ & tbody tr[data-drop-target] td, & tbody tr[data-drop-target] th { box-shadow: inset 0 2px 0 0 ${c.bgBrandSolid}; transition: box-shadow .12s; }`,
105
+ variants: {},
106
+ defaultVariants: {},
107
+ compoundVariants: [],
108
+ });
109
+ export const datatableRecipe = resolveRecipe(config);
110
+ export default config;
@@ -0,0 +1,2 @@
1
+ export { DataTable, } from "./datatable.js";
2
+ export { datatableRecipe } from "./datatable.recipe.js";