Skip to content

Commit 42f36b3

Browse files
authored
Merge pull request #54 from DouglasNeuroInformatics/dev
docs: add index page and move instructions to site
2 parents 4560c1a + 91a68bc commit 42f36b3

File tree

5 files changed

+73
-47
lines changed

5 files changed

+73
-47
lines changed

.storybook/index.mdx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Welcome" />
4+
5+
# Welcome to the Douglasneuroinformatics UI Library
6+
7+
This library includes generic UI components built using shadcn/ui with React and TailwindCSS.
8+
9+
## 🚀 Getting Started
10+
11+
## Installation
12+
13+
```sh
14+
pnpm install @douglasneuroinformatics/libui
15+
```
16+
17+
## Usage
18+
19+
**globals.css**
20+
21+
```css
22+
@import '@douglasneuroinformatics/libui/tailwind/globals.css';
23+
24+
// adjust as required
25+
@source "../node_modules/@douglasneuroinformatics/libui";
26+
```
27+
28+
**i18n.ts**
29+
30+
```ts
31+
import { init } from '@douglasneuroinformatics/libui/i18n';
32+
33+
import common from './common.json';
34+
35+
declare module '@douglasneuroinformatics/libui/i18n' {
36+
export namespace UserConfig {
37+
export interface LanguageOptions {
38+
en: true;
39+
es: true;
40+
fr: true;
41+
}
42+
export interface Translations {
43+
common: typeof common;
44+
}
45+
}
46+
}
47+
48+
init({ translations: { common } });
49+
```
50+
51+
**main.tsx**
52+
53+
```js
54+
import './globals.css';
55+
import './i18n';
56+
```
57+
58+
## 📚 Available Components
59+
60+
Browse the sidebar to view all available components.

.storybook/main.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
22

33
const config: StorybookConfig = {
4-
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
4+
addons: [
5+
'@storybook/addon-docs',
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@storybook/addon-interactions'
9+
],
510
core: {
611
disableTelemetry: true
712
},
@@ -14,7 +19,7 @@ const config: StorybookConfig = {
1419
strictMode: true
1520
}
1621
},
17-
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
22+
stories: ['./index.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
1823
typescript: {
1924
reactDocgen: 'react-docgen-typescript'
2025
}

README.md

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,52 +33,9 @@
3333

3434
A React component library built by the Douglas Neuroinformatics Platform (DNP) using [shadcn/ui](https://github.com/shadcn-ui/ui) with [React](https://react.dev/) and [TailwindCSS](https://tailwindcss.com/). Although primarily intended for internal use in our platforms, it is designed as a generic implementation.
3535

36-
## Installation
36+
## Documentation
3737

38-
```sh
39-
pnpm install @douglasneuroinformatics/libui
40-
```
41-
42-
## Usage
43-
44-
**globals.css**
45-
46-
```css
47-
@import '@douglasneuroinformatics/libui/tailwind/globals.css';
48-
49-
// adjust as required
50-
@source "../node_modules/@douglasneuroinformatics/libui";
51-
```
52-
53-
**i18n.ts**
54-
55-
```ts
56-
import { init } from '@douglasneuroinformatics/libui/i18n';
57-
58-
import common from './common.json';
59-
60-
declare module '@douglasneuroinformatics/libui/i18n' {
61-
export namespace UserConfig {
62-
export interface LanguageOptions {
63-
en: true;
64-
es: true;
65-
fr: true;
66-
}
67-
export interface Translations {
68-
common: typeof common;
69-
}
70-
}
71-
}
72-
73-
init({ translations: { common } });
74-
```
75-
76-
**main.tsx**
77-
78-
```js
79-
import './globals.css';
80-
import './i18n';
81-
```
38+
For detailed installation, configuration, and usage instructions, please refer to [the documentation](https://douglasneuroinformatics.github.io/libui).
8239

8340
## Contributing
8441

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"@douglasneuroinformatics/semantic-release": "^0.2.1",
116116
"@douglasneuroinformatics/tsconfig": "^1.0.3",
117117
"@faker-js/faker": "^9.6.0",
118+
"@storybook/addon-docs": "^8.6.11",
118119
"@storybook/addon-essentials": "^8.6.11",
119120
"@storybook/addon-interactions": "^8.6.11",
120121
"@storybook/addon-links": "^8.6.11",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)