diff --git a/bun.lockb b/bun.lockb index 86648e3cc4..ffe2bf5eae 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/svelte/.gitignore b/packages/svelte/.gitignore deleted file mode 100644 index ac7211b403..0000000000 --- a/packages/svelte/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store -node_modules -/build -/dist -/.svelte-kit -/package -.env -.env.* -!.env.example -vite.config.js.timestamp-* -vite.config.ts.timestamp-* diff --git a/packages/svelte/.npmrc b/packages/svelte/.npmrc deleted file mode 100644 index b6f27f1359..0000000000 --- a/packages/svelte/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict=true diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md new file mode 100644 index 0000000000..fd338bec53 --- /dev/null +++ b/packages/svelte/CHANGELOG.md @@ -0,0 +1,11 @@ +--- +id: changelog +title: Changelog +description: All notable changes will be documented in this file. +--- + +## [Unreleased] + +### Added + +- Added `Avatar` component. diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 7e50104a3d..f3c4b6567f 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,25 +1,51 @@ { "name": "@ark-ui/svelte", "version": "0.0.1", - "scripts": { - "dev": "vite dev", - "preview": "vite preview", - "package": "svelte-kit sync && svelte-package && publint", - "prepublishOnly": "npm run package", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test": "vitest" + "description": "A collection of unstyled, accessible UI components for Svelte", + "keywords": ["avatar", "svelte"], + "license": "MIT", + "homepage": "https://ark-ui.com", + "repository": { + "type": "git", + "url": "git+https://github.com/chakra-ui/ark.git", + "directory": "packages/svelte" }, + "bugs": { + "url": "https://github.com/chakra-ui/ark/issues" + }, + "type": "module", + "svelte": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": ["dist", "!dist/**/*.test.*", "!dist/**/*.spec.*"], "exports": { ".": { + "source": "./src/lib/index.ts", "types": "./dist/index.d.ts", "svelte": "./dist/index.js" + }, + "./*": { + "source": "./src/lib/components/*/index.ts", + "types": "./dist/components/*/index.d.ts", + "svelte": "./dist/components/*/index.js" } }, - "files": ["dist", "!dist/**/*.test.*", "!dist/**/*.spec.*"], - "peerDependencies": { - "svelte": "5.1.3" + "scripts": { + "build": "svelte-kit sync && svelte-package", + "dev": "vite dev", + "test": "vitest", + "test:ci": "vitest --run", + "typecheck": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "release-it": "release-it --config ../../release-it.json", + "prepack": "clean-package", + "postpack": "clean-package restore" + }, + "clean-package": { + "remove": ["exports.\\..source", "exports.\\./*.source"] + }, + "publishConfig": { + "access": "public" }, + "sideEffects": false, "dependencies": { "@zag-js/avatar": "0.77.1", "@zag-js/core": "0.77.1", @@ -27,11 +53,13 @@ "nanoid": "5.0.9" }, "devDependencies": { + "@release-it/keep-a-changelog": "5.0.0", "@sveltejs/adapter-auto": "3.3.1", "@sveltejs/kit": "2.8.4", "@sveltejs/package": "2.3.7", "@sveltejs/vite-plugin-svelte": "4.0.2", - "publint": "0.2.12", + "clean-package": "2.2.0", + "release-it": "17.10.0", "svelte": "5.2.8", "svelte-check": "4.1.0", "tslib": "2.8.1", @@ -39,7 +67,7 @@ "vite": "5.4.11", "vitest": "2.1.5" }, - "svelte": "./dist/index.js", - "types": "./dist/index.d.ts", - "type": "module" + "peerDependencies": { + "svelte": ">=5.0.0" + } } diff --git a/packages/svelte/src/lib/components/avatar/avatar-fallback.svelte b/packages/svelte/src/lib/components/avatar/avatar-fallback.svelte index e9aacff9f1..f731263ec7 100644 --- a/packages/svelte/src/lib/components/avatar/avatar-fallback.svelte +++ b/packages/svelte/src/lib/components/avatar/avatar-fallback.svelte @@ -1,8 +1,8 @@ -
{@render props.children?.()}
diff --git a/packages/svelte/src/lib/components/avatar/avatar-image.svelte b/packages/svelte/src/lib/components/avatar/avatar-image.svelte index 09b0b4a03b..d588f29b7c 100644 --- a/packages/svelte/src/lib/components/avatar/avatar-image.svelte +++ b/packages/svelte/src/lib/components/avatar/avatar-image.svelte @@ -1,7 +1,8 @@ - + diff --git a/packages/svelte/src/lib/components/avatar/avatar-root.svelte b/packages/svelte/src/lib/components/avatar/avatar-root.svelte index 969a491d3b..6971cfda60 100644 --- a/packages/svelte/src/lib/components/avatar/avatar-root.svelte +++ b/packages/svelte/src/lib/components/avatar/avatar-root.svelte @@ -1,9 +1,9 @@ + + + PA + + diff --git a/packages/svelte/src/lib/components/avatar/index.ts b/packages/svelte/src/lib/components/avatar/index.ts index 94d91ded0e..1471a44344 100644 --- a/packages/svelte/src/lib/components/avatar/index.ts +++ b/packages/svelte/src/lib/components/avatar/index.ts @@ -1,11 +1,27 @@ export type { StatusChangeDetails as AvatarStatusChangeDetails } from '@zag-js/avatar' // export { default as AvatarContext, type AvatarContextProps } from './avatar-context.svelte' -export { default as AvatarFallback, type AvatarFallbackProps } from './avatar-fallback.svelte' -export { default as AvatarImage, type AvatarImageProps } from './avatar-image.svelte' +export { + default as AvatarFallback, + type AvatarFallbackProps, + type AvatarFallbackBaseProps, +} from './avatar-fallback.svelte' +export { + default as AvatarImage, + type AvatarImageProps, + type AvatarImageBaseProps, +} from './avatar-image.svelte' export { default as AvatarRoot, + type AvatarRootBaseProps, type AvatarRootProps, } from './avatar-root.svelte' -// export { useAvatarContext, type UseAvatarContext } from './use-avatar-context' +export { useAvatarContext, type UseAvatarContext } from './use-avatar-context' +export { useAvatar, type UseAvatarProps, type UseAvatarReturn } from './use-avatar.svelte' +// export { +// default as AvatarRootProvider, +// type AvatarRootProviderProps, +// type AvatarRootProviderBaseProps, +// } from './avatar-root-provider.svelte' +// export { avatarAnatomy } from './avatar.anatomy' export * as Avatar from './avatar' diff --git a/packages/svelte/tsconfig.json b/packages/svelte/tsconfig.json index 5c56cee332..f3dc6573e5 100644 --- a/packages/svelte/tsconfig.json +++ b/packages/svelte/tsconfig.json @@ -8,6 +8,7 @@ "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": true + "strict": true, + "customConditions": ["source"] } }