Skip to content

Commit 1c0dc47

Browse files
docs: correcting and improvements in docs
1 parent 37cece1 commit 1c0dc47

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed

apps/docs/app/docs/components/dialog/page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Pass `isBarebone` prop to remove all style in dialog.
6363

6464
## ShowCloseButton
6565

66-
The showCloseButton prop exists in DialogContent subcomponent and it is used to show/hide default close button in dialog.
66+
The showCloseButton prop exists in DialogContent subcomponent and it is used to show/hide default close button in dialog. Its default value is true.
6767

6868
{% example name="dialog:closebutton" /%}
6969

apps/docs/app/docs/components/drawer/page.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ import {
2424
DrawerDescription,
2525
} from "@rafty/ui";
2626

27-
() => (
28-
<Drawer>
29-
<DrawerOverlay />
30-
<DrawerContent>
31-
<DrawerTitle />
32-
<DrawerDescription />
33-
<DrawerClose />
34-
</DrawerContent>
35-
</Drawer>
36-
);
27+
<Drawer>
28+
<DrawerOverlay />
29+
<DrawerContent>
30+
<DrawerTitle />
31+
<DrawerDescription />
32+
<DrawerClose />
33+
</DrawerContent>
34+
</Drawer>;
3735
```
3836

3937
## Usage

apps/docs/app/docs/components/field-control/page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ There are 3 `orientation` options in field control: `row` (default), `col` & `ro
5050

5151
`isReadOnly` prop is used to change field state to read only.
5252

53-
{% example name="field-control:orientation" /%}
53+
{% example name="field-control:readonly" /%}
5454

5555
## IsInvalid
5656

apps/docs/components/Examples/dialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
DialogOverlay,
77
DialogTrigger,
88
DialogDescription,
9+
DialogClose,
910
} from "@rafty/ui";
1011

1112
export const dialog_examples = {
@@ -49,7 +50,9 @@ export const dialog_examples = {
4950
Make changes to your profile here. Click save when you&apos;re done.
5051
</DialogDescription>
5152
<div className="flex items-center justify-end pt-5">
52-
<Button>Save Change</Button>
53+
<DialogClose asChild>
54+
<Button>Save Change</Button>
55+
</DialogClose>
5356
</div>
5457
</DialogContent>
5558
</Dialog>
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,54 @@
1-
import { ErrorMessage, FieldControl, InputField, Label, Text } from "@rafty/ui";
1+
import { ErrorMessage, FieldControl, InputField, Label } from "@rafty/ui";
22

33
export const field_control_examples = {
44
"field-control:usage": (
55
<FieldControl name="name">
6-
<Label>Name</Label>
6+
<Label>Label</Label>
77
<InputField />
8-
<Text>Sample </Text>
8+
<ErrorMessage>Error message will be displayed here</ErrorMessage>
99
</FieldControl>
1010
),
1111
"field-control:orientation": (
12-
<FieldControl name="name" orientation="col">
12+
<FieldControl name="name" orientation="row">
1313
<Label>Name</Label>
1414
<InputField />
15-
<Text>Sample </Text>
1615
</FieldControl>
1716
),
1817
"field-control:required": (
1918
<FieldControl name="name" isRequired>
2019
<Label>Name</Label>
2120
<InputField />
22-
<Text>Sample </Text>
2321
</FieldControl>
2422
),
2523
"field-control:disabled": (
2624
<FieldControl name="name" isDisabled>
2725
<Label>Name</Label>
2826
<InputField />
29-
<Text>Sample </Text>
27+
</FieldControl>
28+
),
29+
"field-control:readonly": (
30+
<FieldControl name="name" isReadOnly>
31+
<Label>Name</Label>
32+
<InputField defaultValue="This is a sample default text" />
3033
</FieldControl>
3134
),
3235
"field-control:loading": (
3336
<FieldControl name="name" isLoading>
3437
<Label>Name</Label>
3538
<InputField />
36-
<Text>Sample </Text>
3739
</FieldControl>
3840
),
3941
"field-control:invalid": (
4042
<FieldControl name="name" isInvalid>
4143
<Label>Name</Label>
4244
<InputField />
43-
<Text></Text>
4445
</FieldControl>
4546
),
4647
"field-control:errormessage": (
4748
<FieldControl name="name">
4849
<Label>Name</Label>
4950
<InputField />
50-
<ErrorMessage>Sample error message</ErrorMessage>
51+
<ErrorMessage>Error message will be displayed here</ErrorMessage>
5152
</FieldControl>
5253
),
5354
};

apps/docs/components/Examples/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ export function Examples({
112112
{Component}
113113
</div>
114114
{children || (
115-
<Fence language="jsx" className="!-mt-2">
116-
{reactElementToJSXString(Component)}
117-
</Fence>
115+
<Fence language="jsx">{reactElementToJSXString(Component)}</Fence>
118116
)}
119117
</div>
120118
);

apps/docs/components/Fence.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export function Fence({
2929
<div className="relative">
3030
<Highlight code={content} language={language} theme={themes.dracula}>
3131
{({ className, style, tokens, getTokenProps }) => (
32-
<pre className={classNames(className, _className)} style={style}>
32+
<pre
33+
className={classNames(className, _className, "!-mt-2")}
34+
style={style}
35+
>
3336
<Button
3437
onClick={handleCopyClick}
3538
className="absolute right-1 top-1 "

0 commit comments

Comments
 (0)