Skip to content

Commit 328e9e8

Browse files
committed
docs: Improve documentation for @spuxx/solid library
1 parent 0955190 commit 328e9e8

File tree

6 files changed

+81
-31
lines changed

6 files changed

+81
-31
lines changed

apps/starlight/src/assets/sidebar.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ export const sidebar: StarlightUserConfigWithPlugins['sidebar'] = [
4545
},
4646
{
4747
label: 'Components',
48-
autogenerate: { directory: 'solid/components' },
48+
items: [
49+
{
50+
label: 'Layout',
51+
autogenerate: { directory: 'solid/components/layout' },
52+
},
53+
],
4954
},
5055
],
5156
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: 'Divider'
3+
description: 'A library containing various production-ready components for SolidJS applications.'
4+
---
5+
6+
import TypeDoc from '@docs/solid/components/layout/divider.md';
7+
import { BaseColor, ContentColor } from '@packages/browser-utils/dist/main';
8+
import { Interactive } from '@src/components/interactive';
9+
10+
<Interactive
11+
componentName="Divider"
12+
argDefinitions={{
13+
color: {
14+
type: 'string',
15+
options: Object.values({ ...BaseColor, ...ContentColor }),
16+
},
17+
variant: {
18+
type: 'string',
19+
options: ['straight', 'sleek'],
20+
},
21+
vertical: {
22+
type: 'boolean',
23+
},
24+
}}
25+
/>
26+
27+
<TypeDoc />

apps/starlight/src/content/docs/solid/index.mdx

+2-15
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ title: 'Solid'
33
description: 'A library containing various production-ready components for SolidJS applications.'
44
---
55

6-
import { BaseColor, ContentColor } from "@packages/browser-utils/dist/main";
7-
import { Interactive } from "@src/components/interactive";
6+
import README from '@packages/solid/README.md';
87

9-
<Interactive componentName="Divider" title="Divider (horizontal)" argDefinitions={{
10-
color: {
11-
type: "string",
12-
options: Object.values({...BaseColor, ...ContentColor})
13-
},
14-
variant: {
15-
type: "string",
16-
options: ["straight", "sleek"]
17-
},
18-
vertical: {
19-
type: "boolean"
20-
}
21-
}}/>
8+
<README />

packages/solid/README.md

+41-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,45 @@
1-
## Colors and Themes
1+
# @spuxx/solid
22

3-
### Custom Colors
3+
![Main pipeline](https://github.com/spuxx-dev/jslibs/actions/workflows/main.yml/badge.svg)
4+
![Release pipeline](https://github.com/spuxx-dev/jslibs/actions/workflows/release_solid.yml/badge.svg)
5+
![npm version](https://img.shields.io/npm/v/%40spuxx%2Fsolid)
6+
![npm bundle size](https://img.shields.io/bundlephobia/min/%40spuxx%2Fsolid)
7+
![License](https://img.shields.io/github/license/spuxx-dev/jslibs)
48

5-
Types for default colors provided by `@spuxx/styles` are defined in [src/types/registry.ts](packages/solidsrc/types/registry.ts).
6-
Custom colors can be added in a type-safe way by extending the `ColorRegistry` interface.
9+
<!-- vscode-markdown-toc -->
710

8-
```ts
9-
import { Colors } from '@spuxx/solid';
11+
- [Description](#Description)
12+
- [Documentation](#Documentation)
13+
- [Installation](#Installation)
14+
- [Links](#Links)
1015

11-
declare module '@spuxx/solid' {
12-
interface ColorRegistry {
13-
myCustomColor: 'my-custom-color';
14-
}
15-
}
16-
```
16+
<!-- vscode-markdown-toc-config
17+
numbering=false
18+
autoSave=true
19+
/vscode-markdown-toc-config -->
20+
<!-- /vscode-markdown-toc -->
21+
22+
## <a name='Description'></a>Description
23+
24+
`@spuxx/solid` contains a selection of both primitive and composite components for SolidJS applications. It is primarily intended for my own use, but feel free to use it in your own projects. The components directly use the `@spuxx/browser-utils` package for styling and other utilities. In addition, the library bundles a couple of third-party components such as:
25+
26+
- [@corvu/dialog](https://corvu.dev/docs/primitives/dialog/)
27+
28+
## <a name='Documentation'></a>Documentation
29+
30+
Documentation can be found [here](https://spuxx-dev.github.io/jslibs/solid).
31+
32+
## <a name='Installation'></a>Installation
33+
34+
Depending on your package manager, run:
35+
36+
- `npm install @spuxx/solid` (npm)
37+
- `pnpm install @spuxx/solid` (pnpm)
38+
39+
## <a name='Links'></a>Links
40+
41+
- [About me](https://spuxx.dev/)
42+
- [Documentation](https://spuxx-dev.github.io/jslibs/solid)
43+
- [Source](https://github.com/spuxx-dev/jslibs)
44+
- [NPM](https://www.npmjs.com/package/@spuxx/solid)
45+
- [Buy me a coffee](https://buymeacoffee.com/spuxx) ☕️

packages/solid/src/components/layout/divider/divider.component.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { attributes, classNames } from '@src/main';
44

55
/**
66
* A divider component. Can be used to separate content. Supports vertical orientation.
7-
* Color defaults to `surface`, but can be customized with the `color` prop.
8-
* @param props
9-
* @returns
7+
* @param props {@link DividerProps}
8+
* @returns The divider component.
109
*/
1110
export const Divider: Component<DividerProps> = (props) => {
1211
const { color = 'text-subtle', variant = 'straight', vertical } = props;

packages/solid/src/components/layout/divider/divider.types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { BaseColor, ContentColor } from '@spuxx/browser-utils';
22
import { ComponentProps } from '@src/main';
33

4+
/**
5+
* The Divider component's properties.
6+
*/
47
export interface DividerProps extends ComponentProps<HTMLHRElement> {
58
/**
69
* The color of the divider.

0 commit comments

Comments
 (0)