Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ui Laravel Package

beartropy/ui

Beartropy UI is a small Laravel UI package providing ready-made components and helpers to speed up building admin and front-end screens. Drop in common layouts, forms, and UI utilities to get a consistent look fast with minimal setup.

View on GitHub
Deep Wiki
Context7

x-bt-dialog — AI Reference

Component Tag

<x-bt-dialog />
<x-bt-dialog size="lg" />

Architecture

  • Dialog → extends BeartropyComponent
  • View: dialog.blade.php (self-contained, no partials)
  • Single instance per page — event-driven, no Blade slots
  • Alpine module: resources/js/modules/bt-dialog.js (btDialog() function)
  • JS helper: resources/js/modules/dialog.js (dialog() function, exported from beartropy-ui.js)
  • Livewire trait: src/Traits/HasDialogs.php (dispatches bt-dialog event)

Props (constructor)

Prop PHP Type Default Description
size ?string 'md' Default panel width — overridable per dialog via event payload

Event Flow

  1. Livewire component calls $this->dialog()->success(...) (or confirm, delete, etc.)
  2. HasDialogs trait calls $this->dispatch('bt-dialog', $payload)
  3. Blade listens via x-on:bt-dialog.window="openDialog($event.detail)"
  4. Alpine btDialog.openDialog() parses payload, sets state, opens dialog
  5. Button clicks call clickAccept() / clickReject() → find Livewire component via componentId → call method

JS Alternative Flow

  1. JS calls dialog.success('Title') (from modules/dialog.js)
  2. Dispatches CustomEvent('bt-dialog', { detail: payload }) on window
  3. Same Alpine handler picks it up

Size Mapping (intentional offset)

Named sizes map to one step wider for readability:

  • sm → max-w-md, md → max-w-lg, lg → max-w-xl, xl → max-w-2xl, 2xl → max-w-3xl

Alpine State (btDialog)

  • isOpen, type, title, description, icon
  • accept / reject{ label, method, params } or null
  • componentId — Livewire component ID for method calls
  • acceptBusy / rejectBusy — loading states
  • allowOutsideClick, allowEscape — close behavior
  • panelSizeClass — resolved Tailwind max-width class
  • globalSize — default size from Blade prop
  • typeStyles — PHP-generated icon color map
  • buttonColors — JS-defined single-button color map

Type Styles (passed from PHP)

info, success, warning, error, confirm, danger — each with iconBg and iconText classes.

HasDialogs Trait Methods

Method Signature Type
dialog() (): static Fluent accessor
success() (string $title, ?string $description, array $options) Alert
info() (string $title, ?string $description, array $options) Alert
warning() (string $title, ?string $description, array $options) Alert
error() (string $title, ?string $description, array $options) Alert
confirm() (array $config) Two-button confirm
delete() (string $title, ?string $description, array $options) Danger confirm

JS Helper API (dialog)

dialog.success(title, description?, options?)
dialog.info(title, description?, options?)
dialog.warning(title, description?, options?)
dialog.error(title, description?, options?)
dialog.confirm({ title, description?, accept, reject, ... })
dialog.delete(title, description?, { method, params, componentId, ... })

Localization Keys Used

  • beartropy-ui::ui.ok — accept button fallback, single-button text
  • beartropy-ui::ui.cancel — reject button fallback
  • beartropy-ui::ui.confirm — confirm accept button fallback
  • beartropy-ui::ui.delete — delete accept button fallback
  • beartropy-ui::ui.are_you_sure — confirm title fallback

Key Blade Markers for Testing

  • btDialog( — Alpine init
  • role="dialog", aria-modal="true" — accessibility
  • x-cloak, x-show="isOpen" — visibility
  • globalSize: "..." — size prop passthrough
  • x-trap.noscroll.inert="isOpen" — focus trap
  • x-on:bt-dialog.window — event listener
  • z-[9999] — stacking
  • md:pt-[18vh] — desktop offset
  • clickAccept(), clickReject() — button handlers
  • isSingleButton, buttonColors — single-button mode
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
boundwize/jsonrecast
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata