@ensi-platform/admin-ui 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/dist/Component-CBWeJZfB.js +92 -0
  2. package/dist/Component-CBWeJZfB.js.map +1 -0
  3. package/dist/Component-DFwWbzFS.js +128 -0
  4. package/dist/Component-DFwWbzFS.js.map +1 -0
  5. package/dist/{Component-Bk0VFhAQ.js → Component-DhhrZEMr.js} +2 -2
  6. package/dist/{Component-Bk0VFhAQ.js.map → Component-DhhrZEMr.js.map} +1 -1
  7. package/dist/Component-Dkvzqo0L.js +155 -0
  8. package/dist/Component-Dkvzqo0L.js.map +1 -0
  9. package/dist/action-popup/index.js +1 -1
  10. package/dist/arrangement-settings/index.js +1 -1
  11. package/dist/assets/Component16.css +1 -1
  12. package/dist/assets/Component5.css +1 -1
  13. package/dist/assets/Component7.css +1 -1
  14. package/dist/assets/Component9.css +1 -1
  15. package/dist/assets/index.css +1 -1
  16. package/dist/assets/index17.css +1 -1
  17. package/dist/assets/index26.css +1 -1
  18. package/dist/assets/index27.css +1 -1
  19. package/dist/autocomplete/index.js +1 -1
  20. package/dist/autocomplete-async/index.js +1 -1
  21. package/dist/button/Component.d.ts +1 -1
  22. package/dist/button/Component.d.ts.map +1 -1
  23. package/dist/button/index.js +1 -1
  24. package/dist/button/theme.d.ts +1 -0
  25. package/dist/button/theme.d.ts.map +1 -1
  26. package/dist/button/types.d.ts +2 -0
  27. package/dist/button/types.d.ts.map +1 -1
  28. package/dist/checkbox/index.js +1 -1
  29. package/dist/checkbox-group/index.js +1 -1
  30. package/dist/data-table/index.js +1 -1
  31. package/dist/date-picker/index.js +1 -1
  32. package/dist/date-range-picker/index.js +1 -1
  33. package/dist/form/Component.d.ts +1 -1
  34. package/dist/form/Component.d.ts.map +1 -1
  35. package/dist/form/context.d.ts +3 -1
  36. package/dist/form/context.d.ts.map +1 -1
  37. package/dist/form/hooks/useFieldHook.d.ts +2 -1
  38. package/dist/form/hooks/useFieldHook.d.ts.map +1 -1
  39. package/dist/form/index.js +84 -74
  40. package/dist/form/index.js.map +1 -1
  41. package/dist/form/types.d.ts +15 -2
  42. package/dist/form/types.d.ts.map +1 -1
  43. package/dist/form/utils.d.ts +3 -0
  44. package/dist/form/utils.d.ts.map +1 -1
  45. package/dist/input/Component.d.ts +1 -1
  46. package/dist/input/Component.d.ts.map +1 -1
  47. package/dist/input/FormInput.d.ts +1 -1
  48. package/dist/input/FormInput.d.ts.map +1 -1
  49. package/dist/input/index.js +27 -25
  50. package/dist/input/index.js.map +1 -1
  51. package/dist/input/types.d.ts +5 -1
  52. package/dist/input/types.d.ts.map +1 -1
  53. package/dist/multi-autocomplete/index.js +1 -1
  54. package/dist/multi-autocomplete-async/index.js +1 -1
  55. package/dist/multi-select/index.js +1 -1
  56. package/dist/number-input/Component.d.ts +1 -1
  57. package/dist/number-input/Component.d.ts.map +1 -1
  58. package/dist/number-input/FormNumberInput.d.ts +1 -1
  59. package/dist/number-input/FormNumberInput.d.ts.map +1 -1
  60. package/dist/number-input/index.js +41 -39
  61. package/dist/number-input/index.js.map +1 -1
  62. package/dist/number-input/types.d.ts +5 -1
  63. package/dist/number-input/types.d.ts.map +1 -1
  64. package/dist/number-range/index.js +2 -2
  65. package/dist/select/index.js +1 -1
  66. package/dist/slider/index.js +1 -1
  67. package/dist/suggest-checklist/index.js +1 -1
  68. package/dist/switch/index.js +1 -1
  69. package/dist/table/index.js +1 -1
  70. package/dist/textarea/Component.d.ts +1 -1
  71. package/dist/textarea/Component.d.ts.map +1 -1
  72. package/dist/textarea/FormTextArea.d.ts +1 -1
  73. package/dist/textarea/FormTextArea.d.ts.map +1 -1
  74. package/dist/textarea/index.js +91 -86
  75. package/dist/textarea/index.js.map +1 -1
  76. package/dist/textarea/types.d.ts +5 -1
  77. package/dist/textarea/types.d.ts.map +1 -1
  78. package/dist/time-field/index.js +1 -1
  79. package/dist/useFieldHook-Bt9nST7g.js +52 -0
  80. package/dist/useFieldHook-Bt9nST7g.js.map +1 -0
  81. package/docs/README.md +3 -4
  82. package/docs/ai.md +42 -28
  83. package/docs/architecture.md +23 -23
  84. package/docs/design-language.md +103 -0
  85. package/docs/skills/SKILL.md +64 -25
  86. package/package.json +10 -6
  87. package/scripts/sync-agents-consumer.ts +2 -1
  88. package/src/button/docs/{Description.en.md → Description.md} +1 -0
  89. package/src/button/types.ts +2 -0
  90. package/src/cascade-menu/docs/cssVariables.ts +2 -1
  91. package/src/combobox/docs/Description.md +27 -0
  92. package/src/combobox/docs/Example.md +11 -0
  93. package/src/docs/ai/Description.md +60 -0
  94. package/src/docs/getting-started/Description.md +81 -0
  95. package/src/ds/tokens/docs/Description.md +30 -0
  96. package/src/ds/typography/docs/{Description.en.md → Description.md} +3 -3
  97. package/src/form/docs/{Description.en.md → Description.md} +2 -1
  98. package/src/form/types.ts +18 -3
  99. package/src/hooks/docs/Description.md +30 -0
  100. package/src/hooks/docs/Example.md +9 -0
  101. package/src/icons/docs/Description.md +23 -0
  102. package/src/icons/docs/Example.md +5 -0
  103. package/src/input/docs/{Description.en.md → Description.md} +3 -1
  104. package/src/input/docs/cssVariables.ts +1 -0
  105. package/src/input/types.ts +5 -1
  106. package/src/link/docs/cssVariables.ts +1 -1
  107. package/src/number-input/docs/{Description.en.md → Description.md} +3 -1
  108. package/src/number-input/docs/cssVariables.ts +1 -0
  109. package/src/number-input/types.ts +5 -0
  110. package/src/table/docs/cssVariables.ts +3 -3
  111. package/src/tabs/docs/{Description.en.md → Description.md} +17 -0
  112. package/src/textarea/docs/{Description.en.md → Description.md} +3 -1
  113. package/src/textarea/docs/cssVariables.ts +1 -0
  114. package/src/textarea/types.ts +5 -1
  115. package/src/toast/docs/cssVariables.ts +1 -1
  116. package/src/tooltip/docs/cssVariables.ts +2 -2
  117. package/dist/Component-BBFBVrTt.js +0 -152
  118. package/dist/Component-BBFBVrTt.js.map +0 -1
  119. package/dist/Component-C4pVS7OW.js +0 -125
  120. package/dist/Component-C4pVS7OW.js.map +0 -1
  121. package/dist/Component-VS3iDpxE.js +0 -85
  122. package/dist/Component-VS3iDpxE.js.map +0 -1
  123. package/dist/utils-CizYZV2a.js +0 -50
  124. package/dist/utils-CizYZV2a.js.map +0 -1
  125. package/docs/skills/evals/evals.json +0 -23
  126. package/src/action-popup/docs/Description.ru.md +0 -40
  127. package/src/action-popup/docs/Example.ru.md +0 -14
  128. package/src/active-filters/docs/Description.ru.md +0 -49
  129. package/src/active-filters/docs/Example.ru.md +0 -15
  130. package/src/arrangement-settings/docs/Description.ru.md +0 -25
  131. package/src/arrangement-settings/docs/Example.ru.md +0 -15
  132. package/src/autocomplete/docs/Description.ru.md +0 -51
  133. package/src/autocomplete/docs/Example.ru.md +0 -17
  134. package/src/autocomplete-async/docs/Description.ru.md +0 -71
  135. package/src/autocomplete-async/docs/Example.ru.md +0 -19
  136. package/src/avatar/docs/Description.ru.md +0 -23
  137. package/src/avatar/docs/Example.ru.md +0 -7
  138. package/src/badge/docs/Description.ru.md +0 -22
  139. package/src/badge/docs/Example.ru.md +0 -8
  140. package/src/bottom-sheet/docs/Description.ru.md +0 -27
  141. package/src/bottom-sheet/docs/Example.ru.md +0 -14
  142. package/src/button/docs/Description.ru.md +0 -24
  143. package/src/button/docs/Example.ru.md +0 -11
  144. package/src/cascade-menu/docs/Description.ru.md +0 -43
  145. package/src/cascade-menu/docs/Example.ru.md +0 -107
  146. package/src/checkbox/docs/Description.ru.md +0 -42
  147. package/src/checkbox/docs/Example.ru.md +0 -13
  148. package/src/checkbox-group/docs/Description.ru.md +0 -39
  149. package/src/checkbox-group/docs/Example.ru.md +0 -17
  150. package/src/context-menu/docs/Description.ru.md +0 -44
  151. package/src/context-menu/docs/Example.ru.md +0 -22
  152. package/src/data-table/docs/Description.ru.md +0 -33
  153. package/src/data-table/docs/Example.ru.md +0 -82
  154. package/src/date-picker/docs/Description.ru.md +0 -43
  155. package/src/date-picker/docs/Example.ru.md +0 -15
  156. package/src/date-range-picker/docs/Description.ru.md +0 -39
  157. package/src/date-range-picker/docs/Example.ru.md +0 -19
  158. package/src/drawer/docs/Description.ru.md +0 -28
  159. package/src/drawer/docs/Example.ru.md +0 -14
  160. package/src/ds/typography/docs/Description.ru.md +0 -35
  161. package/src/field/docs/Description.ru.md +0 -28
  162. package/src/field/docs/Example.ru.md +0 -16
  163. package/src/filters/docs/Description.ru.md +0 -40
  164. package/src/filters/docs/Example.ru.md +0 -21
  165. package/src/form/docs/Description.ru.md +0 -33
  166. package/src/form/docs/Example.ru.md +0 -18
  167. package/src/input/docs/Description.ru.md +0 -41
  168. package/src/input/docs/Example.ru.md +0 -21
  169. package/src/link/docs/Description.ru.md +0 -21
  170. package/src/link/docs/Example.ru.md +0 -16
  171. package/src/loader/docs/Description.ru.md +0 -21
  172. package/src/loader/docs/Example.ru.md +0 -10
  173. package/src/menu-list/docs/Description.ru.md +0 -45
  174. package/src/menu-list/docs/Example.ru.md +0 -14
  175. package/src/modal/docs/Description.ru.md +0 -25
  176. package/src/modal/docs/Example.ru.md +0 -15
  177. package/src/modal-hub/docs/Description.ru.md +0 -35
  178. package/src/modal-hub/docs/Example.ru.md +0 -20
  179. package/src/multi-autocomplete/docs/Description.ru.md +0 -52
  180. package/src/multi-autocomplete/docs/Example.ru.md +0 -12
  181. package/src/multi-autocomplete-async/docs/Description.ru.md +0 -55
  182. package/src/multi-autocomplete-async/docs/Example.ru.md +0 -5
  183. package/src/multi-select/docs/Description.ru.md +0 -46
  184. package/src/multi-select/docs/Example.ru.md +0 -20
  185. package/src/number-input/docs/Description.ru.md +0 -46
  186. package/src/number-input/docs/Example.ru.md +0 -19
  187. package/src/number-range/docs/Description.ru.md +0 -49
  188. package/src/number-range/docs/Example.ru.md +0 -25
  189. package/src/popover/docs/Description.ru.md +0 -33
  190. package/src/popover/docs/Example.ru.md +0 -13
  191. package/src/provider/docs/Description.ru.md +0 -27
  192. package/src/provider/docs/Example.ru.md +0 -10
  193. package/src/select/docs/Description.ru.md +0 -46
  194. package/src/select/docs/Example.ru.md +0 -20
  195. package/src/slider/docs/Description.ru.md +0 -45
  196. package/src/slider/docs/Example.ru.md +0 -17
  197. package/src/suggest-checklist/docs/Description.ru.md +0 -26
  198. package/src/suggest-checklist/docs/Example.ru.md +0 -11
  199. package/src/switch/docs/Description.ru.md +0 -39
  200. package/src/switch/docs/Example.ru.md +0 -13
  201. package/src/table/docs/Description.ru.md +0 -32
  202. package/src/table/docs/Example.ru.md +0 -67
  203. package/src/tabs/docs/Description.ru.md +0 -24
  204. package/src/tabs/docs/Example.ru.md +0 -12
  205. package/src/tag/docs/Description.ru.md +0 -24
  206. package/src/tag/docs/Example.ru.md +0 -6
  207. package/src/textarea/docs/Description.ru.md +0 -40
  208. package/src/textarea/docs/Example.ru.md +0 -21
  209. package/src/time-field/docs/Description.ru.md +0 -41
  210. package/src/time-field/docs/Example.ru.md +0 -9
  211. package/src/toast/docs/Description.ru.md +0 -57
  212. package/src/toast/docs/Example.ru.md +0 -25
  213. package/src/tooltip/docs/Description.ru.md +0 -34
  214. package/src/tooltip/docs/Example.ru.md +0 -10
  215. /package/src/action-popup/docs/{Description.en.md → Description.md} +0 -0
  216. /package/src/action-popup/docs/{Example.en.md → Example.md} +0 -0
  217. /package/src/active-filters/docs/{Description.en.md → Description.md} +0 -0
  218. /package/src/active-filters/docs/{Example.en.md → Example.md} +0 -0
  219. /package/src/arrangement-settings/docs/{Description.en.md → Description.md} +0 -0
  220. /package/src/arrangement-settings/docs/{Example.en.md → Example.md} +0 -0
  221. /package/src/autocomplete/docs/{Description.en.md → Description.md} +0 -0
  222. /package/src/autocomplete/docs/{Example.en.md → Example.md} +0 -0
  223. /package/src/autocomplete-async/docs/{Description.en.md → Description.md} +0 -0
  224. /package/src/autocomplete-async/docs/{Example.en.md → Example.md} +0 -0
  225. /package/src/avatar/docs/{Description.en.md → Description.md} +0 -0
  226. /package/src/avatar/docs/{Example.en.md → Example.md} +0 -0
  227. /package/src/badge/docs/{Description.en.md → Description.md} +0 -0
  228. /package/src/badge/docs/{Example.en.md → Example.md} +0 -0
  229. /package/src/bottom-sheet/docs/{Description.en.md → Description.md} +0 -0
  230. /package/src/bottom-sheet/docs/{Example.en.md → Example.md} +0 -0
  231. /package/src/button/docs/{Example.en.md → Example.md} +0 -0
  232. /package/src/cascade-menu/docs/{Description.en.md → Description.md} +0 -0
  233. /package/src/cascade-menu/docs/{Example.en.md → Example.md} +0 -0
  234. /package/src/checkbox/docs/{Description.en.md → Description.md} +0 -0
  235. /package/src/checkbox/docs/{Example.en.md → Example.md} +0 -0
  236. /package/src/checkbox-group/docs/{Description.en.md → Description.md} +0 -0
  237. /package/src/checkbox-group/docs/{Example.en.md → Example.md} +0 -0
  238. /package/src/context-menu/docs/{Description.en.md → Description.md} +0 -0
  239. /package/src/context-menu/docs/{Example.en.md → Example.md} +0 -0
  240. /package/src/data-table/docs/{Description.en.md → Description.md} +0 -0
  241. /package/src/data-table/docs/{Example.en.md → Example.md} +0 -0
  242. /package/src/date-picker/docs/{Description.en.md → Description.md} +0 -0
  243. /package/src/date-picker/docs/{Example.en.md → Example.md} +0 -0
  244. /package/src/date-range-picker/docs/{Description.en.md → Description.md} +0 -0
  245. /package/src/date-range-picker/docs/{Example.en.md → Example.md} +0 -0
  246. /package/src/drawer/docs/{Description.en.md → Description.md} +0 -0
  247. /package/src/drawer/docs/{Example.en.md → Example.md} +0 -0
  248. /package/src/field/docs/{Description.en.md → Description.md} +0 -0
  249. /package/src/field/docs/{Example.en.md → Example.md} +0 -0
  250. /package/src/filters/docs/{Description.en.md → Description.md} +0 -0
  251. /package/src/filters/docs/{Example.en.md → Example.md} +0 -0
  252. /package/src/form/docs/{Example.en.md → Example.md} +0 -0
  253. /package/src/input/docs/{Example.en.md → Example.md} +0 -0
  254. /package/src/link/docs/{Description.en.md → Description.md} +0 -0
  255. /package/src/link/docs/{Example.en.md → Example.md} +0 -0
  256. /package/src/loader/docs/{Description.en.md → Description.md} +0 -0
  257. /package/src/loader/docs/{Example.en.md → Example.md} +0 -0
  258. /package/src/menu-list/docs/{Description.en.md → Description.md} +0 -0
  259. /package/src/menu-list/docs/{Example.en.md → Example.md} +0 -0
  260. /package/src/modal/docs/{Description.en.md → Description.md} +0 -0
  261. /package/src/modal/docs/{Example.en.md → Example.md} +0 -0
  262. /package/src/modal-hub/docs/{Description.en.md → Description.md} +0 -0
  263. /package/src/modal-hub/docs/{Example.en.md → Example.md} +0 -0
  264. /package/src/multi-autocomplete/docs/{Description.en.md → Description.md} +0 -0
  265. /package/src/multi-autocomplete/docs/{Example.en.md → Example.md} +0 -0
  266. /package/src/multi-autocomplete-async/docs/{Description.en.md → Description.md} +0 -0
  267. /package/src/multi-autocomplete-async/docs/{Example.en.md → Example.md} +0 -0
  268. /package/src/multi-select/docs/{Description.en.md → Description.md} +0 -0
  269. /package/src/multi-select/docs/{Example.en.md → Example.md} +0 -0
  270. /package/src/number-input/docs/{Example.en.md → Example.md} +0 -0
  271. /package/src/number-range/docs/{Description.en.md → Description.md} +0 -0
  272. /package/src/number-range/docs/{Example.en.md → Example.md} +0 -0
  273. /package/src/popover/docs/{Description.en.md → Description.md} +0 -0
  274. /package/src/popover/docs/{Example.en.md → Example.md} +0 -0
  275. /package/src/provider/docs/{Description.en.md → Description.md} +0 -0
  276. /package/src/provider/docs/{Example.en.md → Example.md} +0 -0
  277. /package/src/select/docs/{Description.en.md → Description.md} +0 -0
  278. /package/src/select/docs/{Example.en.md → Example.md} +0 -0
  279. /package/src/slider/docs/{Description.en.md → Description.md} +0 -0
  280. /package/src/slider/docs/{Example.en.md → Example.md} +0 -0
  281. /package/src/suggest-checklist/docs/{Description.en.md → Description.md} +0 -0
  282. /package/src/suggest-checklist/docs/{Example.en.md → Example.md} +0 -0
  283. /package/src/switch/docs/{Description.en.md → Description.md} +0 -0
  284. /package/src/switch/docs/{Example.en.md → Example.md} +0 -0
  285. /package/src/table/docs/{Description.en.md → Description.md} +0 -0
  286. /package/src/table/docs/{Example.en.md → Example.md} +0 -0
  287. /package/src/tabs/docs/{Example.en.md → Example.md} +0 -0
  288. /package/src/tag/docs/{Description.en.md → Description.md} +0 -0
  289. /package/src/tag/docs/{Example.en.md → Example.md} +0 -0
  290. /package/src/textarea/docs/{Example.en.md → Example.md} +0 -0
  291. /package/src/time-field/docs/{Description.en.md → Description.md} +0 -0
  292. /package/src/time-field/docs/{Example.en.md → Example.md} +0 -0
  293. /package/src/toast/docs/{Description.en.md → Description.md} +0 -0
  294. /package/src/toast/docs/{Example.en.md → Example.md} +0 -0
  295. /package/src/tooltip/docs/{Description.en.md → Description.md} +0 -0
  296. /package/src/tooltip/docs/{Example.en.md → Example.md} +0 -0
