@designcrowd/fe-shared-lib 1.5.24 → 1.5.25-eng3931

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,68 @@
1
+ <template>
2
+ <a class="menu-cta" :class="variantClasses" @click="handleClick">
3
+ <Icon v-if="icon" :name="icon" :size="iconSize" />
4
+ <span class="menu-cta-label">{{ label }}</span>
5
+ </a>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import { computed } from 'vue';
10
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
11
+
12
+ type MenuCtaVariant = 'primary' | 'secondary' | 'empty';
13
+
14
+ interface MenuCtaProps {
15
+ label: string;
16
+ variant?: MenuCtaVariant;
17
+ icon: string | undefined;
18
+ iconSize?: 'sm' | 'md' | 'lg';
19
+ url: string | undefined;
20
+ }
21
+
22
+ const props = withDefaults(defineProps<MenuCtaProps>(), {
23
+ variant: 'primary',
24
+ iconSize: 'sm',
25
+ });
26
+
27
+ const emit = defineEmits<{
28
+ click: [event: MouseEvent];
29
+ }>();
30
+
31
+ const variantClasses = computed(() => {
32
+ const baseClasses =
33
+ 'tw-w-full tw-py-4 tw-flex tw-items-center tw-justify-center tw-gap-2 tw-rounded-lg tw-font-semibold tw-transition-colors tw-duration-200';
34
+
35
+ switch (props.variant) {
36
+ case 'primary':
37
+ return `${baseClasses} tw-bg-primary-500 tw-text-white hover:tw-bg-primary-700 tw-border-none`;
38
+ case 'secondary':
39
+ return `${baseClasses} tw-bg-secondary-500 tw-text-white hover:tw-bg-secondary-700 tw-border-none`;
40
+ case 'empty':
41
+ return `${baseClasses} tw-text-grayscale-700 hover:tw-bg-gray-600`;
42
+ default:
43
+ return baseClasses;
44
+ }
45
+ });
46
+
47
+ const handleClick = (event: MouseEvent) => {
48
+ emit('click', event);
49
+ if (props.url) {
50
+ window.location.href = props.url;
51
+ }
52
+ };
53
+ </script>
54
+
55
+ <style scoped>
56
+ .menu-cta {
57
+ @apply tw-flex tw-gap-2 tw-items-center tw-rounded-lg;
58
+ height: 36px;
59
+ }
60
+
61
+ .menu-cta:last-child {
62
+ margin-bottom: 0;
63
+ }
64
+
65
+ .menu-cta-label {
66
+ @apply tw-text-sm;
67
+ }
68
+ </style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <a class="menu-item" :class="{ 'tw-bg-gray-400': isActive }" :href="url">
3
+ <Icon :name="icon" size="md" />
4
+ <span class="tw-text-md tw-font-medium tw-text-grayscale-700">{{ label }}</span>
5
+ </a>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import Icon from '../../../atoms/components/Icon/Icon.vue';
10
+
11
+ type IMenuItem = {
12
+ label: string;
13
+ url: string | undefined;
14
+ // action: Function?; // might need to implement actions on menu items
15
+ icon: string;
16
+ isActive: boolean;
17
+ };
18
+
19
+ const props = defineProps<IMenuItem>();
20
+ </script>
21
+
22
+ <style scoped>
23
+ .menu-item {
24
+ @apply tw-p-2 tw-mb-1 tw-flex tw-gap-2 tw-items-center tw-rounded-lg hover:tw-bg-gray-300;
25
+ height: 36px;
26
+ }
27
+ </style>
@@ -0,0 +1,64 @@
1
+ import SideNavigationPanel from './SideNavigationPanel.vue';
2
+
3
+ export default {
4
+ title: 'Experiences/SideNavigationPanel',
5
+ component: SideNavigationPanel,
6
+ argTypes: {
7
+ menuItems: {
8
+ control: 'object',
9
+ description: 'Array of menu items',
10
+ },
11
+ },
12
+ };
13
+
14
+ const defaultMenuItems = [
15
+ { id: 1, label: 'Logos', icon: 'star-hollow', url: '#logos', isActive: true },
16
+ { id: 2, label: 'Designs', icon: 'designs', url: '#designs', isActive: false },
17
+ { id: 3, label: 'Printing', icon: 'printing', url: '#printing', isActive: false },
18
+ { id: 4, label: 'Websites', icon: 'website', url: '#websites', isActive: false },
19
+ { id: 5, label: 'Domains', icon: 'globe', url: '#domains', isActive: false },
20
+ { id: 6, label: 'Settings', icon: 'settings', url: '#settings', isActive: false },
21
+ ];
22
+
23
+ const defaultCreateNewDesigns = {
24
+ label: 'Create Designs',
25
+ url: '#createDesigns',
26
+ };
27
+
28
+ const Template = (args) => ({
29
+ components: { SideNavigationPanel },
30
+ setup() {
31
+ return { args };
32
+ },
33
+ template: `
34
+ <div style="width: 90vw; height: 90vh">
35
+ <SideNavigationPanel v-bind="args" />
36
+ </div>
37
+ `,
38
+ });
39
+
40
+ export const Default = Template.bind({});
41
+ Default.args = {
42
+ menuItems: defaultMenuItems,
43
+ };
44
+
45
+ export const WithDifferentActiveItem = Template.bind({});
46
+ WithDifferentActiveItem.args = {
47
+ menuItems: [
48
+ { id: 1, label: 'Logos', icon: 'star-hollow', url: '#logos', isActive: false },
49
+ { id: 2, label: 'Designs', icon: 'designs', url: '#designs', isActive: false },
50
+ { id: 3, label: 'Printing', icon: 'printing', url: '#printing', isActive: true },
51
+ { id: 4, label: 'Websites', icon: 'website', url: '#websites', isActive: false },
52
+ { id: 5, label: 'Domains', icon: 'globe', url: '#domains', isActive: false },
53
+ { id: 6, label: 'Settings', icon: 'settings', url: '#settings', isActive: false },
54
+ ],
55
+ };
56
+
57
+ export const CustomMenuItems = Template.bind({});
58
+ CustomMenuItems.args = {
59
+ menuItems: [
60
+ { id: 1, label: 'Dashboard', icon: 'star-hollow', url: '#dashboard', isActive: true },
61
+ { id: 2, label: 'Projects', icon: 'designs', url: '#projects', isActive: false },
62
+ { id: 3, label: 'Help', icon: 'settings', url: '#help', isActive: false },
63
+ ],
64
+ };
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <!-- Side Navigation Component following these figma designs: https://www.figma.com/design/UUZ56EQZbb1Ua9NBMm6Rt5/DCOM---My-Account-Left-Nav -->
3
+ <div class="sidebar">
4
+ <div class="menu">
5
+ <MenuCta class="tw-mt-2 tw-mb-4" label="Create New Design" variant="primary" icon="plus" icon-size="sm" />
6
+ <div class="menuitemcontainer">
7
+ <MenuItem
8
+ v-for="item in menuItems"
9
+ :key="item.label"
10
+ :label="item.label"
11
+ :url="item.action ? '' : item.url"
12
+ :icon="item.icon"
13
+ :is-active="item.isActive"
14
+ />
15
+ </div>
16
+ </div>
17
+ <div class="ctas tw-flex tw-flex-col tw-gap-2">
18
+ <MenuCta label="Upgrade" variant="secondary" icon="social-instagram-color" icon-size="md" />
19
+ <MenuCta label="Rate Design.com" variant="empty" />
20
+ </div>
21
+ </div>
22
+ </template>
23
+ <script setup lang="ts">
24
+ import defineProps from 'vue';
25
+ import MenuCta from './MenuCta.vue';
26
+ import MenuItem from './MenuItem.vue';
27
+
28
+ type IMenuItem = {
29
+ label: string;
30
+ url: string | undefined;
31
+ action: Function | undefined; // might need to implement actions on menu items
32
+ icon: string;
33
+ isActive: Boolean;
34
+ };
35
+
36
+ const props = defineProps({
37
+ menuItems: {
38
+ type: Array<IMenuItem>,
39
+ required: true,
40
+ },
41
+ createNewDesignCta: {
42
+ type: Object,
43
+ required: true,
44
+ },
45
+ // ctaItems: {},
46
+ });
47
+ </script>
48
+ <style scoped>
49
+ .sidebar {
50
+ @apply tw-p-2 tw-flex tw-flex-col tw-h-full tw-justify-between tw-w-[14rem];
51
+ background-color: rgba(245, 245, 245, 1);
52
+ border-right: 1px rgba(227, 227, 227, 1) solid;
53
+ }
54
+ </style>
@@ -69,9 +69,9 @@
69
69
  </template>
70
70
  <script setup lang="ts">
71
71
  import { Ref, ref } from 'vue';
72
- import Modal from '../../../atoms/components/Modal/Modal.vue';
73
72
  import Button from '../../../atoms/components/Button/Button.vue';
74
73
  import Icon from '../../../atoms/components/Icon/Icon.vue';
74
+ import Modal from '../../../atoms/components/Modal/Modal.vue';
75
75
  import { websiteContextualUpgradeModalTr } from '../../../useSharedLibTranslate';
76
76
  import { WEBSITE_UPGRADE_CONTEXT_TYPES, type WebsiteContextUpgradeType } from '../../models/websiteContextualModel';
77
77
 
@@ -190,7 +190,7 @@ const onUpgradeClick = () => {
190
190
  </script>
191
191
  <style scoped>
192
192
  .bottom-bar {
193
- @apply tw-absolute tw-p-4 tw-bottom-0 tw-left-0 tw-w-full tw-border-t tw-border-grayscale-300 md:tw-p-0 md:tw-relative md:tw-border-none;
193
+ @apply tw-absolute tw-p-4 tw-bottom-0 tw-left-0 tw-w-full tw-border-t md:tw-p-0 md:tw-relative md:tw-border-none;
194
194
  }
195
195
  .button-size {
196
196
  @apply tw-w-full md:tw-max-w-40;