Skip to content

Commit 9ddfc4c

Browse files
authored
Improve storybook UI and getting started guide (#58)
1 parent 03ed92e commit 9ddfc4c

File tree

7 files changed

+179
-43
lines changed

7 files changed

+179
-43
lines changed

.storybook/manager-head.html

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
4+
15
<style>
6+
7+
body, html, div, span, p, h1, h2, h3, h4, h5, h6,
8+
button, input, textarea, select, label {
9+
font-family: "Inter", sans-serif ;
10+
font-optical-sizing: auto;
11+
}
12+
213
/* Title */
314
.sidebar-header div a {
415
font-size: 20px !important;
516
font-weight: 600;
617
}
718

819
#fur-title {
9-
font-size: 25px;
20+
font-size: 22px;
21+
font-weight: 700;
22+
color: #000000;
23+
letter-spacing: -0.02em;
24+
line-height: 1.2;
1025
}
1126

1227
#fur-version {
@@ -15,4 +30,43 @@
1530
display: block;
1631
color: grey;
1732
}
33+
34+
#root .sidebar-container {
35+
background-color: rgb(243, 243, 243);
36+
}
37+
38+
#root > div > div {
39+
border-right: 1px solid rgba(226, 226, 226, 0.3);
40+
}
41+
42+
#storybook-explorer-tree .sidebar-item > button > div > svg {
43+
visibility: hidden;
44+
}
45+
46+
#storybook-explorer-tree .sidebar-item > button > div::before {
47+
content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='currentColor' d='m28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864M16 3.158L26.016 9L16 14.842L5.984 9ZM5 10.74l10 5.833V28.26L5 22.426Zm12 17.52V16.574l10-5.833v11.685Z'/></svg>");
48+
color: #999999;
49+
display: inline-block;
50+
width: 14px;
51+
height: 14px;
52+
vertical-align: middle;
53+
transform: translate(34px, 0px);
54+
opacity: 0.5;
55+
}
56+
57+
#storybook-explorer-tree .sidebar-item[data-selected="true"]{
58+
font-weight: normal;
59+
}
60+
61+
#storybook-explorer-tree .sidebar-item[data-selected="true"]:hover {
62+
background-color: rgb(124, 124, 124);
63+
}
64+
65+
#storybook-explorer-tree .sidebar-subheading > button {
66+
text-transform: none;
67+
font-weight: normal;
68+
letter-spacing: normal;
69+
font-size: 14px;
70+
}
71+
1872
</style>

.storybook/manager.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ addons.setConfig({
55
theme: create({
66
base: "light",
77
brandTitle:
8-
'<span id="fur-title">frappe-ui-react</span> <span id="fur-version">(v1.0.0-beta.0)</span>', // update version as per package.json
8+
'<h1 id="fur-title">frappe-ui-react</h1> <span id="fur-version">(v1.0.0-beta.0)</span>', // update version as per package.json
99
brandUrl: undefined, // disables link on the title
1010
brandImage: undefined,
11+
12+
// Sidebar/Toolbar active state color
13+
barSelectedColor: 'rgb(153, 153, 153)',
14+
15+
// Primary accent color for buttons, links, focus states
16+
colorPrimary: 'rgb(153, 153, 153)',
17+
colorSecondary: 'rgb(153, 153, 153)',
18+
fontBase: '"Inter", sans-serif',
1119
}),
20+
panelPosition: 'right', // Options: 'bottom' (default), 'right'
1221
});

.storybook/preview-styles.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#storybook-docs,
2+
#storybook-docs .sbdocs-title,
3+
#storybook-docs > .sbdocs > .sbdocs > h1 {
4+
font-family: "Inter", sans-serif;
5+
font-optical-sizing: auto;
6+
}
7+
8+
#storybook-docs .sbdocs-title,
9+
#storybook-docs > .sbdocs > .sbdocs > h1 {
10+
font-weight: 800;
11+
font-size: 36px;
12+
}
13+
14+
#storybook-docs .sbdocs-content p {
15+
font-size: 16px;
16+
}
17+
18+
#storybook-docs .sbdocs-content h2 {
19+
font-weight: 800;
20+
font-size: 24px;
21+
}

.storybook/preview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Preview } from "@storybook/react-vite";
2+
import './preview-styles.css';
23
import "@rtcamp/frappe-ui-react/theme.css";
34

45
import { decorators } from "./modeDecorator";

