From 86ce5eeab7a50e98949c37aa1155319df6fd52bc Mon Sep 17 00:00:00 2001 From: Andrea Leardini Date: Wed, 10 Apr 2024 16:33:59 +0200 Subject: [PATCH 1/8] feat: add NeTabs component --- src/components/NeTabs.vue | 107 ++++++++++++++++++++++++++++++++++++++ src/main.ts | 2 + stories/NeTabs.stories.ts | 36 +++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 src/components/NeTabs.vue create mode 100644 stories/NeTabs.stories.ts diff --git a/src/components/NeTabs.vue b/src/components/NeTabs.vue new file mode 100644 index 0000000..e8f0f1e --- /dev/null +++ b/src/components/NeTabs.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/main.ts b/src/main.ts index 3f9b3bb..a85db05 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,10 +29,12 @@ export { default as NeFormItemLabel } from '@/components/NeFormItemLabel.vue' export { default as NeRadioSelection } from '@/components/NeRadioSelection.vue' export { default as NePaginator } from '@/components/NePaginator.vue' export { default as NeEmptyState } from '@/components/NeEmptyState.vue' +export { default as NeTabs } from '@/components/NeTabs.vue' // types export export type { NeComboboxOption } from '@/components/NeCombobox.vue' export type { NePaginatorProps } from '@/components/NePaginator.vue' +export type { Tab } from '@/components/NeTabs.vue' // library functions export export { diff --git a/stories/NeTabs.stories.ts b/stories/NeTabs.stories.ts new file mode 100644 index 0000000..9b7da94 --- /dev/null +++ b/stories/NeTabs.stories.ts @@ -0,0 +1,36 @@ +// Copyright (C) 2024 Nethesis S.r.l. +// SPDX-License-Identifier: GPL-3.0-or-later + +import type { Meta, StoryObj } from '@storybook/vue3' + +import { NeTabs } from '../src/main' + +const meta = { + title: 'Visual/NeTabs', + component: NeTabs, + argTypes: {}, + args: { + tabs: [ + { name: 'firstTab', label: 'First tab' }, + { name: 'secondTab', label: 'Second tab' }, + { name: 'thirdTab', label: 'Third tab' } + ], + selected: 'secondTab' + } // default values +} satisfies Meta + +export default meta +type Story = StoryObj + +const template = '' + +export const Default: Story = { + render: (args) => ({ + components: { NeTabs }, + setup() { + return { args } + }, + template: template + }), + args: {} +} From 531f7c7769b3bfa92d58be07d01f9319457b9fb2 Mon Sep 17 00:00:00 2001 From: Andrea Leardini Date: Wed, 10 Apr 2024 17:29:22 +0200 Subject: [PATCH 2/8] fix: style of NeInlineNotification buttons --- src/components/NeInlineNotification.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/NeInlineNotification.vue b/src/components/NeInlineNotification.vue index 4063729..6472600 100644 --- a/src/components/NeInlineNotification.vue +++ b/src/components/NeInlineNotification.vue @@ -179,9 +179,12 @@ const closeIconKindStyle: { [index: string]: string } = {