@r0hitsharma/design-system 0.12.0-rohit-fork-ci.1

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 (395) hide show
  1. package/README.md +237 -0
  2. package/dist/ark.d.ts +28 -0
  3. package/dist/ark.js +27 -0
  4. package/dist/component-manifest.d.ts +475 -0
  5. package/dist/component-manifest.js +498 -0
  6. package/dist/components/AsyncStateRenderer.d.ts +12 -0
  7. package/dist/components/AsyncStateRenderer.js +13 -0
  8. package/dist/components/Badge.d.ts +25 -0
  9. package/dist/components/Badge.js +20 -0
  10. package/dist/components/Button.d.ts +21 -0
  11. package/dist/components/Button.js +27 -0
  12. package/dist/components/Chip.d.ts +25 -0
  13. package/dist/components/Chip.js +34 -0
  14. package/dist/components/Code.d.ts +7 -0
  15. package/dist/components/Code.js +19 -0
  16. package/dist/components/DateRangeFilter.d.ts +22 -0
  17. package/dist/components/DateRangeFilter.js +24 -0
  18. package/dist/components/Drawer.d.ts +31 -0
  19. package/dist/components/Drawer.js +56 -0
  20. package/dist/components/EmptyState.d.ts +12 -0
  21. package/dist/components/EmptyState.js +14 -0
  22. package/dist/components/ErrorBoundary.d.ts +21 -0
  23. package/dist/components/ErrorBoundary.js +87 -0
  24. package/dist/components/ErrorState.d.ts +26 -0
  25. package/dist/components/ErrorState.js +85 -0
  26. package/dist/components/FacetedMultiSelect.d.ts +32 -0
  27. package/dist/components/FacetedMultiSelect.js +33 -0
  28. package/dist/components/Figure.d.ts +35 -0
  29. package/dist/components/Figure.js +24 -0
  30. package/dist/components/FlashOnChange.d.ts +55 -0
  31. package/dist/components/FlashOnChange.js +108 -0
  32. package/dist/components/HeatCell.d.ts +41 -0
  33. package/dist/components/HeatCell.js +35 -0
  34. package/dist/components/Indicator.d.ts +22 -0
  35. package/dist/components/Indicator.js +22 -0
  36. package/dist/components/InfoPopover.d.ts +29 -0
  37. package/dist/components/InfoPopover.js +23 -0
  38. package/dist/components/InfoTip.d.ts +30 -0
  39. package/dist/components/InfoTip.js +20 -0
  40. package/dist/components/KeyValueTable.d.ts +28 -0
  41. package/dist/components/KeyValueTable.js +24 -0
  42. package/dist/components/LoadingIndicator.d.ts +8 -0
  43. package/dist/components/LoadingIndicator.js +23 -0
  44. package/dist/components/Meter.d.ts +56 -0
  45. package/dist/components/Meter.js +51 -0
  46. package/dist/components/Panel.d.ts +105 -0
  47. package/dist/components/Panel.js +45 -0
  48. package/dist/components/PlaybackBar.d.ts +105 -0
  49. package/dist/components/PlaybackBar.js +99 -0
  50. package/dist/components/Popover.d.ts +40 -0
  51. package/dist/components/Popover.js +70 -0
  52. package/dist/components/ProportionBar.d.ts +26 -0
  53. package/dist/components/ProportionBar.js +50 -0
  54. package/dist/components/ProportionList.d.ts +32 -0
  55. package/dist/components/ProportionList.js +40 -0
  56. package/dist/components/RangePicker.d.ts +19 -0
  57. package/dist/components/RangePicker.js +275 -0
  58. package/dist/components/RangeSlider.d.ts +30 -0
  59. package/dist/components/RangeSlider.js +35 -0
  60. package/dist/components/SearchInput.d.ts +21 -0
  61. package/dist/components/SearchInput.js +64 -0
  62. package/dist/components/SkeletonRows.d.ts +97 -0
  63. package/dist/components/SkeletonRows.js +141 -0
  64. package/dist/components/SkeletonStack.d.ts +23 -0
  65. package/dist/components/SkeletonStack.js +22 -0
  66. package/dist/components/Sparkline.d.ts +29 -0
  67. package/dist/components/Sparkline.js +38 -0
  68. package/dist/components/StatTile.d.ts +61 -0
  69. package/dist/components/StatTile.js +24 -0
  70. package/dist/components/StatusPill.d.ts +22 -0
  71. package/dist/components/StatusPill.js +23 -0
  72. package/dist/components/StyledSelect.d.ts +10 -0
  73. package/dist/components/StyledSelect.js +26 -0
  74. package/dist/components/SurfaceMessage.d.ts +55 -0
  75. package/dist/components/SurfaceMessage.js +34 -0
  76. package/dist/components/TextInput.d.ts +23 -0
  77. package/dist/components/TextInput.js +27 -0
  78. package/dist/components/ThemeToggle.d.ts +17 -0
  79. package/dist/components/ThemeToggle.js +60 -0
  80. package/dist/components/TreeRow.d.ts +20 -0
  81. package/dist/components/TreeRow.js +68 -0
  82. package/dist/components/data-table/DataTable.d.ts +216 -0
  83. package/dist/components/data-table/DataTable.js +543 -0
  84. package/dist/components/data-table/define-columns.d.ts +78 -0
  85. package/dist/components/data-table/define-columns.js +51 -0
  86. package/dist/components/data-table/features.d.ts +61 -0
  87. package/dist/components/data-table/features.js +35 -0
  88. package/dist/components/data-table/hooks.d.ts +13 -0
  89. package/dist/components/data-table/hooks.js +132 -0
  90. package/dist/components/data-table/index.d.ts +7 -0
  91. package/dist/components/data-table/index.js +4 -0
  92. package/dist/components/data-table/magnitude.d.ts +14 -0
  93. package/dist/components/data-table/magnitude.js +110 -0
  94. package/dist/components/data-table/types.d.ts +268 -0
  95. package/dist/components/data-table/types.js +1 -0
  96. package/dist/components/data-table/utils.d.ts +15 -0
  97. package/dist/components/data-table/utils.js +64 -0
  98. package/dist/components/skeletonPulse.d.ts +77 -0
  99. package/dist/components/skeletonPulse.js +77 -0
  100. package/dist/filter-state/FilterProvider.d.ts +118 -0
  101. package/dist/filter-state/FilterProvider.js +124 -0
  102. package/dist/filter-state/index.d.ts +3 -0
  103. package/dist/filter-state/index.js +3 -0
  104. package/dist/filter-state/types.d.ts +53 -0
  105. package/dist/filter-state/types.js +29 -0
  106. package/dist/filter-state/urlSync.d.ts +27 -0
  107. package/dist/filter-state/urlSync.js +44 -0
  108. package/dist/hooks/devWarning.d.ts +12 -0
  109. package/dist/hooks/devWarning.js +12 -0
  110. package/dist/hooks/index.d.ts +3 -0
  111. package/dist/hooks/index.js +3 -0
  112. package/dist/hooks/useHashRoute.d.ts +30 -0
  113. package/dist/hooks/useHashRoute.js +46 -0
  114. package/dist/hooks/useIdentityChurnWarning.d.ts +26 -0
  115. package/dist/hooks/useIdentityChurnWarning.js +48 -0
  116. package/dist/hooks/useMediaQuery.d.ts +12 -0
  117. package/dist/hooks/useMediaQuery.js +32 -0
  118. package/dist/hooks/useSettled.d.ts +7 -0
  119. package/dist/hooks/useSettled.js +15 -0
  120. package/dist/index.d.ts +62 -0
  121. package/dist/index.js +58 -0
  122. package/dist/layouts/PageShell.d.ts +10 -0
  123. package/dist/layouts/PageShell.js +17 -0
  124. package/dist/layouts/SidebarGrid.d.ts +30 -0
  125. package/dist/layouts/SidebarGrid.js +24 -0
  126. package/dist/layouts/SidebarLayout.d.ts +24 -0
  127. package/dist/layouts/SidebarLayout.js +176 -0
  128. package/dist/layouts/SplitLayout.d.ts +63 -0
  129. package/dist/layouts/SplitLayout.js +31 -0
  130. package/dist/layouts/splitSizes.d.ts +38 -0
  131. package/dist/layouts/splitSizes.js +55 -0
  132. package/dist/panda-preset.d.ts +31 -0
  133. package/dist/panda-preset.js +142 -0
  134. package/dist/playback/appendOnlyBuffer.d.ts +99 -0
  135. package/dist/playback/appendOnlyBuffer.js +187 -0
  136. package/dist/playback/index.d.ts +34 -0
  137. package/dist/playback/index.js +34 -0
  138. package/dist/playback/rafBatch.d.ts +27 -0
  139. package/dist/playback/rafBatch.js +48 -0
  140. package/dist/playback/types.d.ts +71 -0
  141. package/dist/playback/types.js +22 -0
  142. package/dist/playback/usePlayback.d.ts +80 -0
  143. package/dist/playback/usePlayback.js +531 -0
  144. package/dist/playback/useTransportHotkeys.d.ts +71 -0
  145. package/dist/playback/useTransportHotkeys.js +127 -0
  146. package/dist/recipes/badge.recipe.d.ts +16 -0
  147. package/dist/recipes/badge.recipe.js +82 -0
  148. package/dist/recipes/button.recipe.d.ts +21 -0
  149. package/dist/recipes/button.recipe.js +176 -0
  150. package/dist/recipes/chip.recipe.d.ts +9 -0
  151. package/dist/recipes/chip.recipe.js +103 -0
  152. package/dist/recipes/code.recipe.d.ts +8 -0
  153. package/dist/recipes/code.recipe.js +48 -0
  154. package/dist/recipes/dataTable.recipe.d.ts +55 -0
  155. package/dist/recipes/dataTable.recipe.js +723 -0
  156. package/dist/recipes/drawer.recipe.d.ts +1 -0
  157. package/dist/recipes/drawer.recipe.js +117 -0
  158. package/dist/recipes/emptyState.recipe.d.ts +8 -0
  159. package/dist/recipes/emptyState.recipe.js +78 -0
  160. package/dist/recipes/facetedMultiSelect.recipe.d.ts +7 -0
  161. package/dist/recipes/facetedMultiSelect.recipe.js +102 -0
  162. package/dist/recipes/figure.recipe.d.ts +12 -0
  163. package/dist/recipes/figure.recipe.js +47 -0
  164. package/dist/recipes/flash.recipe.d.ts +17 -0
  165. package/dist/recipes/flash.recipe.js +47 -0
  166. package/dist/recipes/heatCell.recipe.d.ts +17 -0
  167. package/dist/recipes/heatCell.recipe.js +69 -0
  168. package/dist/recipes/index.d.ts +36 -0
  169. package/dist/recipes/index.js +36 -0
  170. package/dist/recipes/indicator.recipe.d.ts +18 -0
  171. package/dist/recipes/indicator.recipe.js +67 -0
  172. package/dist/recipes/input.recipe.d.ts +1 -0
  173. package/dist/recipes/input.recipe.js +96 -0
  174. package/dist/recipes/interactiveItem.recipe.d.ts +1 -0
  175. package/dist/recipes/interactiveItem.recipe.js +68 -0
  176. package/dist/recipes/keyValueTable.recipe.d.ts +11 -0
  177. package/dist/recipes/keyValueTable.recipe.js +68 -0
  178. package/dist/recipes/meter.recipe.d.ts +29 -0
  179. package/dist/recipes/meter.recipe.js +231 -0
  180. package/dist/recipes/pageShell.recipe.d.ts +7 -0
  181. package/dist/recipes/pageShell.recipe.js +20 -0
  182. package/dist/recipes/panel.recipe.d.ts +11 -0
  183. package/dist/recipes/panel.recipe.js +143 -0
  184. package/dist/recipes/panelAction.recipe.d.ts +1 -0
  185. package/dist/recipes/panelAction.recipe.js +54 -0
  186. package/dist/recipes/panelSection.recipe.d.ts +1 -0
  187. package/dist/recipes/panelSection.recipe.js +39 -0
  188. package/dist/recipes/playbackBar.recipe.d.ts +12 -0
  189. package/dist/recipes/playbackBar.recipe.js +113 -0
  190. package/dist/recipes/popover.recipe.d.ts +12 -0
  191. package/dist/recipes/popover.recipe.js +100 -0
  192. package/dist/recipes/rangeSlider.recipe.d.ts +7 -0
  193. package/dist/recipes/rangeSlider.recipe.js +72 -0
  194. package/dist/recipes/searchInput.recipe.d.ts +8 -0
  195. package/dist/recipes/searchInput.recipe.js +97 -0
  196. package/dist/recipes/sectionHeading.recipe.d.ts +1 -0
  197. package/dist/recipes/sectionHeading.recipe.js +29 -0
  198. package/dist/recipes/segmentedControl.recipe.d.ts +1 -0
  199. package/dist/recipes/segmentedControl.recipe.js +43 -0
  200. package/dist/recipes/select.recipe.d.ts +9 -0
  201. package/dist/recipes/select.recipe.js +69 -0
  202. package/dist/recipes/sharedRecipes.d.ts +63 -0
  203. package/dist/recipes/sharedRecipes.js +99 -0
  204. package/dist/recipes/sidebarGrid.recipe.d.ts +9 -0
  205. package/dist/recipes/sidebarGrid.recipe.js +80 -0
  206. package/dist/recipes/sidebarLayout.recipe.d.ts +9 -0
  207. package/dist/recipes/sidebarLayout.recipe.js +199 -0
  208. package/dist/recipes/splitLayout.recipe.d.ts +12 -0
  209. package/dist/recipes/splitLayout.recipe.js +90 -0
  210. package/dist/recipes/statTile.recipe.d.ts +11 -0
  211. package/dist/recipes/statTile.recipe.js +151 -0
  212. package/dist/recipes/statusPill.recipe.d.ts +17 -0
  213. package/dist/recipes/statusPill.recipe.js +86 -0
  214. package/dist/recipes/surfaceMessage.recipe.d.ts +11 -0
  215. package/dist/recipes/surfaceMessage.recipe.js +75 -0
  216. package/dist/recipes/switch.recipe.d.ts +1 -0
  217. package/dist/recipes/switch.recipe.js +56 -0
  218. package/dist/recipes/themeToggle.recipe.d.ts +16 -0
  219. package/dist/recipes/themeToggle.recipe.js +132 -0
  220. package/dist/recipes/tooltip.recipe.d.ts +23 -0
  221. package/dist/recipes/tooltip.recipe.js +119 -0
  222. package/dist/staticCss.d.ts +68 -0
  223. package/dist/staticCss.js +68 -0
  224. package/dist/theme/ThemeProvider.d.ts +27 -0
  225. package/dist/theme/ThemeProvider.js +165 -0
  226. package/dist/theme/theme-bootstrap.d.ts +40 -0
  227. package/dist/theme/theme-bootstrap.js +77 -0
  228. package/dist/theme/theme-storage.d.ts +41 -0
  229. package/dist/theme/theme-storage.js +65 -0
  230. package/dist/theme/useIdentityPalette.d.ts +35 -0
  231. package/dist/theme/useIdentityPalette.js +87 -0
  232. package/dist/theme/useTheme.d.ts +8 -0
  233. package/dist/theme/useTheme.js +9 -0
  234. package/dist/theme-bootstrap.js +31 -0
  235. package/dist/tokens/chartColorTokens.d.ts +220 -0
  236. package/dist/tokens/chartColorTokens.js +132 -0
  237. package/dist/tokens/index.d.ts +1 -0
  238. package/dist/tokens/index.js +1 -0
  239. package/dist/tokens/sharedThemeTokens.d.ts +1469 -0
  240. package/dist/tokens/sharedThemeTokens.js +600 -0
  241. package/package.json +109 -0
  242. package/scripts/emit-theme-bootstrap.ts +72 -0
  243. package/src/ark.ts +32 -0
  244. package/src/component-manifest.test.ts +49 -0
  245. package/src/component-manifest.ts +560 -0
  246. package/src/components/AsyncStateRenderer.tsx +35 -0
  247. package/src/components/Badge.tsx +86 -0
  248. package/src/components/Button.tsx +102 -0
  249. package/src/components/Chip.tsx +111 -0
  250. package/src/components/Code.tsx +43 -0
  251. package/src/components/DateRangeFilter.tsx +55 -0
  252. package/src/components/Drawer.tsx +112 -0
  253. package/src/components/EmptyState.tsx +76 -0
  254. package/src/components/ErrorBoundary.tsx +159 -0
  255. package/src/components/ErrorState.tsx +177 -0
  256. package/src/components/FacetedMultiSelect.tsx +121 -0
  257. package/src/components/Figure.tsx +88 -0
  258. package/src/components/FlashOnChange.compare.test.ts +19 -0
  259. package/src/components/FlashOnChange.test.ts +25 -0
  260. package/src/components/FlashOnChange.tsx +228 -0
  261. package/src/components/HeatCell.test.ts +49 -0
  262. package/src/components/HeatCell.tsx +109 -0
  263. package/src/components/Indicator.tsx +77 -0
  264. package/src/components/InfoPopover.tsx +102 -0
  265. package/src/components/InfoTip.tsx +79 -0
  266. package/src/components/KeyValueTable.tsx +106 -0
  267. package/src/components/LoadingIndicator.tsx +53 -0
  268. package/src/components/Meter.test.ts +36 -0
  269. package/src/components/Meter.tsx +193 -0
  270. package/src/components/Panel.test.ts +37 -0
  271. package/src/components/Panel.tsx +263 -0
  272. package/src/components/PlaybackBar.test.ts +78 -0
  273. package/src/components/PlaybackBar.tsx +346 -0
  274. package/src/components/Popover.tsx +120 -0
  275. package/src/components/ProportionBar.tsx +159 -0
  276. package/src/components/ProportionList.tsx +135 -0
  277. package/src/components/RangePicker.tsx +478 -0
  278. package/src/components/RangeSlider.tsx +89 -0
  279. package/src/components/SearchInput.tsx +193 -0
  280. package/src/components/SkeletonRows.test.ts +116 -0
  281. package/src/components/SkeletonRows.tsx +312 -0
  282. package/src/components/SkeletonStack.test.ts +358 -0
  283. package/src/components/SkeletonStack.tsx +69 -0
  284. package/src/components/Sparkline.tsx +104 -0
  285. package/src/components/StatTile.tsx +157 -0
  286. package/src/components/StatusPill.tsx +88 -0
  287. package/src/components/StyledSelect.tsx +58 -0
  288. package/src/components/SurfaceMessage.test.ts +82 -0
  289. package/src/components/SurfaceMessage.tsx +188 -0
  290. package/src/components/TextInput.tsx +153 -0
  291. package/src/components/ThemeToggle.tsx +142 -0
  292. package/src/components/TreeRow.tsx +132 -0
  293. package/src/components/data-table/DataTable.flash.test.ts +113 -0
  294. package/src/components/data-table/DataTable.skeletonHints.test.ts +75 -0
  295. package/src/components/data-table/DataTable.tsx +1453 -0
  296. package/src/components/data-table/define-columns.ts +112 -0
  297. package/src/components/data-table/features.ts +58 -0
  298. package/src/components/data-table/hooks.ts +211 -0
  299. package/src/components/data-table/index.ts +37 -0
  300. package/src/components/data-table/magnitude.ts +191 -0
  301. package/src/components/data-table/types.ts +331 -0
  302. package/src/components/data-table/utils.test.ts +29 -0
  303. package/src/components/data-table/utils.ts +88 -0
  304. package/src/components/skeletonPulse.test.ts +126 -0
  305. package/src/components/skeletonPulse.ts +83 -0
  306. package/src/exports.test.ts +345 -0
  307. package/src/filter-state/FilterProvider.tsx +292 -0
  308. package/src/filter-state/index.ts +19 -0
  309. package/src/filter-state/types.ts +99 -0
  310. package/src/filter-state/urlSync.ts +74 -0
  311. package/src/hooks/devWarning.ts +19 -0
  312. package/src/hooks/index.ts +3 -0
  313. package/src/hooks/useHashRoute.ts +60 -0
  314. package/src/hooks/useIdentityChurnWarning.test.ts +78 -0
  315. package/src/hooks/useIdentityChurnWarning.ts +67 -0
  316. package/src/hooks/useMediaQuery.ts +35 -0
  317. package/src/hooks/useSettled.ts +18 -0
  318. package/src/index.ts +282 -0
  319. package/src/layouts/PageShell.tsx +46 -0
  320. package/src/layouts/SidebarGrid.tsx +93 -0
  321. package/src/layouts/SidebarLayout.tsx +405 -0
  322. package/src/layouts/SplitLayout.dom.test.ts +72 -0
  323. package/src/layouts/SplitLayout.test.ts +96 -0
  324. package/src/layouts/SplitLayout.tsx +128 -0
  325. package/src/layouts/splitSizes.ts +56 -0
  326. package/src/panda-preset.test.ts +91 -0
  327. package/src/panda-preset.ts +167 -0
  328. package/src/playback/appendOnlyBuffer.test.ts +163 -0
  329. package/src/playback/appendOnlyBuffer.ts +197 -0
  330. package/src/playback/index.ts +56 -0
  331. package/src/playback/rafBatch.test.ts +149 -0
  332. package/src/playback/rafBatch.ts +75 -0
  333. package/src/playback/types.ts +97 -0
  334. package/src/playback/usePlayback.live.test.ts +438 -0
  335. package/src/playback/usePlayback.memo.test.ts +166 -0
  336. package/src/playback/usePlayback.replay.test.ts +110 -0
  337. package/src/playback/usePlayback.reset.test.ts +124 -0
  338. package/src/playback/usePlayback.ssr.test.ts +33 -0
  339. package/src/playback/usePlayback.swap.test.ts +172 -0
  340. package/src/playback/usePlayback.ts +705 -0
  341. package/src/playback/useTransportHotkeys.dom.test.ts +169 -0
  342. package/src/playback/useTransportHotkeys.test.ts +142 -0
  343. package/src/playback/useTransportHotkeys.ts +185 -0
  344. package/src/recipes/badge.recipe.ts +84 -0
  345. package/src/recipes/button.recipe.ts +178 -0
  346. package/src/recipes/chip.recipe.ts +105 -0
  347. package/src/recipes/code.recipe.ts +50 -0
  348. package/src/recipes/dataTable.recipe.ts +728 -0
  349. package/src/recipes/drawer.recipe.ts +119 -0
  350. package/src/recipes/emptyState.recipe.ts +80 -0
  351. package/src/recipes/facetedMultiSelect.recipe.ts +104 -0
  352. package/src/recipes/figure.recipe.ts +49 -0
  353. package/src/recipes/flash.recipe.ts +49 -0
  354. package/src/recipes/heatCell.recipe.ts +71 -0
  355. package/src/recipes/index.ts +40 -0
  356. package/src/recipes/indicator.recipe.ts +69 -0
  357. package/src/recipes/input.recipe.ts +98 -0
  358. package/src/recipes/interactiveItem.recipe.ts +70 -0
  359. package/src/recipes/keyValueTable.recipe.ts +70 -0
  360. package/src/recipes/meter.recipe.ts +237 -0
  361. package/src/recipes/pageShell.recipe.ts +22 -0
  362. package/src/recipes/panel.recipe.ts +145 -0
  363. package/src/recipes/panelAction.recipe.ts +55 -0
  364. package/src/recipes/panelSection.recipe.ts +41 -0
  365. package/src/recipes/playbackBar.recipe.ts +115 -0
  366. package/src/recipes/popover.recipe.ts +102 -0
  367. package/src/recipes/rangeSlider.recipe.ts +74 -0
  368. package/src/recipes/searchInput.recipe.ts +99 -0
  369. package/src/recipes/sectionHeading.recipe.ts +30 -0
  370. package/src/recipes/segmentedControl.recipe.ts +44 -0
  371. package/src/recipes/select.recipe.ts +71 -0
  372. package/src/recipes/sharedRecipes.ts +105 -0
  373. package/src/recipes/sidebarGrid.recipe.ts +83 -0
  374. package/src/recipes/sidebarLayout.recipe.ts +203 -0
  375. package/src/recipes/splitLayout.recipe.ts +92 -0
  376. package/src/recipes/statTile.recipe.ts +154 -0
  377. package/src/recipes/statusPill.recipe.ts +89 -0
  378. package/src/recipes/surfaceMessage.recipe.ts +77 -0
  379. package/src/recipes/switch.recipe.ts +57 -0
  380. package/src/recipes/themeToggle.recipe.ts +134 -0
  381. package/src/recipes/tooltip.recipe.ts +123 -0
  382. package/src/staticCss.ts +68 -0
  383. package/src/theme/ThemeProvider.test.ts +145 -0
  384. package/src/theme/ThemeProvider.tsx +220 -0
  385. package/src/theme/theme-bootstrap.test.ts +206 -0
  386. package/src/theme/theme-bootstrap.ts +96 -0
  387. package/src/theme/theme-storage.test.ts +119 -0
  388. package/src/theme/theme-storage.ts +73 -0
  389. package/src/theme/useIdentityPalette.test.ts +64 -0
  390. package/src/theme/useIdentityPalette.ts +97 -0
  391. package/src/theme/useTheme.ts +21 -0
  392. package/src/tokens/chartColorTokens.test.ts +94 -0
  393. package/src/tokens/chartColorTokens.ts +181 -0
  394. package/src/tokens/index.ts +6 -0
  395. package/src/tokens/sharedThemeTokens.ts +670 -0
