The shtukbase-ui-html component library
The Shtukbase components in plain HTML and CSS: the shadcn set and our composites (record card, property row, details card, empty state, tree item, toolbar, search field, status dot, settings group), the package card with its presets, areas, the package grid and the settings bar; every state and data state, long text never overflows; CSS on the token contract only, so any style fits.
关于该包
这段内容尚未翻译,下面是英文原文。
The Shtukbase look as a component library in plain HTML and CSS: what the owner tuned in the package-map mock (the even card
edge, hover that changes only the shadow, chips with a grey outline, icon left on the title's cap line, the Basic card with
its faint tint and light from under it, cover finishes, group backgrounds, the compact settings bar) becomes components with
fixed ids, states and controls. The CSS reads only the token contract (/design/contract.md of design-tokens), so the
library takes any style: shtukbase-style by default, any shadcn theme as well.
What it installs
/design/shtukbase-ui-html.md: the library page: how a component is written, how controls become attributes, the presets./design/shtukbase-ui-html/components/<level>/<id>/<id>.htmland<id>.css: 44 components besides the shell: primitivesbutton,badge,chip,icon-plate,kicker,input,select,switch,slider,swatches,avatar,checkbox,label,progress,radio-group,separator,skeleton,textarea,tooltip,status-dot; compositescard,package-card,field,accordion,alert,breadcrumb,command,dialog,dropdown-menu,popover,table,tabs; oursrecord-card,property-row,details-card,empty-state,tree-item,toolbar,search-field,settings-group; blocksarea,package-grid,settings-barandpeek./design/shtukbase-ui-html/components/shell/<id>/:sidebar,panel,panel-section,collapsible,scroll-area,sheet, and the page formslayout-document,layout-grid,layout-catalog,layout-canvas. A lens layout arranges these parts./design/shtukbase-ui-html/ui.css(built): every component's CSS joined./design/shtukbase-ui-html/demo.html(built): every component in every state and every control value, and a package map made of the components; opened with a double click./design/shtukbase-ui-html/demo-tokens.css: the mock's values as contract tokens, used by the demo only when no style is installed (shtukbase-styleoverrides them).- Norms SUI-R01 (the component format), SUI-R02 (tokens only), SUI-R03 (ui.css is fresh) with their checks.
design-components sync turns the headers into the pages /design/components/<id>.md; the lenses of design-lenses show
them; shtukbase-ui-react renders the same markup and classes in React and imports ui.css.
Where the boundary is
- No JavaScript: states are attributes (
data-hover,data-focusfor a still picture; the real:hoverand:focus-visiblelook the same), controls aredata-<control>attributes and--<id>-<control>custom properties. Presets are bundles of attributes; the explore kit or the React library sets them. - Icons are content: the library draws the sticker rim, never a plate (SBS-R06), and not the icon. Turning an icon into style 79 is the style's business.
- Dialogs, menus, popovers and tooltips are their surfaces: opening and placing them is the page's (a native
<dialog>, Radix, any positioning). - Text never overflows:
bun testdraws every state and every control value with long Russian text in a narrow cell in headless Chrome and fails on any text that leaves its box (lib/overflow.ts).
规范 3
| ID | 规范 | 级别 | 模式 | Enforcer |
|---|---|---|---|---|
| SUI-R01 | Every component file under /design/shtukbase-ui-html/components/<level>/<id>/<id>.html starts with the component header, has one template per state and status, and its markup root carries data-slot and class equal to the id. |
MUST | 拦截 | 检查 |
| SUI-R02 | Component CSS takes colours, radii and shadow colours only from the token contract: var(--…), color-mix() of tokens, relative colours from a token, transparent and currentColor. |
MUST | 拦截 | 检查 |
| SUI-R03 | /design/shtukbase-ui-html/ui.css is exactly what the build action writes from the current component CSS. |
MUST | 拦截 | 检查 |
“拦截”:enforcer 会阻止违规;“观察”:只记录违规。MUST 级别表示必须遵守;SHOULD 表示默认应当遵守。
动作 4
| 名称 | 作用 | 文件 | 时机 |
|---|---|---|---|
| build | Join the component CSS into ui.css and write the demo page (/design/shtukbase-ui-html/) | actions/build.ts | 安装后 更新后 |
| format | Every component file has a valid header and a template for each state and status 规范 SUI-R01 | checks/format.ts | 检查 |
| tokens-only | Component CSS takes colours, radii and shadows only from the token contract 规范 SUI-R02 | checks/tokens-only.ts | 检查 |
| fresh | ui.css is rebuilt from the component CSS 规范 SUI-R03 | checks/fresh.ts | 检查 |
shtuk check 运行检查;shtuk run shtukbase-ui-html <名称> 运行任意动作。“安装后”动作只有在包来自可信来源时才会自动运行。
页面 114
这些页面会放到项目中的以下路径。
- /design/
- shtukbase-ui-html: the component library 页面
- /design/shtukbase-ui-html/
- demo-tokens.css 文件
- ui.css 文件
- /design/shtukbase-ui-html/components/block/area/
- area.css 文件
- area.html 文件
- /design/shtukbase-ui-html/components/block/package-grid/
- package-grid.css 文件
- package-grid.html 文件
- /design/shtukbase-ui-html/components/block/peek/
- peek.css 文件
- peek.html 文件
- /design/shtukbase-ui-html/components/block/settings-bar/
- settings-bar.css 文件
- settings-bar.html 文件
- /design/shtukbase-ui-html/components/composite/accordion/
- accordion.css 文件
- accordion.html 文件
- /design/shtukbase-ui-html/components/composite/alert/
- alert.css 文件
- alert.html 文件
- /design/shtukbase-ui-html/components/composite/breadcrumb/
- breadcrumb.css 文件
- breadcrumb.html 文件
- /design/shtukbase-ui-html/components/composite/card/
- card.css 文件
- card.html 文件
- /design/shtukbase-ui-html/components/composite/command/
- command.css 文件
- command.html 文件
- /design/shtukbase-ui-html/components/composite/details-card/
- details-card.css 文件
- details-card.html 文件
- /design/shtukbase-ui-html/components/composite/dialog/
- dialog.css 文件
- dialog.html 文件
- /design/shtukbase-ui-html/components/composite/dropdown-menu/
- dropdown-menu.css 文件
- dropdown-menu.html 文件
- /design/shtukbase-ui-html/components/composite/empty-state/
- empty-state.css 文件
- empty-state.html 文件
- /design/shtukbase-ui-html/components/composite/field/
- field.css 文件
- field.html 文件
- /design/shtukbase-ui-html/components/composite/package-card/
- package-card.css 文件
- package-card.html 文件
- /design/shtukbase-ui-html/components/composite/popover/
- popover.css 文件
- popover.html 文件
- /design/shtukbase-ui-html/components/composite/property-row/
- property-row.css 文件
- property-row.html 文件
- /design/shtukbase-ui-html/components/composite/record-card/
- record-card.css 文件
- record-card.html 文件
- /design/shtukbase-ui-html/components/composite/search-field/
- search-field.css 文件
- search-field.html 文件
- /design/shtukbase-ui-html/components/composite/settings-group/
- settings-group.css 文件
- settings-group.html 文件
- /design/shtukbase-ui-html/components/composite/table/
- table.css 文件
- table.html 文件
- /design/shtukbase-ui-html/components/composite/tabs/
- tabs.css 文件
- tabs.html 文件
- /design/shtukbase-ui-html/components/composite/toolbar/
- toolbar.css 文件
- toolbar.html 文件
- /design/shtukbase-ui-html/components/composite/tree-item/
- tree-item.css 文件
- tree-item.html 文件
- /design/shtukbase-ui-html/components/primitive/avatar/
- avatar.css 文件
- avatar.html 文件
- /design/shtukbase-ui-html/components/primitive/badge/
- badge.css 文件
- badge.html 文件
- /design/shtukbase-ui-html/components/primitive/button/
- button.css 文件
- button.html 文件
- /design/shtukbase-ui-html/components/primitive/checkbox/
- checkbox.css 文件
- checkbox.html 文件
- /design/shtukbase-ui-html/components/primitive/chip/
- chip.css 文件
- chip.html 文件
- /design/shtukbase-ui-html/components/primitive/icon-plate/
- icon-plate.css 文件
- icon-plate.html 文件
- /design/shtukbase-ui-html/components/primitive/input/
- input.css 文件
- input.html 文件
- /design/shtukbase-ui-html/components/primitive/kicker/
- kicker.css 文件
- kicker.html 文件
- /design/shtukbase-ui-html/components/primitive/label/
- label.css 文件
- label.html 文件
- /design/shtukbase-ui-html/components/primitive/progress/
- progress.css 文件
- progress.html 文件
- /design/shtukbase-ui-html/components/primitive/radio-group/
- radio-group.css 文件
- radio-group.html 文件
- /design/shtukbase-ui-html/components/primitive/select/
- select.css 文件
- select.html 文件
- /design/shtukbase-ui-html/components/primitive/separator/
- separator.css 文件
- separator.html 文件
- /design/shtukbase-ui-html/components/primitive/skeleton/
- skeleton.css 文件
- skeleton.html 文件
- /design/shtukbase-ui-html/components/primitive/slider/
- slider.css 文件
- slider.html 文件
- /design/shtukbase-ui-html/components/primitive/status-dot/
- status-dot.css 文件
- status-dot.html 文件
- /design/shtukbase-ui-html/components/primitive/swatches/
- swatches.css 文件
- swatches.html 文件
- /design/shtukbase-ui-html/components/primitive/switch/
- switch.css 文件
- switch.html 文件
- /design/shtukbase-ui-html/components/primitive/textarea/
- textarea.css 文件
- textarea.html 文件
- /design/shtukbase-ui-html/components/primitive/tooltip/
- tooltip.css 文件
- tooltip.html 文件
- /design/shtukbase-ui-html/components/shell/collapsible/
- collapsible.css 文件
- collapsible.html 文件
- /design/shtukbase-ui-html/components/shell/layout-canvas/
- layout-canvas.css 文件
- layout-canvas.html 文件
- /design/shtukbase-ui-html/components/shell/layout-catalog/
- layout-catalog.css 文件
- layout-catalog.html 文件
- /design/shtukbase-ui-html/components/shell/layout-document/
- layout-document.css 文件
- layout-document.html 文件
- /design/shtukbase-ui-html/components/shell/layout-grid/
- layout-grid.css 文件
- layout-grid.html 文件
- /design/shtukbase-ui-html/components/shell/panel/
- panel.css 文件
- panel.html 文件
- /design/shtukbase-ui-html/components/shell/panel-section/
- panel-section.css 文件
- panel-section.html 文件
- /design/shtukbase-ui-html/components/shell/scroll-area/
- scroll-area.css 文件
- scroll-area.html 文件
- /design/shtukbase-ui-html/components/shell/sheet/
- sheet.css 文件
- sheet.html 文件
- /design/shtukbase-ui-html/components/shell/sidebar/
- sidebar.css 文件
- sidebar.html 文件
- /norms/rules/shtukbase-ui-html/
- A component file has a valid header and a template for each state SUI-R01
- Component CSS uses only contract tokens for colours, radii and shadows SUI-R02
- ui.css is rebuilt from the component CSS SUI-R03
包文件 31
它们会放到 .shtukbase/packages/shtukbase-ui-html/,动作从那里运行。