GETTING-STARTED.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Frappe UI React
2-
3-
Frappe UI React is a component library designed for rapid UI development using React 19 and Tailwind 4. It is inspired by the original [frappe-ui](https://github.com/frappe/frappe-ui), offering a similar aesthetic for a consistent user experience. However, we are not limited to a one-to-one port and also provide a growing collection of custom-built components to give developers more power and flexibility.
1+
Frappe UI React is a modern component library designed for building frontend applications in React, specifically tailored for the [Frappe Framework](https://frappe.io/framework). It is inspired by the original [frappe-ui](https://github.com/frappe/frappe-ui), which is created in Vue, offering a similar components and aesthetic in React. However, we are not limited to a one-to-one port and also provide a growing collection of custom-built components to give developers more power and flexibility.
42

53
## Prerequisites
64

@@ -9,35 +7,53 @@ Frappe UI React is a component library designed for rapid UI development using R
97

108
## Usage
119

10+
You can set up frappe-ui-react in the following simple steps.
11+
12+
### Step 1: Installation
13+
14+
Install the package using npm.
15+
1216
```bash
1317
npm install @rtcamp/frappe-ui-react
14-
# or
15-
yarn add @rtcamp/frappe-ui-react
1618
```
1719

18-
### Now, you can use the package in the following page
20+
### Step 2: Configuration
1921

20-
#### index.css
22+
**Option 1 (Recommended):** If you already have a Tailwind configuration, import the tailwind configuration from `frappe-ui-react` and use it as a preset or extend your existing configuration.
23+
24+
```js
25+
// tailwind.config.js in your project
26+
module.exports = {
27+
presets: [
28+
require('@rtcamp/frappe-ui-react/tailwind/preset')
29+
],
30+
// Additional configuration...
31+
}
32+
```
33+
34+
**Option 2:** Import the theme CSS directly into your project (e.g., in `index.css`).
2135

2236
```css
23-
@import @rtcamp/frappe-ui-react/theme.css
37+
@import '@rtcamp/frappe-ui-react/theme.css';
2438
```
2539

26-
#### app.tsx
40+
### Step 3: Import and Use Components
2741

28-
```js
42+
You can now import components and use them in your project.
43+
44+
```jsx
2945
import './index.css';
3046
import { Button } from "@rtcamp/frappe-ui-react";
3147

32-
3348
function App() {
3449
return (
3550
<div className="app-container">
3651
<Button
3752
label="Default Button"
38-
theme= "gray"
39-
size= "md"
40-
variant= "subtle" />
53+
theme="gray"
54+
size="md"
55+
variant="subtle"
56+
/>
4157
</div>
4258
);
4359
}
@@ -47,12 +63,14 @@ export default App;
4763

4864
## Under the Hood
4965

50-
- [TailwindCSS](https://github.com/tailwindlabs/tailwindcss): Utility first CSS Framework to build design system based UI.
51-
- [Headless UI](https://github.com/tailwindlabs/headlessui): Unstyled and accessible UI components.
52-
- [Radix UI](https://github.com/radix-ui/themes): Unstyled and accessible UI components.
53-
- [TipTap](https://github.com/ueberdosis/tiptap): ProseMirror based rich-text editor with a Vue API.
54-
- [dayjs](https://github.com/iamkun/dayjs): Minimal javascript library for working with dates.
66+
This library is built on top of several excellent open-source projects:
67+
68+
- **[TailwindCSS](https://github.com/tailwindlabs/tailwindcss)**: Utility-first CSS framework for building design system-based UIs.
69+
- **[Headless UI](https://github.com/tailwindlabs/headlessui)**: Unstyled and accessible UI components.
70+
- **[Radix UI](https://github.com/radix-ui/themes)**: Low-level, unstyled, and accessible UI primitives.
71+
- **[React Quill](https://github.com/zenoamaro/react-quill)**: Rich text editor component for React.
72+
- **[dayjs](https://github.com/iamkun/dayjs)**: Lightweight JavaScript library for working with dates.
5573

56-
## Does this interest you?
74+
## Inspiration & Credits
5775

58-
<a href="https://rtcamp.com/"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/github-banner@2x.png" alt="Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions"></a>
76+
This project, **Frappe UI React**, is heavily inspired by the original **[Frappe UI](https://github.com/frappe/frappe-ui)** project. Frappe UI is a fantastic Vue.js component library, and our goal with Frappe UI React is to bring a similar aesthetic and component experience to the React ecosystem.

README.md

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Frappe UI React
2+
[![ESLint](https://img.shields.io/badge/code%20style-eslint-4B32C3?logo=eslint)](#)
3+
[![Prettier](https://img.shields.io/badge/code%20style-prettier-ff69b4?logo=prettier)](#)
4+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
25

3-
Frappe UI React is a component library designed for rapid UI development using React 19 and Tailwind 4. It is inspired by the original [frappe-ui](https://github.com/frappe/frappe-ui), offering a similar aesthetic for a consistent user experience. However, we are not limited to a one-to-one port and also provide a growing collection of custom-built components to give developers more power and flexibility.
6+
Frappe UI React is a modern component library designed for building frontend applications in React, specifically tailored for the [Frappe Framework](https://frappe.io/framework). It is inspired by the original [frappe-ui](https://github.com/frappe/frappe-ui), which is created in Vue, offering a similar components and aesthetic in React. However, we are not limited to a one-to-one port and also provide a growing collection of custom-built components to give developers more power and flexibility.
47

58
## Prerequisites
69

@@ -9,35 +12,53 @@ Frappe UI React is a component library designed for rapid UI development using R
912

1013
## Usage
1114

15+
You can set up frappe-ui-react in the following simple steps.
16+
17+
### Step 1: Installation
18+
19+
Install the package using npm.
20+
1221
```bash
1322
npm install @rtcamp/frappe-ui-react
14-
# or
15-
yarn add @rtcamp/frappe-ui-react
1623
```
1724

18-
### Now, you can use the package in the following page
25+
### Step 2: Configuration
26+
27+
**Option 1 (Recommended):** If you already have a Tailwind configuration, import the tailwind configuration from `frappe-ui-react` and use it as a preset or extend your existing configuration.
28+
29+
```js
30+
// tailwind.config.js in your project
31+
module.exports = {
32+
presets: [
33+
require('@rtcamp/frappe-ui-react/tailwind/preset')
34+
],
35+
// Additional configuration...
36+
}
37+
```
1938

20-
#### index.css
39+
**Option 2:** Import the theme CSS directly into your project (e.g., in `index.css`).
2140

2241
```css
23-
@import @rtcamp/frappe-ui-react/theme.css
42+
@import '@rtcamp/frappe-ui-react/theme.css';
2443
```
2544

26-
#### app.tsx
45+
### Step 3: Import and Use Components
2746

28-
```js
47+
You can now import components and use them in your project.
48+
49+
```jsx
2950
import './index.css';
3051
import { Button } from "@rtcamp/frappe-ui-react";
3152

32-
3353
function App() {
3454
return (
3555
<div className="app-container">
3656
<Button
3757
label="Default Button"
38-
theme= "gray"
39-
size= "md"
40-
variant= "subtle" />
58+
theme="gray"
59+
size="md"
60+
variant="subtle"
61+
/>
4162
</div>
4263
);
4364
}
@@ -47,12 +68,14 @@ export default App;
4768

4869
## Under the Hood
4970

50-
- [TailwindCSS](https://github.com/tailwindlabs/tailwindcss): Utility first CSS Framework to build design system based UI.
51-
- [Headless UI](https://github.com/tailwindlabs/headlessui): Unstyled and accessible UI components.
52-
- [Radix UI](https://github.com/radix-ui/themes): Unstyled and accessible UI components.
53-
- [TipTap](https://github.com/ueberdosis/tiptap): ProseMirror based rich-text editor with a Vue API.
54-
- [dayjs](https://github.com/iamkun/dayjs): Minimal javascript library for working with dates.
71+
This library is built on top of several excellent open-source projects:
72+
73+
- **[TailwindCSS](https://github.com/tailwindlabs/tailwindcss)**: Utility-first CSS framework for building design system-based UIs.
74+
- **[Headless UI](https://github.com/tailwindlabs/headlessui)**: Unstyled and accessible UI components.
75+
- **[Radix UI](https://github.com/radix-ui/themes)**: Low-level, unstyled, and accessible UI primitives.
76+
- **[React Quill](https://github.com/zenoamaro/react-quill)**: Rich text editor component for React.
77+
- **[dayjs](https://github.com/iamkun/dayjs)**: Lightweight JavaScript library for working with dates.
5578

56-
## Does this interest you?
79+
## Inspiration & Credits
5780

58-
<a href="https://rtcamp.com/"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/github-banner@2x.png" alt="Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions"></a>
81+
This project, **Frappe UI React**, is heavily inspired by the original **[Frappe UI](https://github.com/frappe/frappe-ui)** project. Frappe UI is a fantastic Vue.js component library, and our goal with Frappe UI React is to bring a similar aesthetic and component experience to the React ecosystem.

packages/frappe-ui-react/src/components/themeShowCase/ThemeShowcase.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Theme Showcase Component Styles
3+
*
4+
* This CSS file contains all styles for the ThemeShowcase component, which is used
5+
* to display and demonstrate the Frappe UI React component library.
6+
*
7+
* - Used primarily in Storybook documentation and component demos
8+
*/
9+
110
.theme-showcase {
211
--showcase-max-width: 1200px;
312
--showcase-padding: 2rem;
@@ -10,7 +19,8 @@
1019
--showcase-tab-active-border: var(--outline-blue-1);
1120

1221
padding: var(--showcase-padding);
13-
font-family: "Reddit Sans", sans-serif;
22+
font-family: "Inter", sans-serif;
23+
font-optical-sizing: auto;
1424
color: var(--showcase-font-color);
1525
max-width: var(--showcase-max-width);
1626
margin: 0 auto;

0 commit comments

Comments
 (0)