@@ -0,0 +1,103 @@
1
+ # Design language (admin UI)
2
+
3
+ Visual canon for Ensi admin screens. `--aui-*` tokens live in Storybook Design System / Tokens and in `src/ds/tokens/docs/Description.md`. This file is **layers, sidebar, and how to assemble screens**.
4
+
5
+ ## Formula
6
+
7
+ A fill (bg) or a stroke (border) on its own is fine.
8
+ Many of them **together**, **and** inside nested boxes, is noise.
9
+
10
+ | Rule | |
11
+ | --- | --- |
12
+ | Zone container | **XOR**: either `surface-bg-*` or `surface-border-*`, not both |
13
+ | Nesting budget | ≤ **2** surface boxes from `page` to the deepest leaf |
14
+ | Chip / Tag / Badge | one signal: tint **or** outline, not both |
15
+ | Separating zones | gap / divider / bg contrast — not another card |
16
+
17
+ **Exceptions** (bg + border are allowed):
18
+
19
+ - an interactive control (`Input`, `Select`, …)
20
+ - focus ring
21
+ - semantic alert (danger/warning box)
22
+
23
+ Layer reference: Kontur.Diadoc (fills and strokes exist, stacked frames do not).
24
+ Anti-reference: Elba / old nested boxes (muted bar → bordered controls inside → another card outside).
25
+
26
+ ## App chrome / CascadeMenu
27
+
28
+ Ready-made column: `@ensi-platform/admin-ui/cascade-menu` (`CascadeMenu`).
29
+ Parts: `MenuList` (`@ensi-platform/admin-ui/menu-list`), `Avatar` (`@ensi-platform/admin-ui/avatar`), logo `LogoEnsiMark` + the text `ensi-opensource`.
30
+
31
+ **Chrome source of truth:** Storybook `App/CascadeMenu` + this section (WIP).
32
+
33
+ | | Yes | No |
34
+ | --- | --- | --- |
35
+ | Navigation | hover flyout on the arrow (aim-delay); L0 stays in the layout | flat dissolve; accordion; Back button |
36
+ | Logo | `LogoEnsiMark` + text `ensi-opensource`, `currentColor`; optional `title` under the brand; collapse → Mark only | full `LogoEnsi` wordmark in the opensource chrome; a hard-coded `#000` / `#fff` in the SVG; collapse only in the footer |
37
+ | L0 column | light: `neutral-50` `#fafafa` (page is white); dark: `--aui-black-900`; hover `--aui-surface-bg-muted` / `--aui-grey-700`; fg = page; resize; collapse → icon rail; in the rail a folder hover opens a flyout, a leaf opens a Tooltip | a column in another hue; collapse that disables the flyout |
38
+ | Flyout | full height = L0 height; flush left; same bg as L0; border-right divider; no shadow/radius; also works from the collapsed rail | floating card from the item; push layout; surface / light panel |
39
+ | Active | `data-open` only on the open flyout folder; current leaf has no pill (breadcrumbs) | a persistent path pill from `activePath`; a soft pill on the leaf; pill **and** left bar **and** border |
40
+ | Pins | one Pinned item on L0 → hover flyout with the list; hint about right-click when empty; RMB Pin/Unpin (not on L0) + Open in new tab; leaf+folder; divider; limit 8; LS keyed by `pinUserId` | N pins listed directly on L0; pin on L0; trailing pin button; a card around pins; DnD; sticky flyout |
41
+ | User | divider + `Avatar` → `Popover` | user inside a bordered card |
42
+ | Search | button next to collapse; dimmed backdrop + a small window above center (field and a list of `link` leaves + path); Escape / backdrop click closes; the rail does not expand | an in-place tree filter; counters |
43
+
44
+ CascadeMenu is layer 0 (app chrome). It does **not** count toward the content budget of tables and forms.
45
+
46
+ The `sidebar | page` layout belongs to the consumer (the flyout covers the page).
47
+ Z-order: L0+flyout (`--aui-z-chrome`) above a sticky table (`--aui-table-z-sticky`), below dropdown/modal (`--aui-z-dropdown` / `--aui-z-modal`).
48
+
49
+ ## Screens (assembled from Base)
50
+
51
+ Primitives: `CascadeMenu` / `MenuList`, `Button`, `Tag`, `Badge`, `Table`, `Tabs`, `Field` + controls, and `Drawer` when needed.
52
+
53
+ ### List — table
54
+
55
+ - title (`headingM`); `Button` secondary “Filters” + primary “+ New …”
56
+ - applied filters: `ActiveFilters` (`Tag` + a “Clear” link) — **no** bordered bar around the row
57
+ - `Table` flush on `page` — **no** outer rounded card
58
+ - status in a cell — `Badge` (tint only)
59
+ - pagination: active = fill; **no** border box on every page
60
+ - do not use a segmented “Table | Filters” (two outlined buttons)
61
+
62
+ ### List — filters
63
+
64
+ - the same title / primary action
65
+ - a grid of `Field` + Select / DateRange / … on `page`
66
+ - **no** card wrapper and **no** muted bar around the controls
67
+ - a long form goes in a `Drawer`, not another nested box on the page
68
+ - no pill tabs as document-type filters
69
+
70
+ ### Detail
71
+
72
+ - back link; title + `Badge`; `⋯` + primary “Save”
73
+ - page sections — underline `Tabs` (not a pill row with a border)
74
+ - sections: H2 + gap; fields on `page` — **no** card per section
75
+ - one alert (bg+border) is the only heavy nested block
76
+ - tags inside a field — tint, with no second stroke on top of `Field`
77
+
78
+ ## Theme (from `src/ds/tokens`)
79
+
80
+ Light / dark are one contract, remapped (`data-theme`). Dark is not a different product look. Font: Inter. List / detail page title — `typographyStyles.headingM`. Space / radius / control height — rem (root 16px on `AdminUiProvider`).
81
+
82
+ | Role | Light | Dark |
83
+ | --- | --- | --- |
84
+ | page bg | `#ffffff` | `#1b1d22` (`black-900`) |
85
+ | page fg | `#0a0a0a` (`neutral-900`) | `#f1f5f9` (`grey-100`) |
86
+ | fg muted | `#737373` (`neutral-500`) | `#8b929e` (`grey-400`) |
87
+ | link | = page fg (underline); hover `neutral-800` | = page fg; hover white |
88
+ | sidebar | `#fafafa` (`neutral-50`) | = page |
89
+ | surface muted (secondary btn / tag) | `#f5f5f5` (`neutral-100`) | `#3f4651` (`grey-600`) |
90
+ | surface primary (input fill) | `#ffffff` | `#212328` (`black-800`) |
91
+ | table fill | = page (flush) | = page (flush) |
92
+ | surface border | `#e5e5e5` (`neutral-200`) | `#3f4651` (`grey-600`) |
93
+ | primary button | bg `#171717` (`neutral-800`), fg `#fafafa` | bg `#f1f5f9`, fg `#1b1d22` |
94
+ | focus | `#a1a1a1` (`neutral-400`) | grey-100 |
95
+ | badge success/warning/danger | soft `*-50` bg + `*-700` fg | `color-mix(*-500 22%, surface)` + `*-500` fg |
96
+ | badge info | = neutral | = neutral |
97
+ | control radius | `8px` (`radius-8`) | same |
98
+
99
+ Light accent = neutral (`neutral-800` / `#171717`). Dark accent = a light grey fill. Status = red/green/yellow only (info = neutral).
100
+
101
+ ## Related
102
+
103
+ - consumer skill: [`skills/`](./skills/) — which primitive to pick; screen visuals — this file
@@ -2,9 +2,9 @@
2
2
  name: admin-ui
