# enactjs/sandstone architecture

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

- Interactive diagram: https://gitdiagram.com/enactjs/sandstone
- Repository: https://github.com/enactjs/sandstone

## Overview

##### Main Components Structure

- Sandstone UI Library                                   |

- Core Components|  |Layout Components|  |Input Components|  |Decorator Components|   |

##### Component Layer Details

**Core Components:**

- Button          |
- Image           |
- Text/BodyText   |
- Heading         |

**Layout Components:**

- Panels          |
- Scroller        |
- VirtualList     |
- TabLayout       |
- PopupPanels     |

**Input Components:**

- Input          |
- Checkbox       |
- DatePicker     |
- Slider         |
- Switch         |

**Decorator Components:**

- ThemeDecorator  |
- Skinnable       |
- SpotlightDec.   |

- Theme System        |

- Typography         |
- Spacing            |
- Animations         |

- ↑

- Style Implementation  |

- CSS Modules        |
- LESS Variables     |
- Theme Variables    |

##### Integration Flow

- React App      | →   | ThemeDecorator   | →   | Sandstone         |
- (Entry Point)  |     | (Configuration)  |     | Components        |

- ↓

- I18n/Spotlight   |
- Resolution       |

Key Elements to Include:

- Component dependencies
- Theme inheritance
- Event flow
- Data flow

##### Testing integration
- Jest test runner
- Testing Library integration
- UI test specifications

##### The testing and quality assurance structure

This system design should help developers understand:
- How components are organized
- How themes and styles are applied
- How to integrate the library
- How testing is implemented
- The overall architecture of the system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph SandstoneUI["Sandstone UI Library"]
        subgraph CoreComponents["Core Components"]
            Button["Button"]:::core
            Icon["Icon"]:::core
            Image["Image"]:::core
            BodyText["BodyText"]:::core
            Heading["Heading"]:::core
        end

        subgraph LayoutComponents["Layout Components"]
            Panels["Panels"]:::layout
            Scroller["Scroller"]:::layout
            VirtualList["VirtualList"]:::layout
            TabLayout["TabLayout"]:::layout
            PopupPanels["PopupPanels"]:::layout
        end

        subgraph InputComponents["Input Components"]
            Input["Input"]:::input
            Checkbox["Checkbox"]:::input
            DatePicker["DatePicker"]:::input
            Slider["Slider"]:::input
            Switch["Switch"]:::input
        end

        subgraph DecoratorComponents["Decorator Components"]
            ThemeDecorator["ThemeDecorator"]:::decorator
            Skinnable["Skinnable"]:::decorator
            ContextualMenu["ContextualMenuDecorator"]:::decorator
            TooltipDec["TooltipDecorator"]:::decorator
        end

        subgraph ThemeSystem["Theme System"]
            ThemeVars["Theme Variables"]:::theme
            ColorSystem["Color System"]:::theme
            SkinImpl["Skin Implementation"]:::theme
        end

        subgraph Testing["Testing Infrastructure"]
            UITests["UI Tests"]:::testing
            ScreenTests["Screenshot Tests"]:::testing
            CompSpecs["Component Specs"]:::testing
        end
    end

    %% Relationships
    ThemeDecorator --> CoreComponents
    ThemeDecorator --> LayoutComponents
    ThemeDecorator --> InputComponents
    
    ThemeSystem --> ThemeDecorator
    Skinnable --> CoreComponents
    Skinnable --> LayoutComponents
    Skinnable --> InputComponents

    Testing --> CoreComponents
    Testing --> LayoutComponents
    Testing --> InputComponents
    Testing --> DecoratorComponents

    %% Click Events
    click Button "https://github.com/enactjs/sandstone/tree/master//Button"
    click Icon "https://github.com/enactjs/sandstone/tree/master//Icon"
    click Image "https://github.com/enactjs/sandstone/tree/master//Image"
    click BodyText "https://github.com/enactjs/sandstone/tree/master//BodyText"
    click Heading "https://github.com/enactjs/sandstone/tree/master//Heading"
    click Panels "https://github.com/enactjs/sandstone/tree/master//Panels"
    click Scroller "https://github.com/enactjs/sandstone/tree/master//Scroller"
    click VirtualList "https://github.com/enactjs/sandstone/tree/master//VirtualList"
    click TabLayout "https://github.com/enactjs/sandstone/tree/master//TabLayout"
    click PopupPanels "https://github.com/enactjs/sandstone/tree/master//FixedPopupPanels"
    click Input "https://github.com/enactjs/sandstone/tree/master//Input"
    click Checkbox "https://github.com/enactjs/sandstone/tree/master//Checkbox"
    click DatePicker "https://github.com/enactjs/sandstone/tree/master//DatePicker"
    click Slider "https://github.com/enactjs/sandstone/tree/master//Slider"
    click Switch "https://github.com/enactjs/sandstone/tree/master//Switch"
    click ThemeDecorator "https://github.com/enactjs/sandstone/tree/master//ThemeDecorator"
    click Skinnable "https://github.com/enactjs/sandstone/tree/master//Skinnable"
    click ContextualMenu "https://github.com/enactjs/sandstone/tree/master//ContextualMenuDecorator"
    click TooltipDec "https://github.com/enactjs/sandstone/tree/master//TooltipDecorator"
    click ThemeVars "https://github.com/enactjs/sandstone/blob/master//styles/variables.less"
    click ColorSystem "https://github.com/enactjs/sandstone/blob/master//styles/colors.less"
    click SkinImpl "https://github.com/enactjs/sandstone/blob/master//styles/skin.less"
    click UITests "https://github.com/enactjs/sandstone/tree/master//tests/ui"
    click ScreenTests "https://github.com/enactjs/sandstone/tree/master//tests/screenshot"
    click CompSpecs "https://github.com/enactjs/sandstone/tree/master//tests/ui/specs"

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef layout fill:#4CAF50,stroke:#2E7D32,color:white
    classDef input fill:#FF9800,stroke:#EF6C00,color:white
    classDef decorator fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef theme fill:#607D8B,stroke:#37474F,color:white
    classDef testing fill:#795548,stroke:#4E342E,color:white

    %% Legend
    subgraph Legend
        CoreLegend["Core Components"]:::core
        LayoutLegend["Layout Components"]:::layout
        InputLegend["Input Components"]:::input
        DecoratorLegend["Decorator Components"]:::decorator
        ThemeLegend["Theme System"]:::theme
        TestingLegend["Testing"]:::testing
    end
```
