Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ jobs:
commit: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ jobs:
- name: Publish snapshot to npm
env:
TAG: ${{ github.event.inputs.tag }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
npx changeset publish --tag "$TAG"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
.DS_Store
coverage/
storybook-static/
.idea/
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

All notable changes to the ArtisanPack UI React monorepo will be documented in this file.

Per-package changelogs are generated automatically by [Changesets](https://github.com/changesets/changesets) and can be found in each package directory.

The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added

- `@artisanpack-ui/tokens` — Design tokens package with colors, spacing, typography, shadows, animations, borders, and glass morphism presets
- `@artisanpack-ui/react` — 56+ React UI components (form, layout, navigation, data display, feedback, utility) styled with DaisyUI and Tailwind CSS
- `@artisanpack-ui/react-laravel` — Inertia.js adapter wrappers for navigation, forms, auth, layout, and toast integration
- Storybook with 56 component stories and DaisyUI theme switcher (31 themes)
- Chromatic CI integration for visual regression testing
- Changesets-based release workflow with npm publishing pipeline
- Full TypeScript support with strict mode across all packages
- React 18 and React 19 compatibility
196 changes: 196 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Contributing to ArtisanPack UI React

Thank you for your interest in contributing! This guide covers the local development setup, code style, changeset workflow, and PR process.

## Prerequisites

- **Node.js** 18+ (LTS recommended)
- **npm** 9+
- **Git**

## Local Development Setup

### 1. Clone and install

```bash
git clone https://github.com/ArtisanPack-UI/react.git
cd react
npm install
```

### 2. Build all packages

```bash
npm run build
```

This builds `tokens` → `react` → `react-laravel` in workspace order.

### 3. Start Storybook

```bash
npm run storybook
```

Opens at [http://localhost:6006](http://localhost:6006) with all component stories and a DaisyUI theme switcher.

### 4. Run tests

```bash
npm test
```

Or run tests for a specific package:

```bash
cd packages/tokens && npm test
cd packages/react && npm test
```

## Monorepo Structure

```text
packages/
├── tokens/ # @artisanpack-ui/tokens — Design tokens and utilities
├── react/ # @artisanpack-ui/react — React component library
└── react-laravel/ # @artisanpack-ui/react-laravel — Inertia.js adapters
```

All three packages are versioned together using [Changesets](https://github.com/changesets/changesets) linked versioning.

## Code Style

### Formatting

We use **Prettier** for code formatting and **ESLint** for linting.

```bash
# Format all source files
npm run format

# Check formatting without writing
npm run format:check

# Lint
npm run lint
```

### TypeScript

- Strict mode is enabled across all packages
- All exports must have explicit type annotations
- Use JSDoc/TSDoc comments on all public APIs

### Component Conventions

- One component per file
- Props interface named `{ComponentName}Props`
- Export both the component and its props type from the component file
- Use `cn()` from `@artisanpack-ui/tokens` for conditional class names
- Style with DaisyUI classes and Tailwind utilities

### File Naming

- Components: `PascalCase.tsx` (e.g. `Button.tsx`)
- Hooks: `camelCase.ts` (e.g. `useTheme.ts`)
- Types: `camelCase.ts` (e.g. `types.ts`)
- Tests: `{name}.test.ts` or `{name}.test.tsx`
- Stories: `{ComponentName}.stories.tsx`

## Adding a New Component

1. Create the component file in the appropriate category under `packages/react/src/components/`:

```text
packages/react/src/components/form/MyComponent/MyComponent.tsx
```

2. Export from the category index:
```ts
// packages/react/src/components/form/index.ts
export { MyComponent } from './MyComponent/MyComponent';
export type { MyComponentProps } from './MyComponent/MyComponent';
```

3. Export from the package root:
```ts
// packages/react/src/index.ts
export { MyComponent } from './components/form/MyComponent/MyComponent';
export type { MyComponentProps } from './components/form/MyComponent/MyComponent';
```

4. Add a Storybook story:

```text
packages/react/src/components/form/MyComponent/MyComponent.stories.tsx
```

5. Add tests:

```text
packages/react/src/components/form/MyComponent/__tests__/MyComponent.test.tsx
```

## Changeset Workflow

Every PR that changes published code **must include a changeset**.

### Adding a changeset

```bash
npm run changeset
```

The interactive CLI walks you through:
1. Which packages are affected
2. Bump type (major / minor / patch)
3. A summary (this becomes the changelog entry)

This creates a file in `.changeset/` — commit it with your PR.

### When to use each bump type

| Bump | When |
|------|------|
| **patch** | Bug fixes, documentation improvements, internal refactors |
| **minor** | New components, new props, new hooks, new features |
| **major** | Breaking changes to existing component APIs or removal of exports |

## Pull Request Process

1. **Branch from `release/1.0`** (or the current release branch):
```bash
git checkout -b feature/my-change release/1.0
```

2. **Make your changes** following the code style and conventions above.

3. **Add a changeset** if you changed published code.

4. **Run checks locally**:
```bash
npm run build
npm test
npm run lint
npm run format:check
npm run type-check
```

5. **Push and open a PR** targeting the release branch.

6. **CI runs automatically** — build, lint, tests, and Chromatic visual regression.

7. **Address review feedback** — CodeRabbit and maintainers will review.

## Releasing

See [docs/Releasing.md](./docs/Releasing.md) for the full release process, including stable releases, snapshots, and troubleshooting.

## Getting Help

- Open an issue on [GitHub](https://github.com/ArtisanPack-UI/react/issues)
- Check existing issues and discussions before opening a new one

## License

By contributing, you agree that your contributions will be licensed under the [MIT License](./LICENSE).
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Jacob Martella

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
136 changes: 136 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# ArtisanPack UI React

[![CI](https://github.com/ArtisanPack-UI/react/actions/workflows/ci.yml/badge.svg)](https://github.com/ArtisanPack-UI/react/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)

A comprehensive React UI component ecosystem for building modern web applications. Includes 56+ components styled with [DaisyUI](https://daisyui.com/) and [Tailwind CSS](https://tailwindcss.com/), a shared design tokens package, and first-class [Laravel](https://laravel.com/) / [Inertia.js](https://inertiajs.com/) integration.

## Packages

| Package | Description |
|---------|-------------|
| [`@artisanpack-ui/tokens`](./packages/tokens) | Design tokens — colors, spacing, typography, shadows, animations, glass morphism presets |
| [`@artisanpack-ui/react`](./packages/react) | 56+ React UI components (form, layout, navigation, data display, feedback, utility) |
| [`@artisanpack-ui/react-laravel`](./packages/react-laravel) | Inertia.js adapter wrappers for navigation, forms, auth, and toast integration |

## Quick Start

### Install

```bash
# Core components
npm install @artisanpack-ui/react @artisanpack-ui/tokens

# With Laravel/Inertia support
npm install @artisanpack-ui/react-laravel
```

### Peer Dependencies

```bash
npm install react react-dom tailwindcss daisyui
```

`@artisanpack-ui/react-laravel` also requires `@inertiajs/react`.

### Set Up Tailwind CSS

Import the tokens CSS in your Tailwind entry file:

```css
@import "tailwindcss";
@import "@artisanpack-ui/tokens/css";
```

### Use Components

```tsx
import { Button, Input, Card } from '@artisanpack-ui/react';
import { ThemeProvider } from '@artisanpack-ui/react';

function App() {
return (
<ThemeProvider>
<Card>
<Input label="Email" type="email" />
<Button color="primary">Submit</Button>
</Card>
</ThemeProvider>
);
}
```

### Laravel / Inertia Usage

```tsx
import { useInertiaForm, AppLayout, createLayout } from '@artisanpack-ui/react-laravel';
import { Input, Button } from '@artisanpack-ui/react';

function LoginPage() {
const { form, field } = useInertiaForm({ email: '', password: '' });

return (
<form onSubmit={(e) => { e.preventDefault(); form.post('/login'); }}>
<Input label="Email" {...field('email')} />
<Input label="Password" type="password" {...field('password')} />
<Button color="primary" loading={form.processing}>Log In</Button>
</form>
);
}

LoginPage.layout = createLayout(AppLayout);
```

## Component Categories

- **Form** — Button, Input, Select, Checkbox, Toggle, DatePicker, ColorPicker, RichTextEditor, and more
- **Layout** — Card, Modal, Tabs, Accordion, Drawer, Dropdown, Grid, Stack, Popover
- **Navigation** — Menu, Breadcrumbs, Pagination, Steps, Navbar, Sidebar, SpotlightSearch
- **Data Display** — Table, Chart, Calendar, Avatar, Badge, Progress, Stat, Timeline, Carousel, Code, Diff
- **Feedback** — Alert, Toast, Loading, Skeleton, EmptyState, ErrorDisplay
- **Utility** — Icon, ThemeToggle, Tooltip, Clipboard, Markdown

## Theming

All components support DaisyUI's 31 built-in themes plus custom themes. Wrap your app with `ThemeProvider` to enable dark/light/system mode:

```tsx
import { ThemeProvider, ThemeToggle } from '@artisanpack-ui/react';

<ThemeProvider defaultColorScheme="system">
<ThemeToggle />
{/* your app */}
</ThemeProvider>
```

## React Compatibility

All packages support both React 18 and React 19.

## Documentation

- [Getting Started](https://github.com/ArtisanPack-UI/react/wiki/Getting-Started)
- [Component API Reference](https://github.com/ArtisanPack-UI/react/wiki/Component-API-Reference)
- [Design Tokens Guide](https://github.com/ArtisanPack-UI/react/wiki/Design-Tokens)
- [Theming Guide](https://github.com/ArtisanPack-UI/react/wiki/Theming)
- [Laravel / Inertia Integration](https://github.com/ArtisanPack-UI/react/wiki/Laravel-Inertia-Integration)
- [Migration from Livewire](https://github.com/ArtisanPack-UI/react/wiki/Migration-from-Livewire)
- [React 18 vs 19 Compatibility](https://github.com/ArtisanPack-UI/react/wiki/React-18-vs-19-Compatibility)
- [Releasing](https://github.com/ArtisanPack-UI/react/wiki/Releasing)

## Development

```bash
git clone https://github.com/ArtisanPack-UI/react.git
cd react
npm install
npm run build
npm run storybook # View components at http://localhost:6006
npm test # Run test suites
```

See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full development guide.

## License

[MIT](./LICENSE) — Jacob Martella
Loading
Loading