Loaded
``` -------------------------------- ### CI/CD Integration Example Source: https://github.com/louismazel/maz-ui/blob/master/packages/node/README.md Shows how to use the logger and execPromise within a CI/CD pipeline to execute a series of commands. ```APIDOC ## CI/CD Integration ### Description This example demonstrates setting up a CI/CD pipeline using `@maz-ui/node`'s logger and `execPromise`. It defines a series of steps (lint, test, build, package) and executes them sequentially, logging progress and handling errors. ### Functions - `ciPipeline()`: An async function that runs the CI pipeline steps. ### Example ```typescript import { createLogger, execPromise } from '@maz-ui/node' async function ciPipeline() { const logger = createLogger({ level: 2 // normal level for CI }) const steps = [ { name: 'Lint', command: 'npm run lint' }, { name: 'Test', command: 'npm test' }, { name: 'Build', command: 'npm run build' }, { name: 'Package', command: 'npm pack' } ] logger.box('🔄 CI Pipeline Started') logger.divider() for (const step of steps) { logger.info(`Running ${step.name}...`) try { await execPromise(step.command, { packageName: step.name.toLowerCase(), noStdout: true, logger }) logger.ready(`${step.name} completed`) } catch (error) { logger.fail(`${step.name} failed`) logger.error(error) process.exit(1) } } logger.eot() logger.success('🎉 All pipeline steps completed!') } ciPipeline() ``` ``` -------------------------------- ### Basic useBreakpoints Setup Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/composables/use-breakpoints.md Define your breakpoints and initialize the composable. Use the destructured properties to check screen size conditions. ```typescript const breakpoints = { 'sm': '640px', 'md': '768px', 'lg': '1024px', 'xl': '1280px', '2xl': '1536px', } const { isLargeScreen, isMediumScreen, isSmallScreen, } = useBreakpoints({ breakpoints, initialWidth: 0, mediumBreakPoint: 'md', largeBreakPoint: 'lg', }) ``` -------------------------------- ### Run Documentation Development Server Source: https://github.com/louismazel/maz-ui/blob/master/CONTRIBUTING.md Start the Vitepress development server for the documentation. This server is available at http://localhost:5173/. ```shell pnpm -F docs dev ``` -------------------------------- ### Vue Usage Example for useDisplayNames Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/composables/use-display-names.md Demonstrates how to use the useDisplayNames composable within a Vue component to get reactive display names for languages. ```vue ``` -------------------------------- ### Nuxt Plugin for AOS Initialization Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/plugins/aos.md Set up the AOS plugin in your Nuxt.js client-side configuration. This example shows how to pass router and animation options during installation. ```typescript import { AosOptions, installAos } from 'maz-ui/plugins' export default ({ vueApp, $router: router }) => { const options: AosOptions = { router, animation: { duration: 1000, delay: 0, once: false, }, } vueApp.use(installAos, options) } ``` -------------------------------- ### Internationalization Examples Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/components/maz-date-picker.md Shows how to set up the date picker for different languages and locales. ```vue const frenchDate = ref() const germanDate = ref() const japaneseDate = ref() const arabicDate = ref() ``` -------------------------------- ### Complete Translation Setup Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/guide/translations.md Configure Maz-UI with multiple languages by providing a nested object of translation messages. This example sets up English, French, and Spanish. ```typescript import { createApp } from 'vue' import { MazUi } from 'maz-ui/plugins/maz-ui' import App from './App.vue' const app = createApp(App) app.use(MazUi, { translations: { locale: 'en', // Start with English messages: { // English (default - you don't need to provide this unless you want to override the default translations) en: { inputPhoneNumber: { countrySelect: { placeholder: 'Country code', error: 'Choose country', searchPlaceholder: 'Search the country' }, phoneInput: { placeholder: 'Phone number', example: 'Example: {example}' } } }, // French fr: { inputPhoneNumber: { countrySelect: { placeholder: 'Code pays', error: 'Choisir un pays', searchPlaceholder: 'Rechercher le pays' }, phoneInput: { placeholder: 'Numéro de téléphone', example: 'Exemple: {example}' } }, dropzone: { dragAndDrop: 'Déposez vos fichiers', selectFile: 'sélectionner un fichier', divider: 'ou', fileMaxCount: 'Maximum {count} fichiers', fileMaxSize: 'Maximum {size} MB', fileTypes: 'Types de fichiers autorisés: {types}' }, pagination: { navAriaLabel: 'navigation de page', screenReader: { firstPage: 'Première page, page {page}', previousPage: 'Page précédente, page {page}', page: 'Page {page}', nextPage: 'Page suivante, page {page}', lastPage: 'Dernière page, page {page}' } } }, // Spanish es: { inputPhoneNumber: { countrySelect: { placeholder: 'Código de país', error: 'Elegir país', searchPlaceholder: 'Buscar el país' }, phoneInput: { placeholder: 'Número de teléfono', example: 'Ejemplo: {example}' } }, dropzone: { dragAndDrop: 'Suelta tus archivos', selectFile: 'seleccionar archivo', divider: 'o', fileMaxCount: 'Máximo {count} archivos', fileMaxSize: 'Máximo {size} MB', fileTypes: 'Tipos de archivo permitidos: {types}' }, pagination: { navAriaLabel: 'navegación de página', screenReader: { firstPage: 'Primera página, página {page}', previousPage: 'Página anterior, página {page}', page: 'Página {page}', nextPage: 'Página siguiente, página {page}', lastPage: 'Última página, página {page}' } } } } } }) app.mount('#app') ``` -------------------------------- ### Complete Dashboard Setup with Vite Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/guide/resolvers.md Configure Vite with Maz UI resolvers for automatic component and module imports. Ensure `unplugin-auto-import` and `unplugin-vue-components` are installed. ```typescript import vue from '@vitejs/plugin-vue' import { MazComponentsResolver, MazDirectivesResolver, MazModulesResolver } from 'maz-ui/resolvers' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' // vite.config.ts - Production-ready configuration import { defineConfig } from 'vite' export default defineConfig({ plugins: [ vue(), Components({ resolvers: [MazComponentsResolver()], dts: 'src/types/components.d.ts', directoryAsNamespace: true, }), AutoImport({ resolvers: [MazModulesResolver()], dts: 'src/types/auto-imports.d.ts', imports: ['vue', 'vue-router'], eslintrc: { enabled: true, }, }), ], }) ``` -------------------------------- ### Basic Usage with Items Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/components/maz-btn-group.md Use the `items` prop to quickly create a button group from an array of button configurations. This example shows basic setup with imported types. ```vue{{ t('button.cancel') }}
``` -------------------------------- ### Use useTheme Composable for Theme Management Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/guide/migration-v4.md The 'useTheme' composable provides functions to get the current dark mode state, toggle it, and set a specific theme. It must be used within a component where Maz-UI plugin is installed. ```vue ``` -------------------------------- ### MazDropzone Basic Usage Source: https://github.com/louismazel/maz-ui/blob/master/apps/docs/src/components/maz-dropzone.md Demonstrates the basic setup of MazDropzone with file handling and upload event listeners. Use this for standard file upload scenarios. ```vueHello World!
Hello World!