定制 williamalmeida/mary-v1-community 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

williamalmeida/mary-v1-community

Composer 安装命令:

composer require williamalmeida/mary-v1-community

包简介

Mary UI Community Edition - UI components for Livewire, daisyUI and Tailwind (forked and maintained by William Almeida)

README 文档

README

Community Maintained Stable v1 MIT License

mary-v1-community

This repository is an independent, community-maintained continuation of the original MaryUI v1 project. It preserves and extends the classic v1 branch after official support was discontinued, ensuring ongoing updates, bug fixes, and compatibility for users who rely on the v1 codebase.

mary-v1-community provides a set of beautiful UI components for Livewire, powered by daisyUI and Tailwind CSS, based on the original MaryUI v1 foundation.

Documentation

Refer to the maryUI website for the original documentation. Community updates and new documentation will be provided here as the project evolves.

Contributing

Contributions are welcome! If you want to help maintain or improve mary-v1-community, please open issues or pull requests.

To use this package locally during development, clone this repository and set up a local path repository in your app's composer.json:

"repositories": {
        "mary-v1-community": {
                "type": "path",
                "url": "/path/to/mary-v1-community",
                "options": {
                    "symlink": true
                }
        }
}

Then require the package:

composer require williamalmeida/mary-v1-community

Start the dev server:

yarn dev

Importing JS helpers from vendor (no CDN required)

The original maryUI docs suggest loading some helpers (e.g. currency.js) via CDN from a <script> tag in your layout. In mary-v1-community you can also import the bundled helpers directly from the package inside your resources/js/app.js, so they get processed by Vite and bundled with your app — no extra CDN request needed.

The available helpers live under vendor/williamalmeida/mary-v1-community/libs/:

  • color-palette.js — registers the $store.maryColorPalette Alpine store used by the <x-color-palette> component.
  • dialog.js — registers the global Livewire dialog listener used by the Dialog trait.
  • toast.js — registers the global Livewire toast listener used by the Toast trait.
  • currency.js — provides the global window.Currency class used by the <x-input money> component.

Example: resources/js/app.js

import './bootstrap';

import Alpine from 'alpinejs';
import { Livewire } from '../../vendor/livewire/livewire/dist/livewire.esm';

// mary-v1-community helpers (bundled, no CDN)
import { registerColorPalette } from '../../vendor/williamalmeida/mary-v1-community/libs/color-palette';
import { registerDialog }       from '../../vendor/williamalmeida/mary-v1-community/libs/dialog';
import { registerToast }        from '../../vendor/williamalmeida/mary-v1-community/libs/toast';
import '../../vendor/williamalmeida/mary-v1-community/libs/currency'; // exposes window.Currency

// Register the Alpine store BEFORE Alpine starts
document.addEventListener('alpine:init', () => {
    registerColorPalette(Alpine);
});

// Register Livewire listeners AFTER Livewire is available on window
registerDialog();
registerToast();

window.Alpine = Alpine;
Alpine.start();
Livewire.start();

Notes

  • registerDialog() and registerToast() use the global window.Livewire (Livewire 3), so call them after Livewire has been loaded.
  • registerColorPalette(Alpine) must be called inside the alpine:init event so the store is available before Alpine boots.
  • currency.js only needs to be imported once — it auto-attaches window.Currency.

Tailwind: scan the package sources

Make sure your tailwind.config.js includes the package components so Tailwind picks up the classes used inside them:

module.exports = {
    content: [
        // ...
        './vendor/williamalmeida/mary-v1-community/src/View/Components/**/*.php',
    ],
    // ...
}

Tip: se você está desenvolvendo localmente usando um repositório path (link simbólico via composer), inclua também o caminho para a cópia local do pacote para que o Vite/Tailwind detectem as classes durante o desenvolvimento. Exemplo com ambas as opções:

module.exports = {
    content: [
        // arquivos da sua app
        './resources/js/**/*.js',
        './resources/views/**/*.blade.php',

        // quando o pacote está instalado via Composer
        './vendor/williamalmeida/mary-v1-community/src/View/Components/**/*.php',

        // quando estiver usando o pacote localmente via `repositories.type = path`
        '../mary-v1-community/src/View/Components/**/*.php',
    ],
}

Isso garante que o Tailwind processe as classes usadas por <x-color-palette> (e outros componentes do pacote) tanto em instalações via vendor quanto em desenvolvimento local.

Color Palette component

<x-color-palette> renders a Tailwind color palette picker (all 22 color families × shades 50–950) and stores the selected hex value in your model.

It depends on the maryColorPalette Alpine store registered by libs/color-palette.js (see the import section above).

{{-- Livewire model --}}
<x-color-palette
    label="Background color"
    wire:model="background_color"
    clearable
    hint="Click the swatch to open the palette" />

{{-- Plain Alpine model --}}
<div x-data="{ color: '' }">
    <x-color-palette label="Pick a color" x-model="color" />
</div>

Available props: label, hint, hintClass, inline, clearable, plus the standard error props (errorField, errorClass, omitError, firstErrorOnly). Standard HTML attributes such as disabled, readonly, required and placeholder are also supported.

License

mary-v1-community is open-sourced software licensed under the MIT license.

williamalmeida/mary-v1-community 适用场景与选型建议

williamalmeida/mary-v1-community 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ui」 「components」 「laravel」 「blade」 「tailwind」 「livewire」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 williamalmeida/mary-v1-community 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 williamalmeida/mary-v1-community 我们能提供哪些服务?
定制开发 / 二次开发

基于 williamalmeida/mary-v1-community 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 32
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-22