-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10ece49
commit 5df1f35
Showing
14 changed files
with
272 additions
and
151 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { MainLayout } from "@/components/MainLayout/MainLayout"; | ||
import { SliceFeatures } from "@/components/SliceFeatures"; | ||
import { SliceHero } from "@/components/SliceHero"; | ||
import { SliceInstallation } from "@/components/SliceInstallation"; | ||
import { SliceTypeScale } from "@/components/SliceTypeScale"; | ||
import { SliceUsage } from "@/components/SliceUsage"; | ||
|
||
export default function Home() { | ||
return ( | ||
<MainLayout> | ||
<SliceHero /> | ||
<SliceTypeScale /> | ||
<SliceFeatures /> | ||
<SliceInstallation /> | ||
<SliceUsage /> | ||
</MainLayout> | ||
); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type PanelProps = { | ||
title: string; | ||
content: string; | ||
}; |
87 changes: 87 additions & 0 deletions
87
example/src/components/SliceInstallation/SliceInstallation.content.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { PanelProps } from "../PanelCode/PanelCode.types"; | ||
|
||
export const sliceInstallTerminal: PanelProps[] = [ | ||
{ | ||
title: "terminal", | ||
content: ` | ||
npx jsr add @buen/type | ||
// or | ||
deno add @buen/type | ||
// or | ||
yarn dlx jsr add @buen/type | ||
// or | ||
pnpm dlx jsr add @buen/type | ||
`, | ||
}, | ||
]; | ||
|
||
export const sliceInstallConfig: PanelProps[] = [ | ||
{ | ||
title: "tailwind.config.ts", | ||
content: ` | ||
import { buenTypeTailwind } from "@buen/type"; | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
// ... | ||
plugins: [ | ||
buenTypeTailwind | ||
] | ||
}; | ||
`, | ||
}, | ||
]; | ||
|
||
export const sliceInstallCustom: PanelProps[] = [ | ||
{ | ||
title: "type-config.ts", | ||
content: ` | ||
const customHeadlines = { | ||
'display-xl': { | ||
classAlias: 'primary-headline', | ||
fontFamily: "'Inter', 'sans-serif'", | ||
fontWeight: 'bold', | ||
clamp: [4.5, 9], | ||
letterSpacing: '-0.1em', | ||
lineHeight: 1, | ||
textTransform: 'uppercase', | ||
}, | ||
// other headline styles | ||
} | ||
const customTexts = { | ||
'body': { | ||
classAlias: 'article-body', | ||
fontFamily: "'Inter', 'sans-serif'", | ||
fontWeight: 'normal', | ||
fontSize: '1.1rem' | ||
letterSpacing: '0em', | ||
lineHeight: 1.5, | ||
textTransform: 'none', | ||
}, | ||
// other text styles | ||
} | ||
`, | ||
}, | ||
{ | ||
title: "tailwind.config.js", | ||
content: ` | ||
import { buenTypeTailwind } from "@buen/type"; | ||
import { customHeadlines, customTexts } from "./type-config"; | ||
function typePlugin({ addUtilities }) { | ||
buenTypeTailwind({ addUtilities }, { | ||
customHeadlines, | ||
customTexts | ||
}); | ||
}; | ||
module.exports = { | ||
// ... | ||
plugins: [ | ||
typePlugin | ||
] | ||
}; | ||
`, | ||
}, | ||
]; |
39 changes: 39 additions & 0 deletions
39
example/src/components/SliceInstallation/SliceInstallation.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { PanelCode } from "../PanelCode"; | ||
import { SliceWrapper } from "../SliceWrapper"; | ||
import { | ||
sliceInstallConfig, | ||
sliceInstallCustom, | ||
sliceInstallTerminal, | ||
} from "./SliceInstallation.content"; | ||
|
||
export function SliceInstallation() { | ||
return ( | ||
<SliceWrapper title="INSTALLATION" innerClassName="gap-y-12 py-4"> | ||
<div className="grid grid-cols-subgrid col-span-full"> | ||
<div className="col-span-2 xl:col-span-2 max-w-[20rem]"> | ||
<p> | ||
Install the jsr package with your package manager of choice. Then | ||
import the plugin in your Tailwind CSS configuration file. | ||
</p> | ||
</div> | ||
<div className="xl:col-start-5 md:col-start-4 col-span-4 xl:col-span-3 md:col-span-4 grid grid-cols-subgrid gap-y-8"> | ||
<PanelCode panelContent={sliceInstallTerminal} /> | ||
<PanelCode panelContent={sliceInstallConfig} /> | ||
</div> | ||
</div> | ||
<div className="grid grid-cols-subgrid col-span-full"> | ||
<div className="col-span-2 xl:col-span-2 max-w-[20rem]"> | ||
<p> | ||
Customize the plugin with your own type definitions for{" "} | ||
<code>customHeadlines</code> and | ||
<code>customTexts</code> styles. You can also create{" "} | ||
<code>classAlias</code>es for custom class names. | ||
</p> | ||
</div> | ||
<div className="xl:col-start-5 md:col-start-4 col-span-4 xl:col-span-3 md:col-span-4 grid grid-cols-subgrid gap-y-8"> | ||
<PanelCode panelContent={sliceInstallCustom} /> | ||
</div> | ||
</div> | ||
</SliceWrapper> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { SliceInstallation } from "./SliceInstallation"; | ||
|
||
export { SliceInstallation }; |
5 changes: 3 additions & 2 deletions
5
...components/PanelCode/PanelCode.content.ts → .../SliceTypeScale/SliceTypeScale.content.ts
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { PanelProps } from "../PanelCode/PanelCode.types"; | ||
|
||
export const sliceUsageComponent: PanelProps[] = [ | ||
{ | ||
title: "SomeComponent.tsx", | ||
content: ` | ||
export const SomeComponent = () => ( | ||
<div> | ||
<h1 className="headline-display-xl">Hello World</h1> | ||
<p className="text-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> | ||
</div> | ||
); | ||
`, | ||
}, | ||
]; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { PanelCode } from "../PanelCode"; | ||
import { SliceWrapper } from "../SliceWrapper"; | ||
import { sliceUsageComponent } from "./SliceUsage.content"; | ||
|
||
export function SliceUsage() { | ||
return ( | ||
<SliceWrapper title="USAGE" innerClassName="gap-y-6 py-4"> | ||
<div className="grid grid-cols-subgrid col-span-full"> | ||
<div className="col-span-2 xl:col-span-2 max-w-[20rem]"> | ||
<p>Use the custom classes in your components to style your text.</p> | ||
</div> | ||
<div className="xl:col-start-5 md:col-start-4 col-span-4 xl:col-span-3 md:col-span-4 grid grid-cols-subgrid gap-y-8"> | ||
<PanelCode panelContent={sliceUsageComponent} /> | ||
</div> | ||
</div> | ||
</SliceWrapper> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { SliceUsage } from "./SliceUsage"; | ||
|
||
export { SliceUsage }; |
This file contains 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