Skip to content
Draft
Show file tree
Hide file tree
Changes from 70 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
41 changes: 41 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type {StorybookConfig} from '@storybook/vue3-vite';
import {mergeConfig} from 'vite';
import {resolve} from 'path';
import remarkGfm from 'remark-gfm';

const config: StorybookConfig = {
stories: [
'../resources/js/components/**/*.mdx',
'../resources/js/components/**/*.stories.@(js|jsx|mjs|ts|tsx|vue)',
],
addons: [
'@storybook/addon-links',
'@storybook/addon-a11y',
{
name: '@storybook/addon-docs',
options: {
mdxPluginOptions: {
mdxCompileOptions: {
remarkPlugins: [remarkGfm],
},
},
},
},
],
framework: {
name: '@storybook/vue3-vite',
options: {},
},
viteFinal(config) {
return mergeConfig(config, {
resolve: {
alias: {
'@': resolve(__dirname, '../resources/js'),
'@actions': resolve(__dirname, '../resources/js/actions'),
},
},
});
},
};

export default config;
30 changes: 30 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type {Preview} from '@storybook/vue3';

// Import global styles
import '../resources/css/cp.css';

// Import craftcms-cp web components
import '@craftcms/cp';

const preview: Preview = {
parameters: {
controls: {
expanded: true,
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
options: {
storySort: {
method: 'alphabetical',
},
},
a11y: {
test: 'todo',
},
},
tags: ['autodocs'],
};

export default preview;
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ if (!$event->isValid) {
- `src/User/Events/` - User-related events
- `src/Plugin/Events/` - Plugin lifecycle events

### Templates

A portion of this port is moving from twig + jQuery templates into [Inertia](https://inertiajs.com/) + VueJs. The original twig templates are conttained in `resources/templates` the new Inertia Vue files will live in `resources/js`.

We're also building component library located in the `@craftcms/cp` package. Whenever possible, use components from that package to build out UI.


## Common Pitfalls

### Unicode Characters in Source Files
Expand Down
Loading