npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@morlay/dsh-client-ui-primitives

v0.0.16

Published

client UI kit for this workspace: re-exports the official ui-primitives (Button / Menu / Input / Tag / Modal / Switch / SettingsForm …) plus our own layout primitives (Stack / Row / Text / Panel) and controls (TagInput / SearchSelect / ModelRouteList / Sp

Readme

@morlay/dsh-client-ui-primitives

对话 UI 与设置页共用的基础面:上游那套样式、官方基础组件的统一出口(Button / Menu / Input / Modal / Switch / SettingsForm / 图标 …)、布局原语(Stack / Row / Text)、这套界面自有的控件(字段行 / 可搜索 选择器 / 标签输入 / 图标按钮 …)、按 schema 自动生成的行配置页,以及引用解析与渲染(host 与 client 共用唯一一份 源码,@morlay/dsh-reference 的引用展开复用 host 那半)。

样式与控件的写法约束见规范 how-to-write;schema 表单、字段槽与装配形态的 机制见设计 按 schema 自动生成行配置表单与字段槽注入。

用法

import { styled, dsw, findReferences } from "@morlay/dsh-client-ui-primitives/client";

按 schema 生成的那一页:

// 插件侧:Config 标 volatile,页面自动出现在该行的配置入口里
export const Config = z.object({
  maxDepth: z.number().step(1).min(0).default(1).volatile(),
});
// 想给某个字段换控件或只改文案:注册 chain 槽
import {
  SchemaFieldDefault,
  type SchemaFieldComponentProps,
} from "@morlay/dsh-client-ui-primitives/client";

ctx.slots.inject("settings.schema-form.field", () =>
  ctx.slots.register(
    {
      name: "settings.schema-form.field",
      select: (field) => (claim(field) ? { label: "服务商" } : null),
    },
    function ProviderField(field: SchemaFieldComponentProps<{ label: string }>) {
      return <SchemaFieldDefault owner={{ ...field, ...field.matched }} />;
    },
  ),
);

设置表单原语:

import { SettingsFormModel, settingsNumberField } from "@morlay/dsh-client-ui-primitives/client";

const form = new SettingsFormModel(scope, [settingsNumberField("timeoutMs")]);

业务页面组设置面时,控件与字段摆位都从这里取:

import {
  IconButton,
  SearchSelect,
  SettingsFieldRow,
  TagInput,
} from "@morlay/dsh-client-ui-primitives/client";

<SettingsFieldRow label="允许的工具" hint="留空 = 不限制" divider layout="inline">
  <TagInput
    value={tools}
    onChange={setTools}
    placeholder="加一个后回车,或粘贴一串"
    label="允许的工具"
    removeLabel={(name) => `移除 ${name}`}
  />
</SettingsFieldRow>;

装配:不是装配行——client 半随用到它的 client 行内联,apply 由那些行各自调用、幂等去重。取舍见 ADR 基础面暂时内联而不是装配行。