design-system-dashboard-devmunity 0.0.0

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,112 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import ACard from './a-card.vue'
3
+
4
+ const meta = {
5
+ title: 'Components/ACard',
6
+ component: ACard,
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ variant: {
10
+ control: 'select',
11
+ options: ['outline', 'solid', 'soft'],
12
+ },
13
+ as: {
14
+ control: 'text',
15
+ },
16
+ hasBodyExpanded: {
17
+ control: 'boolean',
18
+ },
19
+ hasFooterDivider: {
20
+ control: 'boolean',
21
+ },
22
+ },
23
+ args: {
24
+ variant: 'outline',
25
+ as: 'div',
26
+ hasBodyExpanded: false,
27
+ hasFooterDivider: true,
28
+ },
29
+ } satisfies Meta<typeof ACard>
30
+
31
+ export default meta
32
+ type Story = StoryObj<typeof meta>
33
+
34
+ export const Default: Story = {
35
+ render: (args) => ({
36
+ components: { ACard },
37
+ setup() {
38
+ return { args }
39
+ },
40
+ template: `
41
+ <UButton>Button</UButton>
42
+ <ACard v-bind="args">
43
+ <template #header>
44
+ <div class="p-4">
45
+ <h3 class="text-lg font-semibold">Card Header</h3>
46
+ </div>
47
+ </template>
48
+ <div class="p-4">
49
+ <p>This is the card body content.</p>
50
+ </div>
51
+ <template #footer>
52
+ <div class="p-4">
53
+ <button class="px-4 py-2 bg-blue-500 text-white rounded">Action</button>
54
+ </div>
55
+ </template>
56
+ </ACard>
57
+ `,
58
+ }),
59
+ }
60
+
61
+ export const WithoutHeader: Story = {
62
+ render: (args) => ({
63
+ components: { ACard },
64
+ setup() {
65
+ return { args }
66
+ },
67
+ template: `
68
+ <ACard v-bind="args">
69
+ <div class="p-4">
70
+ <p>Card without header</p>
71
+ </div>
72
+ <template #footer>
73
+ <div class="p-4">
74
+ <button class="px-4 py-2 bg-blue-500 text-white rounded">Action</button>
75
+ </div>
76
+ </template>
77
+ </ACard>
78
+ `,
79
+ }),
80
+ }
81
+
82
+ export const ExpandedBody: Story = {
83
+ args: {
84
+ hasBodyExpanded: true,
85
+ },
86
+ render: (args) => ({
87
+ components: { ACard },
88
+ setup() {
89
+ return { args }
90
+ },
91
+ template: `
92
+ <div style="height: 400px;">
93
+ <ACard v-bind="args">
94
+ <template #header>
95
+ <div class="p-4">
96
+ <h3 class="text-lg font-semibold">Expanded Card</h3>
97
+ </div>
98
+ </template>
99
+ <div class="p-4">
100
+ <p>This card has an expanded body that fills available space.</p>
101
+ <p class="mt-4">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
102
+ </div>
103
+ <template #footer>
104
+ <div class="p-4">
105
+ <button class="px-4 py-2 bg-blue-500 text-white rounded">Action</button>
106
+ </div>
107
+ </template>
108
+ </ACard>
109
+ </div>
110
+ `,
111
+ }),
112
+ }
@@ -0,0 +1,73 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import { twMerge } from 'tailwind-merge'
4
+
5
+ const props = defineProps({
6
+ as: {
7
+ type: String,
8
+ default: 'div',
9
+ required: false,
10
+ },
11
+ variant: {
12
+ default: 'outline',
13
+ type: String,
14
+ required: false,
15
+ },
16
+ hasBodyExpanded: {
17
+ type: Boolean,
18
+ default: false,
19
+ required: false,
20
+ },
21
+ hasFooterDivider: {
22
+ type: Boolean,
23
+ default: true,
24
+ required: false,
25
+ },
26
+ ui: {
27
+ type: Object,
28
+ default: null,
29
+ required: false,
30
+ },
31
+ })
32
+
33
+ // Computed
34
+
35
+ const uiStyles = computed(() => {
36
+ const baseStyles = {
37
+ header: 'p-0 sm:p-0',
38
+ body: 'p-0 sm:p-0',
39
+ footer: 'p-0 sm:p-0 sm:px-0',
40
+ }
41
+
42
+ // Apply hasBodyExpanded styles
43
+ if (props.hasBodyExpanded) {
44
+ baseStyles.root = 'grid h-full grid-rows-[auto_1fr_auto]'
45
+ // ! FIXME:
46
+ baseStyles.body = twMerge(baseStyles.body, 'overflow-y-auto')
47
+ }
48
+
49
+ // Apply hasFooterDivider styles
50
+ if (!props.hasFooterDivider) {
51
+ baseStyles.body = twMerge(baseStyles.body, 'border-none')
52
+ }
53
+
54
+ // Apply custom ui prop (overrides previous styles)
55
+ if (props.ui) {
56
+ Object.assign(baseStyles, props.ui)
57
+ }
58
+
59
+ return baseStyles
60
+ })
61
+ </script>
62
+
63
+ <template>
64
+ <UCard :ui="uiStyles" :variant="variant" :as="as">
65
+ <template v-if="$slots.header" #header>
66
+ <slot name="header" />
67
+ </template>
68
+ <slot />
69
+ <template v-if="$slots.footer" #footer>
70
+ <slot name="footer" />
71
+ </template>
72
+ </UCard>
73
+ </template>
@@ -0,0 +1,145 @@
1
+ <script setup lang="ts">
2
+ const colorMode = useColorMode()
3
+
4
+ const isDark = computed({
5
+ get() {
6
+ return colorMode.value === 'dark'
7
+ },
8
+ set(_isDark) {
9
+ colorMode.preference = _isDark ? 'dark' : 'light'
10
+ },
11
+ })
12
+ </script>
13
+
14
+ <template>
15
+ <div>
16
+ <UPageHero
17
+ title="Nuxt Starter Template"
18
+ description="A production-ready starter template powered by Nuxt UI. Build beautiful, accessible, and performant applications in minutes, not hours."
19
+ :links="[
20
+ {
21
+ label: 'Get started',
22
+ to: 'https://ui.nuxt.com/docs/getting-started/installation/nuxt',
23
+ target: '_blank',
24
+ trailingIcon: 'i-lucide-arrow-right',
25
+ size: 'xl',
26
+ },
27
+ {
28
+ label: 'Use this template',
29
+ to: 'https://github.com/nuxt-ui-templates/starter',
30
+ target: '_blank',
31
+ icon: 'i-simple-icons-github',
32
+ size: 'xl',
33
+ color: 'neutral',
34
+ variant: 'subtle',
35
+ },
36
+ ]"
37
+ />
38
+
39
+ <UPageSection
40
+ id="features"
41
+ title="Everything you need to build modern Nuxt apps"
42
+ description="Start with a solid foundation. This template includes all the essentials for building production-ready applications with Nuxt UI's powerful component system."
43
+ :features="[
44
+ {
45
+ icon: 'i-lucide-rocket',
46
+ title: 'Production-ready from day one',
47
+ description:
48
+ 'Pre-configured with TypeScript, ESLint, Tailwind CSS, and all the best practices. Focus on building features, not setting up tooling.',
49
+ },
50
+ {
51
+ icon: 'i-lucide-palette',
52
+ title: 'Beautiful by default',
53
+ description:
54
+ 'Leveraging Nuxt UI\'s design system with automatic dark mode, consistent spacing, and polished components that look great out of the box.',
55
+ },
56
+ {
57
+ icon: 'i-lucide-zap',
58
+ title: 'Lightning fast',
59
+ description:
60
+ 'Optimized for performance with SSR/SSG support, automatic code splitting, and edge-ready deployment. Your users will love the speed.',
61
+ },
62
+ {
63
+ icon: 'i-lucide-blocks',
64
+ title: '100+ components included',
65
+ description:
66
+ 'Access Nuxt UI\'s comprehensive component library. From forms to navigation, everything is accessible, responsive, and customizable.',
67
+ },
68
+ {
69
+ icon: 'i-lucide-code-2',
70
+ title: 'Developer experience first',
71
+ description:
72
+ 'Auto-imports, hot module replacement, and TypeScript support. Write less boilerplate and ship more features.',
73
+ },
74
+ {
75
+ icon: 'i-lucide-shield-check',
76
+ title: 'Built for scale',
77
+ description:
78
+ 'Enterprise-ready architecture with proper error handling, SEO optimization, and security best practices built-in.',
79
+ },
80
+ ]"
81
+ />
82
+
83
+ <UPageSection>
84
+ <UPageCTA
85
+ title="Ready to build your next Nuxt app?"
86
+ description="Join thousands of developers building with Nuxt and Nuxt UI. Get this template and start shipping today."
87
+ variant="subtle"
88
+ :links="[
89
+ {
90
+ label: 'Start building',
91
+ to: 'https://ui.nuxt.com/docs/getting-started/installation/nuxt',
92
+ target: '_blank',
93
+ trailingIcon: 'i-lucide-arrow-right',
94
+ color: 'neutral',
95
+ },
96
+ {
97
+ label: 'View on GitHub',
98
+ to: 'https://github.com/nuxt-ui-templates/starter',
99
+ target: '_blank',
100
+ icon: 'i-simple-icons-github',
101
+ color: 'neutral',
102
+ variant: 'outline',
103
+ },
104
+ ]"
105
+ />
106
+
107
+ <div class="flex items-center gap-2">
108
+ <div class="bg-primary-50 size-12 space-x-2" />
109
+ <div class="bg-primary-100 size-12 space-x-2" />
110
+ <div class="bg-primary-200 size-12 space-x-2" />
111
+ <div class="bg-primary-300 size-12 space-x-2" />
112
+ <div class="bg-primary-400 size-12 space-x-2" />
113
+ <div class="bg-primary-500 size-12 space-x-2" />
114
+ <div class="bg-primary-600 size-12 space-x-2" />
115
+ <div class="bg-primary-700 size-12 space-x-2" />
116
+ <div class="bg-primary-800 size-12 space-x-2" />
117
+ <div class="bg-primary-900 size-12 space-x-2" />
118
+ <div class="bg-primary-950 size-12 space-x-2" />
119
+ <div class="bg-default text-default border-default size-12 space-x-2">div</div>
120
+
121
+ <UButton label="Button" color="test" />
122
+ <UButton label="Button" color="primary" />
123
+ </div>
124
+ <p class="text-brand-blue-500 bg-primary-50">
125
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam nihil corrupti doloremque,
126
+ natus ipsa voluptatem, eos nobis assumenda nostrum quasi, nesciunt deserunt illum ex magnam
127
+ animi perferendis optio tempora debitis.
128
+ </p>
129
+
130
+ <ClientOnly v-if="!colorMode?.forced">
131
+ <UButton
132
+ :icon="isDark ? 'i-lucide-moon' : 'i-lucide-sun'"
133
+ color="neutral"
134
+ variant="ghost"
135
+ :aria-label="`Switch to ${isDark ? 'light' : 'dark'} mode`"
136
+ @click="isDark = !isDark"
137
+ />
138
+
139
+ <template #fallback>
140
+ <div class="size-8" />
141
+ </template>
142
+ </ClientOnly>
143
+ </UPageSection>
144
+ </div>
145
+ </template>
@@ -0,0 +1,18 @@
1
+ <script lang="ts" setup></script>
2
+
3
+ <template>
4
+ <div class="h-screen">
5
+ <ACardInner class="h-full">
6
+ <ACard :has-footer-divider="false">
7
+ <template #header>
8
+ <h1>Header</h1>
9
+ </template>
10
+ <p>Body</p>
11
+ <template #footer>
12
+ <p>Footer</p>
13
+ </template>
14
+ </ACard>
15
+ <UCard variant="ghost"> oli </UCard>
16
+ </ACardInner>
17
+ </div>
18
+ </template>