yard / brave-components
Collection of logic-heavy components used in Brave projects.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Type:package
pkg:composer/yard/brave-components
Requires
- php: >=8.1
- roots/acorn: ^4.3
- spatie/laravel-package-tools: ^1.16
- yard/wp-hook-registrar: *
Requires (Dev)
- 10up/wp_mock: ^0.4.2
- larastan/larastan: ^2.9
- orchestra/testbench: ^8.27
- pestphp/pest: ^2.36
- php-stubs/gravity-forms-stubs: ^v2.9
- szepeviktor/phpstan-wordpress: ^1.3
- yard/php-cs-fixer-rules: ^1.0
README
Collection of logic-heavy components used in Brave projects.
Requirements
Installation
To install this package using Composer, follow these steps:
-
Install this package with Composer:
composer require yard/brave-components
-
Run the Acorn WP-CLI command to discover this package:
wp acorn package:discover
You can publish the config file with:
wp acorn vendor:publish --provider="Yard\Brave\ComponentsServiceProvider"
To only publish the views, run:
wp acorn vendor:publish --provider="Yard\Brave\ComponentsServiceProvider" --tag="views"
Components
Back Button
Shows a back button that determines its link and text by checking the parent page. If the post has no parent, it sets the link to a predefined parent page slug or defaults to "javascript:history.back();".
Usage:
<x-brave-back-button /> <x-brave-back-button text="Terug naar het vacature-overzicht" /> <x-brave-back-button className="custom-class" />
Pattern Content
Shows the content of a pattern by its slug. You can find the slug (post name) using the wp post get CLI command and providing the post ID.
Usage:
<x-brave-pattern-content slug="footer" /> <x-brave-pattern-content slug="single-vacancy-contact-information" />
Configure the admin behavior of each pattern in the components.php config file to automatically save them as drafts (thus hiding them from the pattern inserter), prevent their deletion, and add custom labels in the admin view.