Skip to content

About

Shared Svelte 5 UI kit for Oshi Connect products (@oshi-connect/ui)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@oshi-connect/ui

Shared Svelte 5 UI kit for Oshi Connect products. Tokens and primitives extracted from MiruV.

Stack

  • Svelte 5
  • Tailwind CSS 4
  • Lucide icons (peer)

Install

GitHub Packages

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

Local sibling

"@oshi-connect/ui": "link:../oshi-connect-ui"

Build the package before consuming:

pnpm --filter @oshi-connect/ui build

Consume CSS

In 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" or data-theme="dark" on <html>
  • Load Nunito from Google Fonts

Override tokens after the import if needed:

:root {
  --ds-color-primary: #your-color;
}

Components

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" />

Editor (headless)

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.

Develop

pnpm install
pnpm build
pnpm test
pnpm dev   # playground catalog

Publish

The 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:

  1. Bump the version in package.json and merge to main.
  2. 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.

Design source

  • docs/design-system.pen — Pencil source of truth
  • MiruV Figma

About

Shared Svelte 5 UI kit for Oshi Connect products (@oshi-connect/ui)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages