Skip to content

Commit

Permalink
Added x-bind for alpine | Fix format exmaples
Browse files Browse the repository at this point in the history
  • Loading branch information
Roene-JustBetter committed Sep 6, 2024
1 parent a6588f8 commit 6733751
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
11 changes: 7 additions & 4 deletions resources/views/components/button/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
when you add a for on the button the button will be a <label>.
If the button doesn't have a href or label it will be a <button>
Examples:
```
<x-rapidez::button href="something">Something</x-rapidez::button>
<x-rapidez::button href="something">Something</x-rapidez::button>
```
```
<x-rapidez::button for="something">Something</x-rapidez::button>
<x-rapidez::button for="something">Something</x-rapidez::button>
```
```
<x-rapidez::button>Something</x-rapidez::button>
<x-rapidez::button>Something</x-rapidez::button>
```
--}}
@php
$tag = $attributes->hasAny('href', ':href', 'v-bind:href') ? 'a' : 'button';
$tag = $attributes->hasAny('href', ':href', 'v-bind:href', 'x-bind:href') ? 'a' : 'button';
$tag = $attributes->has('for') ? 'label' : $tag;
@endphp

Expand Down
3 changes: 2 additions & 1 deletion resources/views/components/button/enhanced.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
This is the enhanced button the button can be used for the add to cart buttons
and it can be used inside the checkout.
Example:
```
<x-rapidez::button.enhanced>Something</x-rapidez::button.enhanced>
<x-rapidez::button.enhanced>Something</x-rapidez::button.enhanced>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-enhanced text-white border-b border-black/15') }}>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/components/button/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{--
This is the default button if you use the example you get this.
Example:
```
<x-rapidez::button>Something</x-rapidez::button>
<x-rapidez::button>Something</x-rapidez::button>
```
--}}
<x-rapidez::button.base {{ $attributes->twMerge('relative inline-flex items-center justify-center transition text-white bg-neutral text-base font-medium rounded min-h-12 py-1.5 px-5 hover:bg-opacity-80 border-b border-black/15 disabled:text-inactive disabled:bg-disabled disabled:cursor-not-allowed') }}>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/components/button/outline.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{--
This is an outline button so it doesn't need a background and only need a border.
Example:
```
<x-rapidez::button.outline>Something</x-rapidez::button.outline>
<x-rapidez::button.outline>Something</x-rapidez::button.outline>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-transparent border text-neutral hover:border-neutral') }}>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/components/button/primary.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{--
This is the primary button.
Example:
```
<x-rapidez::button.primary>Something</x-rapidez::button.primary>
<x-rapidez::button.primary>Something</x-rapidez::button.primary>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-primary text-white border-b border-black/15') }}>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/components/button/slider.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{--
This button is used for sliders.
Example:
```
<x-rapidez::button.slider>Icon</x-rapidez::button.slider>
<x-rapidez::button.slider>Icon</x-rapidez::button.slider>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('inline-flex bg-white p-0 rounded-full size-14 items-center justify-center shadow bg-white text-neutral border') }}>
Expand Down

0 comments on commit 6733751

Please sign in to comment.