3
3
  description: >-
4
4
  Build Ensi admin UI with @ensi-platform/admin-ui primitives (Button, Field,
5
- Form*, Select, Modal, Table, tokens, Provider). Use whenever the user builds
6
- or changes admin screens, forms, filters, overlays, or asks which control to
7
- pick — even if they do not name the package.
5
+ Form*, Select, Modal, Table, icons, tokens, Provider). Use whenever the user builds
6
+ or changes admin screens, forms, filters, overlays, lists, detail pages, or
7
+ asks which control to pick — even if they do not name the package.
8
8
  ---
9
9
 
10
10
  # admin-ui
@@ -14,40 +14,79 @@ Skill for **consuming** the package (assemble UI). Authoring Description / stori
14
14
  ## Before coding
15
15
 
16
16
  1. Pick the primitive (table below).
17
- 2. Read — do not invent API:
18
- - `src/<name>/docs/Description.ru.md` or `Description.en.md`
19
- - `src/<name>/types.ts` (when present)
20
- - if unsure: `Example.*.md`
21
- 3. In a consumer app: same files under `node_modules/@ensi-platform/admin-ui/...`. Prefer Description over guessing from neighbouring JSX.
17
+ 2. If you build a whole screen (list, filters, detail page, page chrome), also read `node_modules/@ensi-platform/admin-ui/docs/design-language.md` first. It defines layer budget (container: bg XOR border, nesting <= 2), list/filters/detail layouts, theme colours.
18
+ 3. Read — do not invent API:
19
+ - `node_modules/@ensi-platform/admin-ui/src/<name>/docs/Description.md`
20
+ - `node_modules/@ensi-platform/admin-ui/src/<name>/types.ts` (when present)
21
+ - if unsure: `Example.md` in the same folder
22
+ 4. Prefer Description over guessing from neighbouring JSX.
22
23
 
