@openpkg-ts/ui 0.2.0 → 0.3.1
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/dist/docskit/index.js +69 -69
- package/package.json +1 -1
- package/src/styles/docskit.css +52 -52
- package/src/styles/tokens.css +62 -24
package/dist/docskit/index.js
CHANGED
|
@@ -795,7 +795,7 @@ function LanguageSelector({
|
|
|
795
795
|
/* @__PURE__ */ jsxs9("button", {
|
|
796
796
|
type: "button",
|
|
797
797
|
onClick: () => setOpen(!open),
|
|
798
|
-
className: cn("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-sm font-medium", "bg-
|
|
798
|
+
className: cn("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-sm font-medium", "bg-[var(--openpkg-bg-secondary)] hover:bg-[var(--openpkg-bg-tertiary)] text-[var(--openpkg-text-primary)] transition-colors cursor-pointer"),
|
|
799
799
|
children: [
|
|
800
800
|
selectedLanguage?.label ?? value,
|
|
801
801
|
/* @__PURE__ */ jsx19(ChevronDown, {
|
|
@@ -805,14 +805,14 @@ function LanguageSelector({
|
|
|
805
805
|
]
|
|
806
806
|
}),
|
|
807
807
|
open && /* @__PURE__ */ jsx19("div", {
|
|
808
|
-
className: cn("absolute top-full left-0 mt-1 z-50 min-w-[120px]", "bg-
|
|
808
|
+
className: cn("absolute top-full left-0 mt-1 z-50 min-w-[120px]", "bg-[var(--openpkg-bg-card)] border border-[var(--openpkg-border-subtle)] rounded-md shadow-lg overflow-hidden"),
|
|
809
809
|
children: languages.map((lang) => /* @__PURE__ */ jsx19("button", {
|
|
810
810
|
type: "button",
|
|
811
811
|
onClick: () => {
|
|
812
812
|
onChange(lang.id);
|
|
813
813
|
setOpen(false);
|
|
814
814
|
},
|
|
815
|
-
className: cn("w-full px-3 py-2 text-sm text-left transition-colors cursor-pointer", lang.id === value ? "bg-primary
|
|
815
|
+
className: cn("w-full px-3 py-2 text-sm text-left transition-colors cursor-pointer", lang.id === value ? "bg-[color-mix(in_srgb,var(--openpkg-accent-primary)_10%,transparent)] text-[var(--openpkg-accent-primary)]" : "text-[var(--openpkg-text-primary)] hover:bg-[var(--openpkg-bg-secondary)]"),
|
|
816
816
|
children: lang.label
|
|
817
817
|
}, lang.id))
|
|
818
818
|
})
|
|
@@ -932,14 +932,14 @@ function APIReferencePage({
|
|
|
932
932
|
className: cn("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", className),
|
|
933
933
|
children: [
|
|
934
934
|
/* @__PURE__ */ jsxs11("header", {
|
|
935
|
-
className: "py-8 border-b border-border",
|
|
935
|
+
className: "py-8 border-b border-[var(--openpkg-border-subtle)]",
|
|
936
936
|
children: [
|
|
937
937
|
/* @__PURE__ */ jsx21("h1", {
|
|
938
|
-
className: "text-3xl font-bold text-
|
|
938
|
+
className: "text-3xl font-bold text-[var(--openpkg-text-primary)]",
|
|
939
939
|
children: title
|
|
940
940
|
}),
|
|
941
941
|
description && /* @__PURE__ */ jsx21("div", {
|
|
942
|
-
className: "mt-4 text-lg text-muted
|
|
942
|
+
className: "mt-4 text-lg text-[var(--openpkg-text-muted)] prose prose-lg dark:prose-invert max-w-none",
|
|
943
943
|
children: description
|
|
944
944
|
})
|
|
945
945
|
]
|
|
@@ -966,7 +966,7 @@ function APISection({
|
|
|
966
966
|
}) {
|
|
967
967
|
return /* @__PURE__ */ jsx22("section", {
|
|
968
968
|
id,
|
|
969
|
-
className: cn("py-8 border-b border-border last:border-b-0", className),
|
|
969
|
+
className: cn("py-8 border-b border-[var(--openpkg-border-subtle)] last:border-b-0", className),
|
|
970
970
|
children: /* @__PURE__ */ jsxs12("div", {
|
|
971
971
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12",
|
|
972
972
|
children: [
|
|
@@ -976,11 +976,11 @@ function APISection({
|
|
|
976
976
|
/* @__PURE__ */ jsxs12("div", {
|
|
977
977
|
children: [
|
|
978
978
|
/* @__PURE__ */ jsx22("h2", {
|
|
979
|
-
className: "text-2xl font-semibold text-
|
|
979
|
+
className: "text-2xl font-semibold text-[var(--openpkg-text-primary)]",
|
|
980
980
|
children: title
|
|
981
981
|
}),
|
|
982
982
|
description && /* @__PURE__ */ jsx22("div", {
|
|
983
|
-
className: "mt-3 text-muted
|
|
983
|
+
className: "mt-3 text-[var(--openpkg-text-muted)] prose prose-sm dark:prose-invert",
|
|
984
984
|
children: description
|
|
985
985
|
})
|
|
986
986
|
]
|
|
@@ -1046,20 +1046,20 @@ var EndpointHeader = React4.forwardRef(({ className, method, path, copyable = tr
|
|
|
1046
1046
|
};
|
|
1047
1047
|
return /* @__PURE__ */ jsxs13("div", {
|
|
1048
1048
|
ref,
|
|
1049
|
-
className: cn("group flex items-center gap-3 py-2 px-3 rounded-lg bg-
|
|
1049
|
+
className: cn("group flex items-center gap-3 py-2 px-3 rounded-lg bg-[var(--openpkg-bg-secondary)] border border-[var(--openpkg-border-subtle)]", className),
|
|
1050
1050
|
...props,
|
|
1051
1051
|
children: [
|
|
1052
1052
|
/* @__PURE__ */ jsx24(EndpointBadge, {
|
|
1053
1053
|
method
|
|
1054
1054
|
}),
|
|
1055
1055
|
/* @__PURE__ */ jsx24("code", {
|
|
1056
|
-
className: "font-mono text-sm text-
|
|
1056
|
+
className: "font-mono text-sm text-[var(--openpkg-text-primary)] flex-1",
|
|
1057
1057
|
children: path
|
|
1058
1058
|
}),
|
|
1059
1059
|
copyable && /* @__PURE__ */ jsx24("button", {
|
|
1060
1060
|
type: "button",
|
|
1061
1061
|
onClick: handleCopy,
|
|
1062
|
-
className: cn("p-1.5 rounded text-muted
|
|
1062
|
+
className: cn("p-1.5 rounded text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)]", "opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"),
|
|
1063
1063
|
"aria-label": "Copy path",
|
|
1064
1064
|
children: copied ? /* @__PURE__ */ jsx24(Check2, {
|
|
1065
1065
|
size: 14
|
|
@@ -1088,7 +1088,7 @@ function NestedProperty({
|
|
|
1088
1088
|
const hasNested = schema.properties && Object.keys(schema.properties).length > 0;
|
|
1089
1089
|
const _nestedCount = hasNested && schema.properties ? Object.keys(schema.properties).length : 0;
|
|
1090
1090
|
return /* @__PURE__ */ jsxs14("div", {
|
|
1091
|
-
className: cn("border-t border-border first:border-t-0", depth > 0 && "ml-4"),
|
|
1091
|
+
className: cn("border-t border-[var(--openpkg-border-subtle)] first:border-t-0", depth > 0 && "ml-4"),
|
|
1092
1092
|
children: [
|
|
1093
1093
|
/* @__PURE__ */ jsx25("div", {
|
|
1094
1094
|
className: "group py-4",
|
|
@@ -1098,7 +1098,7 @@ function NestedProperty({
|
|
|
1098
1098
|
hasNested ? /* @__PURE__ */ jsx25("button", {
|
|
1099
1099
|
type: "button",
|
|
1100
1100
|
onClick: () => setExpanded(!expanded),
|
|
1101
|
-
className: "mt-0.5 p-0.5 text-muted
|
|
1101
|
+
className: "mt-0.5 p-0.5 text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] transition-colors cursor-pointer",
|
|
1102
1102
|
"aria-label": expanded ? "Collapse" : "Expand",
|
|
1103
1103
|
children: /* @__PURE__ */ jsx25(ChevronRight, {
|
|
1104
1104
|
size: 14,
|
|
@@ -1114,29 +1114,29 @@ function NestedProperty({
|
|
|
1114
1114
|
className: "flex items-center gap-2 flex-wrap",
|
|
1115
1115
|
children: [
|
|
1116
1116
|
/* @__PURE__ */ jsxs14("span", {
|
|
1117
|
-
className: "font-mono text-sm font-medium text-
|
|
1117
|
+
className: "font-mono text-sm font-medium text-[var(--openpkg-text-primary)]",
|
|
1118
1118
|
children: [
|
|
1119
1119
|
name,
|
|
1120
1120
|
!required && /* @__PURE__ */ jsx25("span", {
|
|
1121
|
-
className: "text-muted
|
|
1121
|
+
className: "text-[var(--openpkg-text-muted)]",
|
|
1122
1122
|
children: "?"
|
|
1123
1123
|
})
|
|
1124
1124
|
]
|
|
1125
1125
|
}),
|
|
1126
1126
|
/* @__PURE__ */ jsx25("span", {
|
|
1127
|
-
className: "font-mono text-xs text-muted
|
|
1127
|
+
className: "font-mono text-xs text-[var(--openpkg-text-muted)]",
|
|
1128
1128
|
children: type
|
|
1129
1129
|
}),
|
|
1130
1130
|
hasNested && /* @__PURE__ */ jsx25("button", {
|
|
1131
1131
|
type: "button",
|
|
1132
1132
|
onClick: () => setExpanded(!expanded),
|
|
1133
|
-
className: "text-xs text-
|
|
1133
|
+
className: "text-xs text-[var(--openpkg-accent-link)] hover:underline cursor-pointer",
|
|
1134
1134
|
children: "Show child parameters"
|
|
1135
1135
|
}),
|
|
1136
1136
|
/* @__PURE__ */ jsx25("button", {
|
|
1137
1137
|
type: "button",
|
|
1138
1138
|
onClick: () => copy(name),
|
|
1139
|
-
className: "p-1 rounded text-muted
|
|
1139
|
+
className: "p-1 rounded text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",
|
|
1140
1140
|
"aria-label": "Copy name",
|
|
1141
1141
|
children: copied ? /* @__PURE__ */ jsx25(Check3, {
|
|
1142
1142
|
size: 12
|
|
@@ -1147,7 +1147,7 @@ function NestedProperty({
|
|
|
1147
1147
|
]
|
|
1148
1148
|
}),
|
|
1149
1149
|
schema.description && /* @__PURE__ */ jsx25("p", {
|
|
1150
|
-
className: "text-sm text-muted
|
|
1150
|
+
className: "text-sm text-[var(--openpkg-text-muted)] mt-1",
|
|
1151
1151
|
children: schema.description
|
|
1152
1152
|
})
|
|
1153
1153
|
]
|
|
@@ -1156,7 +1156,7 @@ function NestedProperty({
|
|
|
1156
1156
|
})
|
|
1157
1157
|
}),
|
|
1158
1158
|
hasNested && expanded && schema.properties && /* @__PURE__ */ jsx25("div", {
|
|
1159
|
-
className: "border-l border-border ml-2 mb-3",
|
|
1159
|
+
className: "border-l border-[var(--openpkg-border-subtle)] ml-2 mb-3",
|
|
1160
1160
|
children: Object.entries(schema.properties).map(([propName, propSchema]) => /* @__PURE__ */ jsx25(NestedProperty, {
|
|
1161
1161
|
name: propName,
|
|
1162
1162
|
schema: propSchema,
|
|
@@ -1181,7 +1181,7 @@ function APIParameterItem({
|
|
|
1181
1181
|
const hasNested = children?.properties && Object.keys(children.properties).length > 0;
|
|
1182
1182
|
const _nestedCount = hasNested && children?.properties ? Object.keys(children.properties).length : 0;
|
|
1183
1183
|
return /* @__PURE__ */ jsxs14("div", {
|
|
1184
|
-
className: cn("border-b border-border last:border-b-0", className),
|
|
1184
|
+
className: cn("border-b border-[var(--openpkg-border-subtle)] last:border-b-0", className),
|
|
1185
1185
|
children: [
|
|
1186
1186
|
/* @__PURE__ */ jsx25("div", {
|
|
1187
1187
|
className: "group py-4",
|
|
@@ -1191,7 +1191,7 @@ function APIParameterItem({
|
|
|
1191
1191
|
hasNested ? /* @__PURE__ */ jsx25("button", {
|
|
1192
1192
|
type: "button",
|
|
1193
1193
|
onClick: () => setExpanded(!expanded),
|
|
1194
|
-
className: "mt-0.5 p-0.5 text-muted
|
|
1194
|
+
className: "mt-0.5 p-0.5 text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] transition-colors cursor-pointer",
|
|
1195
1195
|
"aria-label": expanded ? "Collapse" : "Expand",
|
|
1196
1196
|
children: /* @__PURE__ */ jsx25(ChevronRight, {
|
|
1197
1197
|
size: 14,
|
|
@@ -1207,27 +1207,27 @@ function APIParameterItem({
|
|
|
1207
1207
|
className: "flex items-center gap-2 flex-wrap",
|
|
1208
1208
|
children: [
|
|
1209
1209
|
/* @__PURE__ */ jsx25("span", {
|
|
1210
|
-
className: "font-mono text-sm font-medium text-
|
|
1210
|
+
className: "font-mono text-sm font-medium text-[var(--openpkg-text-primary)]",
|
|
1211
1211
|
children: name
|
|
1212
1212
|
}),
|
|
1213
1213
|
required && /* @__PURE__ */ jsx25("span", {
|
|
1214
|
-
className: "text-[10px] font-semibold px-1.5 py-0.5 rounded border border-border bg-
|
|
1214
|
+
className: "text-[10px] font-semibold px-1.5 py-0.5 rounded border border-[var(--openpkg-border-subtle)] bg-[var(--openpkg-bg-badge)] text-[var(--openpkg-text-muted)] uppercase tracking-wide",
|
|
1215
1215
|
children: "Required"
|
|
1216
1216
|
}),
|
|
1217
1217
|
/* @__PURE__ */ jsx25("span", {
|
|
1218
|
-
className: "font-mono text-xs text-muted
|
|
1218
|
+
className: "font-mono text-xs text-[var(--openpkg-text-muted)]",
|
|
1219
1219
|
children: type
|
|
1220
1220
|
}),
|
|
1221
1221
|
hasNested && /* @__PURE__ */ jsx25("button", {
|
|
1222
1222
|
type: "button",
|
|
1223
1223
|
onClick: () => setExpanded(!expanded),
|
|
1224
|
-
className: "text-xs text-
|
|
1224
|
+
className: "text-xs text-[var(--openpkg-accent-link)] hover:underline cursor-pointer",
|
|
1225
1225
|
children: "Show child parameters"
|
|
1226
1226
|
}),
|
|
1227
1227
|
/* @__PURE__ */ jsx25("button", {
|
|
1228
1228
|
type: "button",
|
|
1229
1229
|
onClick: () => copy(name),
|
|
1230
|
-
className: "p-1 rounded text-muted
|
|
1230
|
+
className: "p-1 rounded text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",
|
|
1231
1231
|
"aria-label": "Copy name",
|
|
1232
1232
|
children: copied ? /* @__PURE__ */ jsx25(Check3, {
|
|
1233
1233
|
size: 12
|
|
@@ -1238,7 +1238,7 @@ function APIParameterItem({
|
|
|
1238
1238
|
]
|
|
1239
1239
|
}),
|
|
1240
1240
|
description && /* @__PURE__ */ jsx25("p", {
|
|
1241
|
-
className: "text-sm text-muted
|
|
1241
|
+
className: "text-sm text-[var(--openpkg-text-muted)] mt-1",
|
|
1242
1242
|
children: description
|
|
1243
1243
|
})
|
|
1244
1244
|
]
|
|
@@ -1247,7 +1247,7 @@ function APIParameterItem({
|
|
|
1247
1247
|
})
|
|
1248
1248
|
}),
|
|
1249
1249
|
hasNested && expanded && children?.properties && /* @__PURE__ */ jsx25("div", {
|
|
1250
|
-
className: "border-l border-border ml-2 mb-3",
|
|
1250
|
+
className: "border-l border-[var(--openpkg-border-subtle)] ml-2 mb-3",
|
|
1251
1251
|
children: Object.entries(children.properties).map(([propName, propSchema]) => /* @__PURE__ */ jsx25(NestedProperty, {
|
|
1252
1252
|
name: propName,
|
|
1253
1253
|
schema: propSchema,
|
|
@@ -1279,17 +1279,17 @@ function ParameterList({
|
|
|
1279
1279
|
className: cn("", className),
|
|
1280
1280
|
children: [
|
|
1281
1281
|
title && /* @__PURE__ */ jsx26("h3", {
|
|
1282
|
-
className: "text-sm font-medium text-
|
|
1282
|
+
className: "text-sm font-medium text-[var(--openpkg-text-primary)] mb-3 uppercase tracking-wide",
|
|
1283
1283
|
children: title
|
|
1284
1284
|
}),
|
|
1285
1285
|
/* @__PURE__ */ jsx26("div", {
|
|
1286
|
-
className: "divide-y divide-border border-t border-b border-border",
|
|
1286
|
+
className: "divide-y divide-[var(--openpkg-border-subtle)] border-t border-b border-[var(--openpkg-border-subtle)]",
|
|
1287
1287
|
children: visibleChildren
|
|
1288
1288
|
}),
|
|
1289
1289
|
shouldCollapse && !expanded && /* @__PURE__ */ jsxs15("button", {
|
|
1290
1290
|
type: "button",
|
|
1291
1291
|
onClick: () => setExpanded(true),
|
|
1292
|
-
className: "flex items-center gap-1 mt-3 text-sm text-
|
|
1292
|
+
className: "flex items-center gap-1 mt-3 text-sm text-[var(--openpkg-accent-link)] hover:underline cursor-pointer",
|
|
1293
1293
|
children: [
|
|
1294
1294
|
/* @__PURE__ */ jsx26(ChevronDown2, {
|
|
1295
1295
|
size: 14
|
|
@@ -1315,19 +1315,19 @@ function ResponseBlock({ data, title, className }) {
|
|
|
1315
1315
|
copy(jsonString);
|
|
1316
1316
|
};
|
|
1317
1317
|
return /* @__PURE__ */ jsxs16("div", {
|
|
1318
|
-
className: cn("group rounded-lg border border-border overflow-hidden bg-
|
|
1318
|
+
className: cn("group rounded-lg border border-[var(--openpkg-border-subtle)] overflow-hidden bg-[var(--openpkg-bg-secondary)]", className),
|
|
1319
1319
|
children: [
|
|
1320
1320
|
title && /* @__PURE__ */ jsxs16("div", {
|
|
1321
|
-
className: "flex items-center justify-between px-4 py-2 border-b border-border bg-
|
|
1321
|
+
className: "flex items-center justify-between px-4 py-2 border-b border-[var(--openpkg-border-subtle)] bg-[var(--openpkg-bg-tertiary)]",
|
|
1322
1322
|
children: [
|
|
1323
1323
|
/* @__PURE__ */ jsx27("span", {
|
|
1324
|
-
className: "text-xs font-medium text-muted
|
|
1324
|
+
className: "text-xs font-medium text-[var(--openpkg-text-muted)] uppercase tracking-wide",
|
|
1325
1325
|
children: title
|
|
1326
1326
|
}),
|
|
1327
1327
|
/* @__PURE__ */ jsx27("button", {
|
|
1328
1328
|
type: "button",
|
|
1329
1329
|
onClick: handleCopy,
|
|
1330
|
-
className: "p-1 rounded text-muted
|
|
1330
|
+
className: "p-1 rounded text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",
|
|
1331
1331
|
"aria-label": "Copy response",
|
|
1332
1332
|
children: copied ? /* @__PURE__ */ jsx27(Check4, {
|
|
1333
1333
|
size: 14
|
|
@@ -1351,7 +1351,7 @@ function ResponseBlock({ data, title, className }) {
|
|
|
1351
1351
|
!title && /* @__PURE__ */ jsx27("button", {
|
|
1352
1352
|
type: "button",
|
|
1353
1353
|
onClick: handleCopy,
|
|
1354
|
-
className: "absolute top-3 right-3 p-1.5 rounded text-muted
|
|
1354
|
+
className: "absolute top-3 right-3 p-1.5 rounded text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)] opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",
|
|
1355
1355
|
"aria-label": "Copy response",
|
|
1356
1356
|
children: copied ? /* @__PURE__ */ jsx27(Check4, {
|
|
1357
1357
|
size: 14
|
|
@@ -1369,25 +1369,25 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1369
1369
|
const nextIndent = " ".repeat(depth + 1);
|
|
1370
1370
|
if (json === null) {
|
|
1371
1371
|
return /* @__PURE__ */ jsx27("span", {
|
|
1372
|
-
className: "text-
|
|
1372
|
+
className: "text-[var(--openpkg-syn-number)]",
|
|
1373
1373
|
children: "null"
|
|
1374
1374
|
});
|
|
1375
1375
|
}
|
|
1376
1376
|
if (typeof json === "boolean") {
|
|
1377
1377
|
return /* @__PURE__ */ jsx27("span", {
|
|
1378
|
-
className: "text-
|
|
1378
|
+
className: "text-[var(--openpkg-syn-boolean)]",
|
|
1379
1379
|
children: json ? "true" : "false"
|
|
1380
1380
|
});
|
|
1381
1381
|
}
|
|
1382
1382
|
if (typeof json === "number") {
|
|
1383
1383
|
return /* @__PURE__ */ jsx27("span", {
|
|
1384
|
-
className: "text-
|
|
1384
|
+
className: "text-[var(--openpkg-syn-number)]",
|
|
1385
1385
|
children: json
|
|
1386
1386
|
});
|
|
1387
1387
|
}
|
|
1388
1388
|
if (typeof json === "string") {
|
|
1389
1389
|
return /* @__PURE__ */ jsxs16("span", {
|
|
1390
|
-
className: "text-
|
|
1390
|
+
className: "text-[var(--openpkg-syn-string)]",
|
|
1391
1391
|
children: [
|
|
1392
1392
|
'"',
|
|
1393
1393
|
json,
|
|
@@ -1398,14 +1398,14 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1398
1398
|
if (Array.isArray(json)) {
|
|
1399
1399
|
if (json.length === 0) {
|
|
1400
1400
|
return /* @__PURE__ */ jsx27("span", {
|
|
1401
|
-
className: "text-
|
|
1401
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1402
1402
|
children: "[]"
|
|
1403
1403
|
});
|
|
1404
1404
|
}
|
|
1405
1405
|
return /* @__PURE__ */ jsxs16(Fragment4, {
|
|
1406
1406
|
children: [
|
|
1407
1407
|
/* @__PURE__ */ jsx27("span", {
|
|
1408
|
-
className: "text-
|
|
1408
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1409
1409
|
children: "["
|
|
1410
1410
|
}),
|
|
1411
1411
|
`
|
|
@@ -1418,7 +1418,7 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1418
1418
|
depth: depth + 1
|
|
1419
1419
|
}),
|
|
1420
1420
|
i < json.length - 1 && /* @__PURE__ */ jsx27("span", {
|
|
1421
|
-
className: "text-
|
|
1421
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1422
1422
|
children: ","
|
|
1423
1423
|
}),
|
|
1424
1424
|
`
|
|
@@ -1427,7 +1427,7 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1427
1427
|
}, i)),
|
|
1428
1428
|
indent,
|
|
1429
1429
|
/* @__PURE__ */ jsx27("span", {
|
|
1430
|
-
className: "text-
|
|
1430
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1431
1431
|
children: "]"
|
|
1432
1432
|
})
|
|
1433
1433
|
]
|
|
@@ -1437,14 +1437,14 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1437
1437
|
const entries = Object.entries(json);
|
|
1438
1438
|
if (entries.length === 0) {
|
|
1439
1439
|
return /* @__PURE__ */ jsx27("span", {
|
|
1440
|
-
className: "text-
|
|
1440
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1441
1441
|
children: "{}"
|
|
1442
1442
|
});
|
|
1443
1443
|
}
|
|
1444
1444
|
return /* @__PURE__ */ jsxs16(Fragment4, {
|
|
1445
1445
|
children: [
|
|
1446
1446
|
/* @__PURE__ */ jsx27("span", {
|
|
1447
|
-
className: "text-
|
|
1447
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1448
1448
|
children: "{"
|
|
1449
1449
|
}),
|
|
1450
1450
|
`
|
|
@@ -1453,7 +1453,7 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1453
1453
|
children: [
|
|
1454
1454
|
nextIndent,
|
|
1455
1455
|
/* @__PURE__ */ jsxs16("span", {
|
|
1456
|
-
className: "text-
|
|
1456
|
+
className: "text-[var(--openpkg-syn-property)]",
|
|
1457
1457
|
children: [
|
|
1458
1458
|
'"',
|
|
1459
1459
|
key,
|
|
@@ -1461,7 +1461,7 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1461
1461
|
]
|
|
1462
1462
|
}),
|
|
1463
1463
|
/* @__PURE__ */ jsx27("span", {
|
|
1464
|
-
className: "text-
|
|
1464
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1465
1465
|
children: ": "
|
|
1466
1466
|
}),
|
|
1467
1467
|
/* @__PURE__ */ jsx27(JsonHighlight, {
|
|
@@ -1469,7 +1469,7 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1469
1469
|
depth: depth + 1
|
|
1470
1470
|
}),
|
|
1471
1471
|
i < entries.length - 1 && /* @__PURE__ */ jsx27("span", {
|
|
1472
|
-
className: "text-
|
|
1472
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1473
1473
|
children: ","
|
|
1474
1474
|
}),
|
|
1475
1475
|
`
|
|
@@ -1478,14 +1478,14 @@ function JsonHighlight({ json, depth = 0 }) {
|
|
|
1478
1478
|
}, key)),
|
|
1479
1479
|
indent,
|
|
1480
1480
|
/* @__PURE__ */ jsx27("span", {
|
|
1481
|
-
className: "text-
|
|
1481
|
+
className: "text-[var(--openpkg-syn-punctuation)]",
|
|
1482
1482
|
children: "}"
|
|
1483
1483
|
})
|
|
1484
1484
|
]
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
1487
|
return /* @__PURE__ */ jsx27("span", {
|
|
1488
|
-
className: "text-
|
|
1488
|
+
className: "text-[var(--openpkg-text-primary)]",
|
|
1489
1489
|
children: String(json)
|
|
1490
1490
|
});
|
|
1491
1491
|
}
|
|
@@ -1701,7 +1701,7 @@ function TabsList({
|
|
|
1701
1701
|
}) {
|
|
1702
1702
|
return /* @__PURE__ */ jsx31(TabsPrimitive.List, {
|
|
1703
1703
|
"data-slot": "tabs-list",
|
|
1704
|
-
className: cn("bg-
|
|
1704
|
+
className: cn("bg-[var(--openpkg-bg-secondary)] text-[var(--openpkg-text-muted)] inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className),
|
|
1705
1705
|
...props
|
|
1706
1706
|
});
|
|
1707
1707
|
}
|
|
@@ -1711,7 +1711,7 @@ function TabsTrigger({
|
|
|
1711
1711
|
}) {
|
|
1712
1712
|
return /* @__PURE__ */ jsx31(TabsPrimitive.Trigger, {
|
|
1713
1713
|
"data-slot": "tabs-trigger",
|
|
1714
|
-
className: cn("
|
|
1714
|
+
className: cn("data-[state=active]:text-[var(--openpkg-text-primary)] focus-visible:ring-[var(--openpkg-accent-primary)] focus-visible:outline-[var(--openpkg-accent-primary)] text-[var(--openpkg-text-muted)] inline-flex h-full flex-1 items-center justify-center gap-1.5 px-2 py-1 text-sm font-normal whitespace-nowrap transition-colors focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
1715
1715
|
...props
|
|
1716
1716
|
});
|
|
1717
1717
|
}
|
|
@@ -2598,16 +2598,16 @@ function ImportSection({ importStatement, className }) {
|
|
|
2598
2598
|
copy(importStatement);
|
|
2599
2599
|
};
|
|
2600
2600
|
return /* @__PURE__ */ jsxs24("div", {
|
|
2601
|
-
className: cn("group flex items-center justify-between gap-3", "rounded-lg border border-border bg-
|
|
2601
|
+
className: cn("group flex items-center justify-between gap-3", "rounded-lg border border-[var(--openpkg-border-subtle)] bg-[var(--openpkg-bg-secondary)] px-4 py-3", className),
|
|
2602
2602
|
children: [
|
|
2603
2603
|
/* @__PURE__ */ jsx41("code", {
|
|
2604
|
-
className: "font-mono text-sm text-
|
|
2604
|
+
className: "font-mono text-sm text-[var(--openpkg-text-primary)] overflow-x-auto",
|
|
2605
2605
|
children: importStatement
|
|
2606
2606
|
}),
|
|
2607
2607
|
/* @__PURE__ */ jsx41("button", {
|
|
2608
2608
|
type: "button",
|
|
2609
2609
|
onClick: handleCopy,
|
|
2610
|
-
className: cn("shrink-0 p-1.5 rounded", "text-muted
|
|
2610
|
+
className: cn("shrink-0 p-1.5 rounded", "text-[var(--openpkg-text-muted)] hover:text-[var(--openpkg-text-primary)]", "opacity-0 group-hover:opacity-100 transition-opacity duration-200", "cursor-pointer"),
|
|
2611
2611
|
"aria-label": "Copy import statement",
|
|
2612
2612
|
children: copied ? /* @__PURE__ */ jsx41(Check7, {
|
|
2613
2613
|
size: 16
|
|
@@ -2625,17 +2625,17 @@ import { jsx as jsx42 } from "react/jsx-runtime";
|
|
|
2625
2625
|
var typeBadgeVariants = cva2("font-mono text-sm", {
|
|
2626
2626
|
variants: {
|
|
2627
2627
|
typeColor: {
|
|
2628
|
-
string: "text-
|
|
2629
|
-
number: "text-
|
|
2630
|
-
boolean: "text-
|
|
2631
|
-
null: "text-
|
|
2632
|
-
undefined: "text-
|
|
2633
|
-
object: "text-
|
|
2634
|
-
array: "text-
|
|
2635
|
-
function: "text-
|
|
2636
|
-
union: "text-
|
|
2637
|
-
generic: "text-
|
|
2638
|
-
default: "text-muted
|
|
2628
|
+
string: "text-[var(--openpkg-accent-green)]",
|
|
2629
|
+
number: "text-[var(--openpkg-accent-blue)]",
|
|
2630
|
+
boolean: "text-[var(--openpkg-accent-amber)]",
|
|
2631
|
+
null: "text-[var(--openpkg-text-muted)]",
|
|
2632
|
+
undefined: "text-[var(--openpkg-text-muted)]",
|
|
2633
|
+
object: "text-[var(--openpkg-accent-purple)]",
|
|
2634
|
+
array: "text-[var(--openpkg-accent-cyan)]",
|
|
2635
|
+
function: "text-[var(--openpkg-accent-fuchsia)]",
|
|
2636
|
+
union: "text-[var(--openpkg-accent-orange)]",
|
|
2637
|
+
generic: "text-[var(--openpkg-accent-rose)]",
|
|
2638
|
+
default: "text-[var(--openpkg-text-muted)]"
|
|
2639
2639
|
}
|
|
2640
2640
|
},
|
|
2641
2641
|
defaultVariants: {
|
package/package.json
CHANGED
package/src/styles/docskit.css
CHANGED
|
@@ -6,66 +6,66 @@
|
|
|
6
6
|
* Usage: @import '@openpkg-ts/ui/styles/docskit.css';
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
/* CodeHike
|
|
9
|
+
/* CodeHike custom theme (dark) */
|
|
10
10
|
:root {
|
|
11
11
|
--ch-0: dark;
|
|
12
|
-
--ch-1: #
|
|
13
|
-
--ch-2: #
|
|
14
|
-
--ch-3: #
|
|
15
|
-
--ch-4: #
|
|
16
|
-
--ch-5: #
|
|
17
|
-
--ch-6: #
|
|
18
|
-
--ch-7: #
|
|
19
|
-
--ch-8: #
|
|
20
|
-
--ch-9: #
|
|
21
|
-
--ch-10: #
|
|
22
|
-
--ch-11: #
|
|
23
|
-
--ch-12: #
|
|
24
|
-
--ch-13: #
|
|
25
|
-
--ch-14: #
|
|
26
|
-
--ch-15: #
|
|
27
|
-
--ch-16: #
|
|
28
|
-
--ch-17: #
|
|
12
|
+
--ch-1: #5c5c5c;
|
|
13
|
+
--ch-2: #c9555a;
|
|
14
|
+
--ch-3: #d4a553;
|
|
15
|
+
--ch-4: #d4d4d4;
|
|
16
|
+
--ch-5: #c4a7e7;
|
|
17
|
+
--ch-6: #d4a553;
|
|
18
|
+
--ch-7: #c9555a;
|
|
19
|
+
--ch-8: #d4a553;
|
|
20
|
+
--ch-9: #c9555a;
|
|
21
|
+
--ch-10: #2a2a2a;
|
|
22
|
+
--ch-11: #3a1515;
|
|
23
|
+
--ch-12: #1a2a1a;
|
|
24
|
+
--ch-13: #3a2a15;
|
|
25
|
+
--ch-14: #1e1e1e;
|
|
26
|
+
--ch-15: #5c5c5c;
|
|
27
|
+
--ch-16: #1a1a1a;
|
|
28
|
+
--ch-17: #3a3a3a1a;
|
|
29
29
|
--ch-18: #ffffff0b;
|
|
30
|
-
--ch-19: #
|
|
31
|
-
--ch-20: #
|
|
32
|
-
--ch-21: #
|
|
33
|
-
--ch-22: #
|
|
34
|
-
--ch-23: #
|
|
35
|
-
--ch-24: #
|
|
36
|
-
--ch-25: #
|
|
37
|
-
--ch-26: #
|
|
30
|
+
--ch-19: #c9555a;
|
|
31
|
+
--ch-20: #3a3a5a;
|
|
32
|
+
--ch-21: #c9555a;
|
|
33
|
+
--ch-22: #141414;
|
|
34
|
+
--ch-23: #2a2a2a;
|
|
35
|
+
--ch-24: #4a4a4a;
|
|
36
|
+
--ch-25: #4a4a4a66;
|
|
37
|
+
--ch-26: #1a1a1ae6;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/* CodeHike
|
|
40
|
+
/* CodeHike custom theme (light) */
|
|
41
41
|
[data-theme="light"] {
|
|
42
42
|
--ch-0: light;
|
|
43
|
-
--ch-1: #
|
|
44
|
-
--ch-2: #
|
|
45
|
-
--ch-3: #
|
|
46
|
-
--ch-4: #
|
|
47
|
-
--ch-5: #
|
|
48
|
-
--ch-6: #
|
|
49
|
-
--ch-7: #
|
|
50
|
-
--ch-8: #
|
|
51
|
-
--ch-9: #
|
|
52
|
-
--ch-10: #
|
|
53
|
-
--ch-11: #
|
|
54
|
-
--ch-12: #
|
|
55
|
-
--ch-13: #
|
|
56
|
-
--ch-14: #
|
|
57
|
-
--ch-15: #
|
|
58
|
-
--ch-16: #
|
|
59
|
-
--ch-17: #
|
|
43
|
+
--ch-1: #999999;
|
|
44
|
+
--ch-2: #c9555a;
|
|
45
|
+
--ch-3: #b8860b;
|
|
46
|
+
--ch-4: #3a3a3a;
|
|
47
|
+
--ch-5: #7c3aed;
|
|
48
|
+
--ch-6: #b8860b;
|
|
49
|
+
--ch-7: #c9555a;
|
|
50
|
+
--ch-8: #b8860b;
|
|
51
|
+
--ch-9: #c9555a;
|
|
52
|
+
--ch-10: #ebebeb;
|
|
53
|
+
--ch-11: #fde8e8;
|
|
54
|
+
--ch-12: #e8f5e8;
|
|
55
|
+
--ch-13: #fdf0d5;
|
|
56
|
+
--ch-14: #e8e8e8;
|
|
57
|
+
--ch-15: #999999;
|
|
58
|
+
--ch-16: #f5f5f5;
|
|
59
|
+
--ch-17: #d0d0d080;
|
|
60
60
|
--ch-18: #fdff0033;
|
|
61
|
-
--ch-19: #
|
|
62
|
-
--ch-20: #
|
|
63
|
-
--ch-21: #
|
|
64
|
-
--ch-22: #
|
|
65
|
-
--ch-23: #
|
|
66
|
-
--ch-24: #
|
|
67
|
-
--ch-25: #
|
|
68
|
-
--ch-26: #
|
|
61
|
+
--ch-19: #c9555a;
|
|
62
|
+
--ch-20: #d0d0e0;
|
|
63
|
+
--ch-21: #c9555a;
|
|
64
|
+
--ch-22: #ebebeb;
|
|
65
|
+
--ch-23: #e0e0e0;
|
|
66
|
+
--ch-24: #b0b0b0;
|
|
67
|
+
--ch-25: #b0b0b033;
|
|
68
|
+
--ch-26: #f5f5f5e6;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/* dk-* Tailwind v4 color theme (maps to --ch-* vars) */
|
package/src/styles/tokens.css
CHANGED
|
@@ -25,21 +25,35 @@
|
|
|
25
25
|
--openpkg-text-code: #1a1a1a;
|
|
26
26
|
|
|
27
27
|
/* Syntax highlighting — light */
|
|
28
|
-
--openpkg-syn-keyword: #
|
|
29
|
-
--openpkg-syn-string: #
|
|
30
|
-
--openpkg-syn-function: #
|
|
28
|
+
--openpkg-syn-keyword: #c9555a;
|
|
29
|
+
--openpkg-syn-string: #b8860b;
|
|
30
|
+
--openpkg-syn-function: #1a1a1a;
|
|
31
31
|
--openpkg-syn-property: #7c3aed;
|
|
32
|
-
--openpkg-syn-variable: #
|
|
33
|
-
--openpkg-syn-punctuation: #
|
|
34
|
-
--openpkg-syn-number: #
|
|
35
|
-
--openpkg-syn-boolean: #
|
|
36
|
-
--openpkg-syn-comment: #
|
|
32
|
+
--openpkg-syn-variable: #3a3a3a;
|
|
33
|
+
--openpkg-syn-punctuation: #999999;
|
|
34
|
+
--openpkg-syn-number: #b8860b;
|
|
35
|
+
--openpkg-syn-boolean: #c9555a;
|
|
36
|
+
--openpkg-syn-comment: #999999;
|
|
37
37
|
|
|
38
38
|
/* Accent colors */
|
|
39
39
|
--openpkg-accent-green: #16a34a;
|
|
40
40
|
--openpkg-accent-blue: #2563eb;
|
|
41
41
|
--openpkg-accent-purple: #7c3aed;
|
|
42
|
+
--openpkg-accent-red: #dc2626;
|
|
43
|
+
--openpkg-accent-yellow: #ca8a04;
|
|
44
|
+
--openpkg-accent-amber: #d97706;
|
|
45
|
+
--openpkg-accent-cyan: #0891b2;
|
|
46
|
+
--openpkg-accent-rose: #e11d48;
|
|
47
|
+
--openpkg-accent-fuchsia: #c026d3;
|
|
48
|
+
--openpkg-accent-orange: #ea580c;
|
|
42
49
|
--openpkg-accent-link: #2563eb;
|
|
50
|
+
--openpkg-accent-primary: #2563eb;
|
|
51
|
+
--openpkg-text-on-primary: #ffffff;
|
|
52
|
+
|
|
53
|
+
/* Card / surface colors */
|
|
54
|
+
--openpkg-bg-card: #ffffff;
|
|
55
|
+
--openpkg-bg-card-hover: #fafafa;
|
|
56
|
+
--openpkg-bg-input: #ffffff;
|
|
43
57
|
|
|
44
58
|
/* Border colors */
|
|
45
59
|
--openpkg-border-subtle: #e5e5e5;
|
|
@@ -82,20 +96,32 @@
|
|
|
82
96
|
--openpkg-accent-green: #3ecf8e;
|
|
83
97
|
--openpkg-accent-blue: #6cb6ff;
|
|
84
98
|
--openpkg-accent-purple: #c4a7e7;
|
|
99
|
+
--openpkg-accent-red: #f87171;
|
|
100
|
+
--openpkg-accent-yellow: #facc15;
|
|
101
|
+
--openpkg-accent-amber: #fbbf24;
|
|
102
|
+
--openpkg-accent-cyan: #22d3ee;
|
|
103
|
+
--openpkg-accent-rose: #fb7185;
|
|
104
|
+
--openpkg-accent-fuchsia: #e879f9;
|
|
105
|
+
--openpkg-accent-orange: #fb923c;
|
|
85
106
|
--openpkg-accent-link: #6cb6ff;
|
|
107
|
+
--openpkg-accent-primary: #6cb6ff;
|
|
108
|
+
--openpkg-text-on-primary: #ffffff;
|
|
109
|
+
--openpkg-bg-card: #141414;
|
|
110
|
+
--openpkg-bg-card-hover: #1a1a1a;
|
|
111
|
+
--openpkg-bg-input: #171717;
|
|
86
112
|
--openpkg-border-subtle: #262626;
|
|
87
113
|
--openpkg-border-medium: #333333;
|
|
88
114
|
--openpkg-border-chip: #333333;
|
|
89
115
|
--openpkg-border-chip-active: #666666;
|
|
90
|
-
--openpkg-syn-keyword: #
|
|
91
|
-
--openpkg-syn-string: #
|
|
92
|
-
--openpkg-syn-function: #
|
|
116
|
+
--openpkg-syn-keyword: #c9555a;
|
|
117
|
+
--openpkg-syn-string: #d4a553;
|
|
118
|
+
--openpkg-syn-function: #e0e0e0;
|
|
93
119
|
--openpkg-syn-property: #c4a7e7;
|
|
94
|
-
--openpkg-syn-variable: #
|
|
95
|
-
--openpkg-syn-punctuation: #
|
|
96
|
-
--openpkg-syn-number: #
|
|
97
|
-
--openpkg-syn-boolean: #
|
|
98
|
-
--openpkg-syn-comment: #
|
|
120
|
+
--openpkg-syn-variable: #d4d4d4;
|
|
121
|
+
--openpkg-syn-punctuation: #6b6b6b;
|
|
122
|
+
--openpkg-syn-number: #d4a553;
|
|
123
|
+
--openpkg-syn-boolean: #c9555a;
|
|
124
|
+
--openpkg-syn-comment: #5c5c5c;
|
|
99
125
|
}
|
|
100
126
|
|
|
101
127
|
/* Dark mode — system preference */
|
|
@@ -117,20 +143,32 @@
|
|
|
117
143
|
--openpkg-accent-green: #3ecf8e;
|
|
118
144
|
--openpkg-accent-blue: #6cb6ff;
|
|
119
145
|
--openpkg-accent-purple: #c4a7e7;
|
|
146
|
+
--openpkg-accent-red: #f87171;
|
|
147
|
+
--openpkg-accent-yellow: #facc15;
|
|
148
|
+
--openpkg-accent-amber: #fbbf24;
|
|
149
|
+
--openpkg-accent-cyan: #22d3ee;
|
|
150
|
+
--openpkg-accent-rose: #fb7185;
|
|
151
|
+
--openpkg-accent-fuchsia: #e879f9;
|
|
152
|
+
--openpkg-accent-orange: #fb923c;
|
|
120
153
|
--openpkg-accent-link: #6cb6ff;
|
|
154
|
+
--openpkg-accent-primary: #6cb6ff;
|
|
155
|
+
--openpkg-text-on-primary: #ffffff;
|
|
156
|
+
--openpkg-bg-card: #141414;
|
|
157
|
+
--openpkg-bg-card-hover: #1a1a1a;
|
|
158
|
+
--openpkg-bg-input: #171717;
|
|
121
159
|
--openpkg-border-subtle: #262626;
|
|
122
160
|
--openpkg-border-medium: #333333;
|
|
123
161
|
--openpkg-border-chip: #333333;
|
|
124
162
|
--openpkg-border-chip-active: #666666;
|
|
125
|
-
--openpkg-syn-keyword: #
|
|
126
|
-
--openpkg-syn-string: #
|
|
127
|
-
--openpkg-syn-function: #
|
|
163
|
+
--openpkg-syn-keyword: #c9555a;
|
|
164
|
+
--openpkg-syn-string: #d4a553;
|
|
165
|
+
--openpkg-syn-function: #e0e0e0;
|
|
128
166
|
--openpkg-syn-property: #c4a7e7;
|
|
129
|
-
--openpkg-syn-variable: #
|
|
130
|
-
--openpkg-syn-punctuation: #
|
|
131
|
-
--openpkg-syn-number: #
|
|
132
|
-
--openpkg-syn-boolean: #
|
|
133
|
-
--openpkg-syn-comment: #
|
|
167
|
+
--openpkg-syn-variable: #d4d4d4;
|
|
168
|
+
--openpkg-syn-punctuation: #6b6b6b;
|
|
169
|
+
--openpkg-syn-number: #d4a553;
|
|
170
|
+
--openpkg-syn-boolean: #c9555a;
|
|
171
|
+
--openpkg-syn-comment: #5c5c5c;
|
|
134
172
|
}
|
|
135
173
|
}
|
|
136
174
|
|