# aquarela-io/sso-ui-components architecture

> Architecture diagram of the GitHub repository aquarela-io/sso-ui-components, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aquarela-io/sso-ui-components
- Repository: https://github.com/aquarela-io/sso-ui-components

## Overview

##### Main Component Structure

a) Core Library Components
- Subdivide into two main component categories:
- UI Components (from /src/components/ui)

b) Build & Development Infrastructure
- This on the left side
- Include:
- Vite Development Server
- Rollup Build System
- Storybook Documentation

c) External Dependencies
- This on the right side
- Into:
- Core Dependencies (React, React-DOM)
- UI Utilities (class-variance-authority, tailwind-merge, clsx)
- Component Libraries (Radix UI)

##### Component Relationships

a) Internal Dependencies
- How UI components utilize the utils library
- Button component to its constants and stories

b) External Dependencies
- How components consume Radix UI primitives
- Tailwind CSS integration
- React dependency connections

##### Development Tools Integration

- Storybook integration for component documentation
- Build process flow from source to distribution
- Development environment setup

Use the following visual elements:

- Rectangles: Main components and modules
- Rounded rectangles: External dependencies
- Hexagons: Build tools and infrastructure
- Blue: Core components
- Green: External dependencies
- Orange: Build tools
- Purple: Documentation tools

##### Component Flow

- Component initialization
- Prop flow
- Style application
- Variant handling through class-variance-authority

Remember to:

##### Build/publish workflow

For tools, I recommend using:
- Exportable versions for documentation

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Legend"
        direction TB
        L1[Component]:::component --- L2[External Dependency]:::external
        L2 --- L3[Build Tool]:::build
        L3 --- L4[Documentation]:::docs
    end

    subgraph "Core Library Components"
        direction TB
        UI["UI Components"]:::component
        Icons["Icon Components"]:::component
        Utils["Utilities Library"]:::component
        
        subgraph "Button Implementation"
            direction TB
            Button["Button Component"]:::component
            ButtonConst["Button Constants"]:::component
            ButtonDocs["Button Stories"]:::docs
            Button --> ButtonConst
            Button --> ButtonDocs
        end

        subgraph "SSO Icons"
            direction TB
            IconContainer["Icon Container"]:::component
            GoogleIcon["Google Login Icon"]:::component
            AppleIcon["Apple Login Icon"]:::component
            IconContainer --> GoogleIcon
            IconContainer --> AppleIcon
        end

        UI --> Utils
        Icons --> IconContainer
    end

    subgraph "Build & Development"
        direction TB
        Vite["Vite Dev Server"]:::build
        Rollup["Rollup Build"]:::build
        Storybook["Storybook"]:::docs
        DevApp["Development App"]:::build
        DevEntry["Development Entry"]:::build
        
        Vite --> DevApp
        DevApp --> DevEntry
        Rollup --> PublishFlow["Publishing Workflow"]:::build
    end

    subgraph "External Dependencies"
        direction TB
        React["React"]:::external
        ReactDOM["React-DOM"]:::external
        RadixUI["Radix UI"]:::external
        
        subgraph "UI Utilities"
            direction TB
            CVA["class-variance-authority"]:::external
            TailwindMerge["tailwind-merge"]:::external
            CLSX["clsx"]:::external
        end
    end

    subgraph "Styling System"
        direction TB
        TailwindConfig["Tailwind Config"]:::component
        ThemeConfig["Theme Configuration"]:::component
        GlobalStyles["Global Styles"]:::component
        
        TailwindConfig --> ThemeConfig
        ThemeConfig --> GlobalStyles
    end

    MainExports["Main Library Exports"]:::component

    UI --> MainExports
    Icons --> MainExports
    Button --> MainExports

    click UI "https://github.com/aquarela-io/sso-ui-components/tree/main/src/components/ui"
    click Icons "https://github.com/aquarela-io/sso-ui-components/tree/main/src/components/icons"
    click Utils "https://github.com/aquarela-io/sso-ui-components/blob/main/src/lib/utils.ts"
    click Button "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/ui/Button/index.tsx"
    click ButtonConst "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/ui/Button/constants.ts"
    click ButtonDocs "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/ui/Button/index.stories.tsx"
    click GoogleIcon "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/icons/GoogleIcon.tsx"
    click AppleIcon "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/icons/AppleIcon.tsx"
    click IconContainer "https://github.com/aquarela-io/sso-ui-components/blob/main/src/components/icons/IconContainer.tsx"
    click Vite "https://github.com/aquarela-io/sso-ui-components/blob/main/vite.config.ts"
    click Rollup "https://github.com/aquarela-io/sso-ui-components/blob/main/rollup.config.js"
    click Storybook "https://github.com/aquarela-io/sso-ui-components/blob/main/.storybook/main.ts"
    click TailwindConfig "https://github.com/aquarela-io/sso-ui-components/blob/main/tailwind.config.ts"
    click ThemeConfig "https://github.com/aquarela-io/sso-ui-components/blob/main/.storybook/AquarelaTheme.ts"
    click GlobalStyles "https://github.com/aquarela-io/sso-ui-components/blob/main/src/index.css"
    click DevApp "https://github.com/aquarela-io/sso-ui-components/blob/main/src/dev/App.tsx"
    click DevEntry "https://github.com/aquarela-io/sso-ui-components/blob/main/src/dev/main.tsx"
    click PublishFlow "https://github.com/aquarela-io/sso-ui-components/blob/main/.github/workflows/publish.yml.disabled"
    click MainExports "https://github.com/aquarela-io/sso-ui-components/blob/main/src/index.ts"

    classDef component fill:#3b82f6,color:#fff,stroke:#1d4ed8
    classDef external fill:#22c55e,color:#fff,stroke:#15803d
    classDef build fill:#f97316,color:#fff,stroke:#c2410c
    classDef docs fill:#a855f7,color:#fff,stroke:#7e22ce
```