23
- Package channel overview: [`docs/ai.md`](../ai.md). Architecture: [`docs/architecture.md`](../architecture.md).
24
+ Package channel overview: `node_modules/@ensi-platform/admin-ui/docs/ai.md`. Architecture: `node_modules/@ensi-platform/admin-ui/docs/architecture.md`.
24
25
 
25
26
  ## Setup (host app)
26
27
 
27
28
  - tokens once: `import '@ensi-platform/admin-ui/tokens'`
29
+ - which `--aui-*` an app layout may use: `node_modules/@ensi-platform/admin-ui/src/ds/tokens/docs/Description.md`
28
30
  - `AdminUiProvider` from `@ensi-platform/admin-ui/provider` at the UI root (locale, portals, built-in labels, page substrate; content inset on host `main`)
29
31
  - theme: `data-theme` on `document.documentElement` (`light` | `dark`)
32
+ - Full provider example (`labels`) and router `Link` wrapper (`react-router` / `next/link`): `node_modules/@ensi-platform/admin-ui/src/docs/getting-started/Description.md`
30
33
 
31
34
  ## Choose
32
35
 
36
+ Import `@ensi-platform/admin-ui/<folder>` (`button`, `date-picker`, …). Inside `Form`, use the `Form*` exported next to that control (`FormInput`, `FormDatePicker`, …). Props stay in that primitive’s `Description.md`.
37
+
33
38
  | Need | Use | Not |
34
39
  | --- | --- | --- |
