manolis-ui 0.0.9 → 0.0.11
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/.github/workflows/deploy_and_publish.yml +113 -0
- package/.storybook/main.ts +34 -0
- package/.storybook/preview.ts +17 -0
- package/.vscode/extensions.json +3 -0
- package/dist/manolis-ui.css +1 -1
- package/dist/manolis-ui.js +4 -4
- package/dist/manolis-ui.umd.cjs +1 -1
- package/dist/style.css +48 -0
- package/index.html +13 -0
- package/package.json +1 -5
- package/postcss.config.js +2 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +19 -0
- package/src/assets/vue.svg +1 -0
- package/src/components/data-input/datetimePicker.vue +3 -10
- package/src/composables/useLocalStorage.ts +24 -0
- package/src/index.ts +30 -0
- package/src/main.ts +5 -0
- package/src/stories/actions/Button.stories.ts +47 -0
- package/src/stories/actions/Dropdown.stories.ts +70 -0
- package/src/stories/actions/Modal.stories.ts +56 -0
- package/src/stories/actions/Swap.stories.ts +56 -0
- package/src/stories/actions/ThemeSwitcher.stories.ts +41 -0
- package/src/stories/data-display/accordion.stories.ts +49 -0
- package/src/stories/data-display/avatar.stories.ts +75 -0
- package/src/stories/data-display/badge.stories.ts +76 -0
- package/src/stories/data-display/card.stories.ts +79 -0
- package/src/stories/data-input/rating.stories.ts +73 -0
- package/src/stories/feedback/Loader.stories.ts +34 -0
- package/src/stories/layout/footer.stories.ts +63 -0
- package/src/style.css +57 -0
- package/src/vite-env.d.ts +1 -0
- package/storybook-static/assets/Button.stories-B5Gg7Ski.js +6 -0
- package/storybook-static/assets/Color-YHDXOIA2-Cy_mA6cn.js +1 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-wSGN0bIp.js +610 -0
- package/storybook-static/assets/Dropdown.stories-Bth3_21L.js +32 -0
- package/storybook-static/assets/Loader.stories-BnqtyQP_.js +5 -0
- package/storybook-static/assets/Modal.stories-CxOA4msz.js +46 -0
- package/storybook-static/assets/Swap.stories-Cpc9q_kE.js +54 -0
- package/storybook-static/assets/ThemeSwitcher.stories-BwHcHihM.js +45 -0
- package/storybook-static/assets/accordion.stories-B6yDsDXk.js +7 -0
- package/storybook-static/assets/avatar.stories-BDN93iYh.js +39 -0
- package/storybook-static/assets/badge.stories-CXQpnu0e.js +39 -0
- package/storybook-static/assets/card.stories-1gVWO2fs.js +48 -0
- package/storybook-static/assets/entry-preview-Cfvj9hgI.js +1 -0
- package/storybook-static/assets/entry-preview-docs-BJQT5BWv.js +16 -0
- package/storybook-static/assets/footer.stories-DPXqApht.js +23 -0
- package/storybook-static/assets/iframe-BNdG_Qtn.js +211 -0
- package/storybook-static/assets/index-Bx-go_-4.js +8 -0
- package/storybook-static/assets/index-CiNYFPF0.js +1 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/preview-4lzcCKUM.css +1 -0
- package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
- package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
- package/storybook-static/assets/preview-DD_OYowb.js +1 -0
- package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
- package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
- package/storybook-static/assets/preview-DMNI4LCC.js +15 -0
- package/storybook-static/assets/preview-DnqJFqn_.js +2 -0
- package/storybook-static/assets/preview-Dsq_8SDT.js +240 -0
- package/storybook-static/assets/preview-hHK5u5_Q.js +1 -0
- package/storybook-static/assets/rating.stories-BX0Pzp5i.js +27 -0
- package/storybook-static/assets/vue.esm-bundler-C-YazFc_.js +36 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +666 -0
- package/storybook-static/index.html +181 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +331 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +51 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +402 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +242 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js +222 -0
- package/storybook-static/sb-addons/links-11/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1046 -0
- package/storybook-static/sb-manager/globals-runtime.js +41239 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/storybook-static/vite.svg +1 -0
- package/tsconfig.app.json +27 -0
- package/tsconfig.build.json +3 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +25 -0
- package/vite.config.ts +43 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
import Button from "../../components/actions/ButtonComponent.vue"
|
|
3
|
+
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Actions/Buttons',
|
|
7
|
+
component: Button,
|
|
8
|
+
parameters: {
|
|
9
|
+
slots: {
|
|
10
|
+
default: "Button",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {
|
|
16
|
+
outlined: { control: 'boolean' },
|
|
17
|
+
active: { control: 'boolean' },
|
|
18
|
+
loading: { control: 'boolean' },
|
|
19
|
+
size: { control: 'select', options: ['wide', 'tiny', 'small', 'large'] },
|
|
20
|
+
shape: {control: 'select', options: ['square', 'circle']},
|
|
21
|
+
type: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['neutral', 'primary', 'secondary', 'accent', 'ghost', 'link', 'info', 'success', 'warning', 'error']
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
args: {
|
|
28
|
+
|
|
29
|
+
// primary: false,
|
|
30
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
31
|
+
// onClick: fn(),
|
|
32
|
+
},
|
|
33
|
+
} satisfies Meta<typeof Button>;
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
/*
|
|
38
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
39
|
+
* See https://storybook.js.org/docs/api/csf
|
|
40
|
+
* to learn how to use render functions.
|
|
41
|
+
*/
|
|
42
|
+
export const Primary: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
type: 'primary',
|
|
45
|
+
default: 'Button',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import Dropdown from '../../components/actions/dropdown.vue';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Actions/Dropdown',
|
|
6
|
+
component: Dropdown,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
items: {
|
|
10
|
+
control: 'object',
|
|
11
|
+
description: 'Array of dropdown items with `text` and `link`.',
|
|
12
|
+
},
|
|
13
|
+
position: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['left', 'right', 'bottom', 'top'],
|
|
16
|
+
description: 'Controls the position of the dropdown relative to the button.',
|
|
17
|
+
},
|
|
18
|
+
floatPosition: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['start', 'end'],
|
|
21
|
+
description: 'Determines the float position (start or end).',
|
|
22
|
+
},
|
|
23
|
+
openOnHover: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
description: 'If true, the dropdown opens on hover.',
|
|
26
|
+
},
|
|
27
|
+
forceOpen: {
|
|
28
|
+
control: 'boolean',
|
|
29
|
+
description: 'If true, the dropdown remains open.',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
} as Meta<typeof Dropdown>;
|
|
33
|
+
|
|
34
|
+
const Template: StoryFn<typeof Dropdown> = (args, { slots }) => ({
|
|
35
|
+
components: { Dropdown },
|
|
36
|
+
setup() {
|
|
37
|
+
return { args, slots };
|
|
38
|
+
},
|
|
39
|
+
template: `
|
|
40
|
+
<Dropdown v-bind="args">
|
|
41
|
+
<template #default>
|
|
42
|
+
<div class="btn m-1"><button>Custom Trigger</button></div>
|
|
43
|
+
</template>
|
|
44
|
+
<template #additional>
|
|
45
|
+
<div class="p-2 text-sm">Additional Slot Content</div>
|
|
46
|
+
</template>
|
|
47
|
+
</Dropdown>
|
|
48
|
+
`,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const Default = Template.bind({});
|
|
52
|
+
Default.args = {
|
|
53
|
+
items: [
|
|
54
|
+
{ text: 'Item 1', link: '#' },
|
|
55
|
+
{ text: 'Item 2', link: '#' },
|
|
56
|
+
{ text: 'Item 3', link: '#' },
|
|
57
|
+
],
|
|
58
|
+
position: 'bottom',
|
|
59
|
+
floatPosition: 'start',
|
|
60
|
+
openOnHover: false,
|
|
61
|
+
forceOpen: false,
|
|
62
|
+
};
|
|
63
|
+
Default.parameters = {
|
|
64
|
+
docs: {
|
|
65
|
+
description: {
|
|
66
|
+
component:
|
|
67
|
+
'A dropdown component with configurable props and slots for customization. Be sure to put a button in the default slot to get the desired results!',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Modal from '../../components/actions/modal.vue';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Actions/Modal',
|
|
6
|
+
component: Modal,
|
|
7
|
+
tags: ['autodocs'], // Added autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
position: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['top', 'bottom', 'center'],
|
|
12
|
+
description: 'Controls the position of the modal.',
|
|
13
|
+
},
|
|
14
|
+
withBackdrop: {
|
|
15
|
+
control: 'boolean',
|
|
16
|
+
description: 'If true, a backdrop is displayed behind the modal.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
} as Meta<typeof Modal>;
|
|
20
|
+
|
|
21
|
+
const Template: StoryFn<typeof Modal> = (args, { slots }) => ({
|
|
22
|
+
components: { Modal },
|
|
23
|
+
setup() {
|
|
24
|
+
return { args, slots };
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<Modal v-bind="args">
|
|
28
|
+
<template #trigger>
|
|
29
|
+
<button class="btn">Custom Trigger</button>
|
|
30
|
+
</template>
|
|
31
|
+
<template #default>
|
|
32
|
+
<h2 class="text-xl font-bold">Modal Content</h2>
|
|
33
|
+
<p>This is an example modal.</p>
|
|
34
|
+
</template>
|
|
35
|
+
<template #actions>
|
|
36
|
+
<button class="btn btn-primary">Confirm</button>
|
|
37
|
+
</template>
|
|
38
|
+
<template #close-button>
|
|
39
|
+
<button class="btn btn-secondary">Dismiss</button>
|
|
40
|
+
</template>
|
|
41
|
+
</Modal>
|
|
42
|
+
`,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const Default = Template.bind({});
|
|
46
|
+
Default.args = {
|
|
47
|
+
position: 'center',
|
|
48
|
+
withBackdrop: true,
|
|
49
|
+
};
|
|
50
|
+
Default.parameters = {
|
|
51
|
+
docs: {
|
|
52
|
+
description: {
|
|
53
|
+
component: 'A customizable modal component with slots for trigger, content, actions, and a close button.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Swap from '../../components/actions/swap.vue'; // Adjust the path as per your setup
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Actions/Swap',
|
|
6
|
+
component: Swap,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
effect: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['rotate', 'flip'],
|
|
12
|
+
description: 'The effect applied to the swap component.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
} as Meta<typeof Swap>;
|
|
16
|
+
|
|
17
|
+
const Template: StoryFn<typeof Swap> = (args, { slots }) => ({
|
|
18
|
+
components: { Swap },
|
|
19
|
+
setup() {
|
|
20
|
+
return { args, slots };
|
|
21
|
+
},
|
|
22
|
+
template: `
|
|
23
|
+
<Swap v-bind="args">
|
|
24
|
+
<template #on>
|
|
25
|
+
<div class="text-green-500 font-bold">On</div>
|
|
26
|
+
</template>
|
|
27
|
+
<template #off>
|
|
28
|
+
<div class="text-red-500 font-bold">Off</div>
|
|
29
|
+
</template>
|
|
30
|
+
</Swap>
|
|
31
|
+
`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const Default = Template.bind({});
|
|
35
|
+
Default.args = {
|
|
36
|
+
effect: 'rotate',
|
|
37
|
+
};
|
|
38
|
+
Default.parameters = {
|
|
39
|
+
docs: {
|
|
40
|
+
description: {
|
|
41
|
+
component: 'A swap component with optional effects and customizable slots for "on" and "off" states.',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const FlipEffect = Template.bind({});
|
|
47
|
+
FlipEffect.args = {
|
|
48
|
+
effect: 'flip',
|
|
49
|
+
};
|
|
50
|
+
FlipEffect.parameters = {
|
|
51
|
+
docs: {
|
|
52
|
+
description: {
|
|
53
|
+
story: 'This variant applies the "flip" effect to the swap component.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import ThemeSwitcher from '../../components/actions/theme-controller.vue'; // Adjust the path as per your setup
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Actions/ThemeSwitcher',
|
|
6
|
+
component: ThemeSwitcher,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
darkTheme: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: "Define the name of your dark theme here",
|
|
12
|
+
},
|
|
13
|
+
lightTheme: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: "Define the name of your light theme here",
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
} as Meta<typeof ThemeSwitcher>;
|
|
19
|
+
|
|
20
|
+
const Template: StoryFn<typeof ThemeSwitcher> = (args) => ({
|
|
21
|
+
components: { ThemeSwitcher },
|
|
22
|
+
setup() {
|
|
23
|
+
return { args };
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<ThemeSwitcher v-bind="args" />
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({});
|
|
31
|
+
Default.args = {
|
|
32
|
+
darkTheme: 'reserveren-dark',
|
|
33
|
+
lightTheme: 'reserveren-light',
|
|
34
|
+
};
|
|
35
|
+
Default.parameters = {
|
|
36
|
+
docs: {
|
|
37
|
+
description: {
|
|
38
|
+
component: 'A theme switcher component that toggles between light and dark themes with localStorage support.',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
import Accordion from '../../components/data-display/accordion.vue'
|
|
3
|
+
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Data Display/Accordion',
|
|
7
|
+
component: Accordion,
|
|
8
|
+
parameters: {
|
|
9
|
+
slots: {
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
name: {control: "text", type: "string"},
|
|
16
|
+
items: {control: "object"},
|
|
17
|
+
joinItems: {control: "boolean", description: "Glue every item together or seperate every item."},
|
|
18
|
+
icon: {control: "radio", options: ["arrow", "plus"]}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
args: {
|
|
22
|
+
joinItems: false,
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
title: "item 1",
|
|
26
|
+
content: "this is some text you can adjust with a wysiwyg editor or just in plain text",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "item 2",
|
|
30
|
+
content: "this is also some text you can adjust with a <strong>wysiwyg</strong> editor or just in plain text/html",
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
} satisfies Meta<typeof Accordion>;
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
38
|
+
/*
|
|
39
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
40
|
+
* See https://storybook.js.org/docs/api/csf
|
|
41
|
+
* to learn how to use render functions.
|
|
42
|
+
*/
|
|
43
|
+
export const Primary: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
name: "demo-accordion",
|
|
46
|
+
joinItems: false,
|
|
47
|
+
icon: "plus",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import Avatar from '../../components/data-display/avatar.vue'; // Adjust the path as per your setup
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Display/Avatar',
|
|
6
|
+
component: Avatar,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
image: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'URL of the avatar image.',
|
|
12
|
+
},
|
|
13
|
+
onlineStatus: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['online', 'offline', 'none'],
|
|
16
|
+
description: 'Online status of the avatar.',
|
|
17
|
+
},
|
|
18
|
+
initials: {
|
|
19
|
+
control: "text",
|
|
20
|
+
description: 'The Initials of the user'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
} as Meta<typeof Avatar>;
|
|
24
|
+
|
|
25
|
+
const Template: StoryFn<typeof Avatar> = (args) => ({
|
|
26
|
+
components: { Avatar },
|
|
27
|
+
setup() {
|
|
28
|
+
return { args };
|
|
29
|
+
},
|
|
30
|
+
template: `
|
|
31
|
+
<Avatar v-bind="args" />
|
|
32
|
+
`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const Default = Template.bind({});
|
|
36
|
+
Default.args = {
|
|
37
|
+
image: 'https://randomuser.me/api/portraits/men/32.jpg', // Example image URL
|
|
38
|
+
onlineStatus: "none",
|
|
39
|
+
initials: "JM",
|
|
40
|
+
};
|
|
41
|
+
Default.parameters = {
|
|
42
|
+
docs: {
|
|
43
|
+
description: {
|
|
44
|
+
component: 'An avatar component that displays an online/offline status based on the `online` prop.',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Online = Template.bind({});
|
|
50
|
+
Online.args = {
|
|
51
|
+
image: 'https://randomuser.me/api/portraits/men/32.jpg', // Example image URL
|
|
52
|
+
onlineStatus: "online",
|
|
53
|
+
initials: "SYP",
|
|
54
|
+
};
|
|
55
|
+
Online.parameters = {
|
|
56
|
+
docs: {
|
|
57
|
+
description: {
|
|
58
|
+
component: 'An avatar component that displays an online/offline status based on the `online` prop.',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Offline = Template.bind({});
|
|
64
|
+
Offline.args = {
|
|
65
|
+
image: 'https://randomuser.me/api/portraits/men/32.jpg', // Example image URL
|
|
66
|
+
onlineStatus: "offline",
|
|
67
|
+
initials: 'SS'
|
|
68
|
+
};
|
|
69
|
+
Offline.parameters = {
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
story: 'This variant displays the avatar with an offline status.',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Badge from '../../components/data-display/badge.vue'; // Adjust the path as per your setup
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Display/Badge',
|
|
6
|
+
component: Badge,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
color: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['neutral', 'primary', 'secondary', 'accent', 'ghost', 'info', 'success', 'warning', 'error'],
|
|
12
|
+
description: 'Sets the color of the badge.',
|
|
13
|
+
},
|
|
14
|
+
outline: {
|
|
15
|
+
control: 'boolean',
|
|
16
|
+
description: 'If true, the badge will have an outline style.',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['extra small', 'small', 'medium', 'large'],
|
|
21
|
+
description: 'Sets the size of the badge.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
} as Meta<typeof Badge>;
|
|
25
|
+
|
|
26
|
+
const Template: StoryFn<typeof Badge> = (args) => ({
|
|
27
|
+
components: { Badge },
|
|
28
|
+
setup() {
|
|
29
|
+
return { args };
|
|
30
|
+
},
|
|
31
|
+
template: `
|
|
32
|
+
<Badge v-bind="args">New</Badge>
|
|
33
|
+
`,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
color: 'primary',
|
|
39
|
+
outline: false,
|
|
40
|
+
size: 'medium',
|
|
41
|
+
};
|
|
42
|
+
Default.parameters = {
|
|
43
|
+
docs: {
|
|
44
|
+
description: {
|
|
45
|
+
component: 'A customizable badge component with different colors, sizes, and outline styles.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Outlined = Template.bind({});
|
|
51
|
+
Outlined.args = {
|
|
52
|
+
color: 'success',
|
|
53
|
+
outline: true,
|
|
54
|
+
size: 'small',
|
|
55
|
+
};
|
|
56
|
+
Outlined.parameters = {
|
|
57
|
+
docs: {
|
|
58
|
+
description: {
|
|
59
|
+
story: 'This variant demonstrates a badge with the outline style enabled.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const LargeWarning = Template.bind({});
|
|
65
|
+
LargeWarning.args = {
|
|
66
|
+
color: 'warning',
|
|
67
|
+
outline: false,
|
|
68
|
+
size: 'large',
|
|
69
|
+
};
|
|
70
|
+
LargeWarning.parameters = {
|
|
71
|
+
docs: {
|
|
72
|
+
description: {
|
|
73
|
+
story: 'This variant shows a large-sized badge with a warning color.',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import Card from '../../components/data-display/card.vue'; // Adjust the path as per your setup
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Display/Card',
|
|
6
|
+
component: Card,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
imgUrl: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'URL of the image to display on the card.',
|
|
12
|
+
},
|
|
13
|
+
alt: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Alt text for the image.',
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Title displayed on the card.',
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Description text for the card.',
|
|
24
|
+
},
|
|
25
|
+
outlined: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'If true, applies an outline style to the card.',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
} as Meta<typeof Card>;
|
|
31
|
+
|
|
32
|
+
const Template: StoryFn<typeof Card> = (args) => ({
|
|
33
|
+
components: { Card },
|
|
34
|
+
setup() {
|
|
35
|
+
return { args };
|
|
36
|
+
},
|
|
37
|
+
template: `
|
|
38
|
+
<Card v-bind="args">
|
|
39
|
+
<template #details>
|
|
40
|
+
<p>This is additional content passed through the details slot.</p>
|
|
41
|
+
</template>
|
|
42
|
+
<template #actions>
|
|
43
|
+
<button class="btn btn-primary">Action Button</button>
|
|
44
|
+
</template>
|
|
45
|
+
</Card>
|
|
46
|
+
`,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const Default = Template.bind({});
|
|
50
|
+
Default.args = {
|
|
51
|
+
imgUrl: 'https://via.placeholder.com/300x200',
|
|
52
|
+
alt: 'Placeholder image',
|
|
53
|
+
title: 'Card Title',
|
|
54
|
+
description: 'This is a description of the card.',
|
|
55
|
+
outlined: false,
|
|
56
|
+
};
|
|
57
|
+
Default.parameters = {
|
|
58
|
+
docs: {
|
|
59
|
+
description: {
|
|
60
|
+
component: 'A card component that can display an image, title, description, and has an optional outlined style.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const OutlinedCard = Template.bind({});
|
|
66
|
+
OutlinedCard.args = {
|
|
67
|
+
imgUrl: 'https://via.placeholder.com/300x200',
|
|
68
|
+
alt: 'Placeholder image',
|
|
69
|
+
title: 'Outlined Card Title',
|
|
70
|
+
description: 'This card has an outline style applied.',
|
|
71
|
+
outlined: true,
|
|
72
|
+
};
|
|
73
|
+
OutlinedCard.parameters = {
|
|
74
|
+
docs: {
|
|
75
|
+
description: {
|
|
76
|
+
story: 'This variant demonstrates a card with the outline style enabled.',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Rating from '../../components/data-input/rating.vue';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Input/Rating',
|
|
6
|
+
component: Rating,
|
|
7
|
+
tags: ['autodocs'], // Include autodocs tag
|
|
8
|
+
argTypes: {
|
|
9
|
+
initialRating: {
|
|
10
|
+
control: 'number',
|
|
11
|
+
description: 'The initial rating value.',
|
|
12
|
+
},
|
|
13
|
+
numberOfStars: {
|
|
14
|
+
control: 'number',
|
|
15
|
+
description: 'The total number of stars to display.',
|
|
16
|
+
},
|
|
17
|
+
halfStars: {
|
|
18
|
+
control: 'boolean',
|
|
19
|
+
description: 'If true, allows half-star ratings.',
|
|
20
|
+
},
|
|
21
|
+
isInteractive: {
|
|
22
|
+
control: 'boolean',
|
|
23
|
+
description: 'If true, allows users to interact and change the rating.',
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['xs', 'sm', 'md', 'lg'],
|
|
28
|
+
description: 'The size of the star icons.',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
} as Meta<typeof Rating>;
|
|
32
|
+
|
|
33
|
+
const Template: StoryFn<typeof Rating> = (args) => ({
|
|
34
|
+
components: { Rating },
|
|
35
|
+
setup() {
|
|
36
|
+
return { args };
|
|
37
|
+
},
|
|
38
|
+
template: `
|
|
39
|
+
<Rating v-bind="args" />
|
|
40
|
+
`,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const Default = Template.bind({});
|
|
44
|
+
Default.args = {
|
|
45
|
+
initialRating: 2.5,
|
|
46
|
+
numberOfStars: 5,
|
|
47
|
+
halfStars: false,
|
|
48
|
+
isInteractive: false,
|
|
49
|
+
size: 'sm',
|
|
50
|
+
};
|
|
51
|
+
Default.parameters = {
|
|
52
|
+
docs: {
|
|
53
|
+
description: {
|
|
54
|
+
component: 'A star rating component with options for interactivity, half-star ratings, and size customization.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Interactive = Template.bind({});
|
|
60
|
+
Interactive.args = {
|
|
61
|
+
initialRating: 3,
|
|
62
|
+
numberOfStars: 5,
|
|
63
|
+
halfStars: false,
|
|
64
|
+
isInteractive: true,
|
|
65
|
+
size: 'xs',
|
|
66
|
+
};
|
|
67
|
+
Interactive.parameters = {
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
story: 'This variant allows users to interact and change the rating.',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
import Loader from '../../components/feedback/loader.vue'
|
|
3
|
+
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'feedback/Loader',
|
|
7
|
+
component: Loader,
|
|
8
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
loading: { control: 'boolean' },
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
args: {
|
|
15
|
+
|
|
16
|
+
// primary: false,
|
|
17
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
18
|
+
// onClick: fn(),
|
|
19
|
+
},
|
|
20
|
+
} satisfies Meta<typeof Loader>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
/*
|
|
25
|
+
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
26
|
+
* See https://storybook.js.org/docs/api/csf
|
|
27
|
+
* to learn how to use render functions.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export const LoadingState: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
loading: true,
|
|
33
|
+
},
|
|
34
|
+
};
|