Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(interactive): 📝 improve docs and move to pnpm #24

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions components/Icons/CopyIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import { createIcon } from "@adaptui/react-tailwind";

export const CopyIcon = createIcon({
displayName: "CopyIcon",
viewBox: "0 0 15 15",
viewBox: "0 0 24 24",
path: (
<path
d="M5 2V1h5v1H5Zm-.25-2A.75.75 0 0 0 4 .75V1h-.5A1.5 1.5 0 0 0 2 2.5v10A1.5 1.5 0 0 0 3.5 14H7v-1H3.5a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5H4v.25c0 .414.336.75.75.75h5.5a.75.75 0 0 0 .75-.75V2h.5a.5.5 0 0 1 .5.5V7h1V2.5A1.5 1.5 0 0 0 11.5 1H11V.75a.75.75 0 0 0-.75-.75h-5.5ZM9 8.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm1.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm2.5-.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm1.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm.5 1.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-.5 2.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm0 2a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm-6-4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm.5 1.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0ZM8.5 15a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Zm2.5-.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm1.5.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z"
fill="currentColor"
fillRule="evenodd"
clipRule="evenodd"
/>
<>
<rect width="8" height="4" x="8" y="2" rx="1" ry="1" />
<path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4M21 14H11" />
<path d="m15 10-4 4 4 4" />
</>
),
defaultProps: {
fill: "none",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "2",
},
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"ariakit": "2.0.0-next.36",
"lodash": "4.17.21",
"next": "12.2.3",
"next-themes": "^0.2.1",
"nextra": "2.0.0-alpha.56",
"nextra-theme-docs": "2.0.0-alpha.59",
"react": "17.0.2",
Expand Down
11 changes: 4 additions & 7 deletions pages/docs/components/feedback/circular-progress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
useCircularProgressState,
CircularProgressTrack,
CircularProgressTrackWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -42,7 +42,7 @@ import {
children={({ spreadProps }) =>
`<CircularProgress value={40} ${spreadProps} />`
}
themeProps={{ size: "circularProgress.barWrapper.common.size" }}
themeProps={{ size: "circularProgress.size" }}
/>

## CircularProgress sizes
Expand All @@ -66,10 +66,7 @@ sizes are: `sm` `md` `lg` `xl`

Set the `min` and `max` values of the progress bar.

<Codeblock
live
code={`<CircularProgress min={10} max={40} value={35} />`}
/>
<Codeblock live code={`<CircularProgress min={10} max={40} value={35} />`} />

## Indeterminate progress

Expand Down Expand Up @@ -107,7 +104,7 @@ CircularProgressHint) for more control.
data={[
{
name: "size",
themeKey: "circularProgress.barWrapper.common.size",
themeKey: "circularProgress.size",
default: "md",
},
{
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/feedback/meter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
useMeterState,
MeterTrack,
MeterWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -39,7 +39,7 @@ import {
children={({ spreadProps }) =>
`<Meter value={40} max={100} ${spreadProps} />`
}
themeProps={{ size: "meter.track.size" }}
themeProps={{ size: "meter.size" }}
/>

## Meter sizes
Expand Down Expand Up @@ -109,7 +109,7 @@ children components (MeterTrack, MeterBar) for more control.

<PropsTable
data={[
{ name: "size", themeKey: "meter.track.size", default: "md" },
{ name: "size", themeKey: "meter.size", default: "md" },
{
name: "intervals",
type: "number",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/feedback/progress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
useProgressState,
ProgressTrack,
ProgressWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -36,7 +36,7 @@ import {

<InteractiveCodeblock
children={({ spreadProps }) => `<Progress value={40} ${spreadProps} />`}
themeProps={{ size: "progress.track.size" }}
themeProps={{ size: "progress.size" }}
/>

## Progress sizes
Expand Down Expand Up @@ -101,7 +101,7 @@ children components (ProgressTrack, ProgressBar) for more control.

<PropsTable
data={[
{ name: "size", themeKey: "progress.track.size", default: "md" },
{ name: "size", themeKey: "progress.size", default: "md" },
{
name: "hint",
type: "React.ReactNode",
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/components/feedback/show-more.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
ShowMoreContent,
useShowMoreProps,
useShowMoreState,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand Down
12 changes: 6 additions & 6 deletions pages/docs/components/feedback/spinner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ course of change or a result.
## Imports

```js
import { Spinner } from "@renderlesskit/react-tailwind";
import { Spinner } from "@adaptui/react-tailwind";
```

## Usage

<InteractiveCodeblock
children={({ spreadProps }) => `<Spinner ${spreadProps} />`}
themeProps={{ size: "spinner.size", stroke: "spinner.stroke" }}
themeProps={{ size: "spinner.size", track: "spinner.track" }}
/>

## Spinner sizes
Expand All @@ -43,10 +43,10 @@ sizes are: `xs` `sm` `md` `lg` & `em`
`}
/>

## Show stroke
## Show track

To show the subtle stroke around the spinner we can use the `stroke` which
accepts `visible` or `transparent` values
To show the subtle track around the spinner we can use the `track` which accepts
`visible` or `transparent` values

<Codeblock
live
Expand Down Expand Up @@ -77,7 +77,7 @@ visible to the screen readers.
<PropsTable
data={[
{ name: "size", themeKey: "spinner.size", default: "md" },
{ name: "stroke", themeKey: "spinner.stroke", default: "transparent" },
{ name: "track", themeKey: "spinner.track", default: "transparent" },
{
name: "label",
type: "string",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/checkbox-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
useCheckboxGroupState,
CheckboxGroupWrapper,
CheckboxShowMore,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -44,7 +44,7 @@ import {
<Checkbox value="grapes" label="Grapes" />
</CheckboxGroup>
`}
themeProps={{ size: "checkbox.icon.size" }}
themeProps={{ size: "checkbox.size" }}
/>

## CheckboxGroup sizes
Expand Down Expand Up @@ -141,7 +141,7 @@ render (<CheckboxGroupStack/>); `} />

<PropsTable
data={[
{ name: "size", themeKey: "checkbox.icon.size", default: "md" },
{ name: "size", themeKey: "checkbox.size", default: "md" },
{
name: "stack",
type: "string",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/checkbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
useCheckboxProps,
useCheckboxState,
CheckboxText,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -40,7 +40,7 @@ import {
`<Checkbox${spreadProps}>Label text</Checkbox>`
}
booleanProps={["disabled"]}
themeProps={{ size: "checkbox.icon.size" }}
themeProps={{ size: "checkbox.size" }}
choiceProps={{ defaultState: ["true", "false", "'indeterminate'"] }}
/>

Expand Down Expand Up @@ -106,7 +106,7 @@ Uncontrolled checkbox can be used with `defaultState` prop.

<PropsTable
data={[
{ name: "size", themeKey: "checkbox.icon.size", default: "md" },
{ name: "size", themeKey: "checkbox.size", default: "md" },
{
name: "disabled",
type: "boolean",
Expand Down
8 changes: 4 additions & 4 deletions pages/docs/components/forms/input.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
useInputProps,
useInputState,
InputWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -35,7 +35,7 @@ import {
<InteractiveCodeblock
children={({ spreadProps }) => `<Input placeholder="Search" ${spreadProps}/>`}
booleanProps={["disabled", "invalid", "loading"]}
themeProps={{ variant: "input.base.variant", size: "input.base.size" }}
themeProps={{ variant: "input.variant", size: "input.size" }}
/>

## Input Variants
Expand Down Expand Up @@ -94,8 +94,8 @@ Prefix is positioned absolutely within the input.

<PropsTable
data={[
{ name: "size", themeKey: "input.base.size", default: "md" },
{ name: "variant", themeKey: "input.base.variant", default: "outline" },
{ name: "size", themeKey: "input.size", default: "md" },
{ name: "variant", themeKey: "input.variant", default: "outline" },
{
name: "disabled",
type: "boolean",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/radio-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
useRadioGroupState,
RadioGroupWrapper,
RadioShowMore,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -40,7 +40,7 @@ import {
<Radio value="grapes" label="Grapes" />
</RadioGroup>
`}
themeProps={{ size: "radio.icon.size" }}
themeProps={{ size: "radio.size" }}
/>

## RadioGroup sizes
Expand Down Expand Up @@ -136,7 +136,7 @@ render (<RadioGroupStack/>); `} />

<PropsTable
data={[
{ name: "size", themeKey: "radio.icon.size", default: "md" },
{ name: "size", themeKey: "radio.size", default: "md" },
{
name: "stack",
type: "string",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/radio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
useRadioProps,
useRadioState,
RadioText,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -39,7 +39,7 @@ import {
`<Radio value="apple" label="Apple" ${spreadProps} />`
}
booleanProps={["disabled"]}
themeProps={{ size: "radio.icon.size" }}
themeProps={{ size: "radio.size" }}
/>

## Radio sizes
Expand Down Expand Up @@ -101,7 +101,7 @@ Radio can be controlled using `state` prop.

<PropsTable
data={[
{ name: "size", themeKey: "radio.icon.size", default: "md" },
{ name: "size", themeKey: "radio.size", default: "md" },
{
name: "disabled",
type: "boolean",
Expand Down
8 changes: 4 additions & 4 deletions pages/docs/components/forms/select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
useSelectProps,
useSelectState,
SelectWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -45,7 +45,7 @@ import {
<option value="goldfish">Goldfish</option>
</Select>`}
booleanProps={["disabled", "invalid", "loading"]}
themeProps={{ variant: "select.base.variant", size: "select.base.size" }}
themeProps={{ variant: "select.variant", size: "select.size" }}
/>

## Select Variants
Expand Down Expand Up @@ -145,8 +145,8 @@ can change the default `suffix` component aswell.

<PropsTable
data={[
{ name: "size", themeKey: "select.base.size", default: "md" },
{ name: "variant", themeKey: "select.base.variant", default: "outline" },
{ name: "size", themeKey: "select.size", default: "md" },
{ name: "variant", themeKey: "select.variant", default: "outline" },
{
name: "disabled",
type: "boolean",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/slider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
SliderTrack,
SliderTrackWrapper,
SliderWrapper,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -43,7 +43,7 @@ import {
`<Slider defaultValue={[50]} ${spreadProps} />`
}
booleanProps={["tooltip", "isDisabled"]}
themeProps={{ size: "slider.track.base.size" }}
themeProps={{ size: "slider.size" }}
/>

## Slider sizes
Expand Down Expand Up @@ -114,7 +114,7 @@ Single Slider can be converted to a range slider using `range` prop.

<PropsTable
data={[
{ name: "size", themeKey: "slider.track.base.size", default: "md" },
{ name: "size", themeKey: "slider.size", default: "md" },
{
name: "isDisabled",
type: "boolean",
Expand Down
6 changes: 3 additions & 3 deletions pages/docs/components/forms/switch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
useSwitchProps,
useSwitchState,
SwitchText,
} from "@renderlesskit/react-tailwind";
} from "@adaptui/react-tailwind";
```

<Nextra.Callout>
Expand All @@ -37,7 +37,7 @@ import {
<InteractiveCodeblock
children={({ spreadProps }) => `<Switch ${spreadProps}>Label text</Switch>`}
booleanProps={["disabled"]}
themeProps={{ size: "switch.icon.size" }}
themeProps={{ size: "switch.size" }}
/>

## Switch sizes
Expand Down Expand Up @@ -101,7 +101,7 @@ Uncontrolled switch can be used with `defaultState` prop.

<PropsTable
data={[
{ name: "size", themeKey: "switch.icon.size", default: "md" },
{ name: "size", themeKey: "switch.size", default: "md" },
{
name: "disabled",
type: "boolean",
Expand Down
Loading