Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set -e
echo "Checking clean dependency installation..."
npm run check:clean-install

echo "Building workspace packages..."
npm run build

echo "Running workspace typecheck..."
npm run typecheck --workspaces --if-present
npm run typecheck

echo "Running workspace tests..."
npm run test:ci-like
npm test --workspaces --if-present --include-workspace-root=false
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
run: npm run build

- name: Check repository contracts
run: npm run check:repository-contracts
run: npm run check:docs

- name: Check CodeMonster UI contracts, accessibility, and visual fixtures
run: npm run test:ui
Expand All @@ -114,12 +114,7 @@ jobs:
- name: Install dependencies
run: npm ci

# The suite hides dist itself; the build is still needed for its other output, such as
# generated CSS that some workspaces' own tests read back.
- name: Build packages
run: npm run build

- name: Run workspace tests without build output
- name: Run workspace tests from a clean build
run: npm run test:ci-like

packaging:
Expand Down Expand Up @@ -259,11 +254,14 @@ jobs:
done

npm run visual:cross-platform:capture -- --origin=http://127.0.0.1:5176 --output="${CROSS_PLATFORM_CAPTURE}" --label=ci-actual-adapters
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vue" --diff="${CROSS_PLATFORM_VUE_DIFF}" --threshold=4
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vanilla" --diff="${CROSS_PLATFORM_VANILLA_DIFF}" --threshold=4

CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-visual.json" node scripts/visual/check-vanilla-parity.mjs
CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-behavior.json" CM_PARITY_BEHAVIOR=1 node scripts/visual/check-vanilla-parity.mjs
# Keep the gate strict while collecting both adapters' results and behavior evidence.
result=0
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vue" --diff="${CROSS_PLATFORM_VUE_DIFF}" --threshold=4 || result=1
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vanilla" --diff="${CROSS_PLATFORM_VANILLA_DIFF}" --threshold=4 || result=1

CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-visual.json" node scripts/visual/check-vanilla-parity.mjs || result=1
CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-behavior.json" CM_PARITY_BEHAVIOR=1 node scripts/visual/check-vanilla-parity.mjs || result=1
exit "$result"

- name: Upload cross-platform visual differences
if: failure()
Expand Down
11 changes: 3 additions & 8 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
"MD012": false,
"MD025": false,
"MD024": {
"siblings_only": true
}
"siblings_only": true,
},
},
"ignores": [
"**/node_modules/**",
"**/dist/**",
"**/coverage/**",
"**/LICENSE"
]
"ignores": ["artifacts/**", "**/node_modules/**", "**/dist/**", "**/coverage/**", "**/LICENSE"],
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
**/showcase-dist
package-lock.json

# Machine-local settings
**/.claude/settings.local.json

