Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pigment-css][material-ui] Render badge demos #41353

Merged
merged 1 commit into from
Mar 5, 2024
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
72 changes: 72 additions & 0 deletions apps/pigment-next-app/src/app/material-ui/react-badge/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use client';
import * as React from 'react';
import AccessibleBadges from '../../../../../../docs/data/material/components/badges/AccessibleBadges';
import BadgeMax from '../../../../../../docs/data/material/components/badges/BadgeMax';
import BadgeOverlap from '../../../../../../docs/data/material/components/badges/BadgeOverlap';
import BadgeVisibility from '../../../../../../docs/data/material/components/badges/BadgeVisibility';
import ColorBadge from '../../../../../../docs/data/material/components/badges/ColorBadge';
import CustomizedBadges from '../../../../../../docs/data/material/components/badges/CustomizedBadges';
import DotBadge from '../../../../../../docs/data/material/components/badges/DotBadge';
import ShowZeroBadge from '../../../../../../docs/data/material/components/badges/ShowZeroBadge';
import SimpleBadge from '../../../../../../docs/data/material/components/badges/SimpleBadge';

export default function Badges() {
return (
<React.Fragment>
<section>
<h2> Accessible Badges</h2>
<div className="demo-container">
<AccessibleBadges />
</div>
</section>
<section>
<h2> Badge Max</h2>
<div className="demo-container">
<BadgeMax />
</div>
</section>
<section>
<h2> Badge Overlap</h2>
<div className="demo-container">
<BadgeOverlap />
</div>
</section>
<section>
<h2> Badge Visibility</h2>
<div className="demo-container">
<BadgeVisibility />
</div>
</section>
<section>
<h2> Color Badge</h2>
<div className="demo-container">
<ColorBadge />
</div>
</section>
<section>
<h2> Customized Badges</h2>
<div className="demo-container">
<CustomizedBadges />
</div>
</section>
<section>
<h2> Dot Badge</h2>
<div className="demo-container">
<DotBadge />
</div>
</section>
<section>
<h2> Show Zero Badge</h2>
<div className="demo-container">
<ShowZeroBadge />
</div>
</section>
<section>
<h2> Simple Badge</h2>
<div className="demo-container">
<SimpleBadge />
</div>
</section>
</React.Fragment>
);
}
73 changes: 73 additions & 0 deletions apps/pigment-vite-app/src/pages/material-ui/react-badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import * as React from 'react';
import MaterialUILayout from '../../Layout';
import AccessibleBadges from '../../../../../docs/data/material/components/badges/AccessibleBadges.tsx';
import BadgeMax from '../../../../../docs/data/material/components/badges/BadgeMax.tsx';
import BadgeOverlap from '../../../../../docs/data/material/components/badges/BadgeOverlap.tsx';
import BadgeVisibility from '../../../../../docs/data/material/components/badges/BadgeVisibility.tsx';
import ColorBadge from '../../../../../docs/data/material/components/badges/ColorBadge.tsx';
import CustomizedBadges from '../../../../../docs/data/material/components/badges/CustomizedBadges.tsx';
import DotBadge from '../../../../../docs/data/material/components/badges/DotBadge.tsx';
import ShowZeroBadge from '../../../../../docs/data/material/components/badges/ShowZeroBadge.tsx';
import SimpleBadge from '../../../../../docs/data/material/components/badges/SimpleBadge.tsx';

export default function Badges() {
return (
<MaterialUILayout>
<h1>Badges</h1>
<section>
<h2> Accessible Badges</h2>
<div className="demo-container">
<AccessibleBadges />
</div>
</section>
<section>
<h2> Badge Max</h2>
<div className="demo-container">
<BadgeMax />
</div>
</section>
<section>
<h2> Badge Overlap</h2>
<div className="demo-container">
<BadgeOverlap />
</div>
</section>
<section>
<h2> Badge Visibility</h2>
<div className="demo-container">
<BadgeVisibility />
</div>
</section>
<section>
<h2> Color Badge</h2>
<div className="demo-container">
<ColorBadge />
</div>
</section>
<section>
<h2> Customized Badges</h2>
<div className="demo-container">
<CustomizedBadges />
</div>
</section>
<section>
<h2> Dot Badge</h2>
<div className="demo-container">
<DotBadge />
</div>
</section>
<section>
<h2> Show Zero Badge</h2>
<div className="demo-container">
<ShowZeroBadge />
</div>
</section>
<section>
<h2> Simple Badge</h2>
<div className="demo-container">
<SimpleBadge />
</div>
</section>
</MaterialUILayout>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ ${renders.join('\n')}
}
`;

// Create the page in zero-runtime apps
// Create the page in pigment apps
const nextFilepath = path.join(
process.cwd(),
`apps/zero-runtime-next-app/src/app/material-ui/${args[0]}/page.tsx`,
`apps/pigment-next-app/src/app/material-ui/${args[0]}/page.tsx`,
);
const prettiedNextFileContent = await prettier.format(nextFileContent, {
...prettierConfig,
filepath: nextFilepath,
});
await fse.mkdirp(`apps/zero-runtime-next-app/src/app/material-ui/${args[0]}`);
await fse.mkdirp(`apps/pigment-next-app/src/app/material-ui/${args[0]}`);
await fse.writeFile(nextFilepath, prettiedNextFileContent);

/**
Expand All @@ -102,16 +102,16 @@ ${renders.join('\n')}
);
}
`;
// Create the page in zero-runtime apps
// Create the page in pigment apps
const viteFilepath = path.join(
process.cwd(),
`apps/zero-runtime-vite-app/src/pages/material-ui/${args[0]}.tsx`,
`apps/pigment-vite-app/src/pages/material-ui/${args[0]}.tsx`,
);
const prettiedViteFileContent = await prettier.format(viteFileContent, {
...prettierConfig,
filepath: viteFilepath,
});
await fse.mkdirp(`apps/zero-runtime-vite-app/src/pages/material-ui`);
await fse.mkdirp(`apps/pigment-vite-app/src/pages/material-ui`);
await fse.writeFile(viteFilepath, prettiedViteFileContent);
}

Expand Down
Loading