@activecollab/components 2.0.566 → 2.0.567

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 (291) hide show
  1. package/dist/cjs/components/Chip/Chip.js +4 -2
  2. package/dist/cjs/components/Chip/Chip.js.map +1 -1
  3. package/dist/cjs/components/Chip/Styles.js +12 -5
  4. package/dist/cjs/components/Chip/Styles.js.map +1 -1
  5. package/dist/cjs/components/Divider/Divider.js.map +1 -1
  6. package/dist/cjs/components/Divider/Styles.js +2 -1
  7. package/dist/cjs/components/Divider/Styles.js.map +1 -1
  8. package/dist/cjs/components/Filter/Styles.js +1 -1
  9. package/dist/cjs/components/Filter/Styles.js.map +1 -1
  10. package/dist/cjs/components/GlobalStyle.js +2 -1
  11. package/dist/cjs/components/GlobalStyle.js.map +1 -1
  12. package/dist/cjs/components/Icons/collection/CalendarDate.js +63 -0
  13. package/dist/cjs/components/Icons/collection/CalendarDate.js.map +1 -0
  14. package/dist/cjs/components/Icons/collection/Project.js +3 -9
  15. package/dist/cjs/components/Icons/collection/Project.js.map +1 -1
  16. package/dist/cjs/components/Icons/collection/index.js +7 -0
  17. package/dist/cjs/components/Icons/collection/index.js.map +1 -1
  18. package/dist/cjs/components/MainMenu/MainMenu.js +38 -28
  19. package/dist/cjs/components/MainMenu/MainMenu.js.map +1 -1
  20. package/dist/cjs/components/MainMenu/MainMenuDrawer.js +3 -2
  21. package/dist/cjs/components/MainMenu/MainMenuDrawer.js.map +1 -1
  22. package/dist/cjs/components/MainMenu/hooks.js +46 -8
  23. package/dist/cjs/components/MainMenu/hooks.js.map +1 -1
  24. package/dist/cjs/components/MainMenu/types.js.map +1 -1
  25. package/dist/cjs/components/Nav/Nav.js +3 -2
  26. package/dist/cjs/components/Nav/Nav.js.map +1 -1
  27. package/dist/cjs/components/Nav/Styles.js +9 -4
  28. package/dist/cjs/components/Nav/Styles.js.map +1 -1
  29. package/dist/cjs/components/PillButton/PillButton.js.map +1 -1
  30. package/dist/cjs/components/PillButton/Styles.js +2 -0
  31. package/dist/cjs/components/PillButton/Styles.js.map +1 -1
  32. package/dist/cjs/components/PillGroup/Styles.js +1 -1
  33. package/dist/cjs/components/PillGroup/Styles.js.map +1 -1
  34. package/dist/cjs/components/RaisedAddButton/RaisedAddButton.js +44 -0
  35. package/dist/cjs/components/RaisedAddButton/RaisedAddButton.js.map +1 -0
  36. package/dist/cjs/components/RaisedAddButton/Styles.js +19 -0
  37. package/dist/cjs/components/RaisedAddButton/Styles.js.map +1 -0
  38. package/dist/cjs/components/RaisedAddButton/index.js +17 -0
  39. package/dist/cjs/components/RaisedAddButton/index.js.map +1 -0
  40. package/dist/cjs/components/SwatchPalette/index.js +17 -0
  41. package/dist/cjs/components/SwatchPalette/index.js.map +1 -0
  42. package/dist/cjs/components/SwatchPalette/swatchPalette.js +210 -0
  43. package/dist/cjs/components/SwatchPalette/swatchPalette.js.map +1 -0
  44. package/dist/cjs/components/SwatchPalette/swatchPalette.test.js +35 -0
  45. package/dist/cjs/components/SwatchPalette/swatchPalette.test.js.map +1 -0
  46. package/dist/cjs/components/SwatchPicker/SwatchPicker.js +23 -6
  47. package/dist/cjs/components/SwatchPicker/SwatchPicker.js.map +1 -1
  48. package/dist/cjs/components/Timesheet/Styles.js +6 -2
  49. package/dist/cjs/components/Timesheet/Styles.js.map +1 -1
  50. package/dist/cjs/components/Timesheet/TimesheetCell.js.map +1 -1
  51. package/dist/cjs/components/Timesheet/TimesheetTotalRow.js +5 -2
  52. package/dist/cjs/components/Timesheet/TimesheetTotalRow.js.map +1 -1
  53. package/dist/cjs/components/ViewSwitcher/Styles.js +25 -4
  54. package/dist/cjs/components/ViewSwitcher/Styles.js.map +1 -1
  55. package/dist/cjs/components/ViewSwitcher/ViewSwitcherMenu.js +113 -0
  56. package/dist/cjs/components/ViewSwitcher/ViewSwitcherMenu.js.map +1 -0
  57. package/dist/cjs/components/ViewSwitcher/index.js +11 -0
  58. package/dist/cjs/components/ViewSwitcher/index.js.map +1 -1
  59. package/dist/cjs/components/index.js +24 -0
  60. package/dist/cjs/components/index.js.map +1 -1
  61. package/dist/cjs/presentation/myWork/MyWorkTasks.js +8 -4
  62. package/dist/cjs/presentation/myWork/MyWorkTasks.js.map +1 -1
  63. package/dist/cjs/presentation/people/teamTasks.js +1 -2
  64. package/dist/cjs/presentation/people/teamTasks.js.map +1 -1
  65. package/dist/cjs/presentation/shared/ObjectSheetFrame.js +226 -92
  66. package/dist/cjs/presentation/shared/ObjectSheetFrame.js.map +1 -1
  67. package/dist/cjs/presentation/shared/ProjectIdentityPalette.js +17 -31
  68. package/dist/cjs/presentation/shared/ProjectIdentityPalette.js.map +1 -1
  69. package/dist/cjs/presentation/shared/ProjectsBatchBar.js +4 -4
  70. package/dist/cjs/presentation/shared/ProjectsBatchBar.js.map +1 -1
  71. package/dist/cjs/presentation/shared/ProjectsCompletedParts.js +1 -2
  72. package/dist/cjs/presentation/shared/ProjectsCompletedParts.js.map +1 -1
  73. package/dist/cjs/presentation/shared/ProjectsListCards.js +1 -2
  74. package/dist/cjs/presentation/shared/ProjectsListCards.js.map +1 -1
  75. package/dist/cjs/presentation/shared/ProjectsListRows.js +1 -2
  76. package/dist/cjs/presentation/shared/ProjectsListRows.js.map +1 -1
  77. package/dist/cjs/presentation/shared/ProjectsListToolbar.js +5 -14
  78. package/dist/cjs/presentation/shared/ProjectsListToolbar.js.map +1 -1
  79. package/dist/cjs/presentation/shared/ProjectsPortfoliosList.js +5 -17
  80. package/dist/cjs/presentation/shared/ProjectsPortfoliosList.js.map +1 -1
  81. package/dist/cjs/presentation/shared/ProjectsTemplatesParts.js +4 -16
  82. package/dist/cjs/presentation/shared/ProjectsTemplatesParts.js.map +1 -1
  83. package/dist/cjs/presentation/shared/ShellMainMenu.js +1 -1
  84. package/dist/cjs/presentation/shared/ShellMainMenu.js.map +1 -1
  85. package/dist/cjs/presentation/shared/TaskContentDialogs.js +13 -65
  86. package/dist/cjs/presentation/shared/TaskContentDialogs.js.map +1 -1
  87. package/dist/cjs/presentation/shared/TaskContentThread.js +2 -1
  88. package/dist/cjs/presentation/shared/TaskContentThread.js.map +1 -1
  89. package/dist/cjs/presentation/shared/TaskContentThreadLive.js +2 -10
  90. package/dist/cjs/presentation/shared/TaskContentThreadLive.js.map +1 -1
  91. package/dist/cjs/presentation/shared/TaskListRows.js +64 -48
  92. package/dist/cjs/presentation/shared/TaskListRows.js.map +1 -1
  93. package/dist/cjs/presentation/shared/TimesheetAddButtons.js +34 -0
  94. package/dist/cjs/presentation/shared/TimesheetAddButtons.js.map +1 -0
  95. package/dist/cjs/presentation/shared/TrackingList.js +159 -57
  96. package/dist/cjs/presentation/shared/TrackingList.js.map +1 -1
  97. package/dist/cjs/presentation/shared/UserMenu.js +3 -0
  98. package/dist/cjs/presentation/shared/UserMenu.js.map +1 -1
  99. package/dist/cjs/presentation/shared/headers.js +15 -10
  100. package/dist/cjs/presentation/shared/headers.js.map +1 -1
  101. package/dist/esm/components/Chip/Chip.d.ts +2 -0
  102. package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
  103. package/dist/esm/components/Chip/Chip.js +4 -2
  104. package/dist/esm/components/Chip/Chip.js.map +1 -1
  105. package/dist/esm/components/Chip/Styles.d.ts +1 -0
  106. package/dist/esm/components/Chip/Styles.d.ts.map +1 -1
  107. package/dist/esm/components/Chip/Styles.js +10 -5
  108. package/dist/esm/components/Chip/Styles.js.map +1 -1
  109. package/dist/esm/components/Divider/Divider.d.ts +1 -1
  110. package/dist/esm/components/Divider/Divider.d.ts.map +1 -1
  111. package/dist/esm/components/Divider/Divider.js.map +1 -1
  112. package/dist/esm/components/Divider/Styles.d.ts +1 -1
  113. package/dist/esm/components/Divider/Styles.d.ts.map +1 -1
  114. package/dist/esm/components/Divider/Styles.js +2 -1
  115. package/dist/esm/components/Divider/Styles.js.map +1 -1
  116. package/dist/esm/components/Filter/Styles.d.ts.map +1 -1
  117. package/dist/esm/components/Filter/Styles.js +1 -1
  118. package/dist/esm/components/Filter/Styles.js.map +1 -1
  119. package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
  120. package/dist/esm/components/GlobalStyle.js +2 -1
  121. package/dist/esm/components/GlobalStyle.js.map +1 -1
  122. package/dist/esm/components/Icons/collection/CalendarDate.d.ts +32 -0
  123. package/dist/esm/components/Icons/collection/CalendarDate.d.ts.map +1 -0
  124. package/dist/esm/components/Icons/collection/CalendarDate.js +56 -0
  125. package/dist/esm/components/Icons/collection/CalendarDate.js.map +1 -0
  126. package/dist/esm/components/Icons/collection/Project.d.ts.map +1 -1
  127. package/dist/esm/components/Icons/collection/Project.js +3 -9
  128. package/dist/esm/components/Icons/collection/Project.js.map +1 -1
  129. package/dist/esm/components/Icons/collection/index.d.ts +1 -0
  130. package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
  131. package/dist/esm/components/Icons/collection/index.js +1 -0
  132. package/dist/esm/components/Icons/collection/index.js.map +1 -1
  133. package/dist/esm/components/MainMenu/MainMenu.d.ts +1 -1
  134. package/dist/esm/components/MainMenu/MainMenu.d.ts.map +1 -1
  135. package/dist/esm/components/MainMenu/MainMenu.js +37 -22
  136. package/dist/esm/components/MainMenu/MainMenu.js.map +1 -1
  137. package/dist/esm/components/MainMenu/MainMenuDrawer.d.ts +1 -1
  138. package/dist/esm/components/MainMenu/MainMenuDrawer.d.ts.map +1 -1
  139. package/dist/esm/components/MainMenu/MainMenuDrawer.js +3 -2
  140. package/dist/esm/components/MainMenu/MainMenuDrawer.js.map +1 -1
  141. package/dist/esm/components/MainMenu/hooks.d.ts +2 -1
  142. package/dist/esm/components/MainMenu/hooks.d.ts.map +1 -1
  143. package/dist/esm/components/MainMenu/hooks.js +43 -9
  144. package/dist/esm/components/MainMenu/hooks.js.map +1 -1
  145. package/dist/esm/components/MainMenu/types.d.ts +2 -0
  146. package/dist/esm/components/MainMenu/types.d.ts.map +1 -1
  147. package/dist/esm/components/MainMenu/types.js.map +1 -1
  148. package/dist/esm/components/Nav/Nav.d.ts +3 -1
  149. package/dist/esm/components/Nav/Nav.d.ts.map +1 -1
  150. package/dist/esm/components/Nav/Nav.js +4 -3
  151. package/dist/esm/components/Nav/Nav.js.map +1 -1
  152. package/dist/esm/components/Nav/Styles.d.ts +1 -0
  153. package/dist/esm/components/Nav/Styles.d.ts.map +1 -1
  154. package/dist/esm/components/Nav/Styles.js +8 -3
  155. package/dist/esm/components/Nav/Styles.js.map +1 -1
  156. package/dist/esm/components/PillButton/PillButton.d.ts +2 -2
  157. package/dist/esm/components/PillButton/PillButton.d.ts.map +1 -1
  158. package/dist/esm/components/PillButton/PillButton.js.map +1 -1
  159. package/dist/esm/components/PillButton/Styles.d.ts.map +1 -1
  160. package/dist/esm/components/PillButton/Styles.js +2 -0
  161. package/dist/esm/components/PillButton/Styles.js.map +1 -1
  162. package/dist/esm/components/PillGroup/Styles.d.ts.map +1 -1
  163. package/dist/esm/components/PillGroup/Styles.js +1 -1
  164. package/dist/esm/components/PillGroup/Styles.js.map +1 -1
  165. package/dist/esm/components/RaisedAddButton/RaisedAddButton.d.ts +19 -0
  166. package/dist/esm/components/RaisedAddButton/RaisedAddButton.d.ts.map +1 -0
  167. package/dist/esm/components/RaisedAddButton/RaisedAddButton.js +35 -0
  168. package/dist/esm/components/RaisedAddButton/RaisedAddButton.js.map +1 -0
  169. package/dist/esm/components/RaisedAddButton/Styles.d.ts +4 -0
  170. package/dist/esm/components/RaisedAddButton/Styles.d.ts.map +1 -0
  171. package/dist/esm/components/RaisedAddButton/Styles.js +11 -0
  172. package/dist/esm/components/RaisedAddButton/Styles.js.map +1 -0
  173. package/dist/esm/components/RaisedAddButton/index.d.ts +2 -0
  174. package/dist/esm/components/RaisedAddButton/index.d.ts.map +1 -0
  175. package/dist/esm/components/RaisedAddButton/index.js +2 -0
  176. package/dist/esm/components/RaisedAddButton/index.js.map +1 -0
  177. package/dist/esm/components/SwatchPalette/index.d.ts +2 -0
  178. package/dist/esm/components/SwatchPalette/index.d.ts.map +1 -0
  179. package/dist/esm/components/SwatchPalette/index.js +2 -0
  180. package/dist/esm/components/SwatchPalette/index.js.map +1 -0
  181. package/dist/esm/components/SwatchPalette/swatchPalette.d.ts +39 -0
  182. package/dist/esm/components/SwatchPalette/swatchPalette.d.ts.map +1 -0
  183. package/dist/esm/components/SwatchPalette/swatchPalette.js +185 -0
  184. package/dist/esm/components/SwatchPalette/swatchPalette.js.map +1 -0
  185. package/dist/esm/components/SwatchPalette/swatchPalette.test.d.ts +2 -0
  186. package/dist/esm/components/SwatchPalette/swatchPalette.test.d.ts.map +1 -0
  187. package/dist/esm/components/SwatchPalette/swatchPalette.test.js +33 -0
  188. package/dist/esm/components/SwatchPalette/swatchPalette.test.js.map +1 -0
  189. package/dist/esm/components/SwatchPicker/SwatchPicker.d.ts +6 -2
  190. package/dist/esm/components/SwatchPicker/SwatchPicker.d.ts.map +1 -1
  191. package/dist/esm/components/SwatchPicker/SwatchPicker.js +17 -6
  192. package/dist/esm/components/SwatchPicker/SwatchPicker.js.map +1 -1
  193. package/dist/esm/components/Timesheet/Styles.d.ts.map +1 -1
  194. package/dist/esm/components/Timesheet/Styles.js +6 -2
  195. package/dist/esm/components/Timesheet/Styles.js.map +1 -1
  196. package/dist/esm/components/Timesheet/TimesheetCell.d.ts +4 -1
  197. package/dist/esm/components/Timesheet/TimesheetCell.d.ts.map +1 -1
  198. package/dist/esm/components/Timesheet/TimesheetCell.js.map +1 -1
  199. package/dist/esm/components/Timesheet/TimesheetTotalRow.d.ts +2 -0
  200. package/dist/esm/components/Timesheet/TimesheetTotalRow.d.ts.map +1 -1
  201. package/dist/esm/components/Timesheet/TimesheetTotalRow.js +5 -2
  202. package/dist/esm/components/Timesheet/TimesheetTotalRow.js.map +1 -1
  203. package/dist/esm/components/ViewSwitcher/Styles.d.ts +14 -0
  204. package/dist/esm/components/ViewSwitcher/Styles.d.ts.map +1 -1
  205. package/dist/esm/components/ViewSwitcher/Styles.js +24 -3
  206. package/dist/esm/components/ViewSwitcher/Styles.js.map +1 -1
  207. package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts +35 -0
  208. package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts.map +1 -0
  209. package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js +93 -0
  210. package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js.map +1 -0
  211. package/dist/esm/components/ViewSwitcher/index.d.ts +1 -0
  212. package/dist/esm/components/ViewSwitcher/index.d.ts.map +1 -1
  213. package/dist/esm/components/ViewSwitcher/index.js +1 -0
  214. package/dist/esm/components/ViewSwitcher/index.js.map +1 -1
  215. package/dist/esm/components/index.d.ts +2 -0
  216. package/dist/esm/components/index.d.ts.map +1 -1
  217. package/dist/esm/components/index.js +2 -0
  218. package/dist/esm/components/index.js.map +1 -1
  219. package/dist/esm/presentation/myWork/MyWorkTasks.d.ts.map +1 -1
  220. package/dist/esm/presentation/myWork/MyWorkTasks.js +8 -4
  221. package/dist/esm/presentation/myWork/MyWorkTasks.js.map +1 -1
  222. package/dist/esm/presentation/people/teamTasks.d.ts.map +1 -1
  223. package/dist/esm/presentation/people/teamTasks.js +1 -2
  224. package/dist/esm/presentation/people/teamTasks.js.map +1 -1
  225. package/dist/esm/presentation/shared/ObjectSheetFrame.d.ts +12 -5
  226. package/dist/esm/presentation/shared/ObjectSheetFrame.d.ts.map +1 -1
  227. package/dist/esm/presentation/shared/ObjectSheetFrame.js +219 -94
  228. package/dist/esm/presentation/shared/ObjectSheetFrame.js.map +1 -1
  229. package/dist/esm/presentation/shared/ProjectIdentityPalette.d.ts +1 -1
  230. package/dist/esm/presentation/shared/ProjectIdentityPalette.d.ts.map +1 -1
  231. package/dist/esm/presentation/shared/ProjectIdentityPalette.js +14 -23
  232. package/dist/esm/presentation/shared/ProjectIdentityPalette.js.map +1 -1
  233. package/dist/esm/presentation/shared/ProjectsBatchBar.js +4 -4
  234. package/dist/esm/presentation/shared/ProjectsBatchBar.js.map +1 -1
  235. package/dist/esm/presentation/shared/ProjectsCompletedParts.d.ts.map +1 -1
  236. package/dist/esm/presentation/shared/ProjectsCompletedParts.js +1 -2
  237. package/dist/esm/presentation/shared/ProjectsCompletedParts.js.map +1 -1
  238. package/dist/esm/presentation/shared/ProjectsListCards.d.ts.map +1 -1
  239. package/dist/esm/presentation/shared/ProjectsListCards.js +1 -2
  240. package/dist/esm/presentation/shared/ProjectsListCards.js.map +1 -1
  241. package/dist/esm/presentation/shared/ProjectsListRows.d.ts.map +1 -1
  242. package/dist/esm/presentation/shared/ProjectsListRows.js +1 -2
  243. package/dist/esm/presentation/shared/ProjectsListRows.js.map +1 -1
  244. package/dist/esm/presentation/shared/ProjectsListToolbar.d.ts +1 -2
  245. package/dist/esm/presentation/shared/ProjectsListToolbar.d.ts.map +1 -1
  246. package/dist/esm/presentation/shared/ProjectsListToolbar.js +6 -15
  247. package/dist/esm/presentation/shared/ProjectsListToolbar.js.map +1 -1
  248. package/dist/esm/presentation/shared/ProjectsPortfoliosList.d.ts +1 -2
  249. package/dist/esm/presentation/shared/ProjectsPortfoliosList.d.ts.map +1 -1
  250. package/dist/esm/presentation/shared/ProjectsPortfoliosList.js +6 -18
  251. package/dist/esm/presentation/shared/ProjectsPortfoliosList.js.map +1 -1
  252. package/dist/esm/presentation/shared/ProjectsTemplatesParts.d.ts +2 -2
  253. package/dist/esm/presentation/shared/ProjectsTemplatesParts.d.ts.map +1 -1
  254. package/dist/esm/presentation/shared/ProjectsTemplatesParts.js +5 -17
  255. package/dist/esm/presentation/shared/ProjectsTemplatesParts.js.map +1 -1
  256. package/dist/esm/presentation/shared/ShellMainMenu.d.ts.map +1 -1
  257. package/dist/esm/presentation/shared/ShellMainMenu.js +2 -2
  258. package/dist/esm/presentation/shared/ShellMainMenu.js.map +1 -1
  259. package/dist/esm/presentation/shared/TaskContentDialogs.d.ts +0 -3
  260. package/dist/esm/presentation/shared/TaskContentDialogs.d.ts.map +1 -1
  261. package/dist/esm/presentation/shared/TaskContentDialogs.js +12 -64
  262. package/dist/esm/presentation/shared/TaskContentDialogs.js.map +1 -1
  263. package/dist/esm/presentation/shared/TaskContentThread.d.ts.map +1 -1
  264. package/dist/esm/presentation/shared/TaskContentThread.js +2 -1
  265. package/dist/esm/presentation/shared/TaskContentThread.js.map +1 -1
  266. package/dist/esm/presentation/shared/TaskContentThreadLive.d.ts.map +1 -1
  267. package/dist/esm/presentation/shared/TaskContentThreadLive.js +3 -9
  268. package/dist/esm/presentation/shared/TaskContentThreadLive.js.map +1 -1
  269. package/dist/esm/presentation/shared/TaskListRows.d.ts.map +1 -1
  270. package/dist/esm/presentation/shared/TaskListRows.js +65 -49
  271. package/dist/esm/presentation/shared/TaskListRows.js.map +1 -1
  272. package/dist/esm/presentation/shared/TimesheetAddButtons.d.ts +6 -0
  273. package/dist/esm/presentation/shared/TimesheetAddButtons.d.ts.map +1 -0
  274. package/dist/esm/presentation/shared/TimesheetAddButtons.js +25 -0
  275. package/dist/esm/presentation/shared/TimesheetAddButtons.js.map +1 -0
  276. package/dist/esm/presentation/shared/TrackingList.d.ts +13 -0
  277. package/dist/esm/presentation/shared/TrackingList.d.ts.map +1 -1
  278. package/dist/esm/presentation/shared/TrackingList.js +135 -55
  279. package/dist/esm/presentation/shared/TrackingList.js.map +1 -1
  280. package/dist/esm/presentation/shared/UserMenu.d.ts +1 -1
  281. package/dist/esm/presentation/shared/UserMenu.d.ts.map +1 -1
  282. package/dist/esm/presentation/shared/UserMenu.js +3 -0
  283. package/dist/esm/presentation/shared/UserMenu.js.map +1 -1
  284. package/dist/esm/presentation/shared/headers.d.ts.map +1 -1
  285. package/dist/esm/presentation/shared/headers.js +15 -10
  286. package/dist/esm/presentation/shared/headers.js.map +1 -1
  287. package/dist/index.js +1381 -889
  288. package/dist/index.js.map +1 -1
  289. package/dist/index.min.js +1 -1
  290. package/dist/index.min.js.map +1 -1
  291. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import React, { ComponentPropsWithoutRef } from "react";