35
- | app sidebar / main menu | `CascadeMenu` | invent a second cascade / card-nav |
36
- | menu column items only | `MenuList` | rebuild inside page chrome |
37
- | user avatar circle | `Avatar` | ad-hoc initials span |
38
- | action / submit / link-as-button | `Button` | — |
39
- | entity status (read-only) | `Badge` | `Tag` |
40
- | removable chip / filter value / MultiSelect chips | `Tag` | `Badge` |
41
- | applied filters on a list (chips + clear) | `ActiveFilters` | `Filters`, `Badge` |
42
- | single-line text | `Input` / `FormInput` | `Textarea` |
43
- | multi-line text | `Textarea` / `FormTextarea` | `Input` |
44
- | one from a list | `Select` / `FormSelect` | `MultiSelect` |
45
- | several from a list | `MultiSelect` / `FormMultiSelect` | `Select` |
46
- | date / range / time | `DatePicker` / `DateRangePicker` / `TimeField` (+ Form*) | — |
47
- | confirm / delete dialog | `ConfirmModal` / `DeleteModal` / `ActionPopup` | raw `Modal` unless custom chrome |
48
- | custom dialog shell | `Modal` | — |
49
- | field chrome (label / hint / error) | `Field` | invent `FormControl` |
50
- | async feedback | `Toast` / `Loader` | read Description first |
40
+ | Persistent admin nav: nested section tree, hover flyout, pins, collapse. Tree in `items`; optional `allowedCodes` and current URL `activePath` | `CascadeMenu` | a second cascade, accordion, or card-nav. One column without logo / user / collapse — `MenuList` |
41
+ | Section list only: groups and leaf items, no nested accordion | `MenuList` | the full sidebar — `CascadeMenu` |
42
+ | User circle in the sidebar, header, or a list. Initials from `name` / `initials`, or a photo via `src` | `Avatar` | an ad-hoc initials span; a status — `Badge` |
43
+ | Primary, secondary, or danger action, or a form submit (`type="submit"`) | `Button` | a restyled `Link` |
44
+ | Read-only entity status (“Paid”, “In assembly”). No click and no remove | `Badge` | `Tag` |
45
+ | Removable chip: a `MultiSelect` value or one applied filter | `Tag` | `Badge` |
46
+ | Applied filters on a list: one chip per value, remove, and a clear link. Several values of one field collapse into a count chip | `ActiveFilters` | `Filters` (the form), `Badge` |
47
+ | Free single-line text: name, email, search | `Input` / `FormInput` | multiline — `TextArea`; a number — `NumberInput` |
48
+ | Free multiline text: comment, description, address | `TextArea` / `FormTextArea` | `Input` |
49
+ | One value from a dictionary or enum, no typing | `Select` / `FormSelect` | several values — `MultiSelect`; typing — `Autocomplete` |
50
+ | Several values from a dictionary or enum, no typing | `MultiSelect` / `FormMultiSelect` | `Select`; a status in a cell — `Badge` |
51
+ | One date, or a date with time (`granularity` on the same control) | `DatePicker` / `FormDatePicker` | a period — `DateRangePicker`; time only — `TimeField` |
52
+ | A date period: list filters, reports | `DateRangePicker` / `FormDateRangePicker` | one date — `DatePicker` |
53
+ | Time of day only | `TimeField` / `FormTimeField` | a date — `DatePicker` |
54
+ | Confirm (primary) or delete (danger). Custom tone and labels — `ActionPopup`. Open from a helper with `useModal({ Component, props })` | `ConfirmModal` / `DeleteModal` / `ActionPopup` from `action-popup` | raw `Modal`, unless the chrome itself is custom |
55
+ | Dialog shell over the page: custom body, not a confirm/delete preset | `Modal` | `ConfirmModal` / `DeleteModal` |
56
+ | Label, hint, and error around a control. Error text is passed in (including from RHF). `Field` has no `name` | `Field` | `FormControl`. Wiring a form field is `Form` + `Form*` |
57
+ | Short message after save, delete, or a failed request. Mount `ToastProvider` and `ToastRegion` yourself (they are not inside `AdminUiProvider`). Call `useToast()` → `appendToast` / `closeToast`. Default stack cap is 5 | `Toast` | `Loader`, which blocks the surface instead of messaging |
58
+ | Block clicks on a list, card, or form while data loads. On refetch the children stay mounted | `Loader` | `Toast` |
59
+ | Entity list whose sort and column filter live in the header, plus a row action menu | `DataTable` (+ `ContextMenu`) | bare `Table` |
60
+ | List chrome only: custom cells, pagination, `PageSize`. Row selection — `useTableRowSelection` | `Table` | `DataTable` when the header should sort or filter |
61
+ | Sections of one page or entity card. Underline, not a pill row | `Tabs` | bordered segment buttons |
62
+ | Filters or details at the side. Long content that must not cover the viewport the way `Modal` does | `Drawer` | a nested card on the page; on mobile — `BottomSheet` |
63
+ | The same panel on a narrow screen, dismissed with a swipe down | `BottomSheet` | a side `Drawer` |
64
+ | Filter form of a list page. Fields sit on the page: no card and no muted bar. A date or a range may span more columns than a short field | `Filters` | applied chips — `ActiveFilters`; which fields exist and their order — `ArrangementSettings` |
65
+ | The user chooses which filters or columns are visible and in which order. Values stay in `Filters`, columns stay in `Table` | `ArrangementSettings` | `Filters` for the values themselves |
66
+ | Create/edit page, or a filter submit, with a zod schema. RHF state lives in `Form`; each control is the matching `Form*` | `Form` + `FormInput` / `FormSelect` / … | hand-rolled RHF, React Aria `Form`, `FormControl` |
67
+ | One `boolean` | `Checkbox` / `FormCheckbox` | a settings on/off — `Switch`; several options — `CheckboxGroup` |
68
+ | Several options, more than one can be on (`string[]`) | `CheckboxGroup` / `FormCheckboxGroup` | one `Checkbox` |
69
+ | Settings flag, on/off, no checkmark | `Switch` / `FormSwitch` | `Checkbox` |
70
+ | Quantity, price, or weight. Money goes through `formatOptions`; store a `number` (there is no MoneyInput) | `NumberInput` / `FormNumberInput` | `Input` |
71
+ | From–to filter for an amount, quantity, or price | `NumberRange` / `FormNumberRange` | one number — `NumberInput`; a date period — `DateRangePicker` |
72
+ | A value on a track: scale, volume, ratio | `Slider` / `FormSlider` | an exact number from the keyboard — `NumberInput` |
73
+ | One value; the user types to filter a local list | `Autocomplete` / `FormAutocomplete` | no typing — `Select`; a request — `AutocompleteAsync` |
74
+ | One value; suggestions come from the app’s request (React Query / `fetch`) | `AutocompleteAsync` / `FormAutocompleteAsync` | a local list — `Autocomplete` |
75
+ | Several values; the user types to filter a local list | `MultiAutocomplete` / `FormMultiAutocomplete` | no typing — `MultiSelect`; a request — `MultiAutocompleteAsync` |
76
+ | Several values from backend suggestions | `MultiAutocompleteAsync` / `FormMultiAutocompleteAsync` | a local list — `MultiAutocomplete`; a checkbox list that is already open — `SuggestChecklist` |
77
+ | Several values inside a panel that is already open, such as a table header filter | `SuggestChecklist` | `MultiAutocompleteAsync`; never `Combobox` |
78
+ | Shared list chrome used inside Select and Autocomplete. No app-facing props | do not import | `Combobox`. The public controls are listed in `src/combobox/docs/Description.md` |
79
+ | Text navigation inside a table, form, or hint. Root is `<a>` until you pass the router link as `as` | `Link` | button look — `Button` with `as` |
80
+ | Navigation that should look like a button | `Button` with `as` and `href` | restyling `Link` |
81
+ | Short hint on an icon or a button with no visible text. Not shown on touch, so the control must work without it | `Tooltip` | a panel the user clicks — `Popover` |
82
+ | Click panel: filters, an action menu, a short form | `Popover` | plain text — `Tooltip`; right-click — `ContextMenu` |
83
+ | Right-click commands on a row, nav item, or cell (pin, open, delete) | `ContextMenu` | a menu opened from a button — `Popover` |
84
+ | Open a dialog from a helper, a menu, or an async chunk, with no local `useState` | `ModalProvider` + `useModal` from `modal-hub` | plumbing `open` through the tree |
85
+ | List or detail page title. Body copy is `bodyM` / `bodyS`; do not set `font-*` or `line-height` in your CSS | `typographyStyles.headingM` from `typography` (`headingL` when the title is larger) | a custom heading style |
86
+ | Icon-only button. `children` stays (it is the accessible name); `hidden` hides only that text; `aria-label` is required | `Button` with `icon` + `hidden` | empty `children` |
87
+ | An SVG from the kit. Color is `currentColor`. On a button pass it as `icon.Component`. Sidebar brand mark is `LogoEnsiMark`; `LogoEnsi` is the full wordmark. Names are in `src/icons/docs/Description.md` | a named export from `icons` (`Plus`, `Trash`, …) | an inline `<svg>` or another icon set |
88
+ | A value that must stay readable and selectable, but not editable. Only the text-like form fields honor this. `readOnly` may be a boolean or `{ [field name]: boolean }` | `Form` `readOnly` with `FormInput` / `FormTextArea` / `FormNumberInput` | `disabled` on those three (it drops focus and selection). Every other locked control uses `disabled` |
89
+ | The previous render’s value, or one callback after an overlay has fully closed (exit animation included, and if it unmounts mid-exit) | `usePrevious` / `useOverlayExitComplete` from `hooks` | a hand-rolled `useRef`. Debounce stays `usehooks-ts` (`useDebounceValue` / `useDebounceCallback`) |
51
90
 
