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

fix: add Chip to Docs, align colours [MDS-720] #2453

Merged
merged 1 commit into from
Oct 30, 2023
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
1 change: 1 addition & 0 deletions docs/app/components/server/chip/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Chips help filter content, or trigger actions.
5 changes: 5 additions & 0 deletions docs/app/components/server/chip/examples/Default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Chip from '@heathmont/moon-base-tw/lib/chip/Chip';

export const Default = () => <Chip>Default</Chip>;

export default Default;
22 changes: 22 additions & 0 deletions docs/app/components/server/chip/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Default } from '@/app/components/server/chip/examples/Default';
import ExampleSection from '@/app/components/shared/ExampleSection';
import QuickNav from '@/app/components/shared/QuickNav';
import { getExamples } from '@/app/utils/getExamples';
import { MDX } from '@/components/MDX';

export default async function Home() {
const { server } = await getExamples();
const examplesList = Object.keys(server.chip.examples);
return (
<div className="w-full max-w-7xl flex flex-col gap-4 text-moon-14">
<h1 className="font-medium text-moon-32">Chip</h1>
<MDX markdown={server.chip.description} />
<QuickNav items={examplesList} />
<ExampleSection
title="Default"
component={<Default />}
code={server.chip.examples.Default}
/>
</div>
);
}
6 changes: 6 additions & 0 deletions docs/app/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export interface Examples {
Default: 'string';
};
};
chip: {
description: 'string';
examples: {
Default: 'string';
};
};
tag: {
description: 'string';
examples: {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/base/src/chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Chip = forwardRef<HTMLButtonElement, ChipProps>(
iconOnly ? 'center' : 'space-between',
size === 'sm' ? 'h-8 gap-1' : 'h-10 gap-2',
setPadding({ size, iconLeft, iconRight, iconOnly }),
variant === 'ghost' ? '' : 'bg-gohan',
variant === 'ghost' ? '' : 'bg-goku',
isActive ? 'bg-jiren text-piccolo' : 'text-bulma',
isStroke && 'hover:shadow-interactive',
isActive && isStroke && 'shadow-interactive',
Expand Down
Loading