2
+ export interface RaisedAddButtonProps extends Omit<ComponentPropsWithoutRef<"button">, "children" | "title"> {
3
+ /** The name of the action, for the tooltip and for screen readers. */
4
+ label: string;
5
+ /** Shows the pressed look while the button holds something open, such as a menu. */
6
+ active?: boolean;
7
+ }
8
+ /**
9
+ * @component RaisedAddButton
10
+ * @description
11
+ * A round raised button with a soft accent fill, for the add action next to a page title.
12
+ * The plus turns on hover and on keyboard focus, and the tooltip names the action.
13
+ * The button and the plus swap colors while the button is pressed, has keyboard focus or is active.
14
+ *
15
+ * @example
16
+ * <RaisedAddButton label="New Project" onClick={openWizard} />
17
+ */
18
+ export declare const RaisedAddButton: React.ForwardRefExoticComponent<RaisedAddButtonProps & React.RefAttributes<HTMLButtonElement>>;
19
+ //# sourceMappingURL=RaisedAddButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RaisedAddButton.d.ts","sourceRoot":"","sources":["../../../../src/components/RaisedAddButton/RaisedAddButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAQpE,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACtE,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,gGAgB1B,CAAC"}
@@ -0,0 +1,35 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["label", "active", "className"];
4
+ import React, { forwardRef } from "react";
5
+ import classnames from "classnames";
6
+ import { StyledRaisedAddButton } from "./Styles";
7
+ import { AddCrossIcon } from "../Icons";
8
+ import { Tooltip } from "../Tooltip";
9
+ /**
10
+ * @component RaisedAddButton
11
+ * @description
12
+ * A round raised button with a soft accent fill, for the add action next to a page title.
13
+ * The plus turns on hover and on keyboard focus, and the tooltip names the action.
14
+ * The button and the plus swap colors while the button is pressed, has keyboard focus or is active.
15
+ *
16
+ * @example
17
+ * <RaisedAddButton label="New Project" onClick={openWizard} />
18
+ */
19
+ export const RaisedAddButton = /*#__PURE__*/forwardRef((_ref, ref) => {
20
+ let label = _ref.label,
21
+ active = _ref.active,
22
+ className = _ref.className,
23
+ args = _objectWithoutPropertiesLoose(_ref, _excluded);
24
+ return /*#__PURE__*/React.createElement(Tooltip, {
25
+ title: label
26
+ }, /*#__PURE__*/React.createElement(StyledRaisedAddButton, _extends({
27
+ ref: ref,
28
+ type: "button",
29
+ "aria-label": label,
30
+ $active: active,
31
+ className: classnames("c-raised-add-button", className)
32
+ }, args), /*#__PURE__*/React.createElement(AddCrossIcon, null)));
33
+ });
34
+ RaisedAddButton.displayName = "RaisedAddButton";
35
+ //# sourceMappingURL=RaisedAddButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RaisedAddButton.js","names":["React","forwardRef","classnames","StyledRaisedAddButton","AddCrossIcon","Tooltip","RaisedAddButton","_ref","ref","label","active","className","args","_objectWithoutPropertiesLoose","_excluded","createElement","title","_extends","type","$active","displayName"],"sources":["../../../../src/components/RaisedAddButton/RaisedAddButton.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef, forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledRaisedAddButton } from \"./Styles\";\nimport { AddCrossIcon } from \"../Icons\";\nimport { Tooltip } from \"../Tooltip\";\n\nexport interface RaisedAddButtonProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"children\" | \"title\"> {\n /** The name of the action, for the tooltip and for screen readers. */\n label: string;\n /** Shows the pressed look while the button holds something open, such as a menu. */\n active?: boolean;\n}\n\n/**\n * @component RaisedAddButton\n * @description\n * A round raised button with a soft accent fill, for the add action next to a page title.\n * The plus turns on hover and on keyboard focus, and the tooltip names the action.\n * The button and the plus swap colors while the button is pressed, has keyboard focus or is active.\n *\n * @example\n * <RaisedAddButton label=\"New Project\" onClick={openWizard} />\n */\nexport const RaisedAddButton = forwardRef<\n HTMLButtonElement,\n RaisedAddButtonProps\n>(({ label, active, className, ...args }, ref) => (\n <Tooltip title={label}>\n <StyledRaisedAddButton\n ref={ref}\n type=\"button\"\n aria-label={label}\n $active={active}\n className={classnames(\"c-raised-add-button\", className)}\n {...args}\n >\n <AddCrossIcon />\n </StyledRaisedAddButton>\n </Tooltip>\n));\n\nRaisedAddButton.displayName = \"RaisedAddButton\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAA8BC,UAAU,QAAQ,OAAO;AAEnE,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,qBAAqB,QAAQ,UAAU;AAChD,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,OAAO,QAAQ,YAAY;AAUpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,gBAAGL,UAAU,CAGvC,CAAAM,IAAA,EAAwCC,GAAG;EAAA,IAAxCC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAKC,IAAI,GAAAC,6BAAA,CAAAN,IAAA,EAAAO,SAAA;EAAA,oBACpCd,KAAA,CAAAe,aAAA,CAACV,OAAO;IAACW,KAAK,EAAEP;EAAM,gBACpBT,KAAA,CAAAe,aAAA,CAACZ,qBAAqB,EAAAc,QAAA;IACpBT,GAAG,EAAEA,GAAI;IACTU,IAAI,EAAC,QAAQ;IACb,cAAYT,KAAM;IAClBU,OAAO,EAAET,MAAO;IAChBC,SAAS,EAAET,UAAU,CAAC,qBAAqB,EAAES,SAAS;EAAE,GACpDC,IAAI,gBAERZ,KAAA,CAAAe,aAAA,CAACX,YAAY,MAAE,CACM,CAChB,CAAC;AAAA,CACX,CAAC;AAEFE,eAAe,CAACc,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export declare const StyledRaisedAddButton: import("styled-components").StyledComponent<"button", any, {
2
+ $active?: boolean;
3
+ }, never>;
4
+ //# sourceMappingURL=Styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/RaisedAddButton/Styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;cAA6B,OAAO;SAwDrE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import styled, { css } from "styled-components";
2
+ import { BoxSizingStyle } from "../BoxSizingStyle";
3
+
4
+ // The plus takes the look of the normal fill, opaque because a translucent color does not show on solid primary.
5
+ const SwappedColors = css(["border-color:var(--color-primary);background-color:var(--color-primary);svg{fill:color-mix(in oklab,var(--color-primary) 20%,var(--body-bg-main));}"]);
6
+ export const StyledRaisedAddButton = styled.button.withConfig({
7
+ displayName: "Styles__StyledRaisedAddButton",
8
+ componentId: "sc-1reg2s-0"
9
+ })(["", " display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid color-mix(in oklab,var(--color-primary) 25%,transparent);border-radius:50%;background-color:color-mix(in oklab,var(--color-primary) 20%,transparent);box-shadow:var(--shadow-float);cursor:pointer;svg{flex-shrink:0;fill:var(--color-primary);transition:transform 300ms;}&:hover{border-color:color-mix(in oklab,var(--color-primary) 40%,transparent);background-color:color-mix( in oklab,var(--color-primary) 30%,transparent );}&:hover svg,&:focus-visible svg{transform:rotate(90deg);}&:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px;}&:active,&:focus-visible{", "}", ""], BoxSizingStyle, SwappedColors, props => props.$active && css(["&&{", " svg{transform:rotate(90deg);}}"], SwappedColors));
10
+ StyledRaisedAddButton.displayName = "StyledRaisedAddButton";
11
+ //# sourceMappingURL=Styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","SwappedColors","StyledRaisedAddButton","button","withConfig","displayName","componentId","props","$active"],"sources":["../../../../src/components/RaisedAddButton/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\n// The plus takes the look of the normal fill, opaque because a translucent color does not show on solid primary.\nconst SwappedColors = css`\n border-color: var(--color-primary);\n background-color: var(--color-primary);\n\n svg {\n fill: color-mix(in oklab, var(--color-primary) 20%, var(--body-bg-main));\n }\n`;\n\nexport const StyledRaisedAddButton = styled.button<{ $active?: boolean }>`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 1px solid color-mix(in oklab, var(--color-primary) 25%, transparent);\n border-radius: 50%;\n background-color: color-mix(in oklab, var(--color-primary) 20%, transparent);\n box-shadow: var(--shadow-float);\n cursor: pointer;\n\n svg {\n flex-shrink: 0;\n fill: var(--color-primary);\n transition: transform 300ms;\n }\n\n &:hover {\n border-color: color-mix(in oklab, var(--color-primary) 40%, transparent);\n background-color: color-mix(\n in oklab,\n var(--color-primary) 30%,\n transparent\n );\n }\n\n &:hover svg,\n &:focus-visible svg {\n transform: rotate(90deg);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-primary);\n outline-offset: 2px;\n }\n\n &:active,\n &:focus-visible {\n ${SwappedColors}\n }\n\n ${(props) =>\n props.$active &&\n css`\n && {\n ${SwappedColors}\n\n svg {\n transform: rotate(90deg);\n }\n }\n `}\n`;\n\nStyledRaisedAddButton.displayName = \"StyledRaisedAddButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,cAAc,QAAQ,mBAAmB;;AAElD;AACA,MAAMC,aAAa,GAAGF,GAAG,yJAOxB;AAED,OAAO,MAAMG,qBAAqB,GAAGJ,MAAM,CAACK,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,wtBAC9CN,cAAc,EAyCZC,aAAa,EAGdM,KAAK,IACNA,KAAK,CAACC,OAAO,IACbT,GAAG,6CAEGE,aAAa,CAMlB,CACJ;AAEDC,qBAAqB,CAACG,WAAW,GAAG,uBAAuB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./RaisedAddButton";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RaisedAddButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./RaisedAddButton";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/RaisedAddButton/index.ts"],"sourcesContent":["export * from \"./RaisedAddButton\";\n"],"mappings":"AAAA,cAAc,mBAAmB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./swatchPalette";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SwatchPalette/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./swatchPalette";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/SwatchPalette/index.ts"],"sourcesContent":["export * from \"./swatchPalette\";\n"],"mappings":"AAAA,cAAc,iBAAiB","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ export type SwatchPaletteTone = "pastel" | "soft";
2
+ export type SwatchPaletteFillKind = "event" | "card" | "label";
3
+ export interface ISwatchPaletteColor {
4
+ /** The hex color of the entry. */
5
+ color: string;
6
+ /** The name of the entry, such as "Red Soft". */
7
+ name: string;
8
+ /** The hue of the entry. */
9
+ hue: string;
10
+ /** The tone of the entry. */
11
+ tone: SwatchPaletteTone;
12
+ /** A dark tone of the hue, for text and marks on the color. */
13
+ ink: string;
14
+ }
15
+ export interface ISwatchPaletteHue {
16
+ hue: string;
17
+ /** The base color of the hue. */
18
+ soft: string;
19
+ /** The light derivative of the base color. */
20
+ pastel: string;
21
+ /** The dark derivative of the base color. */
22
+ ink: string;
23
+ }
24
+ export declare const SWATCH_PALETTE_HUES: ISwatchPaletteHue[];
25
+ export declare const SWATCH_PALETTE: ISwatchPaletteColor[];
26
+ /** The base colors, the only ones a person picks. The other tones derive from them. */
27
+ export declare const SWATCH_PALETTE_BASE: ISwatchPaletteColor[];
28
+ /** The share of a color in a fill. GlobalStyle reads them, so the fills change in one place. */
29
+ export declare const SWATCH_PALETTE_FILL_MIX: Record<SwatchPaletteFillKind, {
30
+ light: number;
31
+ dark: number;
32
+ }>;
33
+ /** How much more saturated a label is than a calendar event of the same color. */
34
+ export declare const SWATCH_PALETTE_LABEL_CHROMA = 1.15;
35
+ /** The fill of a color on the current paper, for an inline style. A CSS file uses the same tokens. */
36
+ export declare const swatchPaletteFill: (color: string, kind?: SwatchPaletteFillKind) => string;
37
+ /** The base color of the palette for any color, so an older saved color still shows from the fixed set. */
38
+ export declare const swatchPaletteBaseOf: (color?: string | null) => string;
39
+ //# sourceMappingURL=swatchPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatchPalette.d.ts","sourceRoot":"","sources":["../../../../src/components/SwatchPalette/swatchPalette.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAiBlD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,mBAAmB,EAI5C,CAAC;AAEL,uFAAuF;AACvF,eAAO,MAAM,mBAAmB,uBAE/B,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,qBAAqB,EACrB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKhC,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,GAC5B,OAAO,MAAM,EACb,OAAM,qBAA+B,WAUtC,CAAC;AAyCF,2GAA2G;AAC3G,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,GAAG,IAAI,WAsBxD,CAAC"}
@@ -0,0 +1,185 @@
1
+ // mirrors: ProjectColorPalette::DETAILS in the backend, which validates the saved colors.
2
+ export const SWATCH_PALETTE_HUES = [{
3
+ hue: "Red",
4
+ pastel: "#FED2CD",
5
+ soft: "#FAA39C",
6
+ ink: "#773430"
7
+ }, {
8
+ hue: "Orange",
9
+ pastel: "#FED4BD",
10
+ soft: "#F5AA80",
11
+ ink: "#743A14"
12
+ }, {
13
+ hue: "Amber",
14
+ pastel: "#F8D9AF",
15
+ soft: "#E5B46E",
16
+ ink: "#674401"
17
+ }, {
18
+ hue: "Yellow",
19
+ pastel: "#F2E7A0",
20
+ soft: "#E6D271",
21
+ ink: "#574C00"
22
+ }, {
23
+ hue: "Lime",
24
+ pastel: "#D4E6B7",
25
+ soft: "#AECA7E",
26
+ ink: "#40540F"
27
+ }, {
28
+ hue: "Green",
29
+ pastel: "#C4EAC4",
30
+ soft: "#92D094",
31
+ ink: "#255929"
32
+ }, {
33
+ hue: "Mint",
34
+ pastel: "#B6ECD3",
35
+ soft: "#77D3AD",
36
+ ink: "#015A40"
37
+ }, {
38
+ hue: "Teal",
39
+ pastel: "#ADEDE4",
40
+ soft: "#63D4C6",
41
+ ink: "#005851"
42
+ }, {
43
+ hue: "Cyan",
44
+ pastel: "#ABEBF3",
45
+ soft: "#5ED1DE",
46
+ ink: "#00565E"
47
+ }, {
48
+ hue: "Sky",
49
+ pastel: "#B7E6FE",
50
+ soft: "#70CAF4",
51
+ ink: "#005370"
52
+ }, {
53
+ hue: "Blue",
54
+ pastel: "#C9E0FF",
55
+ soft: "#91C1FE",
56
+ ink: "#244C7E"
57
+ }, {
58
+ hue: "Indigo",
59
+ pastel: "#D4DCFE",
60
+ soft: "#AAB9FF",
61
+ ink: "#3D467F"
62
+ }, {
63
+ hue: "Violet",
64
+ pastel: "#E0D8FE",
65
+ soft: "#C2B0FB",
66
+ ink: "#504079"
67
+ }, {
68
+ hue: "Purple",
69
+ pastel: "#EFD2FC",
70
+ soft: "#D7A9EC",
71
+ ink: "#5F3A6F"
72
+ }, {
73
+ hue: "Pink",
74
+ pastel: "#FFCDE8",
75
+ soft: "#EFA2CD",
76
+ ink: "#6F3457"
77
+ }, {
78
+ hue: "Gray",
79
+ pastel: "#D7D7D7",
80
+ soft: "#B1B1B1",
81
+ ink: "#3D3D3D"
82
+ }];
83
+ export const SWATCH_PALETTE = SWATCH_PALETTE_HUES.flatMap(_ref => {
84
+ let hue = _ref.hue,
85
+ pastel = _ref.pastel,
86
+ soft = _ref.soft,
87
+ ink = _ref.ink;
88
+ return [{
89
+ color: pastel,
90
+ name: hue + " Pastel",
91
+ hue,
92
+ tone: "pastel",
93
+ ink
94
+ }, {
95
+ color: soft,
96
+ name: hue + " Soft",
97
+ hue,
98
+ tone: "soft",
99
+ ink
100
+ }];
101
+ });
102
+
103
+ /** The base colors, the only ones a person picks. The other tones derive from them. */
104
+ export const SWATCH_PALETTE_BASE = SWATCH_PALETTE.filter(_ref2 => {
105
+ let tone = _ref2.tone;
106
+ return tone === "soft";
107
+ });
108
+
109
+ /** The share of a color in a fill. GlobalStyle reads them, so the fills change in one place. */
110
+ export const SWATCH_PALETTE_FILL_MIX = {
111
+ event: {
112
+ light: 40,
113
+ dark: 38
114
+ },
115
+ card: {
116
+ light: 22,
117
+ dark: 26
118
+ },
119
+ label: {
120
+ light: 40,
121
+ dark: 38
122
+ }
123
+ };
124
+
125
+ /** How much more saturated a label is than a calendar event of the same color. */
126
+ export const SWATCH_PALETTE_LABEL_CHROMA = 1.15;
127
+
128
+ /** The fill of a color on the current paper, for an inline style. A CSS file uses the same tokens. */
129
+ export const swatchPaletteFill = function (color, kind) {
130
+ if (kind === void 0) {
131
+ kind = "event";
132
+ }
133
+ const mix = theme => "color-mix(in srgb, " + color + " var(--swatch-palette-" + kind + "-mix-" + theme + "), var(--page-paper-main))";
134
+ const shade = theme => kind === "label" ? "oklch(from " + mix(theme) + " l calc(c * " + SWATCH_PALETTE_LABEL_CHROMA + ") h)" : mix(theme);
135
+ return "light-dark(" + shade("light") + ", " + shade("dark") + ")";
136
+ };
137
+ const rgbOf = hex => {
138
+ const full = hex.length === 4 ? hex.replace(/[0-9a-f]/gi, digit => digit + digit) : hex;
139
+ return [1, 3, 5].map(start => parseInt(full.slice(start, start + 2), 16));
140
+ };
141
+ const hueAndSaturationOf = hex => {
142
+ const _rgbOf$map = rgbOf(hex).map(part => part / 255),
143
+ red = _rgbOf$map[0],
144
+ green = _rgbOf$map[1],
145
+ blue = _rgbOf$map[2];
146
+ const max = Math.max(red, green, blue);
147
+ const min = Math.min(red, green, blue);
148
+ const delta = max - min;
149
+ if (delta === 0) return {
150
+ hue: 0,
151
+ saturation: 0
152
+ };
153
+ const sector = max === red ? ((green - blue) / delta + 6) % 6 : max === green ? (blue - red) / delta + 2 : (red - green) / delta + 4;
154
+ return {
155
+ hue: sector * 60,
156
+ saturation: delta / (1 - Math.abs(max + min - 1))
157
+ };
158
+ };
159
+ const GRAY_SATURATION = 0.15;
160
+ const HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
161
+ const hueDistance = (first, second) => {
162
+ const distance = Math.abs(first - second);
163
+ return Math.min(distance, 360 - distance);
164
+ };
165
+
166
+ /** The base color of the palette for any color, so an older saved color still shows from the fixed set. */
167
+ export const swatchPaletteBaseOf = color => {
168
+ const hex = typeof color === "string" ? color.trim() : "";
169
+ const gray = SWATCH_PALETTE_HUES[SWATCH_PALETTE_HUES.length - 1].soft;
170
+ if (!HEX_COLOR.test(hex)) return gray;
171
+ const own = SWATCH_PALETTE.find(entry => entry.color === hex.toUpperCase());
172
+ if (own) {
173
+ var _SWATCH_PALETTE_HUES$, _SWATCH_PALETTE_HUES$2;
174
+ return (_SWATCH_PALETTE_HUES$ = (_SWATCH_PALETTE_HUES$2 = SWATCH_PALETTE_HUES.find(_ref3 => {
175
+ let hue = _ref3.hue;
176
+ return hue === own.hue;
177
+ })) == null ? void 0 : _SWATCH_PALETTE_HUES$2.soft) != null ? _SWATCH_PALETTE_HUES$ : gray;
178
+ }
179
+ const _hueAndSaturationOf = hueAndSaturationOf(hex),
180
+ hue = _hueAndSaturationOf.hue,
181
+ saturation = _hueAndSaturationOf.saturation;
182
+ if (saturation < GRAY_SATURATION) return gray;
183
+ return SWATCH_PALETTE_HUES.slice(0, -1).reduce((nearest, entry) => hueDistance(hueAndSaturationOf(entry.soft).hue, hue) < hueDistance(hueAndSaturationOf(nearest.soft).hue, hue) ? entry : nearest).soft;
184
+ };
185
+ //# sourceMappingURL=swatchPalette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatchPalette.js","names":["SWATCH_PALETTE_HUES","hue","pastel","soft","ink","SWATCH_PALETTE","flatMap","_ref","color","name","tone","SWATCH_PALETTE_BASE","filter","_ref2","SWATCH_PALETTE_FILL_MIX","event","light","dark","card","label","SWATCH_PALETTE_LABEL_CHROMA","swatchPaletteFill","kind","mix","theme","shade","rgbOf","hex","full","length","replace","digit","map","start","parseInt","slice","hueAndSaturationOf","_rgbOf$map","part","red","green","blue","max","Math","min","delta","saturation","sector","abs","GRAY_SATURATION","HEX_COLOR","hueDistance","first","second","distance","swatchPaletteBaseOf","trim","gray","test","own","find","entry","toUpperCase","_SWATCH_PALETTE_HUES$","_SWATCH_PALETTE_HUES$2","_ref3","_hueAndSaturationOf","reduce","nearest"],"sources":["../../../../src/components/SwatchPalette/swatchPalette.ts"],"sourcesContent":["export type SwatchPaletteTone = \"pastel\" | \"soft\";\n\nexport type SwatchPaletteFillKind = \"event\" | \"card\" | \"label\";\n\nexport interface ISwatchPaletteColor {\n /** The hex color of the entry. */\n color: string;\n /** The name of the entry, such as \"Red Soft\". */\n name: string;\n /** The hue of the entry. */\n hue: string;\n /** The tone of the entry. */\n tone: SwatchPaletteTone;\n /** A dark tone of the hue, for text and marks on the color. */\n ink: string;\n}\n\nexport interface ISwatchPaletteHue {\n hue: string;\n /** The base color of the hue. */\n soft: string;\n /** The light derivative of the base color. */\n pastel: string;\n /** The dark derivative of the base color. */\n ink: string;\n}\n\n// mirrors: ProjectColorPalette::DETAILS in the backend, which validates the saved colors.\nexport const SWATCH_PALETTE_HUES: ISwatchPaletteHue[] = [\n { hue: \"Red\", pastel: \"#FED2CD\", soft: \"#FAA39C\", ink: \"#773430\" },\n { hue: \"Orange\", pastel: \"#FED4BD\", soft: \"#F5AA80\", ink: \"#743A14\" },\n { hue: \"Amber\", pastel: \"#F8D9AF\", soft: \"#E5B46E\", ink: \"#674401\" },\n { hue: \"Yellow\", pastel: \"#F2E7A0\", soft: \"#E6D271\", ink: \"#574C00\" },\n { hue: \"Lime\", pastel: \"#D4E6B7\", soft: \"#AECA7E\", ink: \"#40540F\" },\n { hue: \"Green\", pastel: \"#C4EAC4\", soft: \"#92D094\", ink: \"#255929\" },\n { hue: \"Mint\", pastel: \"#B6ECD3\", soft: \"#77D3AD\", ink: \"#015A40\" },\n { hue: \"Teal\", pastel: \"#ADEDE4\", soft: \"#63D4C6\", ink: \"#005851\" },\n { hue: \"Cyan\", pastel: \"#ABEBF3\", soft: \"#5ED1DE\", ink: \"#00565E\" },\n { hue: \"Sky\", pastel: \"#B7E6FE\", soft: \"#70CAF4\", ink: \"#005370\" },\n { hue: \"Blue\", pastel: \"#C9E0FF\", soft: \"#91C1FE\", ink: \"#244C7E\" },\n { hue: \"Indigo\", pastel: \"#D4DCFE\", soft: \"#AAB9FF\", ink: \"#3D467F\" },\n { hue: \"Violet\", pastel: \"#E0D8FE\", soft: \"#C2B0FB\", ink: \"#504079\" },\n { hue: \"Purple\", pastel: \"#EFD2FC\", soft: \"#D7A9EC\", ink: \"#5F3A6F\" },\n { hue: \"Pink\", pastel: \"#FFCDE8\", soft: \"#EFA2CD\", ink: \"#6F3457\" },\n { hue: \"Gray\", pastel: \"#D7D7D7\", soft: \"#B1B1B1\", ink: \"#3D3D3D\" },\n];\n\nexport const SWATCH_PALETTE: ISwatchPaletteColor[] =\n SWATCH_PALETTE_HUES.flatMap(({ hue, pastel, soft, ink }) => [\n { color: pastel, name: `${hue} Pastel`, hue, tone: \"pastel\" as const, ink },\n { color: soft, name: `${hue} Soft`, hue, tone: \"soft\" as const, ink },\n ]);\n\n/** The base colors, the only ones a person picks. The other tones derive from them. */\nexport const SWATCH_PALETTE_BASE = SWATCH_PALETTE.filter(\n ({ tone }) => tone === \"soft\"\n);\n\n/** The share of a color in a fill. GlobalStyle reads them, so the fills change in one place. */\nexport const SWATCH_PALETTE_FILL_MIX: Record<\n SwatchPaletteFillKind,\n { light: number; dark: number }\n> = {\n event: { light: 40, dark: 38 },\n card: { light: 22, dark: 26 },\n label: { light: 40, dark: 38 },\n};\n\n/** How much more saturated a label is than a calendar event of the same color. */\nexport const SWATCH_PALETTE_LABEL_CHROMA = 1.15;\n\n/** The fill of a color on the current paper, for an inline style. A CSS file uses the same tokens. */\nexport const swatchPaletteFill = (\n color: string,\n kind: SwatchPaletteFillKind = \"event\"\n) => {\n const mix = (theme: \"light\" | \"dark\") =>\n `color-mix(in srgb, ${color} var(--swatch-palette-${kind}-mix-${theme}), var(--page-paper-main))`;\n const shade = (theme: \"light\" | \"dark\") =>\n kind === \"label\"\n ? `oklch(from ${mix(theme)} l calc(c * ${SWATCH_PALETTE_LABEL_CHROMA}) h)`\n : mix(theme);\n\n return `light-dark(${shade(\"light\")}, ${shade(\"dark\")})`;\n};\n\nconst rgbOf = (hex: string) => {\n const full =\n hex.length === 4\n ? hex.replace(/[0-9a-f]/gi, (digit) => digit + digit)\n : hex;\n\n return [1, 3, 5].map((start) => parseInt(full.slice(start, start + 2), 16));\n};\n\nconst hueAndSaturationOf = (hex: string) => {\n const [red, green, blue] = rgbOf(hex).map((part) => part / 255);\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const delta = max - min;\n\n if (delta === 0) return { hue: 0, saturation: 0 };\n\n const sector =\n max === red\n ? ((green - blue) / delta + 6) % 6\n : max === green\n ? (blue - red) / delta + 2\n : (red - green) / delta + 4;\n\n return {\n hue: sector * 60,\n saturation: delta / (1 - Math.abs(max + min - 1)),\n };\n};\n\nconst GRAY_SATURATION = 0.15;\nconst HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\nconst hueDistance = (first: number, second: number) => {\n const distance = Math.abs(first - second);\n\n return Math.min(distance, 360 - distance);\n};\n\n/** The base color of the palette for any color, so an older saved color still shows from the fixed set. */\nexport const swatchPaletteBaseOf = (color?: string | null) => {\n const hex = typeof color === \"string\" ? color.trim() : \"\";\n const gray = SWATCH_PALETTE_HUES[SWATCH_PALETTE_HUES.length - 1].soft;\n\n if (!HEX_COLOR.test(hex)) return gray;\n\n const own = SWATCH_PALETTE.find((entry) => entry.color === hex.toUpperCase());\n\n if (own) {\n return SWATCH_PALETTE_HUES.find(({ hue }) => hue === own.hue)?.soft ?? gray;\n }\n\n const { hue, saturation } = hueAndSaturationOf(hex);\n\n if (saturation < GRAY_SATURATION) return gray;\n\n return SWATCH_PALETTE_HUES.slice(0, -1).reduce((nearest, entry) =>\n hueDistance(hueAndSaturationOf(entry.soft).hue, hue) <\n hueDistance(hueAndSaturationOf(nearest.soft).hue, hue)\n ? entry\n : nearest\n ).soft;\n};\n"],"mappings":"AA2BA;AACA,OAAO,MAAMA,mBAAwC,GAAG,CACtD;EAAEC,GAAG,EAAE,KAAK;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EAClE;EAAEH,GAAG,EAAE,QAAQ;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACrE;EAAEH,GAAG,EAAE,OAAO;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACpE;EAAEH,GAAG,EAAE,QAAQ;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACrE;EAAEH,GAAG,EAAE,MAAM;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACnE;EAAEH,GAAG,EAAE,OAAO;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACpE;EAAEH,GAAG,EAAE,MAAM;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC,EACnE;EAAEH,GAAG,EAAE,MAAM;EAAEC,MAAM,EAAE,SAAS;EAAEC,IAAI,EAAE,SAAS;EAAEC,GAAG,EAAE;AAAU,CAAC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UAAU,GAAAoB,mBAAA,CAAVpB,UAAU;EAEvB,IAAIA,UAAU,GAAGG,eAAe,EAAE,OAAOQ,IAAI;EAE7C,OAAOzD,mBAAmB,CAACmC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACgC,MAAM,CAAC,CAACC,OAAO,EAAEP,KAAK,KAC5DV,WAAW,CAACf,kBAAkB,CAACyB,KAAK,CAAC1D,IAAI,CAAC,CAACF,GAAG,EAAEA,GAAG,CAAC,GACpDkD,WAAW,CAACf,kBAAkB,CAACgC,OAAO,CAACjE,IAAI,CAAC,CAACF,GAAG,EAAEA,GAAG,CAAC,GAClD4D,KAAK,GACLO,OACN,CAAC,CAACjE,IAAI;AACR,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=swatchPalette.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatchPalette.test.d.ts","sourceRoot":"","sources":["../../../../src/components/SwatchPalette/swatchPalette.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { SWATCH_PALETTE, SWATCH_PALETTE_HUES, swatchPaletteBaseOf, swatchPaletteFill } from "./swatchPalette";
2
+ describe("swatch palette", () => {
3
+ it("has a pastel and a soft entry for each hue", () => {
4
+ expect(SWATCH_PALETTE).toHaveLength(SWATCH_PALETTE_HUES.length * 2);
5
+ expect(new Set(SWATCH_PALETTE.map(_ref => {
6
+ let color = _ref.color;
7
+ return color;
8
+ })).size).toBe(SWATCH_PALETTE.length);
9
+ });
10
+ it("gives each entry the ink of its hue", () => {
11
+ const red = SWATCH_PALETTE.filter(_ref2 => {
12
+ let hue = _ref2.hue;
13
+ return hue === "Red";
14
+ });
15
+ expect(red.map(_ref3 => {
16
+ let ink = _ref3.ink;
17
+ return ink;
18
+ })).toEqual(["#773430", "#773430"]);
19
+ expect(red.map(_ref4 => {
20
+ let name = _ref4.name;
21
+ return name;
22
+ })).toEqual(["Red Pastel", "Red Soft"]);
23
+ });
24
+ it("reads the fill strength from the tokens of its kind", () => {
25
+ expect(swatchPaletteFill("#FAA39C", "card")).toContain("--swatch-palette-card-mix-dark");
26
+ expect(swatchPaletteFill("#FAA39C")).toContain("--swatch-palette-event-mix-light");
27
+ expect(swatchPaletteFill("#FAA39C", "label")).toContain("oklch(from color-mix(in srgb, #FAA39C var(--swatch-palette-label-mix-light)");
28
+ });
29
+ it.each([["#FED2CD", "#FAA39C"], ["#FAA39C", "#FAA39C"], ["#FF7E7E", "#FAA39C"], ["#BEACF9", "#C2B0FB"], ["#C3E799", "#AECA7E"], ["#CACACA", "#B1B1B1"], [undefined, "#B1B1B1"]])("takes the base color of %s", (color, base) => {
30
+ expect(swatchPaletteBaseOf(color)).toBe(base);
31
+ });
32
+ });
33
+ //# sourceMappingURL=swatchPalette.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swatchPalette.test.js","names":["SWATCH_PALETTE","SWATCH_PALETTE_HUES","swatchPaletteBaseOf","swatchPaletteFill","describe","it","expect","toHaveLength","length","Set","map","_ref","color","size","toBe","red","filter","_ref2","hue","_ref3","ink","toEqual","_ref4","name","toContain","each","undefined","base"],"sources":["../../../../src/components/SwatchPalette/swatchPalette.test.ts"],"sourcesContent":["import {\n SWATCH_PALETTE,\n SWATCH_PALETTE_HUES,\n swatchPaletteBaseOf,\n swatchPaletteFill,\n} from \"./swatchPalette\";\n\ndescribe(\"swatch palette\", () => {\n it(\"has a pastel and a soft entry for each hue\", () => {\n expect(SWATCH_PALETTE).toHaveLength(SWATCH_PALETTE_HUES.length * 2);\n expect(new Set(SWATCH_PALETTE.map(({ color }) => color)).size).toBe(\n SWATCH_PALETTE.length\n );\n });\n\n it(\"gives each entry the ink of its hue\", () => {\n const red = SWATCH_PALETTE.filter(({ hue }) => hue === \"Red\");\n\n expect(red.map(({ ink }) => ink)).toEqual([\"#773430\", \"#773430\"]);\n expect(red.map(({ name }) => name)).toEqual([\"Red Pastel\", \"Red Soft\"]);\n });\n\n it(\"reads the fill strength from the tokens of its kind\", () => {\n expect(swatchPaletteFill(\"#FAA39C\", \"card\")).toContain(\n \"--swatch-palette-card-mix-dark\"\n );\n expect(swatchPaletteFill(\"#FAA39C\")).toContain(\n \"--swatch-palette-event-mix-light\"\n );\n expect(swatchPaletteFill(\"#FAA39C\", \"label\")).toContain(\n \"oklch(from color-mix(in srgb, #FAA39C var(--swatch-palette-label-mix-light)\"\n );\n });\n\n it.each([\n [\"#FED2CD\", \"#FAA39C\"],\n [\"#FAA39C\", \"#FAA39C\"],\n [\"#FF7E7E\", \"#FAA39C\"],\n [\"#BEACF9\", \"#C2B0FB\"],\n [\"#C3E799\", \"#AECA7E\"],\n [\"#CACACA\", \"#B1B1B1\"],\n [undefined, \"#B1B1B1\"],\n ])(\"takes the base color of %s\", (color, base) => {\n expect(swatchPaletteBaseOf(color)).toBe(base);\n });\n});\n"],"mappings":"AAAA,SACEA,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,QACZ,iBAAiB;AAExBC,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BC,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrDC,MAAM,CAACN,cAAc,CAAC,CAACO,YAAY,CAACN,mBAAmB,CAACO,MAAM,GAAG,CAAC,CAAC;IACnEF,MAAM,CAAC,IAAIG,GAAG,CAACT,cAAc,CAACU,GAAG,CAACC,IAAA;MAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;MAAA,OAAOA,KAAK;IAAA,EAAC,CAAC,CAACC,IAAI,CAAC,CAACC,IAAI,CACjEd,cAAc,CAACQ,MACjB,CAAC;EACH,CAAC,CAAC;EAEFH,EAAE,CAAC,qCAAqC,EAAE,MAAM;IAC9C,MAAMU,GAAG,GAAGf,cAAc,CAACgB,MAAM,CAACC,KAAA;MAAA,IAAGC,GAAG,GAAAD,KAAA,CAAHC,GAAG;MAAA,OAAOA,GAAG,KAAK,KAAK;IAAA,EAAC;IAE7DZ,M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ptions {
50
50
  value?: string;