# Icon geometry is generated by packages/icons/scripts/generate-icons.mjs and committed, because the
# Razor adapter reads it without running Node. Unlike .generated, these are tracked artifacts: their
# shape is the generator's business, not a formatter's.
Expand Down
25 changes: 2 additions & 23 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "monorepo:typecheck:watch",
"type": "shell",
"command": "npm run typecheck --workspaces --if-present -- --watch --preserveWatchOutput",
"isBackground": true,
"problemMatcher": "$tsc-watch",
"presentation": {
"reveal": "always",
"panel": "shared",
"clear": false
}
},
{
"label": "monorepo:lint:once",
"type": "shell",
"command": "npm run lint --workspaces --if-present",
"command": "npm run lint",
"isBackground": false,
"problemMatcher": "$eslint-stylish",
"presentation": {
Expand Down Expand Up @@ -90,19 +78,10 @@
"dependsOn": ["monorepo:lint:once", "monorepo:styles-html:once", "monorepo:md-data:once"],
"problemMatcher": []
},
{
"label": "monorepo:diagnostics:watch",
"dependsOrder": "parallel",
"dependsOn": ["monorepo:typecheck:watch", "monorepo:quality:once"],
"runOptions": {
"runOn": "folderOpen"
},
"problemMatcher": []
},
{
"label": "monorepo:check:once",
"type": "shell",
"command": "npm run lint:all && npm run typecheck --workspaces --if-present",
"command": "npm run build && npm run lint:all && npm run typecheck",
"problemMatcher": "$tsc",
"presentation": {
"reveal": "always",
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,28 @@ See the [CodeMonster UI 1.1 release notes](./docs/codemonster-ui-1.1-release-not

## Preview locally

Run `npm ci` from the repository root once. Run `npm run preview` to build and open the Vue
showcase, or `npm run preview:vanilla` to build and open the full Vanilla HTML showcase. Both
commands are available under the root `package.json` in the VS Code NPM Scripts panel.

Use `npm run dev` for the Vue showcase with hot reload. See the
[Vanilla guide](./docs/vanilla.md) for the static assets and template integration.
The Vue and Vanilla showcases are development tools for trying components, states, and layouts.
Both open on the **Visual matrix** for reviewing variants by category.

Run `npm ci` from the repository root once. Use the following root commands in the terminal or
under the root `package.json` in VS Code's NPM Scripts panel.

| Task | Vue showcase | Vanilla showcase |
| --- | --- | --- |
| Develop with browser updates | `npm run dev` · [5177](http://127.0.0.1:5177) | `npm run dev:vanilla` · [5178](http://127.0.0.1:5178) |
| Build the local showcase | `npm run build:showcase` | `npm run build:vanilla` |
| Open the existing build | `npm run preview` · [4173](http://127.0.0.1:4173) | `npm run preview:vanilla` · [4174](http://127.0.0.1:4174) |

The NPM Scripts panel also lists `dev`, `build`, and `preview` under `examples/ui-showcase/package.json`
for Vue and `examples/vanilla/package.json` for Vanilla.

Run the build before the first preview and whenever you want to refresh the previewed artifact.
`npm run build` builds the seven npm packages. Use `npm test` for package and UI contract tests,
`npm run check` for documentation and package checks, and `npm run verify` for release checks.
After the first package build, use `-w` to focus a command on one workspace, for example
`npm test -w @codemonster-ru/ui-vue`.
The [showcase README](./examples/ui-showcase/README.md) explains which files to edit and serve;
the [Vanilla guide](./docs/vanilla.md) covers static assets and template integration.

## VueForge

Expand Down
3 changes: 3 additions & 0 deletions contracts/date-picker/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Page Down change month. Movement respects the date bounds. Escape closes the cal
returns focus to the trigger. An outside click or focus move closes the calendar without
moving focus back.

If the available width cannot fit its localized weekday and date columns, the grid can scroll
horizontally within the calendar. Keyboard navigation scrolls the focused date into view.

The calendar prefers `bottom-start` placement and can flip above the trigger near an edge.
Choose `bottom-end` to align its trailing edge. Vue `teleportTo` accepts a selector or
element and `disableTeleport` keeps the calendar inline. Vanilla accepts
Expand Down
4 changes: 3 additions & 1 deletion contracts/icon-button/cases/default.case.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"id": "icon-button-default",
"description": "Ghost icon button with the default medium size and native button type.",
"props": { "label": "Search" },
"slots": { "default": "<svg></svg>" }
"slots": {
"default": "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" focusable=\"false\"><circle cx=\"10.5\" cy=\"10.5\" r=\"6.5\"></circle><line x1=\"15.25\" y1=\"15.25\" x2=\"20.25\" y2=\"20.25\"></line></svg>"
}
}
2 changes: 1 addition & 1 deletion contracts/icon-button/cases/default.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button class="cm-icon-button cm-icon-button--ghost cm-icon-button--md" type="button" aria-label="Search">
<span class="cm-icon-button__icon" aria-hidden="true"><svg></svg></span>
<span class="cm-icon-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false"><circle cx="10.5" cy="10.5" r="6.5"></circle><line x1="15.25" y1="15.25" x2="20.25" y2="20.25"></line></svg></span>
</button>
4 changes: 3 additions & 1 deletion contracts/icon-button/cases/disabled.case.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"id": "icon-button-disabled",
"description": "Disabled primary small icon button.",
"props": { "label": "Delete", "variant": "primary", "size": "sm", "disabled": true },
"slots": { "default": "<svg></svg>" }
"slots": {
"default": "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" focusable=\"false\"><path d=\"M5.25 8.25h13.5l-1 12.25H6.25Z\"></path><line x1=\"4\" y1=\"5.25\" x2=\"20\" y2=\"5.25\"></line><path d=\"M9 5.25V3.5h6v1.75M9.5 11v5.75M14.5 11v5.75\"></path></svg>"
}
}
2 changes: 1 addition & 1 deletion contracts/icon-button/cases/disabled.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button class="cm-icon-button cm-icon-button--primary cm-icon-button--sm" type="button" aria-label="Delete" disabled>
<span class="cm-icon-button__icon" aria-hidden="true"><svg></svg></span>
<span class="cm-icon-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M5.25 8.25h13.5l-1 12.25H6.25Z"></path><line x1="4" y1="5.25" x2="20" y2="5.25"></line><path d="M9 5.25V3.5h6v1.75M9.5 11v5.75M14.5 11v5.75"></path></svg></span>
</button>
4 changes: 3 additions & 1 deletion contracts/icon-button/cases/warn.case.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"id": "icon-button-warn",
"description": "Warning-toned icon action with the default medium size.",
"props": { "label": "Flag item for review", "variant": "warn" },
"slots": { "default": "<svg></svg>" }
"slots": {
"default": "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" focusable=\"false\"><path d=\"M10.35 3.9 2.8 18.1a1.65 1.65 0 0 0 1.45 2.4h15.5a1.65 1.65 0 0 0 1.45-2.4L13.65 3.9a1.86 1.86 0 0 0-3.3 0Z\"></path><line x1=\"12\" y1=\"8.25\" x2=\"12\" y2=\"13.75\"></line><path d=\"M12 17.25h.01\"></path></svg>"
}
}
2 changes: 1 addition & 1 deletion contracts/icon-button/cases/warn.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button class="cm-icon-button cm-icon-button--warn cm-icon-button--md" type="button" aria-label="Flag item for review">
<span class="cm-icon-button__icon" aria-hidden="true"><svg></svg></span>
<span class="cm-icon-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M10.35 3.9 2.8 18.1a1.65 1.65 0 0 0 1.45 2.4h15.5a1.65 1.65 0 0 0 1.45-2.4L13.65 3.9a1.86 1.86 0 0 0-3.3 0Z"></path><line x1="12" y1="8.25" x2="12" y2="13.75"></line><path d="M12 17.25h.01"></path></svg></span>
</button>
6 changes: 6 additions & 0 deletions contracts/tooltip/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ focused or hovered without moving focus. The panel remains in the DOM and `hidde
whether it is visible.
`defaultVisible` sets only the initial render state.

Once enhanced, an inline tooltip moves in the viewport and flips to the opposite side when
needed. The panel remains inside its authored container and can still be clipped by an ancestor
with `overflow: hidden`, scrolling overflow, or paint containment. To escape such an ancestor,
choose a portal target outside the clipping container. Before enhancement the Tooltip follows
its CSS placement.

The visible tooltip can be positioned in another container. Use `teleportTo` with a selector or
element in Vue, or `data-cm-tooltip-teleport-to` with a selector in Vanilla. A `body` target
inside an open dialog keeps the tooltip in that dialog. Vue `disableTeleport`, `null`, or
Expand Down
34 changes: 18 additions & 16 deletions docs/codemonster-ui-2.0-release-notes.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# CodeMonster UI 2.0 release notes

Draft changelog for the internal `2.0.0-rc.2` build. Install the seven local tarballs together using
Draft changelog for the unpublished stable `2.0.0` candidate. Install the seven local tarballs together using
[Getting started](./getting-started.md#install-a-local-20-build). The stable registry installation
is documented in the [1.1 release notes](./codemonster-ui-1.1-release-notes.md).

## Package versions

The current internal candidate is `2.0.0-rc.2` for each package below. The coordinated version
keeps the prerelease dependency and peer ranges aligned. The tag workflow selects the `next`
channel for a separately approved prerelease. Stable `2.0.0` requires a fresh qualification run
with stable manifests, dependency ranges and changelog sections.
All seven packages are prepared at `2.0.0`. Use the tarballs from the same candidate build.
The stable version publishes to `latest` after release acceptance and owner approval.

| Package | Internal candidate | What ships |
| Package | Version | What ships |
| --- | --- | --- |
| `@codemonster-ru/ui-tokens` | `2.0.0-rc.2` | Token data, theme CSS and shared breakpoints |
| `@codemonster-ru/ui-icons` | `2.0.0-rc.2` | Named icon geometry and catalog metadata |
| `@codemonster-ru/ui-runtime` | `2.0.0-rc.2` | Vanilla controllers and shared behavior primitives |
| `@codemonster-ru/ui-css` | `2.0.0-rc.2` | Foundation, fonts, and full and component stylesheets |
| `@codemonster-ru/ui-utilities` | `2.0.0-rc.2` | Utility CSS with the matching token dependency |
| `@codemonster-ru/ui-vue` | `2.0.0-rc.2` | Vue components and opt-in historical entry points |
| `@codemonster-ru/ui-layouts` | `2.0.0-rc.2` | Vue layouts, regions and breakpoint composables |
| `@codemonster-ru/ui-tokens` | `2.0.0` | Token data, theme CSS and shared breakpoints |
| `@codemonster-ru/ui-icons` | `2.0.0` | Named icon geometry and catalog metadata |
| `@codemonster-ru/ui-runtime` | `2.0.0` | Vanilla controllers and shared behavior primitives |
| `@codemonster-ru/ui-css` | `2.0.0` | Foundation, fonts, and full and component stylesheets |
| `@codemonster-ru/ui-utilities` | `2.0.0` | Utility CSS with the matching token dependency |
| `@codemonster-ru/ui-vue` | `2.0.0` | Vue components and opt-in historical entry points |
| `@codemonster-ru/ui-layouts` | `2.0.0` | Vue layouts, regions and breakpoint composables |

Vue and Layouts require Vue `^3.5.0`. For Node consumers, including SSR, use Node `^22.22.3`,
`^24.15.0`, or `>=26.0.0` where declared by the package.

## Added

- Vue and Vanilla reference sites with a searchable component catalog, interactive previews,
copyable examples, integrated guides and a Release Workspace demo.
- Vue and Vanilla reference sites with interactive component previews, copyable examples, and links
to the developer guides.
- A dedicated Layouts package for shells, page layouts, regions and shared breakpoint helpers.
- Opt-in historical Vue and Layouts entry points for incremental migration, including component
subpaths with automatic CSS in browser builds and CSS-free entries for server rendering.
Expand All @@ -43,7 +41,11 @@ Vue and Layouts require Vue `^3.5.0`. For Node consumers, including SSR, use Nod

## Fixed

- Matching `Vue` in site search now surfaces local installation and Vue quick start first.
- Vue Skeleton preserves its DOM element when the minimum height changes.
- AdminShell and AdminLayout keep keyboard focus visible around sticky headers. Vue and Vanilla
consumers with a custom AdminShell header can declare its initial clearance for SSR.
- Vanilla showcase previews load a single bundle of package styles, restoring interaction in
Chromium when several embedded previews load together.
- The compact Select preview reserves space for its two-option listbox.
- Sorting the DataTable preview reorders the example rows in both directions.
- Dialog and Drawer descriptions describe how to open the previews and remain accurate when open.
Expand Down
4 changes: 4 additions & 0 deletions docs/components/data-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Table supplies `<thead>`, `<tbody>`, and `<tfoot>` wrappers but does not infer h
relationships. Its outer element owns forwarded attributes and horizontal scrolling. No runtime is
needed.

Table and auto-layout DataTable use the available width and scroll when their content needs more
room. DataTable retains the scrollable minimum for fixed columns so pinning and resizing have room
to work. Column headings use the label scale, while tabular numerals align figures in data cells.

## DataTable data model

Columns have a unique kebab-case `key`, non-empty `header`, optional `sortable`, and optional
Expand Down
22 changes: 16 additions & 6 deletions docs/components/layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,28 @@ Vanilla markup: [admin-layout HTML](../../contracts/admin-layout/cases/default.h

## AdminShell

`CmAdminShell` is a fixed administrative frame: a topbar above a sidebar and workspace. It holds no
state at all, so it needs neither attributes nor a controller — it is the frame, and everything that
changes lives in what fills it.
`CmAdminShell` is a fixed administrative frame with a sticky topbar above a sidebar and workspace.
Set the existing `--cm-layout-header-height` token on the shell when its topbar has a custom height.
Before JavaScript runs, sticky sidebar placement and native focus scrolling use that declared
height. Include the topbar's padding in the value. If the topbar can wrap before enhancement,
declare enough clearance for the tallest expected layout.

After enhancement, the Vue adapter and Vanilla `shell-metrics` controller measure the rendered
topbar and update the clearance as it resizes. Use the same CSS property on the Vanilla
`.cm-admin-shell` element. If you register Vanilla controllers individually, register
`shell-metrics` with `createCmShellMetricsController`.

Use `:fill-viewport="false"` to size the frame to its content. Both `header-actions` and
`headerActions` are accepted as slot names.

```vue
<template>
<CmAdminShell>
<template #brand>Acme</template>
<template #sidebar>Navigation</template>
<CmAdminShell style="--cm-layout-header-height: 120px">
<template #header>
<div style="min-block-size: calc(120px - 2 * var(--cm-space-2))">Acme workspace</div>
</template>
<template #sidebar><a href="#reports">Reports</a></template>
<h1 id="reports">Reports</h1>
Workspace
</CmAdminShell>
</template>
Expand Down
3 changes: 3 additions & 0 deletions docs/components/overlays.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ when the surface flips or shifts to fit the viewport.
- Rich Tooltip content must remain brief and cannot contain controls. You can move the pointer
onto the tooltip to read it, or press Escape to dismiss it without moving focus. Provide
required instructions where they do not depend on a tooltip.
- Enhanced inline tooltips shift or flip at viewport edges. A clipping ancestor can still hide
an inline tooltip. Choose a portal target outside that ancestor when the panel must extend
beyond its bounds.
- Keep content inside a component-owned trigger button noninteractive. Use authored trigger
composition for existing buttons: Tooltip accepts one in its default slot, and Vue Popover
and Dropdown accept one with `triggerAsChild` or through their historical entries.
Expand Down
2 changes: 1 addition & 1 deletion docs/migrate-from-vueforge.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migrate from VueForge

This guide starts from VueForge commit `d9879116` and targets the CodeMonster UI `2.0.0-rc.2`
This guide starts from VueForge commit `d9879116` and targets the CodeMonster UI `2.0.0`
workspace. Build and install matching workspace tarballs to try these examples in another app.
[Build and verify a packed Vue consumer](../packages/vue/README.md#installation).

Expand Down
Loading
Loading