# youzan/zent architecture

> Architecture diagram of the GitHub repository youzan/zent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youzan/zent
- Repository: https://github.com/youzan/zent

## Overview

##### High-Level Architecture
a. Core Layer (Bottom)
- Utils & Helpers (/src/utils)
- Theme System (/src/theme)
- I18n System (/src/i18n)
- Portal System (/src/portal)

b. Foundation Layer
- Base Components (buttons, inputs, etc.)
- Layout Components (/src/layout)
- Style System (assets/*.scss)

c. Complex Components Layer
- Form System (/src/form)
- Data Display Components (grid, table)
- Navigation Components (menu, tabs)
- Feedback Components (notify, alert)

d. Integration Layer (Top)
- Build System
- TypeScript Support
- Theming Integration
- Polyfills

##### Component Dependencies
- Related components (e.g., form-related components)
- Shared utilities and hooks
- Theme and i18n context providers

##### Build & Distribution Flow
- Source Files → TypeScript Compilation
- SCSS Processing
- Babel Transformation
- Package Distribution
- Documentation Generation

##### Important Relationships
- Component inheritance hierarchies
- Context providers and consumers
- Style dependencies
- Utility function usage

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#b3d1ff,stroke:#333
    classDef foundation fill:#90EE90,stroke:#333
    classDef complex fill:#FFE5B4,stroke:#333
    classDef integration fill:#D3D3D3,stroke:#333

    %% Integration Layer
    subgraph Integration
        Build["Build System"]
        TypeScript["TypeScript Support"]
        ThemeInteg["Theming Integration"]
        Polyfills["Polyfills"]
    end

    %% Complex Components Layer
    subgraph ComplexComponents
        FormSystem["Form System"]
        DataDisplay["Data Display Components"]
        Navigation["Navigation Components"]
        Feedback["Feedback Components"]

        %% Data Display Components
        subgraph DataDisplayGroup
            Grid["Grid"]
            Table["Table"]
            Tree["Tree"]
        end

        %% Navigation Components
        subgraph NavigationGroup
            Menu["Menu"]
            Tabs["Tabs"]
            Breadcrumb["Breadcrumb"]
        end

        %% Feedback Components
        subgraph FeedbackGroup
            Notify["Notify"]
            Alert["Alert"]
            Dialog["Dialog"]
        end
    end

    %% Foundation Layer
    subgraph Foundation
        BaseComponents["Base Components"]
        Layout["Layout Components"]
        StyleSystem["Style System"]

        %% Base Components
        subgraph BaseGroup
            Button["Button"]
            Input["Input"]
            Icon["Icon"]
        end
    end

    %% Core Layer
    subgraph Core
        Utils["Utils & Helpers"]
        ThemeSystem["Theme System"]
        I18n["I18n System"]
        Portal["Portal System"]
    end

    %% Relationships
    Core --> Foundation
    Foundation --> ComplexComponents
    ComplexComponents --> Integration
    ThemeSystem --> ThemeInteg
    StyleSystem --> ThemeInteg

    %% Click Events
    click Utils "https://github.com/youzan/zent/tree/master/packages/zent/src/utils/"
    click ThemeSystem "https://github.com/youzan/zent/tree/master/packages/zent/src/theme/"
    click I18n "https://github.com/youzan/zent/tree/master/packages/zent/src/i18n/"
    click Portal "https://github.com/youzan/zent/tree/master/packages/zent/src/portal/"
    click Layout "https://github.com/youzan/zent/tree/master/packages/zent/src/layout/"
    click StyleSystem "https://github.com/youzan/zent/tree/master/packages/zent/assets/"
    click Button "https://github.com/youzan/zent/tree/master/packages/zent/src/button/"
    click Input "https://github.com/youzan/zent/tree/master/packages/zent/src/input/"
    click Icon "https://github.com/youzan/zent/tree/master/packages/zent/src/icon/"
    click FormSystem "https://github.com/youzan/zent/tree/master/packages/zent/src/form/"
    click Grid "https://github.com/youzan/zent/tree/master/packages/zent/src/grid/"
    click Table "https://github.com/youzan/zent/tree/master/packages/zent/src/table/"
    click Tree "https://github.com/youzan/zent/tree/master/packages/zent/src/tree/"
    click Menu "https://github.com/youzan/zent/tree/master/packages/zent/src/menu/"
    click Tabs "https://github.com/youzan/zent/tree/master/packages/zent/src/tabs/"
    click Breadcrumb "https://github.com/youzan/zent/tree/master/packages/zent/src/breadcrumb/"
    click Notify "https://github.com/youzan/zent/tree/master/packages/zent/src/notify/"
    click Alert "https://github.com/youzan/zent/tree/master/packages/zent/src/alert/"
    click Dialog "https://github.com/youzan/zent/tree/master/packages/zent/src/dialog/"
    click Build "https://github.com/youzan/zent/tree/master/packages/zent/scripts/"
    click TypeScript "https://github.com/youzan/zent/blob/master/packages/zent/tsconfig.json"
    click ThemeInteg "https://github.com/youzan/zent/tree/master/packages/zent/assets/theme/"

    %% Legend
    subgraph Legend
        CoreLegend["Core Components"]:::core
        FoundationLegend["Foundation Components"]:::foundation
        ComplexLegend["Complex Components"]:::complex
        IntegrationLegend["Integration Layer"]:::integration
    end

    %% Apply styles
    class Utils,ThemeSystem,I18n,Portal core
    class BaseComponents,Layout,StyleSystem,Button,Input,Icon foundation
    class FormSystem,DataDisplay,Navigation,Feedback,Grid,Table,Tree,Menu,Tabs,Breadcrumb,Notify,Alert,Dialog complex
    class Build,TypeScript,ThemeInteg,Polyfills integration
```