51
51
  /** The row labels per tone. A tone without a label shows with a capital first letter. */
52
52
  toneLabels?: Record<string, string>;
53
+ /** Breaks the palette into rows of this many swatches, with no tone labels. */
54
+ swatchesPerRow?: number;
53
55
  /** The label and the name of the row for a color outside the palette. */
54
56
  currentLabel?: string;
55
57
  }
56
58
  /** Builds the grid rows of a palette: hues in columns, tones in rows, as the project color picker does. */
57
- export declare const buildPaletteRows: (palette: ISwatchPaletteEntry[], { value, toneLabels, currentLabel, }?: IPaletteRowsOptions) => ISwatchRow[];
59
+ export declare const buildPaletteRows: (palette: ISwatchPaletteEntry[], { value, toneLabels, currentLabel, swatchesPerRow, }?: IPaletteRowsOptions) => ISwatchRow[];
58
60
  export interface ISwatchPickerProps {
59
61
  /** The rows of the grid. Leave it out to build the rows from `palette`. */
60
62
  rows?: ISwatchRow[];
@@ -62,6 +64,8 @@ export interface ISwatchPickerProps {
62
64
  palette?: ISwatchPaletteEntry[];
63
65
  /** The row labels per tone of `palette`. */
64
66
  toneLabels?: Record<string, string>;
67
+ /** Breaks `palette` into rows of this many swatches, with no tone labels. */
68
+ swatchesPerRow?: number;
65
69
  /** The label of the row for a selected color outside `palette`. */
66
70
  currentLabel?: string;
67
71
  /** The id of the selected swatch or option. */
@@ -86,7 +90,7 @@ export interface ISwatchPickerProps {
86
90
  "data-testid"?: string;
87
91
  }
88
92
  export declare const SwatchPicker: {
89
- ({ rows: rowsProp, palette, toneLabels, currentLabel, value: valueProp, onChange, options: optionsProp, title, width, footer, defaultOpen, disabled, invalid, className, "data-testid": testId, }: ISwatchPickerProps): React.JSX.Element;
93
+ ({ rows: rowsProp, palette, toneLabels, swatchesPerRow, currentLabel, value: valueProp, onChange, options: optionsProp, title, width: widthProp, footer, defaultOpen, disabled, invalid, className, "data-testid": testId, }: ISwatchPickerProps): React.JSX.Element;
90
94
  displayName: string;
91
95
  };
92
96
  //# sourceMappingURL=SwatchPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"S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+ {"version":3,"file":"SwatchPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/SwatchPicker/SwatchPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,SAAS,EAMV,MAAM,OAAO,CAAC;AAkCf,MAAM,WAAW,OAAO;IACtB,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2GAA2G;IAC3G,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;C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,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAqGD,eAAO,MAAM,YAAY;kOAiBtB,kBAAkB;;CAqTpB,CAAC"}
@@ -8,6 +8,9 @@ import { StyledSwatchCell, StyledSwatchFooter, StyledSwatchFooterDetail, StyledS
8
8
  import { CheckIcon } from "../Icons";
9
9
  import { Menu } from "../Menu";
10
10
  const TRIGGER_SWATCH_SIZE = 20;
11
+ const SWATCH_SIZE = 22;
12
+ const SWATCH_GAP = 6;
13
+ const GRID_INLINE_PADDING = 34;
11
14
  const DEFAULT_EDGE = "rgba(0, 0, 0, 0.1)";
12
15
  const HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
13
16
  const DEFAULT_TONE_LABELS = {
@@ -25,6 +28,9 @@ const toSwatch = entry => {
25
28
  ink: (_entry$ink = entry.ink) != null ? _entry$ink : undefined
26
29
  };
27
30
  };
31
+ const chunk = (items, size) => Array.from({
32
+ length: Math.ceil(items.length / size)
33
+ }, (_, index) => items.slice(index * size, (index + 1) * size));
28
34
 
29
35
  /** Builds the grid rows of a palette: hues in columns, tones in rows, as the project color picker does. */
30
36
  export const buildPaletteRows = function (palette, _temp) {
@@ -33,7 +39,8 @@ export const buildPaletteRows = function (palette, _temp) {
33
39
  _ref$toneLabels = _ref.toneLabels,
34
40
  toneLabels = _ref$toneLabels === void 0 ? DEFAULT_TONE_LABELS : _ref$toneLabels,
35
41
  _ref$currentLabel = _ref.currentLabel,
36
- currentLabel = _ref$currentLabel === void 0 ? "Current" : _ref$currentLabel;
42
+ currentLabel = _ref$currentLabel === void 0 ? "Current" : _ref$currentLabel,
43
+ swatchesPerRow = _ref.swatchesPerRow;
37
44
  const hasDetails = palette.length > 0 && palette.every(entry => entry.hue && entry.tone);
38
45
  let tones;
39
46
  let grid;
@@ -49,7 +56,9 @@ export const buildPaletteRows = function (palette, _temp) {
49
56
  length: columns
50
57
  }, (__, column) => palette[column * 2 + row]));
51
58
  }
52
- const rows = tones.map((tone, index) => {
59
+ const rows = swatchesPerRow ? chunk(palette, swatchesPerRow).map(entries => ({
60
+ swatches: entries.map(toSwatch)
61
+ })) : tones.map((tone, index) => {
53
62
  var _toneLabels$tone;
54
63
  return {
55
64
  label: (_toneLabels$tone = toneLabels[tone]) != null ? _toneLabels$tone : tone.charAt(0).toUpperCase() + tone.slice(1),
@@ -165,14 +174,14 @@ export const SwatchPicker = _ref7 => {
165
174
  let rowsProp = _ref7.rows,
166
175
  palette = _ref7.palette,
167
176
  toneLabels = _ref7.toneLabels,
177
+ swatchesPerRow = _ref7.swatchesPerRow,
168
178
  currentLabel = _ref7.currentLabel,
169
179
  valueProp = _ref7.value,
170
180
  onChange = _ref7.onChange,
171
181
  _ref7$options = _ref7.options,
172
182
  optionsProp = _ref7$options === void 0 ? NO_OPTIONS : _ref7$options,
173
183
  title = _ref7.title,
174
- _ref7$width = _ref7.width,
175
- width = _ref7$width === void 0 ? 520 : _ref7$width,
184
+ widthProp = _ref7.width,
176
185
  _ref7$footer = _ref7.footer,
177
186
  footer = _ref7$footer === void 0 ? true : _ref7$footer,
178
187
  _ref7$defaultOpen = _ref7.defaultOpen,
@@ -181,6 +190,7 @@ export const SwatchPicker = _ref7 => {
181
190
  invalid = _ref7.invalid,
182
191
  className = _ref7.className,
183
192
  testId = _ref7["data-testid"];
193
+ const width = widthProp != null ? widthProp : swatchesPerRow ? swatchesPerRow * SWATCH_SIZE + (swatchesPerRow - 1) * SWATCH_GAP + GRID_INLINE_PADDING : 520;
184
194
  const _useState = useState(defaultOpen),
185
195
  open = _useState[0],
186
196
  setOpen = _useState[1];
@@ -205,8 +215,9 @@ export const SwatchPicker = _ref7 => {
205
215
  const rows = useMemo(() => rowsProp != null ? rowsProp : buildPaletteRows(palette != null ? palette : [], {
206
216
  value,
207
217
  toneLabels,
208
- currentLabel
209
- }), [currentLabel, palette, rowsProp, toneLabels, value]);
218
+ currentLabel,
219
+ swatchesPerRow
220
+ }), [currentLabel, palette, rowsProp, toneLabels, value, swatchesPerRow]);
210
221
  const filled = useMemo(() => rows.filter(row => row.swatches.length > 0), [rows]);
211
222
  const selectedOption = options.find(option => option.id === value);
212
223
  const selectedPosition = useMemo(() => {