@ensi-platform/admin-ui 0.5.0 → 0.7.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.
- package/dist/Component-CBWeJZfB.js +92 -0
- package/dist/Component-CBWeJZfB.js.map +1 -0
- package/dist/Component-DFwWbzFS.js +128 -0
- package/dist/Component-DFwWbzFS.js.map +1 -0
- package/dist/{Component-Bk0VFhAQ.js → Component-DhhrZEMr.js} +2 -2
- package/dist/{Component-Bk0VFhAQ.js.map → Component-DhhrZEMr.js.map} +1 -1
- package/dist/Component-Dkvzqo0L.js +155 -0
- package/dist/Component-Dkvzqo0L.js.map +1 -0
- package/dist/{Component-CwYbdJhI.js → Component-gOj-4jKv.js} +2 -2
- package/dist/{Component-CwYbdJhI.js.map → Component-gOj-4jKv.js.map} +1 -1
- package/dist/action-popup/index.js +1 -1
- package/dist/active-filters/index.js +1 -1
- package/dist/arrangement-settings/index.js +1 -1
- package/dist/assets/Component16.css +1 -1
- package/dist/assets/Component5.css +1 -1
- package/dist/assets/Component7.css +1 -1
- package/dist/assets/Component9.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -0
- package/dist/assets/index29.css +1 -0
- package/dist/autocomplete/index.js +1 -1
- package/dist/autocomplete-async/index.js +1 -1
- package/dist/bottom-sheet/index.js +1 -1
- package/dist/button/Component.d.ts +1 -1
- package/dist/button/Component.d.ts.map +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/theme.d.ts +1 -0
- package/dist/button/theme.d.ts.map +1 -1
- package/dist/button/types.d.ts +2 -0
- package/dist/button/types.d.ts.map +1 -1
- package/dist/cascade-menu/index.js +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox-group/index.js +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/data-table/index.js +2 -2
- package/dist/date-picker/index.js +2 -2
- package/dist/date-range-picker/index.js +2 -2
- package/dist/filters/index.js +1 -1
- package/dist/form/Component.d.ts +1 -1
- package/dist/form/Component.d.ts.map +1 -1
- package/dist/form/context.d.ts +3 -1
- package/dist/form/context.d.ts.map +1 -1
- package/dist/form/hooks/useFieldHook.d.ts +2 -1
- package/dist/form/hooks/useFieldHook.d.ts.map +1 -1
- package/dist/form/index.js +84 -74
- package/dist/form/index.js.map +1 -1
- package/dist/form/types.d.ts +15 -2
- package/dist/form/types.d.ts.map +1 -1
- package/dist/form/utils.d.ts +3 -0
- package/dist/form/utils.d.ts.map +1 -1
- package/dist/grid/Component.d.ts +9 -0
- package/dist/grid/Component.d.ts.map +1 -0
- package/dist/grid/components/Item/index.d.ts +5 -0
- package/dist/grid/components/Item/index.d.ts.map +1 -0
- package/dist/grid/index.d.ts +3 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +85 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/grid/types.d.ts +44 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/grid/utils.d.ts +6 -0
- package/dist/grid/utils.d.ts.map +1 -0
- package/dist/{index-CVEaKh8K.js → index-B0l1op71.js} +2 -2
- package/dist/{index-CVEaKh8K.js.map → index-B0l1op71.js.map} +1 -1
- package/dist/{index-B-dHfeT9.js → index-yKOPreNy.js} +2 -2
- package/dist/{index-B-dHfeT9.js.map → index-yKOPreNy.js.map} +1 -1
- package/dist/input/Component.d.ts +1 -1
- package/dist/input/Component.d.ts.map +1 -1
- package/dist/input/FormInput.d.ts +1 -1
- package/dist/input/FormInput.d.ts.map +1 -1
- package/dist/input/index.js +27 -25
- package/dist/input/index.js.map +1 -1
- package/dist/input/types.d.ts +5 -1
- package/dist/input/types.d.ts.map +1 -1
- package/dist/multi-autocomplete/index.js +2 -2
- package/dist/multi-autocomplete-async/index.js +2 -2
- package/dist/multi-select/index.js +3 -3
- package/dist/number-input/Component.d.ts +1 -1
- package/dist/number-input/Component.d.ts.map +1 -1
- package/dist/number-input/FormNumberInput.d.ts +1 -1
- package/dist/number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/number-input/index.js +41 -39
- package/dist/number-input/index.js.map +1 -1
- package/dist/number-input/types.d.ts +5 -1
- package/dist/number-input/types.d.ts.map +1 -1
- package/dist/number-range/index.js +2 -2
- package/dist/select/index.js +1 -1
- package/dist/slider/index.js +2 -2
- package/dist/suggest-checklist/index.js +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/textarea/Component.d.ts +1 -1
- package/dist/textarea/Component.d.ts.map +1 -1
- package/dist/textarea/FormTextArea.d.ts +1 -1
- package/dist/textarea/FormTextArea.d.ts.map +1 -1
- package/dist/textarea/index.js +91 -86
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/types.d.ts +5 -1
- package/dist/textarea/types.d.ts.map +1 -1
- package/dist/time-field/index.js +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/typography/index.js +1 -1
- package/dist/useFieldHook-Bt9nST7g.js +52 -0
- package/dist/useFieldHook-Bt9nST7g.js.map +1 -0
- package/dist/vertical-tabs/Component.d.ts +18 -0
- package/dist/vertical-tabs/Component.d.ts.map +1 -0
- package/dist/vertical-tabs/components/Indicator/index.d.ts +6 -0
- package/dist/vertical-tabs/components/Indicator/index.d.ts.map +1 -0
- package/dist/vertical-tabs/components/Item/index.d.ts +5 -0
- package/dist/vertical-tabs/components/Item/index.d.ts.map +1 -0
- package/dist/vertical-tabs/components/Item/theme.d.ts +5 -0
- package/dist/vertical-tabs/components/Item/theme.d.ts.map +1 -0
- package/dist/vertical-tabs/components/List/index.d.ts +5 -0
- package/dist/vertical-tabs/components/List/index.d.ts.map +1 -0
- package/dist/vertical-tabs/components/List/theme.d.ts +5 -0
- package/dist/vertical-tabs/components/List/theme.d.ts.map +1 -0
- package/dist/vertical-tabs/components/Panel/index.d.ts +5 -0
- package/dist/vertical-tabs/components/Panel/index.d.ts.map +1 -0
- package/dist/vertical-tabs/components/Panels/index.d.ts +5 -0
- package/dist/vertical-tabs/components/Panels/index.d.ts.map +1 -0
- package/dist/vertical-tabs/context.d.ts +4 -0
- package/dist/vertical-tabs/context.d.ts.map +1 -0
- package/dist/vertical-tabs/index.d.ts +4 -0
- package/dist/vertical-tabs/index.d.ts.map +1 -0
- package/dist/vertical-tabs/index.js +193 -0
- package/dist/vertical-tabs/index.js.map +1 -0
- package/dist/vertical-tabs/theme.d.ts +5 -0
- package/dist/vertical-tabs/theme.d.ts.map +1 -0
- package/dist/vertical-tabs/types.d.ts +84 -0
- package/dist/vertical-tabs/types.d.ts.map +1 -0
- package/docs/README.md +3 -4
- package/docs/ai.md +42 -28
- package/docs/architecture.md +23 -23
- package/docs/design-language.md +104 -0
- package/docs/skills/SKILL.md +66 -25
- package/package.json +18 -6
- package/scripts/sync-agents-consumer.ts +2 -1
- package/src/button/docs/{Description.en.md → Description.md} +1 -0
- package/src/button/types.ts +2 -0
- package/src/cascade-menu/docs/cssVariables.ts +2 -1
- package/src/combobox/docs/Description.md +27 -0
- package/src/combobox/docs/Example.md +11 -0
- package/src/docs/ai/Description.md +60 -0
- package/src/docs/getting-started/Description.md +81 -0
- package/src/ds/tokens/docs/Description.md +30 -0
- package/src/ds/typography/docs/{Description.en.md → Description.md} +3 -3
- package/src/form/docs/{Description.en.md → Description.md} +2 -1
- package/src/form/types.ts +18 -3
- package/src/grid/docs/Description.md +26 -0
- package/src/grid/docs/Example.md +16 -0
- package/src/grid/docs/cssVariables.ts +13 -0
- package/src/grid/types.ts +53 -0
- package/src/hooks/docs/Description.md +30 -0
- package/src/hooks/docs/Example.md +9 -0
- package/src/icons/docs/Description.md +23 -0
- package/src/icons/docs/Example.md +5 -0
- package/src/input/docs/{Description.en.md → Description.md} +3 -1
- package/src/input/docs/cssVariables.ts +1 -0
- package/src/input/types.ts +5 -1
- package/src/link/docs/cssVariables.ts +1 -1
- package/src/number-input/docs/{Description.en.md → Description.md} +3 -1
- package/src/number-input/docs/cssVariables.ts +1 -0
- package/src/number-input/types.ts +5 -0
- package/src/table/docs/cssVariables.ts +3 -3
- package/src/tabs/docs/{Description.en.md → Description.md} +17 -0
- package/src/textarea/docs/{Description.en.md → Description.md} +3 -1
- package/src/textarea/docs/cssVariables.ts +1 -0
- package/src/textarea/types.ts +5 -1
- package/src/toast/docs/cssVariables.ts +1 -1
- package/src/tooltip/docs/cssVariables.ts +2 -2
- package/src/vertical-tabs/docs/Description.md +32 -0
- package/src/vertical-tabs/docs/Example.md +19 -0
- package/src/vertical-tabs/docs/cssVariables.ts +25 -0
- package/src/vertical-tabs/types.ts +110 -0
- package/dist/Component-BBFBVrTt.js +0 -152
- package/dist/Component-BBFBVrTt.js.map +0 -1
- package/dist/Component-C4pVS7OW.js +0 -125
- package/dist/Component-C4pVS7OW.js.map +0 -1
- package/dist/Component-VS3iDpxE.js +0 -85
- package/dist/Component-VS3iDpxE.js.map +0 -1
- package/dist/utils-CizYZV2a.js +0 -50
- package/dist/utils-CizYZV2a.js.map +0 -1
- package/docs/skills/evals/evals.json +0 -23
- package/src/action-popup/docs/Description.ru.md +0 -40
- package/src/action-popup/docs/Example.ru.md +0 -14
- package/src/active-filters/docs/Description.ru.md +0 -49
- package/src/active-filters/docs/Example.ru.md +0 -15
- package/src/arrangement-settings/docs/Description.ru.md +0 -25
- package/src/arrangement-settings/docs/Example.ru.md +0 -15
- package/src/autocomplete/docs/Description.ru.md +0 -51
- package/src/autocomplete/docs/Example.ru.md +0 -17
- package/src/autocomplete-async/docs/Description.ru.md +0 -71
- package/src/autocomplete-async/docs/Example.ru.md +0 -19
- package/src/avatar/docs/Description.ru.md +0 -23
- package/src/avatar/docs/Example.ru.md +0 -7
- package/src/badge/docs/Description.ru.md +0 -22
- package/src/badge/docs/Example.ru.md +0 -8
- package/src/bottom-sheet/docs/Description.ru.md +0 -27
- package/src/bottom-sheet/docs/Example.ru.md +0 -14
- package/src/button/docs/Description.ru.md +0 -24
- package/src/button/docs/Example.ru.md +0 -11
- package/src/cascade-menu/docs/Description.ru.md +0 -43
- package/src/cascade-menu/docs/Example.ru.md +0 -107
- package/src/checkbox/docs/Description.ru.md +0 -42
- package/src/checkbox/docs/Example.ru.md +0 -13
- package/src/checkbox-group/docs/Description.ru.md +0 -39
- package/src/checkbox-group/docs/Example.ru.md +0 -17
- package/src/context-menu/docs/Description.ru.md +0 -44
- package/src/context-menu/docs/Example.ru.md +0 -22
- package/src/data-table/docs/Description.ru.md +0 -33
- package/src/data-table/docs/Example.ru.md +0 -82
- package/src/date-picker/docs/Description.ru.md +0 -43
- package/src/date-picker/docs/Example.ru.md +0 -15
- package/src/date-range-picker/docs/Description.ru.md +0 -39
- package/src/date-range-picker/docs/Example.ru.md +0 -19
- package/src/drawer/docs/Description.ru.md +0 -28
- package/src/drawer/docs/Example.ru.md +0 -14
- package/src/ds/typography/docs/Description.ru.md +0 -35
- package/src/field/docs/Description.ru.md +0 -28
- package/src/field/docs/Example.ru.md +0 -16
- package/src/filters/docs/Description.ru.md +0 -40
- package/src/filters/docs/Example.ru.md +0 -21
- package/src/form/docs/Description.ru.md +0 -33
- package/src/form/docs/Example.ru.md +0 -18
- package/src/input/docs/Description.ru.md +0 -41
- package/src/input/docs/Example.ru.md +0 -21
- package/src/link/docs/Description.ru.md +0 -21
- package/src/link/docs/Example.ru.md +0 -16
- package/src/loader/docs/Description.ru.md +0 -21
- package/src/loader/docs/Example.ru.md +0 -10
- package/src/menu-list/docs/Description.ru.md +0 -45
- package/src/menu-list/docs/Example.ru.md +0 -14
- package/src/modal/docs/Description.ru.md +0 -25
- package/src/modal/docs/Example.ru.md +0 -15
- package/src/modal-hub/docs/Description.ru.md +0 -35
- package/src/modal-hub/docs/Example.ru.md +0 -20
- package/src/multi-autocomplete/docs/Description.ru.md +0 -52
- package/src/multi-autocomplete/docs/Example.ru.md +0 -12
- package/src/multi-autocomplete-async/docs/Description.ru.md +0 -55
- package/src/multi-autocomplete-async/docs/Example.ru.md +0 -5
- package/src/multi-select/docs/Description.ru.md +0 -46
- package/src/multi-select/docs/Example.ru.md +0 -20
- package/src/number-input/docs/Description.ru.md +0 -46
- package/src/number-input/docs/Example.ru.md +0 -19
- package/src/number-range/docs/Description.ru.md +0 -49
- package/src/number-range/docs/Example.ru.md +0 -25
- package/src/popover/docs/Description.ru.md +0 -33
- package/src/popover/docs/Example.ru.md +0 -13
- package/src/provider/docs/Description.ru.md +0 -27
- package/src/provider/docs/Example.ru.md +0 -10
- package/src/select/docs/Description.ru.md +0 -46
- package/src/select/docs/Example.ru.md +0 -20
- package/src/slider/docs/Description.ru.md +0 -45
- package/src/slider/docs/Example.ru.md +0 -17
- package/src/suggest-checklist/docs/Description.ru.md +0 -26
- package/src/suggest-checklist/docs/Example.ru.md +0 -11
- package/src/switch/docs/Description.ru.md +0 -39
- package/src/switch/docs/Example.ru.md +0 -13
- package/src/table/docs/Description.ru.md +0 -32
- package/src/table/docs/Example.ru.md +0 -67
- package/src/tabs/docs/Description.ru.md +0 -24
- package/src/tabs/docs/Example.ru.md +0 -12
- package/src/tag/docs/Description.ru.md +0 -24
- package/src/tag/docs/Example.ru.md +0 -6
- package/src/textarea/docs/Description.ru.md +0 -40
- package/src/textarea/docs/Example.ru.md +0 -21
- package/src/time-field/docs/Description.ru.md +0 -41
- package/src/time-field/docs/Example.ru.md +0 -9
- package/src/toast/docs/Description.ru.md +0 -57
- package/src/toast/docs/Example.ru.md +0 -25
- package/src/tooltip/docs/Description.ru.md +0 -34
- package/src/tooltip/docs/Example.ru.md +0 -10
- /package/src/action-popup/docs/{Description.en.md → Description.md} +0 -0
- /package/src/action-popup/docs/{Example.en.md → Example.md} +0 -0
- /package/src/active-filters/docs/{Description.en.md → Description.md} +0 -0
- /package/src/active-filters/docs/{Example.en.md → Example.md} +0 -0
- /package/src/arrangement-settings/docs/{Description.en.md → Description.md} +0 -0
- /package/src/arrangement-settings/docs/{Example.en.md → Example.md} +0 -0
- /package/src/autocomplete/docs/{Description.en.md → Description.md} +0 -0
- /package/src/autocomplete/docs/{Example.en.md → Example.md} +0 -0
- /package/src/autocomplete-async/docs/{Description.en.md → Description.md} +0 -0
- /package/src/autocomplete-async/docs/{Example.en.md → Example.md} +0 -0
- /package/src/avatar/docs/{Description.en.md → Description.md} +0 -0
- /package/src/avatar/docs/{Example.en.md → Example.md} +0 -0
- /package/src/badge/docs/{Description.en.md → Description.md} +0 -0
- /package/src/badge/docs/{Example.en.md → Example.md} +0 -0
- /package/src/bottom-sheet/docs/{Description.en.md → Description.md} +0 -0
- /package/src/bottom-sheet/docs/{Example.en.md → Example.md} +0 -0
- /package/src/button/docs/{Example.en.md → Example.md} +0 -0
- /package/src/cascade-menu/docs/{Description.en.md → Description.md} +0 -0
- /package/src/cascade-menu/docs/{Example.en.md → Example.md} +0 -0
- /package/src/checkbox/docs/{Description.en.md → Description.md} +0 -0
- /package/src/checkbox/docs/{Example.en.md → Example.md} +0 -0
- /package/src/checkbox-group/docs/{Description.en.md → Description.md} +0 -0
- /package/src/checkbox-group/docs/{Example.en.md → Example.md} +0 -0
- /package/src/context-menu/docs/{Description.en.md → Description.md} +0 -0
- /package/src/context-menu/docs/{Example.en.md → Example.md} +0 -0
- /package/src/data-table/docs/{Description.en.md → Description.md} +0 -0
- /package/src/data-table/docs/{Example.en.md → Example.md} +0 -0
- /package/src/date-picker/docs/{Description.en.md → Description.md} +0 -0
- /package/src/date-picker/docs/{Example.en.md → Example.md} +0 -0
- /package/src/date-range-picker/docs/{Description.en.md → Description.md} +0 -0
- /package/src/date-range-picker/docs/{Example.en.md → Example.md} +0 -0
- /package/src/drawer/docs/{Description.en.md → Description.md} +0 -0
- /package/src/drawer/docs/{Example.en.md → Example.md} +0 -0
- /package/src/field/docs/{Description.en.md → Description.md} +0 -0
- /package/src/field/docs/{Example.en.md → Example.md} +0 -0
- /package/src/filters/docs/{Description.en.md → Description.md} +0 -0
- /package/src/filters/docs/{Example.en.md → Example.md} +0 -0
- /package/src/form/docs/{Example.en.md → Example.md} +0 -0
- /package/src/input/docs/{Example.en.md → Example.md} +0 -0
- /package/src/link/docs/{Description.en.md → Description.md} +0 -0
- /package/src/link/docs/{Example.en.md → Example.md} +0 -0
- /package/src/loader/docs/{Description.en.md → Description.md} +0 -0
- /package/src/loader/docs/{Example.en.md → Example.md} +0 -0
- /package/src/menu-list/docs/{Description.en.md → Description.md} +0 -0
- /package/src/menu-list/docs/{Example.en.md → Example.md} +0 -0
- /package/src/modal/docs/{Description.en.md → Description.md} +0 -0
- /package/src/modal/docs/{Example.en.md → Example.md} +0 -0
- /package/src/modal-hub/docs/{Description.en.md → Description.md} +0 -0
- /package/src/modal-hub/docs/{Example.en.md → Example.md} +0 -0
- /package/src/multi-autocomplete/docs/{Description.en.md → Description.md} +0 -0
- /package/src/multi-autocomplete/docs/{Example.en.md → Example.md} +0 -0
- /package/src/multi-autocomplete-async/docs/{Description.en.md → Description.md} +0 -0
- /package/src/multi-autocomplete-async/docs/{Example.en.md → Example.md} +0 -0
- /package/src/multi-select/docs/{Description.en.md → Description.md} +0 -0
- /package/src/multi-select/docs/{Example.en.md → Example.md} +0 -0
- /package/src/number-input/docs/{Example.en.md → Example.md} +0 -0
- /package/src/number-range/docs/{Description.en.md → Description.md} +0 -0
- /package/src/number-range/docs/{Example.en.md → Example.md} +0 -0
- /package/src/popover/docs/{Description.en.md → Description.md} +0 -0
- /package/src/popover/docs/{Example.en.md → Example.md} +0 -0
- /package/src/provider/docs/{Description.en.md → Description.md} +0 -0
- /package/src/provider/docs/{Example.en.md → Example.md} +0 -0
- /package/src/select/docs/{Description.en.md → Description.md} +0 -0
- /package/src/select/docs/{Example.en.md → Example.md} +0 -0
- /package/src/slider/docs/{Description.en.md → Description.md} +0 -0
- /package/src/slider/docs/{Example.en.md → Example.md} +0 -0
- /package/src/suggest-checklist/docs/{Description.en.md → Description.md} +0 -0
- /package/src/suggest-checklist/docs/{Example.en.md → Example.md} +0 -0
- /package/src/switch/docs/{Description.en.md → Description.md} +0 -0
- /package/src/switch/docs/{Example.en.md → Example.md} +0 -0
- /package/src/table/docs/{Description.en.md → Description.md} +0 -0
- /package/src/table/docs/{Example.en.md → Example.md} +0 -0
- /package/src/tabs/docs/{Example.en.md → Example.md} +0 -0
- /package/src/tag/docs/{Description.en.md → Description.md} +0 -0
- /package/src/tag/docs/{Example.en.md → Example.md} +0 -0
- /package/src/textarea/docs/{Example.en.md → Example.md} +0 -0
- /package/src/time-field/docs/{Description.en.md → Description.md} +0 -0
- /package/src/time-field/docs/{Example.en.md → Example.md} +0 -0
- /package/src/toast/docs/{Description.en.md → Description.md} +0 -0
- /package/src/toast/docs/{Example.en.md → Example.md} +0 -0
- /package/src/tooltip/docs/{Description.en.md → Description.md} +0 -0
- /package/src/tooltip/docs/{Example.en.md → Example.md} +0 -0
package/docs/skills/SKILL.md
CHANGED
|
@@ -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,
|
|
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,81 @@ 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.
|
|
18
|
-
|
|
19
|
-
- `src/<name>/
|
|
20
|
-
-
|
|
21
|
-
|
|
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:
|
|
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
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
| action
|
|
39
|
-
| entity status (
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
| single-line text | `Input` / `FormInput` | `
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| date
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
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; vertical tabs inside a tab — `VerticalTabs` |
|
|
62
|
+
| Vertical tabs inside one page tab: column on the left, panel on the right. Column width, gap, and selected fill are `--aui-vertical-tabs-*` | `VerticalTabs` | underline page tabs — `Tabs` |
|
|
63
|
+
| Equal columns of fields, or an explicit track split (`cols` number or track list, `Grid.Item` `col="full"`). Gap is a spacing step | `Grid` | `Filters.Grid`, which is only the list-filter grid |
|
|
64
|
+
| 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` |
|
|
65
|
+
| The same panel on a narrow screen, dismissed with a swipe down | `BottomSheet` | a side `Drawer` |
|
|
66
|
+
| 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` |
|
|
67
|
+
| 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 |
|
|
68
|
+
| 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` |
|
|
69
|
+
| One `boolean` | `Checkbox` / `FormCheckbox` | a settings on/off — `Switch`; several options — `CheckboxGroup` |
|
|
70
|
+
| Several options, more than one can be on (`string[]`) | `CheckboxGroup` / `FormCheckboxGroup` | one `Checkbox` |
|
|
71
|
+
| Settings flag, on/off, no checkmark | `Switch` / `FormSwitch` | `Checkbox` |
|
|
72
|
+
| Quantity, price, or weight. Money goes through `formatOptions`; store a `number` (there is no MoneyInput) | `NumberInput` / `FormNumberInput` | `Input` |
|
|
73
|
+
| From–to filter for an amount, quantity, or price | `NumberRange` / `FormNumberRange` | one number — `NumberInput`; a date period — `DateRangePicker` |
|
|
74
|
+
| A value on a track: scale, volume, ratio | `Slider` / `FormSlider` | an exact number from the keyboard — `NumberInput` |
|
|
75
|
+
| One value; the user types to filter a local list | `Autocomplete` / `FormAutocomplete` | no typing — `Select`; a request — `AutocompleteAsync` |
|
|
76
|
+
| One value; suggestions come from the app’s request (React Query / `fetch`) | `AutocompleteAsync` / `FormAutocompleteAsync` | a local list — `Autocomplete` |
|
|
77
|
+
| Several values; the user types to filter a local list | `MultiAutocomplete` / `FormMultiAutocomplete` | no typing — `MultiSelect`; a request — `MultiAutocompleteAsync` |
|
|
78
|
+
| Several values from backend suggestions | `MultiAutocompleteAsync` / `FormMultiAutocompleteAsync` | a local list — `MultiAutocomplete`; a checkbox list that is already open — `SuggestChecklist` |
|
|
79
|
+
| Several values inside a panel that is already open, such as a table header filter | `SuggestChecklist` | `MultiAutocompleteAsync`; never `Combobox` |
|
|
80
|
+
| 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` |
|
|
81
|
+
| 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` |
|
|
82
|
+
| Navigation that should look like a button | `Button` with `as` and `href` | restyling `Link` |
|
|
83
|
+
| 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` |
|
|
84
|
+
| Click panel: filters, an action menu, a short form | `Popover` | plain text — `Tooltip`; right-click — `ContextMenu` |
|
|
85
|
+
| Right-click commands on a row, nav item, or cell (pin, open, delete) | `ContextMenu` | a menu opened from a button — `Popover` |
|
|
86
|
+
| 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 |
|
|
87
|
+
| 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 |
|
|
88
|
+
| 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` |
|
|
89
|
+
| 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 |
|
|
90
|
+
| 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` |
|
|
91
|
+
| 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
92
|
|
|
52
93
|
When neighbours disagree, trust that primitive’s Description.
|
|
53
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ensi-platform/admin-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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
|
|
21
|
-
"src/*/docs/Example
|
|
21
|
+
"src/*/docs/Description.md",
|
|
22
|
+
"src/*/docs/Example.md",
|
|
22
23
|
"src/*/docs/cssVariables.ts",
|
|
23
24
|
"src/*/types.ts",
|
|
24
|
-
"src/ds/
|
|
25
|
-
"src/ds/typography/docs/
|
|
26
|
-
"src/ds/typography/docs/
|
|
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",
|
|
@@ -141,6 +145,10 @@
|
|
|
141
145
|
"types": "./dist/form/index.d.ts",
|
|
142
146
|
"import": "./dist/form/index.js"
|
|
143
147
|
},
|
|
148
|
+
"./grid": {
|
|
149
|
+
"types": "./dist/grid/index.d.ts",
|
|
150
|
+
"import": "./dist/grid/index.js"
|
|
151
|
+
},
|
|
144
152
|
"./hooks": {
|
|
145
153
|
"types": "./dist/hooks/index.d.ts",
|
|
146
154
|
"import": "./dist/hooks/index.js"
|
|
@@ -252,6 +260,10 @@
|
|
|
252
260
|
"./typography": {
|
|
253
261
|
"types": "./dist/typography/index.d.ts",
|
|
254
262
|
"import": "./dist/typography/index.js"
|
|
263
|
+
},
|
|
264
|
+
"./vertical-tabs": {
|
|
265
|
+
"types": "./dist/vertical-tabs/index.d.ts",
|
|
266
|
+
"import": "./dist/vertical-tabs/index.js"
|
|
255
267
|
}
|
|
256
268
|
},
|
|
257
269
|
"scripts": {
|
|
@@ -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
|
|
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.
|
package/src/button/types.ts
CHANGED
|
@@ -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-
|
|
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,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-
|
|
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-
|
|
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-
|
|
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`
|
|
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
|
-
|
|
115
|
+
readOnly?: TFormFieldFlags<T>;
|
|
101
116
|
/** Call `form.trigger()` after reinitialize. */
|
|
102
117
|
triggerOnReinitialize?: boolean;
|
|
103
118
|
/** Reset handler. */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Grid for fields and for column splits.
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Grid } from '@ensi-platform/admin-ui/grid';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- section fields in two or three columns
|
|
10
|
+
- one item across the whole grid (`col="full"`)
|
|
11
|
+
- a content-and-side split, by passing custom tracks in `cols`
|
|
12
|
+
|
|
13
|
+
The list filter grid is `Filters.Grid`.
|
|
14
|
+
|
|
15
|
+
## API (short)
|
|
16
|
+
|
|
17
|
+
| Prop | Values | Default | Description |
|
|
18
|
+
| ------------ | --------------------------------------------- | --------- | ------------------------------ |
|
|
19
|
+
| `cols` | `number` \| track list | — | columns |
|
|
20
|
+
| `gap` | `0` \| `4` \| `8` \| `12` \| `16` \| … \| `64` | `16` | gap, a spacing-scale step |
|
|
21
|
+
| `col` | `number` \| `full` | — | span when nested in another grid |
|
|
22
|
+
| `align` | `start` \| `center` \| `end` \| `stretch` | `stretch` | cross-axis alignment |
|
|
23
|
+
| `hidden` | `boolean` | `false` | removes the grid from layout |
|
|
24
|
+
| `dataTestId` | `string` | — | `data-test-id` for tests |
|
|
25
|
+
|
|
26
|
+
`Grid.Item` `col` is how many columns to take. `full` crosses the grid. A number in `cols` makes equal `minmax(0, 1fr)` columns. A number inside a track list is `Nfr`; a string is used as written (`minmax(0, 1fr)`).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Example
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
<Grid cols={2} gap={16}>
|
|
5
|
+
<FormInput name="last_name" label="Last name" />
|
|
6
|
+
<FormInput name="first_name" label="First name" />
|
|
7
|
+
<Grid.Item col="full">
|
|
8
|
+
<FormInput name="password" label="Password" />
|
|
9
|
+
</Grid.Item>
|
|
10
|
+
</Grid>
|
|
11
|
+
|
|
12
|
+
<Grid cols={['minmax(0, 1fr)', '16.25rem']} gap={0}>
|
|
13
|
+
<div>Main</div>
|
|
14
|
+
<aside>Aside</aside>
|
|
15
|
+
</Grid>
|
|
16
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Grid CSS variables from semantic tokens (--aui-grid-*). */
|
|
2
|
+
export const docsCssVariables = `/* CSS variables — Grid (--aui-grid-*) */
|
|
3
|
+
--aui-grid-gap-0: 0; /* no gap */
|
|
4
|
+
--aui-grid-gap-4: var(--aui-spacing-4); /* gap 4 */
|
|
5
|
+
--aui-grid-gap-8: var(--aui-spacing-8); /* gap 8 */
|
|
6
|
+
--aui-grid-gap-12: var(--aui-spacing-12); /* gap 12 */
|
|
7
|
+
--aui-grid-gap-16: var(--aui-spacing-16); /* gap 16 */
|
|
8
|
+
--aui-grid-gap-20: var(--aui-spacing-20); /* gap 20 */
|
|
9
|
+
--aui-grid-gap-24: var(--aui-spacing-24); /* gap 24 */
|
|
10
|
+
--aui-grid-gap-32: var(--aui-spacing-32); /* gap 32 */
|
|
11
|
+
--aui-grid-gap-40: var(--aui-spacing-40); /* gap 40 */
|
|
12
|
+
--aui-grid-gap-48: var(--aui-spacing-48); /* gap 48 */
|
|
13
|
+
--aui-grid-gap-64: var(--aui-spacing-64); /* gap 64 */`;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type CSSProperties, type ComponentPropsWithRef, type ReactNode, type Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
import { type IDataTestIdProps } from '@ds/common';
|
|
4
|
+
|
|
5
|
+
/** Gap step. Matches the spacing scale. */
|
|
6
|
+
export type TGridGap = 0 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 64;
|
|
7
|
+
|
|
8
|
+
/** One track: a number is `Nfr`, a string is used as written. */
|
|
9
|
+
export type TGridTrack = number | string;
|
|
10
|
+
|
|
11
|
+
/** How many columns an item spans. */
|
|
12
|
+
export type TGridCol = number | 'full';
|
|
13
|
+
|
|
14
|
+
/** Cross-axis alignment of items. */
|
|
15
|
+
export type TGridAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
16
|
+
|
|
17
|
+
/** Own props for Grid. */
|
|
18
|
+
export interface IGridOwnProps extends IDataTestIdProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Equal columns, or an explicit track list. */
|
|
21
|
+
cols: number | TGridTrack[];
|
|
22
|
+
/** Gap between items. */
|
|
23
|
+
gap?: TGridGap;
|
|
24
|
+
/** Span when this grid sits inside another grid. */
|
|
25
|
+
col?: TGridCol;
|
|
26
|
+
/** Cross-axis alignment. */
|
|
27
|
+
align?: TGridAlign;
|
|
28
|
+
/** Removes the grid from the layout. */
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
/** Ref to the grid (React 19 prop). */
|
|
31
|
+
ref?: Ref<HTMLDivElement>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IGridProps
|
|
35
|
+
extends Omit<ComponentPropsWithRef<'div'>, keyof IGridOwnProps | 'children'>, IGridOwnProps {}
|
|
36
|
+
|
|
37
|
+
/** Own props for Grid.Item. */
|
|
38
|
+
export interface IGridItemOwnProps extends IDataTestIdProps {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/** Column span. `full` crosses the whole grid. */
|
|
41
|
+
col?: TGridCol;
|
|
42
|
+
/** Ref to the item (React 19 prop). */
|
|
43
|
+
ref?: Ref<HTMLDivElement>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IGridItemProps
|
|
47
|
+
extends Omit<ComponentPropsWithRef<'div'>, keyof IGridItemOwnProps | 'children'>, IGridItemOwnProps {}
|
|
48
|
+
|
|
49
|
+
/** Inline template written by Grid. */
|
|
50
|
+
export interface IGridStyle extends CSSProperties {
|
|
51
|
+
'--aui-grid-template'?: string;
|
|
52
|
+
'--aui-grid-col'?: string;
|
|
53
|
+
}
|