From bfe71cfc962a69317b306ff7c87eb3235d2b4d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20M?= Date: Thu, 2 May 2024 18:38:26 +0200 Subject: [PATCH] feat: actions (#6) --- UPGRADING.md | 10 ++ composer.json | 2 +- config/wireuse.php | 22 +++ .../css/presets/tailwind.config.preset.js | 8 ++ resources/views/.gitkeep | 0 resources/views/actions/button.blade.php | 20 +++ resources/views/actions/icon.blade.php | 29 ++++ resources/views/actions/link.blade.php | 24 ++++ resources/views/auth/login.blade.php | 19 +++ resources/views/auth/logout.blade.php | 3 + resources/views/auth/register.blade.php | 3 + .../views/components/forms/actions.blade.php | 16 +++ .../views/components/forms/checkbox.blade.php | 15 +++ .../views/components/forms/input.blade.php | 53 ++++++++ .../views/components/forms/label.blade.php | 36 +++++ .../views/components/forms/messages.blade.php | 14 ++ .../views/components/forms/tags.blade.php | 84 ++++++++++++ resources/views/navigation/tabs.blade.php | 39 ++++++ src/Actions/Components/Button.php | 26 ++++ src/Actions/Components/Icon.php | 45 +++++++ src/Actions/Components/Link.php | 50 +++++++ src/Actions/Concerns/WithAction.php | 12 ++ src/Actions/Support/Action.php | 100 ++++++++++++++ src/Auth/Concerns/WithAuthentication.php | 10 ++ src/Auth/Controllers/LoginController.php | 53 ++++++++ src/Auth/Controllers/LogoutController.php | 36 +++++ src/Auth/Controllers/RegisterController.php | 39 ++++++ src/Auth/Forms/LoginForm.php | 45 +++++++ src/Auth/Forms/RegisterForm.php | 67 +++++++++ src/Facades/WireUse.php | 1 + src/Forms/Concerns/WithForm.php | 105 --------------- src/Forms/Concerns/WithThrottle.php | 4 +- src/Forms/Support/Form.php | 87 +++++++++++- src/Models/Concerns/WithQueryBuilder.php | 13 +- src/Models/Forms/CreateForm.php | 29 ---- src/Models/Forms/UpdateForm.php | 34 ----- src/Navigation/Components/Tabs.php | 25 ++++ src/Navigation/Concerns/WithTabs.php | 37 +++++ src/States/Concerns/WithState.php | 12 ++ src/States/Support/State.php | 10 ++ src/Support/Blade/Bladeable.php | 38 +++++- src/Support/Components/Component.php | 24 ++++ .../Components/Concerns/HasComponent.php | 30 +++++ src/Support/Components/Concerns/HasIcon.php | 30 +++++ src/Support/Components/Concerns/HasLabel.php | 18 +++ .../Components/Concerns/HasLivewire.php | 37 +++++ src/Support/Components/Concerns/HasName.php | 18 +++ src/Support/Components/Concerns/HasNodes.php | 55 ++++++++ .../Components/Concerns/HasRequest.php | 30 +++++ .../Components/Concerns/HasRouting.php | 57 ++++++++ src/Support/Components/Concerns/HasState.php | 30 +++++ .../Components/Concerns/HasVisibility.php | 30 +++++ src/Support/Concerns/WithHooks.php | 6 +- src/Support/Discover/ComponentScout.php | 2 +- .../ActionObjects/ActionObjectSynth.php | 37 +++++ .../ActionObjects/SupportActionObjects.php | 15 +++ src/Support/Livewire/StateObjects/State.php | 4 +- src/Views/Concerns/WithLayout.php | 15 +++ src/Views/Concerns/WithLivewire.php | 2 +- .../Concerns/WithRateLimiter.php} | 4 +- src/Views/Support/Component.php | 6 + src/Views/Support/Page.php | 4 - src/WireUse.php | 13 ++ src/WireUseServiceProvider.php | 127 ++++++++++++------ 64 files changed, 1626 insertions(+), 243 deletions(-) create mode 100644 UPGRADING.md create mode 100644 resources/css/presets/tailwind.config.preset.js create mode 100644 resources/views/.gitkeep create mode 100644 resources/views/actions/button.blade.php create mode 100644 resources/views/actions/icon.blade.php create mode 100644 resources/views/actions/link.blade.php create mode 100644 resources/views/auth/login.blade.php create mode 100644 resources/views/auth/logout.blade.php create mode 100644 resources/views/auth/register.blade.php create mode 100644 resources/views/components/forms/actions.blade.php create mode 100644 resources/views/components/forms/checkbox.blade.php create mode 100644 resources/views/components/forms/input.blade.php create mode 100644 resources/views/components/forms/label.blade.php create mode 100644 resources/views/components/forms/messages.blade.php create mode 100644 resources/views/components/forms/tags.blade.php create mode 100644 resources/views/navigation/tabs.blade.php create mode 100644 src/Actions/Components/Button.php create mode 100644 src/Actions/Components/Icon.php create mode 100644 src/Actions/Components/Link.php create mode 100644 src/Actions/Concerns/WithAction.php create mode 100644 src/Actions/Support/Action.php create mode 100644 src/Auth/Controllers/LoginController.php create mode 100644 src/Auth/Controllers/LogoutController.php create mode 100644 src/Auth/Controllers/RegisterController.php create mode 100644 src/Auth/Forms/LoginForm.php create mode 100644 src/Auth/Forms/RegisterForm.php delete mode 100644 src/Forms/Concerns/WithForm.php delete mode 100644 src/Models/Forms/CreateForm.php delete mode 100644 src/Models/Forms/UpdateForm.php create mode 100644 src/Navigation/Components/Tabs.php create mode 100644 src/Navigation/Concerns/WithTabs.php create mode 100644 src/States/Concerns/WithState.php create mode 100644 src/States/Support/State.php create mode 100644 src/Support/Components/Component.php create mode 100644 src/Support/Components/Concerns/HasComponent.php create mode 100644 src/Support/Components/Concerns/HasIcon.php create mode 100644 src/Support/Components/Concerns/HasLabel.php create mode 100644 src/Support/Components/Concerns/HasLivewire.php create mode 100644 src/Support/Components/Concerns/HasName.php create mode 100644 src/Support/Components/Concerns/HasNodes.php create mode 100644 src/Support/Components/Concerns/HasRequest.php create mode 100644 src/Support/Components/Concerns/HasRouting.php create mode 100644 src/Support/Components/Concerns/HasState.php create mode 100644 src/Support/Components/Concerns/HasVisibility.php create mode 100644 src/Support/Livewire/ActionObjects/ActionObjectSynth.php create mode 100644 src/Support/Livewire/ActionObjects/SupportActionObjects.php create mode 100644 src/Views/Concerns/WithLayout.php rename src/{Support/Concerns/WithRateLimiting.php => Views/Concerns/WithRateLimiter.php} (95%) diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 00000000..48446df2 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,10 @@ +# Upgrading + +Because there are many breaking changes an upgrade is not that easy. There are many edge cases this guide does not cover. We accept PRs to improve this guide. + +## From v0 to v1 + +- It now includes a basic set of components. It can optionally be disabled in `config/wireuse.php`. +- The `classFor` behavior has been changed. You now need to specify the class attribute: `