Shared Svelte 5 UI kit for Oshi Connect products. Tokens and primitives extracted from MiruV.
- Svelte 5
- Tailwind CSS 4
- Lucide icons (peer)
Add to .npmrc:
@oshi-connect:registry=https://npm.pkg.github.com
Install (CI needs packages: read on the org registry):
pnpm add @oshi-connect/ui"@oshi-connect/ui": "link:../oshi-connect-ui"Build the package before consuming:
pnpm --filter @oshi-connect/ui buildIn your app CSS (Tailwind v4):
@import 'tailwindcss';
@import '@oshi-connect/ui/theme.css';
@source "../node_modules/@oshi-connect/ui/dist";In app.html:
- Set
data-theme="light"ordata-theme="dark"on<html> - Load Nunito from Google Fonts
Override tokens after the import if needed:
:root {
--ds-color-primary: #your-color;
}import {
Button,
Input,
Modal,
cn,
createThemePreference,
ThemeToggle
} from '@oshi-connect/ui';
const theme = createThemePreference({ storageKey: 'my-app-theme' });<ThemeToggle storageKey="my-app-theme" defaultMode="light" />Session sketch/frame engine for hosts that are not Svelte (for example Phoenix LiveView hooks). Install fabric in the host when you import this entry.
import {
createSketchEditor,
disposeSketchEditor,
bindToolState,
undoLastStroke,
clearDrawings,
type UploadFn
} from '@oshi-connect/ui/editor';
const uploadSketch: UploadFn = async (blob, filename) => {
const body = new FormData();
body.append('image', blob, filename);
return fetch(`/api/chekis/${chekiId}/annotated`, { method: 'PUT', body });
};
const instance = createSketchEditor({
container,
canvasEl,
editorRoot,
mode: 'sketch',
imageUrl,
uploadSketch,
onClose: () => {},
onReject: (reason) => alert(reason)
});
disposeSketchEditor(instance);The host must supply UploadFn. The kit does not call product API paths.
pnpm install
pnpm build
pnpm test
pnpm dev # playground catalogThe package is published to GitHub Packages by the Publish workflow
(.github/workflows/publish.yml). It runs when a GitHub Release is published
and can also be triggered manually from the Actions tab. The workflow builds the
package and runs pnpm publish using the built-in GITHUB_TOKEN, so no extra
secret is needed.
To cut a release:
- Bump the
versioninpackage.jsonand merge tomain. - Create a GitHub Release with a tag that matches the new version (for example
v0.1.0).
The workflow then publishes @oshi-connect/ui to
https://npm.pkg.github.com.
docs/design-system.pen— Pencil source of truth- MiruV Figma