├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── SECURITY.md └── workflows │ ├── dependabot-auto-merge.yml │ ├── fix-php-code-style-issues.yml │ ├── phpstan.yml │ └── update-changelog.yml ├── .gitignore ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── docs ├── _index.md ├── filament.md ├── getting-started │ ├── _index.md │ ├── blade-component.md │ ├── changelog.md │ ├── installation.md │ └── usage.md └── introduction.md ├── phpstan-baseline.neon ├── phpstan.neon.dist ├── pint.json ├── resources └── views │ ├── components │ └── accordion │ │ ├── index.blade.php │ │ └── item.blade.php │ └── forms │ ├── accordion.blade.php │ └── accordions.blade.php ├── src ├── AccordionServiceProvider.php ├── Concerns │ └── CanBeIsolated.php ├── Forms │ ├── Accordion.php │ └── Accordions.php └── Infolists │ ├── Accordion.php │ └── Accordions.php └── tailwind.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code 10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be 11 | extremely unfair for them to suffer abuse or anger for their hard work. 12 | 13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the 14 | world that developers are civilized and selfless people. 15 | 16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient 17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 18 | 19 | ## Viability 20 | 21 | When requesting or submitting new features, first consider whether it might be useful to others. Open 22 | source projects are used by many developers, who may have entirely different needs to your own. Think about 23 | whether or not your feature is likely to be used by other users of the project. 24 | 25 | ## Procedure 26 | 27 | Before filing an issue: 28 | 29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 30 | - Check to make sure your feature suggestion isn't already present within the project. 31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 32 | - Check the pull requests tab to ensure that the feature isn't already in progress. 33 | 34 | Before submitting a pull request: 35 | 36 | - Check the codebase to ensure that your feature doesn't already exist. 37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 38 | 39 | ## Requirements 40 | 41 | If the project maintainer has any additional requirements, you will find them listed here. 42 | 43 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). 44 | 45 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 46 | 47 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 48 | 49 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 50 | 51 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 52 | 53 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 54 | 55 | **Happy coding**! 56 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: atmonshi 2 | custom: "https://www.buymeacoffee.com/larazeus" 3 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | If you discover any security related issues, please email info@larazeus.com instead of using the issue tracker. 4 | -------------------------------------------------------------------------------- /.github/workflows/dependabot-auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: dependabot-auto-merge 2 | on: pull_request_target 3 | 4 | permissions: 5 | pull-requests: write 6 | contents: write 7 | 8 | jobs: 9 | dependabot: 10 | runs-on: ubuntu-latest 11 | if: ${{ github.actor == 'dependabot[bot]' }} 12 | steps: 13 | 14 | - name: Dependabot metadata 15 | id: metadata 16 | uses: dependabot/fetch-metadata@v1.6.0 17 | with: 18 | github-token: "${{ secrets.GITHUB_TOKEN }}" 19 | 20 | - name: Auto-merge Dependabot PRs for semver-minor updates 21 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} 22 | run: gh pr merge --auto --merge "$PR_URL" 23 | env: 24 | PR_URL: ${{github.event.pull_request.html_url}} 25 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 26 | 27 | - name: Auto-merge Dependabot PRs for semver-patch updates 28 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} 29 | run: gh pr merge --auto --merge "$PR_URL" 30 | env: 31 | PR_URL: ${{github.event.pull_request.html_url}} 32 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} -------------------------------------------------------------------------------- /.github/workflows/fix-php-code-style-issues.yml: -------------------------------------------------------------------------------- 1 | name: code style 2 | 3 | on: [push] 4 | 5 | jobs: 6 | php-code-styling: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v4 12 | with: 13 | ref: ${{ github.head_ref }} 14 | 15 | - name: Fix PHP code style issues 16 | uses: aglipanci/laravel-pint-action@2.3.1 17 | 18 | - name: Commit changes 19 | uses: stefanzweifel/git-auto-commit-action@v5 20 | with: 21 | commit_message: Fix styling 22 | -------------------------------------------------------------------------------- /.github/workflows/phpstan.yml: -------------------------------------------------------------------------------- 1 | name: PHPStan 2 | 3 | on: 4 | push: 5 | paths: 6 | - '**.php' 7 | - 'phpstan.neon.dist' 8 | 9 | jobs: 10 | phpstan: 11 | name: phpstan 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Setup PHP 17 | uses: shivammathur/setup-php@v2 18 | with: 19 | php-version: '8.2' 20 | coverage: none 21 | 22 | - name: Install composer dependencies 23 | uses: ramsey/composer-install@v2 24 | 25 | - name: Run PHPStan 26 | run: ./vendor/bin/phpstan --error-format=github -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yml: -------------------------------------------------------------------------------- 1 | name: "Update Changelog" 2 | 3 | on: 4 | release: 5 | types: [released] 6 | 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v4 14 | with: 15 | ref: 1.x 16 | 17 | - name: Update Changelog 18 | uses: stefanzweifel/changelog-updater-action@v1 19 | with: 20 | latest-version: ${{ github.event.release.name }} 21 | release-notes: ${{ github.event.release.body }} 22 | 23 | - name: Commit updated CHANGELOG 24 | uses: stefanzweifel/git-auto-commit-action@v5 25 | with: 26 | branch: 1.x 27 | commit_message: Update CHANGELOG 28 | file_pattern: CHANGELOG.md 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /vendor/.idea 7 | /bootstrap/cache 8 | .env 9 | .env.backup 10 | .phpunit.result.cache 11 | docker-compose.override.yml 12 | Homestead.json 13 | Homestead.yaml 14 | npm-debug.log 15 | yarn-error.log 16 | /.idea 17 | /.vscode 18 | /pkg 19 | /build 20 | .DS_Store 21 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "trailingComma": "all" 5 | } 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | info@larazeus.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Lara Zeus (Ash) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

