# jpngeekudin/puni-ui architecture

> Architecture diagram of the GitHub repository jpngeekudin/puni-ui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jpngeekudin/puni-ui
- Repository: https://github.com/jpngeekudin/puni-ui

## Overview

Puni-UI is a React component library for playful, spring-animated interfaces. An application imports its public API and composes components; those components render interactive controls, content, overlays, and layouts. The library also exposes theme/provider capabilities, design tokens, and a reduced-motion hook. Edges reflect documented exports and sampled component dependencies; unsampled components are included from the README and source tree, but their internal wiring is not inferred.

Main entry points: [`src/index.ts`](https://github.com/jpngeekudin/puni-ui/blob/master/src/index.ts) (Component exports), [`src/hooks/useReducedMotion.ts`](https://github.com/jpngeekudin/puni-ui/blob/master/src/hooks/useReducedMotion.ts) (Reduced-motion hook), [`src/utils/cn.ts`](https://github.com/jpngeekudin/puni-ui/blob/master/src/utils/cn.ts) (Class merger), [`src/components/Button/Button.tsx`](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Button/Button.tsx) (Button)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_public["Component exports<br/>[index.ts]"]
end

subgraph group_controls["Inputs and Feedback"]
  node_button["Button<br/>[Button.tsx]"]
  node_input["Input<br/>[Input.tsx]"]
  node_checkbox["Checkbox and Radio<br/>[Checkbox.tsx]"]
  node_switch["Switch<br/>[Switch.tsx]"]
  node_select["Select<br/>[Select.tsx]"]
  node_progress["Progress<br/>[Progress.tsx]"]
  node_spinner["Spinner<br/>[Spinner.tsx]"]
  node_skeleton["Skeleton<br/>[Skeleton.tsx]"]
end

subgraph group_content["Content and Navigation"]
  node_card["Card<br/>[Card.tsx]"]
  node_badge["Badge<br/>[Badge.tsx]"]
  node_avatar["Avatar<br/>[Avatar.tsx]"]
  node_tabs["Tabs<br/>[Tabs.tsx]"]
  node_navbar["Navbar<br/>[Navbar.tsx]"]
  node_sidebar["Sidebar<br/>[Sidebar.tsx]"]
end

subgraph group_overlays["Overlays"]
  node_tooltip["Tooltip<br/>[Tooltip.tsx]"]
  node_popover["Popover<br/>[Popover.tsx]"]
  node_modal["Modal<br/>[Modal.tsx]"]
  node_toast["Toast<br/>[Toast.tsx]"]
end

subgraph group_foundation["Shared Foundation"]
  node_provider["Theme provider<br/>[PuniProvider.tsx]"]
  node_themes["Preset themes"]
  node_tokens["Design tokens<br/>[index.css]"]
  node_motion["Reduced-motion hook"]
  node_classnames["Class merger<br/>[cn.ts]"]
end

node_app(("React application"))

node_app -->|"imports"| node_public
node_public -->|"imports"| node_tokens
node_public -->|"exports"| node_button
node_public -->|"exports"| node_input
node_public -->|"exports"| node_card
node_public -->|"exports"| node_badge
node_public -->|"exports"| node_switch
node_public -->|"exports"| node_tooltip
node_public -->|"exports"| node_modal
node_public -->|"exports"| node_popover
node_public -->|"exports"| node_avatar
node_public -->|"exports"| node_progress
node_public -->|"exports"| node_spinner
node_public -->|"exports"| node_toast
node_public -->|"exports"| node_tabs
node_public -->|"exports"| node_checkbox
node_public -->|"exports"| node_select
node_public -->|"exports"| node_skeleton
node_public -->|"exports"| node_navbar
node_public -->|"exports"| node_sidebar
node_public -->|"exports"| node_provider
node_public -->|"exports"| node_motion
node_public -->|"exports"| node_classnames
node_button -->|"checks preference"| node_motion
node_button -->|"merges classes"| node_classnames
node_input -->|"checks preference"| node_motion
node_input -->|"merges classes"| node_classnames
node_checkbox -->|"checks preference"| node_motion
node_checkbox -->|"merges classes"| node_classnames
node_switch -->|"checks preference"| node_motion
node_switch -->|"merges classes"| node_classnames
node_select -->|"checks preference"| node_motion
node_select -->|"merges classes"| node_classnames
node_modal -->|"checks preference"| node_motion
node_modal -->|"merges classes"| node_classnames
node_tabs -->|"checks preference"| node_motion
node_tabs -->|"merges classes"| node_classnames
node_tooltip -->|"checks preference"| node_motion
node_tooltip -->|"merges classes"| node_classnames
node_provider -.->|"provides presets"| node_themes

click node_public "https://github.com/jpngeekudin/puni-ui/blob/master/src/index.ts"
click node_button "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Button/Button.tsx"
click node_input "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Input/Input.tsx"
click node_checkbox "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Checkbox/Checkbox.tsx"
click node_switch "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Switch/Switch.tsx"
click node_select "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Select/Select.tsx"
click node_progress "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Progress/Progress.tsx"
click node_spinner "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Spinner/Spinner.tsx"
click node_skeleton "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Skeleton/Skeleton.tsx"
click node_card "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Card/Card.tsx"
click node_badge "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Badge/Badge.tsx"
click node_avatar "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Avatar/Avatar.tsx"
click node_tabs "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Tabs/Tabs.tsx"
click node_navbar "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Navbar/Navbar.tsx"
click node_sidebar "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Sidebar/Sidebar.tsx"
click node_tooltip "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Tooltip/Tooltip.tsx"
click node_popover "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Popover/Popover.tsx"
click node_modal "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Modal/Modal.tsx"
click node_toast "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Toast/Toast.tsx"
click node_provider "https://github.com/jpngeekudin/puni-ui/blob/master/src/components/PuniProvider/PuniProvider.tsx"
click node_themes "https://github.com/jpngeekudin/puni-ui/tree/master/src/themes"
click node_tokens "https://github.com/jpngeekudin/puni-ui/blob/master/src/tokens/index.css"
click node_motion "https://github.com/jpngeekudin/puni-ui/blob/master/src/hooks/useReducedMotion.ts"
click node_classnames "https://github.com/jpngeekudin/puni-ui/blob/master/src/utils/cn.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public toneBlue
class node_button,node_input,node_checkbox,node_switch,node_select,node_progress,node_spinner,node_skeleton toneAmber
class node_card,node_badge,node_avatar,node_tabs,node_navbar,node_sidebar toneMint
class node_tooltip,node_popover,node_modal,node_toast toneRose
class node_provider,node_themes,node_tokens,node_motion,node_classnames,node_app toneIndigo
```

## Components

### Public API

- [Component exports](https://github.com/jpngeekudin/puni-ui/blob/master/src/index.ts): `src/index.ts`

### Inputs and Feedback

- [Button](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Button/Button.tsx): `src/components/Button/Button.tsx`
- [Input](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Input/Input.tsx): `src/components/Input/Input.tsx`
- [Checkbox and Radio](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Checkbox/Checkbox.tsx): `src/components/Checkbox/Checkbox.tsx`
- [Switch](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Switch/Switch.tsx): `src/components/Switch/Switch.tsx`
- [Select](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Select/Select.tsx): `src/components/Select/Select.tsx`
- [Progress](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Progress/Progress.tsx): `src/components/Progress/Progress.tsx`
- [Spinner](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Spinner/Spinner.tsx): `src/components/Spinner/Spinner.tsx`
- [Skeleton](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Skeleton/Skeleton.tsx): `src/components/Skeleton/Skeleton.tsx`

### Content and Navigation

- [Card](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Card/Card.tsx): `src/components/Card/Card.tsx`
- [Badge](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Badge/Badge.tsx): `src/components/Badge/Badge.tsx`
- [Avatar](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Avatar/Avatar.tsx): `src/components/Avatar/Avatar.tsx`
- [Tabs](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Tabs/Tabs.tsx): `src/components/Tabs/Tabs.tsx`
- [Navbar](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Navbar/Navbar.tsx): `src/components/Navbar/Navbar.tsx`
- [Sidebar](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Sidebar/Sidebar.tsx): `src/components/Sidebar/Sidebar.tsx`

### Overlays

- [Tooltip](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Tooltip/Tooltip.tsx): `src/components/Tooltip/Tooltip.tsx`
- [Popover](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Popover/Popover.tsx): `src/components/Popover/Popover.tsx`
- [Modal](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Modal/Modal.tsx): `src/components/Modal/Modal.tsx`
- [Toast](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/Toast/Toast.tsx): `src/components/Toast/Toast.tsx`

### Shared Foundation

- [Theme provider](https://github.com/jpngeekudin/puni-ui/blob/master/src/components/PuniProvider/PuniProvider.tsx): `src/components/PuniProvider/PuniProvider.tsx`
- [Preset themes](https://github.com/jpngeekudin/puni-ui/tree/master/src/themes): `src/themes`
- [Design tokens](https://github.com/jpngeekudin/puni-ui/blob/master/src/tokens/index.css): `src/tokens/index.css`
- [Reduced-motion hook](https://github.com/jpngeekudin/puni-ui/blob/master/src/hooks/useReducedMotion.ts): `src/hooks/useReducedMotion.ts`
- [Class merger](https://github.com/jpngeekudin/puni-ui/blob/master/src/utils/cn.ts): `src/utils/cn.ts`

### Other components

- **React application**

## Connections

- React application → Component exports: imports (evidence: `README.md`)
- Component exports → Design tokens: imports (evidence: `src/index.ts`)
- Component exports → Button: exports (evidence: `src/index.ts`)
- Component exports → Input: exports (evidence: `src/index.ts`)
- Component exports → Card: exports (evidence: `src/index.ts`)
- Component exports → Badge: exports (evidence: `src/index.ts`)
- Component exports → Switch: exports (evidence: `src/index.ts`)
- Component exports → Tooltip: exports (evidence: `src/index.ts`)
- Component exports → Modal: exports (evidence: `src/index.ts`)
- Component exports → Popover: exports (evidence: `src/index.ts`)
- Component exports → Avatar: exports (evidence: `src/index.ts`)
- Component exports → Progress: exports (evidence: `src/index.ts`)
- Component exports → Spinner: exports (evidence: `src/index.ts`)
- Component exports → Toast: exports (evidence: `src/index.ts`)
- Component exports → Tabs: exports (evidence: `src/index.ts`)
- Component exports → Checkbox and Radio: exports (evidence: `src/index.ts`)
- Component exports → Select: exports (evidence: `src/index.ts`)
- Component exports → Skeleton: exports (evidence: `src/index.ts`)
- Component exports → Navbar: exports (evidence: `src/index.ts`)
- Component exports → Sidebar: exports (evidence: `src/index.ts`)
- Component exports → Theme provider: exports (evidence: `src/index.ts`)
- Component exports → Reduced-motion hook: exports (evidence: `src/index.ts`)
- Component exports → Class merger: exports (evidence: `src/index.ts`)
- Button → Reduced-motion hook: checks preference (evidence: `src/components/Button/Button.tsx`)
- Button → Class merger: merges classes (evidence: `src/components/Button/Button.tsx`)
- Input → Reduced-motion hook: checks preference (evidence: `src/components/Input/Input.tsx`)
- Input → Class merger: merges classes (evidence: `src/components/Input/Input.tsx`)
- Checkbox and Radio → Reduced-motion hook: checks preference (evidence: `src/components/Checkbox/Checkbox.tsx`)
- Checkbox and Radio → Class merger: merges classes (evidence: `src/components/Checkbox/Checkbox.tsx`)
- Switch → Reduced-motion hook: checks preference (evidence: `src/components/Switch/Switch.tsx`)
- Switch → Class merger: merges classes (evidence: `src/components/Switch/Switch.tsx`)
- Select → Reduced-motion hook: checks preference (evidence: `src/components/Select/Select.tsx`)
- Select → Class merger: merges classes (evidence: `src/components/Select/Select.tsx`)
- Modal → Reduced-motion hook: checks preference (evidence: `src/components/Modal/Modal.tsx`)
- Modal → Class merger: merges classes (evidence: `src/components/Modal/Modal.tsx`)
- Tabs → Reduced-motion hook: checks preference (evidence: `src/components/Tabs/Tabs.tsx`)
- Tabs → Class merger: merges classes (evidence: `src/components/Tabs/Tabs.tsx`)
- Tooltip → Reduced-motion hook: checks preference (evidence: `src/components/Tooltip/Tooltip.tsx`)
- Tooltip → Class merger: merges classes (evidence: `src/components/Tooltip/Tooltip.tsx`)
- Theme provider → Preset themes: provides presets (evidence: `README.md`)
