milume 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- milume-1.1.0/.agents/skills/cube-motion/SKILL.md +126 -0
- milume-1.1.0/.agents/skills/shadcn/SKILL.md +277 -0
- milume-1.1.0/.agents/skills/shadcn/agents/openai.yml +5 -0
- milume-1.1.0/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
- milume-1.1.0/.agents/skills/shadcn/assets/shadcn.png +0 -0
- milume-1.1.0/.agents/skills/shadcn/cli.md +290 -0
- milume-1.1.0/.agents/skills/shadcn/customization.md +209 -0
- milume-1.1.0/.agents/skills/shadcn/evals/evals.json +77 -0
- milume-1.1.0/.agents/skills/shadcn/mcp.md +105 -0
- milume-1.1.0/.agents/skills/shadcn/registry.md +277 -0
- milume-1.1.0/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
- milume-1.1.0/.agents/skills/shadcn/rules/chat.md +224 -0
- milume-1.1.0/.agents/skills/shadcn/rules/composition.md +213 -0
- milume-1.1.0/.agents/skills/shadcn/rules/forms.md +192 -0
- milume-1.1.0/.agents/skills/shadcn/rules/icons.md +101 -0
- milume-1.1.0/.agents/skills/shadcn/rules/styling.md +185 -0
- milume-1.1.0/.agents/skills/shadcn-anywidget/SKILL.md +177 -0
- milume-1.1.0/.agents/skills/verify-landmarks/SKILL.md +118 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/README.md +51 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/canvas-rulers.md +38 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/chrome-rest.md +50 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/inspect-cube.md +134 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/inspect-history.md +75 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/landmark-edit-node.md +77 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/landmark-undo.md +61 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/panel-peek.md +58 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/place-landmark-line.md +60 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/place-landmark-point.md +56 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/place-spline-shape.md +64 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/pointer-or-select-modes.md +73 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/selection-neighborhood.md +81 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/toolbar-layout.md +70 -0
- milume-1.1.0/.agents/skills/verify-landmarks/features/zoom-controls.md +56 -0
- milume-1.1.0/.cursor/environment.json +16 -0
- milume-1.1.0/.github/scripts/post-playwright-visuals.sh +280 -0
- milume-1.1.0/.github/workflows/ci.yml +32 -0
- milume-1.1.0/.github/workflows/frontend-e2e.yml +211 -0
- milume-1.1.0/.github/workflows/publish-test.yml +33 -0
- milume-1.1.0/.github/workflows/publish.yml +43 -0
- milume-1.1.0/.gitignore +18 -0
- milume-1.1.0/AGENTS.md +157 -0
- milume-1.1.0/CONTEXT.md +99 -0
- milume-1.1.0/LICENSE +20 -0
- milume-1.1.0/PKG-INFO +141 -0
- milume-1.1.0/README.md +98 -0
- milume-1.1.0/ROADMAP.md +22 -0
- milume-1.1.0/assets/landmarks_widget_dark.png +0 -0
- milume-1.1.0/assets/landmarks_widget_light.png +0 -0
- milume-1.1.0/demos/landmarks.py +162 -0
- milume-1.1.0/docs/adr/0001-prebuilt-bundles-node-free-install.md +15 -0
- milume-1.1.0/docs/adr/0002-named-traitlets-as-widget-contract.md +16 -0
- milume-1.1.0/docs/adr/0003-deckgl-landmarks-renderer.md +48 -0
- milume-1.1.0/docs/adr/0004-neighborhood-visuals.md +51 -0
- milume-1.1.0/docs/adr/0005-widget-owns-rendering-controls.md +32 -0
- milume-1.1.0/docs/adr/0006-landmarks-hosts-volume-cube.md +93 -0
- milume-1.1.0/docs/landmarks-spatialdata-contract.md +113 -0
- milume-1.1.0/docs/publishing.md +33 -0
- milume-1.1.0/docs/shadcn-frontend.md +51 -0
- milume-1.1.0/docs/superpowers/specs/2026-09-25-landmarks-inspect-cube-design.md +241 -0
- milume-1.1.0/docs/superpowers/specs/2026-09-26-inspect-preview-dock-design.md +213 -0
- milume-1.1.0/docs/widget-packaging.md +123 -0
- milume-1.1.0/docs/widget-ui-dev.md +79 -0
- milume-1.1.0/frontend/.gitignore +38 -0
- milume-1.1.0/frontend/DESIGN.md +270 -0
- milume-1.1.0/frontend/PRODUCT.md +88 -0
- milume-1.1.0/frontend/components.json +24 -0
- milume-1.1.0/frontend/dev/HarnessShell.tsx +101 -0
- milume-1.1.0/frontend/dev/export-fixture.py +397 -0
- milume-1.1.0/frontend/dev/export-landmarks-volume-fixture.py +101 -0
- milume-1.1.0/frontend/dev/fixture.json +259 -0
- milume-1.1.0/frontend/dev/index.html +85 -0
- milume-1.1.0/frontend/dev/landmarks-volume/.gitattributes +2 -0
- milume-1.1.0/frontend/dev/landmarks-volume/index.html +22 -0
- milume-1.1.0/frontend/dev/landmarks-volume/main.tsx +68 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/0/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/0/2 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/0/3 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/1/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/1/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/1/2 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/1/3 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/2/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/2/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/2/2 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/2/3 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/3/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/3/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/3/2 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/c/0/0/3/3 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s0/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s1/c/0/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s1/c/0/0/0/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s1/c/0/0/1/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s1/c/0/0/1/1 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s1/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s2/c/0/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/s2/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/mosaic/zarr.json +166 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/images/zarr.json +5 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s0/c/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s0/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s1/c/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s1/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s2/c/0/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/s2/zarr.json +49 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/cells/zarr.json +144 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/labels/zarr.json +11 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/X/c/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/X/zarr.json +68 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/layers/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/_index/mask/zarr.json +62 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/_index/values/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/_index/values/zarr.json +63 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/_index/zarr.json +9 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_id/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_id/zarr.json +65 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_type/categories/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_type/categories/zarr.json +63 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_type/codes/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_type/codes/zarr.json +62 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/cell_type/zarr.json +9 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/region/categories/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/region/categories/zarr.json +63 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/region/codes/zarr.json +62 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/region/zarr.json +9 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obs/zarr.json +14 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obsm/spatial/c/0/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obsm/spatial/zarr.json +68 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obsm/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/obsp/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/raw/zarr.json +36 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/instance_key/c +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/instance_key/zarr.json +37 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/region/c +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/region/zarr.json +37 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/region_key/c +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/region_key/zarr.json +37 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/spatialdata_attrs/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/uns/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/var/_index/mask/zarr.json +62 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/var/_index/values/c/0 +0 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/var/_index/values/zarr.json +63 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/var/_index/zarr.json +9 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/var/zarr.json +10 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/varm/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/varp/zarr.json +8 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/table/zarr.json +13 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/tables/zarr.json +5 -0
- milume-1.1.0/frontend/dev/landmarks-volume/public/toy.sdata.zarr/zarr.json +1713 -0
- milume-1.1.0/frontend/dev/landmarks-volume-fixture.json +111 -0
- milume-1.1.0/frontend/dev/main.tsx +13 -0
- milume-1.1.0/frontend/dev/mock-model.ts +50 -0
- milume-1.1.0/frontend/e2e/README.md +84 -0
- milume-1.1.0/frontend/e2e/core/shared-chrome.spec.ts +32 -0
- milume-1.1.0/frontend/e2e/core/shared-chrome.spec.ts-snapshots/shared-chrome-rest-chromium.png +0 -0
- milume-1.1.0/frontend/e2e/helpers.ts +112 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks-tools.spec.ts +310 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks-volume.spec.ts +1373 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks.spec.ts +561 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks.spec.ts-snapshots/after-place-point-chromium.png +0 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks.spec.ts-snapshots/rest-chromium.png +0 -0
- milume-1.1.0/frontend/e2e/landmarks/landmarks.spec.ts-snapshots/selection-neighborhood-chromium.png +0 -0
- milume-1.1.0/frontend/package-lock.json +6976 -0
- milume-1.1.0/frontend/package.json +76 -0
- milume-1.1.0/frontend/playwright.config.ts +61 -0
- milume-1.1.0/frontend/src/components/ui/badge.tsx +44 -0
- milume-1.1.0/frontend/src/components/ui/button.tsx +64 -0
- milume-1.1.0/frontend/src/components/ui/card.tsx +92 -0
- milume-1.1.0/frontend/src/components/ui/chart.tsx +373 -0
- milume-1.1.0/frontend/src/components/ui/collapsible.tsx +31 -0
- milume-1.1.0/frontend/src/components/ui/combobox.tsx +313 -0
- milume-1.1.0/frontend/src/components/ui/dropdown-menu.tsx +257 -0
- milume-1.1.0/frontend/src/components/ui/field.tsx +246 -0
- milume-1.1.0/frontend/src/components/ui/input-group.tsx +168 -0
- milume-1.1.0/frontend/src/components/ui/input.tsx +21 -0
- milume-1.1.0/frontend/src/components/ui/item.tsx +151 -0
- milume-1.1.0/frontend/src/components/ui/label.tsx +22 -0
- milume-1.1.0/frontend/src/components/ui/radio-group.tsx +42 -0
- milume-1.1.0/frontend/src/components/ui/separator.tsx +28 -0
- milume-1.1.0/frontend/src/components/ui/slider.tsx +99 -0
- milume-1.1.0/frontend/src/components/ui/switch.tsx +37 -0
- milume-1.1.0/frontend/src/components/ui/tabs.tsx +88 -0
- milume-1.1.0/frontend/src/components/ui/textarea.tsx +18 -0
- milume-1.1.0/frontend/src/components/ui/toggle-group.tsx +83 -0
- milume-1.1.0/frontend/src/components/ui/toggle.tsx +47 -0
- milume-1.1.0/frontend/src/components/ui/tooltip.tsx +55 -0
- milume-1.1.0/frontend/src/hooks/use-model.ts +77 -0
- milume-1.1.0/frontend/src/hooks/use-notebook-theme.ts +85 -0
- milume-1.1.0/frontend/src/lib/utils.ts +6 -0
- milume-1.1.0/frontend/src/styles/globals.css +90 -0
- milume-1.1.0/frontend/src/widgets/landmarks/LandmarksView.tsx +517 -0
- milume-1.1.0/frontend/src/widgets/landmarks/binary.ts +17 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/canvas-rulers.tsx +123 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/coloring.ts +74 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/cube-window.tsx +369 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/explore-panel.tsx +443 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/genes-legend.tsx +165 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/genes-ternary.ts +11 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/index.ts +15 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/info-panel.tsx +664 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/info-stats.ts +402 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/inspect-preview.tsx +443 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/inspect-toolbar.tsx +441 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/landmark-canvas-menu.tsx +237 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/layers-panel.tsx +98 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/minimap-panel.tsx +358 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/mode-dropdown.tsx +135 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/panel-peek.tsx +97 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/plot-channel-legend.tsx +110 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/primitives.tsx +456 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/raster-section.tsx +65 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/rgb-cube-legend.tsx +94 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/rgb-cube.ts +217 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/right-stack.tsx +138 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/sections.ts +53 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/selection-toolbar.tsx +749 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/sliding-tabs.tsx +91 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/soft-float-slider.tsx +341 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/topbar.tsx +159 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/use-widget-portal.ts +36 -0
- milume-1.1.0/frontend/src/widgets/landmarks/chrome/view-cta.tsx +75 -0
- milume-1.1.0/frontend/src/widgets/landmarks/cube-cut.ts +87 -0
- milume-1.1.0/frontend/src/widgets/landmarks/cube-highlight.ts +82 -0
- milume-1.1.0/frontend/src/widgets/landmarks/engine.d.ts +141 -0
- milume-1.1.0/frontend/src/widgets/landmarks/engine.js +1 -0
- milume-1.1.0/frontend/src/widgets/landmarks/helpers.ts +277 -0
- milume-1.1.0/frontend/src/widgets/landmarks/index.tsx +35 -0
- milume-1.1.0/frontend/src/widgets/landmarks/landmarks.css +1940 -0
- milume-1.1.0/frontend/src/widgets/landmarks/model.d.ts +11 -0
- milume-1.1.0/frontend/src/widgets/landmarks/model.js +5 -0
- milume-1.1.0/frontend/src/widgets/landmarks/spatial-neighbors.js +71 -0
- milume-1.1.0/frontend/src/widgets/landmarks/spatial-raster.js +413 -0
- milume-1.1.0/frontend/src/widgets/landmarks/state.d.ts +198 -0
- milume-1.1.0/frontend/src/widgets/landmarks/state.js +38 -0
- milume-1.1.0/frontend/src/widgets/landmarks/use-cube-settings.ts +57 -0
- milume-1.1.0/frontend/src/widgets/landmarks/use-inspect-cube.ts +348 -0
- milume-1.1.0/frontend/src/widgets/landmarks/use-landmarks-model.ts +356 -0
- milume-1.1.0/frontend/src/widgets/landmarks/use-widget-fullscreen.ts +117 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/CubeControls.tsx +191 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/VolumeCube.tsx +878 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/axis-legend.tsx +98 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/cell-lut-extension.ts +415 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/cell-volume.ts +209 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/chunk-cache.ts +109 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/frame-layers.ts +166 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/image-volume.ts +147 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/overlay-layers.ts +154 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/palettes.ts +75 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/use-shown-window.ts +184 -0
- milume-1.1.0/frontend/src/widgets/volume-cube/window-source.ts +285 -0
- milume-1.1.0/frontend/tsconfig.json +24 -0
- milume-1.1.0/frontend/vite.config.ts +146 -0
- milume-1.1.0/milume/__init__.py +41 -0
- milume-1.1.0/milume/_assets.py +40 -0
- milume-1.1.0/milume/categories.py +155 -0
- milume-1.1.0/milume/genes.py +378 -0
- milume-1.1.0/milume/landmarks.py +1008 -0
- milume-1.1.0/milume/measure.py +572 -0
- milume-1.1.0/milume/py.typed +0 -0
- milume-1.1.0/milume/selection.py +111 -0
- milume-1.1.0/milume/spatialdata_landmarks.py +178 -0
- milume-1.1.0/milume/static/bundled/landmarks.mjs +104240 -0
- milume-1.1.0/milume/static/bundled/widgets.css +1 -0
- milume-1.1.0/milume/static/landmarks.js +6402 -0
- milume-1.1.0/milume/static/landmarks_geometry.js +631 -0
- milume-1.1.0/milume/static/landmarks_model.js +105 -0
- milume-1.1.0/milume/static/landmarks_state.js +498 -0
- milume-1.1.0/milume/volume_cube.py +167 -0
- milume-1.1.0/milume/volume_source.py +130 -0
- milume-1.1.0/pyproject.toml +79 -0
- milume-1.1.0/shim/spatial_rx_shim/README.md +14 -0
- milume-1.1.0/shim/spatial_rx_shim/pyproject.toml +28 -0
- milume-1.1.0/shim/spatial_rx_shim/spatial_rx/__init__.py +26 -0
- milume-1.1.0/shim/spatial_rx_shim/spatial_rx/py.typed +0 -0
- milume-1.1.0/skills-lock.json +17 -0
- milume-1.1.0/tests/helpers.py +93 -0
- milume-1.1.0/tests/test_anndata.py +100 -0
- milume-1.1.0/tests/test_assets.py +13 -0
- milume-1.1.0/tests/test_categories.py +53 -0
- milume-1.1.0/tests/test_genes.py +289 -0
- milume-1.1.0/tests/test_landmarks.py +95 -0
- milume-1.1.0/tests/test_landmarks_volume.py +77 -0
- milume-1.1.0/tests/test_measure.py +225 -0
- milume-1.1.0/tests/test_raster_widget.py +165 -0
- milume-1.1.0/tests/test_serve_directory.py +90 -0
- milume-1.1.0/tests/test_spatialdata_landmarks.py +141 -0
- milume-1.1.0/tests/test_volume_source.py +65 -0
- milume-1.1.0/tests/test_widget_bundles.py +11 -0
- milume-1.1.0/tests/test_zero_copy_input.py +55 -0
- milume-1.1.0/uv.lock +5578 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cube-motion
|
|
3
|
+
description: >-
|
|
4
|
+
Use only when adding or changing cube-motion primitives already in the codebase:
|
|
5
|
+
`rise`, `leave`, `morph`, `reveal` and their React/Solid components (`<Rise>`,
|
|
6
|
+
`<Morph>`, `<Reveal>`). Does not own behavioral verification — for LandmarksWidget
|
|
7
|
+
proof use verify-landmarks.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# cube-motion
|
|
11
|
+
|
|
12
|
+
Four fixed UI motions on the Web Animations API. Zero dependencies. Optional React, Vue, Solid and Svelte adapters. Nothing to tune: pick the job, name the element.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npm i cube-motion
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Which function
|
|
19
|
+
|
|
20
|
+
| You want | Use | Note |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| Content to appear on load or mount | `rise` / `<Rise>` | Animates the element; `targets="children"` staggers its children. |
|
|
23
|
+
| Content to disappear before removal | `leave` / `<Rise show={false}>` | Await `finished` before removing the node. The component does this for you. |
|
|
24
|
+
| A toast, dialog or panel that comes and goes | `<Rise show={open}>` | Mounts with rise, leaves, then unmounts. |
|
|
25
|
+
| An icon or label to change state | `morph` / `<Morph active>` | Both faces stay mounted. |
|
|
26
|
+
| Cards to animate as the user scrolls | `reveal` / `<Reveal>` | Hides now, rises on first intersection. |
|
|
27
|
+
| A button to react to a press | CSS, not this library | `button:active { scale: 0.97 }` with a `transition`. |
|
|
28
|
+
| A timeline, a gesture, layout animation | Motion or GSAP | Out of scope. |
|
|
29
|
+
|
|
30
|
+
## Core
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { rise, leave, morph, reveal } from "cube-motion";
|
|
34
|
+
|
|
35
|
+
type Targets = string | Element | Iterable<Element>;
|
|
36
|
+
|
|
37
|
+
rise(elements: Targets, options?: { targets?: "self" | "children"; stagger?: number; delay?: number }): Animation[];
|
|
38
|
+
leave(elements: Targets, options?: { targets?: "self" | "children"; stagger?: number; delay?: number }): Animation[];
|
|
39
|
+
morph(outgoing: Element, incoming: Element): Animation[];
|
|
40
|
+
reveal(elements: Targets, options?: { targets?: "self" | "children"; stagger?: number; root?: Element | null }): () => void; // cleanup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `rise`: opacity 0 to 1 with a 12px lift, 640ms, 70ms stagger, `fill: backwards`.
|
|
44
|
+
- `leave`: opacity 1 to 0 with a 12px drop, 320ms, 40ms stagger, `fill: both`, holding the interrupted starting state through any delay and the final state until removed or risen again.
|
|
45
|
+
- `morph`: content-aware. Text uses temporary inert, `aria-hidden` sibling overlays, split by grapheme. Original text nodes and accessible labels remain untouched. Shared leading letters stay still; other outgoing letters blur out (180ms each, 35ms stagger), incoming letters blur in starting 60ms later. Without `Intl.Segmenter`, or for other content, whole faces crossfade: outgoing opacity 0, scale 0.8, blur 4px over 220ms, incoming starts at 130ms. The outgoing face becomes absolute and inert with `aria-hidden`; incoming returns to flow and accessibility. The parent becomes relative if needed and eases its width over 400ms. Temporary copies are removed on completion or cancellation.
|
|
46
|
+
- `reveal`: hides immediately, insets the observer's bottom edge by 10% of the scroll root's height measured at binding, then calls `rise` on first intersection with a 60ms stagger. Cleanup restores waiting elements' authored opacity and cancels active entrances. Duplicate or stale observer notifications are ignored.
|
|
47
|
+
|
|
48
|
+
`targets` defaults to `"self"` in core functions, components and hooks. `"children"` selects direct element children. A target list is captured when called; rebind to include children added later. Imports are SSR-safe; call core functions in the browser. Cancelled animations reject `finished` with `AbortError`: catch cancellation and do not remove a node whose exit was interrupted.
|
|
49
|
+
|
|
50
|
+
Every function is interruptible: it reads the element's computed state, cancels what is running, and animates from there, so rise after leave and leave after rise continue smoothly at any moment. Every function reads `prefers-reduced-motion` at call time: translate, scale and blur are dropped, opacity stays.
|
|
51
|
+
|
|
52
|
+
One curve: `cubic-bezier(0.2, 0, 0, 1)`.
|
|
53
|
+
|
|
54
|
+
## React
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { Rise, Morph, Reveal } from "cube-motion/react";
|
|
58
|
+
|
|
59
|
+
<Rise as?="div" show?=true targets?="self" stagger? delay? {...elementProps}>children</Rise>
|
|
60
|
+
<Morph as?="span" active off on {...elementProps} />
|
|
61
|
+
<Reveal as?="div" targets?="self" stagger? root? {...elementProps}>children</Reveal>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- Polymorphic: `as` is a tag or a component that forwards its ref. Other props go to the element, typed for that tag. A caller `ref` is merged.
|
|
65
|
+
- `Rise` animates its own element on mount. With `show`, turning it false runs `leave`, waits for `finished`, then unmounts. Turning it true retargets the entrance. `show={false}` initially renders nothing. Use `targets="children"` for a staggered group.
|
|
66
|
+
- `Morph` renders two `span` faces in inline-flex. The active face sizes the wrapper; the inactive face is absolute, transparent, inert and `aria-hidden` from the first render. No CSS import.
|
|
67
|
+
- Hooks return object refs: `useRise(options?)`, `useMorph(active)` returning `[off, on]`, `useReveal(options?)`. Attach refs in the owning component so its commits detect replacement nodes. The React subpath includes `"use client"` for React Server Component frameworks.
|
|
68
|
+
|
|
69
|
+
## Solid
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { Rise, Morph, Reveal } from "cube-motion/solid";
|
|
73
|
+
|
|
74
|
+
<Rise show={open()} class="toast">Saved</Rise>
|
|
75
|
+
<Morph active={saved()} off="Save" on="Saved" />
|
|
76
|
+
<Reveal as="ul" targets="children" class="cards">{cards}</Reveal>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Same components and props. Solid conventions: `class`, `ref` as a variable or callback, reactive reads (`open()`, not `open`). Bindings run on the client and are released in `onCleanup`.
|
|
80
|
+
|
|
81
|
+
## Vue
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
import { Rise, Morph, Reveal } from "cube-motion/vue";
|
|
85
|
+
|
|
86
|
+
<Rise as?="div" :show?="true" targets?="self" :stagger? :delay? v-bind="attrs">children</Rise>
|
|
87
|
+
<Morph as?="span" :active off? on? v-bind="attrs" /> <!-- or #off and #on slots -->
|
|
88
|
+
<Reveal as?="div" targets?="self" :stagger? :root? v-bind="attrs">children</Reveal>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Render-function components, no SFC. `inheritAttrs` is off and attrs are spread onto the element: `class`, `style` and listeners all land on it. A template `ref` on the component gives the instance; read `.$el` for the element. Custom `as` components must render one element root.
|
|
92
|
+
|
|
93
|
+
## Svelte
|
|
94
|
+
|
|
95
|
+
```svelte
|
|
96
|
+
import { rise, leave, morph, reveal } from "cube-motion/svelte";
|
|
97
|
+
|
|
98
|
+
<div in:rise out:leave>…</div> <!-- transitions; Svelte waits for out -->
|
|
99
|
+
<li in:rise={{ index: i }}>…</li> <!-- index * stagger, or delay: ms -->
|
|
100
|
+
<button use:morph={active}><i>off</i><i>on</i></button> <!-- action; two children are the faces -->
|
|
101
|
+
<ul use:reveal={{ targets: "children" }}>…</ul> <!-- action; explicitly observe children -->
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
No `show` prop: use `{#if}` with `in:rise out:leave`. The transitions evaluate the same curve in JS. Works on Svelte 4 and 5. Actions run only on the client: for SSR, include the initial face layout and `aria-hidden`/`inert` attributes in markup as shown in the README. `use:morph` requires exactly two child faces; `use:reveal` defaults to the element itself.
|
|
105
|
+
|
|
106
|
+
## Rules
|
|
107
|
+
|
|
108
|
+
- Never add `duration`, `easing`, `distance` or `scale` options. If a motion feels wrong, the fix is a new job, not a knob.
|
|
109
|
+
- Do not wrap a single button in `<Rise>` to press it. Use CSS.
|
|
110
|
+
- Do not animate unmount by hand. Use `show` in React, Vue and Solid, `out:leave` in Svelte.
|
|
111
|
+
- In vanilla, remove a node only after `leave`'s animations have finished.
|
|
112
|
+
- Do not import a stylesheet; there is none.
|
|
113
|
+
|
|
114
|
+
## Morph faces in vanilla
|
|
115
|
+
|
|
116
|
+
Give the two faces one parent. The active face sits in the flow and sizes the parent; the inactive one floats over it, hidden:
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
.faces { position: relative; display: inline-flex; align-items: center; }
|
|
120
|
+
.faces > * { display: inline-flex; align-items: center; white-space: nowrap; will-change: opacity, filter, scale; }
|
|
121
|
+
.faces > .hidden { position: absolute; inset: 0; opacity: 0; }
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`morph` swaps which face is in the flow on every call. `white-space: nowrap` keeps a text face from wrapping while the width eases. The framework components set all of this for you.
|
|
125
|
+
|
|
126
|
+
Set `aria-hidden="true" inert` on the initially inactive vanilla face. Subsequent calls synchronize those attributes.
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shadcn
|
|
3
|
+
description: Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".
|
|
4
|
+
user-invocable: false
|
|
5
|
+
allowed-tools: Bash(npx shadcn@latest *), Bash(pnpm dlx shadcn@latest *), Bash(bunx --bun shadcn@latest *)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# shadcn/ui
|
|
9
|
+
|
|
10
|
+
A framework for building ui, components and design systems. Components are added as source code to the user's project via the CLI.
|
|
11
|
+
|
|
12
|
+
> **IMPORTANT:** Run all CLI commands using the project's package runner: `npx shadcn@latest`, `pnpm dlx shadcn@latest`, or `bunx --bun shadcn@latest` — based on the project's `packageManager`. Examples below use `npx shadcn@latest` but substitute the correct runner for the project.
|
|
13
|
+
|
|
14
|
+
## Current Project Context
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
!`npx shadcn@latest info --json`
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The JSON above contains the project config and installed components. Use `npx shadcn@latest docs <component>` to get documentation and example URLs for any component.
|
|
21
|
+
|
|
22
|
+
## Principles
|
|
23
|
+
|
|
24
|
+
1. **Use existing components first.** Use `npx shadcn@latest search` to check registries before writing custom UI. Check community registries too.
|
|
25
|
+
2. **Compose, don't reinvent.** Settings page = Tabs + Card + form controls. Dashboard = Sidebar + Card + Chart + Table.
|
|
26
|
+
3. **Use built-in variants before custom styles.** `variant="outline"`, `size="sm"`, etc.
|
|
27
|
+
4. **Use semantic colors.** `bg-primary`, `text-muted-foreground` — never raw values like `bg-blue-500`.
|
|
28
|
+
|
|
29
|
+
## Critical Rules
|
|
30
|
+
|
|
31
|
+
These rules are **always enforced**. Each links to a file with Incorrect/Correct code pairs.
|
|
32
|
+
|
|
33
|
+
### Styling & Tailwind → [styling.md](./rules/styling.md)
|
|
34
|
+
|
|
35
|
+
- **`className` for layout, not styling.** Never override component colors or typography.
|
|
36
|
+
- **No `space-x-*` or `space-y-*`.** Use `flex` with `gap-*`. For vertical stacks, `flex flex-col gap-*`.
|
|
37
|
+
- **Use `size-*` when width and height are equal.** `size-10` not `w-10 h-10`.
|
|
38
|
+
- **Use `truncate` shorthand.** Not `overflow-hidden text-ellipsis whitespace-nowrap`.
|
|
39
|
+
- **No manual `dark:` color overrides.** Use semantic tokens (`bg-background`, `text-muted-foreground`).
|
|
40
|
+
- **Use `cn()` for conditional classes.** Don't write manual template literal ternaries.
|
|
41
|
+
- **No manual `z-index` on overlay components.** Dialog, Sheet, Popover, etc. handle their own stacking.
|
|
42
|
+
|
|
43
|
+
### Forms & Inputs → [forms.md](./rules/forms.md)
|
|
44
|
+
|
|
45
|
+
- **Forms use `FieldGroup` + `Field`.** Never use raw `div` with `space-y-*` or `grid gap-*` for form layout.
|
|
46
|
+
- **`InputGroup` uses `InputGroupInput`/`InputGroupTextarea`.** Never raw `Input`/`Textarea` inside `InputGroup`.
|
|
47
|
+
- **Buttons inside inputs use `InputGroup` + `InputGroupAddon`.**
|
|
48
|
+
- **Option sets (2–7 choices) use `ToggleGroup`.** Don't loop `Button` with manual active state.
|
|
49
|
+
- **`FieldSet` + `FieldLegend` for grouping related checkboxes/radios.** Don't use a `div` with a heading.
|
|
50
|
+
- **Field validation uses `data-invalid` + `aria-invalid`.** `data-invalid` on `Field`, `aria-invalid` on the control. For disabled: `data-disabled` on `Field`, `disabled` on the control.
|
|
51
|
+
|
|
52
|
+
### Component Structure → [composition.md](./rules/composition.md)
|
|
53
|
+
|
|
54
|
+
- **Items always inside their Group.** `SelectItem` → `SelectGroup`. `DropdownMenuItem` → `DropdownMenuGroup`. `CommandItem` → `CommandGroup`.
|
|
55
|
+
- **Use `asChild` (radix) or `render` (base) for custom triggers.** Check `base` field from `npx shadcn@latest info`. → [base-vs-radix.md](./rules/base-vs-radix.md)
|
|
56
|
+
- **Dialog, Sheet, and Drawer always need a Title.** `DialogTitle`, `SheetTitle`, `DrawerTitle` required for accessibility. Use `className="sr-only"` if visually hidden.
|
|
57
|
+
- **Use full Card composition.** `CardHeader`/`CardTitle`/`CardDescription`/`CardContent`/`CardFooter`. Don't dump everything in `CardContent`.
|
|
58
|
+
- **Button has no `isPending`/`isLoading`.** Compose with `Spinner` + `data-icon` + `disabled`.
|
|
59
|
+
- **`TabsTrigger` must be inside `TabsList`.** Never render triggers directly in `Tabs`.
|
|
60
|
+
- **`Avatar` always needs `AvatarFallback`.** For when the image fails to load.
|
|
61
|
+
|
|
62
|
+
### Use Components, Not Custom Markup → [composition.md](./rules/composition.md)
|
|
63
|
+
|
|
64
|
+
- **Use existing components before custom markup.** Check if a component exists before writing a styled `div`.
|
|
65
|
+
- **Callouts use `Alert`.** Don't build custom styled divs.
|
|
66
|
+
- **Empty states use `Empty`.** Don't build custom empty state markup.
|
|
67
|
+
- **Toast follows the project base.** Use `toast` from the `toast` component for
|
|
68
|
+
Base UI projects. Use `toast()` from `sonner` for Radix and React Aria
|
|
69
|
+
projects.
|
|
70
|
+
- **Use `Separator`** instead of `<hr>` or `<div className="border-t">`.
|
|
71
|
+
- **Use `Skeleton`** for loading placeholders. No custom `animate-pulse` divs.
|
|
72
|
+
- **Use `Badge`** instead of custom styled spans.
|
|
73
|
+
|
|
74
|
+
### Icons → [icons.md](./rules/icons.md)
|
|
75
|
+
|
|
76
|
+
- **Icons in `Button` use `data-icon`.** `data-icon="inline-start"` or `data-icon="inline-end"` on the icon.
|
|
77
|
+
- **No sizing classes on icons inside components.** Components handle icon sizing via CSS. No `size-4` or `w-4 h-4`.
|
|
78
|
+
- **Pass icons as objects, not string keys.** `icon={CheckIcon}`, not a string lookup.
|
|
79
|
+
|
|
80
|
+
### Chat & Messaging → [chat.md](./rules/chat.md)
|
|
81
|
+
|
|
82
|
+
- **Chat UI composes the chat primitives.** Conversations use `MessageScroller`, rows use `Message`, surfaces use `Bubble`. Never hand-rolled bubble `div`s or a raw scroll container.
|
|
83
|
+
- **`MessageScroller` owns scroll behavior.** Streaming follow, anchoring, and jump-to-latest (`MessageScrollerButton`) are built in. Don't write a `useStickToBottom`/`ResizeObserver` hook.
|
|
84
|
+
- **Attachments use `Attachment`; system notes and dividers use `Marker`.** Not `Item` cards or `Separator` + a label.
|
|
85
|
+
|
|
86
|
+
### CLI
|
|
87
|
+
|
|
88
|
+
- **Never decode preset codes or build preset URLs manually.** Use `npx shadcn@latest preset decode <code>`, `preset url <code>`, or `preset open <code>`. For project-aware preset detection, use `npx shadcn@latest preset resolve`.
|
|
89
|
+
- **Apply preset codes directly with the CLI.** Use `npx shadcn@latest apply <code>` for existing projects, or `npx shadcn@latest init --preset <code>` when initializing.
|
|
90
|
+
|
|
91
|
+
## Key Patterns
|
|
92
|
+
|
|
93
|
+
These are the most common patterns that differentiate correct shadcn/ui code. For edge cases, see the linked rule files above.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
// Form layout: FieldGroup + Field, not div + Label.
|
|
97
|
+
<FieldGroup>
|
|
98
|
+
<Field>
|
|
99
|
+
<FieldLabel htmlFor="email">Email</FieldLabel>
|
|
100
|
+
<Input id="email" />
|
|
101
|
+
</Field>
|
|
102
|
+
</FieldGroup>
|
|
103
|
+
|
|
104
|
+
// Validation: data-invalid on Field, aria-invalid on the control.
|
|
105
|
+
<Field data-invalid>
|
|
106
|
+
<FieldLabel>Email</FieldLabel>
|
|
107
|
+
<Input aria-invalid />
|
|
108
|
+
<FieldDescription>Invalid email.</FieldDescription>
|
|
109
|
+
</Field>
|
|
110
|
+
|
|
111
|
+
// Icons in buttons: data-icon, no sizing classes.
|
|
112
|
+
<Button>
|
|
113
|
+
<SearchIcon data-icon="inline-start" />
|
|
114
|
+
Search
|
|
115
|
+
</Button>
|
|
116
|
+
|
|
117
|
+
// Spacing: gap-*, not space-y-*.
|
|
118
|
+
<div className="flex flex-col gap-4"> // correct
|
|
119
|
+
<div className="space-y-4"> // wrong
|
|
120
|
+
|
|
121
|
+
// Equal dimensions: size-*, not w-* h-*.
|
|
122
|
+
<Avatar className="size-10"> // correct
|
|
123
|
+
<Avatar className="w-10 h-10"> // wrong
|
|
124
|
+
|
|
125
|
+
// Status colors: Badge variants or semantic tokens, not raw colors.
|
|
126
|
+
<Badge variant="secondary">+20.1%</Badge> // correct
|
|
127
|
+
<span className="text-emerald-600">+20.1%</span> // wrong
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Component Selection
|
|
131
|
+
|
|
132
|
+
| Need | Use |
|
|
133
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
134
|
+
| Button/action | `Button` with appropriate variant |
|
|
135
|
+
| Form inputs | `Input`, `Select`, `Combobox`, `Switch`, `Checkbox`, `RadioGroup`, `Textarea`, `InputOTP`, `Slider` |
|
|
136
|
+
| Toggle between 2–5 options | `ToggleGroup` + `ToggleGroupItem` |
|
|
137
|
+
| Data display | `Table`, `Card`, `Badge`, `Avatar` |
|
|
138
|
+
| Navigation | `Sidebar`, `NavigationMenu`, `Breadcrumb`, `Tabs`, `Pagination` |
|
|
139
|
+
| Overlays | `Dialog` (modal), `Sheet` (side panel), `Drawer` (bottom sheet), `AlertDialog` (confirmation) |
|
|
140
|
+
| Feedback | `toast` (Base UI), `sonner` (Radix/Aria), `Alert`, `Progress`, `Skeleton`, `Spinner` |
|
|
141
|
+
| Command palette | `Command` inside `Dialog` |
|
|
142
|
+
| Charts | `Chart` (wraps Recharts) |
|
|
143
|
+
| Layout | `Card`, `Separator`, `Resizable`, `ScrollArea`, `Accordion`, `Collapsible` |
|
|
144
|
+
| Empty states | `Empty` |
|
|
145
|
+
| Menus | `DropdownMenu`, `ContextMenu`, `Menubar` |
|
|
146
|
+
| Tooltips/info | `Tooltip`, `HoverCard`, `Popover` |
|
|
147
|
+
| Chat / conversation UI | `MessageScroller`, `Message`, `Bubble`, `Attachment`, `Marker` |
|
|
148
|
+
|
|
149
|
+
## Key Fields
|
|
150
|
+
|
|
151
|
+
The injected project context contains these key fields:
|
|
152
|
+
|
|
153
|
+
- **`aliases`** → use the actual alias prefix for imports (e.g. `@/`, `~/`), never hardcode.
|
|
154
|
+
- **`isRSC`** → when `true`, components using `useState`, `useEffect`, event handlers, or browser APIs need `"use client"` at the top of the file. Always reference this field when advising on the directive.
|
|
155
|
+
- **`tailwindVersion`** → `"v4"` uses `@theme inline` blocks; `"v3"` uses `tailwind.config.js`.
|
|
156
|
+
- **`tailwindCssFile`** → the global CSS file where custom CSS variables are defined. Always edit this file, never create a new one.
|
|
157
|
+
- **`style`** → component visual treatment (e.g. `nova`, `vega`).
|
|
158
|
+
- **`base`** → primitive library (`radix` or `base`). Affects component APIs and available props.
|
|
159
|
+
- **`iconLibrary`** → determines icon imports. Use `lucide-react` for `lucide`, `@tabler/icons-react` for `tabler`, etc. Never assume `lucide-react`.
|
|
160
|
+
- **`resolvedPaths`** → exact file-system destinations for components, utils, hooks, etc.
|
|
161
|
+
- **`framework`** → routing and file conventions (e.g. Next.js App Router vs Vite SPA).
|
|
162
|
+
- **`packageManager`** → use this for any non-shadcn dependency installs (e.g. `pnpm add date-fns` vs `npm install date-fns`).
|
|
163
|
+
- **`preset`** → resolved preset code and values for the current project. Use `npx shadcn@latest preset resolve --json` when you only need preset information.
|
|
164
|
+
|
|
165
|
+
See [cli.md — `info` command](./cli.md) for the full field reference.
|
|
166
|
+
|
|
167
|
+
## Component Docs, Examples, and Usage
|
|
168
|
+
|
|
169
|
+
Run `npx shadcn@latest docs <component>` to get the URLs for a component's documentation, examples, and API reference. Fetch these URLs to get the actual content.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
npx shadcn@latest docs button dialog select
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**When creating, fixing, debugging, or using a component, always run `npx shadcn@latest docs` and fetch the URLs first.** This ensures you're working with the correct API and usage patterns rather than guessing.
|
|
176
|
+
|
|
177
|
+
## Workflow
|
|
178
|
+
|
|
179
|
+
1. **Get project context** — already injected above. Run `npx shadcn@latest info` again if you need to refresh.
|
|
180
|
+
2. **Check installed components first** — before running `add`, always check the `components` list from project context or list the `resolvedPaths.ui` directory. Don't import components that haven't been added, and don't re-add ones already installed.
|
|
181
|
+
3. **Find components** — `npx shadcn@latest search`.
|
|
182
|
+
4. **Get docs and examples** — run `npx shadcn@latest docs <component>` to get URLs, then fetch them. Use `npx shadcn@latest view` to browse registry items you haven't installed. To preview changes to installed components, use `npx shadcn@latest add --diff`.
|
|
183
|
+
5. **Install or update** — `npx shadcn@latest add`. When updating existing components, use `--dry-run` and `--diff` to preview changes first (see [Updating Components](#updating-components) below).
|
|
184
|
+
6. **Fix imports in third-party components** — After adding components from community registries (e.g. `@bundui`, `@magicui`), check the added non-UI files for hardcoded import paths like `@/components/ui/...`. These won't match the project's actual aliases. Use `npx shadcn@latest info` to get the correct `ui` alias (e.g. `@workspace/ui/components`) and rewrite the imports accordingly. The CLI rewrites imports for its own UI files, but third-party registry components may use default paths that don't match the project.
|
|
185
|
+
7. **Review added components** — After adding a component or block from any registry, **always read the added files and verify they are correct**. Check for missing sub-components (e.g. `SelectItem` without `SelectGroup`), missing imports, incorrect composition, or violations of the [Critical Rules](#critical-rules). Also replace any icon imports with the project's `iconLibrary` from the project context (e.g. if the registry item uses `lucide-react` but the project uses `hugeicons`, swap the imports and icon names accordingly). Fix all issues before moving on.
|
|
186
|
+
8. **Registry must be explicit** — When the user asks to add a block or component, **do not guess the registry**. If no registry is specified (e.g. user says "add a login block" without specifying `@shadcn`, `@tailark`, `owner/repo`, etc.), ask which registry to use. Never default to a registry on behalf of the user.
|
|
187
|
+
9. **Switching presets** — Ask the user first: **overwrite**, **partial**, **merge**, or **skip**?
|
|
188
|
+
- **Inspect current preset**: `npx shadcn@latest preset resolve`. Use `--json` when you need structured values.
|
|
189
|
+
- **Inspect incoming preset**: `npx shadcn@latest preset decode <code>`. Use `preset url <code>` or `preset open <code>` to share or open the preset builder.
|
|
190
|
+
- **Overwrite**: `npx shadcn@latest apply <code>`. Overwrites detected components, fonts, and CSS variables.
|
|
191
|
+
- **Partial**: `npx shadcn@latest apply <code> --only theme,font`. Updates only the selected preset parts without reinstalling UI components. Supported values are `theme` and `font`; comma-separated combinations are allowed. `icon` is intentionally not supported, because icon changes may require full component reinstall and transforms.
|
|
192
|
+
- **Merge**: `npx shadcn@latest init --preset <code> --force --no-reinstall`, then run `npx shadcn@latest info` to list installed components, then for each installed component use `--dry-run` and `--diff` to [smart merge](#updating-components) it individually.
|
|
193
|
+
- **Skip**: `npx shadcn@latest init --preset <code> --force --no-reinstall`. Only updates config and CSS, leaves components as-is.
|
|
194
|
+
- **Important**: Always run preset commands inside the user's project directory. `apply` only works in an existing project with a `components.json` file. The CLI automatically preserves the current base (`base` vs `radix`) from `components.json`. If you must use a scratch/temp directory (e.g. for `--dry-run` comparisons), pass `--base <current-base>` explicitly — preset codes do not encode the base.
|
|
195
|
+
|
|
196
|
+
## Updating Components
|
|
197
|
+
|
|
198
|
+
When the user asks to update a component from upstream while keeping their local changes, use `--dry-run` and `--diff` to intelligently merge. **NEVER fetch raw files from GitHub manually — always use the CLI.**
|
|
199
|
+
|
|
200
|
+
1. Run `npx shadcn@latest add <component> --dry-run` to see all files that would be affected.
|
|
201
|
+
2. For each file, run `npx shadcn@latest add <component> --diff <file>` to see what changed upstream vs local.
|
|
202
|
+
3. Decide per file based on the diff:
|
|
203
|
+
- No local changes → safe to overwrite.
|
|
204
|
+
- Has local changes → read the local file, analyze the diff, and apply upstream updates while preserving local modifications.
|
|
205
|
+
- User says "just update everything" → use `--overwrite`, but confirm first.
|
|
206
|
+
4. **Never use `--overwrite` without the user's explicit approval.**
|
|
207
|
+
|
|
208
|
+
## Quick Reference
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Create a new project.
|
|
212
|
+
npx shadcn@latest init --name my-app --preset base-nova
|
|
213
|
+
npx shadcn@latest init --name my-app --preset a2r6bw --template vite
|
|
214
|
+
|
|
215
|
+
# Create a monorepo project.
|
|
216
|
+
npx shadcn@latest init --name my-app --preset base-nova --monorepo
|
|
217
|
+
npx shadcn@latest init --name my-app --preset base-nova --template next --monorepo
|
|
218
|
+
|
|
219
|
+
# Initialize existing project.
|
|
220
|
+
npx shadcn@latest init --preset base-nova
|
|
221
|
+
npx shadcn@latest init --defaults # shortcut: --template=next --preset=nova (base style implied)
|
|
222
|
+
|
|
223
|
+
# Apply a preset to an existing project.
|
|
224
|
+
npx shadcn@latest apply a2r6bw
|
|
225
|
+
npx shadcn@latest apply a2r6bw --only theme
|
|
226
|
+
npx shadcn@latest apply a2r6bw --only font
|
|
227
|
+
npx shadcn@latest apply a2r6bw --only theme,font
|
|
228
|
+
|
|
229
|
+
# Inspect preset codes and project preset state.
|
|
230
|
+
npx shadcn@latest preset decode a2r6bw
|
|
231
|
+
npx shadcn@latest preset url a2r6bw
|
|
232
|
+
npx shadcn@latest preset open a2r6bw
|
|
233
|
+
npx shadcn@latest preset resolve
|
|
234
|
+
npx shadcn@latest preset resolve --json
|
|
235
|
+
|
|
236
|
+
# Add components.
|
|
237
|
+
npx shadcn@latest add button card dialog
|
|
238
|
+
npx shadcn@latest add @magicui/shimmer-button
|
|
239
|
+
npx shadcn@latest add owner/repo/item
|
|
240
|
+
npx shadcn@latest add --all
|
|
241
|
+
|
|
242
|
+
# Preview changes before adding/updating.
|
|
243
|
+
npx shadcn@latest add button --dry-run
|
|
244
|
+
npx shadcn@latest add button --diff button.tsx
|
|
245
|
+
npx shadcn@latest add @acme/form --view button.tsx
|
|
246
|
+
npx shadcn@latest add owner/repo/item --dry-run
|
|
247
|
+
|
|
248
|
+
# Search registries.
|
|
249
|
+
npx shadcn@latest search @shadcn -q "sidebar"
|
|
250
|
+
npx shadcn@latest search @tailark -q "stats"
|
|
251
|
+
npx shadcn@latest search owner/repo -q "login"
|
|
252
|
+
npx shadcn@latest search # all configured registries
|
|
253
|
+
npx shadcn@latest search @shadcn -q "menu" -t ui # filter by item type
|
|
254
|
+
|
|
255
|
+
# Get component docs and example URLs.
|
|
256
|
+
npx shadcn@latest docs button dialog select
|
|
257
|
+
|
|
258
|
+
# View registry item details (for items not yet installed).
|
|
259
|
+
npx shadcn@latest view @shadcn/button
|
|
260
|
+
npx shadcn@latest view owner/repo/item
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Named presets:** `nova`, `vega`, `maia`, `lyra`, `mira`, `luma`
|
|
264
|
+
**Templates:** `next`, `vite`, `start`, `react-router`, `astro` (all support `--monorepo`) and `laravel` (not supported for monorepo)
|
|
265
|
+
**Preset codes:** Version-prefixed base62 strings (e.g. `a2r6bw` or `b0`), from [ui.shadcn.com](https://ui.shadcn.com).
|
|
266
|
+
|
|
267
|
+
## Detailed References
|
|
268
|
+
|
|
269
|
+
- [rules/forms.md](./rules/forms.md) — FieldGroup, Field, InputGroup, ToggleGroup, FieldSet, validation states
|
|
270
|
+
- [rules/composition.md](./rules/composition.md) — Groups, overlays, Card, Tabs, Avatar, Alert, Empty, Toast, Separator, Skeleton, Badge, Button loading
|
|
271
|
+
- [rules/chat.md](./rules/chat.md) — MessageScroller, Message, Bubble, Attachment, Marker; streaming, anchoring, jump-to-latest
|
|
272
|
+
- [rules/icons.md](./rules/icons.md) — data-icon, icon sizing, passing icons as objects
|
|
273
|
+
- [rules/styling.md](./rules/styling.md) — Semantic colors, variants, className, spacing, size, truncate, dark mode, cn(), z-index
|
|
274
|
+
- [rules/base-vs-radix.md](./rules/base-vs-radix.md) — asChild vs render, Select, ToggleGroup, Slider, Accordion
|
|
275
|
+
- [cli.md](./cli.md) — Commands, flags, presets, templates
|
|
276
|
+
- [registry.md](./registry.md) — Authoring source registries, `include`, item definitions, dependencies, GitHub registry rules
|
|
277
|
+
- [customization.md](./customization.md) — Theming, CSS variables, extending components
|
|
Binary file
|
|
Binary file
|