Skip to content

Commit 3a52b2c

Browse files
committed
docs: add mdx storybook
1 parent 87c8c12 commit 3a52b2c

File tree

3 files changed

+182
-1
lines changed

3 files changed

+182
-1
lines changed

stories/Introduction.stories.mdx renamed to stories/ToggleFileTree.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Meta } from '@storybook/addon-docs';
22

3-
<Meta title="Introduction" />
3+
<Meta title="ReactToggleFileTree" />
44

55
<style>
66
{`

stories/ToggleList.stories.mdx

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
import { Meta } from '@storybook/addon-docs';
2+
3+
<Meta title="ReactToggleList" />
4+
5+
<style>
6+
{`
7+
.subheading {
8+
--mediumdark: '#999999';
9+
font-weight: 900;
10+
font-size: 13px;
11+
color: #999;
12+
letter-spacing: 6px;
13+
line-height: 24px;
14+
text-transform: uppercase;
15+
margin-bottom: 12px;
16+
margin-top: 40px;
17+
}
18+
19+
.link-list {
20+
display: grid;
21+
grid-template-columns: 1fr;
22+
grid-template-rows: 1fr 1fr;
23+
row-gap: 10px;
24+
}
25+
26+
@media (min-width: 620px) {
27+
.link-list {
28+
row-gap: 20px;
29+
column-gap: 20px;
30+
grid-template-columns: 1fr 1fr;
31+
}
32+
}
33+
34+
@media all and (-ms-high-contrast:none) {
35+
.link-list {
36+
display: -ms-grid;
37+
-ms-grid-columns: 1fr 1fr;
38+
-ms-grid-rows: 1fr 1fr;
39+
}
40+
}
41+
42+
.link-item {
43+
display: block;
44+
padding: 20px 30px 20px 15px;
45+
border: 1px solid #00000010;
46+
border-radius: 5px;
47+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
48+
color: #333333;
49+
display: flex;
50+
align-items: flex-start;
51+
}
52+
53+
.link-item:hover {
54+
border-color: #1EA7FD50;
55+
transform: translate3d(0, -3px, 0);
56+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
57+
}
58+
59+
.link-item:active {
60+
border-color: #1EA7FD;
61+
transform: translate3d(0, 0, 0);
62+
}
63+
64+
.link-item strong {
65+
font-weight: 700;
66+
display: block;
67+
margin-bottom: 2px;
68+
}
69+
70+
.link-item img {
71+
height: 40px;
72+
width: 40px;
73+
margin-right: 15px;
74+
flex: none;
75+
}
76+
77+
.link-item span {
78+
font-size: 14px;
79+
line-height: 20px;
80+
}
81+
82+
.tip {
83+
display: inline-block;
84+
border-radius: 1em;
85+
font-size: 11px;
86+
line-height: 12px;
87+
font-weight: 700;
88+
background: #E7FDD8;
89+
color: #66BF3C;
90+
padding: 4px 12px;
91+
margin-right: 10px;
92+
vertical-align: top;
93+
}
94+
95+
.tip2 {
96+
display: inline-block;
97+
border-radius: 1em;
98+
font-size: 11px;
99+
line-height: 12px;
100+
font-weight: 700;
101+
background: #85eaf2;
102+
color: #17b0bd;
103+
padding: 4px 12px;
104+
margin-right: 10px;
105+
vertical-align: top;
106+
}
107+
108+
.tip-wrapper {
109+
font-size: 13px;
110+
line-height: 20px;
111+
margin-top: 40px;
112+
margin-bottom: 40px;
113+
}
114+
115+
.tip-wrapper code {
116+
font-size: 12px;
117+
display: inline-block;
118+
}
119+
.tip-wrapper a{
120+
margin-left:5px;
121+
}
122+
.br {
123+
width:10px;
124+
height:30px;
125+
}
126+
`}
127+
</style>
128+
129+
# react-toggle-list
130+
131+
The `react-toggle-list` is can hide and show content inside.
132+
133+
## Document
134+
135+
---
136+
137+
- [Installation](#installation)
138+
- [How to use](#how-to-use)
139+
- [Contribute](#contribute)
140+
141+
## Installation
142+
143+
---
144+
145+
This library use `react-toggle-list`, so you need to install it.
146+
147+
```bash
148+
npm install --save react-toggle-list
149+
```
150+
151+
or
152+
153+
```bash
154+
yarn add react-toggle-list
155+
```
156+
157+
## How to use
158+
159+
---
160+
161+
```tsx
162+
import { ReactToggleList } from 'react-toggle-list';
163+
164+
const subItems = ['string1', 'string2', 'string3'];
165+
166+
<ReactToggleList title="example" subItems={subItems} />;
167+
```
168+
169+
## Contribute
170+
171+
---
172+
173+
You can follow below to contribute `react-toggle-list`
174+
175+
Clone the repository.
176+
177+
```bash
178+
git clone https://github.com/in-ch/react-file-folder.git
179+
```

stories/ToggleList.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @ts-nocheck
2+
13
import React from 'react';
24
import type { Meta, StoryObj } from '@storybook/react';
35
import { ReactToggleList } from '../packages/react-toggle-list/src';

0 commit comments

Comments
 (0)