init
This commit is contained in:
198
typescript-version/plugins/vuetify/defaults.ts
Normal file
198
typescript-version/plugins/vuetify/defaults.ts
Normal file
@@ -0,0 +1,198 @@
|
||||
export default {
|
||||
IconBtn: {
|
||||
icon: true,
|
||||
color: 'default',
|
||||
variant: 'text',
|
||||
},
|
||||
VAlert: {
|
||||
density: 'comfortable',
|
||||
VBtn: {
|
||||
color: undefined,
|
||||
},
|
||||
},
|
||||
VAvatar: {
|
||||
// ℹ️ Remove after next release
|
||||
variant: 'flat',
|
||||
},
|
||||
|
||||
// VImg: {
|
||||
// eager: true,
|
||||
// },
|
||||
VBadge: {
|
||||
// set v-badge default color to primary
|
||||
color: 'primary',
|
||||
},
|
||||
VBtn: {
|
||||
// set v-btn default color to primary
|
||||
color: 'primary',
|
||||
ripple: false,
|
||||
},
|
||||
VChip: {
|
||||
label: true,
|
||||
},
|
||||
VDataTable: {
|
||||
VPagination: {
|
||||
showFirstLastPage: true,
|
||||
firstIcon: 'bx-chevrons-left',
|
||||
lastIcon: 'bx-chevrons-right',
|
||||
},
|
||||
},
|
||||
VTable: {
|
||||
VCheckboxBtn: {
|
||||
density: 'comfortable',
|
||||
},
|
||||
},
|
||||
VDataTableServer: {
|
||||
VPagination: {
|
||||
showFirstLastPage: true,
|
||||
firstIcon: 'bx-chevrons-left',
|
||||
lastIcon: 'bx-chevrons-right',
|
||||
},
|
||||
},
|
||||
VList: {
|
||||
color: 'primary',
|
||||
density: 'compact',
|
||||
VCheckboxBtn: {
|
||||
density: 'compact',
|
||||
},
|
||||
VListItem: {
|
||||
ripple: false,
|
||||
VAvatar: {
|
||||
size: 38,
|
||||
},
|
||||
},
|
||||
},
|
||||
VMenu: {
|
||||
offset: '2px',
|
||||
},
|
||||
VPagination: {
|
||||
density: 'comfortable',
|
||||
variant: 'tonal',
|
||||
},
|
||||
VTabs: {
|
||||
// set v-tabs default color to primary
|
||||
color: 'primary',
|
||||
density: 'comfortable',
|
||||
VSlideGroup: {
|
||||
showArrows: true,
|
||||
},
|
||||
},
|
||||
VTooltip: {
|
||||
// set v-tooltip default location to top
|
||||
location: 'top',
|
||||
},
|
||||
VCheckboxBtn: {
|
||||
color: 'primary',
|
||||
},
|
||||
VCheckbox: {
|
||||
// set v-checkbox default color to primary
|
||||
color: 'primary',
|
||||
density: 'comfortable',
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VRadioGroup: {
|
||||
color: 'primary',
|
||||
density: 'comfortable',
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VRadio: {
|
||||
density: 'comfortable',
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VSelect: {
|
||||
variant: 'outlined',
|
||||
color: 'primary',
|
||||
density: 'comfortable',
|
||||
hideDetails: 'auto',
|
||||
VChip: {
|
||||
label: true,
|
||||
},
|
||||
},
|
||||
VRangeSlider: {
|
||||
// set v-range-slider default color to primary
|
||||
color: 'primary',
|
||||
trackSize: 6,
|
||||
thumbSize: 22,
|
||||
density: 'comfortable',
|
||||
thumbLabel: true,
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VRating: {
|
||||
// set v-rating default color to primary
|
||||
activeColor: 'warning',
|
||||
color: 'disabled',
|
||||
emptyIcon: 'bx-bxs-star',
|
||||
},
|
||||
VProgressLinear: {
|
||||
height: 6,
|
||||
roundedBar: true,
|
||||
rounded: true,
|
||||
bgColor: 'rgba(var(--v-track-bg))',
|
||||
color: 'primary',
|
||||
},
|
||||
VSlider: {
|
||||
// set v-range-slider default color to primary
|
||||
color: 'primary',
|
||||
thumbLabel: true,
|
||||
hideDetails: 'auto',
|
||||
thumbSize: 22,
|
||||
trackSize: 6,
|
||||
elevation: 4,
|
||||
},
|
||||
VTextField: {
|
||||
variant: 'outlined',
|
||||
density: 'comfortable',
|
||||
color: 'primary',
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VAutocomplete: {
|
||||
variant: 'outlined',
|
||||
color: 'primary',
|
||||
density: 'comfortable',
|
||||
hideDetails: 'auto',
|
||||
menuProps: {
|
||||
contentClass: 'app-autocomplete__content v-autocomplete__content',
|
||||
},
|
||||
VChip: {
|
||||
label: true,
|
||||
},
|
||||
},
|
||||
VCombobox: {
|
||||
variant: 'outlined',
|
||||
density: 'comfortable',
|
||||
color: 'primary',
|
||||
hideDetails: 'auto',
|
||||
VChip: {
|
||||
label: true,
|
||||
},
|
||||
},
|
||||
VFileInput: {
|
||||
variant: 'outlined',
|
||||
density: 'comfortable',
|
||||
color: 'primary',
|
||||
hideDetails: 'auto',
|
||||
prependIcon: '',
|
||||
prependInnerIcon: 'bx-link',
|
||||
},
|
||||
VTextarea: {
|
||||
variant: 'outlined',
|
||||
density: 'comfortable',
|
||||
color: 'primary',
|
||||
hideDetails: 'auto',
|
||||
},
|
||||
VSnackbar: {
|
||||
VBtn: {
|
||||
size: 'small',
|
||||
},
|
||||
},
|
||||
VSwitch: {
|
||||
// set v-switch default color to primary
|
||||
inset: true,
|
||||
color: 'primary',
|
||||
hideDetails: 'auto',
|
||||
ripple: false,
|
||||
},
|
||||
VNavigationDrawer: {
|
||||
touchless: true,
|
||||
},
|
||||
}
|
||||
84
typescript-version/plugins/vuetify/icons.ts
Normal file
84
typescript-version/plugins/vuetify/icons.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { IconAliases, IconProps } from 'vuetify'
|
||||
|
||||
import checkboxChecked from '@images/svg/checkbox-checked.svg'
|
||||
import checkboxIndeterminate from '@images/svg/checkbox-indeterminate.svg'
|
||||
import checkboxUnchecked from '@images/svg/checkbox-unchecked.svg'
|
||||
import radioChecked from '@images/svg/radio-checked.svg'
|
||||
import radioUnchecked from '@images/svg/radio-unchecked.svg'
|
||||
|
||||
const customIcons: Record<string, unknown> = {
|
||||
'mdi-checkbox-blank-outline': checkboxUnchecked,
|
||||
'mdi-checkbox-marked': checkboxChecked,
|
||||
'mdi-minus-box': checkboxIndeterminate,
|
||||
'mdi-radiobox-marked': radioChecked,
|
||||
'mdi-radiobox-blank': radioUnchecked,
|
||||
}
|
||||
|
||||
const aliases: Partial<IconAliases> = {
|
||||
calendar: 'bx-calendar',
|
||||
collapse: 'bx-chevron-up',
|
||||
complete: 'bx-check',
|
||||
cancel: 'bx-x',
|
||||
close: 'bx-x',
|
||||
delete: 'bx-bxs-x-circle',
|
||||
clear: 'bx-x-circle',
|
||||
success: 'bx-check-circle',
|
||||
info: 'bx-info-circle',
|
||||
warning: 'bx-error',
|
||||
error: 'bx-error-circle',
|
||||
prev: 'bx-chevron-left',
|
||||
ratingEmpty: 'bx-star',
|
||||
ratingFull: 'bx-bxs-star',
|
||||
ratingHalf: 'bx-bxs-star-half',
|
||||
next: 'bx-chevron-right',
|
||||
delimiter: 'bx-circle',
|
||||
sort: 'bx-up-arrow-alt',
|
||||
expand: 'bx-chevron-down',
|
||||
menu: 'bx-menu',
|
||||
subgroup: 'bx-caret-down',
|
||||
dropdown: 'bx-chevron-down',
|
||||
edit: 'bx-pencil',
|
||||
loading: 'bx-refresh',
|
||||
first: 'bx-skip-previous',
|
||||
last: 'bx-skip-next',
|
||||
unfold: 'bx-move-vertical',
|
||||
file: 'bx-paperclip',
|
||||
plus: 'bx-plus',
|
||||
minus: 'bx-minus',
|
||||
sortAsc: 'bx-up-arrow-alt',
|
||||
sortDesc: 'bx-down-arrow-alt',
|
||||
}
|
||||
|
||||
export const iconify = {
|
||||
component: (props: IconProps) => {
|
||||
// Load custom SVG directly instead of going through icon component
|
||||
if (typeof props.icon === 'string') {
|
||||
const iconComponent = customIcons[props.icon]
|
||||
|
||||
if (iconComponent)
|
||||
return h(iconComponent)
|
||||
}
|
||||
|
||||
return h(
|
||||
props.tag,
|
||||
{
|
||||
...props,
|
||||
|
||||
// As we are using class based icons
|
||||
class: [props.icon],
|
||||
|
||||
// Remove used props from DOM rendering
|
||||
tag: undefined,
|
||||
icon: undefined,
|
||||
},
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
export const icons = {
|
||||
defaultSet: 'iconify',
|
||||
aliases,
|
||||
sets: {
|
||||
iconify,
|
||||
},
|
||||
}
|
||||
27
typescript-version/plugins/vuetify/index.ts
Normal file
27
typescript-version/plugins/vuetify/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createVuetify } from 'vuetify'
|
||||
import { VBtn } from 'vuetify/components/VBtn'
|
||||
import defaults from './defaults'
|
||||
import { icons } from './icons'
|
||||
import { themes } from './theme'
|
||||
|
||||
// Styles
|
||||
|
||||
import '@core/scss/template/libs/vuetify/index.scss'
|
||||
import 'vuetify/styles'
|
||||
|
||||
export default defineNuxtPlugin(nuxtApp => {
|
||||
const vuetify = createVuetify({
|
||||
ssr: true,
|
||||
aliases: {
|
||||
IconBtn: VBtn,
|
||||
},
|
||||
defaults,
|
||||
icons,
|
||||
theme: {
|
||||
defaultTheme: 'light',
|
||||
themes,
|
||||
},
|
||||
})
|
||||
|
||||
nuxtApp.vueApp.use(vuetify)
|
||||
})
|
||||
169
typescript-version/plugins/vuetify/theme.ts
Normal file
169
typescript-version/plugins/vuetify/theme.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
import type { ThemeDefinition } from 'vuetify'
|
||||
|
||||
export const staticPrimaryColor = '#696CFF'
|
||||
export const staticPrimaryDarkenColor = '#5E61E6'
|
||||
|
||||
export const themes: Record<string, ThemeDefinition> = {
|
||||
light: {
|
||||
dark: false,
|
||||
colors: {
|
||||
'primary': staticPrimaryColor,
|
||||
'on-primary': '#fff',
|
||||
'primary-darken-1': staticPrimaryDarkenColor,
|
||||
'primary-light': '#8789FF',
|
||||
'secondary': '#8592A3',
|
||||
'on-secondary': '#fff',
|
||||
'secondary-darken-1': '#788393',
|
||||
'secondary-light': '#9DA8B5',
|
||||
'success': '#71DD37',
|
||||
'on-success': '#fff',
|
||||
'success-darken-1': '#66C732',
|
||||
'success-light': '#53D28C',
|
||||
'info': '#03C3EC',
|
||||
'on-info': '#fff',
|
||||
'info-darken-1': '#03AFD4',
|
||||
'info-light': '#35CFF0',
|
||||
'warning': '#FFAB00',
|
||||
'on-warning': '#fff',
|
||||
'warning-darken-1': '#E69A00',
|
||||
'warning-light': '#FFBC33',
|
||||
'error': '#FF3E1D',
|
||||
'on-error': '#fff',
|
||||
'error-darken-1': '#E6381A',
|
||||
'error-light': '#FF654A',
|
||||
'background': '#f5f5f9',
|
||||
'on-background': '#22303E',
|
||||
'surface': '#fff',
|
||||
'on-surface': '#22303E',
|
||||
'grey-50': '#FAFAFA',
|
||||
'grey-100': '#F5F5F5',
|
||||
'grey-200': '#EEEEEE',
|
||||
'grey-300': '#E0E0E0',
|
||||
'grey-400': '#BDBDBD',
|
||||
'grey-500': '#9E9E9E',
|
||||
'grey-600': '#757575',
|
||||
'grey-700': '#616161',
|
||||
'grey-800': '#424242',
|
||||
'grey-900': '#212121',
|
||||
'grey-light': '#FAFAFA',
|
||||
'perfect-scrollbar-thumb': '#DBDADE',
|
||||
'skin-bordered-background': '#fff',
|
||||
'skin-bordered-surface': '#fff',
|
||||
'expansion-panel-text-custom-bg': '#fafafa',
|
||||
},
|
||||
|
||||
variables: {
|
||||
'code-color': '#d400ff',
|
||||
'overlay-scrim-background': '#22303E',
|
||||
'tooltip-background': '#22303E',
|
||||
'overlay-scrim-opacity': 0.5,
|
||||
'hover-opacity': 0.06,
|
||||
'focus-opacity': 0.1,
|
||||
'selected-opacity': 0.08,
|
||||
'activated-opacity': 0.16,
|
||||
'pressed-opacity': 0.14,
|
||||
'dragged-opacity': 0.1,
|
||||
'disabled-opacity': 0.4,
|
||||
'border-color': '#22303E',
|
||||
'border-opacity': 0.12,
|
||||
'table-header-color': '#FFFFFF',
|
||||
'high-emphasis-opacity': 0.9,
|
||||
'medium-emphasis-opacity': 0.7,
|
||||
'switch-opacity': 0.2,
|
||||
'switch-disabled-track-opacity': 0.3,
|
||||
'switch-disabled-thumb-opacity': 0.4,
|
||||
'switch-checked-disabled-opacity': 0.3,
|
||||
'track-bg': '#EEF1F3',
|
||||
'chat-bg': '#F7F8F8',
|
||||
|
||||
// Shadows
|
||||
'shadow-key-umbra-color': '#22303E',
|
||||
'shadow-xs-opacity': 0.06,
|
||||
'shadow-sm-opacity': 0.08,
|
||||
'shadow-md-opacity': 0.10,
|
||||
'shadow-lg-opacity': 0.14,
|
||||
'shadow-xl-opacity': 0.18,
|
||||
},
|
||||
},
|
||||
dark: {
|
||||
dark: true,
|
||||
colors: {
|
||||
'primary': staticPrimaryColor,
|
||||
'on-primary': '#fff',
|
||||
'primary-darken-1': staticPrimaryDarkenColor,
|
||||
'primary-light': '#8789FF',
|
||||
'secondary': '#8592A3',
|
||||
'on-secondary': '#fff',
|
||||
'secondary-darken-1': '#788393',
|
||||
'secondary-light': '#9DA8B5',
|
||||
'success': '#71DD37',
|
||||
'on-success': '#fff',
|
||||
'success-darken-1': '#66C732',
|
||||
'success-light': '#53D28C',
|
||||
'info': '#03C3EC',
|
||||
'on-info': '#fff',
|
||||
'info-darken-1': '#03AFD4',
|
||||
'info-light': '#35CFF0',
|
||||
'warning': '#FFAB00',
|
||||
'on-warning': '#fff',
|
||||
'warning-darken-1': '#E69A00',
|
||||
'warning-light': '#FFBC33',
|
||||
'error': '#FF3E1D',
|
||||
'on-error': '#fff',
|
||||
'error-darken-1': '#E6381A',
|
||||
'error-light': '#FF654A',
|
||||
'background': '#232333',
|
||||
'on-background': '#E6E6F1',
|
||||
'surface': '#2B2C40',
|
||||
'on-surface': '#E6E6F1',
|
||||
'grey-50': '#26293A',
|
||||
'grey-100': '#2F3349',
|
||||
'grey-200': '#26293A',
|
||||
'grey-300': '#4A5072',
|
||||
'grey-400': '#5E6692',
|
||||
'grey-500': '#7983BB',
|
||||
'grey-600': '#AAB3DE',
|
||||
'grey-700': '#B6BEE3',
|
||||
'grey-800': '#CFD3EC',
|
||||
'grey-900': '#E7E9F6',
|
||||
'grey-light': '#313246',
|
||||
'perfect-scrollbar-thumb': '#4A5072',
|
||||
'skin-bordered-background': '#2B2C40',
|
||||
'skin-bordered-surface': '#2B2C40',
|
||||
},
|
||||
variables: {
|
||||
'code-color': '#d400ff',
|
||||
'overlay-scrim-background': '#1D1D2A',
|
||||
'tooltip-background': '#E6E6F1',
|
||||
'overlay-scrim-opacity': 0.6,
|
||||
'hover-opacity': 0.06,
|
||||
'focus-opacity': 0.1,
|
||||
'selected-opacity': 0.08,
|
||||
'activated-opacity': 0.16,
|
||||
'pressed-opacity': 0.14,
|
||||
'dragged-opacity': 0.1,
|
||||
'disabled-opacity': 0.4,
|
||||
'border-color': '#E6E6F1',
|
||||
'border-opacity': 0.12,
|
||||
'table-header-color': '#2B2C40',
|
||||
'high-emphasis-opacity': 0.9,
|
||||
'medium-emphasis-opacity': 0.7,
|
||||
'switch-opacity': 0.4,
|
||||
'switch-disabled-track-opacity': 0.4,
|
||||
'switch-disabled-thumb-opacity': 0.8,
|
||||
'switch-checked-disabled-opacity': 0.3,
|
||||
'track-bg': '#41415F',
|
||||
'chat-bg': '#20202E',
|
||||
|
||||
// Shadows
|
||||
'shadow-key-umbra-color': '#14141D',
|
||||
'shadow-xs-opacity': 0.18,
|
||||
'shadow-sm-opacity': 0.20,
|
||||
'shadow-md-opacity': 0.22,
|
||||
'shadow-lg-opacity': 0.24,
|
||||
'shadow-xl-opacity': 0.26,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default themes
|
||||
Reference in New Issue
Block a user