# definiteconfusion/notion-components architecture

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

- Interactive diagram: https://gitdiagram.com/definiteconfusion/notion-components
- Repository: https://github.com/definiteconfusion/notion-components

## Overview

##### Project type and purpose
- This is an open-source React component library (“Notion Components”) that bundles a set of reusable, Notion-style UI widgets (Buttons, Cards, Code blocks, Tables, etc.).
- Its primary goal is to let consumers install an NPM package (or pull in a single JS/CSS bundle) and use these styled components in their own React apps.

##### File structure
Top level
- package.json, package-lock.json         → NPM package metadata, dependencies, scripts
- webpack.config.js, compile.sh           → Build configuration and entry-point shell script
- dist/bundle.js                          → Final published bundle (JS + inlined CSS or links to CSS)
- public/index.html                       → Demo/test harness page for manual QA or documentation preview
- src/index.jsx, src/pack.jsx             → Library entry points that import/export all individual components
- src/notion-components/…                 → One folder per component, each with:
– JSX source
– SASS/CSS + source maps
– Markdown README for consumer usage
- README.md, LICENSE                      → Project overview, documentation pointer, license

##### Key insights from README
- No backend or database; pure frontend/UI library
- Documentation hosted on a Notion page (external service)
- Licensed under Creative Commons 4.0
- Single-module distribution model (one bundle for all components)

