@eylulg/ui 1.2.0 → 2.0.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 (524) hide show
  1. package/README.md +172 -223
  2. package/dist/components/{Avatar → atoms/Avatar}/Avatar.d.ts +3 -1
  3. package/dist/components/{Avatar → atoms/Avatar}/Avatar.js +4 -4
  4. package/dist/components/atoms/Avatar/Avatar.js.map +1 -0
  5. package/dist/components/{Avatar → atoms/Avatar}/index.d.ts +1 -1
  6. package/dist/components/atoms/Avatar/index.js +2 -0
  7. package/dist/components/{Badge → atoms/Badge}/Badge.d.ts +10 -6
  8. package/dist/components/{Badge → atoms/Badge}/Badge.js +12 -16
  9. package/dist/components/atoms/Badge/Badge.js.map +1 -0
  10. package/dist/components/atoms/Badge/index.d.ts +2 -0
  11. package/dist/components/atoms/BrandLoader/BrandLoader.d.ts +14 -0
  12. package/dist/components/atoms/BrandLoader/BrandLoader.js +57 -0
  13. package/dist/components/atoms/BrandLoader/BrandLoader.js.map +1 -0
  14. package/dist/components/atoms/BrandLoader/index.d.ts +2 -0
  15. package/dist/components/atoms/BrandLoader/index.js +2 -0
  16. package/dist/{chrome → components/atoms/BrandLogo}/BrandLogo.d.ts +1 -1
  17. package/dist/{chrome → components/atoms/BrandLogo}/BrandLogo.js +3 -4
  18. package/dist/components/atoms/BrandLogo/BrandLogo.js.map +1 -0
  19. package/dist/components/atoms/BrandLogo/index.d.ts +2 -0
  20. package/dist/components/atoms/BrandLogo/index.js +1 -0
  21. package/dist/components/{Button → atoms/Button}/Button.d.ts +13 -9
  22. package/dist/components/atoms/Button/Button.js +88 -0
  23. package/dist/components/atoms/Button/Button.js.map +1 -0
  24. package/dist/components/{Button → atoms/Button}/buttonStyles.d.ts +4 -6
  25. package/dist/components/atoms/Button/buttonStyles.js +25 -0
  26. package/dist/components/atoms/Button/buttonStyles.js.map +1 -0
  27. package/dist/components/atoms/Button/index.d.ts +2 -0
  28. package/dist/components/atoms/Button/index.js +4 -0
  29. package/dist/components/{Checkbox → atoms/Checkbox}/Checkbox.js +10 -14
  30. package/dist/components/atoms/Checkbox/Checkbox.js.map +1 -0
  31. package/dist/components/atoms/IconButton/IconButton.d.ts +21 -0
  32. package/dist/components/atoms/IconButton/IconButton.js +43 -0
  33. package/dist/components/atoms/IconButton/IconButton.js.map +1 -0
  34. package/dist/components/{Kbd → atoms/Kbd}/Kbd.d.ts +2 -2
  35. package/dist/components/{Kbd → atoms/Kbd}/Kbd.js +9 -8
  36. package/dist/components/atoms/Kbd/Kbd.js.map +1 -0
  37. package/dist/components/atoms/NavItem/NavItem.d.ts +24 -0
  38. package/dist/components/atoms/NavItem/NavItem.js +42 -0
  39. package/dist/components/atoms/NavItem/NavItem.js.map +1 -0
  40. package/dist/components/atoms/NavItem/index.d.ts +2 -0
  41. package/dist/components/atoms/NavItem/index.js +1 -0
  42. package/dist/components/{ProgressBar → atoms/ProgressBar}/ProgressBar.d.ts +2 -2
  43. package/dist/components/{ProgressBar → atoms/ProgressBar}/ProgressBar.js +6 -5
  44. package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -0
  45. package/dist/components/atoms/ProgressBar/index.d.ts +2 -0
  46. package/dist/components/{Skeleton → atoms/Skeleton}/Skeleton.js +3 -5
  47. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -0
  48. package/dist/components/{Spinner → atoms/Spinner}/Spinner.js +2 -2
  49. package/dist/components/atoms/Spinner/Spinner.js.map +1 -0
  50. package/dist/components/{Switch → atoms/Switch}/Switch.d.ts +3 -3
  51. package/dist/components/atoms/Switch/Switch.js +35 -0
  52. package/dist/components/atoms/Switch/Switch.js.map +1 -0
  53. package/dist/components/atoms/TextLink/TextLink.d.ts +18 -0
  54. package/dist/components/atoms/TextLink/TextLink.js +21 -0
  55. package/dist/components/atoms/TextLink/TextLink.js.map +1 -0
  56. package/dist/components/atoms/TextLink/index.d.ts +2 -0
  57. package/dist/components/atoms/TextLink/index.js +1 -0
  58. package/dist/components/{Tooltip → atoms/Tooltip}/Tooltip.js +4 -4
  59. package/dist/components/atoms/Tooltip/Tooltip.js.map +1 -0
  60. package/dist/components/{Tooltip → atoms/Tooltip}/TooltipOverlay.js +2 -2
  61. package/dist/components/atoms/Tooltip/TooltipOverlay.js.map +1 -0
  62. package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/Breadcrumbs.js +5 -4
  63. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -0
  64. package/dist/components/{Card → molecules/Card}/Card.d.ts +3 -1
  65. package/dist/components/{Card → molecules/Card}/Card.js +21 -13
  66. package/dist/components/molecules/Card/Card.js.map +1 -0
  67. package/dist/components/molecules/Card/index.d.ts +2 -0
  68. package/dist/components/{CodeBlock → molecules/CodeBlock}/CodeBlock.d.ts +7 -5
  69. package/dist/components/{CodeBlock → molecules/CodeBlock}/CodeBlock.js +20 -12
  70. package/dist/components/molecules/CodeBlock/CodeBlock.js.map +1 -0
  71. package/dist/components/{Combobox → molecules/Combobox}/Combobox.d.ts +4 -1
  72. package/dist/components/molecules/Combobox/Combobox.js +91 -0
  73. package/dist/components/molecules/Combobox/Combobox.js.map +1 -0
  74. package/dist/components/{DatePicker → molecules/DatePicker}/DatePicker.d.ts +7 -4
  75. package/dist/components/molecules/DatePicker/DatePicker.js +138 -0
  76. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -0
  77. package/dist/components/molecules/Dialog/Dialog.d.ts +20 -0
  78. package/dist/components/{Dialog → molecules/Dialog}/Dialog.js +7 -7
  79. package/dist/components/molecules/Dialog/Dialog.js.map +1 -0
  80. package/dist/components/molecules/Dialog/DialogOverlay.d.ts +3 -0
  81. package/dist/components/molecules/Dialog/DialogOverlay.js +60 -0
  82. package/dist/components/molecules/Dialog/DialogOverlay.js.map +1 -0
  83. package/dist/components/molecules/Drawer/Drawer.d.ts +21 -0
  84. package/dist/components/{Drawer → molecules/Drawer}/Drawer.js +7 -7
  85. package/dist/components/molecules/Drawer/Drawer.js.map +1 -0
  86. package/dist/components/{Drawer → molecules/Drawer}/DrawerOverlay.d.ts +1 -1
  87. package/dist/components/molecules/Drawer/DrawerOverlay.js +66 -0
  88. package/dist/components/molecules/Drawer/DrawerOverlay.js.map +1 -0
  89. package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenu.d.ts +8 -9
  90. package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenu.js +8 -20
  91. package/dist/components/molecules/DropdownMenu/DropdownMenu.js.map +1 -0
  92. package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenuParts.d.ts +1 -1
  93. package/dist/components/{DropdownMenu → molecules/DropdownMenu}/DropdownMenuParts.js +17 -28
  94. package/dist/components/molecules/DropdownMenu/DropdownMenuParts.js.map +1 -0
  95. package/dist/components/{EmptyState → molecules/EmptyState}/EmptyState.d.ts +3 -4
  96. package/dist/components/{EmptyState → molecules/EmptyState}/EmptyState.js +6 -5
  97. package/dist/components/molecules/EmptyState/EmptyState.js.map +1 -0
  98. package/dist/components/{FileDropZone → molecules/FileDropZone}/FileDropZone.d.ts +1 -1
  99. package/dist/components/{FileDropZone → molecules/FileDropZone}/FileDropZone.js +6 -5
  100. package/dist/components/molecules/FileDropZone/FileDropZone.js.map +1 -0
  101. package/dist/components/{Input → molecules/Input}/Input.d.ts +8 -6
  102. package/dist/components/molecules/Input/Input.js +45 -0
  103. package/dist/components/molecules/Input/Input.js.map +1 -0
  104. package/dist/components/molecules/Input/index.d.ts +2 -0
  105. package/dist/components/{Pagination → molecules/Pagination}/Pagination.d.ts +6 -2
  106. package/dist/components/{Pagination → molecules/Pagination}/Pagination.js +44 -34
  107. package/dist/components/molecules/Pagination/Pagination.js.map +1 -0
  108. package/dist/components/molecules/Pagination/index.d.ts +2 -0
  109. package/dist/components/molecules/Pagination/index.js +2 -0
  110. package/dist/components/{Popover → molecules/Popover}/Popover.d.ts +1 -1
  111. package/dist/components/{Popover → molecules/Popover}/Popover.js +7 -7
  112. package/dist/components/molecules/Popover/Popover.js.map +1 -0
  113. package/dist/components/{Popover → molecules/Popover}/PopoverOverlay.js +5 -4
  114. package/dist/components/molecules/Popover/PopoverOverlay.js.map +1 -0
  115. package/dist/components/molecules/RadioGroup/RadioGroup.js +43 -0
  116. package/dist/components/molecules/RadioGroup/RadioGroup.js.map +1 -0
  117. package/dist/components/{SegmentedControl → molecules/SegmentedControl}/SegmentedControl.d.ts +6 -7
  118. package/dist/components/molecules/SegmentedControl/SegmentedControl.js +71 -0
  119. package/dist/components/molecules/SegmentedControl/SegmentedControl.js.map +1 -0
  120. package/dist/components/molecules/SegmentedControl/index.d.ts +2 -0
  121. package/dist/components/{Select → molecules/Select}/Select.d.ts +4 -1
  122. package/dist/components/molecules/Select/Select.js +58 -0
  123. package/dist/components/molecules/Select/Select.js.map +1 -0
  124. package/dist/components/molecules/Stat/Stat.d.ts +36 -0
  125. package/dist/components/molecules/Stat/Stat.js +85 -0
  126. package/dist/components/molecules/Stat/Stat.js.map +1 -0
  127. package/dist/components/molecules/Stat/index.d.ts +2 -0
  128. package/dist/components/molecules/Stat/index.js +2 -0
  129. package/dist/components/{Tabs → molecules/Tabs}/Tabs.js +5 -5
  130. package/dist/components/molecules/Tabs/Tabs.js.map +1 -0
  131. package/dist/components/molecules/Tag/Tag.js +49 -0
  132. package/dist/components/molecules/Tag/Tag.js.map +1 -0
  133. package/dist/components/{Textarea → molecules/Textarea}/Textarea.d.ts +3 -11
  134. package/dist/components/molecules/Textarea/Textarea.js +29 -0
  135. package/dist/components/molecules/Textarea/Textarea.js.map +1 -0
  136. package/dist/components/molecules/Textarea/index.d.ts +2 -0
  137. package/dist/components/{Toast → molecules/Toast}/Toast.d.ts +12 -8
  138. package/dist/components/{Toast → molecules/Toast}/Toast.js +13 -18
  139. package/dist/components/molecules/Toast/Toast.js.map +1 -0
  140. package/dist/components/molecules/Toast/ToastItem.d.ts +6 -0
  141. package/dist/components/{Toast → molecules/Toast}/ToastItem.js +25 -27
  142. package/dist/components/molecules/Toast/ToastItem.js.map +1 -0
  143. package/dist/components/{Toast → molecules/Toast}/index.d.ts +1 -1
  144. package/dist/components/{Chart → organisms/Chart}/BarChart.d.ts +1 -1
  145. package/dist/components/organisms/Chart/BarChart.js +304 -0
  146. package/dist/components/organisms/Chart/BarChart.js.map +1 -0
  147. package/dist/components/{Chart → organisms/Chart}/ChartFrame.d.ts +2 -2
  148. package/dist/components/{Chart → organisms/Chart}/ChartFrame.js +14 -18
  149. package/dist/components/organisms/Chart/ChartFrame.js.map +1 -0
  150. package/dist/components/{Chart → organisms/Chart}/ChartLegend.d.ts +3 -2
  151. package/dist/components/{Chart → organisms/Chart}/ChartLegend.js +2 -2
  152. package/dist/components/organisms/Chart/ChartLegend.js.map +1 -0
  153. package/dist/components/{Chart → organisms/Chart}/ChartTable.js +8 -12
  154. package/dist/components/organisms/Chart/ChartTable.js.map +1 -0
  155. package/dist/components/{Chart → organisms/Chart}/ChartTooltip.d.ts +3 -2
  156. package/dist/components/{Chart → organisms/Chart}/ChartTooltip.js +3 -3
  157. package/dist/components/organisms/Chart/ChartTooltip.js.map +1 -0
  158. package/dist/components/{Chart → organisms/Chart}/HeatGrid.d.ts +6 -3
  159. package/dist/components/organisms/Chart/HeatGrid.js +235 -0
  160. package/dist/components/organisms/Chart/HeatGrid.js.map +1 -0
  161. package/dist/components/{Chart → organisms/Chart}/LineChart.d.ts +1 -1
  162. package/dist/components/organisms/Chart/LineChart.js +227 -0
  163. package/dist/components/organisms/Chart/LineChart.js.map +1 -0
  164. package/dist/components/organisms/Chart/Sparkline.d.ts +14 -0
  165. package/dist/components/organisms/Chart/Sparkline.js +39 -0
  166. package/dist/components/organisms/Chart/Sparkline.js.map +1 -0
  167. package/dist/components/{Chart → organisms/Chart}/format.d.ts +2 -0
  168. package/dist/components/{Chart → organisms/Chart}/format.js +6 -4
  169. package/dist/components/organisms/Chart/format.js.map +1 -0
  170. package/dist/components/{Chart → organisms/Chart}/geometry.js +1 -1
  171. package/dist/components/organisms/Chart/geometry.js.map +1 -0
  172. package/dist/components/{Chart → organisms/Chart}/index.d.ts +2 -2
  173. package/dist/components/{Chart → organisms/Chart}/index.js +2 -2
  174. package/dist/components/{Chart → organisms/Chart}/interaction.d.ts +10 -6
  175. package/dist/components/{Chart → organisms/Chart}/interaction.js +13 -10
  176. package/dist/components/organisms/Chart/interaction.js.map +1 -0
  177. package/dist/components/{Chart → organisms/Chart}/labels.js +1 -1
  178. package/dist/components/organisms/Chart/labels.js.map +1 -0
  179. package/dist/components/{Chart → organisms/Chart}/scale.js +1 -1
  180. package/dist/components/organisms/Chart/scale.js.map +1 -0
  181. package/dist/components/organisms/Chart/series.d.ts +30 -0
  182. package/dist/components/organisms/Chart/series.js +108 -0
  183. package/dist/components/organisms/Chart/series.js.map +1 -0
  184. package/dist/components/{Chart → organisms/Chart}/summary.js +2 -5
  185. package/dist/components/organisms/Chart/summary.js.map +1 -0
  186. package/dist/components/{Chart → organisms/Chart}/types.d.ts +2 -2
  187. package/dist/components/{Chart → organisms/Chart}/useElementWidth.js +1 -1
  188. package/dist/components/organisms/Chart/useElementWidth.js.map +1 -0
  189. package/dist/components/{CommandPalette → organisms/CommandPalette}/CommandPalette.d.ts +7 -8
  190. package/dist/components/{CommandPalette → organisms/CommandPalette}/CommandPalette.js +4 -10
  191. package/dist/components/organisms/CommandPalette/CommandPalette.js.map +1 -0
  192. package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.d.ts +4 -0
  193. package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.js +150 -0
  194. package/dist/components/organisms/CommandPalette/CommandPaletteOverlay.js.map +1 -0
  195. package/dist/components/{CommandPalette → organisms/CommandPalette}/index.d.ts +1 -1
  196. package/dist/components/{PageHeader → organisms/PageHeader}/PageHeader.js +5 -5
  197. package/dist/components/organisms/PageHeader/PageHeader.js.map +1 -0
  198. package/dist/{chrome → components/organisms/SidebarNav}/SidebarNav.d.ts +1 -1
  199. package/dist/{chrome → components/organisms/SidebarNav}/SidebarNav.js +18 -26
  200. package/dist/components/organisms/SidebarNav/SidebarNav.js.map +1 -0
  201. package/dist/components/organisms/SidebarNav/index.d.ts +2 -0
  202. package/dist/components/organisms/SidebarNav/index.js +2 -0
  203. package/dist/components/organisms/SiteFooter/SiteFooter.d.ts +33 -0
  204. package/dist/components/organisms/SiteFooter/SiteFooter.js +87 -0
  205. package/dist/components/organisms/SiteFooter/SiteFooter.js.map +1 -0
  206. package/dist/components/organisms/SiteFooter/index.d.ts +2 -0
  207. package/dist/components/organisms/SiteFooter/index.js +1 -0
  208. package/dist/components/{Table → organisms/Table}/Table.d.ts +9 -6
  209. package/dist/components/{Table → organisms/Table}/Table.js +36 -23
  210. package/dist/components/organisms/Table/Table.js.map +1 -0
  211. package/dist/components/organisms/ThemeToggle/ThemeToggle.d.ts +36 -0
  212. package/dist/components/organisms/ThemeToggle/ThemeToggle.js +88 -0
  213. package/dist/components/organisms/ThemeToggle/ThemeToggle.js.map +1 -0
  214. package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.d.ts +14 -0
  215. package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.js +50 -0
  216. package/dist/components/organisms/ThemeToggle/ThemeToggleMenu.js.map +1 -0
  217. package/dist/components/organisms/ThemeToggle/index.d.ts +2 -0
  218. package/dist/components/organisms/ThemeToggle/index.js +2 -0
  219. package/dist/components/organisms/ThemeToggle/themeChoices.d.ts +7 -0
  220. package/dist/components/organisms/ThemeToggle/themeChoices.js +17 -0
  221. package/dist/components/organisms/ThemeToggle/themeChoices.js.map +1 -0
  222. package/dist/components/organisms/TopNav/TopNav.d.ts +51 -0
  223. package/dist/components/organisms/TopNav/TopNav.js +148 -0
  224. package/dist/components/organisms/TopNav/TopNav.js.map +1 -0
  225. package/dist/components/organisms/TopNav/index.d.ts +2 -0
  226. package/dist/components/organisms/TopNav/index.js +2 -0
  227. package/dist/{chrome → components/templates/AppShell}/AppShell.d.ts +10 -6
  228. package/dist/{chrome → components/templates/AppShell}/AppShell.js +12 -17
  229. package/dist/components/templates/AppShell/AppShell.js.map +1 -0
  230. package/dist/components/templates/AppShell/index.d.ts +2 -0
  231. package/dist/components/templates/AppShell/index.js +1 -0
  232. package/dist/{chrome → data}/projects.d.ts +13 -6
  233. package/dist/{chrome → data}/projects.js +43 -14
  234. package/dist/data/projects.js.map +1 -0
  235. package/dist/fonts.css +27 -2
  236. package/dist/index.d.ts +56 -38
  237. package/dist/index.js +55 -42
  238. package/dist/internal/Field.d.ts +16 -11
  239. package/dist/internal/Field.js +30 -23
  240. package/dist/internal/Field.js.map +1 -1
  241. package/dist/internal/OverlayParts.d.ts +43 -0
  242. package/dist/internal/OverlayParts.js +43 -0
  243. package/dist/internal/OverlayParts.js.map +1 -0
  244. package/dist/internal/PreloadOnIntent.d.ts +2 -3
  245. package/dist/internal/PreloadOnIntent.js +3 -3
  246. package/dist/internal/PreloadOnIntent.js.map +1 -1
  247. package/dist/{chrome → internal}/brandLogoPath.js +1 -2
  248. package/dist/internal/brandLogoPath.js.map +1 -0
  249. package/dist/internal/button.d.ts +7 -0
  250. package/dist/internal/button.js +19 -0
  251. package/dist/internal/button.js.map +1 -0
  252. package/dist/internal/control.d.ts +32 -0
  253. package/dist/internal/control.js +59 -0
  254. package/dist/internal/control.js.map +1 -0
  255. package/dist/internal/focusRing.d.ts +7 -1
  256. package/dist/internal/focusRing.js +8 -3
  257. package/dist/internal/focusRing.js.map +1 -1
  258. package/dist/internal/layout.d.ts +9 -0
  259. package/dist/internal/layout.js +13 -0
  260. package/dist/internal/layout.js.map +1 -0
  261. package/dist/internal/lazyModule.d.ts +8 -2
  262. package/dist/internal/lazyModule.js +20 -6
  263. package/dist/internal/lazyModule.js.map +1 -1
  264. package/dist/internal/link.d.ts +3 -0
  265. package/dist/internal/link.js +10 -0
  266. package/dist/internal/link.js.map +1 -0
  267. package/dist/internal/listParts.d.ts +12 -0
  268. package/dist/internal/listParts.js +32 -0
  269. package/dist/internal/listParts.js.map +1 -0
  270. package/dist/internal/surfaces.d.ts +11 -5
  271. package/dist/internal/surfaces.js +13 -7
  272. package/dist/internal/surfaces.js.map +1 -1
  273. package/dist/internal/toggle.d.ts +8 -0
  274. package/dist/internal/toggle.js +22 -0
  275. package/dist/internal/toggle.js.map +1 -0
  276. package/dist/internal/types.d.ts +2 -5
  277. package/dist/{chrome → router}/Anchor.js +1 -2
  278. package/dist/{chrome → router}/Anchor.js.map +1 -1
  279. package/dist/{chrome → router}/LinkRouter.js +1 -1
  280. package/dist/{chrome → router}/LinkRouter.js.map +1 -1
  281. package/dist/{chrome → router}/types.d.ts +3 -3
  282. package/dist/styles/themes/variants.d.ts +0 -12
  283. package/dist/styles/themes/variants.js +3 -43
  284. package/dist/styles/themes/variants.js.map +1 -1
  285. package/dist/styles.css +1 -1
  286. package/dist/{chrome → theme}/themeScript.d.ts +2 -5
  287. package/dist/{chrome → theme}/themeScript.js +4 -7
  288. package/dist/theme/themeScript.js.map +1 -0
  289. package/dist/{chrome → theme}/useTheme.js +1 -1
  290. package/dist/theme/useTheme.js.map +1 -0
  291. package/dist/theme.css +87 -56
  292. package/dist/tokens.css +42 -48
  293. package/dist/utils/cx.d.ts +0 -12
  294. package/dist/utils/cx.js +18 -10
  295. package/dist/utils/cx.js.map +1 -1
  296. package/package.json +147 -107
  297. package/dist/chrome/AppShell.js.map +0 -1
  298. package/dist/chrome/BrandLogo.js.map +0 -1
  299. package/dist/chrome/BrandMark.d.ts +0 -12
  300. package/dist/chrome/BrandMark.js +0 -40
  301. package/dist/chrome/BrandMark.js.map +0 -1
  302. package/dist/chrome/MobileMenu.d.ts +0 -19
  303. package/dist/chrome/MobileMenu.js +0 -52
  304. package/dist/chrome/MobileMenu.js.map +0 -1
  305. package/dist/chrome/ProjectSwitcher.d.ts +0 -30
  306. package/dist/chrome/ProjectSwitcher.js +0 -64
  307. package/dist/chrome/ProjectSwitcher.js.map +0 -1
  308. package/dist/chrome/ProjectSwitcherMenu.d.ts +0 -13
  309. package/dist/chrome/ProjectSwitcherMenu.js +0 -50
  310. package/dist/chrome/ProjectSwitcherMenu.js.map +0 -1
  311. package/dist/chrome/SidebarNav.js.map +0 -1
  312. package/dist/chrome/SiteFooter.d.ts +0 -37
  313. package/dist/chrome/SiteFooter.js +0 -105
  314. package/dist/chrome/SiteFooter.js.map +0 -1
  315. package/dist/chrome/TextSizeToggle.d.ts +0 -11
  316. package/dist/chrome/TextSizeToggle.js +0 -38
  317. package/dist/chrome/TextSizeToggle.js.map +0 -1
  318. package/dist/chrome/ThemeToggle.d.ts +0 -26
  319. package/dist/chrome/ThemeToggle.js +0 -100
  320. package/dist/chrome/ThemeToggle.js.map +0 -1
  321. package/dist/chrome/ThemeToggleMenu.d.ts +0 -16
  322. package/dist/chrome/ThemeToggleMenu.js +0 -42
  323. package/dist/chrome/ThemeToggleMenu.js.map +0 -1
  324. package/dist/chrome/TopNav.d.ts +0 -42
  325. package/dist/chrome/TopNav.js +0 -117
  326. package/dist/chrome/TopNav.js.map +0 -1
  327. package/dist/chrome/brandLogoPath.js.map +0 -1
  328. package/dist/chrome/index.d.ts +0 -28
  329. package/dist/chrome/index.js +0 -15
  330. package/dist/chrome/projects.js.map +0 -1
  331. package/dist/chrome/themeChoices.d.ts +0 -6
  332. package/dist/chrome/themeChoices.js +0 -18
  333. package/dist/chrome/themeChoices.js.map +0 -1
  334. package/dist/chrome/themeScript.js.map +0 -1
  335. package/dist/chrome/useTextSize.d.ts +0 -16
  336. package/dist/chrome/useTextSize.js +0 -64
  337. package/dist/chrome/useTextSize.js.map +0 -1
  338. package/dist/chrome/useTheme.js.map +0 -1
  339. package/dist/components/Avatar/Avatar.js.map +0 -1
  340. package/dist/components/Avatar/index.js +0 -2
  341. package/dist/components/Badge/Badge.js.map +0 -1
  342. package/dist/components/Badge/index.d.ts +0 -2
  343. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +0 -1
  344. package/dist/components/Button/Button.js +0 -73
  345. package/dist/components/Button/Button.js.map +0 -1
  346. package/dist/components/Button/buttonStyles.js +0 -32
  347. package/dist/components/Button/buttonStyles.js.map +0 -1
  348. package/dist/components/Button/index.d.ts +0 -2
  349. package/dist/components/Button/index.js +0 -4
  350. package/dist/components/Card/Card.js.map +0 -1
  351. package/dist/components/Card/index.d.ts +0 -2
  352. package/dist/components/Chart/BarChart.js +0 -327
  353. package/dist/components/Chart/BarChart.js.map +0 -1
  354. package/dist/components/Chart/ChartFrame.js.map +0 -1
  355. package/dist/components/Chart/ChartLegend.js.map +0 -1
  356. package/dist/components/Chart/ChartTable.js.map +0 -1
  357. package/dist/components/Chart/ChartTooltip.js.map +0 -1
  358. package/dist/components/Chart/HeatGrid.js +0 -256
  359. package/dist/components/Chart/HeatGrid.js.map +0 -1
  360. package/dist/components/Chart/LineChart.js +0 -248
  361. package/dist/components/Chart/LineChart.js.map +0 -1
  362. package/dist/components/Chart/format.js.map +0 -1
  363. package/dist/components/Chart/geometry.js.map +0 -1
  364. package/dist/components/Chart/interaction.js.map +0 -1
  365. package/dist/components/Chart/labels.js.map +0 -1
  366. package/dist/components/Chart/scale.js.map +0 -1
  367. package/dist/components/Chart/series.d.ts +0 -14
  368. package/dist/components/Chart/series.js +0 -72
  369. package/dist/components/Chart/series.js.map +0 -1
  370. package/dist/components/Chart/summary.js.map +0 -1
  371. package/dist/components/Chart/useElementWidth.js.map +0 -1
  372. package/dist/components/Checkbox/Checkbox.js.map +0 -1
  373. package/dist/components/CodeBlock/CodeBlock.js.map +0 -1
  374. package/dist/components/Combobox/Combobox.js +0 -106
  375. package/dist/components/Combobox/Combobox.js.map +0 -1
  376. package/dist/components/CommandPalette/CommandPalette.js.map +0 -1
  377. package/dist/components/CommandPalette/CommandPaletteOverlay.d.ts +0 -11
  378. package/dist/components/CommandPalette/CommandPaletteOverlay.js +0 -180
  379. package/dist/components/CommandPalette/CommandPaletteOverlay.js.map +0 -1
  380. package/dist/components/DatePicker/DatePicker.js +0 -142
  381. package/dist/components/DatePicker/DatePicker.js.map +0 -1
  382. package/dist/components/Dialog/Dialog.d.ts +0 -37
  383. package/dist/components/Dialog/Dialog.js.map +0 -1
  384. package/dist/components/Dialog/DialogOverlay.d.ts +0 -3
  385. package/dist/components/Dialog/DialogOverlay.js +0 -72
  386. package/dist/components/Dialog/DialogOverlay.js.map +0 -1
  387. package/dist/components/Drawer/Drawer.d.ts +0 -36
  388. package/dist/components/Drawer/Drawer.js.map +0 -1
  389. package/dist/components/Drawer/DrawerOverlay.js +0 -71
  390. package/dist/components/Drawer/DrawerOverlay.js.map +0 -1
  391. package/dist/components/DropdownMenu/DropdownMenu.js.map +0 -1
  392. package/dist/components/DropdownMenu/DropdownMenuParts.js.map +0 -1
  393. package/dist/components/EmptyState/EmptyState.js.map +0 -1
  394. package/dist/components/FileDropZone/FileDropZone.js.map +0 -1
  395. package/dist/components/IconButton/IconButton.d.ts +0 -17
  396. package/dist/components/IconButton/IconButton.js +0 -37
  397. package/dist/components/IconButton/IconButton.js.map +0 -1
  398. package/dist/components/Input/Input.js +0 -43
  399. package/dist/components/Input/Input.js.map +0 -1
  400. package/dist/components/Input/index.d.ts +0 -2
  401. package/dist/components/Kbd/Kbd.js.map +0 -1
  402. package/dist/components/PageHeader/PageHeader.js.map +0 -1
  403. package/dist/components/Pagination/Pagination.js.map +0 -1
  404. package/dist/components/Pagination/index.d.ts +0 -2
  405. package/dist/components/Pagination/index.js +0 -2
  406. package/dist/components/Popover/Popover.js.map +0 -1
  407. package/dist/components/Popover/PopoverOverlay.js.map +0 -1
  408. package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
  409. package/dist/components/ProgressBar/index.d.ts +0 -2
  410. package/dist/components/RadioGroup/RadioGroup.js +0 -46
  411. package/dist/components/RadioGroup/RadioGroup.js.map +0 -1
  412. package/dist/components/SegmentedControl/SegmentedControl.js +0 -55
  413. package/dist/components/SegmentedControl/SegmentedControl.js.map +0 -1
  414. package/dist/components/SegmentedControl/index.d.ts +0 -2
  415. package/dist/components/Select/Select.js +0 -64
  416. package/dist/components/Select/Select.js.map +0 -1
  417. package/dist/components/Skeleton/Skeleton.js.map +0 -1
  418. package/dist/components/Spinner/Spinner.js.map +0 -1
  419. package/dist/components/Stat/Stat.d.ts +0 -49
  420. package/dist/components/Stat/Stat.js +0 -125
  421. package/dist/components/Stat/Stat.js.map +0 -1
  422. package/dist/components/Stat/index.d.ts +0 -2
  423. package/dist/components/Stat/index.js +0 -2
  424. package/dist/components/Switch/Switch.js +0 -39
  425. package/dist/components/Switch/Switch.js.map +0 -1
  426. package/dist/components/Table/Table.js.map +0 -1
  427. package/dist/components/Tabs/Tabs.js.map +0 -1
  428. package/dist/components/Tag/Tag.js +0 -48
  429. package/dist/components/Tag/Tag.js.map +0 -1
  430. package/dist/components/Textarea/Textarea.js +0 -30
  431. package/dist/components/Textarea/Textarea.js.map +0 -1
  432. package/dist/components/Textarea/index.d.ts +0 -2
  433. package/dist/components/Toast/Toast.js.map +0 -1
  434. package/dist/components/Toast/ToastItem.d.ts +0 -6
  435. package/dist/components/Toast/ToastItem.js.map +0 -1
  436. package/dist/components/Tooltip/Tooltip.js.map +0 -1
  437. package/dist/components/Tooltip/TooltipOverlay.js.map +0 -1
  438. package/dist/internal/LazyDialogTrigger.d.ts +0 -8
  439. package/dist/internal/LazyDialogTrigger.js +0 -15
  440. package/dist/internal/LazyDialogTrigger.js.map +0 -1
  441. package/dist/internal/Spinner.d.ts +0 -3
  442. package/dist/internal/Spinner.js +0 -14
  443. package/dist/internal/Spinner.js.map +0 -1
  444. package/dist/internal/useLazyMenuTrigger.d.ts +0 -23
  445. package/dist/internal/useLazyMenuTrigger.js +0 -47
  446. package/dist/internal/useLazyMenuTrigger.js.map +0 -1
  447. package/dist/utils/cxLite.d.ts +0 -12
  448. package/dist/utils/cxLite.js +0 -23
  449. package/dist/utils/cxLite.js.map +0 -1
  450. /package/dist/components/{Badge → atoms/Badge}/index.js +0 -0
  451. /package/dist/components/{Checkbox → atoms/Checkbox}/Checkbox.d.ts +0 -0
  452. /package/dist/components/{Checkbox → atoms/Checkbox}/index.d.ts +0 -0
  453. /package/dist/components/{Checkbox → atoms/Checkbox}/index.js +0 -0
  454. /package/dist/components/{IconButton → atoms/IconButton}/index.d.ts +0 -0
  455. /package/dist/components/{IconButton → atoms/IconButton}/index.js +0 -0
  456. /package/dist/components/{Kbd → atoms/Kbd}/index.d.ts +0 -0
  457. /package/dist/components/{Kbd → atoms/Kbd}/index.js +0 -0
  458. /package/dist/components/{ProgressBar → atoms/ProgressBar}/index.js +0 -0
  459. /package/dist/components/{Skeleton → atoms/Skeleton}/Skeleton.d.ts +0 -0
  460. /package/dist/components/{Skeleton → atoms/Skeleton}/index.d.ts +0 -0
  461. /package/dist/components/{Skeleton → atoms/Skeleton}/index.js +0 -0
  462. /package/dist/components/{Spinner → atoms/Spinner}/Spinner.d.ts +0 -0
  463. /package/dist/components/{Spinner → atoms/Spinner}/index.d.ts +0 -0
  464. /package/dist/components/{Spinner → atoms/Spinner}/index.js +0 -0
  465. /package/dist/components/{Switch → atoms/Switch}/index.d.ts +0 -0
  466. /package/dist/components/{Switch → atoms/Switch}/index.js +0 -0
  467. /package/dist/components/{Tooltip → atoms/Tooltip}/Tooltip.d.ts +0 -0
  468. /package/dist/components/{Tooltip → atoms/Tooltip}/TooltipOverlay.d.ts +0 -0
  469. /package/dist/components/{Tooltip → atoms/Tooltip}/index.d.ts +0 -0
  470. /package/dist/components/{Tooltip → atoms/Tooltip}/index.js +0 -0
  471. /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/Breadcrumbs.d.ts +0 -0
  472. /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/index.d.ts +0 -0
  473. /package/dist/components/{Breadcrumbs → molecules/Breadcrumbs}/index.js +0 -0
  474. /package/dist/components/{Card → molecules/Card}/index.js +0 -0
  475. /package/dist/components/{CodeBlock → molecules/CodeBlock}/index.d.ts +0 -0
  476. /package/dist/components/{CodeBlock → molecules/CodeBlock}/index.js +0 -0
  477. /package/dist/components/{Combobox → molecules/Combobox}/index.d.ts +0 -0
  478. /package/dist/components/{Combobox → molecules/Combobox}/index.js +0 -0
  479. /package/dist/components/{DatePicker → molecules/DatePicker}/index.d.ts +0 -0
  480. /package/dist/components/{DatePicker → molecules/DatePicker}/index.js +0 -0
  481. /package/dist/components/{Dialog → molecules/Dialog}/index.d.ts +0 -0
  482. /package/dist/components/{Dialog → molecules/Dialog}/index.js +0 -0
  483. /package/dist/components/{Drawer → molecules/Drawer}/index.d.ts +0 -0
  484. /package/dist/components/{Drawer → molecules/Drawer}/index.js +0 -0
  485. /package/dist/components/{DropdownMenu → molecules/DropdownMenu}/index.d.ts +0 -0
  486. /package/dist/components/{DropdownMenu → molecules/DropdownMenu}/index.js +0 -0
  487. /package/dist/components/{EmptyState → molecules/EmptyState}/index.d.ts +0 -0
  488. /package/dist/components/{EmptyState → molecules/EmptyState}/index.js +0 -0
  489. /package/dist/components/{FileDropZone → molecules/FileDropZone}/index.d.ts +0 -0
  490. /package/dist/components/{FileDropZone → molecules/FileDropZone}/index.js +0 -0
  491. /package/dist/components/{Input → molecules/Input}/index.js +0 -0
  492. /package/dist/components/{Popover → molecules/Popover}/PopoverOverlay.d.ts +0 -0
  493. /package/dist/components/{Popover → molecules/Popover}/index.d.ts +0 -0
  494. /package/dist/components/{Popover → molecules/Popover}/index.js +0 -0
  495. /package/dist/components/{RadioGroup → molecules/RadioGroup}/RadioGroup.d.ts +0 -0
  496. /package/dist/components/{RadioGroup → molecules/RadioGroup}/index.d.ts +0 -0
  497. /package/dist/components/{RadioGroup → molecules/RadioGroup}/index.js +0 -0
  498. /package/dist/components/{SegmentedControl → molecules/SegmentedControl}/index.js +0 -0
  499. /package/dist/components/{Select → molecules/Select}/index.d.ts +0 -0
  500. /package/dist/components/{Select → molecules/Select}/index.js +0 -0
  501. /package/dist/components/{Tabs → molecules/Tabs}/Tabs.d.ts +0 -0
  502. /package/dist/components/{Tabs → molecules/Tabs}/index.d.ts +0 -0
  503. /package/dist/components/{Tabs → molecules/Tabs}/index.js +0 -0
  504. /package/dist/components/{Tag → molecules/Tag}/Tag.d.ts +0 -0
  505. /package/dist/components/{Tag → molecules/Tag}/index.d.ts +0 -0
  506. /package/dist/components/{Tag → molecules/Tag}/index.js +0 -0
  507. /package/dist/components/{Textarea → molecules/Textarea}/index.js +0 -0
  508. /package/dist/components/{Toast → molecules/Toast}/index.js +0 -0
  509. /package/dist/components/{Chart → organisms/Chart}/ChartTable.d.ts +0 -0
  510. /package/dist/components/{Chart → organisms/Chart}/geometry.d.ts +0 -0
  511. /package/dist/components/{Chart → organisms/Chart}/labels.d.ts +0 -0
  512. /package/dist/components/{Chart → organisms/Chart}/scale.d.ts +0 -0
  513. /package/dist/components/{Chart → organisms/Chart}/summary.d.ts +0 -0
  514. /package/dist/components/{Chart → organisms/Chart}/useElementWidth.d.ts +0 -0
  515. /package/dist/components/{CommandPalette → organisms/CommandPalette}/index.js +0 -0
  516. /package/dist/components/{PageHeader → organisms/PageHeader}/PageHeader.d.ts +0 -0
  517. /package/dist/components/{PageHeader → organisms/PageHeader}/index.d.ts +0 -0
  518. /package/dist/components/{PageHeader → organisms/PageHeader}/index.js +0 -0
  519. /package/dist/components/{Table → organisms/Table}/index.d.ts +0 -0
  520. /package/dist/components/{Table → organisms/Table}/index.js +0 -0
  521. /package/dist/{chrome → internal}/brandLogoPath.d.ts +0 -0
  522. /package/dist/{chrome → router}/Anchor.d.ts +0 -0
  523. /package/dist/{chrome → router}/LinkRouter.d.ts +0 -0
  524. /package/dist/{chrome → theme}/useTheme.d.ts +0 -0
