Skip to content

Commit 047f420

Browse files
committed
docs: update README and documentation for clarity and consistency
- Revised README to enhance clarity, including renaming "Features" to "Highlights" and restructuring content for better readability. - Updated installation instructions to include additional package managers (pnpm, bun) and emphasized namespaced imports for tree-shaking. - Improved documentation sections, including "Getting Started," "Usage," and "Theme," to provide clearer examples and usage patterns. - Enhanced styling and layout in documentation components for better user experience and accessibility. - Removed outdated references and streamlined content across various sections to reflect recent changes in the library.
1 parent 892e2f2 commit 047f420

File tree

16 files changed

+469
-228
lines changed

16 files changed

+469
-228
lines changed

README.md

Lines changed: 108 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
![npm bundle size (version)](https://img.shields.io/bundlephobia/minzip/react-creme)
88
[![codecov](https://codecov.io/gh/prabhuignoto/react-creme/branch/master/graph/badge.svg?token=JEL70TGE8Q)](https://codecov.io/gh/prabhuignoto/react-creme)
99
[![Snyk](https://snyk.io/test/github/prabhuignoto/react-creme/badge.svg)](https://snyk.io/test/github/prabhuignoto/react-creme)
10-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=react-creme&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=react-creme)
11-
[![CodeFactor](https://www.codefactor.io/repository/github/prabhuignoto/react-creme/badge)](https://www.codefactor.io/repository/github/prabhuignoto/react-creme)
12-
[![CodeQL](https://github.com/prabhuignoto/react-creme/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/prabhuignoto/react-creme/actions/workflows/codeql-analysis.yml)
10+
<!-- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=react-creme&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=react-creme) -->
11+
<!-- [![CodeQL](https://github.com/prabhuignoto/react-creme/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/prabhuignoto/react-creme/actions/workflows/codeql-analysis.yml) -->
1312
[![dev status](https://img.shields.io/badge/status-beta-green)](https://img.shields.io/badge/status-beta-green)
1413
[![GitHub license](https://img.shields.io/github/license/prabhuignoto/react-creme)](https://github.com/prabhuignoto/react-creme/blob/master/LICENSE)
1514
![npm](https://img.shields.io/npm/v/react-creme)
@@ -23,100 +22,145 @@ Modern UI Toolkit for React
2322

2423
[Explore the Components](https://react-creme.vercel.app/)
2524

26-
<h2>Features</h2>
25+
<h2>Highlights</h2>
2726

28-
- 💎 High Quality React components.
29-
30-
- 💪 Robust components written in Typescript.
31-
32-
- ♿ Accessible UI Components.
33-
34-
- 🌈 57 UI Components.
35-
36-
- 🛠️ Customizable components.
37-
38-
- 🎨 Themeable components.
39-
40-
- ⚙️ Minimal Third party dependencies.
41-
42-
- 🪶 Tree-shakeable: Import only what you need (~12-20kb per component) or use the full library (~115kb gzipped with all 57 components and CSS).
27+
- 57 production-ready React components built with TypeScript 5.9 (strict).
28+
- Accessible by default with ARIA-friendly patterns and keyboard support.
29+
- CSS Modules, design tokens, and theming via `ThemeProvider`.
30+
- Namespaced entry points for tree-shaking; fully typed API surface.
31+
- Light dependency stack focused on React, TypeScript, and CSS Modules.
32+
- React 19 ready; ships ESM and CJS plus type declarations.
4333

4434
<h2>Table of Contents</h2>
4535

36+
- [✨ Key Features](#-key-features)
37+
- [📦 Packaging & Bundles](#-packaging--bundles)
38+
- [🧰 Tooling & Quality](#-tooling--quality)
4639
- [🚀 Getting Started](#-getting-started)
47-
- [☕ Usage](#-usage)
40+
- [☕ Quick Usage](#-quick-usage)
41+
- [🎨 Theming](#-theming)
4842
- [🌍 Browser Support](#-browser-support)
49-
- [🍫 Examples & Documentation](#-examples--documentation)
50-
- [🔨 Build](#-build)
51-
- [🤝Contributing](#contributing)
43+
- [🍫 Documentation](#-documentation)
44+
- [🔨 Build & Test](#-build--test)
45+
- [🤝 Contributing](#-contributing)
46+
47+
## ✨ Key Features
48+
49+
- Comprehensive component set: forms, navigation, overlays, data display, media, layout, disclosure, feedback, core primitives.
50+
- Theming-first: design tokens, CSS variables, and `ThemeProvider` to keep brand control.
51+
- Tree-shakeable namespaces to keep bundles lean; side effects minimized.
52+
- Accessibility baked in: keyboard interactions and sensible ARIA defaults.
53+
- Type-safe: emitted declarations for every entry point; IntelliSense-friendly.
54+
55+
## 📦 Packaging & Bundles
56+
57+
- Package name: `react-creme` (unscoped).
58+
- Namespaced imports (recommended):
59+
- `react-creme/core`, `react-creme/forms`, `react-creme/feedback`, `react-creme/data-display`,
60+
`react-creme/navigation`, `react-creme/overlay`, `react-creme/layout`, `react-creme/disclosure`,
61+
`react-creme/media`.
62+
- Measured bundles (latest build):
63+
- Full ESM bundle: ~119 KB gzipped.
64+
- CSS bundle: ~47 KB gzipped.
65+
- Examples (ESM): core ~36 KB, forms ~80 KB, data-display ~88 KB, navigation ~64 KB, overlay ~60 KB.
66+
- Legacy root import `react-creme` remains for compatibility.
67+
68+
## 🧰 Tooling & Quality
69+
70+
- Build: Vite 6 and Bun build pipeline; Turborepo for orchestration.
71+
- Linting: ESLint, Stylelint, Oxlint; format via Prettier.
72+
- Tests: Vitest + Testing Library; coverage tracked with Codecov.
73+
- Security and analysis: Snyk, SonarCloud, CodeQL, CodeFactor.
74+
- Supported runtimes: Node >= 20.18.1, Bun >= 1.1.0.
5275

5376
## 🚀 Getting Started
5477

55-
Install the package using npm or yarn
78+
Install with your preferred package manager:
5679

5780
```sh
58-
yarn add react-creme
59-
60-
or
61-
6281
npm install react-creme
82+
yarn add react-creme
83+
pnpm add react-creme
84+
bun add react-creme
85+
```
6386

87+
Import the bundled styles once (typically in your root entry point):
88+
```ts
89+
import 'react-creme/css';
6490
```
6591

66-
## ☕ Usage
92+
Use namespaced entry points for tree-shaking:
6793

68-
```sh
69-
import { Button } from "react-creme";
94+
- `react-creme/core` — buttons, ThemeProvider, utilities
95+
- `react-creme/forms` — inputs, sliders, switches, file upload
96+
- `react-creme/feedback` — notifications, loaders, progress
97+
- `react-creme/data-display` — tables, tags, timelines
98+
- `react-creme/navigation` — tabs, breadcrumbs, menus
99+
- `react-creme/overlay` — dialogs, drawers, tooltips
100+
- `react-creme/layout` — layout primitives
101+
- `react-creme/disclosure` — accordion and collapsible surfaces
102+
- `react-creme/media` — media helpers
70103

71-
const App = () => {
72-
return (
73-
<div>
74-
<Button>Welcome to react-creme</Button>
75-
</div>
76-
);
77-
};
104+
Full bundle (ESM) is ~119 KB gzipped; CSS bundle is ~47 KB gzipped. The legacy root import `react-creme` remains available for compatibility.
78105

79-
export default App;
80-
```
106+
## ☕ Quick Usage
81107

82-
## 🌍 Browser Support
108+
```tsx
109+
import { Button, ThemeProvider } from "react-creme/core";
110+
import "react-creme/css";
83111

84-
| ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png) |
85-
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
86-
| Chrome | Firefox | Microsoft Edge | Opera | Safari |
112+
function App() {
113+
return (
114+
<ThemeProvider>
115+
<Button>Welcome to react-creme</Button>
116+
</ThemeProvider>
117+
);
118+
}
87119

88-
## 🍫 Examples & Documentation
120+
export default App;
121+
```
89122

90-
For more thorough examples and the API details visit the [main site](https://react-creme.vercel.app)
123+
## 🎨 Theming
91124

92-
## 🔨 Build
125+
Theme tokens are provided via `ThemeProvider` from `react-creme/core`. Define your palette, typography, and sizing once and components across namespaces inherit it. Example:
93126

94-
To build everything
127+
```tsx
128+
import { ThemeProvider, Theme } from "react-creme/core";
129+
import { Input } from "react-creme/forms";
130+
import "react-creme/css";
95131

96-
```sh
97-
bun build
132+
const theme: Theme = {
133+
colors: { primary: "#0074B7" },
134+
fontSizes: { md: 16, sm: 14 },
135+
};
136+
137+
function App() {
138+
return (
139+
<ThemeProvider theme={theme}>
140+
<Input placeholder="Search" />
141+
</ThemeProvider>
142+
);
143+
}
98144
```
99145

100-
To build the library
146+
## 🌍 Browser Support
101147

102-
```sh
103-
bun build:lib
104-
```
148+
| ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png) |
149+
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
150+
| Chrome | Firefox | Microsoft Edge | Opera | Safari |
105151

106-
To build and run the documentation
152+
## 🍫 Documentation
107153

108-
```sh
109-
bun build:doc
110-
cd ./packages/documentation/expo_dist && bunx serve .
111-
```
154+
Full docs, live examples, and API reference: [react-creme.vercel.app](https://react-creme.vercel.app)
112155

113-
To run the Unit tests
156+
## 🔨 Build & Test
114157

115-
```sh
116-
bun test
117-
```
158+
- Build everything: `bun build`
159+
- Build library only: `bun build:lib`
160+
- Build docs: `bun build:doc` then `cd packages/documentation/expo_dist && bunx serve .`
161+
- Tests: `bun test`
118162

119-
## 🤝Contributing
163+
## 🤝 Contributing
120164

121165
Contributions, ideas and PR's are welcome!. Please read the [guidelines](/CONTRIBUTING.md) for more details.
122166

packages/documentation/App.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/* Typography */
2929
--font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
30-
--font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
30+
--font-mono: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'ui-monospace', 'Monaco', 'Courier New', monospace;
3131
--font-size-xs: 0.75rem;
3232
--font-size-sm: 0.875rem;
3333
--font-size-base: 1rem;
@@ -38,6 +38,11 @@
3838
--line-height-tight: 1.4;
3939
--line-height-relaxed: 1.75;
4040

41+
/* Code tokens */
42+
--code-bg: #f7f8fb;
43+
--code-bg-dark: #0f1117;
44+
--code-border: #e5e7eb;
45+
4146
/* Colors (Light mode - Modern palette) */
4247
--bg-primary: #fff;
4348
--bg-secondary: #fafafa;
@@ -102,6 +107,8 @@
102107
--glass-border: rgba(255, 255, 255, 0.08);
103108
--shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px 4px rgba(0, 0, 0, 0.3);
104109
--shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 8px rgba(0, 0, 0, 0.5);
110+
--code-bg: var(--code-bg-dark);
111+
--code-border: #2d2f36;
105112
}
106113

107114
/* ============================================

packages/documentation/common/syntax-highlighter/syntax-highlighter.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
position: relative;
77
width: 100%;
88
margin: var(--spacing-lg) 0;
9-
background: var(--bg-secondary);
9+
background: var(--code-bg, var(--bg-secondary));
1010
border-radius: 12px;
11-
border: 1px solid var(--border-color);
11+
border: 1px solid var(--code-border, var(--border-color));
1212
overflow: hidden;
1313
box-shadow: var(--shadow-md);
1414
transition: all var(--transition-base);
@@ -136,7 +136,7 @@
136136
margin: 0 !important;
137137
padding: var(--spacing-xl) !important;
138138
border-radius: 0 !important;
139-
background: rgba(0, 0, 0, 0.02) !important;
139+
background: var(--code-bg, rgba(0, 0, 0, 0.02)) !important;
140140
font-family: var(--font-mono) !important;
141141
font-size: 0.75rem !important;
142142
line-height: 1.6 !important;
@@ -228,8 +228,8 @@
228228

229229
/* Dark mode adjustments */
230230
.dark .rc-demo-code-block {
231-
background: #1e1e1e;
232-
border-color: #333;
231+
background: var(--code-bg-dark, #0f1117);
232+
border-color: var(--code-border, #333);
233233

234234
.rc-demo-code-file-name {
235235
background: #2d2d2d;
@@ -243,7 +243,7 @@
243243
}
244244

245245
.rc-demo-code-content pre {
246-
background: rgba(255, 255, 255, 0.03) !important;
246+
background: var(--code-bg-dark, #0f1117) !important;
247247
}
248248
}
249249

packages/documentation/home/index.tsx

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockQuote, Button, Text } from '../../lib/components';
1+
import { Button, Text } from '../../lib/components';
22
import { Section } from '../../lib/components/section/section';
33
// import packages from '../../lib/package.json';
44
import { SyntaxHighLighter } from './../common/syntax-highlighter';
@@ -20,34 +20,34 @@ const Home: React.FunctionComponent = () => {
2020
{/* SETUP */}
2121
<Section title="Installation" size="md" hashPrefix="home">
2222
<Text>
23-
Getting started with the <em>react-creme</em> package is easy. To
24-
install it, you can use either npm or yarn package manager. If you
25-
prefer to use npm, you can install it by running the following
26-
command in your terminal:
23+
Install the <em>react-creme</em> package from npm using your
24+
preferred manager.
2725
</Text>
28-
<Code wrap={false}>{`npm install --save react-creme`}</Code>
26+
<Code wrap={false}>{`npm install react-creme
27+
yarn add react-creme
28+
pnpm add react-creme
29+
bun add react-creme`}</Code>
2930
<Text>
30-
If you prefer to use yarn, you can install it by running the
31-
following command in your terminal:
31+
Import the bundled styles once in your application entry point.
3232
</Text>
33-
<Code wrap={false}>{`yarn add react-creme`}</Code>
34-
<Text>
35-
After the installation is complete, you can import the package and
36-
use its components and functionalities in your React application.
37-
</Text>
38-
39-
<BlockQuote>
40-
Once the package is installed, you can start building your
41-
application with the powerful set of features provided by
42-
react-creme, such as the ThemeProvider, which allows you to
43-
customize the visual design of your application with ease.
44-
</BlockQuote>
33+
<Code wrap={false}>{`import 'react-creme/css';`}</Code>
4534
</Section>
4635

4736
<Section title="Usage" size="md" hashPrefix="home">
4837
<Text>
49-
The example below shows how to use the react-creme package to create
50-
a simple button element.
38+
Use namespaced entry points for tree-shaking and clarity. Common
39+
namespaces include <code>react-creme/core</code>,{' '}
40+
<code>react-creme/forms</code>, <code>react-creme/feedback</code>,{' '}
41+
<code>react-creme/data-display</code>,{' '}
42+
<code>react-creme/navigation</code>,{' '}
43+
<code>react-creme/overlay</code>, <code>react-creme/layout</code>,{' '}
44+
<code>react-creme/disclosure</code>, and{' '}
45+
<code>react-creme/media</code>. The legacy root import{' '}
46+
<code>react-creme</code> remains available for compatibility.
47+
</Text>
48+
<Text>
49+
The example below shows how to render a button from the core
50+
namespace.
5151
</Text>
5252
<SyntaxHighLighter
5353
code={gettingStarted}
@@ -64,24 +64,14 @@ const Home: React.FunctionComponent = () => {
6464

6565
<Section title="Theme" size="md" hashPrefix="home">
6666
<Text>
67-
The <em>react-creme</em> library comes with a powerful ThemeProvider
68-
wrapper that makes it easy to customize the visual elements of your
69-
application. This wrapper allows you to easily change the colors,
70-
fonts, and icon sizes throughout your application with a single
71-
point of configuration. This can be useful in situations where you
72-
need to update the visual design of your application or when you
73-
want to create a consistent look and feel across multiple pages or
74-
components.
75-
</Text>
76-
<Text>
77-
The ThemeProvider wrapper is easy to use and can be integrated into
78-
your application in just a few lines of code, making it a powerful
79-
tool for customizing the visual design of your React projects with
80-
ease.
67+
Use the <em>ThemeProvider</em> from <code>react-creme/core</code> to
68+
configure brand colors, typography, icon sizing, and z-index scales
69+
in one place.
8170
</Text>
8271
<Text>
83-
The following example demonstrates how to use the{' '}
84-
<em>ThemeProvider</em> to customize your app built with react-creme.
72+
Components pulled from other namespaces, such as{' '}
73+
<code>react-creme/forms</code>, automatically inherit your theme.
74+
The example below shows a minimal setup.
8575
</Text>
8676
<SyntaxHighLighter
8777
code={gettingStartedTheme}

0 commit comments

Comments
 (0)