##### Detail level
- Layer distinctly:
[Developer] → [Source modules + SASS] → [Webpack/Babel/Sass pipeline] → [bundle.js + CSS maps]
→ → [Demo site] and [NPM registry] → → [Consumer React apps]
- Important config files (webpack.config.js, compile.sh)
- Call out the “pack.jsx/index.jsx” entrypoints as the root import graph

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Workstation
    subgraph "Developer Workstation"
        style DeveloperWorkstation fill:#aed6f1,stroke:#2980b9,stroke-width:2px
        DW_Source["Source Code (src/notion-components/*)"]:::source
        Compile["compile.sh"]:::config
        WebpackConfig["webpack.config.js"]:::config
    end

    %% Build System
    subgraph "Build System"
        style BuildSystem fill:#f5b041,stroke:#d35400,stroke-width:2px
        EntryIndex["src/index.jsx"]:::source
        EntryPack["src/pack.jsx"]:::source
        subgraph "Component Source Modules"
            Buttons["Buttons.jsx"]:::source
            Card["Card.jsx"]:::source
            Code["Code.jsx"]:::source
            Containers["Containers.jsx"]:::source
            Fallback["Fallback.jsx"]:::source
            Headers["Headers.jsx"]:::source
            Icon["Icon.jsx"]:::source
            Image["Image.jsx"]:::source
            LinkComp["Link.jsx"]:::source
            MathComp["Math.jsx"]:::source
            Spinner["Spinner.jsx"]:::source
            StylesComp["Styles.jsx"]:::source
            Table["Table.jsx"]:::source
            Tag["Tag.jsx"]:::source
            Toggle["Toggle.jsx"]:::source
            Tooltips["Tooltips.jsx"]:::source
        end
        Styles["SASS/CSS + maps"]:::source
    end

    %% Distribution & Demo
    subgraph "Distribution & Demo"
        style DistDemo fill:#a9dfbf,stroke:#27ae60,stroke-width:2px
        Bundle["dist/bundle.js"]:::dist
        DemoPage["public/index.html"]:::dist
        NPM["NPM Registry"]:::external
        GitHub["GitHub Releases"]:::external
    end

    %% Consumer Applications
    subgraph "Consumer Applications"
        style Consumer fill:#d5dbdb,stroke:#566573,stroke-width:2px
        ConsumerApp["React App"]:::consumer
    end

    %% Package Metadata
    subgraph "Package Metadata"
        style Metadata fill:#f9e79f,stroke:#b7950b,stroke-width:2px
        PKG["package.json"]:::config
        PKGLock["package-lock.json"]:::config
        License["LICENSE"]:::config
        Readme["README.md"]:::config
    end

    %% Connections
    DW_Source -->|edits| Compile
    DW_Source -->|edits| WebpackConfig
    Compile -->|runs| BuildSystem
    WebpackConfig --> BuildSystem

    EntryIndex -->|"imports components"| Buttons
    EntryIndex --> Card
    EntryIndex --> Code
    EntryIndex --> Containers
    EntryIndex --> Fallback
    EntryIndex --> Headers
    EntryIndex --> Icon
    EntryIndex --> Image
    EntryIndex --> LinkComp
    EntryIndex --> MathComp
    EntryIndex --> Spinner
    EntryIndex --> StylesComp
    EntryIndex --> Table
    EntryIndex --> Tag
    EntryIndex --> Toggle
    EntryIndex --> Tooltips

    Styles --> BuildSystem
    Buttons --> BuildSystem
    Card --> BuildSystem
    Code --> BuildSystem
    Containers --> BuildSystem
    Fallback --> BuildSystem
    Headers --> BuildSystem
    Icon --> BuildSystem
    Image --> BuildSystem
    LinkComp --> BuildSystem
    MathComp --> BuildSystem
    Spinner --> BuildSystem
    StylesComp --> BuildSystem
    Table --> BuildSystem
    Tag --> BuildSystem
    Toggle --> BuildSystem
    Tooltips --> BuildSystem
    EntryPack --> BuildSystem

    BuildSystem -->|"outputs"| Bundle
    BuildSystem -->|"serves"| DemoPage
    Bundle --> NPM
    Bundle --> GitHub
    NPM --> ConsumerApp
    Bundle --> ConsumerApp

    PKG --> NPM
    PKGLock --> NPM
    License --> NPM
    Readme --> NPM

    %% Click Events
    click Compile "https://github.com/definiteconfusion/notion-components/blob/main/compile.sh"
    click WebpackConfig "https://github.com/definiteconfusion/notion-components/blob/main/webpack.config.js"
    click EntryIndex "https://github.com/definiteconfusion/notion-components/blob/main/src/index.jsx"
    click EntryPack "https://github.com/definiteconfusion/notion-components/blob/main/src/pack.jsx"
    click Buttons "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Buttons/Buttons.jsx"
    click Card "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Card/Card.jsx"
    click Code "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Code/Code.jsx"
    click Containers "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Containers/Containers.jsx"
    click Fallback "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Fallback/Fallback.jsx"
    click Headers "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Headers/Headers.jsx"
    click Icon "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Icon/Icon.jsx"
    click Image "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Image/Image.jsx"
    click LinkComp "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Link/Link.jsx"
    click MathComp "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Math/Math.jsx"
    click Spinner "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Spinner/Spinner.jsx"
    click StylesComp "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Styles/Styles.jsx"
    click Table "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Table/Table.jsx"
    click Tag "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Tag/Tag.jsx"
    click Toggle "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Toggle/Toggle.jsx"
    click Tooltips "https://github.com/definiteconfusion/notion-components/blob/main/src/notion-components/Tooltips/Tooltips.jsx"
    click Bundle "https://github.com/definiteconfusion/notion-components/blob/main/dist/bundle.js"
    click DemoPage "https://github.com/definiteconfusion/notion-components/blob/main/public/index.html"
    click PKG "https://github.com/definiteconfusion/notion-components/blob/main/package.json"
    click PKGLock "https://github.com/definiteconfusion/notion-components/blob/main/package-lock.json"
    click License "https://github.com/definiteconfusion/notion-components/tree/main/LICENSE"
    click Readme "https://github.com/definiteconfusion/notion-components/blob/main/README.md"

    %% Classes
    classDef source fill:#aed6f1,stroke:#2980b9
    classDef config fill:#f9e79f,stroke:#b7950b
    classDef dist fill:#a9dfbf,stroke:#27ae60
    classDef external fill:#d7dbdd,stroke:#95a5a6,stroke-dasharray: 5 5
    classDef consumer fill:#d5dbdb,stroke:#566573,stroke-width:1px
```
