@openpkg-ts/ui 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/dist/docskit/index.js +1 -1
- package/package.json +12 -4
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @openpkg-ts/ui
|
|
2
|
+
|
|
3
|
+
Low-level UI primitives for API documentation. Built with Radix UI, Tailwind CSS, and CodeHike.
|
|
4
|
+
|
|
5
|
+
Use `@openpkg-ts/react` for higher-level page components.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @openpkg-ts/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer deps: `react@^18 || ^19`, `react-dom@^18 || ^19`
|
|
14
|
+
|
|
15
|
+
## Entry Points
|
|
16
|
+
|
|
17
|
+
### `@openpkg-ts/ui/api`
|
|
18
|
+
|
|
19
|
+
Components for displaying API exports and parameters.
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { ExportCard, ParameterItem, CodeTabs, TypeBadge, ImportSection } from '@openpkg-ts/ui/api';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### `@openpkg-ts/ui/badge`
|
|
26
|
+
|
|
27
|
+
Status and kind indicator badges.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { KindBadge, StatusBadge } from '@openpkg-ts/ui/badge';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### `@openpkg-ts/ui/docskit`
|
|
34
|
+
|
|
35
|
+
Stripe-style API reference components and CodeHike integrations.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import {
|
|
39
|
+
// Page layout
|
|
40
|
+
APIReferencePage,
|
|
41
|
+
APISection,
|
|
42
|
+
ParameterList,
|
|
43
|
+
EndpointHeader,
|
|
44
|
+
ResponseBlock,
|
|
45
|
+
|
|
46
|
+
// Code blocks
|
|
47
|
+
DocsKitCode,
|
|
48
|
+
SingleCode,
|
|
49
|
+
Terminal,
|
|
50
|
+
PackageInstall,
|
|
51
|
+
CodeIcon,
|
|
52
|
+
|
|
53
|
+
// CodeHike handlers
|
|
54
|
+
addDocsKit,
|
|
55
|
+
} from '@openpkg-ts/ui/docskit';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `@openpkg-ts/ui/lib/utils`
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { cn } from '@openpkg-ts/ui/lib/utils';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
package/dist/docskit/index.js
CHANGED
|
@@ -1659,7 +1659,7 @@ function extractFlags(codeblock) {
|
|
|
1659
1659
|
const title = metaWithoutFlags.trim();
|
|
1660
1660
|
return { title, flags: flags.slice(1) };
|
|
1661
1661
|
}
|
|
1662
|
-
// src/hooks/use-
|
|
1662
|
+
// src/hooks/use-local-storage.ts
|
|
1663
1663
|
import React7 from "react";
|
|
1664
1664
|
function useStateOrLocalStorage(key, initialState) {
|
|
1665
1665
|
const [state, setState] = React7.useState(initialState);
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpkg-ts/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "UI primitives and components for OpenPkg documentation",
|
|
5
|
+
"homepage": "https://github.com/ryanwaits/openpkg-ts#readme",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ryanwaits/openpkg-ts.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
4
11
|
"type": "module",
|
|
5
12
|
"sideEffects": false,
|
|
6
13
|
"files": [
|
|
@@ -22,7 +29,8 @@
|
|
|
22
29
|
"./lib/utils": {
|
|
23
30
|
"types": "./dist/lib/utils.d.ts",
|
|
24
31
|
"import": "./dist/lib/utils.js"
|
|
25
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"./styles/tokens.css": "./src/styles/tokens.css"
|
|
26
34
|
},
|
|
27
35
|
"scripts": {
|
|
28
36
|
"build": "bunup",
|
|
@@ -44,8 +52,8 @@
|
|
|
44
52
|
"zod": "^3.25.0"
|
|
45
53
|
},
|
|
46
54
|
"peerDependencies": {
|
|
47
|
-
"react": "^19
|
|
48
|
-
"react-dom": "^19
|
|
55
|
+
"react": "^18 || ^19",
|
|
56
|
+
"react-dom": "^18 || ^19"
|
|
49
57
|
},
|
|
50
58
|
"devDependencies": {
|
|
51
59
|
"@types/react": "^19.0.0",
|