52
91
  When neighbours disagree, trust that primitive’s Description.
53
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ensi-platform/admin-ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Admin UI for Ensi admin panel",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -13,17 +13,21 @@
13
13
  "docs/ai.md",
14
14
  "docs/architecture.md",
15
15
  "docs/README.md",
16
+ "docs/design-language.md",
16
17
  "scripts/consumer-root.ts",
17
18
  "scripts/sync-skill-consumer.ts",
18
19
  "scripts/sync-agents-consumer.ts",
19
20
  "scripts/sync-consumer.ts",
20
- "src/*/docs/Description.*.md",
21
- "src/*/docs/Example.*.md",
21
+ "src/*/docs/Description.md",
22
+ "src/*/docs/Example.md",
22
23
  "src/*/docs/cssVariables.ts",
23
24
  "src/*/types.ts",
24
- "src/ds/typography/docs/Description.*.md",
25
- "src/ds/typography/docs/Example.*.md",
26
- "src/ds/typography/docs/cssVariables.ts"
25
+ "src/ds/tokens/docs/Description.md",
26
+ "src/ds/typography/docs/Description.md",
27
+ "src/ds/typography/docs/Example.md",
28
+ "src/ds/typography/docs/cssVariables.ts",
29
+ "src/docs/getting-started/Description.md",
30
+ "src/docs/ai/Description.md"
27
31
  ],
