Add Stratakit MUI components (WIP)#204
Draft
alexdunae wants to merge 35 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Stratakit/MUI-based (“V2”) component surface for @itwin/imodel-browser-react, exposed via a new @itwin/imodel-browser-react/mui entrypoint to let consumers trial MUI components with minimal import churn.
Changes:
- Added MUI equivalents for key tiles/grids (iModel + iTwin), plus shared building blocks like
BaseCard,NoResultsMUI, and MUI context-menu utilities. - Added a new
src/mui/index.tsbarrel and updated Rollup/package exports to publish@itwin/imodel-browser-react/mui. - Updated Storybook + lint/build config and dependencies to support Stratakit/MUI icons/components.
Reviewed changes
Copilot reviewed 39 out of 45 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/imodel-browser/tsconfig.json | Adds Stratakit MUI typing config for the module build. |
| packages/modules/imodel-browser/src/utils/_buildMenuOptions.tsx | Adds MUI context menu item type + builder function. |
| packages/modules/imodel-browser/src/mui/index.ts | New MUI barrel exporting MUI components under legacy-aligned names. |
| packages/modules/imodel-browser/src/containers/ITwinGrid/StatusIcon.tsx | New status icon helper for ITwinTileMUI. |
| packages/modules/imodel-browser/src/containers/ITwinGrid/ITwinTileMUI.tsx | New MUI ITwin tile implementation using BaseCard. |
| packages/modules/imodel-browser/src/containers/ITwinGrid/ITwinGridMUI.tsx | New MUI ITwin grid implementation (tile + table modes). |
| packages/modules/imodel-browser/src/containers/iModelTiles/StatusIcon.tsx | New status icon helper for IModelTileMUI. |
| packages/modules/imodel-browser/src/containers/iModelTiles/IModelTileMUI.tsx | New MUI iModel tile implementation using BaseCard. |
| packages/modules/imodel-browser/src/containers/iModelThumbnail/IModelThumbnailMUI.tsx | New MUI thumbnail component using CardMedia/Skeleton + intersection observer. |
| packages/modules/imodel-browser/src/containers/iModelGrid/useIModelTableConfigMUI.tsx | New table config hook for MUI iModel grid table mode. |
| packages/modules/imodel-browser/src/containers/iModelGrid/IModelGridMUI.tsx | New MUI iModel grid implementation (tile + table modes). |
| packages/modules/imodel-browser/src/containers/iModelGrid/IModelGrid.helpers.tsx | Adds/updates helper module for legacy grid behavior and shared logic. |
| packages/modules/imodel-browser/src/components/tileFavoriteIcon/TileFavoriteIconMUI.tsx | New MUI favorite icon button using Stratakit icon. |
| packages/modules/imodel-browser/src/components/tileFavoriteIcon/TileFavoriteIcon.module.scss | Adds Stratakit color styling for MUI favorite icon states. |
| packages/modules/imodel-browser/src/components/noResults/NoResultsMUI.tsx | New MUI “no results” component. |
| packages/modules/imodel-browser/src/components/noResults/NoResultsMUI.module.scss | Styling for MUI no-results icon sizing. |
| packages/modules/imodel-browser/src/components/MoreMenu.tsx | New MUI-based “more” menu helper component. |
| packages/modules/imodel-browser/src/components/baseCard/BaseCardLoading.tsx | New MUI skeleton loading card. |
| packages/modules/imodel-browser/src/components/baseCard/BaseCard.tsx | New BaseCard building block (thumbnail overlays, actions, context menu). |
| packages/modules/imodel-browser/src/components/baseCard/BaseCard.module.scss | Styling for BaseCard layout/overlays/hover actions. |
| packages/modules/imodel-browser/rollup.config.js | Adds a second Rollup entry for the /mui barrel and asset handling. |
| packages/modules/imodel-browser/package.json | Adds /mui export entry and MUI/Stratakit deps. |
| packages/modules/imodel-browser/MUI-MIGRATION.md | Adds migration notes and prop mapping guidance for MUI surface. |
| packages/apps/storybook/tsconfig.json | Adds Storybook TS config for Stratakit/MUI and local /mui path mapping. |
| packages/apps/storybook/tsconfig.eslint.json | Mirrors Storybook ESLint TS program configuration for /mui path mapping. |
| packages/apps/storybook/src/utils/README.md | Notes licensing for placeholder images. |
| packages/apps/storybook/src/imodel-browser/NoResultsMUI.stories.tsx | Adds Storybook stories for NoResultsMUI. |
| packages/apps/storybook/src/imodel-browser/ITwinTileMUI.stories.tsx | Adds Storybook stories for ITwinTileMUI. |
| packages/apps/storybook/src/imodel-browser/ITwinGridMUI.stories.tsx | Adds Storybook stories for ITwinGridMUI. |
| packages/apps/storybook/src/imodel-browser/IModelTileMUI.stories.tsx | Adds Storybook stories for IModelTileMUI. |
| packages/apps/storybook/src/imodel-browser/IModelGridMUI.stories.tsx | Adds Storybook stories for IModelGridMUI. |
| packages/apps/storybook/src/imodel-browser/IModelGridMUI.helpers.tsx | Adds story helpers for external-data and stateful overrides. |
| packages/apps/storybook/src/imodel-browser/BaseCard.stories.tsx | Adds Storybook stories for BaseCard building block. |
| packages/apps/storybook/src/images.d.ts | Adds TS module declarations for jpg/jpeg used by stories. |
| packages/apps/storybook/package.json | Adds Stratakit/MUI deps for Storybook app. |
| packages/apps/storybook/.storybook/preview.js | Wraps Storybook with Stratakit Root via itwinui ThemeProvider bridging. |
| packages/apps/storybook/.storybook/main.js | Adjusts webpack config for svg assets, symlinks, and TS/SCSS handling. |
| common/scripts/.eslintrc.ts.base.json | Adds restricted-import rules for @mui/material and @mui/system root paths. |
| common/config/rush/pnpm-lock.yaml | Updates lockfile for new MUI/Stratakit dependencies. |
| .vscode/settings.json | Adds editor auto-import exclusion and TS SDK workspace settings. |
Files not reviewed (1)
- common/config/rush/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
3
to
+6
| "compilerOptions": { | ||
| "rootDir": "./src", | ||
| "outDir": "./esm" | ||
| "outDir": "./esm", | ||
| "types": ["@stratakit/mui"] |
Comment on lines
+125
to
+135
| const { columns, onRowClick } = useITwinTableConfig({ | ||
| iTwinActions, | ||
| onThumbnailClick: onSelect, | ||
| strings, | ||
| iTwinFavorites, | ||
| addITwinToFavorites, | ||
| removeITwinFromFavorites, | ||
| refetchITwins, | ||
| cellOverrides, | ||
| } as any); // TODO: types | ||
|
|
Comment on lines
+3
to
+10
| "compilerOptions": { | ||
| "strictNullChecks": true, | ||
| "types": ["@stratakit/mui"], | ||
| "paths": { | ||
| "@itwin/imodel-browser-react/mui": [ | ||
| "../../modules/imodel-browser/src/mui/index.ts" | ||
| ] | ||
| } |
Comment on lines
2
to
+9
| "compilerOptions": { | ||
| "strictNullChecks": true | ||
| "strictNullChecks": true, | ||
| "types": ["@stratakit/mui"], | ||
| "paths": { | ||
| "@itwin/imodel-browser-react/mui": [ | ||
| "../../modules/imodel-browser/src/mui/index.ts" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note this branch is based on #202
Posted here for previewing and early review. I can split out some other smaller PRs later.
I tried to strike a balance between keeping the existing API surface while also using MUI idioms.
All these components are exposed via
imodel-browser-react/muiwith aliases, so consumers can try them by swapping their import path (and then updating any necessary types).TODO
iTwinActionsandiModelActionstocontextMenuItemsisNewandfullWidth?more-horizontalicon when available