package/README.md ADDED
@@ -0,0 +1,237 @@
1
+ # @r0hitsharma/design-system
2
+
3
+ Shared UI components and design tokens built with React and Panda CSS.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @r0hitsharma/design-system react react-dom
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - Pre-built React components
14
+ - Design system tokens and recipes
15
+ - Theme customization via Panda CSS
16
+ - TypeScript support
17
+ - Component stories and documentation
18
+
19
+ ## Usage
20
+
21
+ ### Import components
22
+
23
+ ```typescript
24
+ import { Panel, Button, Badge } from '@r0hitsharma/design-system';
25
+
26
+ export function Example() {
27
+ return (
28
+ <Panel title="Status" meta="updated 2m ago">
29
+ <Badge variant="solid" colorPalette="green">Healthy</Badge>
30
+ <Button onClick={() => console.log('clicked')}>Refresh</Button>
31
+ </Panel>
32
+ );
33
+ }
34
+ ```
35
+
36
+ ### What's available
37
+
38
+ The full inventory is the **component manifest** — [`src/component-manifest.ts`](./src/component-manifest.ts),
39
+ also exported at runtime as `designSystemComponentManifest`. Each entry's
40
+ `behaviorSource` tells you whether an export is owned here or a wrapper/re-export
41
+ around [Ark UI](https://ark-ui.com) (Dialog, Tabs, Menu, TreeView, Slider, …) or
42
+ [TanStack Table](https://tanstack.com/table) (`DataTable`), and `styleOwner` tells
43
+ you who owns its visuals. Because it is data, you can also list it programmatically:
44
+
45
+ ```typescript
46
+ import { designSystemComponentManifest } from '@r0hitsharma/design-system';
47
+
48
+ const arkWrappers = designSystemComponentManifest.filter(
49
+ (c) => c.behaviorSource === 'ark-ui',
50
+ );
51
+ ```
52
+
53
+ Charts live in the separate [`@r0hitsharma/charting`](../charting/README.md) package.
54
+
55
+ ### Code-splitting heavy components
56
+
57
+ Every component is exported from the package root, and importing from the root stays
58
+ supported. The heavy ones also have a subpath entry point, so you can put a chunk
59
+ boundary in front of them without a wrapper module:
60
+
61
+ | Subpath | Exports | Cost, bundled alone |
62
+ | --- | --- | --- |
63
+ | `/data-table` | `DataTable` + column helpers (TanStack Table + Virtual) | ~278 kB min / ~85 kB gzip |
64
+ | `/ark` | the unstyled Ark UI pass-throughs: `Dialog`, `Menu`, `Tabs`, `Tooltip`, `TreeView`, `Switch`, `Slider`, `Progress`, `Field`, `Avatar`, `Toggle`, `ToggleGroup`, `Portal` | ~251 kB min / ~74 kB gzip for all thirteen |
65
+ | `/search-input` | `SearchInput` (Ark Combobox) | ~108 kB min / ~35 kB gzip |
66
+ | `/drawer` | `Drawer` (Ark Drawer) | ~94 kB min / ~30 kB gzip |
67
+ | `/info-popover` | `InfoPopover` | ~90 kB min / ~31 kB gzip |
68
+ | `/popover` | `Popover` (Ark Popover) | ~89 kB min / ~30 kB gzip |
69
+ | `/sidebar-layout` | `SidebarLayout` (Ark Splitter) | ~54 kB min / ~19 kB gzip |
70
+ | `/split-layout` | `SplitLayout` (Ark Splitter) | ~50 kB min / ~18 kB gzip |
71
+ | `/range-slider` | `RangeSlider` (Ark Slider) | ~42 kB min / ~15 kB gzip |
72
+
73
+ ```typescript
74
+ import { lazy } from 'react';
75
+
76
+ const DataTable = lazy(() =>
77
+ import('@r0hitsharma/design-system/data-table').then((m) => ({ default: m.DataTable })),
78
+ );
79
+ // likewise: import('@r0hitsharma/design-system/drawer'), '/search-input', '/ark', ...
80
+ ```
81
+
82
+ Those are the components measurement singles out; everything else in the package
83
+ costs single-digit kB, so a subpath for it would buy nothing a root import does not
84
+ already give you. `/ark` is on the list because the `design-system-boundaries` lint
85
+ preset (rightly) forbids importing `@ark-ui/react` directly, which left a consumer no
86
+ way to reach 250 kB of Ark except through the root barrel.
87
+
88
+ Every module except the theme bootstrap is marked side-effect-free
89
+ (`"sideEffects": ["./dist/theme-bootstrap.js"]`), so importing only what you use is
90
+ fully tree-shakeable (a `Badge`-only import ships ~1 KB, not the Ark/TanStack engine).
91
+
92
+ ### Use design tokens
93
+
94
+ This package **emits no CSS of its own** — it builds with `tsc`, ships no generated
95
+ `styled-system`, and applies its recipes by stable Panda class names. The consumer
96
+ generates the CSS. Two steps, both required: add the preset, *and* spread
97
+ `designSystemStaticCssRecipes` into `staticCss`. Without the second, the preset
98
+ registers the recipes but Panda generates no rules for them (nothing in your source
99
+ calls a recipe function for it to extract), and every component renders unstyled.
100
+ `staticCss` is a Panda ROOT-config key, so a preset cannot carry it.
101
+
102
+ ```typescript
103
+ import { defineConfig } from '@pandacss/dev';
104
+ import { designSystemStaticCssRecipes } from '@r0hitsharma/design-system';
105
+ import { designSystemPreset } from '@r0hitsharma/design-system/panda-preset';
106
+
107
+ export default defineConfig({
108
+ presets: [designSystemPreset],
109
+ staticCss: {
110
+ recipes: {
111
+ ...designSystemStaticCssRecipes,
112
+ // ...your own recipes with runtime-driven variants
113
+ },
114
+ },
115
+ });
116
+ ```
117
+
118
+ The recipe definitions themselves are available from the root barrel and from the
119
+ `@r0hitsharma/design-system/recipes` subpath. See
120
+ [PANDA_NOTES.md](./PANDA_NOTES.md) for this and the other Panda gotchas that bite
121
+ consumers of the preset.
122
+
123
+ ### Theming and the no-flash bootstrap
124
+
125
+ `ThemeProvider` owns the theme at runtime: it resolves `light` / `dark` / `auto`,
126
+ persists the choice, and keeps `<html>`'s `dark` class and `data-theme` attribute
127
+ in sync.
128
+
129
+ ```typescript
130
+ import { ThemeProvider, useTheme } from '@r0hitsharma/design-system';
131
+ ```
132
+
133
+ Because the provider applies the theme from an effect, it can only run *after*
134
+ React mounts. On a reload with a dark theme stored, the page paints light first
135
+ and then snaps to dark — a visible flash. To remove it, apply the theme before
136
+ first paint with the bootstrap this package ships. It reads the same storage keys
137
+ the provider does, so the two can never disagree.
138
+
139
+ Pick the mode that matches your CSP.
140
+
141
+ **1. Inline (SSR and any app that allows inline scripts).** Render
142
+ `THEME_BOOTSTRAP_SCRIPT` as the first `<script>` in `<head>`, ahead of your
143
+ stylesheets:
144
+
145
+ ```tsx
146
+ import { THEME_BOOTSTRAP_SCRIPT } from '@r0hitsharma/design-system';
147
+
148
+ export function Document() {
149
+ return (
150
+ <html lang="en">
151
+ <head>
152
+ <script>{THEME_BOOTSTRAP_SCRIPT}</script>
153
+ {/* stylesheets after the bootstrap */}
154
+ </head>
155
+ <body>{/* … */}</body>
156
+ </html>
157
+ );
158
+ }
159
+ ```
160
+
161
+ With a strict CSP that allows inline scripts only by nonce, pass yours through:
162
+ `<script nonce={nonce}>{THEME_BOOTSTRAP_SCRIPT}</script>`.
163
+
164
+ **2. Copied file (`script-src 'self'` — no inline scripts allowed).** The same
165
+ code is built to `dist/theme-bootstrap.js` as a plain browser script. Copy it
166
+ into the directory you serve static assets from, as part of your build (under
167
+ the `uikit-cli link` flow this file exists only after the linked checkout has
168
+ run `npm run build` — resolution through the symlink then works as normal):
169
+
170
+ ```jsonc
171
+ // package.json
172
+ {
173
+ "scripts": {
174
+ "prebuild": "cp node_modules/@r0hitsharma/design-system/dist/theme-bootstrap.js public/"
175
+ }
176
+ }
177
+ ```
178
+
179
+ Then load it first in `<head>`:
180
+
181
+ ```html
182
+ <script src="/theme-bootstrap.js"></script>
183
+ ```
184
+
185
+ Copy it on every build rather than committing it — it is generated from
186
+ `src/theme/theme-bootstrap.ts` at package build time, and copying keeps it in
187
+ step with the version you have installed.
188
+
189
+ **3. Neither?** If you can already run code before React renders (a bundled entry
190
+ module, a framework pre-render hook), call the function form instead:
191
+
192
+ ```typescript
193
+ import { applyThemeBootstrap } from '@r0hitsharma/design-system';
194
+
195
+ applyThemeBootstrap();
196
+ ```
197
+
198
+ Or, as the first statement of your entry module, import the built script for its
199
+ side effect — the same code as the copied file in option 2, but bundled with your
200
+ app instead of served separately:
201
+
202
+ ```typescript
203
+ import '@r0hitsharma/design-system/theme-bootstrap.js';
204
+ ```
205
+
206
+ This form is safe from tree-shaking: `dist/theme-bootstrap.js` is the sole entry in
207
+ the package's `sideEffects` list, so bundlers keep it even though the import binds no
208
+ name. Note that it runs when your entry bundle runs, not before the document's
209
+ stylesheets — put it above every other import, and prefer option 1 or 2 if your entry
210
+ bundle is deferred.
211
+
212
+ Every form makes the same decision: a stored `light` / `dark` wins, `auto` (and no
213
+ stored value) resolves against `prefers-color-scheme`, the pre-rename storage key
214
+ is still honoured, and unavailable storage falls back to the system preference
215
+ rather than throwing. When a bootstrap has run, `ThemeProvider` seeds its first
216
+ render from the `data-theme` it stamped, so the pre-paint decision and the
217
+ provider agree. Without one, the provider behaves exactly as before.
218
+
219
+ ### Browse components
220
+
221
+ View available components and their stories at:
222
+ https://r0hitsharma.github.io/uikit/
223
+
224
+ ## Peer dependencies
225
+
226
+ - `react`: React UI library
227
+ - `react-dom`: React DOM rendering
228
+
229
+ ## Key dependencies
230
+
231
+ - `@ark-ui/react`: Unstyled component primitives
232
+ - `@pandacss/dev`: CSS-in-JS styling solution
233
+
234
+ ## See also
235
+
236
+ - [Live component preview](https://r0hitsharma.github.io/uikit/)
237
+ - [Development guide](../../DEVELOPMENT.md#preview-site) for local component development
package/dist/ark.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `@r0hitsharma/design-system/ark` — the Ark UI components this package
3
+ * passes through unstyled, in one place.
4
+ *
5
+ * These are re-exported rather than left to consumers because the
6
+ * `design-system-boundaries` oxlint preset forbids importing `@ark-ui/react`
7
+ * directly, which is also why they need a subpath of their own: bundled
8
+ * together they are ~250 kB minified / ~74 kB gzipped (from ~1.7 kB for
9
+ * `Portal` to ~99 kB for `Menu`), and reaching them only through the root
10
+ * barrel gives a consumer nowhere to put a chunk boundary.
11
+ *
12
+ * Everything here is also re-exported from the root barrel.
13
+ */
14
+ export { Avatar } from '@ark-ui/react/avatar';
15
+ export { Dialog } from '@ark-ui/react/dialog';
16
+ export { Field } from '@ark-ui/react/field';
17
+ export { Menu } from '@ark-ui/react/menu';
18
+ export { Portal } from '@ark-ui/react/portal';
19
+ export { Progress } from '@ark-ui/react/progress';
20
+ export { Slider } from '@ark-ui/react/slider';
21
+ export { Switch } from '@ark-ui/react/switch';
22
+ export { Tabs } from '@ark-ui/react/tabs';
23
+ export { Toggle } from '@ark-ui/react/toggle';
24
+ export { ToggleGroup } from '@ark-ui/react/toggle-group';
25
+ export { Tooltip } from '@ark-ui/react/tooltip';
26
+ export { TreeView, createTreeCollection } from '@ark-ui/react/tree-view';
27
+ export type { TreeCollection, TreeNode } from '@ark-ui/react/tree-view';
28
+ export { useTreeView, type UseTreeViewProps, type UseTreeViewReturn, } from '@ark-ui/react/tree-view';
package/dist/ark.js ADDED
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `@r0hitsharma/design-system/ark` — the Ark UI components this package
3
+ * passes through unstyled, in one place.
4
+ *
5
+ * These are re-exported rather than left to consumers because the
6
+ * `design-system-boundaries` oxlint preset forbids importing `@ark-ui/react`
7
+ * directly, which is also why they need a subpath of their own: bundled
8
+ * together they are ~250 kB minified / ~74 kB gzipped (from ~1.7 kB for
9
+ * `Portal` to ~99 kB for `Menu`), and reaching them only through the root
10
+ * barrel gives a consumer nowhere to put a chunk boundary.
11
+ *
12
+ * Everything here is also re-exported from the root barrel.
13
+ */
14
+ export { Avatar } from '@ark-ui/react/avatar';
15
+ export { Dialog } from '@ark-ui/react/dialog';
16
+ export { Field } from '@ark-ui/react/field';
17
+ export { Menu } from '@ark-ui/react/menu';
18
+ export { Portal } from '@ark-ui/react/portal';
19
+ export { Progress } from '@ark-ui/react/progress';
20
+ export { Slider } from '@ark-ui/react/slider';
21
+ export { Switch } from '@ark-ui/react/switch';
22
+ export { Tabs } from '@ark-ui/react/tabs';
23
+ export { Toggle } from '@ark-ui/react/toggle';
24
+ export { ToggleGroup } from '@ark-ui/react/toggle-group';
25
+ export { Tooltip } from '@ark-ui/react/tooltip';
26
+ export { TreeView, createTreeCollection } from '@ark-ui/react/tree-view';
27
+ export { useTreeView, } from '@ark-ui/react/tree-view';