28
32
  "keywords": [
29
33
  "ensi",
@@ -13,7 +13,8 @@ const BLOCK_BODY = [
13
13
  '',
14
14
  'When building or changing Ensi admin screens, forms, filters, or overlays, use `@ensi-platform/admin-ui` primitives.',
15
15
  'Before coding, read `node_modules/@ensi-platform/admin-ui/docs/ai.md` and the relevant',
16
- '`src/<name>/docs/Description.*.md` / `types.ts` — do not invent the API.',
16
+ '`src/<name>/docs/Description.md` / `types.ts` — do not invent the API.',
17
+ 'For whole screens (lists, filters, detail pages) also follow `node_modules/@ensi-platform/admin-ui/docs/design-language.md`.',
17
18
  ].join('\n');
18
19
 
19
20
  const buildBlock = (): string => `${BLOCK_START}\n${BLOCK_BODY}\n${BLOCK_END}`;
@@ -20,5 +20,6 @@ import { Button } from '@ensi-platform/admin-ui/button';
20
20
  | `icon` | `{ Component, after?, indent?, size?, className?, fill? }` | — | icon before or after the label (`after`) |
21
21
  | `dataTestId` | `string` | — | `data-test-id` for tests |
22
22
  | `as` | tag or component | `button` | root; for a link usually `as="a"` |
23
+ | `hidden` | `boolean` | `false` | hides only the text (`children`); the icon stays. `aria-label` is required: hidden text is not the accessible name |
23
24
 
24
25
  Native button/link attributes (`type`, `disabled`, `onClick`, `href`, …) are accepted for the chosen root element.
@@ -38,6 +38,8 @@ export interface IButtonOwnProps extends IDataTestIdProps {
38
38
  icon?: IButtonIconProps;
39
39
  /** Stretch to 100% of the parent width. */
40
40
  block?: boolean;
41
+ /** Hide only the text (children); the icon stays. Provide aria-label for the accessible name. */
42
+ hidden?: boolean;
41
43
  }
42
44
 
43
45
  export interface IButtonBaseProps extends IButtonThemeProps, IButtonOwnProps {}
@@ -1,7 +1,7 @@
1
1
  export const docsCssVariables = `/* CSS variables — CascadeMenu (--aui-cascade-menu-*)
2
2
  * Light/default values below (semantic.css). Dark remap: black-900 / grey-700 in semantic.dark.css.
3
3
  */
4
- --aui-cascade-menu-bg-primary: var(--aui-page-bg-primary); /* L0 column — same as page (grey-50 / black-900) */
4
+ --aui-cascade-menu-bg-primary: var(--aui-neutral-50); /* L0 — off-white in light, page black in dark */
5
5
  --aui-cascade-menu-fg-primary: var(--aui-page-fg-primary); /* primary text / logo currentColor */
6
6
  --aui-cascade-menu-fg-muted: var(--aui-page-fg-muted); /* secondary text on L0 */
7
7
  --aui-cascade-menu-border-divider: var(--aui-surface-border-primary); /* footer / edges / L0+flyout border-right; dark = white 12% */
@@ -15,6 +15,7 @@ export const docsCssVariables = `/* CSS variables — CascadeMenu (--aui-cascade
15
15
  --aui-cascade-menu-gap-brand-md: var(--aui-spacing-12); /* brand to body gap */
16
16
  --aui-cascade-menu-user-pad-y-md: var(--aui-spacing-12); /* footer top pad */
17
17
  --aui-cascade-menu-handle-w: 4px; /* resize line width */
18
+ --aui-cascade-menu-handle-delay: 400ms; /* hover dwell before the resize line thickens; drag skips it */
18
19
  --aui-cascade-menu-item-bg-hover: var(--aui-surface-bg-muted); /* L0 item / user / collapse hover; dark = grey-700 */
19
20
  --aui-cascade-menu-item-bg-active: transparent; /* current leaf — no fill (breadcrumbs own “where am I”) */
20
21
  --aui-cascade-menu-item-bg-active-hover: var(--aui-surface-bg-muted); /* current leaf hover = same as hover; dark = grey-700 */
@@ -0,0 +1,27 @@
1
+ Shared list chrome for `Select`, `MultiSelect`, and `Autocomplete`. App code does not import it.
2
+
3
+ ```tsx
4
+ import { Select } from '@ensi-platform/admin-ui/select';
5
+ ```
6
+
7
+ ## When to use
8
+
9
+ - one value, no typing — `Select`
10
+ - several values, no typing — `MultiSelect`
11
+ - typing, local list — `Autocomplete` / `MultiAutocomplete`
12
+ - typing, backend — `AutocompleteAsync` / `MultiAutocompleteAsync`
13
+ - checklist inside an already open panel — `SuggestChecklist`
14
+
15
+ ## API (short)
16
+
17
+ No props for app code.
18
+
19
+ | Primitive | Import |
20
+ | -------------------------- | --------------------------------------------------- |
21
+ | `Select` | `@ensi-platform/admin-ui/select` |
22
+ | `MultiSelect` | `@ensi-platform/admin-ui/multi-select` |
23
+ | `Autocomplete` | `@ensi-platform/admin-ui/autocomplete` |
24
+ | `MultiAutocomplete` | `@ensi-platform/admin-ui/multi-autocomplete` |
25
+ | `AutocompleteAsync` | `@ensi-platform/admin-ui/autocomplete-async` |
26
+ | `MultiAutocompleteAsync` | `@ensi-platform/admin-ui/multi-autocomplete-async` |
27
+ | `SuggestChecklist` | `@ensi-platform/admin-ui/suggest-checklist` |
@@ -0,0 +1,11 @@
1
+ ## Example
2
+
3
+ ```tsx
4
+ <Select
5
+ aria-label="Status"
6
+ options={[
7
+ { value: 'draft', label: 'Draft' },
8
+ { value: 'published', label: 'Published' },
9
+ ]}
10
+ />
11
+ ```
@@ -0,0 +1,60 @@
1
+ How agents (Cursor and others) use `@ensi-platform/admin-ui`.
2
+
3
+ ## Source of truth
4
+
5
+ Per primitive, the contract in this repo (Storybook) is:
6
+
7
+ - `src/<name>/docs/Description.ru.md` / `Description.en.md`
8
+ - `Example.ru.md` / `Example.en.md`, and `cssVariables.ts` when needed
9
+ - `types.ts` when present
10
+ - screen visual canon — `docs/design-language.md`
11
+
12
+ Storybook Docs reads both languages. Do not duplicate component API under package `docs/`.
13
+
14
+ The npm package ships English only, renamed for agents:
15
+
16
+ - `Description.en.md` → `src/<name>/docs/Description.md`
17
+ - `Example.en.md` → `Example.md`
18
+ - getting started → `src/docs/getting-started/Description.md`
19
+
20
+ `*.ru.md` and stories stay in the repo. Read the published files from `node_modules/@ensi-platform/admin-ui/...`.
21
+
22
+ ## Skill
23
+
24
+ Thin router for **consuming** the UI kit (pick a primitive, then read its Description). Authoring Description / stories — separate skill `write-component-docs`.
25
+
26
+ Location in the package: `docs/skills/` (`SKILL.md`).
27
+
28
+ In a consumer app:
29
+
30
+ - skill — `node_modules/@ensi-platform/admin-ui/docs/skills/`
31
+ - contract — `node_modules/@ensi-platform/admin-ui/src/<name>/docs/`, `…/types.ts` (`icons`, `hooks`, `combobox` included)
32
+
33
+ `postinstall` (`scripts/sync-consumer.ts`) copies the skill and writes a pointer. No manual path setup:
34
+
35
+ - `.cursor/skills/admin-ui/SKILL.md`
36
+ - `.claude/skills/admin-ui/SKILL.md` — same file
37
+ - marker `<!-- @ensi-platform/admin-ui:start -->` … `:end` in the consumer repo `AGENTS.md` (rest of the file stays)
38
+
39
+ Limits:
40
+
41
+ - consumer root is the nearest `.git` from `INIT_CWD`; if none, the script does nothing
42
+ - **pnpm ≥ 9** ignores dependency lifecycle scripts until `pnpm approve-builds @ensi-platform/admin-ui` (or `pnpm.onlyBuiltDependencies`), then `pnpm install` again
43
+ - manual run: `node node_modules/@ensi-platform/admin-ui/scripts/sync-consumer.ts`
44
+ - opt out of all three: `ADMIN_UI_SKIP_CONSUMER_SYNC=1`
45
+
46
+ Updating a Description does not require editing the skill.
47
+
48
+ ## Rules for agents
49
+
50
+ - do not invent API — read Description / types first;
51
+ - assemble screens (lists, filters, detail pages) from `docs/design-language.md`;
52
+ - app layout colours — `src/ds/tokens/docs/Description.md` (control chrome stays on the primitive);
53
+ - imports only via subpaths (`@ensi-platform/admin-ui/button`, …) — no package root barrel;
54
+ - setup (tokens, Provider, theme) — see **Getting started**.
55
+
56
+ ## Next
57
+
58
+ - **Getting started** — install and first screen
59
+ - `Base/Button`, `Form/Input`, `Overlays/Modal` — primitives
60
+ - Package docs: `docs/ai.md`, `docs/architecture.md`
@@ -0,0 +1,81 @@
1
+ `@ensi-platform/admin-ui` — UI library for the Ensi admin panel.
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ pnpm add @ensi-platform/admin-ui react react-dom
7
+ ```
8
+
9
+ ## Tokens
10
+
11
+ Import CSS once in the app entry:
12
+
13
+ ```tsx
14
+ import '@ensi-platform/admin-ui/tokens';
15
+ ```
16
+
17
+ ## Provider
18
+
19
+ Mount once at the UI root — portals, locale, built-in strings, and page substrate (background/text color; content inset stays on the host):
20
+
21
+ ```tsx
22
+ import { AdminUiProvider } from '@ensi-platform/admin-ui/provider';
23
+
24
+ <AdminUiProvider
25
+ locale="en-US"
26
+ labels={{
27
+ close: t('aui.close'),
28
+ clear: t('aui.clear'),
29
+ confirm: t('aui.confirm'),
30
+ cancel: t('aui.cancel'),
31
+ delete: t('aui.delete'),
32
+ notDelete: t('aui.notDelete'),
33
+ }}
34
+ >
35
+ <App />
36
+ </AdminUiProvider>;
37
+ ```
38
+
39
+ Details — `Design System/Provider`.
40
+
41
+ ## Theme
42
+
43
+ Set the theme on `document.documentElement`:
44
+
45
+ ```ts
46
+ document.documentElement.setAttribute('data-theme', 'light'); // or 'dark'
47
+ ```
48
+
49
+ Components are theme-agnostic — they only use `--aui-*` CSS variables.
50
+
51
+ ## First component
52
+
53
+ ```tsx
54
+ import { Button } from '@ensi-platform/admin-ui/button';
55
+
56
+ <Button variant="primary" size="md">
57
+ Save
58
+ </Button>;
59
+ ```
60
+
61
+ ## Links / router
62
+
63
+ The package does not know your router: `Link` defaults to a plain `<a>`. Ideal app setup — one wrapper that hard-codes the router link; import only your `Link` in the admin UI.
64
+
65
+ ```tsx
66
+ import { Link as AuiLink, type TLinkProps } from '@ensi-platform/admin-ui/link';
67
+ import { Link as RouterLink } from 'react-router';
68
+
69
+ export const Link = (props: Omit<TLinkProps<typeof RouterLink>, 'as'>) => <AuiLink as={RouterLink} {...props} />;
70
+ ```
71
+
72
+ For Next.js — the same pattern with `next/link` (`href` stays). Types come from the framework component via `TLinkProps<typeof …>`. Button look with navigation — `Button` with `as`, not `Link`.
73
+
74
+ ## Next
75
+
76
+ - **AI** — agents / skill channel
77
+ - `Base/Button` — base controls
78
+ - `Base/Link` — text links
79
+ - `Form/Input` — fields and forms
80
+ - `Overlays/Modal` — modals and overlays
81
+ - `Design System/Typography` — text roles
@@ -0,0 +1,30 @@
1
+ CSS variables for the admin canvas. Not a component. Import once; primitives read their own `--aui-{name}-*` and do not import this entry.
2
+
3
+ ```tsx
4
+ import '@ensi-platform/admin-ui/tokens';
5
+ ```
6
+
7
+ ## When to use
8
+
9
+ - app entry, before any admin screen
10
+ - page and surface colour on layout you write yourself
11
+ - not for control chrome — that stays on the primitive (`Button`, `Input`, …) and its `cssVariables.ts`
12
+
13
+ ## API (short)
14
+
15
+ Theme is `data-theme="light" | "dark"` on `document.documentElement`. Light values live on `:root`, dark remaps the same names. Components do not branch on the theme.
16
+
17
+ An app layout may use only these:
18
+
19
+ | Token | Role |
20
+ | --- | --- |
21
+ | `--aui-page-bg-primary` | page fill |
22
+ | `--aui-page-fg-primary` | page text |
23
+ | `--aui-page-fg-muted` | secondary text |
24
+ | `--aui-page-fg-link` | link text (underline; same as page text) |
25
+ | `--aui-surface-bg-primary` | input / elevated fill |
26
+ | `--aui-surface-bg-muted` | secondary button, tag, hover |
27
+ | `--aui-surface-bg-elevated` | raised surface |
28
+ | `--aui-surface-border-primary` | zone stroke, when the zone has no fill |
29
+
30
+ Primitive scales (`--aui-neutral-*`, `--aui-grey-*`, `--aui-red-*`, radius, spacing) are not for app CSS. Screen layers and hex roles — `docs/design-language.md`.
@@ -1,4 +1,4 @@
1
- Text role classes. Family: **Inter** via `--aui-font-sans` (loaded with tokens). The rem base is the `html` font-size. `AdminUiProvider` root sets `font-size: 1rem`.
1
+ Text role classes. Family: **Inter** via `--aui-font-family` (loaded with tokens). The rem base is the `html` font-size. `AdminUiProvider` root sets `font-size: 1rem`.
2
2
 
3
3
  ```tsx
4
4
  import { typographyStyles } from '@ensi-platform/admin-ui/typography';
@@ -8,7 +8,7 @@ import { typographyStyles } from '@ensi-platform/admin-ui/typography';
8
8
 
9
9
  - body copy in primitives and admin screens
10
10
  - compose `typographyStyles.*` in JSX; do not duplicate `font-*` / `line-height` in your CSS Modules
11
- - base font on the root is already set by `AdminUiProvider` via `--aui-font-sans`
11
+ - base font on the root is already set by `AdminUiProvider` via `--aui-font-family`
12
12
  - list / detail page title — `headingM` (or `headingL`)
13
13
 
14
14
  ## API (short)
@@ -23,7 +23,7 @@ import { typographyStyles } from '@ensi-platform/admin-ui/typography';
23
23
  | `headingM` | `--aui-font-size-xl` | semibold | `--aui-line-height-xl` |
24
24
  | `headingL` | `--aui-font-size-2xl` | semibold | `--aui-line-height-2xl` |
25
25
 
26
- Tokens: `--aui-font-sans`, `--aui-font-size-xs…2xl`, `--aui-font-weight-regular|medium|semibold`, `--aui-line-height-xs…2xl|tight|normal`.
26
+ Tokens: `--aui-font-family`, `--aui-font-size-xs…2xl`, `--aui-font-weight-regular|medium|semibold`, `--aui-line-height-xs…2xl|tight|normal`.
27
27
 
28
28
  `label*` — later.
29
29
 
@@ -27,7 +27,8 @@ Not React Aria `Form` — this is RHF + zod.
27
27
  | `triggerOnReinitialize` | `boolean` | — | `form.trigger()` after reinitialize |
28
28
  | `mode` | RHF `mode` | `all` | validation mode |
29
29
  | `isForm` | `boolean` | `true` | native `<form>` |
30
- | `disabled` | `boolean` | `false` | disable via FormContext |
30
+ | `disabled` | `boolean` \| `{ [field name]: boolean }` | `false` | disable via form context; exact field name; missing key stays enabled; a field prop wins |
31
+ | `readOnly` | `boolean` \| `{ [field name]: boolean }` | `false` | visible and copyable, not editable; only `FormInput`, `FormTextArea`, `FormNumberInput`. Other controls use `disabled`. Native `disabled` removes focus and selection |
31
32
  | `className` / `id` | `string` | — | on the root element |
32
33
 
33
34
  Helpers: `useFieldHook({ name })` for Form controls; `getError(fieldState.error)` — error message. RHF re-exports: `useFormContext`, `useFormState`, `useFieldArray`, `useWatch`, `useController`.
package/src/form/types.ts CHANGED
@@ -24,6 +24,12 @@ export interface IControllerRenderProps<T extends TFieldValueType> extends Omit<
24
24
 
25
25
  export type { FieldValues, Path };
26
26
 
27
+ /** Form-wide flag, or a map of exact RHF field names. */
28
+ export type TFormFieldFlag = boolean | Partial<Record<string, boolean>>;
29
+
30
+ /** Typed form-wide flag. Keys are exact `Path`s, not prefixes. */
31
+ export type TFormFieldFlags<T extends FieldValues> = boolean | Partial<Record<Path<T>, boolean>>;
32
+
27
33
  export interface IFormFieldComponent<
28
34
  TFieldValues extends FieldValues = FieldValues,
29
35
  TName extends Path<TFieldValues> = Path<TFieldValues>,
@@ -72,10 +78,10 @@ type TFormActionProps<T extends FieldValues> =
72
78
 
73
79
  export interface IFormBaseProps<T extends FieldValues>
74
80
  extends
75
- Omit<UseFormProps<T>, 'children'>,
81
+ Omit<UseFormProps<T>, 'children' | 'readOnly' | 'disabled'>,
76
82
  Omit<
77
83
  HTMLProps<HTMLFormElement>,
78
- 'onSubmit' | 'ref' | 'onReset' | 'children' | 'onChange' | 'onError' | 'onBlur'
84
+ 'onSubmit' | 'ref' | 'onReset' | 'children' | 'onChange' | 'onError' | 'onBlur' | 'disabled' | 'readOnly'
79
85
  > {
80
86
  /** Initial field values. */
81
87
  initialValues: DefaultValues<T>;
@@ -95,9 +101,18 @@ export interface IFormBaseProps<T extends FieldValues>
95
101
  isForm?: boolean;
96
102
  /**
97
103
  * Disable fields through FormContext.
104
+ * A map uses exact field names; a missing key means enabled.
105
+ * A field prop wins over this value.
106
+ * @default false
107
+ */
108
+ disabled?: TFormFieldFlags<T>;
109
+ /**
110
+ * Read-only fields through FormContext (`FormInput`, `FormTextArea`, `FormNumberInput`).
111
+ * A map uses exact field names. Other controls stay on `disabled`.
112
+ * A field prop wins over this value.
98
113
  * @default false
99
114
  */
100
- disabled?: boolean;
115
+ readOnly?: TFormFieldFlags<T>;
101
116
  /** Call `form.trigger()` after reinitialize. */
102
117
  triggerOnReinitialize?: boolean;
103
118
  /** Reset handler. */
@@ -0,0 +1,30 @@
1
+ Package hooks: the previous render value, and a callback after an overlay has fully closed.
2
+
3
+ ```tsx
4
+ import { useOverlayExitComplete, usePrevious } from '@ensi-platform/admin-ui/hooks';
5
+ ```
6
+
7
+ ## When to use
8
+
9
+ - keep the value from the previous render
10
+ - run code once the overlay is gone, including after the exit animation
11
+ - debounce stays in `usehooks-ts`
12
+
13
+ ## API (short)
14
+
15
+ ### `usePrevious`
16
+
17
+ | Argument | Values | Default | Description |
18
+ | -------------- | ------ | ------- | ------------------------------------ |
19
+ | `value` | `T` | — | current value |
20
+ | `initialValue` | `T` | — | value returned before the first update |
21
+
22
+ Returns the value from the previous render (`initialValue` on the first one).
23
+
24
+ ### `useOverlayExitComplete`
25
+
26
+ | Argument | Values | Default | Description |
27
+ | ---------------- | ------------ | ------- | ------------------------------------------------ |
28
+ | `open` | `boolean` | — | overlay is open |
29
+ | `isExiting` | `boolean` | — | exit animation is running |
30
+ | `onExitComplete` | `() => void` | — | called once after a full close, and on unmount during exit |