-
Notifications
You must be signed in to change notification settings - Fork 360
Feat/compiler components #4525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Feat/compiler components #4525
Changes from all commits
096c3ca
df0db53
73f8718
6e9c4ac
1c23f59
ffe45f5
5faef5c
a2d03f7
f3dc5bf
c80fde4
3f62c92
64f20b6
e3cd86c
4efa2b7
fdb3796
ba34ebf
8e2d362
ae562e9
186fa05
dcfa247
8a1198d
d971cac
3af8108
c17d0fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ coverage | |
| *.sw? | ||
|
|
||
| *.tsbuildinfo | ||
|
|
||
| .yarn | ||
|
|
||
| .components.d.ts | ||
| .components.d.ts | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,38 @@ | ||
| <script setup lang="ts"> | ||
| import TestPage from './pages/TestPage.vue'; | ||
| <script setup> | ||
| import Test from './Test.vue' | ||
| import { ref } from 'vue' | ||
|
|
||
| const ordersCount = 1000; | ||
|
||
| const orders = Array.from({ length: ordersCount }, (_, i) => ({ | ||
| id: i, | ||
| customer: `Customer ${i + 1}`, | ||
| amount: (Math.random() * 1000).toFixed(2), | ||
| status: ['Pending', 'Shipped', 'Delivered'][i % 3] | ||
| })); | ||
|
|
||
| const icon = ref('refresh'); | ||
| const color = ref('primary'); | ||
| </script> | ||
|
|
||
| <template> | ||
| <VaNavbar color="myCustomColor"> | ||
| <template #left> | ||
| Vuestic UI Devtools demo | ||
| </template> | ||
| <template #right> | ||
| <VaNavbarItem> | ||
| <router-link to="/about"> | ||
| Test | ||
| </router-link> | ||
| <div class="app"> | ||
| <h1>Order Management</h1> | ||
| <div class="orders-grid" v-once> | ||
| <VcButton icon="person">New Order</VcButton> | ||
| <VcButton :icon="icon">Refresh</VcButton> | ||
| </div> | ||
|
|
||
| </VaNavbarItem> | ||
| <VaNavbarItem> | ||
| <router-link to="/contact">Contact</router-link> | ||
| </VaNavbarItem> | ||
| </template> | ||
| </VaNavbar> | ||
|
|
||
| <div style="padding: 16px"> | ||
| <TestPage> | ||
| Default slot | ||
| <template #footer> | ||
| Footer slot | ||
| </template> | ||
| </TestPage> | ||
| <Test /> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style> | ||
| .app { | ||
| text-align: center; | ||
| } | ||
| .orders-grid { | ||
| display: grid; | ||
| grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | ||
| gap: 15px; | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||
| <script setup lang="ts"> | ||||
| import { ref } from 'vue'; | ||||
| const color = ref('primary'); | ||||
|
||||
| const color = ref('primary'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @import "tailwindcss"; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| <script setup lang="ts"> | ||||||
| import VcIcon from './VcIcon.vue'; | ||||||
| import VcProgress from './VcProgress.vue'; | ||||||
| // import { useColor } from '../composables/useColor' | ||||||
|
Comment on lines
+4
to
+5
|
||||||
| // import { useColor } from '../composables/useColor' |
Copilot
AI
Jun 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default background class 'gray' is not a valid Tailwind background utility. Consider returning a valid class like 'bg-gray-200'.
| return 'gray' | |
| return 'bg-gray-500' |
Copilot
AI
Jun 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this debug console.log statement to avoid unnecessary logging in production code.
| console.log('icon', icon) | |
| // No-op: Removed unnecessary console.log statement |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <template> | ||
| <div class="p-4 bg-white rounded-lg shadow-md"> | ||
| <slot /> | ||
| </div> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <template> | ||
| <div class="p-4"> | ||
| <slot /> | ||
| </div> | ||
| </template> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <template> | ||
| <div class="p-4 text-gray-700 text-sm font-medium"> | ||
| <slot /> | ||
| </div> | ||
| </template> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <script setup lang="ts"> | ||
| defineProps({ | ||
| icon: String | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <i class="material-icons">{{ icon }}</i> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <script setup lang="ts"> | ||
| defineProps({ | ||
| placeholder: String, | ||
| label: String | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="flex flex-col gap-1"> | ||
| <label v-if="$props.label" class="text-gray-700 text-xs font-medium uppercase">{{ $props.label }}</label> | ||
| <input | ||
| :placeholder="placeholder" | ||
| class="px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:outline-none transition-all" | ||
| /> | ||
| </div> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <script setup> | ||
| const props = defineProps({ | ||
| items: Array | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <ul> | ||
| <li v-for="item in items" :key="item">{{ item }}</li> | ||
| </ul> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <script setup lang="ts"> | ||
| import VcButton from './VcButton.vue'; | ||
|
|
||
| const props = defineProps({ | ||
| order: { type: Object, required: true } | ||
| }); | ||
|
|
||
| const statusClass = (status: 'pending' | 'shipped' | 'delivered') => { | ||
| switch (status) { | ||
| case 'pending': | ||
| return 'text-yellow-500'; | ||
| case 'shipped': | ||
| return 'text-blue-500'; | ||
| case 'delivered': | ||
| return 'text-green-500'; | ||
| default: | ||
| return 'text-gray-500'; | ||
| } | ||
| }; | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="p-4 rounded-lg shadow bg-white"> | ||
| <h3>Order #{{ order.id }}</h3> | ||
| <p><strong>Customer:</strong> {{ order.customer }}</p> | ||
| <p><strong>Amount:</strong> ${{ order.amount }}</p> | ||
| <p><strong>Status:</strong> <span :class="statusClass(order.status.toLowerCase())">{{ order.status }}</span></p> | ||
|
|
||
| <div class="flex flex-col items-center gap-2 mt-2"> | ||
| <VcButton color="primary" type="solid"> | ||
| View Customer | ||
| </VcButton> | ||
| <VcButton color="secondary" type="outlined">Track Order</VcButton> | ||
| </div> | ||
| </div> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <script setup lang="ts"> | ||
| const { fillColor = 'blue-600', unfillColor = 'gray-200' } = defineProps({ | ||
| fillColor: String, | ||
| unfillColor: String | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <div role="status"> | ||
| <svg aria-hidden="true" :class="`w-8 h-8 animate-spin text-${fillColor} fill-${unfillColor}`" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/> | ||
| <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/></svg> | ||
| </div> | ||
| </template> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| import { ref } from "vue" | ||||||
|
|
||||||
| export const useColor = (props: Record<string, any>) => { | ||||||
|
||||||
| export const useColor = (props: Record<string, any>) => { | |
| export const useColor = () => { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| import { createApp } from 'vue' | ||
| import App from './App.vue' | ||
|
|
||
| import './assets/tailwind.css' | ||
|
|
||
| createApp(App) | ||
| .mount('#app') |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Material Icons stylesheet is commented out, which will prevent icons from displaying correctly. Uncomment or include the proper link.