package/README.md CHANGED
@@ -1,37 +1,30 @@
1
1
  # @eylulg/ui
2
2
 
3
3
  [![CI](https://github.com/eylulg/ui/actions/workflows/ci.yml/badge.svg)](https://github.com/eylulg/ui/actions/workflows/ci.yml)
4
- [![Storybook](https://img.shields.io/badge/storybook-live-ff4785)](https://eylulg.github.io/ui/)
5
4
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
6
5
 
7
- The design system for all of [Eylül Güneş](https://github.com/eylulg)'s projects: an accessible
8
- React 19 component library, nine project theme variants on one visual language, and the shared
9
- app chrome (top nav, project switcher, theme toggle, footer) that makes moving between the
10
- projects feel like one product family.
11
-
12
- **Live docs:** https://eylulg.github.io/ui/
13
-
14
- ## Why it is built this way
15
-
16
- - **React Aria Components for behaviour.** Keyboard navigation, focus management, focus trapping,
17
- ARIA wiring and screen reader announcements are the hardest parts of a component library to get
18
- right and the easiest to regress. React Aria has them tested across browsers and assistive
19
- technology, so this library spends its effort on API design and visuals instead of
20
- reimplementing them.
21
- - **Tailwind CSS 4 tokens for theming.** Every colour, radius, shadow and type size is a CSS
22
- variable declared with `@theme`. Components only reference _semantic_ tokens (`text-primary`,
23
- `bg-elevated`, `border-control`), which point at primitive scales (`brand`, `gray`, `success`,
24
- `warning`, `error`). Dark mode and rebranding are a matter of redefining variables, with no
25
- component changes and no runtime cost.
26
- - **Small and tree shakeable.** ESM only, one module per source file, `sideEffects` limited to
27
- CSS, and a dedicated entry point per component. Overlays (menus, dialogs, drawers, popovers, tooltips, the command palette) load on first open, so a route pays for triggers only. A bundle size budget runs in CI; numbers are in [docs/performance.md](./docs/performance.md).
28
- - **One family, nine variants.** Each project imports one variant file that changes
29
- colour only: the brand colour and its scale. Scales are generated in oklch with the
30
- same lightness per step, so contrast is the same in every variant, and a test checks WCAG AA
31
- for every text token in light and dark.
32
- - **Accessibility is tested, not assumed.** Tests cover the behaviour this library adds on top of
33
- React Aria, and every component has an axe audit in both themes. Storybook runs axe on every
34
- story, including colour contrast.
6
+ The component library behind all of [Eylül's projects](https://eylulg.github.io/): React 19
7
+ components built on React Aria Components, Tailwind CSS 4 design tokens, nine theme variants and
8
+ the shared page frame (top nav, sidebar, theme toggle, footer), all organised by atomic level.
9
+
10
+ Storybook: https://eylulg.github.io/ui/
11
+
12
+ ## Decisions
13
+
14
+ - React Aria Components handle behaviour. Keyboard handling, focus and ARIA come from React Aria,
15
+ so this library only adds the API and the styling. It means a `Button` carries about 12 kB gzip
16
+ of React Aria ([performance](./docs/performance.md)).
17
+ - Tailwind 4 tokens handle theming. Components use semantic tokens (`text-primary`,
18
+ `bg-elevated`, `border-control`) that point at colour scales. Dark mode and a new brand colour
19
+ mean redefining variables, not changing components.
20
+ - A variant changes colour only. Each project imports one variant file. Fonts, density, shape
21
+ and spacing are the same everywhere. A test checks WCAG AA for every text token in light and
22
+ dark, in every variant.
23
+ - Overlays load on first open. Menus, dialogs, drawers, popovers, tooltips and the command
24
+ palette fetch their code when the trigger is hovered, focused or pressed. The cost is a short
25
+ wait on a slow first open.
26
+ - Accessibility is tested. Each component has an axe run in light and dark, and Storybook
27
+ runs axe on every story.
35
28
 
36
29
  ## Install
37
30
 
@@ -39,16 +32,13 @@ projects feel like one product family.
39
32
  npm install @eylulg/ui react-aria-components lucide-react
40
33
  ```
41
34
 
42
- `react`, `react-dom` 19 and `lucide-react` are peer dependencies. The fonts (Inter, Manrope,
43
- JetBrains Mono) come with the library. Until the package is on npm, install it from a local checkout with
44
- `npm install ../ui` (a `file:../ui` dependency). The full workflow, including how to keep a single
45
- copy of React with a linked checkout, with Vite and Next.js examples, is in
46
- [docs/consuming.md](./docs/consuming.md).
35
+ `react`, `react-dom` (19) and `lucide-react` are peer dependencies. The fonts (Inter, Manrope,
36
+ JetBrains Mono) ship with the package. [docs/consuming.md](./docs/consuming.md) covers Vite,
37
+ Next.js and linking a local checkout.
47
38
 
48
39
  ## Usage
49
40
 
50
- Pick one styles path. In an app that runs Tailwind 4, import the tokens and a variant into your
51
- own Tailwind entry so they also become utilities in your markup:
41
+ In an app that runs Tailwind 4, import the tokens and one variant into your own Tailwind entry:
52
42
 
53
43
  ```css
54
44
  @import 'tailwindcss';
@@ -57,20 +47,17 @@ own Tailwind entry so they also become utilities in your markup:
57
47
  @source '../node_modules/@eylulg/ui/dist';
58
48
  ```
59
49
 
60
- Without Tailwind, import the compiled stylesheet and a variant once, at the root of the app:
50
+ Without Tailwind, import the compiled stylesheet and a variant once at the root:
61
51
 
62
52
  ```ts
63
53
  import '@eylulg/ui/styles.css';
64
54
  import '@eylulg/ui/themes/workspace.css';
65
55
  ```
66
56
 
67
- An app that styles itself and only wants the design tokens imports `@eylulg/ui/tokens.css` (custom
68
- properties on `:root` and `.dark-mode`, no preflight, no component styles) and a variant. To load
69
- the fonts, import `@eylulg/ui/fonts.css` first. A
70
- browser downloads only the fonts a page uses; without the file every theme names its fonts and
71
- falls back to the system font.
57
+ `@eylulg/ui/tokens.css` is a third option: custom properties only, for apps that style themselves.
58
+ `@eylulg/ui/fonts.css` loads the bundled fonts; without it the themes fall back to the system font.
72
59
 
73
- Then use components from a per component entry point (or the index):
60
+ Import components from a per component entry point or from the index:
74
61
 
75
62
  ```tsx
76
63
  import { Button } from '@eylulg/ui/button';
@@ -92,19 +79,12 @@ export function InviteDialog() {
92
79
  }
93
80
  ```
94
81
 
95
- ### Dark mode
96
-
97
- Dark mode is class based. `ThemeToggle` writes `dark-mode` on `<html>`; the theme also accepts
98
- `dark`, on `<html>` or on any container. Put `themeInitScript` in `<head>` to avoid a flash of the
99
- wrong theme (see [docs/consuming.md](./docs/consuming.md)).
82
+ Dark mode is class based. `ThemeToggle` writes `dark-mode` on `<html>`; `dark` works too, on
83
+ `<html>` or any container. Put `themeInitScript` in `<head>` to avoid a flash of the wrong theme.
100
84
 
101
85
  ## Theme variants
102
86
 
103
- Every variant shares the base theme: the warm frame (sand page and lighter cards in light mode,
104
- warm brown in dark), the shape (14px buttons and inputs, 20px cards, 24px page panels), the
105
- spacing, the fonts (Manrope for headings, Inter for text, JetBrains Mono for code only), the
106
- default text size, the density, the status colours and the semantic tokens. A variant changes
107
- colour only. Import exactly one, after `theme.css`.
87
+ Import exactly one, after `theme.css`.
108
88
 
109
89
  | Variant | Import | Project | Colour | Light | Dark |
110
90
  | ---------------- | -------------------------------------- | --------------------- | ---------- | --------- | --------- |
@@ -118,97 +98,98 @@ colour only. Import exactly one, after `theme.css`.
118
98
  | `sudoku` | `@eylulg/ui/themes/sudoku.css` | Sudoku | Ink | `#293647` | `#c4d2e5` |
119
99
  | `assistant` | `@eylulg/ui/themes/assistant.css` | Assistant Studio | Plum | `#824d85` | `#deb0e0` |
120
100
 
121
- - **Colour.** In light mode the seed is the solid fill and carries white text; the tinted fill is
122
- the seed mixed 24% into warm paper. In dark mode the lighter dark seed is the solid and carries
123
- the page colour as text; the tint is the seed mixed 32% into the dark page. The brand scale
124
- (`--color-brand-25` to `950`) is generated from the seed in oklch with fixed lightness per
125
- step. `npm run themes` regenerates the scales and CSS from `src/styles/themes/variants.ts`.
126
- - **Contrast.** `npm run contrast` (also part of `npm test`) checks every text token at 4.5:1 and
127
- every icon, solid fill, control border, focus ring, logo and chart series at 3:1, on the
128
- card, the page and popovers, in light and dark, for the base theme and every variant.
129
- - **Text size.** Default has a 16px body in every theme, compact a 14px body. `TextSizeToggle`
130
- (or `useTextSize`) lets the visitor switch; the choice is written as `data-ui-text` on `<html>`, remembered, and
131
- applied before first paint by `themeInitScript`.
132
- - **Density.** Components size from `--density-*` through utilities such as `h-control-md`,
133
- `px-control-x`, `py-item-y`, `px-cell-x` and `p-card`. The values are the same in every theme.
134
- - **Live switching.** `@eylulg/ui/themes/all.css` holds every variant under
135
- `[data-ui-variant="<name>"]` only, so a page can switch themes by changing one attribute, or show
136
- several projects side by side. The portfolio's theme picker and Storybook use it.
137
- - **Typed matrix.** `import { variants, variantNames } from '@eylulg/ui/themes'` gives tools the
138
- same data, including seeds and the generated scales.
139
-
140
- ## Overriding the brand
141
-
142
- To change a single decision rather than switch variant, set `--color-brand-seed` and
143
- `--color-brand-seed-dark` after the library CSS, or override one semantic variable such as
144
- `--ui-bg-brand-solid`. Keep the light seed at 4.5:1 or more against white and the dark seed at
145
- 4.5:1 against the dark page.
101
+ - Each variant has one seed per mode. The brand scale (`--color-brand-25` to `950`) is
102
+ generated from it in oklch, with the same lightness at each step. `npm run themes` regenerates
103
+ the CSS from `src/styles/themes/variants.ts`.
104
+ - `npm run contrast` checks text tokens at 4.5:1 and icons, solid fills, control
105
+ borders, focus rings, the logo and chart series at 3:1, in light and dark, for every variant.
106
+ - `@eylulg/ui/themes/all.css` scopes every variant to
107
+ `[data-ui-variant="<name>"]`, so a page can switch variants by changing one attribute.
108
+ - For a typed matrix, `import { variants, variantNames } from '@eylulg/ui/themes'` returns the
109
+ seeds and scales.
110
+ - To change one decision instead of a variant, set `--color-brand-seed` and
111
+ `--color-brand-seed-dark` after the library CSS. Keep the light seed at 4.5:1 against white and
112
+ the dark seed at 4.5:1 against the dark page.
146
113
 
147
114
  ## Components
148
115
 
149
- | Component | Import | Built on (React Aria) | Highlights |
150
- | ----------------------------- | ------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
151
- | `Avatar` | `@eylulg/ui/avatar` | none (static, image fallback) | Image, initials fallback on error (drawn with CSS, so a labelled button's name stays valid), status, sizes, `AvatarGroup` |
152
- | `Badge` | `@eylulg/ui/badge` | none (static) | gray, brand, success, warning, error, blue, purple, pink, orange, indigo (AA in every variant); dot; icon |
153
- | `Breadcrumbs` | `@eylulg/ui/breadcrumbs` | `Breadcrumbs`, `Breadcrumb`, `Link` | Nav landmark, current page, router links |
154
- | `Button` | `@eylulg/ui/button` | `Button`, `Link` | primary, secondary, tertiary, destructive, destructive-outline; sm, md, lg; loading; icons; `href` renders a link; `buttonStyles()`; `ref` |
155
- | `Card` | `@eylulg/ui/card` | `Link`, `Button` | Header, body, footer slots; interactive card as one link or button; `padding="none"` for media; aria props reach the link |
156
- | `Charts` | `@eylulg/ui/chart` | none (SVG, focus hooks only) | `LineChart`, `BarChart`, `HeatGrid`, `ChartLegend`; series colour tokens, tooltip on hover and focus, Show table toggle, arrow keys |
157
- | `Checkbox` | `@eylulg/ui/checkbox` | `Checkbox` | Indeterminate, hint, invalid |
158
- | `CodeBlock` | `@eylulg/ui/code-block` | none (static) | `pre` in the data font, labelled and keyboard scrollable, optional copy button with a status |
159
- | `Combobox` | `@eylulg/ui/combobox` | `ComboBox`, `Popover`, `ListBox` | Async loading, sections, empty state, descriptions |
160
- | `CommandPalette` | `@eylulg/ui/command-palette` | `Autocomplete`, `SearchField`, `Menu`, `Modal` | Search, groups, shortcuts, Cmd or Ctrl+K hook, nested pages (Backspace goes back), `onSearchChange`, `closeOnAction` |
161
- | `DatePicker, DateRangePicker` | `@eylulg/ui/date-picker` | `DatePicker`, `DateRangePicker`, `Calendar`, `RangeCalendar` | Segmented input, calendar popover, hint, error |
162
- | `Dialog` | `@eylulg/ui/dialog` | `Modal`, `Dialog` | Focus trap and restore, `alertdialog` role, three sizes, `headerActions` slot |
163
- | `Drawer` | `@eylulg/ui/drawer` | `ModalOverlay`, `Modal`, `Dialog` | Left, right or bottom sheet; sticky footer; reduced motion |
164
- | `DropdownMenu` | `@eylulg/ui/dropdown-menu` | `MenuTrigger`, `Menu`, `MenuSection`, `SubmenuTrigger` | Sections, checkbox and radio groups, shortcuts, danger items, submenus |
165
- | `EmptyState` | `@eylulg/ui/empty-state` | none (static) | Icon, title, description, actions, two sizes, heading level 1 to 4 |
166
- | `FileDropZone` | `@eylulg/ui/file-drop-zone` | `DropZone`, `FileTrigger` | Drop or pick files, accepted types checked on both paths, `onSelect` and `onReject` |
167
- | `IconButton` | `@eylulg/ui/icon-button` | `Button` | Required `aria-label`, same variants, loading |
168
- | `Input` | `@eylulg/ui/input` | `TextField`, `Input`, `Group` | Label, hint, error, icons, two sizes, `ref` to the input element |
169
- | `Kbd` | `@eylulg/ui/kbd` | none (static) | Single keys or key combinations |
170
- | `PageHeader` | `@eylulg/ui/page-header` | none (static) | Title, description, actions, breadcrumbs, eyebrow and meta slots |
171
- | `Pagination` | `@eylulg/ui/pagination` | none (buttons or links) | Ellipses, sibling count, `getPageHref` for link pagination |
172
- | `Popover` | `@eylulg/ui/popover` | `Popover`, `Dialog` | Non modal panel, optional arrow, title as name |
173
- | `ProgressBar` | `@eylulg/ui/progress-bar` | `ProgressBar` | Tones, sizes, value label, indeterminate |
174
- | `RadioGroup` | `@eylulg/ui/radio-group` | `RadioGroup`, `Radio` | Vertical or horizontal, hint, error |
175
- | `SegmentedControl` | `@eylulg/ui/segmented-control` | `ToggleButtonGroup`, `ToggleButton` | One of a few views (list or board), icons, two sizes, controlled or not |
176
- | `Select` | `@eylulg/ui/select` | `Select`, `Popover`, `ListBox` | Static or dynamic items, typeahead, hint, error, option `description`, `onKeyDown`, `ref` to the trigger |
177
- | `Skeleton` | `@eylulg/ui/skeleton` | none (static) | text, circle, rect; multi line; reduced motion |
178
- | `Spinner` | `@eylulg/ui/spinner` | none (static) | Decorative or announced with a label, three sizes |
179
- | `Stat` | `@eylulg/ui/stat` | none (static) | `dl` semantics, `sm` and `md`, detail line, trend announced in words, `Sparkline` |
180
- | `Switch` | `@eylulg/ui/switch` | `Switch` | Two sizes, hint, `ref` to the input |
181
- | `Table` | `@eylulg/ui/table` | `Table`, `Column`, `Row`, `Cell` | Sortable columns, selection column, sticky header, empty state |
182
- | `Tabs` | `@eylulg/ui/tabs` | `Tabs`, `TabList`, `Tab`, `TabPanel` | Horizontal or vertical |
183
- | `Tag` | `@eylulg/ui/tag` | `TagGroup`, `TagList`, `Tag` | Removable, selectable |
184
- | `Textarea` | `@eylulg/ui/textarea` | `TextField`, `TextArea` | Label, hint, error, optional resize, `font="data"`, `autoCapitalize`, `autoCorrect` |
185
- | `Toast` | `@eylulg/ui/toast` | none (see note) | `ToastProvider` and `useToast`, four variants, `action` button, pause on hover and focus, Escape and focus return |
186
- | `Tooltip` | `@eylulg/ui/tooltip` | `TooltipTrigger`, `Tooltip` | Hover and focus, Escape, four placements |
187
- | `cx` | `@eylulg/ui/cx` | | `tailwind-merge` based class joiner; imports nothing else, so server components can use it |
188
-
189
- Icons come from [`lucide-react`](https://lucide.dev), which is a peer dependency; the library
190
- re-exports none. Components that take an icon accept a component such as `Plus`.
191
-
192
- **A note on Toast.** React Aria's toast API is still exported as `UNSTABLE_`, so Toast is a small
193
- in house implementation: an always present labelled region with a polite live list, and timers
194
- that pause while a toast is hovered or focused. A toast can carry one `action` button, and when a
195
- toast that holds focus closes (action, dismiss button or Escape), focus goes back to the control the
196
- user tabbed in from.
197
-
198
- **A note on Card.** An interactive card (`href` or `onPress`) stretches its title link over the
199
- whole card. Actions in `CardHeader` and `CardFooter` stay separate tab stops above it; a control
200
- inside `CardBody` needs `relative z-10` to be clickable.
116
+ | Component | Import | Notes |
117
+ | ----------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------- |
118
+ | `Avatar` | `@eylulg/ui/avatar` | Image with initials fallback, status, sizes, `AvatarGroup` |
119
+ | `Badge` | `@eylulg/ui/badge` | Nine tones, dot, icon |
120
+ | `Breadcrumbs` | `@eylulg/ui/breadcrumbs` | Current page, router links |
121
+ | `Button` | `@eylulg/ui/button` | Five variants, three sizes, loading, icons, renders a link with `href`, `buttonStyles()` |
122
+ | `Card` | `@eylulg/ui/card` | Header, body and footer slots, interactive card as one link or button |
123
+ | `Charts` | `@eylulg/ui/chart` | `LineChart`, `BarChart`, `HeatGrid`, `Sparkline` in plain SVG (see below) |
124
+ | `Checkbox` | `@eylulg/ui/checkbox` | Indeterminate, hint, invalid |
125
+ | `CodeBlock` | `@eylulg/ui/code-block` | Labelled, keyboard scrollable, optional copy button |
126
+ | `Combobox` | `@eylulg/ui/combobox` | Async loading, sections, empty state |
127
+ | `CommandPalette` | `@eylulg/ui/command-palette` | Search, groups, shortcuts, `useCommandPaletteShortcut`, nested pages |
128
+ | `DatePicker, DateRangePicker` | `@eylulg/ui/date-picker` | Segmented input, calendar popover |
129
+ | `Dialog` | `@eylulg/ui/dialog` | Focus trap and restore, `alertdialog` role, three sizes |
130
+ | `Drawer` | `@eylulg/ui/drawer` | Left, right or bottom sheet |
131
+ | `DropdownMenu` | `@eylulg/ui/dropdown-menu` | Sections, checkbox and radio items, shortcuts, submenus |
132
+ | `EmptyState` | `@eylulg/ui/empty-state` | Icon, title, description, actions |
133
+ | `FileDropZone` | `@eylulg/ui/file-drop-zone` | Drop or pick files, accepted types checked on both paths |
134
+ | `IconButton` | `@eylulg/ui/icon-button` | Takes an icon element; `aria-label` is required outside a React Aria slot |
135
+ | `Input` | `@eylulg/ui/input` | Label, hint, error, icons |
136
+ | `Kbd` | `@eylulg/ui/kbd` | Keys and key combinations |
137
+ | `PageHeader` | `@eylulg/ui/page-header` | Title, description, actions, breadcrumbs |
138
+ | `Pagination` | `@eylulg/ui/pagination` | Buttons, or links with `getPageHref` |
139
+ | `Popover` | `@eylulg/ui/popover` | Non modal panel |
140
+ | `ProgressBar` | `@eylulg/ui/progress-bar` | Tones, value label, indeterminate |
141
+ | `RadioGroup` | `@eylulg/ui/radio-group` | Vertical or horizontal |
142
+ | `SegmentedControl` | `@eylulg/ui/segmented-control` | One of a few views, icons |
143
+ | `Select` | `@eylulg/ui/select` | Static or dynamic items, typeahead, option descriptions |
144
+ | `Skeleton` | `@eylulg/ui/skeleton` | Text, circle and rectangle |
145
+ | `Spinner` | `@eylulg/ui/spinner` | Decorative, or announced with a label |
146
+ | `Stat` | `@eylulg/ui/stat` | Label, value, detail line and a trend announced in words; put it in a `Card` |
147
+ | `Switch` | `@eylulg/ui/switch` | Two sizes, hint |
148
+ | `Table` | `@eylulg/ui/table` | Sortable columns, row selection, sticky header, empty state |
149
+ | `Tabs` | `@eylulg/ui/tabs` | Horizontal or vertical |
150
+ | `Tag` | `@eylulg/ui/tag` | Removable, selectable |
151
+ | `Textarea` | `@eylulg/ui/textarea` | Label, hint, error, optional resize |
152
+ | `Toast` | `@eylulg/ui/toast` | `ToastProvider` and `useToast`, five tones, one `action` button |
153
+ | `Tooltip` | `@eylulg/ui/tooltip` | Hover and focus, Escape, four placements |
154
+ | `cx` | `@eylulg/ui/cx` | Class joiner that resolves Tailwind conflicts with tailwind-merge |
155
+
156
+ Icons come from `lucide-react`, a peer dependency. Every icon prop takes an element, for example
157
+ `icon={<Plus />}`, so it works from a Next.js server component. The library re-exports none.
158
+
159
+ **API conventions.**
160
+
161
+ - Semantic colour is one prop, `tone`. Its values are `neutral`, `brand`, `success`, `warning` or `error`. Badge
162
+ adds the categorical hues `blue`, `purple`, `pink` and `indigo`. `Badge`, `ProgressBar` and
163
+ `Toast` take it; `DropdownMenuItem` takes `isDestructive`.
164
+ - Booleans read as `isX`, `allowsX` or `shouldX`. Examples are `CodeBlock` `allowsCopy`, `Textarea`
165
+ `allowsResize`, `Kbd` `isDecorative`, `CommandPalette` `shouldCloseOnAction`.
166
+ - `label` is visible text. An accessible name is `aria-label` (`CodeBlock`, `ToastProvider`,
167
+ `CommandPalette`, `ThemeToggle`).
168
+ - Built-in English text is one flat prop per part with an English default. `ThemeToggle`
169
+ has `lightLabel`, `darkLabel`, `systemLabel`; `TopNav` `portfolioLabel`, `openMenuLabel`,
170
+ `closeMenuLabel`; `ToastProvider` `dismissLabel`; `Pagination` `previousLabel`, `nextLabel`,
171
+ `pageLabel(page)`; `Stat` `upLabel`, `downLabel`, `neutralLabel`. `Chart` keeps one `labels`
172
+ object. Buttons inside React Aria's `Combobox`, `Tag` and `DatePicker` are named in the user's
173
+ language by React Aria.
174
+ - `ControlSize` (`sm`, `md`, `lg`) is the one size type for buttons, fields and segmented controls.
175
+ - `TextLink` and `NavItem` take `target`, `rel`, `aria-label` and `title`. With `target='_blank'`
176
+ and no `rel`, `rel` is `noreferrer`.
177
+ - `@eylulg/ui/brand-logo-path` exports the logo outline as a string, with no framework code.
178
+
179
+ **Toast.** React Aria's toast API is still exported as `UNSTABLE_`, so Toast is built in this
180
+ library. It is a labelled region with a polite live list. Timers pause while a toast is hovered or
181
+ focused. When a toast that holds focus closes, focus returns to the control you came from.
182
+
183
+ **Card.** An interactive card (`href` or `onPress`) stretches its title link over the whole card.
184
+ Actions in `CardHeader` and `CardFooter` stay separate tab stops. A control inside `CardBody`
185
+ needs `relative z-10` to be clickable.
201
186
 
202
187
  ## Charts
203
188
 
204
- `@eylulg/ui/chart` draws charts with plain SVG and no chart library. `LineChart` takes one or more
205
- series over dates, numbers or names. `BarChart` is vertical or horizontal, grouped or stacked.
206
- `HeatGrid` is a matrix of rows by columns, either states such as pass and fail (a fill and a
207
- distinct icon per state) or numbers (five shades of one hue). `ChartLegend` is the legend the
208
- charts use, exported for your own layouts.
189
+ `@eylulg/ui/chart` draws with plain SVG and has no chart library behind it.
209
190
 
210
191
  ```tsx
211
- import { HeatGrid, LineChart } from '@eylulg/ui/chart';
192
+ import { LineChart } from '@eylulg/ui/chart';
212
193
 
213
194
  <LineChart
214
195
  title='Requests per day'
@@ -219,110 +200,78 @@ import { HeatGrid, LineChart } from '@eylulg/ui/chart';
219
200
  ]}
220
201
  locale='en-GB'
221
202
  />;
222
-
223
- <HeatGrid
224
- title='Checks by case'
225
- rowLabel='Case'
226
- rows={[{ id: 'refund', label: 'Refund request' }]}
227
- columns={[{ id: 'cites', label: 'Cites source' }]}
228
- states={{
229
- pass: { label: 'Pass', tone: 'success' },
230
- fail: { label: 'Fail', tone: 'error' },
231
- }}
232
- cells={[{ row: 'refund', column: 'cites', state: 'fail', detail: 'No source cited.' }]}
233
- />;
234
203
  ```
235
204
 
236
- - **Colour.** `--ui-chart-1` to `--ui-chart-6` are the series colours, the same hues in every
237
- variant and tuned separately for light and dark. `npm run contrast` checks each at 3:1 or more
238
- against every surface of every variant and keeps every pair of series apart under colour
239
- vision deficiency. A series keeps its colour by `colorIndex`, not by its rank. Past six series the rest
240
- share a muted colour and differ by marker shape and dash.
241
- - **Keyboard and screen readers.** Each chart is a named figure with a generated summary. Tab
242
- enters the plot once; arrow keys, Home and End move between points, bars or cells; Escape closes
243
- the tooltip. Every point reads out its values, and the data is also a real table behind a
244
- "Show table" button.
245
- - **Layout.** Charts fill their container, follow it with a ResizeObserver and stay readable at
246
- 320 px. Axis ticks thin out as space runs short. Numbers and dates go through `Intl` with the
247
- `locale` prop.
248
-
249
- ## App chrome
250
-
251
- `@eylulg/ui/chrome` holds the parts every project shares:
252
-
253
- | Export | What it does | Server safe |
254
- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
255
- | `AppShell` | Skip link, header, optional sidebar, main landmark, footer; 16px gutter at 375px; `maxWidth` and `contentClassName` | yes |
256
- | `TopNav` | Logo and product name, links via any `LinkComponent`, `center`, `actions` and `compactActions` slots, `labels`, mobile menu in a Drawer that loads on first press | client |
257
- | `SidebarNav` | Sections, icons, collapsible groups, an optional action per item, arrow keys, Home and End, `aria-current` | client |
258
- | `ThemeToggle` | Light, dark and system, or one icon button with `compact`; `labels`; writes `dark-mode` on `<html>`; persists in localStorage | client |
259
- | `useTheme` | `{ theme, resolved, setTheme }` for a command palette or settings page; guards `matchMedia` | client |
260
- | `themeInitScript` | Inline `<head>` script that applies the stored theme before first paint (also `@eylulg/ui/theme-script`) | yes |
261
- | `ProjectSwitcher` | DropdownMenu of the projects, current one marked | client |
262
- | `SiteFooter` | "Part of Eylül Güneş's projects", a Live and a Code group of projects, GitHub, LinkedIn, Built with @eylulg/ui; `labels`, `children` for attributions | yes |
263
- | `BrandLogo` | The EG horse logo in the brand green in every theme, a thinner outline at 48px and below. The default brand of TopNav and SiteFooter | yes |
264
- | `BrandMark` | The "eg" monogram, filled with the active brand colour. Kept for compatibility | yes |
265
-
266
- The project list lives in `@eylulg/ui/projects` (`id`, `name`, `description`, `url`,
267
- `plannedUrl`, `variant`, `repoUrl`). Projects without a deployment have `url: null` and a
268
- Vercel style `plannedUrl` placeholder, and link to their repository until they go live. **These
269
- URLs change when the custom domain arrives.** Pass `projects` to `ProjectSwitcher` or
270
- `SiteFooter` to override the list.
271
-
272
- Every chrome part takes a `labels` object for translation, and `useTheme()` lets the app set the
273
- theme from code. `TopNav` loads its mobile menu on first press, so a page that never opens it pays
274
- about 1.6 kB gzip for the bar. In Next.js, server components can import the server safe parts directly. Render `TopNav` from a
275
- small `'use client'` file when you pass `next/link` as `LinkComponent`, because a server component
276
- cannot pass a function to a client component. See [docs/consuming.md](./docs/consuming.md).
205
+ - Series colours are `--ui-chart-1` to `--ui-chart-6`. They are the same in every variant and
206
+ checked at 3:1 against every surface. Past six series, the rest share a muted colour and differ
207
+ by marker shape and dash.
208
+ - Each chart is a named figure with a generated summary. Tab enters the plot once, arrow keys,
209
+ Home and End move between points, and Escape closes the tooltip. The data is also a table behind
210
+ a "Show table" button.
211
+ - Charts take the width of their container. Numbers and dates go through `Intl` with `locale`.
212
+
213
+ ## Page frame
214
+
215
+ The parts every project's pages share are ordinary components on their atomic level, each with its
216
+ own entry point.
217
+
218
+ | Export | Level | What it does | Server safe |
219
+ | ----------------- | -------- | -------------------------------------------------------------------------------------------------- | ----------- |
220
+ | `AppShell` | Template | Skip link, header, optional sidebar, main landmark, footer; `width` and `contentClassName` | yes |
221
+ | `TopNav` | Organism | Logo and product name, `NavItem` links, `center`, `actions`, `mobileActions`, `width`, mobile menu | no |
222
+ | `SidebarNav` | Organism | `NavItem` sections, collapsible groups, an optional action per item, arrow keys | no |
223
+ | `SiteFooter` | Organism | A next project card, a back link and quiet links; `width` and `children` | yes |
224
+ | `ThemeToggle` | Organism | Light, dark and system as a `SegmentedControl`, or `variant="menu"`; controlled or `useTheme` | no |
225
+ | `NavItem` | Atom | One navigation link with `isCurrent`, icon and badge | yes |
226
+ | `TextLink` | Atom | A text link, `inline` or `quiet` | yes |
227
+ | `BrandLogo` | Atom | The EG horse logo, in the brand green in every theme. Default logo of `TopNav` | yes |
228
+ | `BrandLoader` | Atom | The animated logo for page transitions | no |
229
+ | `useTheme` | Hook | `{ theme, resolved, setTheme }` for a command palette or settings page | no |
230
+ | `themeInitScript` | Script | Inline script for the document head that applies the stored theme before first paint | yes |
231
+
232
+ The project list is data, not a component: `@eylulg/ui/projects` exports `projects`,
233
+ `nextProject(currentId)`, `allProjectsLink` and `profileNavLinks`, so a footer is one line:
234
+
235
+ ```tsx
236
+ <SiteFooter next={nextProject('workspace')} backLink={allProjectsLink} links={profileNavLinks} />
237
+ ```
277
238
 
278
239
  ## Development
279
240
 
280
241
  ```bash
281
242
  npm install
282
- npm run storybook # docs and playground on http://localhost:6006
243
+ npm run storybook # http://localhost:6006
283
244
  npm test # Vitest, Testing Library, vitest-axe, theme contrast check
284
- npm run typecheck
285
- npm run lint # ESLint with jsx-a11y and import order, zero warnings
286
- npm run format:check
245
+ npm run typecheck && npm run lint && npm run format:check
287
246
  npm run knip # unused files, exports and dependencies
288
- npm run build # dist/ with ESM, type declarations, styles.css and theme files
247
+ npm run build # dist/ with ESM, types, styles.css and theme files
289
248
  npm run size # bundle size budget
290
- npm run build-storybook # static Storybook in storybook-static/
291
- npm run themes # regenerate variant scales and CSS from variants.ts
292
- npm run contrast # print the contrast report for every variant
293
249
  ```
294
250
 
295
251
  ## Contributing
296
252
 
297
- These rules follow the shared engineering standards for all of Eylül's projects.
298
-
299
- 1. **Conventional Commits are required** and checked by commitlint in a Husky `commit-msg` hook
300
- and in CI, because semantic-release reads them to choose the next version.
301
- - `fix(button): keep width while loading` releases a patch.
302
- - `feat(select): support sections` releases a minor.
303
- - A `BREAKING CHANGE:` footer, or `!` after the type, releases a major.
304
- - `docs`, `test`, `chore`, `refactor`, `build` and `ci` do not release.
305
- 2. **One folder per component** in `src/components/<Name>/`: `<Name>.tsx`, `<Name>.stories.tsx`,
306
- `index.ts` and `__tests__/<Name>.test.tsx`. Add the name to `scripts/components.ts`, export it
307
- from `src/index.ts` and add an entry to `exports` in `package.json`. Shared test helpers live in
308
- `src/test-utils/`.
309
- 3. **Only tests worth having.** Test behaviour this library adds over React Aria (states, rules,
310
- focus placement, logic), one behaviour per test, states folded into `it.each`, queries by role
311
- and name. One `expectNoA11yViolations` run per component covers light and dark. No class name,
312
- DOM structure or pass-through tests.
313
- 4. **One story per variant**, so the a11y panel and visual review cover each of them.
314
- 5. **Only tokens in components.** Semantic colours (`text-primary`, not `text-gray-900`), radius
315
- utilities and density utilities, so every theme variant keeps working.
316
- 6. A pre-commit hook runs ESLint and Prettier on staged files. CI runs typecheck, lint, format,
317
- knip, commitlint, tests, both builds, the size budget and a gitleaks secret scan. Dependabot
318
- opens grouped updates monthly.
253
+ 1. Commits follow Conventional Commits. commitlint checks them in a Husky hook and in CI, and
254
+ semantic-release reads them to pick the version.
255
+ 2. A component lives in `src/components/<level>/<Name>/` (atoms, molecules, organisms or
256
+ templates) with `<Name>.tsx`, `<Name>.stories.tsx`, `index.ts` and `__tests__/<Name>.test.tsx`,
257
+ and is built only from the levels below it. Add its name under its level in
258
+ `scripts/components.ts`, export it from `src/index.ts` and add an entry to `exports` in
259
+ `package.json` (a test checks the last two agree).
260
+ 3. Nothing is one off. A control is a `Button`, `IconButton`, `NavItem` or `TextLink` shaped by its
261
+ props; fields take their box from `fieldStyles` and every control its height from the control
262
+ scale (`sm` 32px, `md` 40px, `lg` 48px).
263
+ 4. Tests cover behaviour this library adds over React Aria: states, rules, focus placement, logic.
264
+ One behaviour per test, queries by role and name, one axe run per component.
265
+ 5. Components use semantic tokens only (`text-primary`, not `text-gray-900`), so every variant
266
+ keeps working.
267
+ 6. CI runs typecheck, lint, format, knip, commitlint, tests, both builds, the size budget and a
268
+ gitleaks scan. Dependabot opens grouped updates monthly.
319
269
 
320
270
  ## Releases
321
271
 
322
- Pushing to `main` runs `.github/workflows/release.yml`. semantic-release analyses the commits since
323
- the last tag, publishes to npm with provenance, creates a GitHub release, and commits the updated
324
- `CHANGELOG.md` and version back to `main`. The workflow needs an `NPM_TOKEN` repository secret; until
325
- it is added the job skips the release step with a notice and nothing is published.
272
+ semantic-release runs on pushes to `main`: it tags, publishes to npm with provenance, creates a
273
+ GitHub release and updates `CHANGELOG.md`. The latest version on npm is 1.2.0. Releases are paused
274
+ for now.
326
275
 
327
276
  ## License
328
277
 
@@ -33,7 +33,9 @@ export interface AvatarGroupProps {
33
33
  max?: number;
34
34
  /** Size of the "+N" counter. Match it to the avatars. */
35
35
  size?: AvatarSize;
36
+ /** Accessible name of the "+N" counter. */
37
+ moreLabel?: (count: number) => string;
36
38
  className?: string;
37
39
  }
38
40
  /** Overlapping avatars with a "+N" counter for the rest. */
39
- export declare function AvatarGroup({ children, 'aria-label': ariaLabel, max, size, className, }: AvatarGroupProps): import("react").JSX.Element;
41
+ export declare function AvatarGroup({ children, 'aria-label': ariaLabel, max, size, moreLabel, className, }: AvatarGroupProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cx } from "../../utils/cx.js";
2
+ import { cx } from "../../../utils/cx.js";
3
3
  import { Children, useState } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- // src/components/Avatar/Avatar.tsx
5
+ // src/components/atoms/Avatar/Avatar.tsx
6
6
  var sizes = {
7
7
  xs: {
8
8
  avatar: "size-6 text-xs",
@@ -101,7 +101,7 @@ function Avatar({ name, src, size = "md", status, statusLabel, className }) {
101
101
  });
102
102
  }
103
103
  /** Overlapping avatars with a "+N" counter for the rest. */
104
- function AvatarGroup({ children, "aria-label": ariaLabel, max = 4, size = "md", className }) {
104
+ function AvatarGroup({ children, "aria-label": ariaLabel, max = 4, size = "md", moreLabel = (count) => `${count} more`, className }) {
105
105
  const items = Children.toArray(children);
106
106
  const visible = items.slice(0, max);
107
107
  const hidden = items.length - visible.length;
@@ -111,7 +111,7 @@ function AvatarGroup({ children, "aria-label": ariaLabel, max = 4, size = "md",
111
111
  className: cx("flex -space-x-2", className),
112
112
  children: [visible, hidden > 0 && /* @__PURE__ */ jsx("span", {
113
113
  role: "img",
114
- "aria-label": `${hidden} more`,
114
+ "aria-label": moreLabel(hidden),
115
115
  "data-initials": `+${hidden}`,
116
116
  className: cx(surface, initialsText, "bg-tertiary text-secondary", sizes[size].avatar)
117
117
  })]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","names":["_Fragment"],"sources":["../../../../src/components/atoms/Avatar/Avatar.tsx"],"sourcesContent":["import { Children, useState, type ReactNode } from 'react';\nimport { cx } from '../../../utils/cx';\n\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type AvatarStatus = 'online' | 'away' | 'busy' | 'offline';\n\nexport interface AvatarProps {\n /** Full name. Used as the accessible name and for the initials fallback. */\n name: string;\n /** Image URL. Falls back to initials when missing or when it fails to load. */\n src?: string;\n size?: AvatarSize;\n /** Presence dot in the corner, announced as text. */\n status?: AvatarStatus;\n /** Overrides the announced status text, for example \"Online since 9:00\". */\n statusLabel?: string;\n className?: string;\n}\n\nconst sizes: Record<AvatarSize, { avatar: string; dot: string }> = {\n xs: { avatar: 'size-6 text-xs', dot: 'size-1.5' },\n sm: { avatar: 'size-8 text-xs', dot: 'size-2' },\n md: { avatar: 'size-10 text-sm', dot: 'size-2.5' },\n lg: { avatar: 'size-12 text-md', dot: 'size-3' },\n xl: { avatar: 'size-14 text-lg', dot: 'size-3.5' },\n};\n\nconst statuses: Record<AvatarStatus, { dot: string; label: string }> = {\n online: { dot: 'bg-fg-success', label: 'Online' },\n away: { dot: 'bg-fg-warning', label: 'Away' },\n busy: { dot: 'bg-fg-error', label: 'Busy' },\n offline: { dot: 'bg-fg-tertiary', label: 'Offline' },\n};\n\nconst surface =\n 'inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-brand-subtle font-semibold text-brand ring-1 ring-default select-none';\n\n/**\n * Initials are drawn from a data attribute through CSS, not rendered as text.\n * An avatar inside a labelled button would otherwise add visible text the\n * button's accessible name does not contain (axe label-content-name-mismatch).\n */\nconst initialsText = 'after:content-[attr(data-initials)]';\n\nconst dotBase =\n 'absolute right-0 bottom-0 rounded-full outline-2 outline-(--ui-bg-primary) outline-solid';\n\n/**\n * Up to two initials from a name: the first letter of the first and last\n * words, or the first letter of a single name. Extra whitespace is ignored and\n * letters outside the Basic Multilingual Plane stay whole.\n */\nexport function getInitials(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n const first = words[0];\n if (!first) return '';\n const last = words.length > 1 ? words[words.length - 1] : undefined;\n const letters = [first, last].map((word) => (word ? (Array.from(word)[0] ?? '') : ''));\n return letters.join('').toLocaleUpperCase();\n}\n\nfunction AvatarImage({ name, src, sizeClass }: { name: string; src?: string; sizeClass: string }) {\n const [failed, setFailed] = useState(false);\n\n function handleError() {\n setFailed(true);\n }\n\n if (!src || failed) {\n return (\n <span\n role='img'\n aria-label={name}\n data-initials={getInitials(name)}\n className={cx(surface, initialsText, sizeClass)}\n />\n );\n }\n return (\n <img\n src={src}\n alt={name}\n onError={handleError}\n className={cx(surface, 'object-cover', sizeClass)}\n />\n );\n}\n\n/**\n * A person's picture, with an initials fallback when there is no image or it\n * fails to load. The name is always the accessible name.\n */\nexport function Avatar({ name, src, size = 'md', status, statusLabel, className }: AvatarProps) {\n return (\n <span className={cx('relative inline-flex shrink-0', className)}>\n <AvatarImage key={src} name={name} src={src} sizeClass={sizes[size].avatar} />\n {status && (\n <>\n <span aria-hidden='true' className={cx(dotBase, statuses[status].dot, sizes[size].dot)} />\n <span className='sr-only'>{statusLabel ?? statuses[status].label}</span>\n </>\n )}\n </span>\n );\n}\n\nexport interface AvatarGroupProps {\n /** Avatar elements. */\n children: ReactNode;\n /** Accessible name of the group, such as \"Reviewers\". */\n 'aria-label': string;\n /** Maximum avatars shown before a \"+N\" counter. */\n max?: number;\n /** Size of the \"+N\" counter. Match it to the avatars. */\n size?: AvatarSize;\n /** Accessible name of the \"+N\" counter. */\n moreLabel?: (count: number) => string;\n className?: string;\n}\n\n/** Overlapping avatars with a \"+N\" counter for the rest. */\nexport function AvatarGroup({\n children,\n 'aria-label': ariaLabel,\n max = 4,\n size = 'md',\n moreLabel = (count) => `${count} more`,\n className,\n}: AvatarGroupProps) {\n const items = Children.toArray(children);\n const visible = items.slice(0, max);\n const hidden = items.length - visible.length;\n return (\n <div role='group' aria-label={ariaLabel} className={cx('flex -space-x-2', className)}>\n {visible}\n {hidden > 0 && (\n <span\n role='img'\n aria-label={moreLabel(hidden)}\n data-initials={`+${hidden}`}\n className={cx(surface, initialsText, 'bg-tertiary text-secondary', sizes[size].avatar)}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAmBA,IAAM,QAA6D;CACjE,IAAI;EAAE,QAAQ;EAAkB,KAAK;CAAW;CAChD,IAAI;EAAE,QAAQ;EAAkB,KAAK;CAAS;CAC9C,IAAI;EAAE,QAAQ;EAAmB,KAAK;CAAW;CACjD,IAAI;EAAE,QAAQ;EAAmB,KAAK;CAAS;CAC/C,IAAI;EAAE,QAAQ;EAAmB,KAAK;CAAW;AACnD;AAEA,IAAM,WAAiE;CACrE,QAAQ;EAAE,KAAK;EAAiB,OAAO;CAAS;CAChD,MAAM;EAAE,KAAK;EAAiB,OAAO;CAAO;CAC5C,MAAM;EAAE,KAAK;EAAe,OAAO;CAAO;CAC1C,SAAS;EAAE,KAAK;EAAkB,OAAO;CAAU;AACrD;AAEA,IAAM,UACJ;;;;;;AAOF,IAAM,eAAe;AAErB,IAAM,UACJ;;;;;;AAOF,SAAgB,YAAY,MAAsB;CAChD,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CACrD,MAAM,QAAQ,MAAM;CACpB,IAAI,CAAC,OAAO,OAAO;CAGnB,OADgB,CAAC,OADJ,MAAM,SAAS,IAAI,MAAM,MAAM,SAAS,KAAK,KAAA,CAC9B,CAAC,CAAC,KAAK,SAAU,OAAQ,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,KAAM,EAC3E,CAAA,CAAQ,KAAK,EAAE,CAAC,CAAC,kBAAkB;AAC5C;AAEA,SAAS,YAAY,EAAE,MAAM,KAAK,aAAgE;CAChG,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAE1C,SAAS,cAAc;EACrB,UAAU,IAAI;CAChB;CAEA,IAAI,CAAC,OAAO,QACV,OACE,oBAAC,QAAD;EACE,MAAK;EACL,cAAY;EACZ,iBAAe,YAAY,IAAI;EAC/B,WAAW,GAAG,SAAS,cAAc,SAAS;CAC/C,CAAA;CAGL,OACE,oBAAC,OAAD;EACO;EACL,KAAK;EACL,SAAS;EACT,WAAW,GAAG,SAAS,gBAAgB,SAAS;CACjD,CAAA;AAEL;;;;;AAMA,SAAgB,OAAO,EAAE,MAAM,KAAK,OAAO,MAAM,QAAQ,aAAa,aAA0B;CAC9F,OACE,qBAAC,QAAD;EAAM,WAAW,GAAG,iCAAiC,SAAS;EAA9D,UAAA,CACE,oBAAC,aAAD;GAA6B;GAAW;GAAK,WAAW,MAAM,KAAK,CAAC;EAAS,GAA3D,GAA2D,GAC5E,UACC,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,eAAY;GAAO,WAAW,GAAG,SAAS,SAAS,OAAO,CAAC,KAAK,MAAM,KAAK,CAAC,GAAG;EAAI,CAAA,GACzF,oBAAC,QAAD;GAAM,WAAU;GAAW,UAAA,eAAe,SAAS,OAAO,CAAC;EAAY,CAAA,CACvE,EAAA,CAAA,CAEA;;AAEV;;AAiBA,SAAgB,YAAY,EAC1B,UACA,cAAc,WACd,MAAM,GACN,OAAO,MACP,aAAa,UAAU,GAAG,MAAM,QAChC,aACmB;CACnB,MAAM,QAAQ,SAAS,QAAQ,QAAQ;CACvC,MAAM,UAAU,MAAM,MAAM,GAAG,GAAG;CAClC,MAAM,SAAS,MAAM,SAAS,QAAQ;CACtC,OACE,qBAAC,OAAD;EAAK,MAAK;EAAQ,cAAY;EAAW,WAAW,GAAG,mBAAmB,SAAS;EAAnF,UAAA,CACG,SACA,SAAS,KACR,oBAAC,QAAD;GACE,MAAK;GACL,cAAY,UAAU,MAAM;GAC5B,iBAAe,IAAI;GACnB,WAAW,GAAG,SAAS,cAAc,8BAA8B,MAAM,KAAK,CAAC,MAAM;EACtF,CAAA,CAEA;;AAET"}
@@ -1,2 +1,2 @@
1
- export { Avatar, AvatarGroup, getInitials } from './Avatar';
1
+ export { Avatar, AvatarGroup } from './Avatar';
2
2
  export type { AvatarGroupProps, AvatarProps, AvatarSize, AvatarStatus } from './Avatar';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { Avatar, AvatarGroup } from "./Avatar.js";