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

feat: add Checkbox to Docs [MDS-719] #2441

Merged
merged 1 commit into from
Oct 19, 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: 0 additions & 1 deletion docs/app/components/server/avatar/description.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/app/components/server/avatar/examples/Active.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions docs/app/components/server/avatar/examples/Default.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions docs/app/components/server/avatar/page.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions docs/app/components/server/checkbox/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The checkbox is shown as a square box that is ticked (checked) when activated.

Checkboxes are used to let a user select one or more options of a limited number of choices.
5 changes: 5 additions & 0 deletions docs/app/components/server/checkbox/examples/Default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Checkbox from '@heathmont/moon-base-tw/lib/checkbox/Checkbox';

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

export default Default;
22 changes: 22 additions & 0 deletions docs/app/components/server/checkbox/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Default } from '@/app/components/server/checkbox/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.checkbox.examples);
return (
<div className="w-full max-w-7xl flex flex-col gap-4 text-moon-14">
<h1 className="font-medium text-moon-32">Checkbox</h1>
<MDX markdown={server.checkbox.description} />
<QuickNav items={examplesList} />
<ExampleSection
title="Default"
component={<Default />}
code={server.checkbox.examples.Default}
/>
</div>
);
}
3 changes: 1 addition & 2 deletions docs/app/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ export interface Examples {
Multiline: 'string';
};
};
avatar: {
checkbox: {
description: 'string';
examples: {
Active: 'string';
Default: 'string';
};
};
Expand Down
2 changes: 1 addition & 1 deletion workspaces/base/src/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, useEffect, useState } from 'react';
import React, { forwardRef } from 'react';
import type CheckboxProps from './private/types/CheckboxProps';
import mergeClassnames from '../mergeClassnames/mergeClassnames';
import ControlsMinus from '../private/icons/ControlsMinus';
Expand Down
Loading