-
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.
Merge pull request #338 from aversini/feat-typography
feat: adding typography classes prose-light and prose-dark
- Loading branch information
Showing
22 changed files
with
679 additions
and
374 deletions.
There are no files selected for viewing
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,7 @@ | ||
{ | ||
"watch": [ | ||
".ladle/*.*", | ||
"src/**/*.*", | ||
"../ui-components/src/**/*.*", | ||
"../ui-components/lib/**/*.*"] | ||
} |
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
82 changes: 82 additions & 0 deletions
82
packages/documentation/src/GettingStarted/1-overview.stories.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,82 @@ | ||
import { linkTo, Story } from "@ladle/react"; | ||
import { | ||
ButtonIcon, | ||
Flexgrid, | ||
FlexgridItem, | ||
IconNext, | ||
} from "@versini/ui-components"; | ||
|
||
export default { | ||
title: "Getting started", | ||
}; | ||
|
||
export const Overview: Story<any> = () => ( | ||
<div className="prose prose-light max-w-none"> | ||
<h1 className="mb-0">UI Components</h1> | ||
|
||
<Flexgrid alignVertical="center"> | ||
<FlexgridItem span={{ fallback: 12, lg: 6 }}> | ||
<blockquote> | ||
<p> | ||
UI Components provides a strong, responsive, and accessible library | ||
of foundational React components. | ||
</p> | ||
</blockquote> | ||
|
||
<ButtonIcon | ||
spacing={{ t: 8 }} | ||
labelLeft="Installation" | ||
noBorder | ||
onClick={linkTo("getting-started--installation")} | ||
> | ||
<IconNext decorative monotone /> | ||
</ButtonIcon> | ||
</FlexgridItem> | ||
<FlexgridItem span={{ fallback: 12, lg: 6 }}> | ||
<img | ||
className="mt-5" | ||
src="hero-14.jpg" | ||
alt="An illustration of web page rendered on both desktop and mobile devices." | ||
title="Hero image of a web page rendered on both desktop and mobile devices." | ||
/> | ||
</FlexgridItem> | ||
</Flexgrid> | ||
|
||
<h2>Features</h2> | ||
|
||
<ul> | ||
<li> | ||
<strong>Strong</strong>: built-in strong components typing via | ||
TypeScript. | ||
</li> | ||
<li> | ||
<strong>Responsive</strong>: built-in responsive components. | ||
</li> | ||
<li> | ||
<strong>Accessible</strong>: built with accessibility in mind from the | ||
start. | ||
</li> | ||
</ul> | ||
|
||
<h2>Extra</h2> | ||
|
||
<ul> | ||
<li> | ||
<strong>TailwindCSS</strong>: built with TailwindCSS, enabling styles | ||
tree-shaking. | ||
</li> | ||
<li> | ||
<strong>Hooks</strong>: provides a set of hooks to use in your | ||
application. | ||
</li> | ||
<li> | ||
<strong>Icons</strong>: provides a set of icons to use in your | ||
application. | ||
</li> | ||
<li> | ||
<strong>Theming</strong>: provides a theming system to customize the | ||
look of the components. | ||
</li> | ||
</ul> | ||
</div> | ||
); |
50 changes: 50 additions & 0 deletions
50
packages/documentation/src/GettingStarted/2-Installation.stories.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,50 @@ | ||
import { linkTo, Story } from "@ladle/react"; | ||
import { | ||
ButtonIcon, | ||
Flexgrid, | ||
FlexgridItem, | ||
IconNext, | ||
IconPrevious, | ||
} from "@versini/ui-components"; | ||
|
||
export default { | ||
title: "Getting Started", | ||
}; | ||
|
||
export const Installation: Story<any> = () => ( | ||
<div className="prose prose-light max-w-none"> | ||
<h1>Installation</h1> | ||
<p> | ||
The <strong>UI-Components</strong> library is available as a npm package. | ||
</p> | ||
<pre> | ||
<code>$ npm install --save @versini/ui-components</code> | ||
</pre> | ||
<p> | ||
You also need to install React and React-DOM (at least 18.0.0 or above). | ||
</p> | ||
<pre> | ||
<code>$ npm install --save react react-dom</code> | ||
</pre> | ||
<Flexgrid alignHorizontal="space-between"> | ||
<FlexgridItem> | ||
<ButtonIcon | ||
labelRight="Overview" | ||
noBorder | ||
onClick={linkTo("getting-started--overview")} | ||
> | ||
<IconPrevious decorative monotone /> | ||
</ButtonIcon> | ||
</FlexgridItem> | ||
<FlexgridItem> | ||
<ButtonIcon | ||
labelLeft="Configuration" | ||
noBorder | ||
onClick={linkTo("getting-started--configuration")} | ||
> | ||
<IconNext decorative monotone /> | ||
</ButtonIcon> | ||
</FlexgridItem> | ||
</Flexgrid> | ||
</div> | ||
); |
108 changes: 108 additions & 0 deletions
108
packages/documentation/src/GettingStarted/3-configuration.stories.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,108 @@ | ||
import { linkTo, Story } from "@ladle/react"; | ||
import { | ||
ButtonIcon, | ||
Flexgrid, | ||
FlexgridItem, | ||
IconNext, | ||
IconPrevious, | ||
} from "@versini/ui-components"; | ||
|
||
export default { | ||
title: "Getting Started", | ||
}; | ||
|
||
export const Configuration: Story<any> = () => ( | ||
<div className="prose prose-light max-w-none"> | ||
<h1>Configuration</h1> | ||
|
||
<h2>JavaScript</h2> | ||
|
||
<ul> | ||
<li> | ||
<p> | ||
UI Components come un-bundled, which means you need to use a bundler | ||
such as Webpack, Vite or Rollup to bundle components into your | ||
application. | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
UI Components are tree-shakeable, side-effect free and each component | ||
style is self-contained. | ||
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Please refer to each component API documentation (under the Components | ||
or Form components menu) to see how they should be imported, what | ||
their individual props are as well as many different examples. | ||
</p> | ||
</li> | ||
</ul> | ||
|
||
<h2>CSS</h2> | ||
|
||
<p> | ||
You can use the <strong>UI-Components</strong> library with or without{" "} | ||
<strong>TailwindCSS</strong>. Depending on your situation, you can either | ||
use the pre-built CSS or the TailwindCSS plugin to build your own styles | ||
and take advantage of tree-shaking unused styles. | ||
</p> | ||
|
||
<h2>Without TailwindCSS</h2> | ||
|
||
<p> | ||
If you are not using TailwindCSS, you can use the pre-built CSS file. Just | ||
import it in your entry file: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{`// index.js | ||
import "@versini/ui-components/dist/style.css";`} | ||
</code> | ||
</pre> | ||
|
||
<h2>With TailwindCSS</h2> | ||
|
||
<p> | ||
If you are using TailwindCSS, you can use the{" "} | ||
<strong>UI-Components</strong> library TailwindCSS plugin: | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{`// tailwind.config.js | ||
/** @type {import('tailwindcss').Config} */ | ||
import { twPlugin } from "@versini/ui-components/dist/utilities"; | ||
export default twPlugin.merge({ | ||
// this is an example, you can change the path to your files | ||
content: ["./src/**/*.{js,ts,jsx,tsx}"], | ||
});`} | ||
</code> | ||
</pre> | ||
|
||
<Flexgrid alignHorizontal="space-between"> | ||
<FlexgridItem> | ||
<ButtonIcon | ||
labelRight="Installation" | ||
noBorder | ||
onClick={linkTo("getting-started--installation")} | ||
> | ||
<IconPrevious decorative monotone /> | ||
</ButtonIcon> | ||
</FlexgridItem> | ||
<FlexgridItem> | ||
<ButtonIcon | ||
labelLeft="Usage" | ||
noBorder | ||
onClick={linkTo("getting-started--usage")} | ||
> | ||
<IconNext decorative monotone /> | ||
</ButtonIcon> | ||
</FlexgridItem> | ||
</Flexgrid> | ||
</div> | ||
); |
Oops, something went wrong.