Skip to content

Commit

Permalink
Merge pull request #1 from huntabyte/init-release
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 25, 2023
2 parents 5f5b113 + 5310792 commit 980f115
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-panthers-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'cmdk-sv': patch
---

initial release
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="./static/og.png" />
</p>

# ⌘K-sv [![cmdk-sv minzip package size](https://img.shields.io/bundlephobia/minzip/cmdk-sv)](https://www.npmjs.com/package/cmdk-sv?activeTab=code) [![cmdk package version](https://img.shields.io/npm/v/cmdk.svg?colorB=green)](https://www.npmjs.com/package/cmdk-sv)
# ⌘K-sv [![cmdk-sv minzip package size](https://img.shields.io/bundlephobia/minzip/cmdk-sv)](https://www.npmjs.com/package/cmdk-sv?activeTab=code) [![cmdk package version](https://img.shields.io/npm/v/cmdk-sv.svg?colorB=green)](https://www.npmjs.com/package/cmdk-sv)

A port of [cmdk](https://cmdk.paco.me), to Svelte.

Expand All @@ -20,7 +20,7 @@ npm install cmdk-sv

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
</script>
<Command.Root label="Command Menu">
Expand All @@ -44,7 +44,7 @@ Or in a dialog:

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
</script>
<Command.Dialog label="Command Menu">
Expand Down Expand Up @@ -74,7 +74,7 @@ Render this to show the command menu inline, or use [Dialog](#dialog-cmdk-dialog

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
let value = 'apple';
</script>
Expand Down Expand Up @@ -146,7 +146,7 @@ All props are forwarded to the underlying `input` element. Can be controlled as

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
let search = '';
</script>
Expand Down Expand Up @@ -221,7 +221,7 @@ You should conditionally render this with `progress` while loading asynchronous

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
let loading = false;
</script>
Expand Down Expand Up @@ -313,7 +313,7 @@ If your items have nested sub-items that you only want to reveal when searching,
```svelte
<!-- SubItem.svelte -->
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
type $$Props = Command.ItemProps & {
search?: string;
Expand Down Expand Up @@ -354,7 +354,7 @@ Using the input value:
```svelte
<!-- CommandMenu.svelte -->
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
import SubItem from './SubItem.svelte';
let search: string;
</script>
Expand All @@ -375,7 +375,7 @@ Render the items as they become available. Filtering and sorting will happen aut

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
let loading = false;
let items: string[] = [];
Expand Down Expand Up @@ -416,7 +416,7 @@ Render `Command` inside of the popover content:

```svelte
<script lang="ts">
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
import { Popover } from 'bits-ui';
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/docs/code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const code = `<script>
import * as Command from 'cmdk-sv';
import { Command } from 'cmdk-sv';
let loading = false
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/framer/framer-cmdk.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
import { onMount, type ComponentType, tick } from 'svelte';
import {
AvatarIcon,
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/linear/linear-cmdk.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount, type ComponentType, tick } from 'svelte';
import * as Command from '$lib';
import { Command } from '$lib';
import {
AssignToIcon,
AssignToMeIcon,
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/raycast/item.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
import type { ItemProps } from '$lib/cmdk';
export let value: string;
export let isCommand: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/raycast/raycast-cmdk.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
} from '$docs/components/icons';
import { ClipboardIcon, HammerIcon, RaycastDarkIcon, RaycastLightIcon } from './icons';
import Logo from '$docs/components/logo.svelte';
import * as Command from '$lib';
import { Command } from '$lib';
import SubCommand from './sub-command.svelte';
import { onMount, tick } from 'svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/raycast/sub-command.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
import { Popover } from 'bits-ui';
import { onMount, tick } from 'svelte';
import SubItem from './sub-item.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/raycast/sub-item.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
export let shortcut: string;
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/vercel/home.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
import { ContactIcon, DocsIcon, FeedbackIcon, PlusIcon, ProjectsIcon, TeamsIcon } from './icons';
import Item from './item.svelte';
export let searchProjects: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/vercel/item.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
export let shortcut: string = '';
export let onSelect: ((value: string) => void) | undefined = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/cmdk/vercel/vercel-cmdk.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Command from '$lib';
import { Command } from '$lib';
import { isHTMLElement, kbd } from '$lib/internal';
import Home from './home.svelte';
import Projects from './projects.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cmdk/components/CommandDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { DialogProps } from '../types.js';
import { Dialog as DialogPrimitive } from 'bits-ui';
import type { Transition } from '$lib/internal/types.js';
import * as Command from '$lib';
import { Command } from '$lib';
type ContentT = $$Generic<Transition>;
type ContentIn = $$Generic<Transition>;
Expand Down
9 changes: 2 additions & 7 deletions src/lib/cmdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import type {
ListProps,
InputProps,
SeparatorProps,
DialogProps,
State
DialogProps
} from './types.js';

import Root from './components/Command.svelte';
Expand All @@ -20,7 +19,6 @@ import Item from './components/CommandItem.svelte';
import List from './components/CommandList.svelte';
import Loading from './components/CommandLoading.svelte';
import Separator from './components/CommandSeparator.svelte';
import { createState } from './command.js';

export {
// Components
Expand Down Expand Up @@ -52,8 +50,5 @@ export {
GroupProps,
ListProps,
InputProps,
SeparatorProps,
// helpers
createState,
State
SeparatorProps
};
29 changes: 27 additions & 2 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
// Reexport your entry components here
export * from './cmdk/index.js';
import { createState } from './cmdk/command.js';
import {
CommandRoot,
CommandDialog,
CommandEmpty,
CommandList,
CommandItem,
CommandGroup,
CommandInput,
CommandLoading,
CommandSeparator
} from './cmdk/index.js';
export * as Command from './cmdk/index.js';
export * from './types.js';
export { createState };

export {
CommandRoot,
CommandDialog,
CommandEmpty,
CommandList,
CommandItem,
CommandGroup,
CommandInput,
CommandLoading,
CommandSeparator
};
25 changes: 25 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type {
LoadingProps,
CommandProps,
EmptyProps,
ItemProps,
GroupProps,
ListProps,
InputProps,
SeparatorProps,
DialogProps,
State
} from './cmdk/types.js';

export {
LoadingProps,
CommandProps,
EmptyProps,
ItemProps,
GroupProps,
ListProps,
InputProps,
SeparatorProps,
DialogProps,
State
};
Binary file removed static/favicon.png
Binary file not shown.
8 changes: 4 additions & 4 deletions static/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 980f115

Please sign in to comment.