Skip to content

Commit

Permalink
Update Melt UI version (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 25, 2023
1 parent aa34a0b commit 8189bde
Show file tree
Hide file tree
Showing 19 changed files with 80 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-poems-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": minor
---

Update Melt UI version & include new `openFocus` & `closeFocus` props
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^\\$\\$(Props|Events|Slots|Generic)$"
}
]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"@melt-ui/svelte": "0.55.3",
"nanoid": "^4.0.2"
"@melt-ui/svelte": "0.56.0",
"nanoid": "^5.0.2"
},
"peerDependencies": {
"svelte": "^4.0.0"
Expand Down
24 changes: 15 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/navigation/sidebar-nav-main-items.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const iconMap = {
Introduction: BookOpen,
"Getting Started": RocketLaunch,
"Render Delegation": Code
Delegation: Code
} as const;
const iconMapKeys = Object.keys(iconMap) as (keyof typeof iconMap)[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/site-header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</script>

<header class="bg-background/75 backdrop-blur border-b border-border -mb-px sticky top-0 z-50">
<div class="mx-auto px-4 sm:px-6 lg:px-8 container">
<div class="mx-auto px-4 container">
<div class="flex items-center justify-between gap-3 h-16">
<div class="flex items-center gap-1.5">
<MobileNav />
Expand Down
4 changes: 2 additions & 2 deletions src/config/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const navigation: Navigation = {
items: []
},
{
title: "Render Delegation",
href: "/docs/render-delegation",
title: "Delegation",
href: "/docs/delegation",
items: []
}
]
Expand Down
3 changes: 2 additions & 1 deletion src/content/api-reference/dropdown-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export const item: APISchema = {
{
name: "href",
type: "string",
description: "An optional prop that when passed converts the dropdown item into an anchor tag."
description:
"An optional prop that when passed converts the dropdown item into an anchor tag."
}
],
dataAttributes: [
Expand Down
3 changes: 1 addition & 2 deletions src/content/api-reference/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export const asChild = {
name: "asChild",
type: "boolean",
default: "false",
description:
"Whether to use [render delegation](/docs/render-delegation) with this component or not."
description: "Whether to use [render delegation](/docs/delegation) with this component or not."
};
2 changes: 1 addition & 1 deletion src/lib/bits/alert-dialog/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { CustomEventHandler } from "$lib/index.js";

type Props = Expand<
OmitOpen<Omit<CreateDialogProps, "role">> & {
open?: boolean & {};
open?: boolean;
onOpenChange?: OnChangeFn<boolean>;
}
>;
Expand Down
9 changes: 9 additions & 0 deletions src/lib/bits/context-menu/components/ContextMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
export let positioning: $$Props["positioning"] = undefined;
export let loop: $$Props["loop"] = undefined;
export let dir: $$Props["dir"] = undefined;
export let typeahead: $$Props["typeahead"] = undefined;
export let closeFocus: $$Props["closeFocus"] = undefined;
export let disableFocusFirstItem: $$Props["disableFocusFirstItem"] = undefined;
const {
states: { open: localOpen },
Expand All @@ -29,6 +32,9 @@
positioning,
loop,
dir,
typeahead,
disableFocusFirstItem,
closeFocus,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -49,6 +55,9 @@
$: updateOption("positioning", positioning);
$: updateOption("loop", loop);
$: updateOption("dir", dir);
$: updateOption("closeFocus", closeFocus);
$: updateOption("disableFocusFirstItem", disableFocusFirstItem);
$: updateOption("typeahead", typeahead);
</script>

<slot />
6 changes: 6 additions & 0 deletions src/lib/bits/dialog/components/Dialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
export let forceVisible: $$Props["forceVisible"] = true;
export let open: $$Props["open"] = undefined;
export let onOpenChange: $$Props["onOpenChange"] = undefined;
export let openFocus: $$Props["openFocus"] = undefined;
export let closeFocus: $$Props["closeFocus"] = undefined;
const transitionTimes = writable<TransitionTimes>({});
const tOpen = writable(open);
Expand All @@ -30,6 +32,8 @@
defaultOpen: open,
transitionTimes,
tOpen,
openFocus,
closeFocus,
onOpenChange: ({ next }) => {
if (!isBrowser) {
return next;
Expand Down Expand Up @@ -72,6 +76,8 @@
$: updateOption("closeOnOutsideClick", closeOnOutsideClick);
$: updateOption("portal", portal);
$: updateOption("forceVisible", forceVisible);
$: updateOption("openFocus", openFocus);
$: updateOption("closeFocus", closeFocus);
</script>

<slot />
9 changes: 9 additions & 0 deletions src/lib/bits/dropdown-menu/components/DropdownMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
export let positioning: $$Props["positioning"] = undefined;
export let loop: $$Props["loop"] = undefined;
export let dir: $$Props["dir"] = undefined;
export let typeahead: $$Props["typeahead"] = undefined;
export let closeFocus: $$Props["closeFocus"] = undefined;
export let disableFocusFirstItem: $$Props["disableFocusFirstItem"] = undefined;
const {
states: { open: localOpen },
Expand All @@ -29,6 +32,9 @@
positioning,
loop,
dir,
typeahead,
closeFocus,
disableFocusFirstItem,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -48,6 +54,9 @@
$: updateOption("positioning", positioning);
$: updateOption("loop", loop);
$: updateOption("dir", dir);
$: updateOption("closeFocus", closeFocus);
$: updateOption("disableFocusFirstItem", disableFocusFirstItem);
$: updateOption("typeahead", typeahead);
</script>

<slot />
9 changes: 9 additions & 0 deletions src/lib/bits/menubar/components/MenubarMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
export let positioning: $$Props["positioning"] = undefined;
export let loop: $$Props["loop"] = undefined;
export let dir: $$Props["dir"] = undefined;
export let typeahead: $$Props["typeahead"] = undefined;
export let closeFocus: $$Props["closeFocus"] = undefined;
export let disableFocusFirstItem: $$Props["disableFocusFirstItem"] = undefined;
const {
states: { open: localOpen },
Expand All @@ -26,6 +29,9 @@
positioning,
loop,
dir,
typeahead,
closeFocus,
disableFocusFirstItem,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -44,6 +50,9 @@
$: updateOption("positioning", positioning);
$: updateOption("loop", loop);
$: updateOption("dir", dir);
$: updateOption("closeFocus", closeFocus);
$: updateOption("disableFocusFirstItem", disableFocusFirstItem);
$: updateOption("typeahead", typeahead);
</script>

<slot />
6 changes: 6 additions & 0 deletions src/lib/bits/popover/components/Popover.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
export let portal: $$Props["portal"] = undefined;
export let open: $$Props["open"] = undefined;
export let onOpenChange: $$Props["onOpenChange"] = undefined;
export let openFocus: $$Props["openFocus"] = undefined;
export let closeFocus: $$Props["closeFocus"] = undefined;
const {
updateOption,
Expand All @@ -25,6 +27,8 @@
preventScroll,
portal,
defaultOpen: open,
openFocus,
closeFocus,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -42,6 +46,8 @@
$: updateOption("closeOnOutsideClick", closeOnOutsideClick);
$: updateOption("preventScroll", preventScroll);
$: updateOption("portal", portal);
$: updateOption("openFocus", openFocus);
$: updateOption("closeFocus", closeFocus);
</script>

<slot />
4 changes: 2 additions & 2 deletions src/lib/bits/slider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type { HTMLInputAttributes } from "svelte/elements";

type Props = Expand<
OmitValue<CreateSliderProps> & {
value?: CreateSliderProps["defaultValue"] & {};
onValueChange?: OnChangeFn<CreateSliderProps["defaultValue"]>;
value?: number[];
onValueChange?: OnChangeFn<number[]>;
} & AsChild
> &
HTMLSpanAttributes;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/bits/tooltip/components/Tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
export let open: $$Props["open"] = undefined;
export let onOpenChange: $$Props["onOpenChange"] = undefined;
export let forceVisible: $$Props["forceVisible"] = true;
export let disableHoverableContent: $$Props["disableHoverableContent"] = undefined;
export let group: $$Props["group"] = undefined;
const {
states: { open: localOpen },
Expand All @@ -27,6 +29,8 @@
closeDelay,
forceVisible,
defaultOpen: open,
disableHoverableContent,
group,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -45,6 +49,8 @@
$: updateOption("openDelay", openDelay);
$: updateOption("closeDelay", closeDelay);
$: updateOption("forceVisible", forceVisible);
$: updateOption("group", group);
$: updateOption("disableHoverableContent", disableHoverableContent);
</script>

<slot />
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<SiteHeader />
<main class="min-h-[calc(100vh-64px)]">
<div class="mx-auto px-4 sm:px-6 lg:px-8 container">
<div class="lg:grid lg:grid-cols-12 lg:gap-6">
<div class="mx-auto px-4 container">
<div class="lg:grid lg:grid-cols-12">
<div class="lg:col-span-2 border-r border-border">
<SidebarNav items={navigation.sidebar} />
</div>
Expand Down

0 comments on commit 8189bde

Please sign in to comment.