Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

feat(ui, scheduler, extension): 新增基础UI组件并重构业务面板

hairyf1d905b6cad46
diff --git a/docs/specs/plugin.client.panel.md b/docs/specs/plugin.client.panel.md
index 91da3a55..4af0305b 100644
--- a/docs/specs/plugin.client.panel.md
+++ b/docs/specs/plugin.client.panel.md
@@ -109,7 +109,7 @@ export function definePanel(ctx: ClientContext, entry: PanelEntry): PanelHandle
3. **面板容器样式**:
* 宿主不再强制包裹面板列宽;面板根节点不再自持列宽,而是由 `definePanel` 的 `render` 外层统一包裹 `dsh-tauri-ui/client` 导出的 `PanelPage`。该页容器逐条对齐官方插件页 `@deepseek-ai/dsh-client-ui-plugin-manager` 的 `.X_2TxG_page`:页根为 `height:100%` + `overflow:auto` 的全宽 flex 列(`align-items:center` + `gap:32px` + `padding:28px clamp(24px,4vw,48px) 48px`),每条直接子项再由 `>*` 规则夹到 `width:100%` + `max-width:960px`。
-* 面板自身根节点(如 `.dshp-scheduler__shell`、`.dshp-extension__section`)因此**只负责内容排版**,严禁再声明 `max-width` / `margin-inline:auto` / 纵向 `padding-block` 等页级几何;这些几何已由 `PanelPage` 承担。`--dsh-chat-content-width` 与会话列宽公式对面板不再适用,不要再引用。
+* 面板自身根节点(如 `.dshp-scheduler__shell`、`.dshp-session__page`)因此**只负责内容排版**,严禁再声明 `max-width` / `margin-inline:auto` / 纵向 `padding-block` 等页级几何;这些几何已由 `PanelPage` 承担。`--dsh-chat-content-width` 与会话列宽公式对面板不再适用,不要再引用。
diff --git a/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx b/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
index a4736ba6..999d2d4c 100644
--- a/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/extension-panel.tsx
@@ -40,8 +40,8 @@ export function ExtensionPanel({ createSkill, market }: ExtensionPanelProps): Re
useEffect(() => setVisited(previous => previous.has(activeId) ? previous : new Set([...previous, activeId])), [activeId])
return (
- <div className="dshp-extension">
- <div className="dshp-extension__section">
+ <div>
+ <div className="flex flex-col gap-[14px] text-primary">
<div>
<SegmentedControl
id={tabsId}
@@ -53,7 +53,7 @@ export function ExtensionPanel({ createSkill, market }: ExtensionPanelProps): Re
</div>
{rows.filter(row => row.id === activeId || visited.has(row.id)).map((row) => {
const selected = row.id === activeId
- return <div key={row.id} id={`${tabsId}-${row.id}-panel`} className="dshp-extension__tab-panel" role="tabpanel" aria-labelledby={`${tabsId}-${row.id}`} hidden={!selected}>{row.render()}</div>
+ return <div key={row.id} id={`${tabsId}-${row.id}-panel`} className="min-w-0 pt-[2px]" role="tabpanel" aria-labelledby={`${tabsId}-${row.id}`} hidden={!selected}>{row.render()}</div>
})}
</div>
</div>
diff --git a/packages/dsh-tauri-extension/src/client/components/markdown.tsx b/packages/dsh-tauri-extension/src/client/components/markdown.tsx
index 983b815b..d2bb5bde 100644
--- a/packages/dsh-tauri-extension/src/client/components/markdown.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/markdown.tsx
@@ -7,7 +7,20 @@ function parseMarkdown(text: string): string {
return DOMPurify.sanitize(marked.parse(text, { async: false, gfm: true, breaks: false }) as string)
}
+// 注入 HTML 的排版:marked 产出的元素不在 JSX 里,只能由容器用 `[&_tag]` 变体下发。
+const MD_BODY = [
+ '[&_h1]:mt-[14px] [&_h1]:mb-[6px] [&_h1]:text-[18px] [&_h1]:text-primary [&_h1]:leading-[1.4]',
+ '[&_h2]:mt-[14px] [&_h2]:mb-[6px] [&_h2]:text-[16px] [&_h2]:text-primary [&_h2]:leading-[1.4]',
+ '[&_h3]:mt-[14px] [&_h3]:mb-[6px] [&_h3]:text-[14px] [&_h3]:text-primary [&_h3]:leading-[1.4]',
+ '[&_h4]:mt-[14px] [&_h4]:mb-[6px] [&_h4]:text-[13px] [&_h4]:text-primary [&_h4]:leading-[1.4]',
+ '[&_p]:my-[6px] [&_p]:leading-[20px]',
+ '[&_ul]:my-[6px] [&_ul]:pl-[20px] [&_ol]:my-[6px] [&_ol]:pl-[20px]',
+ '[&_code]:[font-family:var(--ds-font-family-code)] [&_code]:text-[12px] [&_code]:bg-layer-3 [&_code]:rounded-[4px] [&_code]:px-[5px] [&_code]:py-[1px]',
+ '[&_pre]:my-[8px] [&_pre]:px-[12px] [&_pre]:py-[10px] [&_pre]:overflow-x-auto [&_pre]:border [&_pre]:border-border-l2 [&_pre]:rounded-[8px] [&_pre]:bg-layer-3',
+ '[&_a]:text-business',
+].join(' ')
+
export function MarkdownPreview(props: { text: string }): ReactElement {
const html = useMemo(() => parseMarkdown(props.text), [props.text])
- return <div className="dshp-extension__md-body" dangerouslySetInnerHTML={{ __html: html }} />
+ return <div className={MD_BODY} dangerouslySetInnerHTML={{ __html: html }} />
}
diff --git a/packages/dsh-tauri-extension/src/client/components/mcp-editor-form.tsx b/packages/dsh-tauri-extension/src/client/components/mcp-editor-form.tsx
index 580c512f..67e92ec5 100644
--- a/packages/dsh-tauri-extension/src/client/components/mcp-editor-form.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/mcp-editor-form.tsx
@@ -1,8 +1,8 @@
import type { ReactElement } from 'react'
import type { Translate } from '../locales/index.types'
import type { McpEditorMode, McpEditorState } from './mcp-tab.types'
-import { Button, ChevronDown, Chip, Icon, Input, Menu, SegmentedControl } from 'dsh-tauri-ui/client'
-import { useId, useState } from 'react'
+import { Button, Field, Input, SegmentedControl, Select, Text, Textarea } from 'dsh-tauri-ui/client'
+import { useId } from 'react'
export interface McpEditorFormProps {
t: Translate
@@ -23,113 +23,88 @@ export interface McpEditorFormProps {
export function McpEditorForm(props: McpEditorFormProps): ReactElement {
const { t, editor, mode, busy, pasteJson, pasteError, formError, onModeChange, onEditorChange, onPasteJsonChange, onPasteFill, onCancel, onSave } = props
const tabsId = useId()
- const [transportOpen, setTransportOpen] = useState(false)
const transportOptions = [
- { id: 'stdio', label: t('transportStdio') },
- { id: 'streamable-http', label: t('transportHttp') },
+ { value: 'stdio', label: t('transportStdio') },
+ { value: 'streamable-http', label: t('transportHttp') },
]
return (
- <div className="dshp-extension__form">
- <SegmentedControl
- id={tabsId}
- label={t('addServer')}
- value={mode}
- options={[
- { value: 'json', label: t('editorJsonTab') },
- { value: 'form', label: t('editorFormTab') },
- ]}
- onChange={next => onModeChange(next as McpEditorMode)}
- />
+ <div className="flex flex-col gap-[10px]">
+ <div>
+ <SegmentedControl
+ id={tabsId}
+ label={t('addServer')}
+ value={mode}
+ options={[
+ { value: 'json', label: t('editorJsonTab') },
+ { value: 'form', label: t('editorFormTab') },
+ ]}
+ onChange={next => onModeChange(next as McpEditorMode)}
+ />
+ </div>
{mode === 'json'
? (
- <div id={`${tabsId}-json-panel`} className="dshp-extension__form" role="tabpanel" aria-labelledby={`${tabsId}-json`}>
- <label className="dshp-extension__label">
- <span>{t('formatPaste')}</span>
- <textarea
- className="dshp-extension__textarea dshp-extension__json-editor"
+ <div id={`${tabsId}-json-panel`} className="flex flex-col gap-[10px]" role="tabpanel" aria-labelledby={`${tabsId}-json`}>
+ <Field label={t('formatPaste')}>
+ <Textarea
+ size="compact"
placeholder={'{\n "mcpServers": {\n "name": { "command": "npx", "args": ["-y", "@example/mcp-server"] }\n }\n}\n'}
value={pasteJson}
onChange={event => onPasteJsonChange(event.target.value)}
/>
- </label>
- {pasteError !== null && <p className="dshp-extension__form-error">{pasteError}</p>}
- <div className="dshp-extension__card-row">
+ </Field>
+ {pasteError !== null && <Text tone="error">{pasteError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
<Button variant="outline" size="sm" disabled={pasteJson.trim() === ''} onClick={onPasteFill}>{t('formatFill')}</Button>
</div>
</div>
)
: (
- <div id={`${tabsId}-form-panel`} className="dshp-extension__form" role="tabpanel" aria-labelledby={`${tabsId}-form`}>
- <label className="dshp-extension__label">
- <span>{t('serverName')}</span>
+ <div id={`${tabsId}-form-panel`} className="flex flex-col gap-[10px]" role="tabpanel" aria-labelledby={`${tabsId}-form`}>
+ <Field label={t('serverName')}>
<Input
value={editor.serverName}
disabled={editor.id !== ''}
onChange={event => onEditorChange({ serverName: event.target.value })}
/>
- </label>
- <div className="dshp-extension__label">
- <span>{t('transport')}</span>
- <Menu
- open={transportOpen}
- onClose={() => setTransportOpen(false)}
- onSelect={(id) => {
- onEditorChange({ transport: id as McpEditorState['transport'] })
- setTransportOpen(false)
- }}
- items={transportOptions}
- selectedId={editor.transport}
- portal
- anchor={(
- <Chip
- variant="selector"
- disabled={editor.id !== ''}
- aria-label={t('transport')}
- aria-haspopup="menu"
- open={transportOpen}
- aria-expanded={transportOpen}
- chevron={<Icon as={ChevronDown} />}
- onClick={() => setTransportOpen(value => !value)}
- >
- {transportOptions.find(option => option.id === editor.transport)?.label}
- </Chip>
- )}
+ </Field>
+ <Field as="div" label={t('transport')}>
+ <Select
+ disabled={editor.id !== ''}
+ label={t('transport')}
+ options={transportOptions}
+ value={editor.transport}
+ onChange={next => onEditorChange({ transport: next as McpEditorState['transport'] })}
/>
- </div>
+ </Field>
{editor.transport === 'stdio'
? (
<>
- <label className="dshp-extension__label">
- <span>{t('command')}</span>
+ <Field label={t('command')}>
<Input value={editor.command} onChange={event => onEditorChange({ command: event.target.value })} />
- </label>
- <label className="dshp-extension__label">
- <span>{t('args')}</span>
- <textarea className="dshp-extension__textarea" data-short="true" value={editor.args} onChange={event => onEditorChange({ args: event.target.value })} />
- </label>
- <label className="dshp-extension__label">
- <span>{t('envPairs')}</span>
- <textarea className="dshp-extension__textarea" data-short="true" value={editor.env} onChange={event => onEditorChange({ env: event.target.value })} />
- </label>
+ </Field>
+ <Field label={t('args')}>
+ <Textarea size="short" value={editor.args} onChange={event => onEditorChange({ args: event.target.value })} />
+ </Field>
+ <Field label={t('envPairs')}>
+ <Textarea size="short" value={editor.env} onChange={event => onEditorChange({ env: event.target.value })} />
+ </Field>
</>
)
: (
<>
- <label className="dshp-extension__label">
- <span>{t('url')}</span>
+ <Field label={t('url')}>
<Input value={editor.url} onChange={event => onEditorChange({ url: event.target.value })} />
- </label>
- <label className="dshp-extension__label">
- <span>{t('headersPairs')}</span>
- <textarea className="dshp-extension__textarea" data-short="true" value={editor.headers} onChange={event => onEditorChange({ headers: event.target.value })} />
- </label>
+ </Field>
+ <Field label={t('headersPairs')}>
+ <Textarea size="short" value={editor.headers} onChange={event => onEditorChange({ headers: event.target.value })} />
+ </Field>
</>
)}
</div>
)}
- {formError !== null && <p className="dshp-extension__form-error">{formError}</p>}
- <div className="dshp-extension__card-row">
- <span className="dshp-extension__spacer" />
+ {formError !== null && <Text tone="error">{formError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <span className="flex-1" />
<Button variant="ghost" onClick={onCancel}>{t('cancel')}</Button>
<Button variant="primary" disabled={busy} onClick={onSave}>{t('save')}</Button>
</div>
diff --git a/packages/dsh-tauri-extension/src/client/components/mcp-import-dialog.tsx b/packages/dsh-tauri-extension/src/client/components/mcp-import-dialog.tsx
index 004c08f4..3a133770 100644
--- a/packages/dsh-tauri-extension/src/client/components/mcp-import-dialog.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/mcp-import-dialog.tsx
@@ -1,7 +1,7 @@
import type { ReactElement } from 'react'
import type { Translate } from '../locales/index.types'
import type { McpImportItem } from './mcp-tab.types'
-import { Button, Checkbox, Modal, Tag } from 'dsh-tauri-ui/client'
+import { Button, Card, Checkbox, Modal, Tag, Text } from 'dsh-tauri-ui/client'
import { importGroups } from './mcp-tab.utils'
export interface McpImportDialogProps {
@@ -24,14 +24,14 @@ export function McpImportDialog(props: McpImportDialogProps): ReactElement {
onClose={onClose}
closeLabel={t('close')}
title={t('importServers')}
- className="dshp-extension dshp-extension__modal-wide"
+ className="w-[min(680px,100%)]!"
>
- <div className="dshp-extension__form">
- <p className="dshp-extension__intro">{t('importIntro')}</p>
- {items === null && <p className="dshp-extension__empty">{t('loading')}</p>}
- {items !== null && items.length === 0 && <p className="dshp-extension__empty">{t('importEmpty')}</p>}
+ <div className="flex flex-col gap-[10px]">
+ <Text tone="tertiary">{t('importIntro')}</Text>
+ {items === null && <Text size="sm" tone="tertiary">{t('loading')}</Text>}
+ {items !== null && items.length === 0 && <Text size="sm" tone="tertiary">{t('importEmpty')}</Text>}
{items !== null && items.length > 0 && (
- <div className="dshp-extension__import-scroll">
+ <div className="flex flex-col gap-[14px] max-h-[min(400px,52vh)] overflow-y-auto py-[2px] pr-[4px] pl-[2px]">
{importGroups(items).map((group) => {
const selectable = group.items
.filter(({ item }) => !item.existing)
@@ -39,38 +39,38 @@ export function McpImportDialog(props: McpImportDialogProps): ReactElement {
const allChecked = selectable.length > 0
&& selectable.every(index => items[index].checked)
return (
- <section className="dshp-extension__import-group" key={group.agent}>
- <div className="dshp-extension__import-head">
+ <section className="flex flex-col gap-[8px]" key={group.agent}>
+ <div className="flex items-center gap-[8px] px-[2px]">
<Tag tone="info">{group.label}</Tag>
- <span className="dshp-extension__import-count">{group.items.length}</span>
+ <span className="text-[12px] leading-[18px] text-tertiary">{group.items.length}</span>
{selectable.length > 0 && (
- <div className="dshp-extension__import-all">
+ <div className="ml-auto">
<Checkbox checked={allChecked} onChange={next => onToggleGroup(selectable, next)}>
{t('importSelectAll')}
</Checkbox>
</div>
)}
</div>
- <ul className="dshp-extension__cards dshp-extension__cards--single">
+ <ul className="grid grid-cols-[minmax(0,1fr)] items-stretch gap-[10px] m-0 p-0 list-none">
{group.items.map(({ item, index }) => {
const command = item.server.transport === 'stdio'
? `${item.server.command ?? ''} ${(item.server.args ?? []).join(' ')}`.trim()
: item.server.url ?? ''
return (
- <li className={`dshp-extension__card${item.existing ? ' dshp-extension__card--muted' : ''}`} key={`${item.server.agent}/${item.server.name}`}>
- <div className="dshp-extension__card-top">
+ <li className={`flex flex-col gap-[8px] min-w-0 border border-border-l2 rounded-[10px] bg-layer-3 px-[14px] py-[12px] hover:bg-hover${item.existing ? ' opacity-55' : ''}`} key={`${item.server.agent}/${item.server.name}`}>
+ <div className="flex items-center gap-[6px] flex-wrap">
<Checkbox
checked={item.checked}
disabled={item.existing}
onChange={next => onToggle(index, next)}
title={item.server.name}
>
- <strong className="dshp-extension__card-title" title={item.server.name}>{item.server.name}</strong>
+ <Card.Title className="flex-1 min-w-0 font-semibold [font-family:var(--ds-font-family-code)]" title={item.server.name}>{item.server.name}</Card.Title>
</Checkbox>
<Tag tone="neutral">{item.server.transport}</Tag>
{item.existing && <Tag tone="quiet">{t('importExisting')}</Tag>}
</div>
- <p className="dshp-extension__card-desc" title={command}>{command}</p>
+ <Card.Description className="text-secondary line-clamp-2" title={command}>{command}</Card.Description>
</li>
)
})}
@@ -80,9 +80,9 @@ export function McpImportDialog(props: McpImportDialogProps): ReactElement {
})}
</div>
)}
- {formError !== null && <p className="dshp-extension__form-error">{formError}</p>}
- <div className="dshp-extension__card-row">
- <span className="dshp-extension__spacer" />
+ {formError !== null && <Text tone="error">{formError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <span className="flex-1" />
<Button variant="ghost" onClick={onClose}>{t('cancel')}</Button>
<Button
variant="primary"
diff --git a/packages/dsh-tauri-extension/src/client/components/mcp-tab.tsx b/packages/dsh-tauri-extension/src/client/components/mcp-tab.tsx
index c30c9213..1ebe1340 100644
--- a/packages/dsh-tauri-extension/src/client/components/mcp-tab.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/mcp-tab.tsx
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react'
import type { McpSaveBody } from '../apis/index.type'
import type { McpRow } from '../types'
import type { McpEditorMode, McpEditorState, McpImportItem, McpTabProps } from './mcp-tab.types'
-import { Action, ArrowRotateRight, Button, ChevronDown, Chip, Icon, Menu, Modal, PlugConnection, StateDot, Tag } from 'dsh-tauri-ui/client'
+import { Action, ArrowRotateRight, Button, Card, Icon, Modal, Notice, PlugConnection, Select, StateDot, Tag, Text } from 'dsh-tauri-ui/client'
import { compact } from 'dsh-tauri/client'
import { useEffect, useState } from 'react'
import { deleteMcp, getImportScan, getMcp, postImportApply, postMcp, postMcpCheck, postMcpToggle } from '../apis'
@@ -31,7 +31,6 @@ export function McpTab({ t }: McpTabProps): ReactElement {
const [pasteJson, setPasteJson] = useState('')
const [pasteError, setPasteError] = useState<string | null>(null)
const [scope, setScope] = useState<'all' | 'global' | 'profile'>('all')
- const [scopeOpen, setScopeOpen] = useState(false)
const [checking, setChecking] = useState<string | null>(null)
const [globalError, setGlobalError] = useState('')
const { later } = useTimers()
@@ -281,11 +280,11 @@ export function McpTab({ t }: McpTabProps): ReactElement {
}
const restartBanner = (
- <div className="dshp-extension__banner" data-kind="info" role="status">
+ <Notice kind="info">
<StateDot state="ongoing" size={10} />
- <div className="dshp-extension__banner-body">
+ <div className="flex-1 min-w-0 flex flex-col gap-[4px]">
<span>{restarting ? t('restarting') : t('restartNeeded')}</span>
- <span className="dshp-extension__banner-hint">
+ <span className="flex items-center gap-[8px] flex-wrap text-secondary text-[12px] leading-[18px]">
{restarting
? (!isDesktopHost() && t('restartPortHint'))
: isDesktopHost()
@@ -299,94 +298,75 @@ export function McpTab({ t }: McpTabProps): ReactElement {
: t('restartOtherHint')}
</span>
</div>
- </div>
+ </Notice>
)
const scopeOptions = [
- { id: 'all', label: t('scopeAll') },
- { id: 'global', label: t('global') },
- { id: 'profile', label: t('profile') },
+ { value: 'all', label: t('scopeAll') },
+ { value: 'global', label: t('global') },
+ { value: 'profile', label: t('profile') },
]
return (
- <div className="dshp-extension__section">
- <div className="dshp-extension__head">
- <span className="dshp-extension__head-icon"><Icon as={PlugConnection} size={16} /></span>
+ <div className="flex flex-col gap-[14px] text-primary">
+ <div className="flex items-center gap-[10px] flex-wrap [&_h3]:m-0 [&_h3]:text-[16px] [&_h3]:leading-[24px] [&_h3]:font-medium">
+ <span className="inline-flex items-center justify-center flex-none w-[22px] h-[22px]"><Icon as={PlugConnection} size={16} /></span>
<h3>{t('mcpTitle')}</h3>
- <span className="dshp-extension__spacer" />
+ <span className="flex-1" />
<Button variant="ghost" size="sm" disabled={restarting} onClick={() => setRestartConfirm(true)}>{t('restart')}</Button>
<Button variant="ghost" size="sm" onClick={() => void openImport()}>{t('importServers')}</Button>
<Button variant="primary" size="sm" onClick={openCreate}>{t('addServer')}</Button>
</div>
- <p className="dshp-extension__intro">{t('mcpIntro')}</p>
+ <Text tone="tertiary">{t('mcpIntro')}</Text>
{outcome !== null && (
- <div className="dshp-extension__banner" data-kind={outcome.ok ? 'ok' : 'error'} role="status">
+ <Notice kind={outcome.ok ? 'ok' : 'error'}>
<StateDot state={outcome.ok ? 'done' : 'error'} size={10} />
- <div className="dshp-extension__banner-body"><span>{outcome.text}</span></div>
- </div>
+ <div className="flex-1 min-w-0 flex flex-col gap-[4px]"><span>{outcome.text}</span></div>
+ </Notice>
)}
{(pending || restarting) && restartBanner}
- <div className="dshp-extension__list-head">
+ <div className="flex items-center gap-[7px] px-[2px] mt-[2px] [&_h3]:m-0 [&_h3]:text-[13px] [&_h3]:leading-[20px] [&_h3]:font-semibold">
<h3>{t('mcpTab')}</h3>
- {servers !== null && <span className="dshp-extension__count">{servers.length}</span>}
- <Menu
- open={scopeOpen}
- onClose={() => setScopeOpen(false)}
- onSelect={(id) => {
- setScope(id as typeof scope)
- setScopeOpen(false)
- }}
- items={scopeOptions}
- selectedId={scope}
- portal
- align="end"
- anchor={(
- <Chip
- variant="selector"
- aria-label={t('scope')}
- aria-haspopup="menu"
- open={scopeOpen}
- aria-expanded={scopeOpen}
- chevron={<Icon as={ChevronDown} />}
- onClick={() => setScopeOpen(value => !value)}
- >
- {scopeOptions.find(option => option.id === scope)?.label}
- </Chip>
- )}
+ {servers !== null && <span className="text-[12px] leading-[18px] text-tertiary tabular-nums">{servers.length}</span>}
+ <Select
+ label={t('scope')}
+ options={scopeOptions}
+ value={scope}
+ onChange={next => setScope(next as typeof scope)}
/>
- <span className="dshp-extension__spacer" />
+ <span className="flex-1" />
<Action variant="toolbar" icon={<Icon as={ArrowRotateRight} />} aria-label={t('view')} title={t('view')} disabled={busy} onClick={() => setReload(value => value + 1)} />
</div>
- {servers === null && <p className="dshp-extension__empty">{t('loading')}</p>}
- {servers !== null && servers.length === 0 && <p className="dshp-extension__empty">{t('emptyMcp')}</p>}
+ {servers === null && <Text size="sm" tone="tertiary">{t('loading')}</Text>}
+ {servers !== null && servers.length === 0 && <Text size="sm" tone="tertiary">{t('emptyMcp')}</Text>}
{servers !== null && servers.length > 0 && (
- <ul className="dshp-extension__cards">
+ <Card.List className="grid grid-cols-[repeat(2,minmax(0,1fr))] items-stretch gap-[10px] max-[680px]:grid-cols-[minmax(0,1fr)]">
{servers.filter(row => scope === 'all' || (row.layer ?? 'profile') === scope).map(row => (
- <li className="dshp-extension__card" key={row.id}>
- <div className="dshp-extension__card-top">
- <strong className="dshp-extension__card-title" title={row.id}>{row.serverName}</strong>
+ <Card key={row.id} className="mx-0 flex flex-col gap-[8px] px-[14px] py-[12px]">
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <Card.Title className="flex-1 min-w-0 font-semibold [font-family:var(--ds-font-family-code)]" title={row.id}>{row.serverName}</Card.Title>
<Tag tone={(row.scope ?? row.layer) === 'global' ? 'info' : 'neutral'}>{(row.scope ?? row.layer) === 'global' ? t('scopeGlobal') : t('scopeProfile')}</Tag>
<Tag tone="neutral">{row.transport}</Tag>
<Tag tone={row.disabled ? 'warning' : 'neutral'}>{row.disabled ? t('disabled') : t('enabled')}</Tag>
</div>
- <p className="dshp-extension__card-desc">
+ <Card.Description className="text-secondary line-clamp-2">
{row.transport === 'stdio' ? `${row.command ?? ''} ${(row.args ?? []).join(' ')}` : row.url ?? ''}
- </p>
- {row.shadowed === true && <p className="dshp-extension__form-error">{t('shadowedByGlobal')}</p>}
- {globalError !== '' && <p className="dshp-extension__form-error">{globalError}</p>}
- <div className="dshp-extension__card-row">
- <span className="dshp-extension__spacer" />
+ </Card.Description>
+ {row.shadowed === true && <Text tone="error">{t('shadowedByGlobal')}</Text>}
+ {globalError !== '' && <Text tone="error">{globalError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <span className="flex-1" />
<Button variant="ghost" size="sm" disabled={busy || checking === row.id} onClick={() => void checkConnectivity(row)}>{checking === row.id ? t('checkRunning') : t('checkLabel')}</Button>
<Button variant="ghost" size="sm" disabled={busy} onClick={() => void doToggle(row)}>{t('toggle')}</Button>
<Button variant="ghost" size="sm" disabled={busy} onClick={() => openEdit(row)}>{t('edit')}</Button>
<Button variant="ghost" size="sm" disabled={busy} onClick={() => setConfirmId(row.id)}>{t('delete')}</Button>
</div>
- </li>
+ </Card>
))}
- </ul>
+ </Card.List>
)}
<Modal
@@ -394,8 +374,8 @@ export function McpTab({ t }: McpTabProps): ReactElement {
onClose={() => setEditor(null)}
closeLabel={t('close')}
title={editor !== null && editor.id !== '' ? t('editServer') : t('addServer')}
- className="dshp-extension dshp-extension__modal-form"
- contentClassName="dshp-extension__modal-scroll"
+ className="w-[min(760px,100%)]!"
+ contentClassName="max-h-[calc(100vh-160px)]! overflow-y-auto"
>
{editor !== null && (
<McpEditorForm
diff --git a/packages/dsh-tauri-extension/src/client/components/skills-tab.tsx b/packages/dsh-tauri-extension/src/client/components/skills-tab.tsx
index 6d76039f..84cc436d 100644
--- a/packages/dsh-tauri-extension/src/client/components/skills-tab.tsx
+++ b/packages/dsh-tauri-extension/src/client/components/skills-tab.tsx
@@ -1,6 +1,7 @@
import type { ReactElement } from 'react'
+import type { Translate } from '../locales/index.types'
import type { SkillRowView } from '../types'
-import { Action, ArrowRotateRight, Button, Checkbox, GraduationCap, Icon, Input, LogoGithub, Modal, Pill, SegmentedControl, StateDot, Switch, Tag } from 'dsh-tauri-ui/client'
+import { Action, ArrowRotateRight, Button, Card, Checkbox, Field, GraduationCap, Icon, Input, LogoGithub, Modal, Notice, Pill, SegmentedControl, StateDot, Switch, Tag, Text, Textarea } from 'dsh-tauri-ui/client'
import { orderBy, uniq } from 'dsh-tauri/client'
import { useEffect, useMemo, useState } from 'react'
import { deleteSkill, getSkill, getSkills, postOpenDir, postRoots, postSkill, postSkillPolicy, postSkillsRefresh } from '../apis'
@@ -9,8 +10,6 @@ import { IMPORT_REFRESH_DELAYS_MS, SKILL_REFRESH_INTERVAL_MS, SKILL_REFRESH_TIME
import { useTimers } from '../hooks/use-timers'
import { normalizeRepository, policyTag } from './skills-tab.utils'
-import type { Translate } from '../locales/index.types'
-
export interface SkillEditorState {
mode: 'edit' | 'view'
name: string
@@ -202,11 +201,11 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
const readOnly = editor?.mode === 'view'
return (
- <div className="dshp-extension__section">
- <div className="dshp-extension__head">
- <span className="dshp-extension__head-icon"><Icon as={GraduationCap} size={16} /></span>
+ <div className="flex flex-col gap-[14px] text-primary">
+ <div className="flex items-center gap-[10px] flex-wrap [&_h3]:m-0 [&_h3]:text-[16px] [&_h3]:leading-[24px] [&_h3]:font-medium">
+ <span className="inline-flex items-center justify-center flex-none w-[22px] h-[22px]"><Icon as={GraduationCap} size={16} /></span>
<h3>{t('skillsTitle')}</h3>
- <span className="dshp-extension__spacer" />
+ <span className="flex-1" />
<Button variant="ghost" size="sm" onClick={() => void doOpen({ target: 'user-skills' })}>{t('openUserSkills')}</Button>
<Button
variant="ghost"
@@ -220,74 +219,70 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
{t('importRepository')}
</Button>
<Button variant="primary" size="sm" disabled={busy} onClick={() => void doCreate()}>{t('newSkill')}</Button>
-
</div>
- <p className="dshp-extension__intro">{t('skillsIntro')}</p>
+ <Text tone="tertiary">{t('skillsIntro')}</Text>
{outcome && (
- <div className="dshp-extension__banner" data-kind={outcome.ok ? 'ok' : 'error'} role="status">
+ <Notice kind={outcome.ok ? 'ok' : 'error'}>
<StateDot state={outcome.ok ? 'done' : 'error'} size={10} />
- <div className="dshp-extension__banner-body">{outcome.text}</div>
- </div>
+ <div className="flex-1 min-w-0 flex flex-col gap-[4px]">{outcome.text}</div>
+ </Notice>
)}
- <div className="dshp-extension__list-head">
+ <div className="flex items-center gap-[7px] px-[2px] mt-[2px] [&_h3]:m-0 [&_h3]:text-[13px] [&_h3]:leading-[20px] [&_h3]:font-semibold">
<h3>{t('skillsTab')}</h3>
{skills && (
- <span className="dshp-extension__count">
+ <span className="text-[12px] leading-[18px] text-tertiary tabular-nums">
{filtered.length}
/
{skills.length}
</span>
)}
- <span className="dshp-extension__spacer" />
- <Input className="dshp-extension__search" type="search" placeholder={t('searchSkills')} aria-label={t('searchSkills')} value={query} onChange={event => setQuery(event.target.value)} />
+ <span className="flex-1" />
+ <Input className="w-[200px] max-[680px]:w-[140px]" type="search" placeholder={t('searchSkills')} aria-label={t('searchSkills')} value={query} onChange={event => setQuery(event.target.value)} />
<Action variant="toolbar" icon={<Icon as={ArrowRotateRight} />} aria-label={t('refresh')} title={t('refresh')} disabled={busy} onClick={() => void doRefresh()} />
</div>
- {sources.length > 1 && <div className="dshp-extension__chips" role="group" aria-label={t('source')}>{[{ id: 'all', label: t('filterAll') }, ...sources.map(source => ({ id: source, label: t(SOURCE_LOCALE_KEYS[source] ?? 'sourceCustom') }))].map(chip => <Pill key={chip.id} active={sourceFilter === chip.id} onClick={() => setSourceFilter(chip.id)}>{chip.label}</Pill>)}</div>}
- {skills === null && <p className="dshp-extension__empty">{t('loading')}</p>}
- {skills !== null && filtered.length === 0 && <p className="dshp-extension__empty">{skills.length === 0 ? t('emptySkills') : t('noMatch')}</p>}
+ {sources.length > 1 && <div className="flex items-center gap-[6px] flex-wrap" role="group" aria-label={t('source')}>{[{ id: 'all', label: t('filterAll') }, ...sources.map(source => ({ id: source, label: t(SOURCE_LOCALE_KEYS[source] ?? 'sourceCustom') }))].map(chip => <Pill key={chip.id} active={sourceFilter === chip.id} onClick={() => setSourceFilter(chip.id)}>{chip.label}</Pill>)}</div>}
+ {skills === null && <Text size="sm" tone="tertiary">{t('loading')}</Text>}
+ {skills !== null && filtered.length === 0 && <Text size="sm" tone="tertiary">{skills.length === 0 ? t('emptySkills') : t('noMatch')}</Text>}
{filtered.length > 0 && (
- <ul className="dshp-extension__cards">
+ <Card.List className="grid grid-cols-[repeat(2,minmax(0,1fr))] items-stretch gap-[10px] max-[680px]:grid-cols-[minmax(0,1fr)]">
{filtered.map((skill) => {
const tag = policyTag(skill)
const githubUrl = skill.repository?.githubUrl
return (
- <li className="dshp-extension__card" key={`${skill.source}/${skill.name}`}>
- <div className="dshp-extension__card-top">
- <strong className="dshp-extension__card-title" title={skill.name}>{skill.name}</strong>
+ <Card key={`${skill.source}/${skill.name}`} className="mx-0 flex flex-col gap-[8px] px-[14px] py-[12px]">
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <Card.Title className="flex-1 min-w-0 font-semibold [font-family:var(--ds-font-family-code)]" title={skill.name}>{skill.name}</Card.Title>
<Tag tone="info">{t(SOURCE_LOCALE_KEYS[skill.source] ?? 'sourceCustom')}</Tag>
{tag.key && <Tag tone={tag.off ? 'warning' : 'neutral'}>{t(tag.key)}</Tag>}
</div>
- <p className="dshp-extension__card-desc" title={skill.description}>{skill.description}</p>
- <div className="dshp-extension__card-row">
+ <Card.Description className="text-secondary line-clamp-2" title={skill.description}>{skill.description}</Card.Description>
+ <div className="flex items-center gap-[6px] flex-wrap">
{skill.policyEditable && <Switch checked={skill.invocation.modelInvocable || skill.invocation.userInvocable} onChange={() => void doToggle(skill)} label={t('toggleSkill')} title={t('toggleSkillHint')} disabled={busy} />}
{skill.dir && <Button variant="ghost" size="sm" onClick={() => void doOpen({ target: 'skill', name: skill.name })}>{t('openFolder')}</Button>}
- <span className="dshp-extension__spacer" />
+ <span className="flex-1" />
{githubUrl !== undefined && <Action variant="toolbar" icon={<Icon as={LogoGithub} />} aria-label={t('githubRepository')} title={t('githubRepository')} onClick={() => window.open(githubUrl, '_blank', 'noopener,noreferrer')} />}
<Button variant="ghost" size="sm" disabled={busy} onClick={() => void openExisting(skill)}>{skill.editable ? t('edit') : t('view')}</Button>
{skill.removable && <Button variant="ghost" size="sm" disabled={busy} onClick={() => setConfirmName(skill.name)}>{t('delete')}</Button>}
</div>
- </li>
+ </Card>
)
})}
- </ul>
+ </Card.List>
)}
- <Modal open={editor !== null} onClose={() => setEditor(null)} closeLabel={t('close')} title={editor?.mode === 'edit' ? t('editSkill') : t('viewSkill')} className="dshp-extension dshp-extension__modal-form" contentClassName="dshp-extension__modal-scroll">
+ <Modal open={editor !== null} onClose={() => setEditor(null)} closeLabel={t('close')} title={editor?.mode === 'edit' ? t('editSkill') : t('viewSkill')} className="w-[min(760px,100%)]!" contentClassName="max-h-[calc(100vh-160px)]! overflow-y-auto">
{editor && (
- <div className="dshp-extension__form">
- <label className="dshp-extension__label">
- <span>{t('skillName')}</span>
+ <div className="flex flex-col gap-[10px]">
+ <Field label={t('skillName')}>
<Input value={editor.name} disabled />
- </label>
- <label className="dshp-extension__label">
- <span>{t('skillDescription')}</span>
+ </Field>
+ <Field label={t('skillDescription')}>
<Input value={editor.description} disabled={readOnly} onChange={event => setEditor({ ...editor, description: event.target.value })} />
- </label>
- <label className="dshp-extension__label">
- <span>{t('skillWhenToUse')}</span>
+ </Field>
+ <Field label={t('skillWhenToUse')}>
<Input value={editor.whenToUse} disabled={readOnly} onChange={event => setEditor({ ...editor, whenToUse: event.target.value })} />
- </label>
- <div className="dshp-extension__checks">
+ </Field>
+ <div className="flex items-center gap-[16px] flex-wrap">
<Checkbox checked={editor.modelInvocable} disabled={readOnly} onChange={next => setEditor({ ...editor, modelInvocable: next })}>
{t('modelInvocable')}
</Checkbox>
@@ -295,10 +290,10 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
{t('userInvocable')}
</Checkbox>
</div>
- <div className="dshp-extension__label">
- <div className="dshp-extension__card-row">
+ <div className="flex flex-col gap-[4px] text-[12px] leading-[18px] text-secondary [&>span:first-child]:text-tertiary">
+ <div className="flex items-center gap-[6px] flex-wrap">
<span>{t('skillContent')}</span>
- <span className="dshp-extension__spacer" />
+ <span className="flex-1" />
<SegmentedControl
label={t('skillContent')}
value={preview ? 'preview' : 'text'}
@@ -309,11 +304,11 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
onChange={next => setPreview(next === 'preview')}
/>
</div>
- {preview ? <div className="dshp-extension__md-preview"><MarkdownPreview text={editor.content} /></div> : <textarea className="dshp-extension__textarea" value={editor.content} readOnly={readOnly} onChange={event => setEditor({ ...editor, content: event.target.value })} />}
+ {preview ? <div className="min-h-[320px] max-h-[60vh] overflow-y-auto border border-border-l2 rounded-[8px] px-[12px] py-[8px] bg-layer-1 text-[13px]"><MarkdownPreview text={editor.content} /></div> : <Textarea value={editor.content} readOnly={readOnly} onChange={event => setEditor({ ...editor, content: event.target.value })} />}
</div>
- {formError && <p className="dshp-extension__form-error">{formError}</p>}
- <div className="dshp-extension__card-row">
- <span className="dshp-extension__spacer" />
+ {formError && <Text tone="error">{formError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <span className="flex-1" />
<Button variant="ghost" onClick={() => setEditor(null)}>{readOnly ? t('close') : t('cancel')}</Button>
{!readOnly && <Button variant="primary" disabled={busy} onClick={() => void doSave()}>{t('save')}</Button>}
</div>
@@ -335,11 +330,10 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
>
<p>{t('deleteWarn')}</p>
</Modal>
- <Modal open={importOpen} onClose={() => setImportOpen(false)} closeLabel={t('close')} title={t('importRepositoryTitle')} className="dshp-extension dshp-extension__modal-wide">
- <div className="dshp-extension__form">
- <p className="dshp-extension__intro">{t('importRepositoryHint')}</p>
- <label className="dshp-extension__label">
- <span>{t('repository')}</span>
+ <Modal open={importOpen} onClose={() => setImportOpen(false)} closeLabel={t('close')} title={t('importRepositoryTitle')} className="w-[min(680px,100%)]!">
+ <div className="flex flex-col gap-[10px]">
+ <Text tone="tertiary">{t('importRepositoryHint')}</Text>
+ <Field label={t('repository')}>
<Input
autoFocus
placeholder={t('importRepositoryPlaceholder')}
@@ -350,10 +344,10 @@ export function SkillsTab({ t, createSkill }: SkillsTabProps): ReactElement {
void doImport()
}}
/>
- </label>
- {formError && <p className="dshp-extension__form-error">{formError}</p>}
- <div className="dshp-extension__card-row">
- <span className="dshp-extension__spacer" />
+ </Field>
+ {formError && <Text tone="error">{formError}</Text>}
+ <div className="flex items-center gap-[6px] flex-wrap">
+ <span className="flex-1" />
<Button variant="ghost" disabled={busy} onClick={() => setImportOpen(false)}>{t('cancel')}</Button>
<Button variant="primary" disabled={busy || repositoryUrl.trim() === ''} onClick={() => void doImport()}>{t('importRepository')}</Button>
</div>
diff --git a/packages/dsh-tauri-extension/src/client/constants/index.ts b/packages/dsh-tauri-extension/src/client/constants/index.ts
index 991bf320..c06d0c60 100644
--- a/packages/dsh-tauri-extension/src/client/constants/index.ts
+++ b/packages/dsh-tauri-extension/src/client/constants/index.ts
@@ -10,10 +10,8 @@ export const PANEL_ACTION_ORDER = 20
export const INPUT_PREFILL_ID = `${PLUGIN_ID}.skill-prefill`
export const INPUT_PREFILL_ORDER = 40
export const INPUT_PREFILL_PRIORITY = 0
-export const STYLE_ID = `${PLUGIN_ID}-styles`
export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`
-export const STYLES_EFFECT = `${PLUGIN_ID}: styles`
export const SKILL_CREATOR_PREFILL_EFFECT = `${PLUGIN_ID}: skill creator prefill`
export const EXTENSION_PANEL_EFFECT = `${PLUGIN_ID}: extension panel`
diff --git a/packages/dsh-tauri-extension/src/client/index.ts b/packages/dsh-tauri-extension/src/client/index.ts
index d9ae06a2..929070b9 100644
--- a/packages/dsh-tauri-extension/src/client/index.ts
+++ b/packages/dsh-tauri-extension/src/client/index.ts
@@ -4,12 +4,10 @@ import {
LOCALE_EFFECT,
PLUGIN_ID,
SKILL_CREATOR_PREFILL_EFFECT,
- STYLES_EFFECT,
} from './constants'
import { locale } from './locales'
import { extensionPanelFeature } from './register/extension-panel'
import { skillCreatorPrefillFeature } from './register/skill-creator-prefill'
-import { stylesFeature } from './register/styles'
export const name = PLUGIN_ID
@@ -17,7 +15,6 @@ export const inject = ['slots', 'locale', 'sessions', 'workspaces']
export function apply(ctx: ClientContext): void {
ctx.effect(locale.registerLocale, LOCALE_EFFECT)
- ctx.effect(stylesFeature, STYLES_EFFECT)
ctx.effect(skillCreatorPrefillFeature, SKILL_CREATOR_PREFILL_EFFECT)
ctx.effect(extensionPanelFeature, EXTENSION_PANEL_EFFECT)
}
diff --git a/packages/dsh-tauri-extension/src/client/register/styles.ts b/packages/dsh-tauri-extension/src/client/register/styles.ts
deleted file mode 100644
index 2d5c01ce..00000000
--- a/packages/dsh-tauri-extension/src/client/register/styles.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { mountStyle } from 'dsh-tauri-ui/client'
-import { defineRegister } from 'dsh-tauri/client'
-import { PLUGIN_ID } from '../../shared/constants'
-import { STYLE_ID } from '../constants'
-import extensionIndexStyle from '../styles/index.cssr'
-
-export const stylesFeature = defineRegister((controller) => {
- controller.add(mountStyle(extensionIndexStyle, STYLE_ID, PLUGIN_ID))
-})
diff --git a/packages/dsh-tauri-extension/src/client/styles/index.cssr.ts b/packages/dsh-tauri-extension/src/client/styles/index.cssr.ts
deleted file mode 100644
index 02997d5f..00000000
--- a/packages/dsh-tauri-extension/src/client/styles/index.cssr.ts
+++ /dev/null
@@ -1,227 +0,0 @@
-import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
-
-const { c, bem: { b, e, m } } = cssr
-const { primary, secondary, tertiary, borderL2: border, business, layer1, layer3, hover } = sharedStyles
-
-export default b('extension', [
- e('section', {
- display: 'flex',
- flexDirection: 'column',
- gap: '14px',
- color: primary,
- }),
- e('intro', { margin: '0', fontSize: '12px', lineHeight: '18px', color: tertiary }),
- e('empty', { margin: '0', fontSize: '13px', lineHeight: '20px', color: tertiary }),
- e('spacer', { flex: '1' }),
- e('head', {
- display: 'flex',
- alignItems: 'center',
- gap: '10px',
- flexWrap: 'wrap',
- }, [
- c('& h3', { margin: '0', fontSize: '16px', lineHeight: '24px', fontWeight: '500' }),
- ]),
- e('head-icon', {
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center',
- flex: 'none',
- width: '22px',
- height: '22px',
- }),
- e('list-head', {
- display: 'flex',
- alignItems: 'center',
- gap: '7px',
- padding: '0 2px',
- marginTop: '2px',
- }, [
- c('& h3', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
- ]),
- e('count', { fontSize: '12px', lineHeight: '18px', color: tertiary, fontVariantNumeric: 'tabular-nums' }),
- e('banner', {
- display: 'flex',
- alignItems: 'flex-start',
- gap: '8px',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '10px 12px',
- background: layer3,
- fontSize: '13px',
- lineHeight: '20px',
- }, [
- c('&[data-kind="ok"]', {
- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent)',
- background: 'color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent)',
- }),
- c('&[data-kind="error"]', {
- borderColor: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent)',
- background: 'color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent)',
- }),
- c('&[data-kind="info"]', {
- borderColor: `color-mix(in srgb,${business} 35%,transparent)`,
- background: `color-mix(in srgb,${business} 8%,transparent)`,
- }),
- ]),
- e('banner-body', { flex: '1', minWidth: '0', display: 'flex', flexDirection: 'column', gap: '4px' }),
- e('banner-hint', {
- display: 'flex',
- alignItems: 'center',
- gap: '8px',
- flexWrap: 'wrap',
- color: secondary,
- fontSize: '12px',
- lineHeight: '18px',
- }),
- e('form', { display: 'flex', flexDirection: 'column', gap: '10px' }),
- e('label', {
- display: 'flex',
- flexDirection: 'column',
- gap: '4px',
- fontSize: '12px',
- lineHeight: '18px',
- color: secondary,
- }, [
- c('& > span:first-child', { color: tertiary }),
- ]),
- e('checks', {
- display: 'flex',
- alignItems: 'center',
- gap: '16px',
- flexWrap: 'wrap',
- }),
- e('form-error', {
- margin: '0',
- color: 'var(--dsw-alias-state-error-primary)',
- fontSize: '12px',
- lineHeight: '18px',
- }),
- c('&.dshp-extension__modal-wide.dshp-extension__modal-wide', { width: 'min(680px,100%)' }),
- c('&.dshp-extension__modal-form.dshp-extension__modal-form', { width: 'min(760px,100%)' }),
- c('.dshp-extension__modal-scroll.dshp-extension__modal-scroll', { maxHeight: 'calc(100vh - 160px)', overflowY: 'auto' }),
- e('cards', {
- display: 'grid',
- gridTemplateColumns: 'repeat(2,minmax(0,1fr))',
- alignItems: 'stretch',
- gap: '10px',
- margin: '0',
- padding: '0',
- listStyle: 'none',
- }, [
- m('single', { gridTemplateColumns: 'minmax(0,1fr)' }),
- ]),
- e('card', {
- display: 'flex',
- flexDirection: 'column',
- gap: '8px',
- minWidth: '0',
- border: `1px solid ${border}`,
- borderRadius: '10px',
- background: layer3,
- padding: '12px 14px',
- }, [
- c('&:hover', { background: hover }),
- m('muted', { opacity: '.55' }),
- ]),
- e('card-top', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
- e('card-row', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
- e('card-title', {
- flex: '1',
- minWidth: '0',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
- fontSize: '14px',
- lineHeight: '20px',
- fontWeight: '600',
- fontFamily: 'var(--ds-font-family-code)',
- }),
- e('card-desc', {
- margin: '0',
- fontSize: '12px',
- lineHeight: '18px',
- color: secondary,
- display: '-webkit-box',
- WebkitLineClamp: '2',
- WebkitBoxOrient: 'vertical',
- overflow: 'hidden',
- }),
- e('chips', { display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap' }),
- e('search', { width: '200px' }),
- // dsh-tauri-ui 无 Textarea 导出,多行正文/参数编辑器保留原生元素与自有外观。
- e('textarea', {
- width: '100%',
- boxSizing: 'border-box',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '7px 10px',
- outline: 'none',
- background: layer1,
- color: primary,
- font: 'inherit',
- fontSize: '13px',
- minHeight: '320px',
- resize: 'vertical',
- fontFamily: 'var(--ds-font-family-code)',
- lineHeight: '1.5',
- }, [
- c('&[data-short="true"]', { minHeight: '96px' }),
- c('&:focus-visible', {
- borderColor: business,
- boxShadow: `0 0 0 2px color-mix(in srgb,${business} 18%,transparent)`,
- }),
- ]),
- e('json-editor', { minHeight: '260px' }),
- e('md-preview', {
- minHeight: '320px',
- maxHeight: '60vh',
- overflowY: 'auto',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- padding: '8px 12px',
- background: layer1,
- fontSize: '13px',
- }),
- e('md-body', [
- c('& h1, & h2, & h3, & h4', { margin: '14px 0 6px', color: primary, lineHeight: '1.4' }),
- c('& h1', { fontSize: '18px' }),
- c('& h2', { fontSize: '16px' }),
- c('& h3', { fontSize: '14px' }),
- c('& h4', { fontSize: '13px' }),
- c('& p', { margin: '6px 0', lineHeight: '20px' }),
- c('& ul, & ol', { margin: '6px 0', paddingLeft: '20px' }),
- c('& code', {
- fontFamily: 'var(--ds-font-family-code)',
- fontSize: '12px',
- background: layer3,
- borderRadius: '4px',
- padding: '1px 5px',
- }),
- c('& pre', {
- margin: '8px 0',
- padding: '10px 12px',
- overflowX: 'auto',
- border: `1px solid ${border}`,
- borderRadius: '8px',
- background: layer3,
- }),
- c('& a', { color: business }),
- ]),
- e('tab-panel', { minWidth: '0', paddingTop: '2px' }),
- e('import-scroll', {
- display: 'flex',
- flexDirection: 'column',
- gap: '14px',
- maxHeight: 'min(400px,52vh)',
- overflowY: 'auto',
- padding: '2px 4px 2px 2px',
- }),
- e('import-group', { display: 'flex', flexDirection: 'column', gap: '8px' }),
- e('import-head', { display: 'flex', alignItems: 'center', gap: '8px', padding: '0 2px' }),
- e('import-count', { fontSize: '12px', lineHeight: '18px', color: tertiary }),
- e('import-all', { marginLeft: 'auto' }),
- c('@media (max-width: 680px)', [
- c('.dshp-extension__cards', { gridTemplateColumns: 'minmax(0,1fr)' }),
- c('.dshp-extension__search', { width: '140px' }),
- ]),
-])
diff --git a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx b/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx
index 8d06dc70..ab0b8ff3 100644
--- a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx
+++ b/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.tsx
@@ -1,8 +1,13 @@
-import type { ConfirmDialogOptions } from './confirm-dialog.types'
import { Button, Modal } from 'dsh-tauri-ui/client'
import { createRoot } from 'react-dom/client'
import { locale } from '../locales'
+export interface ConfirmDialogOptions {
+ title: string
+ description: string
+ confirmLabel: string
+}
+
/**
* 客户端样式确认框:确认 resolve(true),取消 / 关闭 resolve(false)。
* 内嵌 WebView2 的原生 confirm 会以嵌入页横幅出现且不随主题,这里用 primitives Modal 渲染。
diff --git a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.types.ts b/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.types.ts
deleted file mode 100644
index 6537d647..00000000
--- a/packages/dsh-tauri-rightclick/src/client/components/confirm-dialog.types.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export interface ConfirmDialogOptions {
- title: string
- description: string
- confirmLabel: string
-}
diff --git a/packages/dsh-tauri-scheduler/src/client/components/model-picker.tsx b/packages/dsh-tauri-scheduler/src/client/components/model-picker.tsx
index dfa4bfcd..ce82040f 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/model-picker.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/model-picker.tsx
@@ -10,18 +10,18 @@ type Pane = 'root' | 'model' | 'effort'
function optionCopy(label: string, description?: string): ReactElement {
return (
- <span className="dshp-scheduler__model-option-copy">
- <span className="dshp-scheduler__model-name">{label}</span>
- {description !== undefined && <span className="dshp-scheduler__model-description">{description}</span>}
+ <span className="flex min-w-0 flex-1 flex-col">
+ <span className="truncate text-[14px] font-medium leading-[20px]">{label}</span>
+ {description !== undefined && <span className="truncate text-tertiary text-[12px] leading-[18px]">{description}</span>}
</span>
)
}
function paneRow(label: string, hint: string): ReactElement {
return (
- <span className="dshp-scheduler__model-row">
- <span className="dshp-scheduler__model-row-label">{label}</span>
- <span className="dshp-scheduler__model-row-hint">{hint}</span>
+ <span className="flex items-center justify-between gap-[12px] w-full">
+ <span className="flex-none">{label}</span>
+ <span className="flex-1 min-w-0 text-tertiary text-right truncate">{hint}</span>
</span>
)
}
@@ -184,10 +184,10 @@ export function ModelPicker({
}}
badge={effortLabel === undefined
? undefined
- : <span className="dshp-scheduler__model-trigger-effort">{effortLabel}</span>}
+ : <span className="flex-none text-tertiary whitespace-nowrap">{effortLabel}</span>}
chevron={<Icon as={ChevronDown} />}
>
- <span className="dshp-scheduler__model-trigger-label">{trigger}</span>
+ <span className="min-w-0 truncate">{trigger}</span>
</Chip>
)}
/>
diff --git a/packages/dsh-tauri-scheduler/src/client/components/recommendations.tsx b/packages/dsh-tauri-scheduler/src/client/components/recommendations.tsx
index 0d100003..83f12ad7 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/recommendations.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/recommendations.tsx
@@ -62,25 +62,25 @@ export function Recommendations({ t, tasks }: RecommendationsProps): ReactElemen
const visible = RECOMMENDATIONS.filter(rec => !tasks.some(task => recommendationMatchesTask(rec, task, t)))
return (
- <section className="dshp-scheduler__recs" aria-label={t('recommended')}>
- <h2 className="dshp-scheduler__recs-title">{t('recommended')}</h2>
+ <section className="flex flex-col gap-[8px] mt-[20px]" aria-label={t('recommended')}>
+ <h2 className="m-0 text-[13px] leading-[20px] font-semibold">{t('recommended')}</h2>
{visible.length === 0
- ? <p className="dshp-scheduler__muted">{t('recommendedEmpty')}</p>
+ ? <p className="m-0 text-secondary text-[12px]">{t('recommendedEmpty')}</p>
: (
- <ul className="dshp-scheduler__recs-list">
+ <ul className="flex flex-col gap-[8px] m-0 p-0 list-none">
{visible.map(rec => (
<li key={rec.id}>
- <button type="button" className="dshp-scheduler__recs-item" onClick={() => void add(rec)}>
- <span className="dshp-scheduler__recs-icon" style={{ color: rec.accent }}>
+ <button type="button" className="box-border flex items-start gap-[10px] w-full min-w-0 px-[12px] py-[10px] border-none rounded-[10px] bg-transparent text-inherit [font-family:inherit] text-[13px] leading-[20px] text-left cursor-pointer hover:bg-hover" onClick={() => void add(rec)}>
+ <span className="flex-none inline-flex mt-[2px] text-[16px]" style={{ color: rec.accent }}>
<Icon as={rec.icon} />
</span>
- <span className="dshp-scheduler__recs-body">
- <span className="dshp-scheduler__recs-name">
+ <span className="flex flex-col gap-[2px] min-w-0">
+ <span className="text-primary text-[13px] leading-[18px] font-medium">
{t(rec.nameKey)}
{' '}
<span style={{ color: 'var(--dsw-alias-label-tertiary)' }}>{describeSchedule(rec.schedule, t)}</span>
</span>
- <span className="dshp-scheduler__recs-prompt">{t(rec.promptKey)}</span>
+ <span className="text-tertiary text-[12px] leading-[18px] truncate">{t(rec.promptKey)}</span>
</span>
</button>
</li>
diff --git a/packages/dsh-tauri-scheduler/src/client/components/runs-tab.tsx b/packages/dsh-tauri-scheduler/src/client/components/runs-tab.tsx
index 92a03524..ed02a663 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/runs-tab.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/runs-tab.tsx
@@ -1,7 +1,7 @@
import type { ReactElement } from 'react'
import type { LocaleKey, Translate } from '../locales/index.types'
import type { RunView } from '../types'
-import { Action, Alarm, CircleCheck, CircleDashed, CircleStop, CircleXmark, Dot, Icon, TrashBin } from 'dsh-tauri-ui/client'
+import { Action, Alarm, Card, CircleCheck, CircleDashed, CircleStop, CircleXmark, Dot, Icon, Text, TrashBin } from 'dsh-tauri-ui/client'
import { formatLocalTime, isRunUnread } from './schedule.utils'
export interface RunsTabProps {
@@ -36,14 +36,14 @@ const STATUS_ICONS = {
export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete }: RunsTabProps): ReactElement {
if (runs.length === 0)
- return <p className="dshp-scheduler__empty">{emptyLabel}</p>
+ return <Text size="sm" tone="tertiary" className="py-[48px] text-center">{emptyLabel}</Text>
return (
- <ul className="dshp-scheduler__runs-list">
+ <Card.List className="gap-[8px]">
{runs.map(run => (
- <li key={run.id} className="dshp-scheduler__card" onClick={() => onOpen(run)}>
+ <Card variant="link" key={run.id} className="box-border mx-0 flex justify-between items-center gap-[10px] w-full min-w-0 h-[60px] px-[12px] py-[10px] rounded-[10px] text-inherit [font-family:inherit] text-[13px] leading-[20px] text-left cursor-pointer overflow-hidden" onClick={() => onOpen(run)}>
<div style={{ height: 36 }}>
<span
- className="dshp-scheduler__card-icon"
+ className="flex-none inline-flex items-center justify-center mt-[2px] w-[16px] h-[16px] text-[16px] text-business data-[status=succeeded]:text-success data-[status=failed]:text-error data-[status=interrupted]:text-error data-[status=running]:text-secondary data-[status=queued]:text-secondary data-[status=cancelled]:text-tertiary data-[status=skipped]:text-tertiary"
data-status={run.status}
role="img"
aria-label={t(STATUS_KEYS[run.status])}
@@ -53,12 +53,12 @@ export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete
</span>
</div>
<div style={{ flex: 1, minWidth: 0 }}>
- <span className="dshp-scheduler__card-title" title={run.taskName}>
+ <Card.Title className="flex items-center gap-[8px] text-[13px] leading-[18px]" title={run.taskName}>
{run.taskName}
{isRunUnread(run, readAt, readIds) ? <Dot state="done" /> : null}
- </span>
- <div className="dshp-scheduler__card-meta">
- <span className="dshp-scheduler__card-meta-text">{formatLocalTime(run.startedAt) ?? ''}</span>
+ </Card.Title>
+ <div className="flex items-center gap-[10px] min-w-0">
+ <Card.Description className="flex-1 min-w-0 text-[12px] line-clamp-none truncate">{formatLocalTime(run.startedAt) ?? ''}</Card.Description>
</div>
</div>
<Action
@@ -70,8 +70,8 @@ export function RunsTab({ t, runs, readAt, readIds, emptyLabel, onOpen, onDelete
onDelete(run.id)
}}
/>
- </li>
+ </Card>
))}
- </ul>
+ </Card.List>
)
}
diff --git a/packages/dsh-tauri-scheduler/src/client/components/scheduler-nav-icon.tsx b/packages/dsh-tauri-scheduler/src/client/components/scheduler-nav-icon.tsx
index 7ba4c070..6592ee91 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/scheduler-nav-icon.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/scheduler-nav-icon.tsx
@@ -10,7 +10,7 @@ export function SchedulerNavIcon({ size }: { size: number }): ReactElement {
<>
<Icon as={Clock} size={size} />
{countUnreadRuns(state.runs, state.readAt, state.readIds) > 0
- ? <Dot className="dshp-scheduler__nav-dot" state="done" />
+ ? <Dot className="dshp-scheduler__nav-dot absolute right-[8px] top-1/2 -translate-y-1/2" state="done" />
: null}
</>
)
diff --git a/packages/dsh-tauri-scheduler/src/client/components/scheduler-panel.tsx b/packages/dsh-tauri-scheduler/src/client/components/scheduler-panel.tsx
index 67f4b21e..7b887ecc 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/scheduler-panel.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/scheduler-panel.tsx
@@ -1,7 +1,7 @@
import type { ReactElement } from 'react'
import type { Translate } from '../locales/index.types'
import type { RunView, TaskFormState, TaskView } from '../types'
-import { Button, Check, CommentPlus, Icon, Input, Magnifier, Plus, SegmentedControl } from 'dsh-tauri-ui/client'
+import { Button, Card, Check, CommentPlus, Icon, Input, Magnifier, Plus, SegmentedControl, Text } from 'dsh-tauri-ui/client'
import { filter, includes, isEmpty, lowerCase, omit, useEventListener } from 'dsh-tauri/client'
import { useCallback, useEffect, useRef, useState } from 'react'
import { REFRESH_INTERVAL_MS } from '../constants'
@@ -93,13 +93,13 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr
}
return (
- <div className="dshp-scheduler__shell">
- <header className="dshp-scheduler__top">
- <div className="dshp-scheduler__heading">
- <h1>{t('scheduler')}</h1>
- <p>{t('subtitle')}</p>
+ <div className="box-border font-sans text-primary text-[13px] leading-[1.5]">
+ <header className="flex justify-between items-start gap-[16px] mb-[12px]">
+ <div className="min-w-0">
+ <h1 className="m-0 text-[20px] leading-[28px] font-medium">{t('scheduler')}</h1>
+ <p className="mt-[4px] mx-0 mb-0 text-secondary text-[13px] leading-[20px]">{t('subtitle')}</p>
</div>
- <div className="dshp-scheduler__toolbar">
+ <div className="flex justify-end items-center gap-[16px]">
<Button style={{ flexShrink: 0 }} variant="addGhost" icon={<Icon as={CommentPlus} />} onClick={onViaChat}>
{t('viaChat')}
</Button>
@@ -109,9 +109,9 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr
</div>
</header>
- <div className="dshp-scheduler__search-bar">
+ <div className="flex justify-between items-center mb-[12px]">
<Input
- className="dshp-scheduler__search-wrap"
+ className="flex-[0_1_280px] min-w-0 max-w-[280px] max-[680px]:max-w-[160px]"
type="search"
icon={<Icon as={Magnifier} />}
aria-label={t('searchPlaceholder')}
@@ -128,7 +128,7 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr
: null}
</div>
- <div className="dshp-scheduler__tabs">
+ <div className="flex mt-[4px] mb-[14px]">
<SegmentedControl
id="dshp-scheduler-tabs"
label={t('scheduler')}
@@ -141,16 +141,16 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr
/>
</div>
- {state.error ? <p className="dshp-scheduler__error" role="alert">{state.error}</p> : null}
- {openError ? <p className="dshp-scheduler__error" role="alert">{openError}</p> : null}
+ {state.error ? <Text tone="error" role="alert">{state.error}</Text> : null}
+ {openError ? <Text tone="error" role="alert">{openError}</Text> : null}
{tab === 'tasks'
? (
<>
{filtered.length === 0
- ? <p className="dshp-scheduler__empty">{search ? t('noMatch') : t('emptyTasks')}</p>
+ ? <Text size="sm" tone="tertiary" className="py-[48px] text-center">{search ? t('noMatch') : t('emptyTasks')}</Text>
: (
- <ul className="dshp-scheduler__cards">
+ <Card.List className="gap-[8px]">
{filtered.map(task => (
<TaskCard
key={task.id}
@@ -162,7 +162,7 @@ export function SchedulerPanel({ t, onViaChat, onOpenSession }: SchedulerPanelPr
onEdit={task => setDialog({ taskId: task.id, initial: taskToForm(task) })}
/>
))}
- </ul>
+ </Card.List>
)}
<Recommendations t={t} tasks={state.tasks} />
</>
diff --git a/packages/dsh-tauri-scheduler/src/client/components/task-card.tsx b/packages/dsh-tauri-scheduler/src/client/components/task-card.tsx
index 61ff8c39..175a0f35 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/task-card.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/task-card.tsx
@@ -2,7 +2,8 @@ import type { MenuEntry } from 'dsh-tauri-ui/client'
import type { ReactElement } from 'react'
import type { LocaleKey, Translate } from '../locales/index.types'
import type { TaskView } from '../types'
-import { Action, Button, CirclePause, CirclePlay, EllipsisVertical, Icon, Menu, Modal, Tag, Toast, TrashBin, TriangleExclamation as Warning } from 'dsh-tauri-ui/client'
+import { Action, Button, Card, CirclePause, CirclePlay, EllipsisVertical, Icon, Menu, Modal, Tag, Text, Toast, TrashBin, TriangleExclamation as Warning } from 'dsh-tauri-ui/client'
+import { cn } from 'dsh-tauri/client'
import { useRef, useState } from 'react'
import { deleteTask, runTask, toggleTask } from '../service/scheduler'
@@ -72,9 +73,10 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar
]
return (
- <li
+ <Card
ref={cardRef}
- className={`${'dshp-scheduler__card'}${paused ? ` ${'dshp-scheduler__card--paused'}` : ''}`}
+ variant="link"
+ className={cn('box-border mx-0 flex justify-between items-center gap-[10px] w-full min-w-0 h-[60px] px-[12px] py-[10px] rounded-[10px] text-inherit [font-family:inherit] text-[13px] leading-[20px] text-left cursor-pointer overflow-hidden', paused && 'opacity-60')}
onClick={(event) => {
// 仅当点击落在卡片本体(title/meta 文本)时打开编辑;portaled 的菜单列表 /
// Modal 不是 li 的 DOM 后代,contains() 为 false,不触发编辑(避免误开弹窗)。
@@ -94,11 +96,11 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar
/>
</div>
<div style={{ flex: 1 }}>
- <span className="dshp-scheduler__card-title" title={task.name}>
+ <Card.Title className="flex items-center gap-[8px] text-[13px] leading-[18px]" title={task.name}>
{task.name}
- </span>
- <div className="dshp-scheduler__card-meta">
- <span className="dshp-scheduler__card-meta-text">
+ </Card.Title>
+ <div className="flex items-center gap-[10px] min-w-0">
+ <Card.Description className="flex-1 min-w-0 text-[12px] line-clamp-none truncate">
{describe}
{' · '}
{nextRun !== undefined
@@ -112,7 +114,7 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar
</>
)
: <strong>{t('paused')}</strong>}
- </span>
+ </Card.Description>
{task.waiting === true
? <Tag variant="status" tone="info">{t('waiting')}</Tag>
: null}
@@ -149,7 +151,7 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar
/>
)}
/>
- {actionError ? <p className="dshp-scheduler__error" role="alert">{actionError}</p> : null}
+ {actionError ? <Text tone="error" role="alert">{actionError}</Text> : null}
{toast !== null
? (
<Toast
@@ -175,6 +177,6 @@ export function TaskCard({ task, t, describe, nextRun, paused, onEdit }: TaskCar
</>
)}
/>
- </li>
+ </Card>
)
}
diff --git a/packages/dsh-tauri-scheduler/src/client/components/task-create-dialog.tsx b/packages/dsh-tauri-scheduler/src/client/components/task-create-dialog.tsx
index b3a901bf..1b3d2e70 100644
--- a/packages/dsh-tauri-scheduler/src/client/components/task-create-dialog.tsx
+++ b/packages/dsh-tauri-scheduler/src/client/components/task-create-dialog.tsx
@@ -1,7 +1,8 @@
-import type { ReactElement } from 'react'
+import type { SelectOption } from 'dsh-tauri-ui/client'
+import type { ReactElement, ReactNode } from 'react'
import type { LocaleKey, Translate } from '../locales/index.types'
import type { ScheduleForm, ScheduleKind, SchedulerOptions, TaskFormState, TaskInput, Weekday } from '../types'
-import { Button, ChevronDown, Chip, Icon, Input, Menu, Modal } from 'dsh-tauri-ui/client'
+import { Button, Input, Modal, Select, Text } from 'dsh-tauri-ui/client'
import { isEmpty, map, omitBy, pick, range } from 'dsh-tauri/client'
import { useRef, useState } from 'react'
import { SCHEDULE_KINDS } from '../../shared/constants'
@@ -45,11 +46,6 @@ const SCHEDULE_KIND_KEYS: Record<ScheduleKind, LocaleKey> = {
custom: 'scheduleCustom',
}
-interface SelectOption {
- value: string
- label: string
-}
-
/** 时间段选项:00:00 ~ 23:45,每 15 分钟一档。 */
const TIME_OPTIONS: SelectOption[] = range(96).map((index) => {
const total = index * 15
@@ -93,40 +89,14 @@ function defaultScheduleFor(kind: ScheduleForm['kind']): ScheduleForm {
}
}
-/** dsh-tauri-ui 没有独立 Select:统一用 Chip(selector) + Menu 组合。 */
-function Select({ label, value, options, onChange }: {
- label: string
- value: string
- options: readonly SelectOption[]
- onChange: (value: string) => void
-}): ReactElement {
- const [open, setOpen] = useState(false)
+/** 对话框内的字段:字段名 + 控件的紧凑堆叠(多控件字段用 `div`,单控件用 `label` 自动关联)。 */
+function TaskField({ label, as = 'div', children }: { label: ReactNode, as?: 'label' | 'div', children?: ReactNode }): ReactElement {
+ const Tag = as
return (
- <Menu
- open={open}
- onClose={() => setOpen(false)}
- onSelect={(id) => {
- setOpen(false)
- onChange(id)
- }}
- items={options.map(option => ({ id: option.value, label: option.label }))}
- selectedId={value}
- portal
- align="end"
- anchor={(
- <Chip
- variant="selector"
- open={open}
- aria-label={label}
- aria-haspopup="menu"
- aria-expanded={open}
- onClick={() => setOpen(openState => !openState)}
- chevron={<Icon as={ChevronDown} />}
- >
- <span>{options.find(option => option.value === value)?.label ?? value}</span>
- </Chip>
- )}
- />
+ <Tag className="flex flex-col gap-[2px] min-w-0 text-[13px]">
+ <span className="inline-flex items-center gap-[10px] text-secondary text-[12px] font-medium leading-[18px]">{label}</span>
+ {children}
+ </Tag>
)
}
@@ -210,7 +180,7 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC
title={taskId ? t('editDialogTitle') : t('createDialogTitle')}
description={t('dialogHint')}
closeLabel={t('close')}
- className="dshp-scheduler__modal"
+ className="w-[min(640px,100%)]!"
footer={(
<>
<Button variant="outline" disabled={saving} onClick={closeSafe}>{t('cancel')}</Button>
@@ -221,19 +191,17 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC
)}
>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
- <label className="dshp-scheduler__field">
- <span className="dshp-scheduler__field-label">{t('taskName')}</span>
+ <TaskField as="label" label={t('taskName')}>
<Input
type="text"
value={form.name}
placeholder={t('taskNamePlaceholder')}
onChange={event => setForm(state => ({ ...state, name: event.target.value }))}
/>
- </label>
+ </TaskField>
- <div className="dshp-scheduler__field">
- <span className="dshp-scheduler__field-label">{t('schedule')}</span>
- <div className="dshp-scheduler__inline">
+ <TaskField label={t('schedule')}>
+ <div className="flex flex-wrap gap-[8px] items-center">
<Select
label={t('schedule')}
value={scheduleKind}
@@ -244,7 +212,7 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC
{scheduleKind === 'once'
? (
<Input
- className="dshp-scheduler__schedule-once"
+ className="flex-1 min-w-0"
type="datetime-local"
value={String(form.schedule.at).slice(0, 16)}
onChange={event => setSchedule({ kind: 'once', at: new Date(event.target.value).toISOString() })}
@@ -333,18 +301,17 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC
/>
)}
</div>
- </div>
+ </TaskField>
- <div className="dshp-scheduler__field">
- <span className="dshp-scheduler__field-label">{t('schedulePrompt')}</span>
- <div className="dshp-scheduler__prompt-wrap">
+ <TaskField label={t('schedulePrompt')}>
+ <div className="relative flex flex-col items-end gap-[8px]">
<textarea
- className="dshp-scheduler__textarea"
+ className="box-border w-full h-auto min-h-[240px] p-[10px] pb-[46px] border-[0.5px] border-border-l4 rounded-[8px] [font-family:inherit] bg-layer-1 text-primary text-[14px] leading-[1.55] resize-y outline-none focus:border-brand placeholder:text-dimmed"
value={form.prompt}
placeholder={t('schedulePromptPlaceholder')}
onChange={event => setForm(state => ({ ...state, prompt: event.target.value }))}
/>
- <div className="dshp-scheduler__composer">
+ <div className="flex gap-[8px] items-center">
<Select
label={t('workspace')}
value={form.workspaceId}
@@ -381,9 +348,9 @@ export function TaskCreateDialog({ t, options, onClose, taskId, initial }: TaskC
/>
</div>
</div>
- </div>
+ </TaskField>
</div>
- {error ? <p className="dshp-scheduler__error" role="alert">{error}</p> : null}
+ {error ? <Text tone="error" role="alert">{error}</Text> : null}
</Modal>
)
}
diff --git a/packages/dsh-tauri-scheduler/src/client/styles/index.cssr.ts b/packages/dsh-tauri-scheduler/src/client/styles/index.cssr.ts
index dddffe52..89aa951b 100644
--- a/packages/dsh-tauri-scheduler/src/client/styles/index.cssr.ts
+++ b/packages/dsh-tauri-scheduler/src/client/styles/index.cssr.ts
@@ -2,73 +2,15 @@ import { cssr, styles as sharedStyles } from 'dsh-tauri-ui/client'
import { SESSION_ICON_ATTRIBUTE } from '../constants'
const { c } = cssr
-const { primary, secondary, tertiary, dimmed, borderL4, brand, business, layer1, font, hover, error, success } = sharedStyles
+const { secondary } = sharedStyles
+/**
+ * 全局样式:只压官方会话树(`[role="treeitem"]`)——图标座位由 DOM 观察器注入,
+ * 侧栏导航按钮里那个未读点也要靠 `:has()` 反过来定位宿主按钮。组件自身样式一律写在
+ * 组件的 `className` 上(见 `components/scheduler.classes.ts` 与各组件)。
+ */
export default c([
- c('.dshp-scheduler__shell', { boxSizing: 'border-box', color: primary, fontFamily: font, fontSize: '13px', lineHeight: '1.5' }),
- c('.dshp-scheduler__top', { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: '16px', marginBottom: '12px' }),
- c('.dshp-scheduler__heading', { minWidth: '0' }),
- c('.dshp-scheduler__heading h1', { margin: '0', fontSize: '20px', lineHeight: '28px', fontWeight: '500' }),
- c('.dshp-scheduler__heading p', { margin: '4px 0 0', color: secondary, fontSize: '13px', lineHeight: '20px' }),
- c('.dshp-scheduler__toolbar', { display: 'flex', justifyContent: 'flex-end', alignItems: 'center', gap: '16px' }),
- c('.dshp-scheduler__search-bar', { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '12px' }),
- c('.dshp-scheduler__search-wrap', { flex: '0 1 280px', minWidth: '0', maxWidth: '280px' }),
- c('.dshp-scheduler__tabs', { display: 'flex', margin: '4px 0 14px' }),
- c('.dshp-scheduler__cards', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),
- c('.dshp-scheduler__runs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),
- c('.dshp-scheduler__empty', { margin: '0', padding: '48px 0', color: tertiary, fontSize: '13px', textAlign: 'center' }),
- c('.dshp-scheduler__error', { margin: '0', color: error, fontSize: '12px', lineHeight: '18px' }),
- c('@media (max-width: 680px)', [c('.dshp-scheduler__search-wrap', { maxWidth: '160px' })]),
-
- c('.dshp-scheduler__modal', { width: 'min(640px,100%) !important' }),
- c('.dshp-scheduler__field', { display: 'flex', flexDirection: 'column', gap: '2px', minWidth: '0', fontSize: '13px' }),
- c('.dshp-scheduler__field-label', { display: 'inline-flex', alignItems: 'center', gap: '10px', color: secondary, fontSize: '12px', fontWeight: '500', lineHeight: '18px' }),
- c('.dshp-scheduler__inline', { display: 'flex', flexWrap: 'wrap', gap: '8px', alignItems: 'center' }),
- c('.dshp-scheduler__schedule-once', { flex: '1', minWidth: '0' }),
- c('.dshp-scheduler__prompt-wrap', { position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: '8px' }),
- c('.dshp-scheduler__composer', { display: 'flex', gap: '8px', alignItems: 'center' }),
- c('.dshp-scheduler__textarea', { boxSizing: 'border-box', border: `.5px solid ${borderL4}`, width: '100%', height: 'auto', minHeight: '240px', font: 'inherit', background: layer1, color: primary, borderRadius: '8px', padding: '10px', paddingBottom: '46px', fontSize: '14px', lineHeight: '1.55', resize: 'vertical', outline: 'none' }),
- c('.dshp-scheduler__textarea:focus', { borderColor: brand }),
- c('.dshp-scheduler__textarea::placeholder', { color: dimmed }),
-
- c('.dshp-scheduler__card', { boxSizing: 'border-box', display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '10px', width: '100%', minWidth: '0', height: '60px', padding: '10px 12px', borderRadius: '10px', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: '13px', lineHeight: '20px', textAlign: 'left', cursor: 'pointer', overflow: 'hidden' }),
- c('.dshp-scheduler__card:hover', { background: hover }),
- c('.dshp-scheduler__card--paused', { opacity: '.6' }),
- c('.dshp-scheduler__card-title', { display: 'flex', alignItems: 'center', gap: '8px', margin: '0', fontSize: '13px', lineHeight: '18px', fontWeight: '500', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__card-icon', { flex: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginTop: '2px', width: '16px', height: '16px', fontSize: '16px', color: business }),
- c('.dshp-scheduler__card-icon[data-status="succeeded"]', { color: success }),
- c('.dshp-scheduler__card-icon[data-status="failed"],.dshp-scheduler__card-icon[data-status="interrupted"]', { color: error }),
- c('.dshp-scheduler__card-icon[data-status="running"],.dshp-scheduler__card-icon[data-status="queued"]', { color: secondary }),
- c('.dshp-scheduler__card-icon[data-status="cancelled"],.dshp-scheduler__card-icon[data-status="skipped"]', { color: tertiary }),
- c('.dshp-scheduler__card-meta', { display: 'flex', alignItems: 'center', gap: '10px', minWidth: '0' }),
- c('.dshp-scheduler__card-meta-text', { flex: '1', minWidth: '0', color: tertiary, fontSize: '12px', lineHeight: '18px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__card-meta-text strong', { color: secondary, fontWeight: '600' }),
-
- c('button:has(.dshp-scheduler__nav-dot)', { position: 'relative' }),
- c('button:has(.dshp-scheduler__nav-dot) .dshp-scheduler__nav-dot', { position: 'absolute', right: '8px', top: '50%', transform: 'translateY(-50%)' }),
-
- c('.dshp-scheduler__recs', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '20px 0 0' }),
- c('.dshp-scheduler__recs-title', { margin: '0', fontSize: '13px', lineHeight: '20px', fontWeight: '600' }),
- c('.dshp-scheduler__recs-list', { display: 'flex', flexDirection: 'column', gap: '8px', margin: '0', padding: '0', listStyle: 'none' }),
- c('.dshp-scheduler__recs-item', { boxSizing: 'border-box', display: 'flex', alignItems: 'flex-start', gap: '10px', width: '100%', minWidth: '0', padding: '10px 12px', border: 'none', borderRadius: '10px', background: 'transparent', color: 'inherit', font: 'inherit', fontSize: '13px', lineHeight: '20px', textAlign: 'left', cursor: 'pointer' }),
- c('.dshp-scheduler__recs-item:hover', { background: hover }),
- c('.dshp-scheduler__recs-icon', { flex: 'none', display: 'inline-flex', marginTop: '2px', fontSize: '16px' }),
- c('.dshp-scheduler__recs-body', { display: 'flex', flexDirection: 'column', gap: '2px', minWidth: '0' }),
- c('.dshp-scheduler__recs-name', { color: primary, fontSize: '13px', lineHeight: '18px', fontWeight: '500' }),
- c('.dshp-scheduler__recs-name strong', { color: secondary, fontWeight: '600' }),
- c('.dshp-scheduler__recs-prompt', { color: tertiary, fontSize: '12px', lineHeight: '18px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__muted', { margin: '0', color: secondary, fontSize: '12px' }),
-
- c('.dshp-scheduler__model-trigger-label', { minWidth: '0', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__model-trigger-effort', { flex: 'none', color: tertiary, whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__model-row', { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', width: '100%' }),
- c('.dshp-scheduler__model-row-label', { flex: 'none' }),
- c('.dshp-scheduler__model-row-hint', { flex: '1', minWidth: '0', overflow: 'hidden', color: tertiary, textAlign: 'right', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__model-option-copy', { display: 'flex', minWidth: '0', flex: '1', flexDirection: 'column' }),
- c('.dshp-scheduler__model-name', { overflow: 'hidden', fontSize: '14px', fontWeight: '500', lineHeight: '20px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
- c('.dshp-scheduler__model-description', { overflow: 'hidden', color: tertiary, fontSize: '12px', lineHeight: '18px', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }),
-
- // register/session-icons.ts 通过 DOM 观察器注入侧边栏会话行时钟图标
c(`[${SESSION_ICON_ATTRIBUTE}]`, { width: '16px', height: '20px', flex: 'none', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginLeft: '2px', marginRight: '5px', color: secondary }),
c('[role="treeitem"]', { position: 'relative' }),
+ c('button:has(.dshp-scheduler__nav-dot)', { position: 'relative' }),
])
diff --git a/packages/dsh-tauri-taiwindcss/src/client/styles/taiwindcss.ts b/packages/dsh-tauri-taiwindcss/src/client/styles/taiwindcss.ts
index 22f02790..7c179e97 100644
--- a/packages/dsh-tauri-taiwindcss/src/client/styles/taiwindcss.ts
+++ b/packages/dsh-tauri-taiwindcss/src/client/styles/taiwindcss.ts
@@ -39,12 +39,21 @@ const TAIWINDCSS_GENERATED = `
.inset-0 {
inset: calc(var(--spacing) * 0);
}
+ .top-1\\/2 {
+ top: calc(1/2 * 100%);
+ }
+ .right-\\[8px\\] {
+ right: 8px;
+ }
.isolate {
isolation: isolate;
}
.z-30 {
z-index: 30;
}
+ .z-\\[1\\] {
+ z-index: 1;
+ }
.z-\\[2\\] {
z-index: 2;
}
@@ -78,12 +87,21 @@ const TAIWINDCSS_GENERATED = `
.mx-0 {
margin-inline: calc(var(--spacing) * 0);
}
+ .mx-\\[-8px\\] {
+ margin-inline: -8px;
+ }
.mx-auto {
margin-inline: auto;
}
+ .my-0 {
+ margin-block: calc(var(--spacing) * 0);
+ }
.my-\\[4px\\] {
margin-block: 4px;
}
+ .mt-\\[2px\\] {
+ margin-top: 2px;
+ }
.mt-\\[4px\\] {
margin-top: 4px;
}
@@ -93,9 +111,21 @@ const TAIWINDCSS_GENERATED = `
.mt-\\[8px\\] {
margin-top: 8px;
}
+ .mt-\\[20px\\] {
+ margin-top: 20px;
+ }
+ .mb-0 {
+ margin-bottom: calc(var(--spacing) * 0);
+ }
.mb-\\[10px\\] {
margin-bottom: 10px;
}
+ .mb-\\[12px\\] {
+ margin-bottom: 12px;
+ }
+ .mb-\\[14px\\] {
+ margin-bottom: 14px;
+ }
.-ml-1 {
margin-left: calc(var(--spacing) * -1);
}
@@ -105,6 +135,24 @@ const TAIWINDCSS_GENERATED = `
.box-border {
box-sizing: border-box;
}
+ .line-clamp-1 {
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 1;
+ }
+ .line-clamp-2 {
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ }
+ .line-clamp-none {
+ overflow: visible;
+ display: block;
+ -webkit-box-orient: horizontal;
+ -webkit-line-clamp: unset;
+ }
.block {
display: block;
}
@@ -141,6 +189,9 @@ const TAIWINDCSS_GENERATED = `
.h-\\[18px\\] {
height: 18px;
}
+ .h-\\[22px\\] {
+ height: 22px;
+ }
.h-\\[24px\\] {
height: 24px;
}
@@ -162,30 +213,63 @@ const TAIWINDCSS_GENERATED = `
.h-\\[42px\\] {
height: 42px;
}
+ .h-\\[48px\\] {
+ height: 48px;
+ }
.h-\\[56px\\] {
height: 56px;
}
+ .h-\\[60px\\] {
+ height: 60px;
+ }
.h-\\[calc\\(28px\\+var\\(--dsh-content-font-delta\\,0px\\)\\)\\] {
height: calc(28px + var(--dsh-content-font-delta,0px));
}
+ .h-auto {
+ height: auto;
+ }
.h-full {
height: 100%;
}
+ .max-h-\\[60vh\\] {
+ max-height: 60vh;
+ }
.max-h-\\[180px\\] {
max-height: 180px;
}
+ .max-h-\\[calc\\(100vh-160px\\)\\]\\! {
+ max-height: calc(100vh - 160px) !important;
+ }
+ .max-h-\\[min\\(400px\\,52vh\\)\\] {
+ max-height: min(400px, 52vh);
+ }
.min-h-0 {
min-height: calc(var(--spacing) * 0);
}
.min-h-\\[28px\\] {
min-height: 28px;
}
+ .min-h-\\[96px\\] {
+ min-height: 96px;
+ }
+ .min-h-\\[240px\\] {
+ min-height: 240px;
+ }
+ .min-h-\\[260px\\] {
+ min-height: 260px;
+ }
+ .min-h-\\[320px\\] {
+ min-height: 320px;
+ }
.w-\\[8px\\] {
width: 8px;
}
.w-\\[16px\\] {
width: 16px;
}
+ .w-\\[22px\\] {
+ width: 22px;
+ }
.w-\\[24px\\] {
width: 24px;
}
@@ -195,9 +279,15 @@ const TAIWINDCSS_GENERATED = `
.w-\\[36px\\] {
width: 36px;
}
+ .w-\\[48px\\] {
+ width: 48px;
+ }
.w-\\[56px\\] {
width: 56px;
}
+ .w-\\[200px\\] {
+ width: 200px;
+ }
.w-\\[calc\\(28px\\+var\\(--dsh-content-font-delta\\,0px\\)\\)\\] {
width: calc(28px + var(--dsh-content-font-delta,0px));
}
@@ -207,6 +297,15 @@ const TAIWINDCSS_GENERATED = `
.w-\\[calc\\(100\\%_-_2_\\*_var\\(--dsh-composer-side-clearance\\)_-_4_\\*_var\\(--dsh-composer-dock-inset\\)\\)\\] {
width: calc(100% - 2 * var(--dsh-composer-side-clearance) - 4 * var(--dsh-composer-dock-inset));
}
+ .w-\\[min\\(640px\\,100\\%\\)\\]\\! {
+ width: min(640px, 100%) !important;
+ }
+ .w-\\[min\\(680px\\,100\\%\\)\\]\\! {
+ width: min(680px, 100%) !important;
+ }
+ .w-\\[min\\(760px\\,100\\%\\)\\]\\! {
+ width: min(760px, 100%) !important;
+ }
.w-\\[min\\(calc\\(var\\(--dsh-composer-card-max-width\\)_\\+_2_\\*_var\\(--dsh-composer-side-clearance\\)\\)\\,100\\%\\)\\] {
width: min(calc(var(--dsh-composer-card-max-width) + 2 * var(--dsh-composer-side-clearance)), 100%);
}
@@ -222,24 +321,37 @@ const TAIWINDCSS_GENERATED = `
.max-w-\\[220px\\] {
max-width: 220px;
}
+ .max-w-\\[280px\\] {
+ max-width: 280px;
+ }
.max-w-\\[calc\\(var\\(--dsh-composer-card-max-width\\)_-_4_\\*_var\\(--dsh-composer-dock-inset\\)\\)\\] {
max-width: calc(var(--dsh-composer-card-max-width) - 4 * var(--dsh-composer-dock-inset));
}
.max-w-\\[min\\(100\\%\\,240px\\)\\] {
max-width: min(100%, 240px);
}
+ .max-w-full {
+ max-width: 100%;
+ }
.min-w-0 {
min-width: calc(var(--spacing) * 0);
}
.flex-1 {
flex: 1;
}
+ .flex-\\[0_1_280px\\] {
+ flex: 0 1 280px;
+ }
.flex-none {
flex: none;
}
.shrink-0 {
flex-shrink: 0;
}
+ .-translate-y-1\\/2 {
+ --tw-translate-y: calc(calc(1/2 * 100%) * -1);
+ translate: var(--tw-translate-x) var(--tw-translate-y);
+ }
.transform {
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
}
@@ -258,6 +370,18 @@ const TAIWINDCSS_GENERATED = `
.resize {
resize: both;
}
+ .resize-y {
+ resize: vertical;
+ }
+ .list-none {
+ list-style-type: none;
+ }
+ .grid-cols-\\[minmax\\(0\\,1fr\\)\\] {
+ grid-template-columns: minmax(0,1fr);
+ }
+ .grid-cols-\\[repeat\\(2\\,minmax\\(0\\,1fr\\)\\)\\] {
+ grid-template-columns: repeat(2,minmax(0,1fr));
+ }
.grid-rows-\\[0fr\\] {
grid-template-rows: 0fr;
}
@@ -273,12 +397,24 @@ const TAIWINDCSS_GENERATED = `
.items-center {
align-items: center;
}
+ .items-end {
+ align-items: flex-end;
+ }
+ .items-start {
+ align-items: flex-start;
+ }
+ .items-stretch {
+ align-items: stretch;
+ }
.justify-between {
justify-content: space-between;
}
.justify-center {
justify-content: center;
}
+ .justify-end {
+ justify-content: flex-end;
+ }
.gap-0 {
gap: calc(var(--spacing) * 0);
}
@@ -294,6 +430,9 @@ const TAIWINDCSS_GENERATED = `
.gap-\\[6px\\] {
gap: 6px;
}
+ .gap-\\[7px\\] {
+ gap: 7px;
+ }
.gap-\\[8px\\] {
gap: 8px;
}
@@ -353,12 +492,18 @@ const TAIWINDCSS_GENERATED = `
.rounded-full {
border-radius: calc(infinity * 1px);
}
+ .rounded-lg {
+ border-radius: var(--dsw-radius-lg);
+ }
.rounded-md {
border-radius: var(--dsw-radius-md);
}
.rounded-sm {
border-radius: var(--dsw-radius-sm);
}
+ .rounded-xl {
+ border-radius: var(--dsw-radius-xl);
+ }
.rounded-xs {
border-radius: var(--dsw-radius-xs);
}
@@ -409,6 +554,24 @@ const TAIWINDCSS_GENERATED = `
.border-border-weak {
border-color: var(--dsw-alias-border-weak);
}
+ .border-business\\/35 {
+ border-color: var(--dsw-alias-state-business-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in oklab, var(--dsw-alias-state-business-primary) 35%, transparent);
+ }
+ }
+ .border-error\\/35 {
+ border-color: var(--dsw-alias-state-error-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in oklab, var(--dsw-alias-state-error-primary) 35%, transparent);
+ }
+ }
+ .border-success\\/35 {
+ border-color: var(--dsw-alias-state-success-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in oklab, var(--dsw-alias-state-success-primary) 35%, transparent);
+ }
+ }
.bg-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-business-primary\\)_8\\%\\,transparent\\)\\] {
background-color: var(--dsw-alias-state-business-primary);
@supports (color: color-mix(in lab, red, red)) {
@@ -430,18 +593,39 @@ const TAIWINDCSS_GENERATED = `
.bg-border-l2 {
background-color: var(--dsw-alias-border-l2);
}
+ .bg-business\\/8 {
+ background-color: var(--dsw-alias-state-business-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in oklab, var(--dsw-alias-state-business-primary) 8%, transparent);
+ }
+ }
+ .bg-error\\/8 {
+ background-color: var(--dsw-alias-state-error-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in oklab, var(--dsw-alias-state-error-primary) 8%, transparent);
+ }
+ }
.bg-hover {
background-color: var(--dsw-alias-interactive-bg-hover);
}
.bg-layer-1 {
background-color: var(--dsw-alias-bg-layer-1);
}
+ .bg-layer-3 {
+ background-color: var(--dsw-alias-bg-layer-3);
+ }
.bg-module-platform {
background-color: var(--dsw-alias-bg-module-platform);
}
.bg-primary-fill {
background-color: var(--dsw-alias-button-primary-fill);
}
+ .bg-success\\/8 {
+ background-color: var(--dsw-alias-state-success-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in oklab, var(--dsw-alias-state-success-primary) 8%, transparent);
+ }
+ }
.bg-transparent {
background-color: transparent;
}
@@ -457,9 +641,15 @@ const TAIWINDCSS_GENERATED = `
.p-\\[6px\\] {
padding: 6px;
}
+ .p-\\[8px\\] {
+ padding: 8px;
+ }
.p-\\[10px\\] {
padding: 10px;
}
+ .px-\\[2px\\] {
+ padding-inline: 2px;
+ }
.px-\\[7px\\] {
padding-inline: 7px;
}
@@ -487,12 +677,18 @@ const TAIWINDCSS_GENERATED = `
.py-\\[1px\\] {
padding-block: 1px;
}
+ .py-\\[2px\\] {
+ padding-block: 2px;
+ }
.py-\\[4px\\] {
padding-block: 4px;
}
.py-\\[6px\\] {
padding-block: 6px;
}
+ .py-\\[7px\\] {
+ padding-block: 7px;
+ }
.py-\\[8px\\] {
padding-block: 8px;
}
@@ -511,6 +707,12 @@ const TAIWINDCSS_GENERATED = `
.py-\\[28px\\] {
padding-block: 28px;
}
+ .py-\\[48px\\] {
+ padding-block: 48px;
+ }
+ .pt-\\[2px\\] {
+ padding-top: 2px;
+ }
.pt-\\[28px\\] {
padding-top: 28px;
}
@@ -523,9 +725,15 @@ const TAIWINDCSS_GENERATED = `
.pr-\\[10px\\] {
padding-right: 10px;
}
+ .pb-\\[46px\\] {
+ padding-bottom: 46px;
+ }
.pb-\\[48px\\] {
padding-bottom: 48px;
}
+ .pl-\\[2px\\] {
+ padding-left: 2px;
+ }
.pl-\\[8px\\] {
padding-left: 8px;
}
@@ -538,6 +746,9 @@ const TAIWINDCSS_GENERATED = `
.text-left {
text-align: left;
}
+ .text-right {
+ text-align: right;
+ }
.\\[font-family\\:cursive\\] {
font-family: cursive;
}
@@ -547,6 +758,12 @@ const TAIWINDCSS_GENERATED = `
.\\[font-family\\:monospace\\] {
font-family: monospace;
}
+ .\\[font-family\\:var\\(--ds-font-family-code\\)\\] {
+ font-family: var(--ds-font-family-code);
+ }
+ .font-sans {
+ font-family: var(--dsw-font-family);
+ }
.text-\\[10px\\] {
font-size: 10px;
}
@@ -562,9 +779,23 @@ const TAIWINDCSS_GENERATED = `
.text-\\[14px\\] {
font-size: 14px;
}
+ .text-\\[16px\\] {
+ font-size: 16px;
+ }
+ .text-\\[20px\\] {
+ font-size: 20px;
+ }
.text-\\[28px\\] {
font-size: 28px;
}
+ .leading-\\[1\\.5\\] {
+ --tw-leading: 1.5;
+ line-height: 1.5;
+ }
+ .leading-\\[1\\.55\\] {
+ --tw-leading: 1.55;
+ line-height: 1.55;
+ }
.leading-\\[16px\\] {
--tw-leading: 16px;
line-height: 16px;
@@ -589,6 +820,10 @@ const TAIWINDCSS_GENERATED = `
--tw-leading: 24px;
line-height: 24px;
}
+ .leading-\\[28px\\] {
+ --tw-leading: 28px;
+ line-height: 28px;
+ }
.leading-none {
--tw-leading: 1;
line-height: 1;
@@ -623,6 +858,12 @@ const TAIWINDCSS_GENERATED = `
.text-\\[var\\(--dsw-alias-label-secondary\\,var\\(--dsw-alias-label-primary\\)\\)\\] {
color: var(--dsw-alias-label-secondary,var(--dsw-alias-label-primary));
}
+ .text-business {
+ color: var(--dsw-alias-state-business-primary);
+ }
+ .text-dimmed {
+ color: var(--dsw-alias-label-dimmed);
+ }
.text-error {
color: var(--dsw-alias-state-error-primary);
}
@@ -678,6 +919,12 @@ const TAIWINDCSS_GENERATED = `
.opacity-0 {
opacity: 0%;
}
+ .opacity-55 {
+ opacity: 55%;
+ }
+ .opacity-60 {
+ opacity: 60%;
+ }
.opacity-100 {
opacity: 100%;
}
@@ -939,6 +1186,11 @@ const TAIWINDCSS_GENERATED = `
border-color: var(--dsw-alias-brand-primary);
}
}
+ .focus-visible\\:border-business {
+ &:focus-visible {
+ border-color: var(--dsw-alias-state-business-primary);
+ }
+ }
.focus-visible\\:bg-\\[var\\(--dsw-alias-bg-layer-4\\)\\] {
&:focus-visible {
background-color: var(--dsw-alias-bg-layer-4);
@@ -949,6 +1201,15 @@ const TAIWINDCSS_GENERATED = `
color: var(--dsw-alias-label-secondary);
}
}
+ .focus-visible\\:shadow-\\[0_0_0_2px_color-mix\\(in_srgb\\,var\\(--dsw-alias-state-business-primary\\)_18\\%\\,transparent\\)\\] {
+ &:focus-visible {
+ --tw-shadow: 0 0 0 2px var(--tw-shadow-color, var(--dsw-alias-state-business-primary));
+ @supports (color: color-mix(in lab, red, red)) {
+ --tw-shadow: 0 0 0 2px var(--tw-shadow-color, color-mix(in srgb,var(--dsw-alias-state-business-primary) 18%,transparent));
+ }
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
+ }
+ }
.focus-visible\\:shadow-focus-ring {
&:focus-visible {
--tw-shadow: 0 0 0 2px var(--tw-shadow-color, var(--dsw-alias-border-l3));
@@ -1043,11 +1304,99 @@ const TAIWINDCSS_GENERATED = `
color: var(--dsw-alias-label-secondary);
}
}
+ .data-\\[kind\\=error\\]\\:border-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-error-primary\\)_35\\%\\,transparent\\)\\] {
+ &[data-kind="error"] {
+ border-color: var(--dsw-alias-state-error-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in srgb,var(--dsw-alias-state-error-primary) 35%,transparent);
+ }
+ }
+ }
+ .data-\\[kind\\=error\\]\\:bg-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-error-primary\\)_8\\%\\,transparent\\)\\] {
+ &[data-kind="error"] {
+ background-color: var(--dsw-alias-state-error-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);
+ }
+ }
+ }
+ .data-\\[kind\\=info\\]\\:border-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-business-primary\\)_35\\%\\,transparent\\)\\] {
+ &[data-kind="info"] {
+ border-color: var(--dsw-alias-state-business-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in srgb,var(--dsw-alias-state-business-primary) 35%,transparent);
+ }
+ }
+ }
+ .data-\\[kind\\=info\\]\\:bg-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-business-primary\\)_8\\%\\,transparent\\)\\] {
+ &[data-kind="info"] {
+ background-color: var(--dsw-alias-state-business-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in srgb,var(--dsw-alias-state-business-primary) 8%,transparent);
+ }
+ }
+ }
+ .data-\\[kind\\=ok\\]\\:border-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-success-primary\\)_35\\%\\,transparent\\)\\] {
+ &[data-kind="ok"] {
+ border-color: var(--dsw-alias-state-success-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ border-color: color-mix(in srgb,var(--dsw-alias-state-success-primary) 35%,transparent);
+ }
+ }
+ }
+ .data-\\[kind\\=ok\\]\\:bg-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-success-primary\\)_8\\%\\,transparent\\)\\] {
+ &[data-kind="ok"] {
+ background-color: var(--dsw-alias-state-success-primary);
+ @supports (color: color-mix(in lab, red, red)) {
+ background-color: color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent);
+ }
+ }
+ }
.data-\\[open\\=true\\]\\:rotate-180 {
&[data-open="true"] {
rotate: 180deg;
}
}
+ .data-\\[short\\=true\\]\\:min-h-\\[96px\\] {
+ &[data-short="true"] {
+ min-height: 96px;
+ }
+ }
+ .data-\\[status\\=cancelled\\]\\:text-tertiary {
+ &[data-status="cancelled"] {
+ color: var(--dsw-alias-label-tertiary);
+ }
+ }
+ .data-\\[status\\=failed\\]\\:text-error {
+ &[data-status="failed"] {
+ color: var(--dsw-alias-state-error-primary);
+ }
+ }
+ .data-\\[status\\=interrupted\\]\\:text-error {
+ &[data-status="interrupted"] {
+ color: var(--dsw-alias-state-error-primary);
+ }
+ }
+ .data-\\[status\\=queued\\]\\:text-secondary {
+ &[data-status="queued"] {
+ color: var(--dsw-alias-label-secondary);
+ }
+ }
+ .data-\\[status\\=running\\]\\:text-secondary {
+ &[data-status="running"] {
+ color: var(--dsw-alias-label-secondary);
+ }
+ }
+ .data-\\[status\\=skipped\\]\\:text-tertiary {
+ &[data-status="skipped"] {
+ color: var(--dsw-alias-label-tertiary);
+ }
+ }
+ .data-\\[status\\=succeeded\\]\\:text-success {
+ &[data-status="succeeded"] {
+ color: var(--dsw-alias-state-success-primary);
+ }
+ }
.data-\\[tone\\=danger\\]\\:bg-\\[color-mix\\(in_srgb\\,var\\(--dsw-alias-state-error-primary\\)_10\\%\\,transparent\\)\\] {
&[data-tone="danger"] {
background-color: var(--dsw-alias-state-error-primary);
@@ -1100,16 +1449,282 @@ const TAIWINDCSS_GENERATED = `
color: var(--dsw-alias-label-tertiary);
}
}
+ .max-\\[680px\\]\\:w-\\[140px\\] {
+ @media (width < 680px) {
+ width: 140px;
+ }
+ }
+ .max-\\[680px\\]\\:max-w-\\[160px\\] {
+ @media (width < 680px) {
+ max-width: 160px;
+ }
+ }
+ .max-\\[680px\\]\\:grid-cols-\\[minmax\\(0\\,1fr\\)\\] {
+ @media (width < 680px) {
+ grid-template-columns: minmax(0,1fr);
+ }
+ }
.\\@max-\\[460px\\]\\:hidden {
@container (width < 460px) {
display: none;
}
}
+ .\\[\\&_a\\]\\:text-business {
+ & a {
+ color: var(--dsw-alias-state-business-primary);
+ }
+ }
+ .\\[\\&_code\\]\\:rounded-\\[4px\\] {
+ & code {
+ border-radius: 4px;
+ }
+ }
+ .\\[\\&_code\\]\\:bg-layer-3 {
+ & code {
+ background-color: var(--dsw-alias-bg-layer-3);
+ }
+ }
+ .\\[\\&_code\\]\\:px-\\[5px\\] {
+ & code {
+ padding-inline: 5px;
+ }
+ }
+ .\\[\\&_code\\]\\:py-\\[1px\\] {
+ & code {
+ padding-block: 1px;
+ }
+ }
+ .\\[\\&_code\\]\\:\\[font-family\\:var\\(--ds-font-family-code\\)\\] {
+ & code {
+ font-family: var(--ds-font-family-code);
+ }
+ }
+ .\\[\\&_code\\]\\:text-\\[12px\\] {
+ & code {
+ font-size: 12px;
+ }
+ }
+ .\\[\\&_h1\\]\\:mt-\\[14px\\] {
+ & h1 {
+ margin-top: 14px;
+ }
+ }
+ .\\[\\&_h1\\]\\:mb-\\[6px\\] {
+ & h1 {
+ margin-bottom: 6px;
+ }
+ }
+ .\\[\\&_h1\\]\\:text-\\[18px\\] {
+ & h1 {
+ font-size: 18px;
+ }
+ }
+ .\\[\\&_h1\\]\\:leading-\\[1\\.4\\] {
+ & h1 {
+ --tw-leading: 1.4;
+ line-height: 1.4;
+ }
+ }
+ .\\[\\&_h1\\]\\:text-primary {
+ & h1 {
+ color: var(--dsw-alias-label-primary);
+ }
+ }
+ .\\[\\&_h2\\]\\:mt-\\[14px\\] {
+ & h2 {
+ margin-top: 14px;
+ }
+ }
+ .\\[\\&_h2\\]\\:mb-\\[6px\\] {
+ & h2 {
+ margin-bottom: 6px;
+ }
+ }
+ .\\[\\&_h2\\]\\:text-\\[16px\\] {
+ & h2 {
+ font-size: 16px;
+ }
+ }
+ .\\[\\&_h2\\]\\:leading-\\[1\\.4\\] {
+ & h2 {
+ --tw-leading: 1.4;
+ line-height: 1.4;
+ }
+ }
+ .\\[\\&_h2\\]\\:text-primary {
+ & h2 {
+ color: var(--dsw-alias-label-primary);
+ }
+ }
+ .\\[\\&_h3\\]\\:m-0 {
+ & h3 {
+ margin: calc(var(--spacing) * 0);
+ }
+ }
+ .\\[\\&_h3\\]\\:mt-\\[14px\\] {
+ & h3 {
+ margin-top: 14px;
+ }
+ }
+ .\\[\\&_h3\\]\\:mb-\\[6px\\] {
+ & h3 {
+ margin-bottom: 6px;
+ }
+ }
+ .\\[\\&_h3\\]\\:text-\\[13px\\] {
+ & h3 {
+ font-size: 13px;
+ }
+ }
+ .\\[\\&_h3\\]\\:text-\\[14px\\] {
+ & h3 {
+ font-size: 14px;
+ }
+ }
+ .\\[\\&_h3\\]\\:text-\\[16px\\] {
+ & h3 {
+ font-size: 16px;
+ }
+ }
+ .\\[\\&_h3\\]\\:leading-\\[1\\.4\\] {
+ & h3 {
+ --tw-leading: 1.4;
+ line-height: 1.4;
+ }
+ }
+ .\\[\\&_h3\\]\\:leading-\\[20px\\] {
+ & h3 {
+ --tw-leading: 20px;
+ line-height: 20px;
+ }
+ }
+ .\\[\\&_h3\\]\\:leading-\\[24px\\] {
+ & h3 {
+ --tw-leading: 24px;
+ line-height: 24px;
+ }
+ }
+ .\\[\\&_h3\\]\\:font-medium {
+ & h3 {
+ --tw-font-weight: var(--font-weight-medium);
+ font-weight: var(--font-weight-medium);
+ }
+ }
+ .\\[\\&_h3\\]\\:font-semibold {
+ & h3 {
+ --tw-font-weight: var(--font-weight-semibold);
+ font-weight: var(--font-weight-semibold);
+ }
+ }
+ .\\[\\&_h3\\]\\:text-primary {
+ & h3 {
+ color: var(--dsw-alias-label-primary);
+ }
+ }
+ .\\[\\&_h4\\]\\:mt-\\[14px\\] {
+ & h4 {
+ margin-top: 14px;
+ }
+ }
+ .\\[\\&_h4\\]\\:mb-\\[6px\\] {
+ & h4 {
+ margin-bottom: 6px;
+ }
+ }
+ .\\[\\&_h4\\]\\:text-\\[13px\\] {
+ & h4 {
+ font-size: 13px;
+ }
+ }
+ .\\[\\&_h4\\]\\:leading-\\[1\\.4\\] {
+ & h4 {
+ --tw-leading: 1.4;
+ line-height: 1.4;
+ }
+ }
+ .\\[\\&_h4\\]\\:text-primary {
+ & h4 {
+ color: var(--dsw-alias-label-primary);
+ }
+ }
+ .\\[\\&_ol\\]\\:my-\\[6px\\] {
+ & ol {
+ margin-block: 6px;
+ }
+ }
+ .\\[\\&_ol\\]\\:pl-\\[20px\\] {
+ & ol {
+ padding-left: 20px;
+ }
+ }
.\\[\\&_p\\]\\:m-0 {
& p {
margin: calc(var(--spacing) * 0);
}
}
+ .\\[\\&_p\\]\\:my-\\[6px\\] {
+ & p {
+ margin-block: 6px;
+ }
+ }
+ .\\[\\&_p\\]\\:leading-\\[20px\\] {
+ & p {
+ --tw-leading: 20px;
+ line-height: 20px;
+ }
+ }
+ .\\[\\&_pre\\]\\:my-\\[8px\\] {
+ & pre {
+ margin-block: 8px;
+ }
+ }
+ .\\[\\&_pre\\]\\:overflow-x-auto {
+ & pre {
+ overflow-x: auto;
+ }
+ }
+ .\\[\\&_pre\\]\\:rounded-\\[8px\\] {
+ & pre {
+ border-radius: 8px;
+ }
+ }
+ .\\[\\&_pre\\]\\:border {
+ & pre {
+ border-style: var(--tw-border-style);
+ border-width: 1px;
+ }
+ }
+ .\\[\\&_pre\\]\\:border-border-l2 {
+ & pre {
+ border-color: var(--dsw-alias-border-l2);
+ }
+ }
+ .\\[\\&_pre\\]\\:bg-layer-3 {
+ & pre {
+ background-color: var(--dsw-alias-bg-layer-3);
+ }
+ }
+ .\\[\\&_pre\\]\\:px-\\[12px\\] {
+ & pre {
+ padding-inline: 12px;
+ }
+ }
+ .\\[\\&_pre\\]\\:py-\\[10px\\] {
+ & pre {
+ padding-block: 10px;
+ }
+ }
+ .\\[\\&_strong\\]\\:font-semibold {
+ & strong {
+ --tw-font-weight: var(--font-weight-semibold);
+ font-weight: var(--font-weight-semibold);
+ }
+ }
+ .\\[\\&_strong\\]\\:text-secondary {
+ & strong {
+ color: var(--dsw-alias-label-secondary);
+ }
+ }
.\\[\\&_svg\\]\\:h-\\[11px\\] {
& svg {
height: 11px;
@@ -1130,6 +1745,16 @@ const TAIWINDCSS_GENERATED = `
width: 14px;
}
}
+ .\\[\\&_ul\\]\\:my-\\[6px\\] {
+ & ul {
+ margin-block: 6px;
+ }
+ }
+ .\\[\\&_ul\\]\\:pl-\\[20px\\] {
+ & ul {
+ padding-left: 20px;
+ }
+ }
.\\[\\&\\>\\*\\]\\:w-full {
&>* {
width: 100%;
@@ -1190,6 +1815,26 @@ const TAIWINDCSS_GENERATED = `
object-fit: fill;
}
}
+ .\\[\\&\\>span\\:first-child\\]\\:text-tertiary {
+ &>span:first-child {
+ color: var(--dsw-alias-label-tertiary);
+ }
+ }
+}
+@property --tw-translate-x {
+ syntax: "*";
+ inherits: false;
+ initial-value: 0;
+}
+@property --tw-translate-y {
+ syntax: "*";
+ inherits: false;
+ initial-value: 0;
+}
+@property --tw-translate-z {
+ syntax: "*";
+ inherits: false;
+ initial-value: 0;
}
@property --tw-rotate-x {
syntax: "*";
@@ -1419,6 +2064,9 @@ const TAIWINDCSS_GENERATED = `
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
+ --tw-translate-x: 0;
+ --tw-translate-y: 0;
+ --tw-translate-z: 0;
--tw-rotate-x: initial;
--tw-rotate-y: initial;
--tw-rotate-z: initial;
diff --git a/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx b/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx
index c98f75be..0dd16d87 100644
--- a/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx
+++ b/packages/dsh-tauri-ui-playground/src/client/ui/components-playground/ui-components.tsx
@@ -4,8 +4,6 @@ import {
Action,
ArrowRightFromSquare,
Button,
- ChevronDown,
- Chip,
CircleTree,
Comments,
ConversationBar,
@@ -15,11 +13,11 @@ import {
Icon,
Input,
Magnifier,
- Menu,
Person,
Pill,
Plus,
Puzzle,
+ Select,
Switch,
Tag,
TerminalLine,
@@ -37,59 +35,32 @@ const BUTTON_VARIANTS = ['primary', 'outline', 'ghost', 'toolbar'] as const
const BUTTON_SIZES = ['md', 'sm'] as const
const TAG_TONES = ['outline', 'solid', 'neutral', 'quiet', 'success', 'info', 'warning', 'danger'] as const
-interface SampleOption { id: string, label: string }
+interface SampleOption { value: string, label: string }
const SEAT_OPTIONS: readonly SampleOption[] = [
- { id: 'default', label: '默认' },
- { id: 'plan', label: '计划模式' },
- { id: 'review', label: '评审模式' },
+ { value: 'default', label: '默认' },
+ { value: 'plan', label: '计划模式' },
+ { value: 'review', label: '评审模式' },
]
const PERMISSION_OPTIONS: readonly SampleOption[] = [
- { id: 'default', label: '默认权限' },
- { id: 'acceptEdits', label: '接受编辑' },
- { id: 'bypass', label: '跳过确认' },
+ { value: 'default', label: '默认权限' },
+ { value: 'acceptEdits', label: '接受编辑' },
+ { value: 'bypass', label: '跳过确认' },
]
const THEME_OPTIONS: readonly SampleOption[] = [
- { id: 'system', label: '跟随系统' },
- { id: 'light', label: '浅色' },
- { id: 'dark', label: '深色' },
+ { value: 'system', label: '跟随系统' },
+ { value: 'light', label: '浅色' },
+ { value: 'dark', label: '深色' },
]
-/** 这三个 chip 在应用里是 select 触发按钮,接上官方 `Menu` 才能调试选中态、chevron 旋转与弹层位置。 */
+/** 通用的 `Select` 把三个 chip 变体都铺成触发器,这里逐档演示(选中态/chevron 旋转/弹层位置由它自管)。 */
function SelectSample({ variant, icon, options }: {
variant: ChipVariant
icon?: ReactNode
options: readonly SampleOption[]
}): ReactElement {
- const [open, setOpen] = useState(false)
- const [value, setValue] = useState(options[0]?.id ?? '')
- return (
- <Menu
- open={open}
- onClose={() => setOpen(false)}
- onSelect={(id) => {
- setOpen(false)
- setValue(id)
- }}
- items={options.map(option => ({ id: option.id, label: option.label }))}
- selectedId={value}
- portal
- align="end"
- anchor={(
- <Chip
- aria-expanded={open}
- aria-haspopup="menu"
- chevron={<Icon as={ChevronDown} size={14} />}
- icon={icon}
- open={open}
- variant={variant}
- onClick={() => setOpen(openState => !openState)}
- >
- {options.find(option => option.id === value)?.label ?? value}
- </Chip>
- )}
- />
- )
+ const [value, setValue] = useState(options[0]?.value ?? '')
+ return <Select icon={icon} options={options} value={value} variant={variant} onChange={setValue} />
}
function SourceCard({ entry }: { entry: UiComponentEntry }): ReactElement {
diff --git a/packages/dsh-tauri-ui/src/client/components/card.tsx b/packages/dsh-tauri-ui/src/client/components/card.tsx
new file mode 100644
index 00000000..42ae21e8
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/card.tsx
@@ -0,0 +1,62 @@
+import type { VariantProps } from 'dsh-tauri/client'
+// 引用源 @deepseek-ai/dsh-client-ui-plugin-manager · lib/client.js 的插件页卡片族 · 版本 0.1.7-rc.2(≥0.1.5-rc.1)· hash cards=2TxG_cards card=2TxG_card cardHead=2TxG_cardHead cardIcon=2TxG_cardIcon cardMain=2TxG_cardMain titleRow=2TxG_titleRow cardTitle=2TxG_cardTitle cardDesc=2TxG_cardDesc cardEnd=2TxG_cardEnd cardLink=2TxG_cardLink
+import type { ComponentProps, ReactElement } from 'react'
+import { tv } from 'dsh-tauri/client'
+
+const card = tv({
+ slots: {
+ list: 'flex flex-col gap-[2px] m-0 p-0 list-none',
+ base: 'box-border min-w-0 mx-[-8px] rounded-xl',
+ head: 'flex items-center gap-[14px] p-[8px]',
+ icon: 'inline-flex items-center justify-center flex-none w-[48px] h-[48px] border-[0.5px] border-border-l3 rounded-lg text-secondary',
+ content: 'flex flex-col flex-1 gap-[4px] min-w-0',
+ titleRow: 'flex flex-wrap items-center gap-[8px] min-w-0',
+ title: 'max-w-full overflow-hidden truncate text-[14px] font-medium leading-[20px]',
+ description: 'text-tertiary text-[13px] leading-[18px] line-clamp-1 my-0',
+ end: 'relative z-[1] inline-flex flex-none items-center gap-[8px]',
+ },
+ variants: {
+ variant: {
+ default: { base: 'border border-border-l2 bg-layer-3' },
+ link: { base: 'relative hover:bg-hover' },
+ },
+ },
+ defaultVariants: { variant: 'default' },
+})
+
+export type CardVariant = NonNullable<VariantProps<typeof card>['variant']>
+
+function CardBase({ variant, className, children, ...rest }: ComponentProps<'li'> & { variant?: CardVariant }): ReactElement {
+ return <li className={card({ variant }).base({ className })} {...rest}>{children}</li>
+}
+
+/**
+ * 插件页卡片:`default` 有线无 hover(静态卡片),`link` 无线有 hover(整卡可点)。
+ * 结构照官方原型 `.card > .cardHead / .cardMain / .cardEnd`,用 `Card.X` 组合。
+ */
+export const Card = Object.assign(CardBase, {
+ List: ({ className, children, ...rest }: ComponentProps<'ul'>): ReactElement => (
+ <ul className={card().list({ className })} {...rest}>{children}</ul>
+ ),
+ Header: ({ className, children, ...rest }: ComponentProps<'div'>): ReactElement => (
+ <div className={card().head({ className })} {...rest}>{children}</div>
+ ),
+ Icon: ({ className, children, ...rest }: ComponentProps<'span'>): ReactElement => (
+ <span className={card().icon({ className })} {...rest}>{children}</span>
+ ),
+ Content: ({ className, children, ...rest }: ComponentProps<'div'>): ReactElement => (
+ <div className={card().content({ className })} {...rest}>{children}</div>
+ ),
+ TitleRow: ({ className, children, ...rest }: ComponentProps<'div'>): ReactElement => (
+ <div className={card().titleRow({ className })} {...rest}>{children}</div>
+ ),
+ Title: ({ className, children, ...rest }: ComponentProps<'span'>): ReactElement => (
+ <span className={card().title({ className })} {...rest}>{children}</span>
+ ),
+ Description: ({ className, children, ...rest }: ComponentProps<'p'>): ReactElement => (
+ <p className={card().description({ className })} {...rest}>{children}</p>
+ ),
+ End: ({ className, children, ...rest }: ComponentProps<'span'>): ReactElement => (
+ <span className={card().end({ className })} {...rest}>{children}</span>
+ ),
+})
diff --git a/packages/dsh-tauri-ui/src/client/components/field.tsx b/packages/dsh-tauri-ui/src/client/components/field.tsx
new file mode 100644
index 00000000..44f4d426
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/field.tsx
@@ -0,0 +1,22 @@
+// 引用源 本仓自建(组合官方标签排版;无上游对应)· 版本 不适用 · hash 不适用
+import type { HTMLAttributes, ReactElement, ReactNode } from 'react'
+import { cn } from 'dsh-tauri/client'
+
+export interface FieldProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
+ /** 字段名,渲染为第一个 `<span>`(由样式表染成弱化色)。 */
+ label: ReactNode
+ /** 控件不是可关联表单控件时(如菜单触发器、分组)用 `div`,避免 `<label>` 包住按钮。 */
+ as?: 'label' | 'div'
+ children?: ReactNode
+}
+
+/** 表单字段:字段名 + 控件的纵向堆叠,控件由隐式 `<label>` 关联。 */
+export function Field({ label, as = 'label', className, children, ...rest }: FieldProps): ReactElement {
+ const Tag = as
+ return (
+ <Tag className={cn('flex flex-col gap-[4px] text-[12px] leading-[18px] text-secondary [&>span:first-child]:text-tertiary', className)} {...rest}>
+ <span>{label}</span>
+ {children}
+ </Tag>
+ )
+}
diff --git a/packages/dsh-tauri-ui/src/client/components/index.ts b/packages/dsh-tauri-ui/src/client/components/index.ts
index bfb1c049..f84092e4 100644
--- a/packages/dsh-tauri-ui/src/client/components/index.ts
+++ b/packages/dsh-tauri-ui/src/client/components/index.ts
@@ -1,11 +1,17 @@
export * from './action'
export * from './button'
+export * from './card'
export * from './checkbox'
export * from './chip'
export * from './conversation-bar'
export * from './dot'
+export * from './field'
export * from './icon'
export * from './icons'
+export * from './notice'
export * from './official'
export * from './registry'
+export * from './select'
export * from './tag'
+export * from './text'
+export * from './textarea'
diff --git a/packages/dsh-tauri-ui/src/client/components/notice.tsx b/packages/dsh-tauri-ui/src/client/components/notice.tsx
new file mode 100644
index 00000000..27806207
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/notice.tsx
@@ -0,0 +1,28 @@
+import type { VariantProps } from 'dsh-tauri/client'
+// 引用源 本仓自建(组合官方状态色 token;无上游对应)· 版本 不适用 · hash 不适用
+import type { HTMLAttributes, ReactElement, ReactNode } from 'react'
+import { tv } from 'dsh-tauri/client'
+
+export interface NoticeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
+ /** 状态配色;省略时用中性底色(`border-l2` + `bg-layer-3`)。 */
+ kind?: NoticeKind
+ children?: ReactNode
+}
+
+const notice = tv({
+ base: 'flex items-start gap-[8px] border border-border-l2 rounded-[8px] px-[12px] py-[10px] bg-layer-3 text-[13px] leading-[20px]',
+ variants: {
+ kind: {
+ ok: 'border-success/35 bg-success/8',
+ error: 'border-error/35 bg-error/8',
+ info: 'border-business/35 bg-business/8',
+ },
+ },
+})
+
+export type NoticeKind = NonNullable<VariantProps<typeof notice>['kind']>
+
+/** 状态提示条:成功 / 失败 / 信息三档着色,默认 `role="status"`(可用 props 覆盖)。 */
+export function Notice({ kind, className, children, ...rest }: NoticeProps): ReactElement {
+ return <div className={notice({ kind, className })} role="status" {...rest}>{children}</div>
+}
diff --git a/packages/dsh-tauri-ui/src/client/components/panel.tsx b/packages/dsh-tauri-ui/src/client/components/panel.tsx
index 065c3e5c..05b354c4 100644
--- a/packages/dsh-tauri-ui/src/client/components/panel.tsx
+++ b/packages/dsh-tauri-ui/src/client/components/panel.tsx
@@ -1,6 +1,5 @@
import type { ReactElement, ReactNode } from 'react'
-
/**
* 面板页容器:复刻官方插件页(`@deepseek-ai/dsh-client-ui-plugin-manager` 的
* `PluginManagerPage`)的页根几何,使第三方插件面板与官方左侧栏「插件」入口
diff --git a/packages/dsh-tauri-ui/src/client/components/select.tsx b/packages/dsh-tauri-ui/src/client/components/select.tsx
new file mode 100644
index 00000000..35e4ff55
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/select.tsx
@@ -0,0 +1,73 @@
+// 引用源 本仓自建(组合官方 primitives 的 `Menu` 与本地 `Chip`;无上游对应)· 版本 不适用 · hash 不适用
+import type { ButtonHTMLAttributes, ReactElement, ReactNode } from 'react'
+import type { ChipVariant } from './chip'
+import { Menu } from '@deepseek-ai/dsh-client-ui-primitives'
+import { useState } from 'react'
+import { Chip } from './chip'
+import { Icon } from './icon'
+import { ChevronDown } from './icons'
+
+export interface SelectOption {
+ value: string
+ label: string
+}
+
+export interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange' | 'value'> {
+ options: readonly SelectOption[]
+ value: string
+ onChange: (next: string) => void
+ /** 触发器外观:复用 chip 的三档(见 `chip.tsx`),默认设置行那档。 */
+ variant?: ChipVariant
+ icon?: ReactNode
+ chevron?: ReactNode
+ /** 无可见文案时的无障碍名(触发器内容取选中项 label)。 */
+ label?: string
+}
+
+/** 下拉选择:`Chip` 触发器 + 官方 portal `Menu`,选中态与展开态由组件自管。 */
+export function Select({
+ options,
+ value,
+ onChange,
+ variant = 'selector',
+ icon,
+ chevron,
+ label,
+ onClick,
+ ...rest
+}: SelectProps): ReactElement {
+ const [open, setOpen] = useState(false)
+ const selected = options.find(option => option.value === value)
+ return (
+ <Menu
+ open={open}
+ onClose={() => setOpen(false)}
+ onSelect={(id) => {
+ setOpen(false)
+ onChange(id)
+ }}
+ items={options.map(option => ({ id: option.value, label: option.label }))}
+ selectedId={value}
+ portal
+ align="end"
+ anchor={(
+ <Chip
+ variant={variant}
+ open={open}
+ aria-label={label}
+ aria-haspopup="menu"
+ aria-expanded={open}
+ icon={icon}
+ chevron={chevron ?? <Icon as={ChevronDown} />}
+ onClick={(event) => {
+ onClick?.(event)
+ setOpen(state => !state)
+ }}
+ {...rest}
+ >
+ {selected?.label ?? value}
+ </Chip>
+ )}
+ />
+ )
+}
diff --git a/packages/dsh-tauri-ui/src/client/components/text.tsx b/packages/dsh-tauri-ui/src/client/components/text.tsx
new file mode 100644
index 00000000..25fd83ac
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/text.tsx
@@ -0,0 +1,37 @@
+import type { VariantProps } from 'dsh-tauri/client'
+// 引用源 本仓自建(官方语义色 token;无上游对应)· 版本 不适用 · hash 不适用
+import type { HTMLAttributes, ReactElement, ReactNode } from 'react'
+import { tv } from 'dsh-tauri/client'
+
+export interface TextProps extends Omit<HTMLAttributes<HTMLParagraphElement>, 'children'> {
+ tone?: TextTone
+ size?: TextSize
+ children?: ReactNode
+}
+
+const text = tv({
+ base: 'm-0',
+ variants: {
+ size: {
+ xs: 'text-[12px] leading-[18px]',
+ sm: 'text-[13px] leading-[20px]',
+ },
+ tone: {
+ primary: 'text-primary',
+ secondary: 'text-secondary',
+ tertiary: 'text-tertiary',
+ dimmed: 'text-dimmed',
+ error: 'text-error',
+ },
+ },
+ defaultVariants: { size: 'xs', tone: 'secondary' },
+})
+
+export type TextTone = NonNullable<VariantProps<typeof text>['tone']>
+
+export type TextSize = NonNullable<VariantProps<typeof text>['size']>
+
+/** 行内说明文字(固定渲染 `<p>`,自带 `m-0`):错误行、灰字提示、次要说明统一走这里。 */
+export function Text({ tone, size, className, children, ...rest }: TextProps): ReactElement {
+ return <p className={text({ tone, size, className })} {...rest}>{children}</p>
+}
diff --git a/packages/dsh-tauri-ui/src/client/components/textarea.tsx b/packages/dsh-tauri-ui/src/client/components/textarea.tsx
new file mode 100644
index 00000000..e344fbec
--- /dev/null
+++ b/packages/dsh-tauri-ui/src/client/components/textarea.tsx
@@ -0,0 +1,26 @@
+import type { VariantProps } from 'dsh-tauri/client'
+// 引用源 本仓自建(官方 primitives 无 Textarea 导出)· 版本 不适用 · hash 不适用
+import type { ReactElement, TextareaHTMLAttributes } from 'react'
+import { tv } from 'dsh-tauri/client'
+
+const textarea = tv({
+ base: 'w-full box-border border border-border-l2 rounded-[8px] px-[10px] py-[7px] outline-none bg-layer-1 text-primary [font-family:var(--ds-font-family-code)] text-[13px] leading-[1.5] resize-y focus-visible:border-business focus-visible:shadow-[0_0_0_2px_color-mix(in_srgb,var(--dsw-alias-state-business-primary)_18%,transparent)]',
+ variants: {
+ size: {
+ tall: 'min-h-[320px]',
+ short: 'min-h-[96px]',
+ compact: 'min-h-[260px]',
+ },
+ },
+ defaultVariants: { size: 'tall' },
+})
+
+export type TextareaSize = NonNullable<VariantProps<typeof textarea>['size']>
+
+export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
+ size?: TextareaSize
+}
+
+export function Textarea({ size, className, ...rest }: TextareaProps): ReactElement {
+ return <textarea className={textarea({ size, className })} {...rest} />
+}