@mjpvs/agentic-component-library-test 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -0
- package/dist/components/Box/Box.d.ts +7 -0
- package/dist/components/Box/Box.stories.d.ts +7 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/Button.stories.d.ts +13 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +7 -0
- package/dist/components/Card/Card.stories.d.ts +12 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Container/Container.d.ts +6 -0
- package/dist/components/Container/Container.stories.d.ts +7 -0
- package/dist/components/Container/index.d.ts +2 -0
- package/dist/components/Flex/Flex.d.ts +11 -0
- package/dist/components/Flex/Flex.stories.d.ts +9 -0
- package/dist/components/Flex/index.d.ts +2 -0
- package/dist/components/Grid/Grid.d.ts +14 -0
- package/dist/components/Grid/Grid.stories.d.ts +9 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Heading/Heading.d.ts +6 -0
- package/dist/components/Heading/Heading.stories.d.ts +9 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/Video/Video.d.ts +12 -0
- package/dist/components/Video/Video.stories.d.ts +9 -0
- package/dist/components/Video/index.d.ts +2 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +963 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# React Component Library
|
|
2
|
+
|
|
3
|
+
[](https://github.com/your-org/your-repo/actions)
|
|
4
|
+
|
|
5
|
+
A modern React component library built with TypeScript, Storybook, and Vitest. Generated entirely agentically as a learning experiment to explore automated component library creation.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Component Library** - Collection of reusable React components
|
|
10
|
+
- **Design Tokens** - Centralized design system with colors, typography, spacing, and more
|
|
11
|
+
- **Storybook** - Component documentation and visual testing
|
|
12
|
+
- **Vitest** - Fast unit testing with React Testing Library
|
|
13
|
+
- **Semantic Release** - Automated versioning and npm publishing
|
|
14
|
+
- **Conventional Commits** - Enforced commit message format
|
|
15
|
+
|
|
16
|
+
## Available Scripts
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Development
|
|
20
|
+
npm run dev # Start Vite dev server
|
|
21
|
+
npm run storybook # Start Storybook on port 6006
|
|
22
|
+
|
|
23
|
+
# Building
|
|
24
|
+
npm run build # Build library (tokens + bundle + types)
|
|
25
|
+
npm run build:tokens # Generate design tokens only
|
|
26
|
+
npm run build-storybook # Build static Storybook
|
|
27
|
+
|
|
28
|
+
# Testing
|
|
29
|
+
npm test # Run tests in watch mode
|
|
30
|
+
npm test run # Run tests once
|
|
31
|
+
npm test run --coverage # Run tests with coverage report
|
|
32
|
+
|
|
33
|
+
# Publishing
|
|
34
|
+
npm run commit # Interactive commit (commitizen)
|
|
35
|
+
npm run release # Run semantic-release (manual)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Components
|
|
39
|
+
|
|
40
|
+
### Layout
|
|
41
|
+
- `Box` - Base container component
|
|
42
|
+
- `Flex` - Flexible layout with direction, justify, align, gap
|
|
43
|
+
- `Grid` - 12-column grid system with span and start props
|
|
44
|
+
- `Container` - Responsive max-width container
|
|
45
|
+
|
|
46
|
+
### UI
|
|
47
|
+
- `Button` - Primary, secondary, outline variants; small, medium, large sizes
|
|
48
|
+
- `Card` - Content container with optional title and padding
|
|
49
|
+
- `Heading` - Levels 1-6
|
|
50
|
+
|
|
51
|
+
### Media
|
|
52
|
+
- `Video` - YouTube embed with aspect ratio options
|
|
53
|
+
|
|
54
|
+
## Design Tokens
|
|
55
|
+
|
|
56
|
+
Tokens are defined in `tokens/design-tokens.json` and generate CSS variables in `src/tokens/_variables.css`.
|
|
57
|
+
|
|
58
|
+
Categories:
|
|
59
|
+
- Colors (primary, gray, white, black)
|
|
60
|
+
- Typography (family, size, weight, line-height)
|
|
61
|
+
- Spacing
|
|
62
|
+
- Border radius
|
|
63
|
+
- Shadows
|
|
64
|
+
- Transitions
|
|
65
|
+
|
|
66
|
+
## Publishing
|
|
67
|
+
|
|
68
|
+
The project uses semantic-release for automatic versioning:
|
|
69
|
+
|
|
70
|
+
1. Create a commit with a conventional commit message:
|
|
71
|
+
```bash
|
|
72
|
+
npm run commit
|
|
73
|
+
# Or: git commit -m "feat: add new component"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Push to main branch
|
|
77
|
+
3. CI/CD runs tests and publishes to npm
|
|
78
|
+
|
|
79
|
+
## Tech Stack
|
|
80
|
+
|
|
81
|
+
- React 18+
|
|
82
|
+
- TypeScript 5+
|
|
83
|
+
- Vite
|
|
84
|
+
- Storybook 8
|
|
85
|
+
- Vitest
|
|
86
|
+
- CSS Modules
|
|
87
|
+
- Style Dictionary
|
|
88
|
+
- Semantic Release
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface BoxProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
as?: keyof JSX.IntrinsicElements;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare function Box({ children, className, as: Component, style }: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ButtonProps {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
3
|
+
size?: 'small' | 'medium' | 'large';
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Button({ variant, size, children, onClick, disabled, className, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Outline: Story;
|
|
9
|
+
export declare const Small: Story;
|
|
10
|
+
export declare const Large: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
export declare const AllVariants: Story;
|
|
13
|
+
export declare const AllSizes: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface CardProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
title?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
padding?: 'none' | 'small' | 'medium' | 'large';
|
|
6
|
+
}
|
|
7
|
+
export declare function Card({ children, title, className, padding, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Card } from './Card';
|
|
3
|
+
declare const meta: Meta<typeof Card>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Card>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithTitle: Story;
|
|
8
|
+
export declare const SmallPadding: Story;
|
|
9
|
+
export declare const LargePadding: Story;
|
|
10
|
+
export declare const NoPadding: Story;
|
|
11
|
+
export declare const WithButton: Story;
|
|
12
|
+
export declare const ComplexCard: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ContainerProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
|
|
5
|
+
}
|
|
6
|
+
export declare function Container({ children, className, size }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Container } from './Container';
|
|
3
|
+
declare const meta: Meta<typeof Container>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Container>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AllSizes: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FlexProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
5
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
6
|
+
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
|
|
7
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
export declare function Flex({ children, className, direction, justify, align, gap, wrap, style, }: FlexProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Flex } from './Flex';
|
|
3
|
+
declare const meta: Meta<typeof Flex>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Flex>;
|
|
6
|
+
export declare const Row: Story;
|
|
7
|
+
export declare const Column: Story;
|
|
8
|
+
export declare const Centered: Story;
|
|
9
|
+
export declare const SpaceBetween: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface GridProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
className?: string;
|
|
4
|
+
columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
}
|
|
7
|
+
export declare function Grid({ children, className, columns, gap }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export interface GridItemProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
12
|
+
start?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
13
|
+
}
|
|
14
|
+
export declare function GridItem({ children, className, span, start }: GridItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Grid } from './Grid';
|
|
3
|
+
declare const meta: Meta<typeof Grid>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Grid>;
|
|
6
|
+
export declare const TwelveColumns: Story;
|
|
7
|
+
export declare const FourColumns: Story;
|
|
8
|
+
export declare const SpanningColumns: Story;
|
|
9
|
+
export declare const WithStartPosition: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Heading } from './Heading';
|
|
3
|
+
declare const meta: Meta<typeof Heading>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Heading>;
|
|
6
|
+
export declare const Level1: Story;
|
|
7
|
+
export declare const Level2: Story;
|
|
8
|
+
export declare const Level3: Story;
|
|
9
|
+
export declare const AllLevels: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VideoProps {
|
|
2
|
+
videoId: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
aspectRatio?: '16-9' | '4-3' | '1-1';
|
|
5
|
+
autoplay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
rel?: boolean;
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Video({ videoId, className, aspectRatio, autoplay, controls, loop, muted, rel, title, }: VideoProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Video } from './Video';
|
|
3
|
+
declare const meta: Meta<typeof Video>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Video>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AspectRatio_4_3: Story;
|
|
8
|
+
export declare const AspectRatio_1_1: Story;
|
|
9
|
+
export declare const Autoplay: Story;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Heading } from './components/Heading';
|
|
2
|
+
export type { HeadingProps } from './components/Heading';
|
|
3
|
+
export { Button } from './components/Button';
|
|
4
|
+
export type { ButtonProps } from './components/Button';
|
|
5
|
+
export { Card } from './components/Card';
|
|
6
|
+
export type { CardProps } from './components/Card';
|
|
7
|
+
export { Box } from './components/Box';
|
|
8
|
+
export type { BoxProps } from './components/Box';
|
|
9
|
+
export { Flex } from './components/Flex';
|
|
10
|
+
export type { FlexProps } from './components/Flex';
|
|
11
|
+
export { Grid, GridItem } from './components/Grid';
|
|
12
|
+
export type { GridProps, GridItemProps } from './components/Grid';
|
|
13
|
+
export { Container } from './components/Container';
|
|
14
|
+
export type { ContainerProps } from './components/Container';
|
|
15
|
+
export { Video } from './components/Video';
|
|
16
|
+
export type { VideoProps } from './components/Video';
|