diff --git a/frontend/.storybook/preview.ts b/frontend/.storybook/preview.ts index a98cf3253..dafdeba72 100644 --- a/frontend/.storybook/preview.ts +++ b/frontend/.storybook/preview.ts @@ -3,6 +3,8 @@ import { setup } from '@storybook/vue3' import { registerPlugins } from '../src/plugins' import { withVuetifyTheme } from './withVeutifyTheme.decorator' import type { App } from 'vue' +import '@bcgov/bc-sans/css/BCSans.css' +import '../src/styles/style.scss' const preview: Preview = { parameters: { @@ -28,7 +30,17 @@ const preview: Preview = { }, }, }, - decorators: [withVuetifyTheme], + decorators: [ + withVuetifyTheme, + (story) => ({ + components: { story }, + template: ` +
+ +
+ `, + }), + ], } export default preview diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b19307919..27953c9b8 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -3,9 +3,7 @@ - - @@ -16,9 +14,7 @@ diff --git a/frontend/src/components/common/AppMessageDialog.stories.ts b/frontend/src/components/common/AppMessageDialog.stories.ts new file mode 100644 index 000000000..f4c3264cc --- /dev/null +++ b/frontend/src/components/common/AppMessageDialog.stories.ts @@ -0,0 +1,80 @@ +import type { Meta, StoryObj } from '@storybook/vue3' +import AppMessageDialog from '@/components/common/AppMessageDialog.vue' + +const meta: Meta = { + title: 'components/common/AppMessageDialog', + component: AppMessageDialog, + argTypes: { + dialog: { + control: 'boolean', + description: 'Dialog visibility', + defaultValue: true, + }, + title: { + control: 'text', + description: 'Dialog title', + defaultValue: 'VDYP Message', + }, + message: { + control: 'text', + description: 'Dialog message', + defaultValue: 'This is a message.', + }, + dialogWidth: { + control: { type: 'range', min: 200, max: 800, step: 50 }, + description: 'Dialog width', + defaultValue: 400, + }, + dialogBorderRadius: { + control: { type: 'range', min: 0, max: 50, step: 1 }, + description: 'Dialog border radius', + defaultValue: 8, + }, + btnLabel: { + control: 'text', + description: 'Button label', + defaultValue: 'OK', + }, + headerBackground: { + control: 'color', + description: 'Background color for header', + defaultValue: '#003366', + }, + headerColor: { + control: 'color', + description: 'Color for header', + defaultValue: '#ffffff', + }, + actionsBackground: { + control: 'color', + description: 'Background color for actions', + defaultValue: '#f6f6f6', + }, + 'onUpdate:dialog': { + action: 'update:dialog', + description: 'Emitted when dialog state changes', + }, + onClose: { + action: 'close', + description: 'Emitted when close button is clicked', + }, + }, +} + +export default meta +type Story = StoryObj + +export const Primary: Story = { + args: { + dialog: true, + title: 'Missing Information', + message: + 'Input field is missing essential information which must be filled in order to confirm and continue.', + dialogWidth: 400, + dialogBorderRadius: 8, + btnLabel: 'Continue Editing', + headerBackground: '#003366', + headerColor: '#ffffff', + actionsBackground: '#f6f6f6', + }, +} diff --git a/frontend/src/components/common/AppMessageDialog.vue b/frontend/src/components/common/AppMessageDialog.vue index f162277db..c7d9adc0a 100644 --- a/frontend/src/components/common/AppMessageDialog.vue +++ b/frontend/src/components/common/AppMessageDialog.vue @@ -1,17 +1,16 @@ diff --git a/frontend/src/components/common/AppNotification.vue b/frontend/src/components/common/AppNotification.vue index bfe0bb580..030bffdec 100644 --- a/frontend/src/components/common/AppNotification.vue +++ b/frontend/src/components/common/AppNotification.vue @@ -1,49 +1,24 @@ diff --git a/frontend/src/components/common/AppProgressCircular.stories.ts b/frontend/src/components/common/AppProgressCircular.stories.ts index e986d7747..6d8195494 100644 --- a/frontend/src/components/common/AppProgressCircular.stories.ts +++ b/frontend/src/components/common/AppProgressCircular.stories.ts @@ -7,6 +7,11 @@ const meta: Meta = { argTypes: { isShow: { control: { type: 'boolean' }, defaultValue: true }, showMessage: { control: { type: 'boolean' }, defaultValue: true }, + hasBackground: { + control: { type: 'boolean' }, + defaultValue: true, + description: 'Whether the background color is applied', + }, message: { control: { type: 'text' }, defaultValue: 'Loading...' }, circleSize: { control: { type: 'range', min: 10, max: 200, step: 1 }, @@ -28,11 +33,6 @@ const meta: Meta = { defaultValue: 'rgba(255, 255, 255, 0.8)', description: 'Background color of the wrapper div', }, - hasBackground: { - control: { type: 'boolean' }, - defaultValue: true, - description: 'Whether the background color is applied', - }, padding: { control: { type: 'range', min: 0, max: 50, step: 1 }, defaultValue: 20, @@ -54,28 +54,13 @@ export const Primary: Story = { args: { isShow: true, showMessage: true, + hasBackground: true, message: 'Loading...', circleSize: 70, circleWidth: 5, circleColor: 'primary', backgroundColor: 'rgba(255, 255, 255, 0.8)', - hasBackground: true, padding: 20, borderRadius: 10, }, } - -export const NoBackground: Story = { - args: { - ...Primary.args, - hasBackground: false, - }, -} - -export const LargeCircle: Story = { - args: { - ...Primary.args, - circleSize: 150, - circleWidth: 10, - }, -} diff --git a/frontend/src/components/common/AppSnackbar.stories.ts b/frontend/src/components/common/AppSnackbar.stories.ts new file mode 100644 index 000000000..b3813ad5a --- /dev/null +++ b/frontend/src/components/common/AppSnackbar.stories.ts @@ -0,0 +1,116 @@ +import type { Meta, StoryObj } from '@storybook/vue3' +import AppSnackbar from './AppSnackbar.vue' + +const meta: Meta = { + title: 'components/common/AppSnackbar', + component: AppSnackbar, + argTypes: { + isVisible: { + control: 'boolean', + description: 'Controls visibility of the snackbar', + defaultValue: true, + }, + message: { + control: 'text', + description: 'Notification message to display', + defaultValue: 'This is a notification', + }, + type: { + control: 'select', + options: ['info', 'success', 'error', 'warning', ''], + description: 'Type of notification', + defaultValue: 'info', + }, + timeout: { + control: { type: 'range', min: 2000, max: 10000, step: 500 }, + description: 'Duration for the notification to stay visible', + defaultValue: 5000, + }, + autoTimeout: { + control: 'boolean', + description: 'Enable or disable auto timeout', + defaultValue: true, + }, + showTimer: { + control: 'boolean', + description: 'Show or hide timer on snackbar', + defaultValue: false, + }, + location: { + control: 'select', + options: ['top', 'center', 'bottom', 'right', 'left'], + description: 'Location of the snackbar', + defaultValue: 'top', + }, + color: { + control: 'color', + description: 'Snackbar background color', + defaultValue: '#2196F3', + }, + rounded: { + control: 'boolean', + description: 'Enable or disable rounded corners', + defaultValue: true, + }, + onClose: { action: 'close', description: 'Emitted when snackbar closes' }, + }, +} + +export default meta +type Story = StoryObj + +export const InfoNotification: Story = { + args: { + isVisible: true, + autoTimeout: false, + showTimer: false, + message: 'This is an informational message.', + type: 'info', + timeout: 5000, + location: 'top', + color: '#d9eaf7', + rounded: true, + }, +} + +export const ErrorNotification: Story = { + args: { + isVisible: true, + autoTimeout: true, + showTimer: false, + message: 'This is an error message.', + type: 'error', + timeout: 5000, + location: 'top', + color: '#d8292f', + rounded: true, + }, +} + +export const WarningNotification: Story = { + args: { + isVisible: true, + autoTimeout: true, + showTimer: false, + message: 'This is a warning message.', + type: 'warning', + timeout: 5000, + location: 'top', + color: '#f9f1c6', + rounded: true, + }, +} + +export const SuccessNotification: Story = { + args: { + isVisible: true, + autoTimeout: true, + showTimer: false, + message: 'This is a success message.', + type: 'success', + timeout: 5000, + location: 'top', + color: '#2e8540', + rounded: true, + }, +} diff --git a/frontend/src/components/common/AppSnackbar.vue b/frontend/src/components/common/AppSnackbar.vue new file mode 100644 index 000000000..13dea3072 --- /dev/null +++ b/frontend/src/components/common/AppSnackbar.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/frontend/src/components/model-param-selection-panes/ReportInfo.vue b/frontend/src/components/model-param-selection-panes/ReportInfo.vue index 7134fcece..10f3c2733 100644 --- a/frontend/src/components/model-param-selection-panes/ReportInfo.vue +++ b/frontend/src/components/model-param-selection-panes/ReportInfo.vue @@ -1,5 +1,14 @@