forked from huntabyte/bits-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal refactors & update melt version (huntabyte#141)
- Loading branch information
Showing
164 changed files
with
1,538 additions
and
1,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"bits-ui": patch | ||
--- | ||
|
||
Update Melt UI to v0.57.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
<script lang="ts"> | ||
import * as RadioGroup from "@/components/ui/radio-group"; | ||
import * as Label from "@/components/ui/label"; | ||
import { RadioGroup, Label } from "$lib"; | ||
</script> | ||
|
||
<RadioGroup.Root value="comfortable"> | ||
<div class="flex items-center space-x-2"> | ||
<RadioGroup.Item value="default" id="r1" /> | ||
<Label.Root for="r1">Default</Label.Root> | ||
<RadioGroup.Root class="flex flex-col gap-3"> | ||
<div | ||
class="group select-none cursor-pointer flex items-center gap-3 text-primary/50 [&:has([data-state=checked])]:text-primary transition-colors" | ||
> | ||
<RadioGroup.Item | ||
id="amazing" | ||
value="amazing" | ||
class="shrink-0 sq-5 rounded-full border-2 border-primary/40 transition-all data-[state=checked]:group-hover:border-primary data-[state=checked]:border-6 data-[state=checked]:border-primary duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-background/70 ring-offset-1" | ||
/> | ||
<Label.Root for="amazing" class="font-medium text-sm">Amazing</Label.Root> | ||
</div> | ||
<div class="flex items-center space-x-2"> | ||
<RadioGroup.Item value="comfortable" id="r2" /> | ||
<Label.Root for="r2">Comfortable</Label.Root> | ||
<div | ||
class="group select-none cursor-pointer flex items-center gap-3 text-primary/50 [&:has([data-state=checked])]:text-primary transition-colors" | ||
> | ||
<RadioGroup.Item | ||
id="average" | ||
value="average" | ||
class="shrink-0 sq-5 rounded-full border-2 border-primary/40 transition-all data-[state=checked]:group-hover:border-primary data-[state=checked]:border-6 data-[state=checked]:border-primary duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-background/70 ring-offset-1 " | ||
/> | ||
<Label.Root for="average" class="font-medium text-sm">Average</Label.Root> | ||
</div> | ||
<div class="flex items-center space-x-2"> | ||
<RadioGroup.Item value="compact" id="r3" /> | ||
<Label.Root for="r3">Compact</Label.Root> | ||
<div | ||
class="group select-none cursor-pointer flex items-center gap-3 text-primary/50 [&:has([data-state=checked])]:text-primary transition-colors" | ||
> | ||
<RadioGroup.Item | ||
id="terrible" | ||
value="terrible" | ||
class="shrink-0 sq-5 rounded-full border-2 border-primary/40 transition-all data-[state=checked]:group-hover:border-primary data-[state=checked]:border-6 data-[state=checked]:border-primary duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-background/70 ring-offset-1" | ||
/> | ||
<Label.Root for="terrible" class="font-medium text-sm">Terrible</Label.Root> | ||
</div> | ||
<RadioGroup.Input name="spacing" /> | ||
</RadioGroup.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
<script lang="ts"> | ||
import * as Label from "@/components/ui/label"; | ||
import * as Switch from "@/components/ui/switch"; | ||
import { Switch, Label } from "$lib"; | ||
</script> | ||
|
||
<div class="flex items-center space-x-2"> | ||
<Switch.Root id="airplane-mode" /> | ||
<Label.Root for="airplane-mode">Airplane Mode</Label.Root> | ||
<Switch.Root | ||
id="airplane-mode" | ||
class="peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-primary/60" | ||
> | ||
<Switch.Thumb | ||
class="pointer-events-none relative inline-block h-4 w-4 rounded-full data-[state=unchecked]:bg-accent shadow-lg ring-0 transition-all transform data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-4 ease-in-out data-[state=checked]:bg-background" | ||
/> | ||
</Switch.Root> | ||
<Label.Root for="airplane-mode" class="text-sm font-medium">Airplane Mode</Label.Root> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { Switch } from "@/lib"; | ||
import { cn } from "@/utils"; | ||
type $$Props = Switch.Props; | ||
type $$Events = Switch.Events; | ||
let className: $$Props["class"] = undefined; | ||
export let checked: $$Props["checked"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<Switch.Root | ||
bind:checked | ||
class={cn( | ||
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-primary/60", | ||
className | ||
)} | ||
on:click | ||
on:keydown | ||
> | ||
<Switch.Thumb | ||
class={cn( | ||
"pointer-events-none relative inline-block h-4 w-4 rounded-full data-[state=unchecked]:bg-accent shadow-lg ring-0 transition-all transform data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-4 ease-in-out data-[state=checked]:bg-background" | ||
)} | ||
/> | ||
</Switch.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.