Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 11 additions & 7 deletions resources/views/components/input/range-slider.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@props(['inputs' => true])
@props(['inputs' => true, 'labels' => true])
@slots(['value'])

<range-slider v-slot="{ _renderProxy: rangeInputScope, value, prefix, suffix }" {{ $attributes }}>
Expand Down Expand Up @@ -35,10 +35,10 @@ class="range-max absolute pointer-events-none appearance-none z-20 h-5 w-full op
<div class="absolute top-1/2 -translate-y-1/2 h-1 z-20 rounded-md bg-active" v-bind:style="'right:'+rangeInputScope.maxThumb+'%; left:'+rangeInputScope.minThumb+'%'"></div>
<div class="absolute z-30 size-4 top-1/2 left-0 bg-active rounded-full -translate-y-1/2 -translate-x-1/2 outline outline-transparent outline-1 outline-offset-1 group-has-[.range-min:focus]/range-slider:outline-emphasis" v-bind:style="'left: '+rangeInputScope.minThumb+'%'"></div>
<div class="absolute z-30 size-4 top-1/2 right-0 bg-active rounded-full -translate-y-1/2 translate-x-1/2 outline outline-transparent outline-1 outline-offset-1 group-has-[.range-max:focus]/range-slider:outline-emphasis" v-bind:style="'right: '+rangeInputScope.maxThumb+'%'"></div>
@if (!$inputs)
@if ($labels)
<div
class="absolute z-30 top-5 left-0 bg-active text-white px-2 py-0.5 rounded-md -translate-x-1/2"
v-bind:style="'left: '+rangeInputScope.minThumb+'%'"
class="absolute z-30 top-5 left-0 bg-active text-white px-2 py-0.5 rounded-md -translate-x-1/2 whitespace-nowrap"
v-bind:style="'left: '+rangeInputScope.minThumb+'%;--tw-translate-x:-'+rangeInputScope.minThumb+'%'"
v-bind:set="value = rangeInputScope.minValue"
>
@if ($value->isNotEmpty())
Expand All @@ -48,8 +48,8 @@ class="absolute z-30 top-5 left-0 bg-active text-white px-2 py-0.5 rounded-md -t
@endif
</div>
<div
class="absolute z-30 top-5 right-0 bg-active text-white px-2 py-0.5 rounded-md translate-x-1/2"
v-bind:style="'right: '+rangeInputScope.maxThumb+'%'"
class="absolute z-30 top-5 right-0 bg-active text-white px-2 py-0.5 rounded-md translate-x-1/2 whitespace-nowrap"
v-bind:style="'right: '+rangeInputScope.maxThumb+'%;--tw-translate-x:'+rangeInputScope.maxThumb+'%'"
v-bind:set="value = rangeInputScope.maxValue"
>
@if ($value->isNotEmpty())
Expand All @@ -62,7 +62,11 @@ class="absolute z-30 top-5 right-0 bg-active text-white px-2 py-0.5 rounded-md t
</div>
</div>
@if ($inputs)
<div class="flex items-center gap-x-4 mt-4">
<div @class([
'flex items-center gap-x-4',
'mt-4' => !$labels,
'mt-9' => $labels,
])>
<div class="relative w-full">
<x-rapidez::input
required
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look good. It should be the inputs or the labels not both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? @jordythevulder opinion? We can also just disable the extra labels by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit too much since the data is already show underneath within the inputs. What could make it better if that label only shows on :active when you drag the handle. Also it looks like the labels can phase in to eachother, can you double check that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that the :focus rings are clipped aswell, maybe that doesn't have to do with your pullrequest but could you create a internal story for that?

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.