From 10ca1390d871fda5e516bba569075dde4198f03e Mon Sep 17 00:00:00 2001 From: dkireev Date: Mon, 30 Oct 2023 16:55:59 +0200 Subject: [PATCH] fix: add Chip to Docs, align colours [MDS-720] --- .../app/components/server/chip/description.md | 1 + .../server/chip/examples/Default.tsx | 5 +++++ docs/app/components/server/chip/page.tsx | 22 +++++++++++++++++++ docs/app/components/types.ts | 6 +++++ workspaces/base/src/chip/Chip.tsx | 2 +- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/app/components/server/chip/description.md create mode 100644 docs/app/components/server/chip/examples/Default.tsx create mode 100644 docs/app/components/server/chip/page.tsx diff --git a/docs/app/components/server/chip/description.md b/docs/app/components/server/chip/description.md new file mode 100644 index 0000000000..b32ed9702a --- /dev/null +++ b/docs/app/components/server/chip/description.md @@ -0,0 +1 @@ +Chips help filter content, or trigger actions. diff --git a/docs/app/components/server/chip/examples/Default.tsx b/docs/app/components/server/chip/examples/Default.tsx new file mode 100644 index 0000000000..b8d1799d43 --- /dev/null +++ b/docs/app/components/server/chip/examples/Default.tsx @@ -0,0 +1,5 @@ +import Chip from '@heathmont/moon-base-tw/lib/chip/Chip'; + +export const Default = () => Default; + +export default Default; diff --git a/docs/app/components/server/chip/page.tsx b/docs/app/components/server/chip/page.tsx new file mode 100644 index 0000000000..b2c3c9110f --- /dev/null +++ b/docs/app/components/server/chip/page.tsx @@ -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 ( +
+

Chip

+ + + } + code={server.chip.examples.Default} + /> +
+ ); +} diff --git a/docs/app/components/types.ts b/docs/app/components/types.ts index d3a9f5e9ea..615fc75458 100644 --- a/docs/app/components/types.ts +++ b/docs/app/components/types.ts @@ -42,6 +42,12 @@ export interface Examples { Default: 'string'; }; }; + chip: { + description: 'string'; + examples: { + Default: 'string'; + }; + }; tag: { description: 'string'; examples: { diff --git a/workspaces/base/src/chip/Chip.tsx b/workspaces/base/src/chip/Chip.tsx index 3817ef005c..a22aaabbdb 100644 --- a/workspaces/base/src/chip/Chip.tsx +++ b/workspaces/base/src/chip/Chip.tsx @@ -29,7 +29,7 @@ const Chip = forwardRef( 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',