Group forms component in an Accordion layout.

6 | 7 |

8 | 9 | [![Latest Version on Packagist](https://img.shields.io/packagist/v/lara-zeus/accordion.svg?style=flat-square)](https://packagist.org/packages/lara-zeus/accordion) 10 | [![Code Style](https://img.shields.io/github/actions/workflow/status/lara-zeus/accordion/fix-php-code-style-issues.yml?label=code-style&flat-square)](https://github.com/lara-zeus/accordion/actions?query=workflow%3Afix-php-code-style-issues+branch%3Amain) 11 | [![Total Downloads](https://img.shields.io/packagist/dt/lara-zeus/accordion.svg?style=flat-square)](https://packagist.org/packages/lara-zeus/accordion) 12 | [![Total Downloads](https://img.shields.io/github/stars/lara-zeus/accordion?style=flat-square)](https://github.com/lara-zeus/accordion) 13 | 14 |

15 | 16 | ## features 17 | - 🔥 same look and feel as filament components 18 | - 🔥 can be used as connected accordion, or isolated 19 | - 🔥 set the active accordion 20 | - 🔥 set icon per accordion 21 | 22 | ## Screenshots 23 | 24 | ![](https://larazeus.com/images/screenshots/accordion/accordion-1.webp) 25 | 26 | ## Demo 27 | 28 | > Visit our demo site: https://demo.larazeus.com/admin/components-demo/accordion 29 | 30 | ## Full Documentation 31 | 32 | > Visit our website to get the complete documentation: https://larazeus.com/docs/accordion 33 | 34 | ## Changelog 35 | 36 | Please see [CHANGELOG](CHANGELOG.md) for more information on recent changes. 37 | 38 | ## Support 39 | available support channels: 40 | 41 | * open an issue on [GitHub](https://github.com/lara-zeus/accordion/issues) 42 | * Email us using the [contact center](https://larazeus.com/contact-us) 43 | 44 | ## Contributing 45 | 46 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 47 | 48 | ## Security 49 | 50 | If you find any security-related issues, please email info@larazeus.com instead of using the issue tracker. 51 | 52 | ## Credits 53 | 54 | - [Lara Zeus (Ash)](https://github.com/atmonshi) 55 | - [All Contributors](../../contributors) 56 | 57 | ## License 58 | 59 | The MIT License (MIT). Please have a look at [License File](LICENSE.md) for more information. 60 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lara-zeus/accordion", 3 | "description": "Zeus Accordion is filamentphp layout component to group components", 4 | "keywords": [ 5 | "laravel", 6 | "lara-zeus", 7 | "ui", 8 | "tooltip", 9 | "tippy", 10 | "accordion", 11 | "code", 12 | "design", 13 | "input", 14 | "coulmn", 15 | "field", 16 | "generator", 17 | "filamentphp" 18 | ], 19 | "homepage": "https://larazeus.com/accordion", 20 | "support": { 21 | "issues": "https://github.com/lara-zeus/accordion/issues", 22 | "source": "https://github.com/lara-zeus/accordion" 23 | }, 24 | "license": "MIT", 25 | "type": "library", 26 | "authors": [ 27 | { 28 | "name": "Lara Zeus (Ash)", 29 | "email": "info@larazeus.com" 30 | } 31 | ], 32 | "require": { 33 | "php": "^8.1", 34 | "filament/filament": "^3.0", 35 | "spatie/laravel-package-tools": "^1.19" 36 | }, 37 | "require-dev": { 38 | "laravel/pint": "^1.0", 39 | "nunomaduro/collision": "^7.0", 40 | "nunomaduro/larastan": "^2.0.1", 41 | "nunomaduro/phpinsights": "^2.8", 42 | "orchestra/testbench": "^8.0", 43 | "phpstan/extension-installer": "^1.1" 44 | }, 45 | "autoload": { 46 | "psr-4": { 47 | "LaraZeus\\Accordion\\": "src" 48 | } 49 | }, 50 | "scripts": { 51 | "analyse": "vendor/bin/phpstan analyse", 52 | "format": "vendor/bin/pint", 53 | "pint": "vendor/bin/pint", 54 | "test:phpstan": "vendor/bin/phpstan analyse" 55 | }, 56 | "config": { 57 | "sort-packages": true, 58 | "allow-plugins": { 59 | "phpstan/extension-installer": true, 60 | "dealerdirect/phpcodesniffer-composer-installer": true 61 | } 62 | }, 63 | "extra": { 64 | "laravel": { 65 | "providers": [ 66 | "LaraZeus\\Accordion\\AccordionServiceProvider" 67 | ] 68 | } 69 | }, 70 | "minimum-stability": "dev", 71 | "prefer-stable": true 72 | } 73 | -------------------------------------------------------------------------------- /docs/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: v1 3 | slogan: filamentphp layout Group forms component in an Accordion layout 4 | githubUrl: https://github.com/lara-zeus/accordion 5 | branch: v1.x 6 | icon: vaadin-accordion-menu 7 | --- 8 | -------------------------------------------------------------------------------- /docs/filament.md: -------------------------------------------------------------------------------- 1 | # Zeus Accordion layout Component 2 | 3 | Group forms component in an Accordion layout 4 | 5 | ## Features 6 | 7 | 🔥 same look and feel as filament components 8 | 🔥 can be used as connected accordion, or isolated 9 | 🔥 set the active accordion 10 | 🔥 set icon per accordion 11 | 12 | ## Screenshots 13 | 14 | ![](https://larazeus.com/images/screenshots/accordion/accordion-1.webp) 15 | ![](https://larazeus.com/images/screenshots/accordion/cover.webp) 16 | 17 | ## More Details 18 | **✨ to learn more about Accordion, please visit:** 19 | 20 | - [Discord](https://discord.com/channels/883083792112300104/1282751058015420528) 21 | - [Docs](https://larazeus.com/docs/accordion) 22 | - [Github](https://github.com/lara-zeus/accordion) 23 | - [Demo](https://demo.larazeus.com/admin/components-demo/accordion) 24 | -------------------------------------------------------------------------------- /docs/getting-started/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting Started 3 | weight: 1 4 | --- 5 | -------------------------------------------------------------------------------- /docs/getting-started/blade-component.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Blade Component 3 | weight: 5 4 | --- 5 | 6 | ## Accordion Blade Component 7 | 8 | you can use accordion as a blade component in any view you want 9 | 10 | ```html 11 | 12 | 19 |
20 |

title

21 |

title

22 |
23 |
24 | 25 | 30 |
31 |

info

32 |

info

33 |

info

34 |
35 |
36 | 37 |
38 | ``` 39 | -------------------------------------------------------------------------------- /docs/getting-started/changelog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Changelog 3 | weight: 100 4 | --- 5 | 6 | All changes to @zeus `Accordion` are auto updated documented on GitHub [changelog](https://github.com/lara-zeus/Accordion/blob/1.x/CHANGELOG.md) 7 | -------------------------------------------------------------------------------- /docs/getting-started/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Installation 3 | weight: 3 4 | --- 5 | 6 | ## Installation 7 | 8 | Install @zeus Accordion by running the following commands in your Laravel project directory. 9 | 10 | ```bash 11 | composer require lara-zeus/accordion 12 | ``` 13 | 14 | ## theme 15 | 16 | add this path to your tailwind config file in the `content` array 17 | 18 | ```js 19 | './vendor/lara-zeus/accordion/resources/views/**/*.blade.php', 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/getting-started/usage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Usage 3 | weight: 4 4 | --- 5 | 6 | ## In Forms 7 | 8 | to use @zeus accordion in your forms: 9 | 10 | @blade 11 | 12 | @endblade 13 | 14 | ```php 15 | \LaraZeus\Accordion\Forms\Accordions::make('Options') 16 | ->activeAccordion(2) 17 | ->isolated() 18 | 19 | ->accordions([ 20 | \LaraZeus\Accordion\Forms\Accordion::make('main-data') 21 | ->columns() 22 | ->label('User Details') 23 | ->icon('tabler-message-chatbot-filled') 24 | ->badge('New Badge') 25 | ->badgeColor('info') 26 | ->schema([ 27 | TextInput::make('name')->required(), 28 | TextInput::make('email')->required(), 29 | ]), 30 | ]), 31 | , 32 | ``` 33 | 34 | ## In Infolist 35 | 36 | to use @zeus accordion in your infolist: 37 | 38 | @blade 39 | 40 | @endblade 41 | 42 | ```php 43 | \LaraZeus\Accordion\Infolists\Accordions::make('Options') 44 | ->activeAccordion(2) 45 | ->isolated() 46 | 47 | ->accordions([ 48 | \LaraZeus\Accordion\Infolists\Accordion::make('main-data') 49 | ->columns() 50 | ->label('User Details') 51 | ->icon('tabler-message-chatbot-filled') 52 | ->schema([ 53 | TextInput::make('name')->required(), 54 | TextInput::make('email')->required(), 55 | ]), 56 | ]), 57 | , 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | weight: 1 4 | --- 5 | 6 | ## Introduction 7 | Group forms component in an Accordion layout 8 | 9 | **[Demo](https://demo.larazeus.com/admin/components-demo/accordion) · [Github](https://github.com/lara-zeus/accordion) · [Discord](https://discord.com/channels/883083792112300104/1282751058015420528)** 10 | 11 | ## Features 12 | 13 | - 🔥 same look and feel as filament components 14 | - 🔥 can be used as connected accordion, or isolated 15 | - 🔥 set the active accordion 16 | - 🔥 set icon per accordion 17 | 18 | ## Screenshots 19 | 20 | ![](https://larazeus.com/images/screenshots/accordion/accordion-1.webp) 21 | ![](https://larazeus.com/images/screenshots/accordion/cover.webp) 22 | 23 | ## Support 24 | 25 | Available support channels: 26 | 27 | * Join our channel on [Discord](https://discord.com/channels/883083792112300104/1282751058015420528) 28 | * Open an issue on [GitHub](https://github.com/lara-zeus/accordion/issues) 29 | * Email us using the [contact center](https://larazeus.com/contact-us) 30 | -------------------------------------------------------------------------------- /phpstan-baseline.neon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lara-zeus/accordion/eac4f36ee4394b8fabb4eeb3e06d0e1771aff2b6/phpstan-baseline.neon -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | includes: 2 | - phpstan-baseline.neon 3 | 4 | parameters: 5 | level: 6 6 | paths: 7 | - src 8 | 9 | checkOctaneCompatibility: true 10 | checkModelProperties: true 11 | checkMissingIterableValueType: false 12 | checkGenericClassInNonGenericObjectType: false 13 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "laravel", 3 | "rules": { 4 | "blank_line_before_statement": true, 5 | "concat_space": { 6 | "spacing": "one" 7 | }, 8 | "method_argument_space": true, 9 | "single_trait_insert_per_statement": true, 10 | "types_spaces": { 11 | "space": "single" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /resources/views/components/accordion/index.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'activeAccordion' => 1, 3 | ]) 4 |
16 |
17 | {{ $slot }} 18 |
19 |
-------------------------------------------------------------------------------- /resources/views/components/accordion/item.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'activeAccordion' => 1, 3 | 'isIsolated' => false, 4 | 'icon' => null, 5 | 'label' => '', 6 | 'badge' => null, 7 | 'badgeColor' => null, 8 | ]) 9 |
31 | 68 |
70 |
{{ $slot }}
71 |
72 |
73 | -------------------------------------------------------------------------------- /resources/views/forms/accordion.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{ $getChildComponentContainer() }} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/forms/accordions.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | $isIsolated = $isIsolated(); 3 | $getActiveAccordion = $getActiveAccordion(); 4 | @endphp 5 |
merge([ 11 | 'id' => $getId(), 12 | 'wire:key' => "{$this->getId()}.{$getStatePath()}." . 'accordions.container', 13 | ], escape: false) 14 | ->merge($getExtraAttributes(), escape: false) 15 | ->merge($getExtraAlpineAttributes(), escape: false) 16 | }} 17 | > 18 | 19 | @foreach ($getChildComponentContainer()->getComponents() as $accordion) 20 | 28 | {{ $accordion }} 29 | 30 | @endforeach 31 | 32 |
33 | -------------------------------------------------------------------------------- /src/AccordionServiceProvider.php: -------------------------------------------------------------------------------- 1 | name(static::$name) 16 | ->hasViews(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Concerns/CanBeIsolated.php: -------------------------------------------------------------------------------- 1 | isIsolated = $condition; 14 | 15 | return $this; 16 | } 17 | 18 | public function isIsolated(): bool 19 | { 20 | return $this->evaluate($this->isIsolated); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Forms/Accordion.php: -------------------------------------------------------------------------------- 1 | label($label); 22 | $this->id(Str::slug($label)); 23 | } 24 | 25 | public function getId(): string 26 | { 27 | return $this->getContainer()->getParentComponent()->getId() . '-' . parent::getId() . '-accordion'; 28 | } 29 | 30 | public function getColumnsConfig(): array 31 | { 32 | return $this->columns ?? $this->getContainer()->getColumnsConfig(); 33 | } 34 | 35 | public function canConcealComponents(): bool 36 | { 37 | return true; 38 | } 39 | 40 | public static function make(string | Closure | null $label = null): static 41 | { 42 | $static = app(static::class, ['label' => $label]); 43 | $static->configure(); 44 | 45 | return $static; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Forms/Accordions.php: -------------------------------------------------------------------------------- 1 | label($label); 22 | } 23 | 24 | public static function make(?string $label = null): static 25 | { 26 | $static = app(static::class, ['label' => $label]); 27 | $static->configure(); 28 | 29 | return $static; 30 | } 31 | 32 | public function activeAccordion(int | Closure $activeAccordion): static 33 | { 34 | $this->activeAccordion = $activeAccordion; 35 | 36 | return $this; 37 | } 38 | 39 | public function getActiveAccordion(): int 40 | { 41 | return $this->evaluate($this->activeAccordion); 42 | } 43 | 44 | public function accordions(array | Closure $accordions): static 45 | { 46 | if (is_array($accordions)) { 47 | $accordions = array_filter($accordions); 48 | } 49 | 50 | $this->childComponents($accordions); 51 | 52 | return $this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Infolists/Accordion.php: -------------------------------------------------------------------------------- 1 | label($label); 21 | $this->id(Str::slug($label)); 22 | } 23 | 24 | public function getId(): string 25 | { 26 | return $this->getContainer()->getParentComponent()->getId() . '-' . parent::getId() . '-accordion'; 27 | } 28 | 29 | public function getColumnsConfig(): array 30 | { 31 | return $this->columns ?? $this->getContainer()->getColumnsConfig(); 32 | } 33 | 34 | public static function make(string | Closure | null $label = null): static 35 | { 36 | $static = app(static::class, ['label' => $label]); 37 | $static->configure(); 38 | 39 | return $static; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Infolists/Accordions.php: -------------------------------------------------------------------------------- 1 | label($label); 22 | } 23 | 24 | public static function make(?string $label = null): static 25 | { 26 | $static = app(static::class, ['label' => $label]); 27 | $static->configure(); 28 | 29 | return $static; 30 | } 31 | 32 | public function activeAccordion(int | Closure $activeAccordion): static 33 | { 34 | $this->activeAccordion = $activeAccordion; 35 | 36 | return $this; 37 | } 38 | 39 | public function getActiveAccordion(): int 40 | { 41 | return $this->evaluate($this->activeAccordion); 42 | } 43 | 44 | public function accordions(array | Closure $accordions): static 45 | { 46 | $this->childComponents($accordions); 47 | 48 | return $this; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | const colors = require('tailwindcss/colors') 2 | 3 | const plugin = require('tailwindcss/plugin') 4 | 5 | module.exports = { 6 | presets: [preset], 7 | content: [ 8 | //App 9 | './resources/views/**/*.blade.php', 10 | './vendor/lara-zeus/core/resources/views/**/*.blade.php', 11 | './vendor/lara-zeus/core/src/CoreServiceProvider.php', 12 | './vendor/awcodes/preset-color-picker/resources/**/*.blade.php', 13 | 14 | './vendor/lara-zeus/wind/resources/views/**/*.blade.php', 15 | './vendor/lara-zeus/wind/src/Filament/Resources/LetterResource.php', 16 | './vendor/lara-zeus/wind/src/Livewire/ContactsForm.php', 17 | 18 | './vendor/lara-zeus/replies/resources/views/**/*.blade.php', 19 | 20 | './vendor/lara-zeus/sky/resources/views/**/*.blade.php', 21 | './vendor/lara-zeus/sky/src/Models/PostStatus.php', 22 | 23 | './vendor/lara-zeus/bolt/resources/views/**/*.blade.php', 24 | 25 | './vendor/lara-zeus/thunder/resources/views/**/*.blade.php', 26 | './vendor/lara-zeus/thunder/src/Models/TicketsStatus.php', 27 | './vendor/lara-zeus/thunder/src/Filament/Resources/TicketResource.php', 28 | 29 | './vendor/lara-zeus/athena/resources/views/**/*.blade.php', 30 | 31 | './vendor/lara-zeus/artemis/resources/views/**/*.blade.php', 32 | 33 | './vendor/lara-zeus/quantity/resources/views/**/*.blade.php', 34 | 35 | './vendor/lara-zeus/dynamic-dashboard/resources/views/**/*.blade.php', 36 | './vendor/lara-zeus/dynamic-dashboard/src/Models/Columns.php', 37 | 38 | './vendor/lara-zeus/rhea/resources/views/**/*.blade.php', 39 | 40 | // hermes 41 | './vendor/lara-zeus/hermes/resources/views/**/*.blade.php', 42 | 43 | // Bolt Pro 44 | './vendor/lara-zeus/bolt-pro/resources/views/**/*.blade.php', 45 | './vendor/sawirricardo/filament-nouislider/resources/views/forms/components/nouislider.blade.php', 46 | 47 | // matrix-choice 48 | './vendor/lara-zeus/matrix-choice/resources/views/**/*.blade.php', 49 | './vendor/lara-zeus/accordion/resources/views/**/*.blade.php', 50 | './vendor/lara-zeus/list-group/resources/views/**/*.blade.php', 51 | 52 | // helen 53 | './vendor/lara-zeus/helen/resources/views/**/*.blade.php', 54 | './vendor/lara-zeus/helen/src/Filament/Resources/LinksResource.php', 55 | './vendor/lara-zeus/helen/src/Facades/Helen.php', 56 | 57 | // filament 58 | './app/Filament/**/*.php', 59 | './resources/views/filament/**/*.blade.php', 60 | './vendor/filament/**/*.blade.php', 61 | 62 | './vendor/awcodes/recently/resources/**/*.blade.php', 63 | './vendor/awcodes/filament-tiptap-editor/resources/**/*.blade.php', 64 | './vendor/awcodes/filament-versions/resources/**/*.blade.php', 65 | './vendor/awcodes/filament-quick-create/resources/**/*.blade.php', 66 | './vendor/awcodes/overlook/resources/**/*.blade.php', 67 | './vendor/ryangjchandler/filament-navigation/resources/**/*.blade.php', 68 | './vendor/wire-elements/spotlight/resources/views/spotlight.blade.php', 69 | './vendor/awcodes/filament-curator/resources/**/*.blade.php', 70 | './vendor/archilex/filament-filter-sets/**/*.php', 71 | './vendor/bezhansalleh/filament-panel-switch/resources/views/panel-switch-menu.blade.php', 72 | './vendor/jaocero/radio-deck/resources/views/**/*.blade.php', 73 | './vendor/jaocero/activity-timeline/resources/views/**/*.blade.php', 74 | ], 75 | darkMode: 'class', 76 | theme: { 77 | extend: { 78 | colors: { 79 | primary: { 80 | DEFAULT: '#45B39D', 81 | 50: '#C6E9E2', 82 | 100: '#B8E4DB', 83 | 200: '#9AD8CC', 84 | 300: '#7DCDBD', 85 | 400: '#5FC1AE', 86 | 500: '#45B39D', 87 | 600: '#358B79', 88 | 700: '#266256', 89 | 800: '#163A32', 90 | 900: '#07110F', 91 | 950: '#000000' 92 | }, 93 | secondary: { 94 | DEFAULT: '#F1948A', 95 | 50: '#FDF2F0', 96 | 100: '#FCE7E5', 97 | 200: '#F9D2CE', 98 | 300: '#F6BEB8', 99 | 400: '#F4A9A1', 100 | 500: '#F1948A', 101 | 600: '#EB6658', 102 | 700: '#E53826', 103 | 800: '#BC2717', 104 | 900: '#8A1C11', 105 | 950: '#71170E' 106 | }, 107 | danger: colors.red, 108 | success: colors.green, 109 | warning: colors.yellow, 110 | info: colors.blue, 111 | } 112 | }, 113 | }, 114 | plugins: [ 115 | plugin(function ({addUtilities, addComponents, e, config}) { 116 | const sketchyBorders = { 117 | '.border-sketchy-sm': { 118 | borderRadius: '255px 25px 225px 25px/25px 225px 25px 255px', 119 | transition: 'all 0.3s ease-in-out' 120 | }, 121 | '.border-sketchy-md': { 122 | borderRadius: '25px 55px 10px 45px/85px 20px 55px 20px', 123 | transition: 'all 0.3s ease-in-out' 124 | }, 125 | '.border-sketchy-lg': { 126 | borderRadius: '5px 55px 25px 25px/85px 20px 55px 20px', 127 | transition: 'all 0.3s ease-in-out' 128 | }, 129 | } 130 | 131 | addUtilities(sketchyBorders, { 132 | variants: ['responsive', 'hover'], 133 | }) 134 | }), 135 | require('tailwindcss-debug-screens'), 136 | ], 137 | } 138 | --------------------------------------------------------------------------------