@xdev-asia/ui 0.0.0-stage → 4.15.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 (448) hide show
  1. package/AGENTS.md +66 -0
  2. package/LICENSE +202 -0
  3. package/README.md +149 -2
  4. package/assets/brand/mobile/android-background-1024.png +0 -0
  5. package/assets/brand/mobile/android-background.svg +13 -0
  6. package/assets/brand/mobile/android-foreground-1024.png +0 -0
  7. package/assets/brand/mobile/android-foreground.svg +13 -0
  8. package/assets/brand/mobile/android-monochrome-1024.png +0 -0
  9. package/assets/brand/mobile/android-monochrome.svg +3 -0
  10. package/assets/brand/mobile/ios-icon-1024.png +0 -0
  11. package/assets/brand/mobile/ios-icon-dark-1024.png +0 -0
  12. package/assets/brand/mobile/ios-icon-dark.svg +22 -0
  13. package/assets/brand/mobile/ios-icon.svg +22 -0
  14. package/assets/brand/systems/xdev-ui-icon.svg +23 -0
  15. package/assets/brand/systems/xdev-ui-lockup-dark.svg +24 -0
  16. package/assets/brand/systems/xdev-ui-lockup-light.svg +24 -0
  17. package/assets/brand/systems/xdev-ui-mark-lit.svg +13 -0
  18. package/assets/brand/systems/xdev-ui-mark.svg +3 -0
  19. package/assets/brand/xdev-icon-512.png +0 -0
  20. package/assets/brand/xdev-icon-blue.svg +23 -0
  21. package/assets/brand/xdev-icon.svg +23 -0
  22. package/assets/brand/xdev-lockup-dark.svg +24 -0
  23. package/assets/brand/xdev-lockup-light.svg +24 -0
  24. package/assets/brand/xdev-mark-lit.svg +13 -0
  25. package/assets/brand/xdev-mark-tile.svg +3 -0
  26. package/assets/brand/xdev-mark.svg +3 -0
  27. package/bin/xdev-ui-skills.mjs +142 -0
  28. package/dist/Workspace.stories.d.ts +15 -0
  29. package/dist/ai-manifest.json +3727 -0
  30. package/dist/chunks/FileDrop-C-ygn8kF.js +891 -0
  31. package/dist/chunks/FileDrop-C-ygn8kF.js.map +1 -0
  32. package/dist/chunks/Popover-Ds4RBtZv.js +121 -0
  33. package/dist/chunks/Popover-Ds4RBtZv.js.map +1 -0
  34. package/dist/chunks/crop-CahE3q01.js +55 -0
  35. package/dist/chunks/crop-CahE3q01.js.map +1 -0
  36. package/dist/chunks/modal-BYFY08ti.js +54 -0
  37. package/dist/chunks/modal-BYFY08ti.js.map +1 -0
  38. package/dist/components/ActionTile/ActionTile.d.ts +14 -0
  39. package/dist/components/ActionTile/ActionTile.stories.d.ts +18 -0
  40. package/dist/components/ActivityBar/ActivityBar.d.ts +36 -0
  41. package/dist/components/ActivityBar/ActivityBar.stories.d.ts +27 -0
  42. package/dist/components/AgentChip/AgentChip.d.ts +10 -0
  43. package/dist/components/AgentChip/AgentChip.stories.d.ts +21 -0
  44. package/dist/components/AgentRow/AgentRow.d.ts +24 -0
  45. package/dist/components/AgentRow/AgentRow.stories.d.ts +19 -0
  46. package/dist/components/AppShell/AppShell.d.ts +58 -0
  47. package/dist/components/AppShell/AppShell.stories.d.ts +17 -0
  48. package/dist/components/ApprovalBar/ApprovalBar.d.ts +23 -0
  49. package/dist/components/ApprovalBar/ApprovalBar.stories.d.ts +18 -0
  50. package/dist/components/AttentionInbox/AttentionInbox.d.ts +43 -0
  51. package/dist/components/AttentionInbox/AttentionInbox.stories.d.ts +16 -0
  52. package/dist/components/AudioPreview/AudioPreview.d.ts +33 -0
  53. package/dist/components/AudioPreview/AudioPreview.stories.d.ts +23 -0
  54. package/dist/components/AudioPreview/audio-preview-store.d.ts +14 -0
  55. package/dist/components/AuthShell/AuthShell.d.ts +24 -0
  56. package/dist/components/AuthShell/AuthShell.stories.d.ts +20 -0
  57. package/dist/components/Avatar/Avatar.d.ts +13 -0
  58. package/dist/components/Avatar/Avatar.stories.d.ts +21 -0
  59. package/dist/components/Badge/Badge.d.ts +14 -0
  60. package/dist/components/Badge/Badge.stories.d.ts +26 -0
  61. package/dist/components/Banner/Banner.d.ts +11 -0
  62. package/dist/components/Banner/Banner.stories.d.ts +23 -0
  63. package/dist/components/BarChart/BarChart.d.ts +20 -0
  64. package/dist/components/BarChart/BarChart.stories.d.ts +24 -0
  65. package/dist/components/Board/Board.d.ts +9 -0
  66. package/dist/components/Board/Board.stories.d.ts +18 -0
  67. package/dist/components/BoardCard/BoardCard.d.ts +32 -0
  68. package/dist/components/BoardColumn/BoardColumn.d.ts +24 -0
  69. package/dist/components/BottomNav/BottomNav.d.ts +40 -0
  70. package/dist/components/BottomNav/BottomNav.stories.d.ts +40 -0
  71. package/dist/components/BrandMark/BrandMark.d.ts +20 -0
  72. package/dist/components/BrandMark/BrandMark.stories.d.ts +28 -0
  73. package/dist/components/Breadcrumb/Breadcrumb.d.ts +22 -0
  74. package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +27 -0
  75. package/dist/components/BulkBar/BulkBar.d.ts +21 -0
  76. package/dist/components/BulkBar/BulkBar.stories.d.ts +16 -0
  77. package/dist/components/Button/Button.d.ts +42 -0
  78. package/dist/components/Button/Button.stories.d.ts +41 -0
  79. package/dist/components/Card/Card.d.ts +22 -0
  80. package/dist/components/Card/Card.stories.d.ts +307 -0
  81. package/dist/components/Checkbox/Checkbox.d.ts +10 -0
  82. package/dist/components/Checkbox/Checkbox.stories.d.ts +18 -0
  83. package/dist/components/Coachmark/Coachmark.d.ts +31 -0
  84. package/dist/components/Coachmark/Coachmark.stories.d.ts +27 -0
  85. package/dist/components/Coachmark/placeCoachmark.d.ts +31 -0
  86. package/dist/components/CodeBlock/CodeBlock.d.ts +19 -0
  87. package/dist/components/CodeBlock/CodeBlock.stories.d.ts +22 -0
  88. package/dist/components/CodeInput/CodeInput.d.ts +25 -0
  89. package/dist/components/CodeInput/CodeInput.stories.d.ts +32 -0
  90. package/dist/components/CodeInput/normalizeCode.d.ts +10 -0
  91. package/dist/components/ColorField/ColorField.d.ts +29 -0
  92. package/dist/components/Combobox/Combobox.d.ts +105 -0
  93. package/dist/components/Combobox/Combobox.stories.d.ts +42 -0
  94. package/dist/components/CommandPalette/CommandPalette.d.ts +94 -0
  95. package/dist/components/CommandPalette/CommandPalette.stories.d.ts +39 -0
  96. package/dist/components/Comment/Comment.d.ts +25 -0
  97. package/dist/components/Comment/Comment.stories.d.ts +24 -0
  98. package/dist/components/CommitGraph/CommitGraph.d.ts +15 -0
  99. package/dist/components/CommitGraph/CommitGraph.stories.d.ts +15 -0
  100. package/dist/components/CommitGraph/graphLanes.d.ts +56 -0
  101. package/dist/components/Composer/Composer.d.ts +31 -0
  102. package/dist/components/Composer/Composer.stories.d.ts +17 -0
  103. package/dist/components/Container/Container.d.ts +11 -0
  104. package/dist/components/Container/Container.stories.d.ts +14 -0
  105. package/dist/components/DataTable/DataTable.d.ts +79 -0
  106. package/dist/components/DataTable/DataTable.stories.d.ts +26 -0
  107. package/dist/components/DataTable/table-helpers.d.ts +16 -0
  108. package/dist/components/DataTable/table-reorder.d.ts +40 -0
  109. package/dist/components/DatePicker/Calendar.d.ts +51 -0
  110. package/dist/components/DatePicker/DatePicker.d.ts +51 -0
  111. package/dist/components/DatePicker/DatePicker.stories.d.ts +42 -0
  112. package/dist/components/DateRangePicker/DateRangePicker.d.ts +59 -0
  113. package/dist/components/DateRangePicker/DateRangePicker.stories.d.ts +42 -0
  114. package/dist/components/DescriptionList/DescriptionList.d.ts +14 -0
  115. package/dist/components/DescriptionList/DescriptionList.stories.d.ts +21 -0
  116. package/dist/components/Dialog/Dialog.d.ts +43 -0
  117. package/dist/components/Dialog/Dialog.stories.d.ts +22 -0
  118. package/dist/components/DiffStat/DiffStat.d.ts +12 -0
  119. package/dist/components/DiffStat/DiffStat.stories.d.ts +15 -0
  120. package/dist/components/Disclosure/Disclosure.d.ts +18 -0
  121. package/dist/components/Disclosure/Disclosure.stories.d.ts +27 -0
  122. package/dist/components/DonutChart/DonutChart.d.ts +30 -0
  123. package/dist/components/DonutChart/DonutChart.stories.d.ts +26 -0
  124. package/dist/components/Drawer/Drawer.d.ts +27 -0
  125. package/dist/components/Drawer/Drawer.stories.d.ts +18 -0
  126. package/dist/components/Emblem/Emblem.d.ts +19 -0
  127. package/dist/components/Emblem/Emblem.stories.d.ts +19 -0
  128. package/dist/components/EmptyState/EmptyState.d.ts +43 -0
  129. package/dist/components/EmptyState/EmptyState.stories.d.ts +17 -0
  130. package/dist/components/EndpointPanel/EndpointPanel.d.ts +29 -0
  131. package/dist/components/FacetFilter/FacetFilter.d.ts +39 -0
  132. package/dist/components/FacetFilter/FacetFilter.stories.d.ts +23 -0
  133. package/dist/components/FacetFilter/facet-helpers.d.ts +5 -0
  134. package/dist/components/Field/Field.d.ts +27 -0
  135. package/dist/components/Field/Field.stories.d.ts +25 -0
  136. package/dist/components/FieldMessage/FieldMessage.d.ts +10 -0
  137. package/dist/components/FieldMessage/FieldMessage.stories.d.ts +14 -0
  138. package/dist/components/FileDrop/FileDrop.d.ts +72 -0
  139. package/dist/components/FileDrop/FileDrop.stories.d.ts +18 -0
  140. package/dist/components/FileIcon/FileIcon.d.ts +25 -0
  141. package/dist/components/FileIcon/FileIcon.stories.d.ts +14 -0
  142. package/dist/components/FilterChip/FilterChip.d.ts +9 -0
  143. package/dist/components/FilterChip/FilterChip.stories.d.ts +19 -0
  144. package/dist/components/FlowMap/FlowMap.d.ts +74 -0
  145. package/dist/components/FlowMap/FlowMap.stories.d.ts +24 -0
  146. package/dist/components/FontField/FontField.d.ts +15 -0
  147. package/dist/components/FontField/FontField.stories.d.ts +17 -0
  148. package/dist/components/FormDialog/FormDialog.d.ts +40 -0
  149. package/dist/components/FormDialog/FormDialog.stories.d.ts +22 -0
  150. package/dist/components/FormSection/FormSection.d.ts +19 -0
  151. package/dist/components/FormSection/FormSection.stories.d.ts +16 -0
  152. package/dist/components/Grid/Grid.d.ts +23 -0
  153. package/dist/components/Grid/Grid.stories.d.ts +19 -0
  154. package/dist/components/Grid/breakpoints.d.ts +25 -0
  155. package/dist/components/Heatmap/Heatmap.d.ts +22 -0
  156. package/dist/components/Heatmap/Heatmap.stories.d.ts +24 -0
  157. package/dist/components/Icon/Icon.d.ts +14 -0
  158. package/dist/components/Icon/Icon.stories.d.ts +20 -0
  159. package/dist/components/IconButton/IconButton.d.ts +16 -0
  160. package/dist/components/IconButton/IconButton.stories.d.ts +27 -0
  161. package/dist/components/Identity/Identity.d.ts +14 -0
  162. package/dist/components/Identity/Identity.stories.d.ts +14 -0
  163. package/dist/components/Kbd/Kbd.d.ts +5 -0
  164. package/dist/components/Kbd/Kbd.stories.d.ts +13 -0
  165. package/dist/components/Label/Label.d.ts +15 -0
  166. package/dist/components/Label/Label.stories.d.ts +16 -0
  167. package/dist/components/LaunchCard/LaunchCard.d.ts +36 -0
  168. package/dist/components/LaunchCard/LaunchCard.stories.d.ts +32 -0
  169. package/dist/components/List/List.d.ts +11 -0
  170. package/dist/components/List/List.stories.d.ts +13 -0
  171. package/dist/components/ListRow/ListRow.d.ts +20 -0
  172. package/dist/components/ListRow/ListRow.stories.d.ts +27 -0
  173. package/dist/components/Menu/Menu.d.ts +53 -0
  174. package/dist/components/Menu/Menu.stories.d.ts +85 -0
  175. package/dist/components/Menu/MenuButton.d.ts +23 -0
  176. package/dist/components/Menu/MenuButton.stories.d.ts +46 -0
  177. package/dist/components/Menu/menu-keys.d.ts +26 -0
  178. package/dist/components/Meter/Meter.d.ts +18 -0
  179. package/dist/components/Meter/Meter.stories.d.ts +34 -0
  180. package/dist/components/ModelChip/ModelChip.d.ts +26 -0
  181. package/dist/components/ModelChip/ModelChip.stories.d.ts +18 -0
  182. package/dist/components/NavList/NavList.d.ts +56 -0
  183. package/dist/components/NavList/NavList.stories.d.ts +25 -0
  184. package/dist/components/PageHeader/PageHeader.d.ts +14 -0
  185. package/dist/components/PageHeader/PageHeader.stories.d.ts +14 -0
  186. package/dist/components/Pagination/Pagination.d.ts +28 -0
  187. package/dist/components/Pagination/Pagination.stories.d.ts +16 -0
  188. package/dist/components/PairingCode/PairingCode.d.ts +17 -0
  189. package/dist/components/PairingCode/PairingCode.stories.d.ts +24 -0
  190. package/dist/components/PaletteTrigger/PaletteTrigger.d.ts +16 -0
  191. package/dist/components/PanZoom/PanZoom.d.ts +24 -0
  192. package/dist/components/PanZoom/PanZoom.stories.d.ts +11 -0
  193. package/dist/components/Popover/Popover.d.ts +24 -0
  194. package/dist/components/Popover/Popover.stories.d.ts +25 -0
  195. package/dist/components/Prose/Prose.d.ts +8 -0
  196. package/dist/components/Prose/Prose.stories.d.ts +12 -0
  197. package/dist/components/RadioGroup/RadioGroup.d.ts +27 -0
  198. package/dist/components/RadioGroup/RadioGroup.stories.d.ts +22 -0
  199. package/dist/components/ReactionBar/ReactionBar.d.ts +21 -0
  200. package/dist/components/ReactionBar/ReactionBar.stories.d.ts +26 -0
  201. package/dist/components/ResourceCard/ResourceCard.d.ts +30 -0
  202. package/dist/components/ResourceCard/ResourceCard.stories.d.ts +19 -0
  203. package/dist/components/ReviewComment/ReviewComment.d.ts +41 -0
  204. package/dist/components/ReviewComment/ReviewComment.stories.d.ts +19 -0
  205. package/dist/components/RouteDiagram/RouteDiagram.d.ts +27 -0
  206. package/dist/components/RunTimeline/RunTimeline.d.ts +28 -0
  207. package/dist/components/RunTimeline/RunTimeline.stories.d.ts +31 -0
  208. package/dist/components/SaveBar/SaveBar.d.ts +56 -0
  209. package/dist/components/SaveBar/SaveBar.stories.d.ts +16 -0
  210. package/dist/components/SearchInput/SearchInput.d.ts +22 -0
  211. package/dist/components/SearchInput/SearchInput.stories.d.ts +18 -0
  212. package/dist/components/SearchPicker/SearchPicker.d.ts +49 -0
  213. package/dist/components/SearchPicker/SearchPicker.stories.d.ts +33 -0
  214. package/dist/components/Segmented/Segmented.d.ts +18 -0
  215. package/dist/components/Segmented/Segmented.stories.d.ts +18 -0
  216. package/dist/components/Select/Select.d.ts +26 -0
  217. package/dist/components/Select/Select.stories.d.ts +22 -0
  218. package/dist/components/ServiceStatus/ServiceStatus.d.ts +13 -0
  219. package/dist/components/SessionBar/SessionBar.d.ts +33 -0
  220. package/dist/components/SessionBar/SessionBar.stories.d.ts +27 -0
  221. package/dist/components/SettingRow/SettingRow.d.ts +17 -0
  222. package/dist/components/SettingRow/SettingRow.stories.d.ts +26 -0
  223. package/dist/components/SettingsShell/SettingsShell.d.ts +52 -0
  224. package/dist/components/SettingsShell/SettingsShell.stories.d.ts +9 -0
  225. package/dist/components/ShellTitle/ShellTitle.d.ts +25 -0
  226. package/dist/components/SiteShell/SiteShell.d.ts +24 -0
  227. package/dist/components/SiteShell/SiteShell.stories.d.ts +18 -0
  228. package/dist/components/Skeleton/Skeleton.d.ts +20 -0
  229. package/dist/components/Skeleton/Skeleton.stories.d.ts +15 -0
  230. package/dist/components/SortableList/SortableList.d.ts +30 -0
  231. package/dist/components/SortableList/SortableList.stories.d.ts +16 -0
  232. package/dist/components/Spinner/Spinner.d.ts +15 -0
  233. package/dist/components/Spinner/Spinner.stories.d.ts +14 -0
  234. package/dist/components/SplitHandle/SplitHandle.d.ts +25 -0
  235. package/dist/components/SplitHandle/SplitHandle.stories.d.ts +18 -0
  236. package/dist/components/Stack/Stack.d.ts +18 -0
  237. package/dist/components/Stack/Stack.stories.d.ts +12 -0
  238. package/dist/components/StatTile/StatTile.d.ts +30 -0
  239. package/dist/components/StatTile/StatTile.stories.d.ts +32 -0
  240. package/dist/components/StatusBar/StatusBar.d.ts +8 -0
  241. package/dist/components/StatusBar/StatusBar.stories.d.ts +15 -0
  242. package/dist/components/StatusDot/StatusDot.d.ts +18 -0
  243. package/dist/components/StatusDot/StatusDot.stories.d.ts +24 -0
  244. package/dist/components/StepDots/StepDots.d.ts +15 -0
  245. package/dist/components/StepDots/StepDots.stories.d.ts +15 -0
  246. package/dist/components/SwatchGroup/SwatchGroup.d.ts +20 -0
  247. package/dist/components/SwatchGroup/SwatchGroup.stories.d.ts +33 -0
  248. package/dist/components/Switch/Switch.d.ts +10 -0
  249. package/dist/components/Switch/Switch.stories.d.ts +17 -0
  250. package/dist/components/TabStrip/TabStrip.d.ts +44 -0
  251. package/dist/components/TabStrip/TabStrip.stories.d.ts +66 -0
  252. package/dist/components/Tabs/Tabs.d.ts +28 -0
  253. package/dist/components/Tabs/Tabs.stories.d.ts +34 -0
  254. package/dist/components/Tag/Tag.d.ts +12 -0
  255. package/dist/components/Tag/Tag.stories.d.ts +21 -0
  256. package/dist/components/Textarea/Textarea.d.ts +15 -0
  257. package/dist/components/Textarea/Textarea.stories.d.ts +19 -0
  258. package/dist/components/ThemeEditor/ThemeEditor.d.ts +56 -0
  259. package/dist/components/ThemePreview/ThemePreview.d.ts +15 -0
  260. package/dist/components/ThemeSwitch/ThemeSwitch.d.ts +30 -0
  261. package/dist/components/ThemeSwitch/ThemeSwitch.stories.d.ts +15 -0
  262. package/dist/components/TimeField/TimeField.d.ts +32 -0
  263. package/dist/components/TimeField/TimeField.stories.d.ts +36 -0
  264. package/dist/components/TimeField/time-text.d.ts +26 -0
  265. package/dist/components/TimeSeriesChart/TimeSeriesChart.d.ts +30 -0
  266. package/dist/components/TimeSeriesChart/TimeSeriesChart.stories.d.ts +29 -0
  267. package/dist/components/Toast/Toast.d.ts +18 -0
  268. package/dist/components/Toast/Toast.stories.d.ts +15 -0
  269. package/dist/components/Toast/Toaster.d.ts +18 -0
  270. package/dist/components/Toast/Toaster.stories.d.ts +16 -0
  271. package/dist/components/Toast/toast-region.d.ts +17 -0
  272. package/dist/components/Toast/toast-store.d.ts +46 -0
  273. package/dist/components/ToggleButton/ToggleButton.d.ts +16 -0
  274. package/dist/components/ToggleButton/ToggleButton.stories.d.ts +20 -0
  275. package/dist/components/Toolbar/Toolbar.d.ts +21 -0
  276. package/dist/components/Toolbar/Toolbar.stories.d.ts +25 -0
  277. package/dist/components/Tooltip/Tooltip.d.ts +13 -0
  278. package/dist/components/Tooltip/Tooltip.stories.d.ts +23 -0
  279. package/dist/components/TreeView/TreeView.d.ts +42 -0
  280. package/dist/components/TreeView/TreeView.stories.d.ts +26 -0
  281. package/dist/components/TreeView/pathRows.d.ts +16 -0
  282. package/dist/components/TreeView/treeKeys.d.ts +16 -0
  283. package/dist/components/UsageMeterRow/UsageMeterRow.d.ts +28 -0
  284. package/dist/components/UsageMeterRow/UsageMeterRow.stories.d.ts +26 -0
  285. package/dist/components/WorktreeRow/WorktreeRow.d.ts +32 -0
  286. package/dist/components/WorktreeRow/WorktreeRow.stories.d.ts +32 -0
  287. package/dist/components/ZoomBar/ZoomBar.d.ts +22 -0
  288. package/dist/components/ZoomBar/ZoomBar.stories.d.ts +17 -0
  289. package/dist/editor/RichTextEditor/EditorToolbar.d.ts +35 -0
  290. package/dist/editor/RichTextEditor/ImageBar.d.ts +17 -0
  291. package/dist/editor/RichTextEditor/LinkForm.d.ts +16 -0
  292. package/dist/editor/RichTextEditor/RichTextEditor.d.ts +45 -0
  293. package/dist/editor/RichTextEditor/RichTextEditor.stories.d.ts +43 -0
  294. package/dist/editor/RichTextEditor/extensions.d.ts +23 -0
  295. package/dist/editor/RichTextEditor/icons.d.ts +23 -0
  296. package/dist/editor/RichTextEditor/insertImage.d.ts +28 -0
  297. package/dist/editor/RichTextEditor/labels.d.ts +32 -0
  298. package/dist/editor/index.d.ts +4 -0
  299. package/dist/editor.js +629 -0
  300. package/dist/editor.js.map +1 -0
  301. package/dist/fonts.css +2 -0
  302. package/dist/icons.d.ts +891 -0
  303. package/dist/image/ImageCropper/ImageCropper.d.ts +39 -0
  304. package/dist/image/ImageCropper/ImageCropper.stories.d.ts +18 -0
  305. package/dist/image/ImageField/ImageField.d.ts +86 -0
  306. package/dist/image/ImageField/ImageField.stories.d.ts +29 -0
  307. package/dist/image/crop.d.ts +39 -0
  308. package/dist/image/index.d.ts +3 -0
  309. package/dist/image.js +377 -0
  310. package/dist/image.js.map +1 -0
  311. package/dist/index.d.ts +138 -0
  312. package/dist/index.js +8253 -0
  313. package/dist/index.js.map +1 -0
  314. package/dist/internal/cx.d.ts +2 -0
  315. package/dist/internal/date.d.ts +96 -0
  316. package/dist/internal/duration.d.ts +4 -0
  317. package/dist/internal/focus.d.ts +34 -0
  318. package/dist/internal/keys.d.ts +21 -0
  319. package/dist/internal/modal.d.ts +8 -0
  320. package/dist/internal/portal.d.ts +9 -0
  321. package/dist/internal/position.d.ts +37 -0
  322. package/dist/internal/reveal.d.ts +6 -0
  323. package/dist/internal/roving.d.ts +25 -0
  324. package/dist/internal/scroll-fade.d.ts +16 -0
  325. package/dist/internal/session-labels.d.ts +3 -0
  326. package/dist/internal/text.d.ts +2 -0
  327. package/dist/llms-full.txt +9786 -0
  328. package/dist/llms.txt +162 -0
  329. package/dist/mcp.js +24706 -0
  330. package/dist/panZoom.d.ts +40 -0
  331. package/dist/styles.css +2 -0
  332. package/dist/styles.layered.css +4 -0
  333. package/dist/tailwind.css +38 -0
  334. package/dist/test-utils.d.ts +5 -0
  335. package/dist/theme/font.d.ts +20 -0
  336. package/dist/theme/index.d.ts +2 -0
  337. package/dist/theme/theme.d.ts +62 -0
  338. package/dist/tokens.css +304 -0
  339. package/dist/tokens.json +267 -0
  340. package/dist/types.d.ts +6 -0
  341. package/package.json +177 -4
  342. package/skills/xdev-ui-admin/SKILL.md +106 -0
  343. package/skills/xdev-ui-admin/references/audit-log.md +18 -0
  344. package/skills/xdev-ui-admin/references/console-chrome.md +119 -0
  345. package/skills/xdev-ui-admin/references/dashboard.md +24 -0
  346. package/skills/xdev-ui-admin/references/detail-and-forms.md +22 -0
  347. package/skills/xdev-ui-admin/references/dialogs.md +33 -0
  348. package/skills/xdev-ui-admin/references/forms.md +60 -0
  349. package/skills/xdev-ui-admin/references/from-other-kits.md +75 -0
  350. package/skills/xdev-ui-admin/references/layout.md +58 -0
  351. package/skills/xdev-ui-admin/references/navigation.md +10 -0
  352. package/skills/xdev-ui-admin/references/permissions.md +26 -0
  353. package/skills/xdev-ui-admin/references/resource-list.md +64 -0
  354. package/skills/xdev-ui-admin/references/responsive.md +68 -0
  355. package/skills/xdev-ui-admin/references/rich-content.md +37 -0
  356. package/skills/xdev-ui-admin/references/settings.md +20 -0
  357. package/skills/xdev-ui-admin/references/sign-in.md +47 -0
  358. package/skills/xdev-ui-admin/references/states-feedback.md +26 -0
  359. package/skills/xdev-ui-admin/references/tree-list.md +50 -0
  360. package/skills/xdev-ui-admin/references/users-roles.md +32 -0
  361. package/skills/xdev-ui-admin/references/ux-principles.md +43 -0
  362. package/skills/xdev-ui-admin/references/visual-identity.md +62 -0
  363. package/skills/xdev-ui-admin/templates/admin/_gitignore +3 -0
  364. package/skills/xdev-ui-admin/templates/admin/_mcp.json +5 -0
  365. package/skills/xdev-ui-admin/templates/admin/_npmrc +2 -0
  366. package/skills/xdev-ui-admin/templates/admin/index.html +14 -0
  367. package/skills/xdev-ui-admin/templates/admin/package.json +24 -0
  368. package/skills/xdev-ui-admin/templates/admin/src/App.tsx +66 -0
  369. package/skills/xdev-ui-admin/templates/admin/src/app.css +26 -0
  370. package/skills/xdev-ui-admin/templates/admin/src/auth/permissions.ts +7 -0
  371. package/skills/xdev-ui-admin/templates/admin/src/auth/session.ts +42 -0
  372. package/skills/xdev-ui-admin/templates/admin/src/data/context.ts +11 -0
  373. package/skills/xdev-ui-admin/templates/admin/src/data/store.ts +84 -0
  374. package/skills/xdev-ui-admin/templates/admin/src/data/useLoad.ts +25 -0
  375. package/skills/xdev-ui-admin/templates/admin/src/i18n/en.ts +98 -0
  376. package/skills/xdev-ui-admin/templates/admin/src/i18n/index.tsx +63 -0
  377. package/skills/xdev-ui-admin/templates/admin/src/i18n/vi.ts +98 -0
  378. package/skills/xdev-ui-admin/templates/admin/src/i18n/xdev-ui-labels.ts +47 -0
  379. package/skills/xdev-ui-admin/templates/admin/src/main.tsx +12 -0
  380. package/skills/xdev-ui-admin/templates/admin/src/notify.tsx +36 -0
  381. package/skills/xdev-ui-admin/templates/admin/src/pages/Dashboard.tsx +55 -0
  382. package/skills/xdev-ui-admin/templates/admin/src/pages/ItemDetail.tsx +83 -0
  383. package/skills/xdev-ui-admin/templates/admin/src/pages/ItemsList.tsx +140 -0
  384. package/skills/xdev-ui-admin/templates/admin/src/pages/NotFound.tsx +17 -0
  385. package/skills/xdev-ui-admin/templates/admin/src/pages/Settings.tsx +37 -0
  386. package/skills/xdev-ui-admin/templates/admin/src/pages/SignIn.tsx +105 -0
  387. package/skills/xdev-ui-admin/templates/admin/src/router.ts +49 -0
  388. package/skills/xdev-ui-admin/templates/admin/src/shell/AccountMenu.tsx +36 -0
  389. package/skills/xdev-ui-admin/templates/admin/src/shell/Shell.tsx +53 -0
  390. package/skills/xdev-ui-admin/templates/admin/src/theme.ts +34 -0
  391. package/skills/xdev-ui-admin/templates/admin/tsconfig.json +16 -0
  392. package/skills/xdev-ui-admin/templates/admin/vite.config.ts +4 -0
  393. package/skills/xdev-ui-build-app/SKILL.md +85 -0
  394. package/skills/xdev-ui-build-app/references/app-shell.md +20 -0
  395. package/skills/xdev-ui-build-app/references/i18n.md +9 -0
  396. package/skills/xdev-ui-build-app/references/responsive-a11y.md +10 -0
  397. package/skills/xdev-ui-build-app/references/routing.md +14 -0
  398. package/skills/xdev-ui-build-app/references/setup.md +25 -0
  399. package/skills/xdev-ui-build-app/references/states.md +25 -0
  400. package/skills/xdev-ui-build-app/references/theme.md +11 -0
  401. package/skills/xdev-ui-build-app/templates/app/_gitignore +3 -0
  402. package/skills/xdev-ui-build-app/templates/app/_mcp.json +5 -0
  403. package/skills/xdev-ui-build-app/templates/app/_npmrc +2 -0
  404. package/skills/xdev-ui-build-app/templates/app/index.html +14 -0
  405. package/skills/xdev-ui-build-app/templates/app/package.json +24 -0
  406. package/skills/xdev-ui-build-app/templates/app/src/App.tsx +77 -0
  407. package/skills/xdev-ui-build-app/templates/app/src/app.css +3 -0
  408. package/skills/xdev-ui-build-app/templates/app/src/i18n/en.ts +35 -0
  409. package/skills/xdev-ui-build-app/templates/app/src/i18n/index.tsx +63 -0
  410. package/skills/xdev-ui-build-app/templates/app/src/i18n/vi.ts +35 -0
  411. package/skills/xdev-ui-build-app/templates/app/src/i18n/xdev-ui-labels.ts +19 -0
  412. package/skills/xdev-ui-build-app/templates/app/src/main.tsx +12 -0
  413. package/skills/xdev-ui-build-app/templates/app/src/notify.tsx +36 -0
  414. package/skills/xdev-ui-build-app/templates/app/src/pages/Home.tsx +22 -0
  415. package/skills/xdev-ui-build-app/templates/app/src/pages/NotFound.tsx +17 -0
  416. package/skills/xdev-ui-build-app/templates/app/src/pages/Settings.tsx +35 -0
  417. package/skills/xdev-ui-build-app/templates/app/src/router.ts +26 -0
  418. package/skills/xdev-ui-build-app/templates/app/src/theme.ts +34 -0
  419. package/skills/xdev-ui-build-app/templates/app/tsconfig.json +16 -0
  420. package/skills/xdev-ui-build-app/templates/app/vite.config.ts +4 -0
  421. package/skills/xdev-ui-design/SKILL.md +111 -0
  422. package/skills/xdev-ui-design/references/brand.md +58 -0
  423. package/skills/xdev-ui-design/references/checklist.md +55 -0
  424. package/skills/xdev-ui-design/references/owner-notes.md +54 -0
  425. package/skills/xdev-ui-design/references/porting.md +56 -0
  426. package/skills/xdev-ui-design/references/rules.md +135 -0
  427. package/skills/xdev-ui-design/references/screens.md +61 -0
  428. package/skills/xdev-ui-design/references/tokens.md +97 -0
  429. package/skills/xdev-ui-improve/SKILL.md +96 -0
  430. package/skills/xdev-ui-improve/references/plan-template.md +59 -0
  431. package/skills/xdev-ui-motion/SKILL.md +87 -0
  432. package/skills/xdev-ui-motion/references/recipes.md +117 -0
  433. package/skills/xdev-ui-review/SKILL.md +141 -0
  434. package/skills/xdev-ui-review/references/checklist.md +92 -0
  435. package/skills/xdev-ui-review/references/grep-recipes.md +37 -0
  436. package/skills/xdev-ui-review/references/pages/dashboard.md +21 -0
  437. package/skills/xdev-ui-review/references/pages/dialogs-forms.md +23 -0
  438. package/skills/xdev-ui-review/references/pages/list.md +22 -0
  439. package/skills/xdev-ui-review/references/pages/provider-grid.md +19 -0
  440. package/skills/xdev-ui-review/references/pages/settings.md +18 -0
  441. package/skills/xdev-ui-review/references/pages/sign-in.md +21 -0
  442. package/skills/xdev-ui-review/references/web-interface.md +73 -0
  443. package/skills/xdev-ui-review/scripts/audit.mjs +775 -0
  444. package/skills/xdev-ui-ux-standards/SKILL.md +88 -0
  445. package/skills/xdev-ui-ux-standards/references/heuristics-checklist.md +129 -0
  446. package/skills/xdev-ui-ux-standards/references/patterns.md +120 -0
  447. package/skills/xdev-ui-ux-standards/references/platforms.md +104 -0
  448. package/skills/xdev-ui-ux-standards/references/standards-map.md +144 -0
@@ -0,0 +1,75 @@
1
+ # Rebuilding an admin template from another kit
2
+
3
+ How to rebuild an admin template made with Ant Design, Ant Design Pro, MUI or shadcn (react-antd-admin, vben, Refine demos) on `@xdev-asia/ui`. Keep the template's pages, information and order; replace every part with the xDev one below. The look comes from `xdev-ui-design` and its porting guide.
4
+
5
+ ## Contents
6
+ - Steps
7
+ - Part map
8
+ - What not to carry over
9
+
10
+ ## Steps
11
+
12
+ 1. **Inventory.** List every route from the template's router or menu config, one row per page, with what it shows and its actions. Read the source when it is available: a live demo hides states (empty, error, no access) and modes (code sign-in, register).
13
+ 2. **Map.** Give each row its page pattern from the `xdev-ui-admin` table and each widget its part from the map below. Mark the gaps: a widget with no part.
14
+ 3. **Gaps.** Compose library parts when the composition is small and keeps the part's rules (a notification list from `Popover` and `ListRow`). When it needs new keyboard or ARIA behaviour (a tree grid, a transfer list), it belongs in `@xdev-asia/ui`; build the page without it and say so.
15
+ 4. **Build** the shell first (console chrome reference), then one page per pattern, each a pure view with tests, then the remaining pages.
16
+ 5. **Review** with `xdev-ui-review`, then screenshots at 375 and 1440px, dark and light, beside the template's own.
17
+
18
+ ## Part map
19
+
20
+ | Ant Design or Pro | `@xdev-asia/ui` |
21
+ |---|---|
22
+ | `ProLayout`, `Layout` with `Sider` and `Header` | `AppShell` (`nav`, `crumbs`, `actions`) |
23
+ | `Menu` in the sider, sub-menus (accordion) | one `NavList` with `children` (up to three levels) and `accordion`; the branch with the current page opens |
24
+ | sider collapse trigger (`MenuFold`, collapsed width) | `AppShell` `navCollapsed` (a rail of icons); the fold button in `navFooter`, as at the foot of the sider, or `onNavCollapsedChange` for one in the top bar |
25
+ | `Breadcrumb` | `Breadcrumb` in `crumbs` |
26
+ | multi-tab bar (keep-alive tabs), tab right-click menu, refresh | `TabStrip` with `onAdd={false}`, home `pinned`, a `MenuButton` of close actions, a reload `IconButton` |
27
+ | tab "maximize" (content full screen) | `AppShell` `chromeHidden` |
28
+ | header theme button, theme tiles in settings | `ThemeSwitch variant="icon"` in the top bar, `variant="icons"` in preferences |
29
+ | header language dropdown | `MenuButton variant="icon" icon="globe"` with checked items |
30
+ | global search modal | `PaletteTrigger` + `CommandPalette` |
31
+ | notification bell with `Badge` | `Popover` + `IconButton` + `ListRow` + `StatusDot` |
32
+ | settings drawer (theme, layout) | `Drawer` + `SettingRow` + `ThemeSwitch`, `Select`, `Switch` |
33
+ | `ProTable`, `Table` | `DataTable` + `SearchInput`, `FilterChip` or `FacetFilter`, `Pagination`, `BulkBar` |
34
+ | `Table` with tree data | `DataTable` with tree rows (tree list reference) |
35
+ | `Popconfirm` on delete | `Dialog` with `alert` naming the object, or do it and offer Undo in a `Toast` |
36
+ | `Modal`, `ModalForm` | `Dialog`, `FormDialog` (up to about 5 fields) |
37
+ | `Drawer`, `DrawerForm` | `Drawer` with the form and a footer of Cancel then Save |
38
+ | `ProForm`, `Form` on a page | `FormSection` + `Field`, `Select`, `Textarea`, `Switch`, `SaveBar` + `useUnsavedGuard` |
39
+ | `Input.Search` | `SearchInput` |
40
+ | `Select` | `Select` (short list), `Combobox` (tens to hundreds), `SearchPicker` (server search) |
41
+ | `Radio.Group` of buttons, `Segmented` | `Segmented` |
42
+ | `DatePicker`, `RangePicker` | `DatePicker`, `DateRangePicker`, `TimeField` |
43
+ | `Upload`, avatar upload | `FileDrop`, `ImageField` (`/image`) |
44
+ | `ColorPicker` | `ColorField`, `SwatchGroup` |
45
+ | `Statistic`, count-up cards | `StatTile` (no count-up animation; say what the number is compared with) |
46
+ | ECharts line or area | `TimeSeriesChart` |
47
+ | ECharts bar | `BarChart` |
48
+ | ECharts pie or donut | `DonutChart` for parts of one whole (at most 8, largest first, every value written in its legend); `BarChart` when the amounts do not add up to a whole or need exact comparison |
49
+ | `Progress` | `Meter` |
50
+ | `Descriptions` | `DescriptionList` |
51
+ | `Tag` | `Tag`; a state is `StatusDot` with words, not a coloured tag |
52
+ | `Badge` count | `Badge` or the `count` of a `NavList` item |
53
+ | `Result` (403, 404, 500, success) | `EmptyState size="center"` |
54
+ | `Empty` | `EmptyState` |
55
+ | `Alert` | `Banner` |
56
+ | `message`, `notification` | `Toast` (one line, past tense) |
57
+ | `Spin`, page loading | `Skeleton` in the shape of the region, `Spinner` in a control |
58
+ | `Steps` | `StepDots`, or `EmptyState` with `steps` for first-run |
59
+ | `Dropdown` | `MenuButton` |
60
+ | `Tooltip` | `Tooltip`, never the only place for a reason |
61
+ | `Avatar` | `Avatar` for people; `Emblem` for things |
62
+ | `Card` | `Card` (no shadow; `flush` for edge-to-edge content) |
63
+ | `Tree` with checkboxes, `TreeSelect`, `Transfer` | gap: a `Checkbox` matrix for permissions today; propose the part for the library |
64
+ | split login page (art left, form right), password, code, register, forgot | `AuthShell` (headline, tagline, language and theme in `actions`, copyright and legal links in `footer`), a `Segmented` for password or code, `CodeInput`, links to reset and register (sign-in reference) |
65
+ | access demo (page control, button control, role-only pages) | real account switch, the nav model filtered by role, `can()` for buttons, `EmptyState` for the role-only pages |
66
+ | privacy policy, terms of service (public routes) | `Prose` in a `Container`, open before sign-in |
67
+
68
+ ## What not to carry over
69
+
70
+ - Layout switchers (side, top, mixed, two-column nav), sidebar themes, colour presets and radius sliders, colour-weak or grey modes: xDev has one shell, two themes and one accent. Offer the rail and the focus view instead.
71
+ - Version polling and back-to-top buttons: add them only when the product needs them; the shell scrolls `main`, and a long page gets a `Pagination` or section links.
72
+ - Watermarks, page transition and loading-bar animations, count-up numbers: motion follows `xdev-ui-motion`.
73
+ - Primary-coloured filled headers, gradient cards, coloured left borders on cards and stat tiles.
74
+ - Chinese-first copy: write `en` and `vi` from the start, sentence case, no exclamation marks.
75
+ - A hidden route reached by URL shows 403 in many templates; in xDev a page the role cannot read shows not-found.
@@ -0,0 +1,58 @@
1
+ # Layout
2
+
3
+ ## Contents
4
+ - Shell and page
5
+ - Container, Stack, Grid
6
+ - Breakpoints
7
+ - With Tailwind
8
+
9
+ ## Shell and page
10
+ - One `AppShell` per app: `brand`, `nav` (a `NavList`), `crumbs` (`Breadcrumb`), `actions` (account menu), `toasts`. Below 768px the nav is a drawer controlled by `navOpen` / `onNavOpenChange`; close it when an item is picked.
11
+ - Each page: `PageHeader` (the only `h1`, actions at the end, primary last), then the content, then `SaveBar` last when the page edits a long form.
12
+ - Design at 360px first. No horizontal page scroll: only a `DataTable` scrolls sideways, inside its own wrapper.
13
+
14
+ ## Container, Stack, Grid
15
+
16
+ ```tsx
17
+ <Container size="xl"> {/* lists, dashboards; "md" for forms; "full" for wide tables */}
18
+ <Stack gap={6}>
19
+ <PageHeader title={t("dashboard.title")} />
20
+ <Grid columns={{ base: 1, sm: 2, xl: 4 }} gap={4}>
21
+ <StatTile label={t("stats.users")} value={users} />
22
+ {/* … */}
23
+ </Grid>
24
+ <Grid columns={{ base: 1, lg: 3 }}>
25
+ <GridItem span={{ base: 1, lg: 2 }}><Card title={t("orders.recent")}>…</Card></GridItem>
26
+ <Card title={t("activity.title")}>…</Card>
27
+ </Grid>
28
+ </Stack>
29
+ </Container>
30
+ ```
31
+
32
+ - `Stack` replaces margins between siblings: `gap` 1, 2, 3, 4, 6, 8 (4 to 32px). Rows wrap by default. Action rows: `direction="row" justify="end"`.
33
+ - `Grid` `columns` is a number or one per breakpoint; a key applies from its width up and falls back to the next smaller key. `minItemWidth="16rem"` fits as many cards as there is room for.
34
+ - Inside a `Drawer`, a split pane or a side panel use `responsive="container"`: the columns follow the grid's own width.
35
+ - `GridItem span="full"` for a row-wide title or banner; spans never exceed the column count.
36
+ - Form fields stay in one column; `FormSection columns={2}` only for short pairs (first and last name, city and postcode).
37
+
38
+ ## Breakpoints
39
+ sm 640, md 768, lg 1024, xl 1280, 2xl 1536 (`--x-bp-*`, `BREAKPOINTS`, Tailwind's defaults). Lay out with CSS. Use `useBreakpoint()` only for behaviour CSS cannot express (open a `Drawer` instead of a side panel below `lg`): it returns "base" on the server and the first client pass, so the first paint must work at any width.
40
+
41
+ ```ts
42
+ const bp = useBreakpoint();
43
+ const asDrawer = !atLeast(bp, "lg");
44
+ ```
45
+
46
+ ## With Tailwind
47
+ An app on Tailwind v4 imports the theme once:
48
+
49
+ ```css
50
+ @import "tailwindcss";
51
+ @import "@xdev-asia/ui/styles.css";
52
+ @import "@xdev-asia/ui/tailwind.css";
53
+ ```
54
+
55
+ - Utilities then speak the tokens: `bg-panel`, `bg-surface`, `text-ink`, `text-muted`, `border-line`, `bg-accent text-on-accent`, `text-danger`, `bg-warn-soft`, `rounded-md`, `font-mono`, `md:grid-cols-2`.
56
+ - `p-4` is 16px (`--x-space-1` is 4px, the same step). Shadows and z-index have no names: `shadow-(--shadow-menu)`, `z-(--x-z-modal)`.
57
+ - Never use Tailwind's palette (`bg-gray-100`, `text-blue-600`) or arbitrary values (`p-[13px]`, `text-[#333]`); they skip the theme.
58
+ - Components first; utilities only for page glue the components do not cover.
@@ -0,0 +1,10 @@
1
+ # Navigation
2
+
3
+ - **Sidebar.** `NavList` groups by task (Content, Sales, People, System), 5 to 9 items per group, nouns in plural ("Users", "Orders"). The current page is `aria-current`. Items the role can never open are not shown.
4
+ - **Breadcrumb** in the shell's `crumbs` for anything deeper than a list: Users / Ada Lovelace / Edit. The last item is the current page and not a link.
5
+ - **Tabs** split one record into views (Profile, Orders, Activity). Put the tab in the URL (`?tab=orders`) so it survives reload and can be shared. Not for steps of a process.
6
+ - **URL holds the view state.** Search, filters, sort, page and the open tab live in the query string; back and reload return to the same list.
7
+ - **Detail from a list.** A row link opens the detail page; a `Drawer` is for quick edits while the list stays visible. Back from the detail restores the list's filters and scroll.
8
+ - **Command palette.** For apps with more than about 15 pages, `CommandPalette` on Ctrl/Cmd+K jumps to pages and records.
9
+ - **After create** go to the new record (or highlight it in the list). **After delete** go back to the list and toast.
10
+ - **Leaving dirty forms** asks first: `confirmLeave()` from `useUnsavedGuard` before every in-app navigation.
@@ -0,0 +1,26 @@
1
+ # Permissions
2
+
3
+ The UI shapes what a role sees; the server must check every request again.
4
+
5
+ ```ts
6
+ export type Capability = "users.create" | "users.update" | "users.delete" | "roles.update" | "settings.update" | "audit.export";
7
+ export function can(roles: Role[], role: RoleId, capability: Capability): boolean {
8
+ if (role === "owner") return true;
9
+ const [resource, action] = MAP[capability];
10
+ return roles.find((r) => r.id === role)?.permissions[resource][action] ?? false;
11
+ }
12
+ ```
13
+
14
+ ## Hide or disable
15
+
16
+ | situation | do |
17
+ |---|---|
18
+ | The role can never do it (create, delete) | hide the button |
19
+ | The role may view but not change a form or a matrix | disable the controls and show a `Banner` that says why |
20
+ | Nothing is selected yet | disable the bulk buttons, keep the bar |
21
+ | The role may not open the page | hide its `NavList` item and show the not-found page for the URL |
22
+
23
+ - Pass the role and the matrix to views as props, so tests can render a viewer and an admin.
24
+ - One capability name per action; do not scatter role names through components.
25
+ - After the matrix is saved, reload the roles so the shell updates at once.
26
+ - Drive the sidebar, the search and any "preview as role" page from one nav model filtered by the same `canRead`, so a preview cannot drift from what the role really sees. A preview page says it changes only the view (`Banner tone="info"`).
@@ -0,0 +1,64 @@
1
+ # Resource list
2
+
3
+ ## Contents
4
+ - Filter state
5
+ - Table
6
+ - Bulk actions
7
+ - Empty states
8
+
9
+ ## Filter state
10
+ Keep `query`, `statuses`, `sort`, `page` and `pageSize` in the page; the view gets them as props. Reset `page` to 1 whenever a filter changes. Filtering is a pure function so it is unit tested:
11
+
12
+ ```ts
13
+ export function filterUsers(users: User[], f: UserFilters): User[] {
14
+ const q = f.query.trim().toLowerCase();
15
+ return users.filter((u) => (!q || u.name.toLowerCase().includes(q) || u.email.toLowerCase().includes(q)) && (f.statuses.size === 0 || f.statuses.has(u.status)));
16
+ }
17
+ ```
18
+
19
+ Slice after sorting with `sortTableRows(rows, sort, valueOf)` and `paginateRows(rows, page, pageSize)`.
20
+
21
+ Server-paged lists (`?q=&page=&pageSize=&sort=field:dir`) do not slice: keep the same state in the URL and send it. `tableSortToParam(sort)` gives `field:dir` and `tableSortFromParam(param, allowedKeys)` reads it back (unknown columns give null), so a hand-edited URL cannot sort by a column the table does not offer. While the next page loads keep the old rows and pass `loading`, which dims them.
22
+
23
+ ## Table
24
+
25
+ ```tsx
26
+ <DataTable
27
+ caption={t("users.table")}
28
+ columns={columns}
29
+ rows={rows}
30
+ rowKey={(u) => u.id}
31
+ rowLabel={(u) => u.name}
32
+ sort={sort}
33
+ onSortChange={onSortChange}
34
+ selected={selected}
35
+ onSelectedChange={onSelectedChange}
36
+ loading={loading}
37
+ empty={empty}
38
+ labels={ui.dataTable}
39
+ />
40
+ <Pagination page={page} pageSize={pageSize} total={sorted.length} onPageChange={onPageChange} pageSizeOptions={[10, 20, 50]} onPageSizeChange={onPageSizeChange} labels={ui.pagination} />
41
+ ```
42
+
43
+ - Columns: `{ key, header, cell, sortable, mono, hideNarrow }`. Mark long columns `hideNarrow` so 360px keeps name and status.
44
+ - A `stack` table with `onSortChange` shows its own "Sort by" select when the rows stack on a phone; pass `labels.sortBy`, `sortNone` and `sortOption` in both languages.
45
+ - Show status with `StatusDot` and a label, a role with `Tag`, a person with `Avatar` and a link.
46
+ - Chips: `FilterChip` with `pressed` and `count`; count each status with the other filters applied.
47
+ - More than five values, or little room: `FacetFilter` (`label`, `options` with `count`, controlled `selected`). Keep it next to the search box.
48
+ - Manually ordered lists (menu items, banners): `reorderable` and `onReorder={(from, to) => save(moveItem(rows, from, to))}`. Reorder is off while a sort is active; reorder the full list, not one page.
49
+
50
+ ## Bulk actions
51
+
52
+ ```tsx
53
+ <BulkBar count={selected.size} onClear={() => setSelected(new Set())} labels={ui.bulkBar}>
54
+ <Button variant="secondary" onClick={() => onSuspend(ids)}>{t("users.suspend")}</Button>
55
+ <Button variant="secondary" onClick={() => askDelete(ids)}>{t("users.delete")}</Button>
56
+ </BulkBar>
57
+ ```
58
+
59
+ `BulkBar` renders nothing at 0 selected. At most four secondary actions with verbs; a destructive one opens a `Dialog` that names the count. After the action clear the selection and toast. Show it only to roles that may act.
60
+
61
+ ## Empty states
62
+
63
+ - No data at all: `EmptyState` with an icon, a title, a hint and the create action (secondary when the page header already has the primary one).
64
+ - Filters match nothing: title names the search text, action clears the filters.
@@ -0,0 +1,68 @@
1
+ # Responsive
2
+
3
+ ## Contents
4
+ - Breakpoints
5
+ - What the library already does
6
+ - What the app must still do
7
+ - Tables on a phone
8
+ - Checklist
9
+
10
+ ## Breakpoints
11
+ sm 640, md 768, lg 1024, xl 1280, 2xl 1536 (`--x-bp-*`, `BREAKPOINTS`, Tailwind's `sm:` to `2xl:`). Mobile first: a value applies from its breakpoint up. Check every screen at three widths: **375** (phone), **768** (tablet, sidebar still a drawer), **1440** (desktop). Also drag down to 320 once to look for a horizontal scrollbar.
12
+
13
+ ## What the library already does
14
+ Import `@xdev-asia/ui/styles.css` and these come with it; do not re-implement them.
15
+
16
+ | part | phone and tablet behaviour |
17
+ |---|---|
18
+ | `AppShell` | Sidebar is a drawer below 768px. Top-bar actions shrink with the title; an empty `SearchInput` there collapses to an icon below 640px and opens on focus. |
19
+ | `PageHeader`, `Toolbar`, `BulkBar`, `Card`, `SettingRow`, `SaveBar`, `EmptyState` | Title and actions wrap onto two lines; actions wrap among themselves. |
20
+ | `Button` | Label stays on one line; the row wraps instead. |
21
+ | `Dialog`, `FormDialog` (modal) | Bottom sheet below 640px, actions stacked with the primary on top, scrolls inside itself. |
22
+ | `Drawer` | Full width below 640px. |
23
+ | `Tabs`, `Segmented` | Scroll sideways inside themselves below 768px. |
24
+ | `TabStrip`, `StatusBar` | Scroll sideways inside themselves at every width. |
25
+ | `DataTable` | Scrolls inside its wrapper; select column pinned; `sticky`, `stack`, `hideNarrow` (below). |
26
+ | `Menu`, `Popover`, `DateRangePicker` | Stay inside the window. |
27
+ | `.ws-mono` text | Breaks anywhere, so long ids and URLs do not widen the page. |
28
+ | touch (`pointer: coarse`) | 44px hit areas on buttons, icon buttons, tabs, segments, menu items and inputs; 16px input text so iOS does not zoom. |
29
+
30
+ ## What the app must still do
31
+ - **No fixed widths.** No `width` or `min-width` over 320px in app CSS. Use `max-width`, `min(30rem, 100%)`, `%`, `ch`, or a `Grid`. The audit warns (`fixed-width`).
32
+ - **No unbounded `nowrap`.** `white-space: nowrap` on a container needs `overflow` or `text-overflow: ellipsis` in the same rule. The audit warns (`nowrap`).
33
+ - **Lay out with `Grid` and `Stack`.** `Grid columns={{ base: 1, sm: 2, xl: 4 }}` or `minItemWidth="16rem"`; `responsive="container"` inside a `Drawer` or side panel. `Stack direction="row"` wraps by default; do not turn `wrap` off for action rows.
34
+ - **Page actions go to `PageHeader actions`**, primary last, not a hand-made flex row. Four actions at most; the rest in a `Menu`.
35
+ - **Top bar:** at most three icon actions next to the search on a phone; put the rest (theme, language, help) in the account `Menu`. Keep the `ShellTitle` short.
36
+ - **Forms:** one column; `FormSection columns={2}` only for short pairs. Quick forms in `FormDialog` already become a sheet; long forms are a page with `SaveBar`.
37
+ - **Behaviour, not layout, with `useBreakpoint()`:** for example `Drawer` instead of a side panel below `lg`. It returns "base" on the server and the first client pass, so the first paint must work at any width.
38
+ - **Wide content scrolls in its own box**: code, diffs, logs, charts. Never let them widen `main`.
39
+
40
+ ## Tables on a phone
41
+ Pick one per table:
42
+
43
+ | table | on a phone |
44
+ |---|---|
45
+ | Many columns, people compare rows | Keep the table; it scrolls inside its wrapper. Put the row-actions column on `sticky="end"` and mark low-value columns `hideNarrow`. |
46
+ | Few rows people read one by one (members, invoices) | `stack`: below a 480px container each row becomes a card of "label: value" lines. Give icon-only or empty headers a `label`. Sort headers are hidden in stack mode, so offer sorting in a `Select` if it matters. |
47
+
48
+ ```tsx
49
+ const columns: DataTableColumn<User>[] = [
50
+ { key: "name", header: t("users.name"), cell: (u) => u.name },
51
+ { key: "email", header: t("users.email"), cell: (u) => u.email, mono: true, hideNarrow: true },
52
+ { key: "role", header: t("users.role"), cell: (u) => <Tag>{u.role}</Tag> },
53
+ { key: "actions", header: "", label: t("common.actions"), width: "min", sticky: "end", cell: (u) => <IconButton icon="more" label={t("common.actionsFor", { name: u.name })} /> },
54
+ ];
55
+
56
+ <DataTable caption={t("users.title")} columns={columns} rows={rows} rowKey={(u) => u.id} stack />
57
+ ```
58
+
59
+ ## Checklist
60
+ - [ ] 375px: no horizontal page scroll; the title is readable; actions wrap under it.
61
+ - [ ] 375px: dialogs open as a sheet; drawers fill the width; nothing sits under the keyboard.
62
+ - [ ] 375px: tables scroll inside their wrapper (actions pinned) or stack.
63
+ - [ ] 768px: sidebar is a drawer; tabs and segmented controls fit or scroll inside themselves.
64
+ - [ ] 1440px: the desktop layout is unchanged; content is capped by `Container`.
65
+ - [ ] 320px: still no page scrollbar.
66
+ - [ ] On a touch device or emulator: every control is at least 44px; inputs do not zoom the page.
67
+ - [ ] Screenshots at 375 and 1440, dark and light, with real data.
68
+ - [ ] The audit has no `fixed-width` or `nowrap` warnings, or each one is justified.
@@ -0,0 +1,37 @@
1
+ # Rich content: editor and images
2
+
3
+ Both live in subpaths so apps without them do not install their peers.
4
+
5
+ ```bash
6
+ pnpm add @tiptap/core @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-image @tiptap/extension-link @tiptap/extensions @tiptap/markdown # /editor
7
+ pnpm add react-easy-crop # /image
8
+ ```
9
+
10
+ ## RichTextEditor
11
+
12
+ ```tsx
13
+ import { RichTextEditor } from "@xdev-asia/ui/editor";
14
+
15
+ <RichTextEditor label={t("post.body")} value={draft.body} onChange={(body) => setDraft({ ...draft, body })}
16
+ onUploadImage={uploadImage} onUploadingChange={setUploading} labels={ui.editor} />
17
+ ```
18
+
19
+ - Stores Markdown by default (`format="html"` for HTML). Content is limited to the toolbar: headings 2 and 3, bold, italic, lists, quote, `http(s)` links, images.
20
+ - Controlled: replacing `value` (record loaded, form reset) replaces the content; echoing `onChange` does not.
21
+ - Images exist only with `onUploadImage(file) => Promise<url>`; wide images are re-encoded to WebP at 1600px before upload. Disable Save while `onUploadingChange(true)`.
22
+ - Render stored Markdown on the public site with the same rules (sanitise; allow only `http(s)` links).
23
+
24
+ ## ImageField
25
+
26
+ ```tsx
27
+ import { ImageField } from "@xdev-asia/ui/image";
28
+
29
+ <ImageField label={t("banner.image")} aspect={{ ratio: 16 / 9, width: 1600, height: 900 }} value={draft.imageUrl}
30
+ onChange={(url) => setDraft({ ...draft, imageUrl: url })} onUpload={(blob, name) => api.upload(blob, name)}
31
+ onBusyChange={setUploading} labels={ui.imageField} />
32
+ ```
33
+
34
+ - `aspect` is the crop ratio and the exported size; output is WebP 0.85 unless `encode` says otherwise.
35
+ - Pick, crop (`ImageCropper`), upload; "Crop again" restarts from the original photo while `value` is still the uploaded URL.
36
+ - A `value` from another origin needs CORS for "Crop again".
37
+ - For several files or non-images use `FileDrop`. Helpers `cropToBlob`, `resizeToBlob`, `sameAspect` are exported for custom flows.
@@ -0,0 +1,20 @@
1
+ # Settings
2
+
3
+ A `NavList` of sections next to a `FormSection` per section. Each setting is a `SettingRow` with its control on the right.
4
+
5
+ ```tsx
6
+ <NavList title={t("settings.title")} labels={ui.navList} value={section} items={SECTIONS.map((s) => ({ id: s, label: t(`settings.sections.${s}`), href: hrefFor.settings(s) }))} />
7
+ <SettingRow id="setting-theme" label={t("settings.theme")} description={t("settings.themeHint")} control={<ThemeSwitch value={theme} onChange={onTheme} labels={ui.themeSwitch} />} />
8
+ <SettingRow
9
+ id="setting-twoFactor"
10
+ controlId="switch-twoFactor"
11
+ label={t("settings.twoFactor")}
12
+ description={t("settings.twoFactorHint")}
13
+ control={<Switch id="switch-twoFactor" aria-describedby="switch-twoFactor-hint" checked={on} onChange={(e) => onFlag(e.target.checked)} />}
14
+ />
15
+ ```
16
+
17
+ - A `Switch` or `Select` row applies at once. Only a text field, such as the workspace name, gets a Save button.
18
+ - Give the control the `controlId` and `aria-describedby="<controlId>-hint"` so the label and hint are linked.
19
+ - The route carries the section (`#/settings/security`); an unknown section falls back to the first.
20
+ - A role that may not change settings sees disabled controls and a `Banner` that says why.
@@ -0,0 +1,47 @@
1
+ # Sign-in
2
+
3
+ `AuthShell`: a showcase side next to a form pane. Use it for sign-in, sign-up and password reset; the pages after sign-in use `AppShell`.
4
+
5
+ From 1024px the showcase takes five eighths of the width: the art centred, the headline and tagline centred under it, the footer (copyright, two links) at its foot. The form pane takes the rest: brand at the top start, language and theme at the top end, the form centred, at most 26rem wide.
6
+
7
+ ```tsx
8
+ <AuthShell
9
+ brand={<><BrandMark variant="tile" size={32} /><span>{t("app.name")}</span></>}
10
+ actions={<><Select icon="globe" aria-label={t("lang.label")} value={lang} onChange={onLang} options={LANGS} /><ThemeSwitch variant="icon" value={theme} onChange={onTheme} /></>}
11
+ headline={t("signin.headline")}
12
+ tagline={t("signin.tagline")}
13
+ footer={t("signin.footer")}
14
+ >
15
+ <Stack gap={4}>
16
+ <Stack gap={1}>
17
+ <h1>{t("signin.welcome")}</h1>
18
+ <p className="muted">{t("signin.purpose")}</p>
19
+ </Stack>
20
+ {error ? <Banner tone="danger" title={t("signin.failed")}>{error}</Banner> : null}
21
+ <form onSubmit={onSubmit}>
22
+ <Stack gap={3}>
23
+ <Field label={t("signin.email")} type="email" autoComplete="username" required />
24
+ <Field label={t("signin.password")} type="password" autoComplete="current-password" required />
25
+ <Button variant="primary" type="submit" disabled={busy}>{t("signin.submit")}</Button>
26
+ </Stack>
27
+ </form>
28
+ </Stack>
29
+ </AuthShell>
30
+ ```
31
+
32
+ - One `h1` in the form ("Welcome back", "Sign in") with one muted line under it on what the account is for; the headline is the product line, not the page title. No emoji.
33
+ - `actions` holds the language `Select` and the theme `ThemeSwitch` (icon); both, so a person can fix either before signing in.
34
+ - One primary `Button`, full width. A second way in (single sign-on, a token) is a secondary `Button` or a second `Card`, with a short line on when to use it.
35
+ - A wrong password or an expired link shows a `Banner` above the form, in words that say what to do; never clear what the person typed.
36
+ - Disable the submit button while the request runs; focus the first field on load.
37
+ - Headline and tagline are two short translated lines that say what the product does. No marketing paragraph.
38
+ - Art is the product's own picture (a diagram of what it does) or the built-in pattern; never a stock illustration from another product.
39
+ - Check it at 375px (only the form pane shows) and at 1440px, in dark and light.
40
+
41
+ ## Other ways in
42
+
43
+ - **Email code.** A `Segmented` above the form switches between password and code. Code: the email, "Send code", then `CodeInput` (`length={6}`, `alphabet="digits"`, `groupSize={3}`) with a visible label and a line naming the address. `onComplete` submits; a wrong code shows a `Banner` and keeps the email. Offer "Use another email".
44
+ - **Forgot password.** Its own `h1` ("Reset your password"), the email and "Send reset link". The answer is the same whether or not the address has an account: "If name@example.com has an account, a reset link is on its way."
45
+ - **Create an account.** Name, email and a password with `autoComplete="new-password"` and its minimum length as the hint; errors show after the first submit. Say who approves new accounts.
46
+ - Each mode keeps one `h1` and one primary button; the links to the other modes are `link` buttons under the form, and "Back to sign in" returns.
47
+
@@ -0,0 +1,26 @@
1
+ # States and feedback
2
+
3
+ Every region that loads data has four states. Write each as a branch of the pure view and test it with `renderToStaticMarkup`.
4
+
5
+ | state | show |
6
+ |---|---|
7
+ | loading, first time | `Skeleton` in the shape of the content (`announce` on one per region); `loading` on `DataTable` and `StatTile` |
8
+ | loading, refresh | keep the old data, `busy` on the trigger or a `Spinner` in the toolbar; no skeleton flash |
9
+ | error | `Banner` whose `title` says what failed, with a secondary "Try again" `action`; keep any data already shown |
10
+ | empty, no data yet | `EmptyState` with icon, title, hint and the create action |
11
+ | empty, filters match nothing | `EmptyState` naming the search text, action "Clear filters" |
12
+ | success of an action | `Toast` that names the object ("User Ada suspended"), with Undo (`actionLabel`, `onAction`) when possible |
13
+
14
+ ```tsx
15
+ if (state.kind === "loading") return <Skeleton shape="block" height="320px" announce labels={ui.skeleton} />;
16
+ if (state.kind === "error") return <Banner title={t("users.loadFailed")} action={<Button variant="secondary" onClick={retry}>{t("common.retry")}</Button>} />;
17
+ ```
18
+
19
+ Whole-page status views (403, 404, 500) are in the tree list and status pages reference. Give them `EmptyState size="center"` with `figure="404"` (the large code above the title) and, if the product has illustrations, `art` (decorative, `aria-hidden`, in place of the icon tile); the title and hint still say what happened and what to do.
20
+
21
+ ## Rules
22
+ - Show a skeleton only after about 300 ms, so fast loads do not flicker; never leave it after an error.
23
+ - One message per problem, in one place: a field error is not also a toast.
24
+ - Toasts: one line, no action except Undo, never for errors that need action.
25
+ - `Meter` for a share of a limit (storage, quota), `StatusDot` with text for a state, `Badge` for a count.
26
+ - Long jobs (exports, imports): start them, show progress in a `Banner` or the row, and notify on completion; do not block the page.
@@ -0,0 +1,50 @@
1
+ # Tree lists and status pages
2
+
3
+ ## Contents
4
+ - Tree list in a DataTable
5
+ - Filtering a tree
6
+ - Editing a node
7
+ - Status pages
8
+
9
+ ## Tree list in a DataTable
10
+
11
+ Menus, departments, categories and folders are trees an admin scans as rows. `TreeView` is the file tree of the workspace (git marks, files and folders); for records with columns, keep `DataTable` and flatten the tree yourself:
12
+
13
+ ```ts
14
+ export interface TreeNode<T> { id: string; data: T; children?: TreeNode<T>[] }
15
+ /** The rows to show, depth first, skipping the children of closed nodes. */
16
+ export function visibleRows<T>(tree: TreeNode<T>[], expanded: ReadonlySet<string>, depth = 0): TreeRow<T>[];
17
+ ```
18
+
19
+ - The first column is the name, indented by depth (`padding-inline-start: calc(depth * var(--x-space-6))`), with an `IconButton size="sm"` that opens and closes the node: `chevron-right` closed, `chevron` open, `aria-expanded`, and a label that names the node ("Expand Engineering"). A leaf gets a same-width spacer so names line up.
20
+ - Above the table: a `SearchInput` filter, "Expand all" and "Collapse all" secondary buttons (disabled while filtering).
21
+ - A count in the `PageHeader` `meta` (`Tag`: "19 items") counts every node, open or not.
22
+ - Use `stack` on the `DataTable` so a phone gets cards; hide path and code columns there with `hideNarrow`.
23
+ - `DataTable` has no tree semantics (`treegrid`); the buttons carry the state for assistive technology. If a tree needs arrow-key navigation between rows, the part belongs in `@xdev-asia/ui`, not in the app.
24
+
25
+ ## Filtering a tree
26
+
27
+ Keep the ancestors of every match, and open every branch while a filter is on, so a match is never hidden in a closed node:
28
+
29
+ ```ts
30
+ const shown = q ? filterTree(tree, (m) => m.name.toLowerCase().includes(q)) : tree;
31
+ const rows = visibleRows(shown, q ? new Set(branchIds(shown)) : expanded);
32
+ ```
33
+
34
+ With no match, the `empty` slot holds an `EmptyState` with "Clear the filter".
35
+
36
+ ## Editing a node
37
+
38
+ A row action `IconButton icon="edit"` (only for roles that can edit; hide the column otherwise) opens a `Drawer` with the node's fields: `Field` for name, path and code (`mono`), `Select` for the kind, a number `Field` for the order and a `Switch` for whether it shows. Save replaces the node with a pure `updateNode(tree, id, data)` and shows a past-tense toast.
39
+
40
+ ## Status pages
41
+
42
+ Whole-page states use `EmptyState size="center"`, one icon, one statement and one hint, and at most two buttons, the primary last:
43
+
44
+ | page | icon | title | actions |
45
+ |---|---|---|---|
46
+ | 403, the server refused | `lock` | "You cannot open this page" | "Go to dashboard" (primary) |
47
+ | 404, no such page, or a page the role cannot read | `search` | "Page not found" | "Go to dashboard" (primary) |
48
+ | 500, the server failed | `alert` | "Something went wrong on our side" | "Go to dashboard" (secondary), "Try again" (primary) |
49
+
50
+ Never show a stack trace or an error code alone; the code may go in the hint for support ("Error 500"). The shell stays around a status page so the person can navigate away.
@@ -0,0 +1,32 @@
1
+ # Users and roles
2
+
3
+ ## Contents
4
+ - Users
5
+ - Roles matrix
6
+
7
+ ## Users
8
+ The users page is the resource list recipe with `Avatar`, `Tag` for the role and `StatusDot` for the status. A user detail page adds `Tabs` (Profile, Activity), a `DescriptionList` and two `FormSection`.
9
+
10
+ ## Roles matrix
11
+
12
+ A role list on the left (`ListRow` with `selected`), a `DataTable` matrix on the right: one row per resource, one `Checkbox` per action.
13
+
14
+ ```tsx
15
+ const columns: DataTableColumn<Resource>[] = [
16
+ { key: "resource", header: t("roles.resource"), cell: (r) => t(`roles.resources.${r}`) },
17
+ ...ACTIONS.map<DataTableColumn<Resource>>((a) => ({
18
+ key: a,
19
+ header: t(`roles.${a}`),
20
+ align: "end",
21
+ cell: (r) => (
22
+ <Checkbox aria-label={`${roleName}: ${t(`roles.resources.${r}`)}, ${t(`roles.${a}`)}`} checked={draft.permissions[r][a]} disabled={!editable} onChange={(e) => onToggle(r, a, e.target.checked)} />
23
+ ),
24
+ })),
25
+ ];
26
+ ```
27
+
28
+ - Every checkbox has an `aria-label` naming role, resource and action.
29
+ - Edit a draft copy with a pure `togglePermission(role, resource, action, value)`; compare with `samePermissions` to know if the draft is dirty.
30
+ - When dirty, show a `Banner` "Unsaved changes" and enable Discard (secondary) and Save (primary) in the `FormSection` `actions`.
31
+ - The owner role is read-only: disable every checkbox and say why in the section description.
32
+ - A role that cannot update roles sees the matrix disabled and no actions.
@@ -0,0 +1,43 @@
1
+ # UX principles for admin screens
2
+
3
+ Admin users repeat the same task many times a day. Optimise for speed, scanning and safety, not for first impressions.
4
+
5
+ ## Contents
6
+ - Information
7
+ - Actions
8
+ - Feedback
9
+ - Language
10
+ - Accessibility
11
+
12
+ ## Information
13
+ - **One job per page.** The `PageHeader` title says what the page is ("Users", "Order #1042"); the description says what can be done here, in one line or not at all.
14
+ - **Scan, then act.** Lists lead with the column people search by (name, code), then status, then the rest. Numbers right-aligned in `mono`, dates in one format for the whole app.
15
+ - **Density.** Default table row height, no zebra stripes, hairlines between rows. Remove columns before shrinking text; mark the rest `hideNarrow`.
16
+ - **Progressive disclosure.** Show the 5 to 7 facts people need; put the rest behind `Tabs`, `Disclosure` or the detail page. Never hide a field that has an error.
17
+ - **Stable layout.** Skeletons match the real shape, so nothing jumps when data arrives. Buttons keep their width while busy (the label changes, not the size).
18
+
19
+ ## Actions
20
+ - **One primary button per view** (page, dialog, drawer). Everything else is secondary or ghost. In a row of actions the primary is last.
21
+ - **Verbs on buttons**: "Create user", "Suspend 3 users", never "OK", "Yes" or "Submit".
22
+ - **Reversible beats confirmed.** Prefer an action that can be undone (archive, suspend) and a `Toast` that says so. Ask with a `Dialog` only for what cannot be undone, and name the object and the count.
23
+ - **Keep the user's work.** On a failed save show the error and keep every field; leaving a dirty form asks first (`useUnsavedGuard`).
24
+ - **Hide what the role can never do; disable what it cannot do now, and say why** (hint or tooltip).
25
+ - **Keyboard first.** Enter submits a form, Esc closes the top overlay, `/` or Ctrl/Cmd+K can focus search or open the `CommandPalette`.
26
+
27
+ ## Feedback
28
+ - Respond within 100 ms: a pressed state, `busy` on the button, or a `Skeleton` for a region.
29
+ - Every data region has loading, error and empty states (see states-feedback reference).
30
+ - Success of a background action: `Toast`. Failure of a form: inline, on the field or in the form's `error`. Failure of a page load: `Banner` with a "Try again" `action`.
31
+ - Do not toast what the user can already see changed on screen (a toggled `Switch`).
32
+
33
+ ## Language
34
+ - Sentence case, short, no emoji, no exclamation marks, no "please".
35
+ - Name things the way the business does, the same word on the menu, the page title, the button and the toast.
36
+ - Errors say what happened and what to do: "This email is already used. Use another email or sign in." Not "Invalid input".
37
+ - Every string has `en` and `vi`; pass components their `labels`.
38
+
39
+ ## Accessibility
40
+ - Every control has a visible label (or `hideLabel` with an `aria-label` when a column or heading names it).
41
+ - Colour is never the only signal: `StatusDot` has a text label, an invalid field has a message.
42
+ - Focus is always visible and returns to the trigger when an overlay closes; the components do this when mounted and unmounted as documented.
43
+ - Targets at least 24px, 44px on touch layouts; text contrast follows the tokens, so do not restyle text colours.
@@ -0,0 +1,62 @@
1
+ # Visual identity
2
+
3
+ A screen can pass every rule of the design system and still look unfinished: grey initials on every card, content from edge to edge, nothing that tells one thing from the next. This page is what to add after the layout and the states are right.
4
+
5
+ ## Contents
6
+ - A face for each thing
7
+ - One width, one rhythm
8
+ - Colour
9
+ - Look before you call it done
10
+ - What goes wrong
11
+
12
+ ## A face for each thing
13
+ Where many things of one kind sit side by side (providers, integrations, tools, apps), each leads with an `Emblem`, inside a `ResourceCard` or a `ListRow`.
14
+
15
+ ```tsx
16
+ <Grid minItemWidth="15rem" gap={3}>
17
+ {providers.map((p) => (
18
+ <ResourceCard
19
+ key={p.id}
20
+ href={`#/providers/${p.id}`}
21
+ leading={<Emblem name={p.name} src={logoOf(p.id)} text={p.mark} color={p.color} />}
22
+ title={p.name}
23
+ status={<StatusDot tone="ok" label={t("providers.connected", { n })} />}
24
+ trailing={<Switch aria-label={t("providers.use", { name: p.name })} checked={on} onChange={toggle} />}
25
+ revealTrailing="hover"
26
+ />
27
+ ))}
28
+ </Grid>
29
+ ```
30
+
31
+ - **Logo first.** If the thing has a logo and you may use it, ship the file and pass `src`. It sits on a white plate in both themes.
32
+ - **Else its letters on its colour.** `text` (one to three letters) and `color` come from the data, next to the name. Without them `Emblem` shows the initials on the accent.
33
+ - **Never the same grey circle for everything.** `Avatar` is for people.
34
+ - A third party's logo names that party and nothing else: keep its shape and colours, and say where the files came from.
35
+
36
+ ## One width, one rhythm
37
+ - Every page sits in one `Container` (`xl` for lists and dashboards, `md` for forms). Content that runs to the screen edge on a wide monitor reads as unfinished.
38
+ - Above each grid: a heading and how many things it holds. A grid of 40 cards with no heading is a wall.
39
+ - A header control is as wide as its content. A `Segmented` or `Tabs` stretched across the page is a layout bug.
40
+
41
+ ## Colour
42
+ - The accent marks what to do next (the primary button, the current nav item). A thing's own colour lives in its `Emblem` and nowhere else.
43
+ - State is said in words beside a `StatusDot`. A card does not change colour with its state; a switched-off thing is `dimmed`.
44
+
45
+ ## Look before you call it done
46
+ Tests and the audit do not see ugliness. Before saying a screen is done, open it and take a screenshot:
47
+
48
+ 1. dark and light;
49
+ 2. 1440px wide and 360px wide;
50
+ 3. with real amounts of data (5 rows and 50), not only the empty state.
51
+
52
+ If there is a reference (an existing product, a mock-up), put the two pictures side by side and list what differs.
53
+
54
+ ## What goes wrong
55
+
56
+ | what you see | cause | fix |
57
+ |---|---|---|
58
+ | Every card has the same grey circle with letters | `Avatar` used for things | `Emblem` with `src`, or `text` and `color` |
59
+ | Letters are cut off or the brand logo changed size | a class of your own named like a library class (`.x-mark`) | prefix app classes with the app, never `x-` |
60
+ | Content touches both screen edges at 1440px | no `Container` | wrap the page |
61
+ | A logo vanishes in dark mode | logo drawn on the page colour | pass it as `Emblem src` |
62
+ | The page passes the audit and still looks flat | nobody looked at it | the screenshots above |