Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed buttons #12

Merged
merged 35 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
281da14
Changed buttons and prevent scroll
jordythevulder Dec 17, 2024
2bf6747
Update demo
jordythevulder Dec 17, 2024
4b2b795
Changed readme with overflow clip
jordythevulder Dec 19, 2024
6421ac0
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Dec 19, 2024
2968649
Finetuned styling and added muted variant
jordythevulder Dec 19, 2024
490c4a5
Update demo
jordythevulder Dec 19, 2024
0c628c4
Changed overflow hidden to clip comment
jordythevulder Dec 19, 2024
54cca17
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Dec 19, 2024
5b7b661
Changed comment within muted button
jordythevulder Dec 19, 2024
d9caf64
Merge branch 'master' of github.com:rapidez/blade-components into fea…
jordythevulder Jan 13, 2025
ec3dc20
Removed inactive color variant
jordythevulder Jan 13, 2025
0330e9f
Update demo
jordythevulder Jan 13, 2025
22745f3
Updated readme and added base classes on buttons
jordythevulder Jan 13, 2025
48b583f
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Jan 13, 2025
4661911
Update demo
jordythevulder Jan 13, 2025
8950fdd
erge branch 'master' of github.com:rapidez/blade-components into feat…
jordythevulder Jan 14, 2025
7b3e1c6
Changed border colors to have more contrast
jordythevulder Jan 14, 2025
4caf8db
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Jan 14, 2025
7770c69
Update demo
jordythevulder Jan 14, 2025
f47f833
Removed slideover duplicate
jordythevulder Jan 14, 2025
ee6a873
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Jan 14, 2025
403b161
Renamed base to tag and button to base
jordythevulder Jan 14, 2025
2fb7309
Update demo
jordythevulder Jan 14, 2025
8868ed1
Removed muted variant and remove border changes
jordythevulder Jan 15, 2025
ce4a1a9
Removed border contrast
jordythevulder Jan 15, 2025
c345483
Update demo
jordythevulder Jan 15, 2025
5d64d97
Small content tweaks
jordythevulder Jan 21, 2025
58d0eae
Resolved Merge conflict
jordythevulder Jan 28, 2025
d06c67d
Update demo
jordythevulder Jan 28, 2025
ace2c37
Changed back preview image with default button variant
jordythevulder Jan 28, 2025
8f2e470
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Jan 28, 2025
515a440
Update demo
jordythevulder Jan 28, 2025
e842383
Merge branch 'master' of github.com:rapidez/blade-components into fea…
jordythevulder Jan 28, 2025
9e8a0bb
Merge branch 'feature/v3-colors-and-tweaks' of github.com:rapidez/bla…
jordythevulder Jan 28, 2025
96f4727
Removed muted
jordythevulder Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/media/buttons.png
royduin marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The base button doesn't have any styling; here, we only use the `x-rapidez::tag`
- [Outline](https://github.com/rapidez/blade-components/blob/master/resources/views/components/button/outline.blade.php)
- [Conversion](https://github.com/rapidez/blade-components/blob/master/resources/views/components/button/conversion.blade.php)
- [Slider](https://github.com/rapidez/blade-components/blob/master/resources/views/components/button/slider.blade.php)
- [Muted](https://github.com/rapidez/blade-components/blob/master/resources/views/components/button/muted.blade.php)
jordythevulder marked this conversation as resolved.
Show resolved Hide resolved


## Installation

Expand Down Expand Up @@ -63,8 +65,8 @@ colors: {
muted: color('--foreground-muted', colors.slate[600]),
},
border: {
emphasis: color('--border-emphasis', colors.slate[500]),
DEFAULT: color('--border', colors.slate[200]),
emphasis: color('--border-emphasis', colors.slate[400]),
DEFAULT: color('--border', colors.slate[300]),
jordythevulder marked this conversation as resolved.
Show resolved Hide resolved
muted: color('--border-muted', colors.slate[100]),
},
background: {
Expand Down Expand Up @@ -172,24 +174,6 @@ Make sure to add this class to your body tag to prevent scrolling when the slide
<body class="has-[.prevent-scroll:checked]:overflow-clip">
```

#### Slideover

```blade
<label for="my-slideover">
Open Slideover
</label>

<x-rapidez::slideover id="my-slideover" title="Example Slideover">
Your slideover content goes here
</x-rapidez::slideover>
```

Make sure to add this class to your body tag to prevent scrolling when the slideover is open:

```html
<body class="has-[.slideover-checkbox:checked]:overflow-hidden">
```

#### Tag

It is a Blade version of a [dynamic Vue component](https://vuejs.org/guide/essentials/component-basics.html#dynamic-components)
Expand Down
44 changes: 22 additions & 22 deletions demo/components.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions resources/views/components-preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function color(variable, fallback) {
muted: color('--foreground-muted', tailwind.colors.slate[600]),
},
border: {
emphasis: color('--border-emphasis', tailwind.colors.slate[500]),
DEFAULT: color('--border', tailwind.colors.slate[200]),
emphasis: color('--border-emphasis', tailwind.colors.slate[400]),
DEFAULT: color('--border', tailwind.colors.slate[300]),
muted: color('--border-muted', tailwind.colors.slate[100]),
},
background: {
Expand Down Expand Up @@ -185,7 +185,7 @@ function color(variable, fallback) {

<h2 class="font-bold text-lg">Button components</h2>
<div class="grid grid-cols-5 gap-5">
<x-rapidez::button>Button</x-rapidez::button>
royduin marked this conversation as resolved.
Show resolved Hide resolved
<x-rapidez::button>Default</x-rapidez::button>
<x-rapidez::button.primary>Primary</x-rapidez::button.primary>
<x-rapidez::button.secondary>Secondary</x-rapidez::button.secondary>
<x-rapidez::button.outline>Outline</x-rapidez::button.outline>
Expand Down
28 changes: 5 additions & 23 deletions resources/views/components/button/base.blade.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
{{--
This is the base for all the buttons. In here we don't need classes.
If you want to change styling for buttons go to the button/button.
- `href` attribute results in an `<a>`
- `for` attribute results in a `<label>`
- Fallback/default is `<button>`
Examples:

```
<x-rapidez::button href="something">Something</x-rapidez::button>
```

```
<x-rapidez::button for="something">Something</x-rapidez::button>
```
This is the default button if you use the example you get this.
It is not recommended to use this button. Make use of the other buttons. ie: `button/primary`
Example:

```
<x-rapidez::button>Something</x-rapidez::button>
```
--}}
@props(['tag' => 'button'])

@php
$tag = $attributes->hasAny('href', ':href', 'v-bind:href', 'x-bind:href') ? 'a' : $tag;
$tag = $attributes->has('for') ? 'label' : $tag;
@endphp

<x-rapidez::tag is="{{ $tag }}" {{ $attributes }}>
<x-rapidez::button.tag {{ $attributes->twMerge('inline-flex items-center justify-center transition font-medium text-base rounded min-h-12 py-1.5 px-5 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer gap-x-1.5') }}>
{{ $slot }}
</x-rapidez::tag>
</x-rapidez::button.tag>
10 changes: 4 additions & 6 deletions resources/views/components/button/button.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{{--
This is the default button if you use the example you get this.
It is not recommended to use this button. Make use of the other buttons. ie: `button/primary`
The muted button is a variant used for basic use cases.
Example:

```
<x-rapidez::button>Something</x-rapidez::button>
<x-rapidez::button.muted>Something</x-rapidez::button.muted>
```
--}}
<x-rapidez::button.base {{ $attributes->twMerge('relative inline-flex items-center justify-center text transition bg text-base font-medium rounded min-h-12 py-1.5 px-5 hover:bg-opacity-80 border-b border-b-black/15 disabled:text-muted disabled:bg-muted disabled:cursor-not-allowed') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg text-muted hover:text hover:bg-emphasis border-b border-b-black/10') }}>
{{ $slot }}
</x-rapidez::button.base>
</x-rapidez::button.base>
4 changes: 2 additions & 2 deletions resources/views/components/button/conversion.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<x-rapidez::button.conversion>Something</x-rapidez::button.conversion>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-conversion text-conversion-text') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg-conversion hover:bg-opacity-80 text-conversion-text border-b border-b-black/20') }}>
{{ $slot }}
</x-rapidez::button>
</x-rapidez::button.base>
4 changes: 2 additions & 2 deletions resources/views/components/button/outline.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<x-rapidez::button.outline>Something</x-rapidez::button.outline>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-transparent border text-default hover:border-emphasis') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg-transparent border text-default hover:border-emphasis') }}>
{{ $slot }}
</x-rapidez::button>
</x-rapidez::button.base>
4 changes: 2 additions & 2 deletions resources/views/components/button/primary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<x-rapidez::button.primary>Something</x-rapidez::button.primary>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-primary text-primary-text') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg-primary text-primary-text border-b border-b-black/20 hover:bg-opacity-80') }}>
{{ $slot }}
</x-rapidez::button>
</x-rapidez::button.base>
4 changes: 2 additions & 2 deletions resources/views/components/button/secondary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<x-rapidez::button.secondary>Something</x-rapidez::button.secondary>
```
--}}
<x-rapidez::button {{ $attributes->twMerge('bg-secondary text-secondary-text') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg-secondary text-secondary-text border-b border-b-black/20 hover:bg-opacity-80') }}>
{{ $slot }}
</x-rapidez::button>
</x-rapidez::button.base>
4 changes: 2 additions & 2 deletions resources/views/components/button/slider.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<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 text-default border') }}>
<x-rapidez::button.base {{ $attributes->twMerge('bg-white p-0 rounded-full size-12 border hover:border-emphasis') }}>
{{ $slot }}
</x-rapidez::button>
</x-rapidez::button.base>
30 changes: 30 additions & 0 deletions resources/views/components/button/tag.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{--
This is the base for all the buttons. In here we don't need classes.
If you want to change styling for buttons go to the button/button.
- `href` attribute results in an `<a>`
- `for` attribute results in a `<label>`
- Fallback/default is `<button>`
Examples:

```
<x-rapidez::button href="something">Something</x-rapidez::button>
```

```
<x-rapidez::button for="something">Something</x-rapidez::button>
```

```
<x-rapidez::button>Something</x-rapidez::button>
```
--}}
@props(['tag' => 'button'])

@php
$tag = $attributes->hasAny('href', ':href', 'v-bind:href', 'x-bind:href') ? 'a' : $tag;
$tag = $attributes->has('for') ? 'label' : $tag;
@endphp

<x-rapidez::tag is="{{ $tag }}" {{ $attributes }}>
{{ $slot }}
</x-rapidez::tag>
2 changes: 1 addition & 1 deletion resources/views/components/input/input.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
</label>
```
--}}
<input {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-muted disabled:border-muted placeholder:text-inactive [&::-webkit-inner-spin-button]:appearance-none [&:user-invalid:not(:placeholder-shown)]:border-red-500') }} />
<input {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-emphasis disabled:border-emphasis placeholder:text-muted [&::-webkit-inner-spin-button]:appearance-none [&:user-invalid:not(:placeholder-shown)]:border-red-500') }} />
2 changes: 1 addition & 1 deletion resources/views/components/input/select/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
</label>
```
--}}
<select {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-muted disabled:border-muted placeholder:text-muted') }}>
<select {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-emphasis disabled:border-emphasis placeholder:text-muted') }}>
{{ $slot }}
</select>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
</label>
```
--}}
<textarea {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-muted disabled:border-muted placeholder:text-muted') }}>{{ $slot }}</textarea>
<textarea {{ $attributes->twMerge('w-full py-3 px-5 border border-default rounded-md outline-0 ring-0 text-sm transition-colors focus:ring-transparent focus:border-emphasis disabled:cursor-not-allowed disabled:bg-emphasis disabled:border-emphasis placeholder:text-muted') }}>{{ $slot }}</textarea>
Loading