@menumalsuite/design-system 0.0.1 → 0.0.2

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.
@@ -0,0 +1,35 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
+ import * as ButtonStories from './MButton.stories';
3
+
4
+ <Meta of={ButtonStories} />
5
+
6
+ # Button
7
+
8
+ Core interactive element for actions and navigation.
9
+
10
+ ## When to use
11
+
12
+ - **Primary** — main page action, one per screen
13
+ - **Secondary** — secondary, alternative or less urgent actions
14
+ - **Large** — prominent CTAs, hero sections
15
+ - **Small** — toolbars, tables, compact spaces
16
+
17
+ ## Variants
18
+
19
+ <Canvas of={ButtonStories.Primary} />
20
+ <Canvas of={ButtonStories.Secondary} />
21
+
22
+ ## Sizes
23
+
24
+ <Canvas of={ButtonStories.Large} />
25
+ <Canvas of={ButtonStories.Small} />
26
+
27
+ ## Props
28
+
29
+ <Controls />
30
+
31
+ ## Notes
32
+
33
+ - `to` triggers internal navigation via `useRouter`
34
+ - `apiUrl` fires a `$fetch` on click and displays loading/ok/error state
35
+ - `backgroundColor` overrides the theme color — use with caution
@@ -1,10 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
2
  import { fn } from 'storybook/test';
3
- import Button from './Button.vue';
3
+ import MButton from './MButton.vue';
4
4
 
5
5
  const meta = {
6
- title: 'Components/Button',
7
- component: Button,
6
+ title: 'Components/MButton',
7
+ component: MButton,
8
8
  tags: ['autodocs'],
9
9
  argTypes: {
10
10
  size: { control: 'select', options: ['small', 'medium', 'large'] },
@@ -14,7 +14,7 @@ const meta = {
14
14
  primary: false,
15
15
  onClick: fn(),
16
16
  },
17
- } satisfies Meta<typeof Button>;
17
+ } satisfies Meta<typeof MButton>;
18
18
 
19
19
  export default meta;
20
20
  type Story = StoryObj<typeof meta>;
@@ -0,0 +1,27 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
+ import * as HeaderStories from './MHeader.stories';
3
+
4
+ <Meta of={HeaderStories} />
5
+
6
+ # Header
7
+
8
+ Main navigation bar of the application.
9
+
10
+ ## When to use
11
+
12
+ Global layout component — place in `app.vue` or the main layout. One instance per page.
13
+
14
+ ## Variants
15
+
16
+ <Canvas of={HeaderStories.LoggedIn} />
17
+ <Canvas of={HeaderStories.LoggedOut} />
18
+
19
+ ## Props
20
+
21
+ <Controls />
22
+
23
+ ## Notes
24
+
25
+ - Handles three events internally: `login`, `logout`, `createAccount`
26
+ - The `user` prop is `null` when unauthenticated
27
+ - Internal buttons use `<Button>` from the design system
@@ -1,10 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
2
  import { fn } from 'storybook/test';
3
- import Header from './Header.vue';
3
+ import MHeader from './MHeader.vue';
4
4
 
5
5
  const meta = {
6
- title: 'Components/Header',
7
- component: Header,
6
+ title: 'Components/MHeader',
7
+ component: MHeader,
8
8
  parameters: { layout: 'fullscreen' },
9
9
  args: {
10
10
  onLogin: fn(),
@@ -12,7 +12,7 @@ const meta = {
12
12
  onCreateAccount: fn(),
13
13
  },
14
14
  tags: ['autodocs'],
15
- } satisfies Meta<typeof Header>;
15
+ } satisfies Meta<typeof MHeader>;
16
16
 
17
17
  export default meta;
18
18
  type Story = StoryObj<typeof meta>;
@@ -0,0 +1,27 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
+ import * as PageStories from './MPage.stories';
3
+
4
+ <Meta of={PageStories} />
5
+
6
+ # Page
7
+
8
+ Base page template with header and main content.
9
+
10
+ ## When to use
11
+
12
+ Starting point for new pages — includes `<Header>` and manages authentication state internally.
13
+
14
+ ## Variants
15
+
16
+ <Canvas of={PageStories.LoggedOut} />
17
+ <Canvas of={PageStories.LoggedIn} />
18
+
19
+ ## Props
20
+
21
+ <Controls />
22
+
23
+ ## Notes
24
+
25
+ - Manages `user` state internally — no need to pass it from outside
26
+ - Composes `<Header>` + `<Button>` from the design system
27
+ - Extend with slots for page-specific content
@@ -1,13 +1,13 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
2
  import { expect, userEvent, within } from 'storybook/test';
3
- import Page from './Page.vue';
3
+ import MPage from './MPage.vue';
4
4
 
5
5
  const meta = {
6
- title: 'Components/Page',
7
- component: Page,
6
+ title: 'Components/MPage',
7
+ component: MPage,
8
8
  parameters: { layout: 'fullscreen' },
9
9
  tags: ['autodocs'],
10
- } satisfies Meta<typeof Page>;
10
+ } satisfies Meta<typeof MPage>;
11
11
 
12
12
  export default meta;
13
13
  type Story = StoryObj<typeof meta>;
package/nuxt.config.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // https://nuxt.com/docs/api/configuration/nuxt-config
2
2
  export default defineNuxtConfig({
3
3
  devtools: { enabled: true },
4
- components: [{ path: './app/components', pathPrefix: false }],
4
+ components: [{ path: './app/components', pathPrefix: false, global: true }],
5
5
  vite: {
6
6
  optimizeDeps: {
7
7
  include: ["@vue/devtools-core", "@vue/devtools-kit"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@menumalsuite/design-system",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "main": "./nuxt.config.ts",
6
6
  "exports": {
7
7
  ".": "./nuxt.config.ts"
File without changes