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
5 changes: 2 additions & 3 deletions docs/codemonster-ui-2.0-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Vue and Layouts require Vue `^3.5.0`. For Node consumers, including SSR, use Nod

## 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 +43,6 @@ 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.
- 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
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/recipes/code-block.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vanilla code block recipe

Run `npm run preview:vanilla` from the repository root and open `code-block-example.html` on the local preview server. For deployment, run `npm run build:vanilla` and serve `examples/vanilla/dist` over HTTP. [Example HTML](../../examples/vanilla/code-block-example.html) · [Styles](../../examples/vanilla/code-block-example.css) · [Copy module](../../examples/vanilla/code-block-example.mjs)
Run `npm run dev:vanilla` from the repository root and open `code-block-example.html` on the local server. For deployment, run `npm run build:vanilla` and serve `examples/vanilla/dist` over HTTP. [Example HTML](../../examples/vanilla/code-block-example.html) · [Styles](../../examples/vanilla/code-block-example.css) · [Copy module](../../examples/vanilla/code-block-example.mjs)

Render an escaped code sample inside `<pre><code>` and use a `<figcaption>` for its filename or language. Give each caption a unique ID and use it to name the scrollable region. The source preserves indentation and long lines. The scroll region can receive keyboard focus, and the code remains readable and selectable with JavaScript disabled. If your server already highlights code, render its escaped text and trusted highlighting spans inside `<code>`. The recipe stylesheet uses CodeMonster UI tokens and the shared button styles.

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/playground.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vanilla playground recipe

Run `npm run preview:vanilla` from the repository root and open `playground-example.html` on the local preview server. For deployment, run `npm run build:vanilla` and serve `examples/vanilla/dist` over HTTP. [Example HTML](../../examples/vanilla/playground-example.html) · [Styles](../../examples/vanilla/playground-example.css) · [Preview module](../../examples/vanilla/playground-example.mjs)
Run `npm run dev:vanilla` from the repository root and open `playground-example.html` on the local server. For deployment, run `npm run build:vanilla` and serve `examples/vanilla/dist` over HTTP. [Example HTML](../../examples/vanilla/playground-example.html) · [Styles](../../examples/vanilla/playground-example.css) · [Preview module](../../examples/vanilla/playground-example.mjs)

Enter a body fragment in HTML, styles in CSS, and a browser script in JavaScript. Run replaces the preview with a fresh document. Reset restores the sample source and starting preview. The example source and starting preview are visible with JavaScript disabled. The recipe accepts HTML, CSS, and JavaScript directly. Vue single-file component compilation requires the Vue playground.

Expand Down
7 changes: 3 additions & 4 deletions docs/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ npm run typecheck
npm run lint:all
npm run build
npm run check:packed-consumers
npm run build:demo
npm run build:showcase
npm run build:vanilla
npm run prepublish:all
```
Expand All @@ -70,9 +70,8 @@ All commands must pass on the release commit. Also confirm:

## 4. Inspect tarballs

`npm run prepublish:all` builds and runs dry-run packs for every npm package. For a CodeMonster UI
only train, `npm run prepublish:ui` provides the focused build and dry run. Dry runs print proposed
archive contents but do not create `.tgz` files. Review those file lists and inspect each target
`npm run prepublish:all` builds and runs dry-run packs for every npm package. Dry runs print
proposed archive contents but do not create `.tgz` files. Review those file lists and inspect each target
explicitly when release metadata changes:

```bash
Expand Down
11 changes: 6 additions & 5 deletions docs/vanilla.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ native submission or application validation behavior.

## Browser assets

Run `npm run preview:vanilla` from the repository root to build and open the full catalog.
Browse Core, Reference, Examples, Layouts, Colors, and Icons on separate pages. Reference
pages include copyable Vue and Vanilla examples. Core shows variants, and Examples shows how
the components work together in a release workspace. All pages share the theme selector.
Run `npm run dev:vanilla` from the repository root to edit the showcase with browser reloads.
To inspect production output, run `npm run build:vanilla` followed by `npm run preview:vanilla`.
Browse component variants in the Visual matrix or visit Layouts, Colors, and Icons. Component
detail routes such as `/components/button/` provide copyable Vue and Vanilla examples. All pages
share the theme selector.

For assets to deploy, run `npm run build:vanilla` and serve the contents of
`examples/vanilla/dist` over HTTP. Keep the `tokens` and `css` directories intact so
their relative imports resolve. Open `index.html` for the catalog, `accordion-example.html`
their relative imports resolve. Open `index.html` for the Visual matrix, `accordion-example.html`
for minimal integration, `confirm-dialog-example.html` for a confirmation flow,
`code-block-example.html` for the [code block recipe](recipes/code-block.md), or
`playground-example.html` for the [Vanilla playground recipe](recipes/playground.md).
Expand Down
Loading
Loading