semajsx 0.1.2 → 0.5.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/dom/jsx-dev-runtime.d.mts +1 -1
- package/dist/dom/jsx-runtime.d.mts +1 -1
- package/dist/{index-DC3tthWf.d.mts → index-Ch9GwToI.d.mts} +2 -2
- package/dist/{index-DC3tthWf.d.mts.map → index-Ch9GwToI.d.mts.map} +1 -1
- package/dist/{jsx-runtime-DZx2Yv-t.d.mts → jsx-runtime-BBi9E0Hz.d.mts} +2 -1
- package/dist/{jsx-runtime-DZx2Yv-t.d.mts.map → jsx-runtime-BBi9E0Hz.d.mts.map} +1 -1
- package/dist/jsx-runtime-D9ZNjMJ2.mjs.map +1 -1
- package/dist/{src-DR-EWgVP.mjs → src-L88LbwEv.mjs} +2 -2
- package/dist/src-L88LbwEv.mjs.map +1 -0
- package/dist/ssg/index.d.mts +1 -1
- package/dist/ssg/index.mjs +1 -1
- package/dist/ssg/plugins/docs-theme.d.mts +311 -5
- package/dist/ssg/plugins/docs-theme.d.mts.map +1 -1
- package/dist/ssg/plugins/docs-theme.mjs +1463 -111
- package/dist/ssg/plugins/docs-theme.mjs.map +1 -1
- package/dist/ssg/plugins/lucide.d.mts +2 -2
- package/dist/{types-CGkRxnQB.d.mts → types-C9fiRu6l.d.mts} +3 -3
- package/dist/{types-CGkRxnQB.d.mts.map → types-C9fiRu6l.d.mts.map} +1 -1
- package/package.json +1 -1
- package/dist/src-DR-EWgVP.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineCollection, v as __exportAll } from "../../src-
|
|
1
|
+
import { d as defineCollection, v as __exportAll } from "../../src-L88LbwEv.mjs";
|
|
2
2
|
import { a as jsxs, i as jsx, v as Fragment } from "../../src-DW3tIczg.mjs";
|
|
3
3
|
import "../../src-BqX3sryB.mjs";
|
|
4
4
|
import { G as rules, K as classes, M as createTheme, N as defineTokens, U as isStyleToken, W as rule } from "../../src-Ds9vl42d.mjs";
|
|
@@ -9,6 +9,8 @@ import "../../resource-DSlXDZZi.mjs";
|
|
|
9
9
|
import "../../src-DuSN6go_.mjs";
|
|
10
10
|
import "../../document-BOJDaiBc.mjs";
|
|
11
11
|
import { n as Icon, t as lucide } from "../../lucide-CVtHepGM.mjs";
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
12
14
|
import { z } from "zod";
|
|
13
15
|
|
|
14
16
|
//#region ../ssg/src/plugins/docs-theme/styles.ts
|
|
@@ -726,6 +728,143 @@ body {
|
|
|
726
728
|
.dt-code-block { border-radius: 10px; }
|
|
727
729
|
.dt-code-header { padding: 0.375rem 1rem; }
|
|
728
730
|
|
|
731
|
+
.dt-ui-grid {
|
|
732
|
+
grid-template-columns: 1fr !important;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.dt-preview-box {
|
|
736
|
+
padding: 2rem 1rem !important;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/* ==============================================
|
|
741
|
+
* Component Preview (shadcn-style showcase)
|
|
742
|
+
* ============================================== */
|
|
743
|
+
|
|
744
|
+
.dt-preview {
|
|
745
|
+
margin: 1.5rem 0;
|
|
746
|
+
border: 0.5px solid rgba(0, 0, 0, 0.08);
|
|
747
|
+
border-radius: 12px;
|
|
748
|
+
overflow: hidden;
|
|
749
|
+
background: white;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.dt-preview-box {
|
|
753
|
+
display: flex;
|
|
754
|
+
flex-wrap: wrap;
|
|
755
|
+
align-items: center;
|
|
756
|
+
justify-content: center;
|
|
757
|
+
gap: 1rem;
|
|
758
|
+
padding: 3.5rem 2.5rem;
|
|
759
|
+
min-height: 120px;
|
|
760
|
+
background: white;
|
|
761
|
+
position: relative;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.dt-preview-box > * {
|
|
765
|
+
pointer-events: none;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.dt-preview-box::before {
|
|
769
|
+
content: "";
|
|
770
|
+
position: absolute;
|
|
771
|
+
inset: 0;
|
|
772
|
+
background-image:
|
|
773
|
+
radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
|
|
774
|
+
background-size: 20px 20px;
|
|
775
|
+
pointer-events: none;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
.dt-preview-label {
|
|
779
|
+
position: absolute;
|
|
780
|
+
top: 0.75rem;
|
|
781
|
+
left: 1rem;
|
|
782
|
+
font-size: 0.6875rem;
|
|
783
|
+
font-weight: 600;
|
|
784
|
+
color: #86868b;
|
|
785
|
+
text-transform: uppercase;
|
|
786
|
+
letter-spacing: 0.04em;
|
|
787
|
+
z-index: 1;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/* ==============================================
|
|
791
|
+
* UI Components Section
|
|
792
|
+
* ============================================== */
|
|
793
|
+
|
|
794
|
+
.dt-ui-grid {
|
|
795
|
+
display: grid;
|
|
796
|
+
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|
797
|
+
gap: 1rem;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.dt-ui-card {
|
|
801
|
+
display: block;
|
|
802
|
+
padding: 1.5rem;
|
|
803
|
+
background: white;
|
|
804
|
+
border: 0.5px solid rgba(0, 0, 0, 0.06);
|
|
805
|
+
border-radius: 12px;
|
|
806
|
+
text-decoration: none;
|
|
807
|
+
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
808
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.dt-ui-card:hover {
|
|
812
|
+
border-color: rgba(0, 113, 227, 0.3);
|
|
813
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
814
|
+
transform: translateY(-2px);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
.dt-ui-card-preview {
|
|
818
|
+
display: flex;
|
|
819
|
+
align-items: center;
|
|
820
|
+
justify-content: center;
|
|
821
|
+
height: 80px;
|
|
822
|
+
margin-bottom: 1rem;
|
|
823
|
+
background: #f9f9fb;
|
|
824
|
+
border-radius: 8px;
|
|
825
|
+
overflow: hidden;
|
|
826
|
+
position: relative;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.dt-ui-card-preview > * {
|
|
830
|
+
pointer-events: none;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.dt-ui-card-preview::before {
|
|
834
|
+
content: "";
|
|
835
|
+
position: absolute;
|
|
836
|
+
inset: 0;
|
|
837
|
+
background-image:
|
|
838
|
+
radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
|
|
839
|
+
background-size: 16px 16px;
|
|
840
|
+
pointer-events: none;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.dt-ui-card-name {
|
|
844
|
+
font-size: 0.9375rem;
|
|
845
|
+
font-weight: 600;
|
|
846
|
+
color: #1d1d1f;
|
|
847
|
+
margin: 0 0 0.25rem;
|
|
848
|
+
letter-spacing: -0.01em;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
.dt-ui-card-desc {
|
|
852
|
+
font-size: 0.8125rem;
|
|
853
|
+
color: #6e6e73;
|
|
854
|
+
margin: 0;
|
|
855
|
+
line-height: 1.4;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.dt-ui-badge-new {
|
|
859
|
+
display: inline-block;
|
|
860
|
+
padding: 0.1rem 0.4rem;
|
|
861
|
+
background: rgba(0, 113, 227, 0.08);
|
|
862
|
+
color: #0071e3;
|
|
863
|
+
font-size: 0.6875rem;
|
|
864
|
+
font-weight: 600;
|
|
865
|
+
border-radius: 4px;
|
|
866
|
+
margin-left: 0.5rem;
|
|
867
|
+
vertical-align: middle;
|
|
729
868
|
}
|
|
730
869
|
`;
|
|
731
870
|
|
|
@@ -826,25 +965,25 @@ const tokens = defineTokens(tokenDefinition);
|
|
|
826
965
|
* Matching the docs site callout design.
|
|
827
966
|
*/
|
|
828
967
|
var callout_style_exports = /* @__PURE__ */ __exportAll({
|
|
829
|
-
content: () => content,
|
|
968
|
+
content: () => content$1,
|
|
830
969
|
icon: () => icon$2,
|
|
831
|
-
root: () => root$
|
|
832
|
-
title: () => title
|
|
970
|
+
root: () => root$11,
|
|
971
|
+
title: () => title$1
|
|
833
972
|
});
|
|
834
|
-
const c$
|
|
973
|
+
const c$11 = classes([
|
|
835
974
|
"root",
|
|
836
975
|
"title",
|
|
837
976
|
"icon",
|
|
838
977
|
"content"
|
|
839
978
|
]);
|
|
840
|
-
const root$
|
|
979
|
+
const root$11 = rule`${c$11.root} {
|
|
841
980
|
padding: 1.25rem 1.5rem;
|
|
842
981
|
margin: 1.5rem 0;
|
|
843
982
|
border-radius: 14px;
|
|
844
983
|
border: 0.5px solid rgba(0, 0, 0, 0.04);
|
|
845
984
|
font-family: ${tokens.fonts.base};
|
|
846
985
|
}`;
|
|
847
|
-
const title = rule`${c$
|
|
986
|
+
const title$1 = rule`${c$11.title} {
|
|
848
987
|
font-weight: ${tokens.fontWeights.semibold};
|
|
849
988
|
font-size: 0.9375rem;
|
|
850
989
|
margin: 0 0 0.5rem;
|
|
@@ -853,7 +992,7 @@ const title = rule`${c$4.title} {
|
|
|
853
992
|
gap: ${tokens.space.sm};
|
|
854
993
|
letter-spacing: -0.005em;
|
|
855
994
|
}`;
|
|
856
|
-
const icon$2 = rule`${c$
|
|
995
|
+
const icon$2 = rule`${c$11.icon} {
|
|
857
996
|
width: 18px;
|
|
858
997
|
height: 18px;
|
|
859
998
|
display: inline-flex;
|
|
@@ -861,7 +1000,7 @@ const icon$2 = rule`${c$4.icon} {
|
|
|
861
1000
|
justify-content: center;
|
|
862
1001
|
flex-shrink: 0;
|
|
863
1002
|
}`;
|
|
864
|
-
const content = rule`${c$
|
|
1003
|
+
const content$1 = rule`${c$11.content} {
|
|
865
1004
|
color: ${tokens.colors.text};
|
|
866
1005
|
font-size: 0.9375rem;
|
|
867
1006
|
line-height: ${tokens.lineHeights.normal};
|
|
@@ -965,18 +1104,18 @@ function Callout(props) {
|
|
|
965
1104
|
const config = calloutConfig[props.type ?? "info"];
|
|
966
1105
|
const IconComponent = config.icon;
|
|
967
1106
|
return /* @__PURE__ */ jsxs("div", {
|
|
968
|
-
class: [root$
|
|
1107
|
+
class: [root$11, props.class],
|
|
969
1108
|
style: `background: ${config.bg}`,
|
|
970
1109
|
role: "note",
|
|
971
1110
|
children: [props.title && /* @__PURE__ */ jsxs("div", {
|
|
972
|
-
class: title,
|
|
1111
|
+
class: title$1,
|
|
973
1112
|
style: `color: ${config.accent}`,
|
|
974
1113
|
children: [/* @__PURE__ */ jsx("span", {
|
|
975
1114
|
class: icon$2,
|
|
976
1115
|
children: /* @__PURE__ */ jsx(IconComponent, {})
|
|
977
1116
|
}), props.title]
|
|
978
1117
|
}), /* @__PURE__ */ jsx("div", {
|
|
979
|
-
class: content,
|
|
1118
|
+
class: content$1,
|
|
980
1119
|
children: props.children
|
|
981
1120
|
})]
|
|
982
1121
|
});
|
|
@@ -989,9 +1128,9 @@ function Callout(props) {
|
|
|
989
1128
|
*
|
|
990
1129
|
* Pill-shaped labels with semantic color variants.
|
|
991
1130
|
*/
|
|
992
|
-
var badge_style_exports = /* @__PURE__ */ __exportAll({ root: () => root$
|
|
993
|
-
const c$
|
|
994
|
-
const root$
|
|
1131
|
+
var badge_style_exports = /* @__PURE__ */ __exportAll({ root: () => root$10 });
|
|
1132
|
+
const c$10 = classes(["root"]);
|
|
1133
|
+
const root$10 = rule`${c$10.root} {
|
|
995
1134
|
display: inline-flex;
|
|
996
1135
|
align-items: center;
|
|
997
1136
|
font-size: 0.6875rem;
|
|
@@ -1036,7 +1175,7 @@ const badgeColors = {
|
|
|
1036
1175
|
function Badge(props) {
|
|
1037
1176
|
const config = badgeColors[props.color ?? "default"];
|
|
1038
1177
|
return /* @__PURE__ */ jsx("span", {
|
|
1039
|
-
class: [root$
|
|
1178
|
+
class: [root$10, props.class],
|
|
1040
1179
|
style: `background: ${config.bg}; color: ${config.fg}`,
|
|
1041
1180
|
children: props.children
|
|
1042
1181
|
});
|
|
@@ -1061,9 +1200,9 @@ var card_style_exports = /* @__PURE__ */ __exportAll({
|
|
|
1061
1200
|
icon: () => icon$1,
|
|
1062
1201
|
link: () => link,
|
|
1063
1202
|
linkStates: () => linkStates,
|
|
1064
|
-
root: () => root$
|
|
1203
|
+
root: () => root$9
|
|
1065
1204
|
});
|
|
1066
|
-
const c$
|
|
1205
|
+
const c$9 = classes([
|
|
1067
1206
|
"root",
|
|
1068
1207
|
"feature",
|
|
1069
1208
|
"link",
|
|
@@ -1071,22 +1210,22 @@ const c$2 = classes([
|
|
|
1071
1210
|
"heading",
|
|
1072
1211
|
"desc"
|
|
1073
1212
|
]);
|
|
1074
|
-
const root$
|
|
1213
|
+
const root$9 = rule`${c$9.root} {
|
|
1075
1214
|
background: white;
|
|
1076
1215
|
border: 0.5px solid rgba(0, 0, 0, 0.06);
|
|
1077
1216
|
font-family: ${tokens.fonts.base};
|
|
1078
1217
|
transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
1079
1218
|
}`;
|
|
1080
|
-
const feature = rule`${c$
|
|
1219
|
+
const feature = rule`${c$9.feature} {
|
|
1081
1220
|
border-radius: ${tokens.radii.xl};
|
|
1082
1221
|
padding: 2.5rem;
|
|
1083
1222
|
box-shadow: ${tokens.shadows.md};
|
|
1084
1223
|
}`;
|
|
1085
|
-
const featureStates = rule`${c$
|
|
1224
|
+
const featureStates = rule`${c$9.feature}:hover {
|
|
1086
1225
|
transform: translateY(-4px) scale(1.01);
|
|
1087
1226
|
box-shadow: ${tokens.shadows.lg};
|
|
1088
1227
|
}`;
|
|
1089
|
-
const link = rule`${c$
|
|
1228
|
+
const link = rule`${c$9.link} {
|
|
1090
1229
|
display: block;
|
|
1091
1230
|
border-radius: ${tokens.radii.lg};
|
|
1092
1231
|
padding: 1.75rem;
|
|
@@ -1094,12 +1233,12 @@ const link = rule`${c$2.link} {
|
|
|
1094
1233
|
text-decoration: none;
|
|
1095
1234
|
cursor: pointer;
|
|
1096
1235
|
}`;
|
|
1097
|
-
const linkStates = rules(rule`${c$
|
|
1236
|
+
const linkStates = rules(rule`${c$9.link}:hover {
|
|
1098
1237
|
border-color: rgba(0, 113, 227, 0.3);
|
|
1099
1238
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
1100
1239
|
transform: translateY(-2px);
|
|
1101
1240
|
}`);
|
|
1102
|
-
const icon$1 = rule`${c$
|
|
1241
|
+
const icon$1 = rule`${c$9.icon} {
|
|
1103
1242
|
font-size: 2rem;
|
|
1104
1243
|
width: 48px;
|
|
1105
1244
|
height: 48px;
|
|
@@ -1110,24 +1249,24 @@ const icon$1 = rule`${c$2.icon} {
|
|
|
1110
1249
|
border-radius: ${tokens.radii.md};
|
|
1111
1250
|
margin-bottom: 1.25rem;
|
|
1112
1251
|
}`;
|
|
1113
|
-
const heading = rule`${c$
|
|
1252
|
+
const heading = rule`${c$9.heading} {
|
|
1114
1253
|
font-size: 1.375rem;
|
|
1115
1254
|
font-weight: ${tokens.fontWeights.semibold};
|
|
1116
1255
|
color: ${tokens.colors.text};
|
|
1117
1256
|
margin: 0 0 0.5rem;
|
|
1118
1257
|
letter-spacing: -0.01em;
|
|
1119
1258
|
}`;
|
|
1120
|
-
const headingLink = rule`${c$
|
|
1259
|
+
const headingLink = rule`${c$9.link} ${c$9.heading} {
|
|
1121
1260
|
font-size: ${tokens.fontSizes.lg};
|
|
1122
1261
|
margin-bottom: 0.25rem;
|
|
1123
1262
|
}`;
|
|
1124
|
-
const desc = rule`${c$
|
|
1263
|
+
const desc = rule`${c$9.desc} {
|
|
1125
1264
|
color: ${tokens.colors.textMuted};
|
|
1126
1265
|
line-height: ${tokens.lineHeights.normal};
|
|
1127
1266
|
font-size: 0.9375rem;
|
|
1128
1267
|
margin: 0;
|
|
1129
1268
|
}`;
|
|
1130
|
-
const descLink = rule`${c$
|
|
1269
|
+
const descLink = rule`${c$9.link} ${c$9.desc} {
|
|
1131
1270
|
font-size: ${tokens.fontSizes.sm};
|
|
1132
1271
|
line-height: 1.5;
|
|
1133
1272
|
}`;
|
|
@@ -1154,7 +1293,7 @@ function Card(props) {
|
|
|
1154
1293
|
if (variant === "link") return /* @__PURE__ */ jsx("a", {
|
|
1155
1294
|
href: props.href,
|
|
1156
1295
|
class: [
|
|
1157
|
-
root$
|
|
1296
|
+
root$9,
|
|
1158
1297
|
link,
|
|
1159
1298
|
linkStates,
|
|
1160
1299
|
props.class
|
|
@@ -1164,7 +1303,7 @@ function Card(props) {
|
|
|
1164
1303
|
});
|
|
1165
1304
|
return /* @__PURE__ */ jsx("div", {
|
|
1166
1305
|
class: [
|
|
1167
|
-
root$
|
|
1306
|
+
root$9,
|
|
1168
1307
|
feature,
|
|
1169
1308
|
featureStates,
|
|
1170
1309
|
props.class
|
|
@@ -1174,6 +1313,199 @@ function Card(props) {
|
|
|
1174
1313
|
});
|
|
1175
1314
|
}
|
|
1176
1315
|
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region ../ui/src/components/tabs/tabs.style.ts
|
|
1318
|
+
/**
|
|
1319
|
+
* Tabs component styles
|
|
1320
|
+
*
|
|
1321
|
+
* A tab bar with active indicator and content panels.
|
|
1322
|
+
*/
|
|
1323
|
+
var tabs_style_exports = /* @__PURE__ */ __exportAll({
|
|
1324
|
+
active: () => active,
|
|
1325
|
+
list: () => list,
|
|
1326
|
+
panel: () => panel,
|
|
1327
|
+
root: () => root$8,
|
|
1328
|
+
trigger: () => trigger,
|
|
1329
|
+
triggerStates: () => triggerStates
|
|
1330
|
+
});
|
|
1331
|
+
const c$8 = classes([
|
|
1332
|
+
"root",
|
|
1333
|
+
"list",
|
|
1334
|
+
"trigger",
|
|
1335
|
+
"active",
|
|
1336
|
+
"panel"
|
|
1337
|
+
]);
|
|
1338
|
+
const root$8 = rule`${c$8.root} {
|
|
1339
|
+
margin: 1.5rem 0;
|
|
1340
|
+
font-family: ${tokens.fonts.base};
|
|
1341
|
+
}`;
|
|
1342
|
+
const list = rule`${c$8.list} {
|
|
1343
|
+
display: flex;
|
|
1344
|
+
gap: 0;
|
|
1345
|
+
border-bottom: 1px solid ${tokens.colors.border};
|
|
1346
|
+
margin-bottom: 0;
|
|
1347
|
+
overflow-x: auto;
|
|
1348
|
+
-webkit-overflow-scrolling: touch;
|
|
1349
|
+
}`;
|
|
1350
|
+
const trigger = rule`${c$8.trigger} {
|
|
1351
|
+
padding: 0.625rem 1rem;
|
|
1352
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1353
|
+
font-weight: ${tokens.fontWeights.medium};
|
|
1354
|
+
font-family: ${tokens.fonts.base};
|
|
1355
|
+
color: ${tokens.colors.textMuted};
|
|
1356
|
+
background: none;
|
|
1357
|
+
border: none;
|
|
1358
|
+
border-bottom: 2px solid transparent;
|
|
1359
|
+
cursor: pointer;
|
|
1360
|
+
white-space: nowrap;
|
|
1361
|
+
transition: color ${tokens.transitions.fast}, border-color ${tokens.transitions.fast};
|
|
1362
|
+
margin-bottom: -1px;
|
|
1363
|
+
}`;
|
|
1364
|
+
const triggerStates = rules(rule`${c$8.trigger}:hover {
|
|
1365
|
+
color: ${tokens.colors.text};
|
|
1366
|
+
}`, rule`${c$8.trigger}:focus-visible {
|
|
1367
|
+
outline: 2px solid ${tokens.colors.primary};
|
|
1368
|
+
outline-offset: -2px;
|
|
1369
|
+
}`);
|
|
1370
|
+
const active = rule`${c$8.active} {
|
|
1371
|
+
color: ${tokens.colors.primary};
|
|
1372
|
+
border-bottom-color: ${tokens.colors.primary};
|
|
1373
|
+
}`;
|
|
1374
|
+
const panel = rule`${c$8.panel} {
|
|
1375
|
+
padding: 1rem 0;
|
|
1376
|
+
}`;
|
|
1377
|
+
|
|
1378
|
+
//#endregion
|
|
1379
|
+
//#region ../ui/src/components/tabs/tabs.tsx
|
|
1380
|
+
function Tabs(props) {
|
|
1381
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1382
|
+
class: [root$8, props.class],
|
|
1383
|
+
"data-tabs": props.defaultValue,
|
|
1384
|
+
children: props.children
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
function TabList(props) {
|
|
1388
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1389
|
+
class: [list, props.class],
|
|
1390
|
+
role: "tablist",
|
|
1391
|
+
children: props.children
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
function Tab(props) {
|
|
1395
|
+
return /* @__PURE__ */ jsx("button", {
|
|
1396
|
+
class: [
|
|
1397
|
+
trigger,
|
|
1398
|
+
triggerStates,
|
|
1399
|
+
props.class
|
|
1400
|
+
],
|
|
1401
|
+
role: "tab",
|
|
1402
|
+
"data-tab-value": props.value,
|
|
1403
|
+
children: props.children
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
function TabPanel(props) {
|
|
1407
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1408
|
+
class: [panel, props.class],
|
|
1409
|
+
role: "tabpanel",
|
|
1410
|
+
"data-tab-panel": props.value,
|
|
1411
|
+
children: props.children
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
//#endregion
|
|
1416
|
+
//#region ../ui/src/components/steps/steps.style.ts
|
|
1417
|
+
/**
|
|
1418
|
+
* Steps component styles
|
|
1419
|
+
*
|
|
1420
|
+
* Numbered step indicators for tutorials and guides.
|
|
1421
|
+
*/
|
|
1422
|
+
var steps_style_exports = /* @__PURE__ */ __exportAll({
|
|
1423
|
+
body: () => body,
|
|
1424
|
+
content: () => content,
|
|
1425
|
+
item: () => item,
|
|
1426
|
+
number: () => number,
|
|
1427
|
+
root: () => root$7,
|
|
1428
|
+
title: () => title
|
|
1429
|
+
});
|
|
1430
|
+
const c$7 = classes([
|
|
1431
|
+
"root",
|
|
1432
|
+
"item",
|
|
1433
|
+
"number",
|
|
1434
|
+
"content",
|
|
1435
|
+
"title",
|
|
1436
|
+
"body"
|
|
1437
|
+
]);
|
|
1438
|
+
const root$7 = rule`${c$7.root} {
|
|
1439
|
+
display: flex;
|
|
1440
|
+
flex-direction: column;
|
|
1441
|
+
gap: 0;
|
|
1442
|
+
margin: 1.5rem 0;
|
|
1443
|
+
font-family: ${tokens.fonts.base};
|
|
1444
|
+
}`;
|
|
1445
|
+
const item = rule`${c$7.item} {
|
|
1446
|
+
display: flex;
|
|
1447
|
+
gap: 1rem;
|
|
1448
|
+
padding: 1.25rem 0;
|
|
1449
|
+
border-bottom: 0.5px solid ${tokens.colors.border};
|
|
1450
|
+
}`;
|
|
1451
|
+
const number = rule`${c$7.number} {
|
|
1452
|
+
flex-shrink: 0;
|
|
1453
|
+
width: 28px;
|
|
1454
|
+
height: 28px;
|
|
1455
|
+
border-radius: 50%;
|
|
1456
|
+
background: ${tokens.colors.primary};
|
|
1457
|
+
color: ${tokens.colors.onPrimary};
|
|
1458
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1459
|
+
font-weight: ${tokens.fontWeights.semibold};
|
|
1460
|
+
display: flex;
|
|
1461
|
+
align-items: center;
|
|
1462
|
+
justify-content: center;
|
|
1463
|
+
margin-top: 0.125rem;
|
|
1464
|
+
}`;
|
|
1465
|
+
const content = rule`${c$7.content} {
|
|
1466
|
+
flex: 1;
|
|
1467
|
+
min-width: 0;
|
|
1468
|
+
}`;
|
|
1469
|
+
const title = rule`${c$7.title} {
|
|
1470
|
+
font-size: ${tokens.fontSizes.md};
|
|
1471
|
+
font-weight: ${tokens.fontWeights.semibold};
|
|
1472
|
+
color: ${tokens.colors.text};
|
|
1473
|
+
margin: 0 0 0.375rem;
|
|
1474
|
+
letter-spacing: -0.005em;
|
|
1475
|
+
}`;
|
|
1476
|
+
const body = rule`${c$7.body} {
|
|
1477
|
+
color: ${tokens.colors.textMuted};
|
|
1478
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1479
|
+
line-height: ${tokens.lineHeights.normal};
|
|
1480
|
+
}`;
|
|
1481
|
+
|
|
1482
|
+
//#endregion
|
|
1483
|
+
//#region ../ui/src/components/steps/steps.tsx
|
|
1484
|
+
function Steps(props) {
|
|
1485
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1486
|
+
class: [root$7, props.class],
|
|
1487
|
+
children: props.children
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
function Step(props) {
|
|
1491
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1492
|
+
class: [item, props.class],
|
|
1493
|
+
children: [props.number !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
1494
|
+
class: number,
|
|
1495
|
+
children: props.number
|
|
1496
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1497
|
+
class: content,
|
|
1498
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
1499
|
+
class: title,
|
|
1500
|
+
children: props.title
|
|
1501
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1502
|
+
class: body,
|
|
1503
|
+
children: props.children
|
|
1504
|
+
})]
|
|
1505
|
+
})]
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1177
1509
|
//#endregion
|
|
1178
1510
|
//#region ../ui/src/theme/themes.ts
|
|
1179
1511
|
/**
|
|
@@ -1245,17 +1577,17 @@ var button_style_exports = /* @__PURE__ */ __exportAll({
|
|
|
1245
1577
|
ghost: () => ghost,
|
|
1246
1578
|
ghostStates: () => ghostStates,
|
|
1247
1579
|
icon: () => icon,
|
|
1248
|
-
lg: () => lg,
|
|
1249
|
-
md: () => md,
|
|
1580
|
+
lg: () => lg$2,
|
|
1581
|
+
md: () => md$2,
|
|
1250
1582
|
outline: () => outline,
|
|
1251
1583
|
outlineStates: () => outlineStates,
|
|
1252
|
-
root: () => root$
|
|
1253
|
-
rootStates: () => rootStates,
|
|
1254
|
-
sm: () => sm,
|
|
1584
|
+
root: () => root$6,
|
|
1585
|
+
rootStates: () => rootStates$1,
|
|
1586
|
+
sm: () => sm$2,
|
|
1255
1587
|
solid: () => solid,
|
|
1256
1588
|
solidStates: () => solidStates
|
|
1257
1589
|
});
|
|
1258
|
-
const c$
|
|
1590
|
+
const c$6 = classes([
|
|
1259
1591
|
"root",
|
|
1260
1592
|
"solid",
|
|
1261
1593
|
"outline",
|
|
@@ -1266,7 +1598,7 @@ const c$1 = classes([
|
|
|
1266
1598
|
"danger",
|
|
1267
1599
|
"icon"
|
|
1268
1600
|
]);
|
|
1269
|
-
const root$
|
|
1601
|
+
const root$6 = rule`${c$6.root} {
|
|
1270
1602
|
display: inline-flex;
|
|
1271
1603
|
align-items: center;
|
|
1272
1604
|
justify-content: center;
|
|
@@ -1281,79 +1613,79 @@ const root$1 = rule`${c$1.root} {
|
|
|
1281
1613
|
user-select: none;
|
|
1282
1614
|
transition: all ${tokens.transitions.normal};
|
|
1283
1615
|
}`;
|
|
1284
|
-
const rootStates = rules(rule`${c$
|
|
1616
|
+
const rootStates$1 = rules(rule`${c$6.root}:focus-visible {
|
|
1285
1617
|
outline: 2px solid ${tokens.colors.primary};
|
|
1286
1618
|
outline-offset: 2px;
|
|
1287
|
-
}`, rule`${c$
|
|
1619
|
+
}`, rule`${c$6.root}:disabled {
|
|
1288
1620
|
opacity: 0.5;
|
|
1289
1621
|
cursor: not-allowed;
|
|
1290
1622
|
pointer-events: none;
|
|
1291
1623
|
}`);
|
|
1292
|
-
const solid = rule`${c$
|
|
1624
|
+
const solid = rule`${c$6.solid} {
|
|
1293
1625
|
background: ${tokens.colors.primary};
|
|
1294
1626
|
color: ${tokens.colors.onPrimary};
|
|
1295
1627
|
border-color: ${tokens.colors.primary};
|
|
1296
1628
|
}`;
|
|
1297
|
-
const solidStates = rules(rule`${c$
|
|
1629
|
+
const solidStates = rules(rule`${c$6.solid}:hover:not(:disabled) {
|
|
1298
1630
|
background: ${tokens.colors.primaryHover};
|
|
1299
1631
|
border-color: ${tokens.colors.primaryHover};
|
|
1300
1632
|
transform: scale(1.02);
|
|
1301
1633
|
box-shadow: ${tokens.shadows.primaryGlow};
|
|
1302
|
-
}`, rule`${c$
|
|
1634
|
+
}`, rule`${c$6.solid}:active:not(:disabled) {
|
|
1303
1635
|
background: ${tokens.colors.primaryActive};
|
|
1304
1636
|
border-color: ${tokens.colors.primaryActive};
|
|
1305
1637
|
transform: scale(0.98);
|
|
1306
1638
|
box-shadow: none;
|
|
1307
1639
|
}`);
|
|
1308
|
-
const outline = rule`${c$
|
|
1640
|
+
const outline = rule`${c$6.outline} {
|
|
1309
1641
|
background: transparent;
|
|
1310
1642
|
color: ${tokens.colors.primary};
|
|
1311
1643
|
border-color: ${tokens.colors.primary};
|
|
1312
1644
|
}`;
|
|
1313
|
-
const outlineStates = rules(rule`${c$
|
|
1645
|
+
const outlineStates = rules(rule`${c$6.outline}:hover:not(:disabled) {
|
|
1314
1646
|
background: ${tokens.colors.primary};
|
|
1315
1647
|
color: ${tokens.colors.onPrimary};
|
|
1316
1648
|
transform: scale(1.02);
|
|
1317
|
-
}`, rule`${c$
|
|
1649
|
+
}`, rule`${c$6.outline}:active:not(:disabled) {
|
|
1318
1650
|
background: ${tokens.colors.primaryActive};
|
|
1319
1651
|
color: ${tokens.colors.onPrimary};
|
|
1320
1652
|
transform: scale(0.98);
|
|
1321
1653
|
}`);
|
|
1322
|
-
const ghost = rule`${c$
|
|
1654
|
+
const ghost = rule`${c$6.ghost} {
|
|
1323
1655
|
background: transparent;
|
|
1324
1656
|
color: ${tokens.colors.text};
|
|
1325
1657
|
border-color: transparent;
|
|
1326
1658
|
}`;
|
|
1327
|
-
const ghostStates = rules(rule`${c$
|
|
1659
|
+
const ghostStates = rules(rule`${c$6.ghost}:hover:not(:disabled) {
|
|
1328
1660
|
background: ${tokens.colors.surface};
|
|
1329
|
-
}`, rule`${c$
|
|
1661
|
+
}`, rule`${c$6.ghost}:active:not(:disabled) {
|
|
1330
1662
|
background: ${tokens.colors.border};
|
|
1331
1663
|
}`);
|
|
1332
|
-
const danger = rule`${c$
|
|
1664
|
+
const danger = rule`${c$6.danger} {
|
|
1333
1665
|
background: ${tokens.colors.danger};
|
|
1334
1666
|
color: ${tokens.colors.onDanger};
|
|
1335
1667
|
border-color: ${tokens.colors.danger};
|
|
1336
1668
|
}`;
|
|
1337
|
-
const dangerStates = rules(rule`${c$
|
|
1669
|
+
const dangerStates = rules(rule`${c$6.danger}:hover:not(:disabled) {
|
|
1338
1670
|
background: ${tokens.colors.dangerHover};
|
|
1339
1671
|
border-color: ${tokens.colors.dangerHover};
|
|
1340
1672
|
transform: scale(1.02);
|
|
1341
|
-
}`, rule`${c$
|
|
1673
|
+
}`, rule`${c$6.danger}:focus-visible {
|
|
1342
1674
|
outline-color: ${tokens.colors.danger};
|
|
1343
1675
|
}`);
|
|
1344
|
-
const sm = rule`${c$
|
|
1676
|
+
const sm$2 = rule`${c$6.sm} {
|
|
1345
1677
|
padding: ${tokens.space.sm} ${tokens.space.lg};
|
|
1346
1678
|
font-size: ${tokens.fontSizes.sm};
|
|
1347
1679
|
}`;
|
|
1348
|
-
const md = rule`${c$
|
|
1680
|
+
const md$2 = rule`${c$6.md} {
|
|
1349
1681
|
padding: ${tokens.space.md} ${tokens.space.xl};
|
|
1350
1682
|
font-size: ${tokens.fontSizes.md};
|
|
1351
1683
|
}`;
|
|
1352
|
-
const lg = rule`${c$
|
|
1684
|
+
const lg$2 = rule`${c$6.lg} {
|
|
1353
1685
|
padding: 0.875rem 1.75rem;
|
|
1354
1686
|
font-size: ${tokens.fontSizes.lg};
|
|
1355
1687
|
}`;
|
|
1356
|
-
const icon = rule`${c$
|
|
1688
|
+
const icon = rule`${c$6.icon} {
|
|
1357
1689
|
display: inline-flex;
|
|
1358
1690
|
flex-shrink: 0;
|
|
1359
1691
|
}`;
|
|
@@ -1370,30 +1702,30 @@ var code_block_style_exports = /* @__PURE__ */ __exportAll({
|
|
|
1370
1702
|
inline: () => inline,
|
|
1371
1703
|
lang: () => lang,
|
|
1372
1704
|
pre: () => pre,
|
|
1373
|
-
root: () => root
|
|
1705
|
+
root: () => root$5
|
|
1374
1706
|
});
|
|
1375
|
-
const c = classes([
|
|
1707
|
+
const c$5 = classes([
|
|
1376
1708
|
"root",
|
|
1377
1709
|
"header",
|
|
1378
1710
|
"lang",
|
|
1379
1711
|
"pre",
|
|
1380
1712
|
"inline"
|
|
1381
1713
|
]);
|
|
1382
|
-
const root = rule`${c.root} {
|
|
1714
|
+
const root$5 = rule`${c$5.root} {
|
|
1383
1715
|
margin: 1.5rem 0;
|
|
1384
1716
|
border-radius: ${tokens.radii.md};
|
|
1385
1717
|
overflow: hidden;
|
|
1386
1718
|
border: 0.5px solid rgba(0, 0, 0, 0.1);
|
|
1387
1719
|
font-family: ${tokens.fonts.mono};
|
|
1388
1720
|
}`;
|
|
1389
|
-
const header = rule`${c.header} {
|
|
1721
|
+
const header = rule`${c$5.header} {
|
|
1390
1722
|
background: #161617;
|
|
1391
1723
|
padding: 0.5rem 1.25rem;
|
|
1392
1724
|
display: flex;
|
|
1393
1725
|
justify-content: space-between;
|
|
1394
1726
|
align-items: center;
|
|
1395
1727
|
}`;
|
|
1396
|
-
const lang = rule`${c.lang} {
|
|
1728
|
+
const lang = rule`${c$5.lang} {
|
|
1397
1729
|
color: #86868b;
|
|
1398
1730
|
font-size: 0.6875rem;
|
|
1399
1731
|
text-transform: uppercase;
|
|
@@ -1401,7 +1733,7 @@ const lang = rule`${c.lang} {
|
|
|
1401
1733
|
letter-spacing: 0.04em;
|
|
1402
1734
|
font-family: ${tokens.fonts.mono};
|
|
1403
1735
|
}`;
|
|
1404
|
-
const pre = rule`${c.pre} {
|
|
1736
|
+
const pre = rule`${c$5.pre} {
|
|
1405
1737
|
background: #1d1d1f;
|
|
1406
1738
|
color: #e5e5ea;
|
|
1407
1739
|
padding: 1.25rem 1.5rem;
|
|
@@ -1411,7 +1743,7 @@ const pre = rule`${c.pre} {
|
|
|
1411
1743
|
line-height: 1.65;
|
|
1412
1744
|
font-family: ${tokens.fonts.mono};
|
|
1413
1745
|
}`;
|
|
1414
|
-
const inline = rule`${c.inline} {
|
|
1746
|
+
const inline = rule`${c$5.inline} {
|
|
1415
1747
|
background: rgba(0, 0, 0, 0.04);
|
|
1416
1748
|
padding: 0.15rem 0.4rem;
|
|
1417
1749
|
border-radius: 5px;
|
|
@@ -1421,56 +1753,473 @@ const inline = rule`${c.inline} {
|
|
|
1421
1753
|
}`;
|
|
1422
1754
|
|
|
1423
1755
|
//#endregion
|
|
1424
|
-
//#region ../ui/src/
|
|
1756
|
+
//#region ../ui/src/components/separator/separator.style.ts
|
|
1425
1757
|
/**
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1428
|
-
* Since @semajsx/style's inject() requires a DOM, this module provides
|
|
1429
|
-
* all component CSS as a static string for server-side rendering.
|
|
1430
|
-
*
|
|
1431
|
-
* @example
|
|
1432
|
-
* ```tsx
|
|
1433
|
-
* import { componentCSS } from "@semajsx/ui/css";
|
|
1434
|
-
*
|
|
1435
|
-
* // Include in a <style> tag for SSG output
|
|
1436
|
-
* <style>{componentCSS}</style>
|
|
1437
|
-
* ```
|
|
1758
|
+
* Separator component styles
|
|
1438
1759
|
*/
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1760
|
+
var separator_style_exports = /* @__PURE__ */ __exportAll({
|
|
1761
|
+
horizontal: () => horizontal,
|
|
1762
|
+
root: () => root$4,
|
|
1763
|
+
vertical: () => vertical
|
|
1764
|
+
});
|
|
1765
|
+
const c$4 = classes(["root", "vertical"]);
|
|
1766
|
+
const root$4 = rule`${c$4.root} {
|
|
1767
|
+
border: none;
|
|
1768
|
+
background: ${tokens.colors.border};
|
|
1769
|
+
flex-shrink: 0;
|
|
1770
|
+
}`;
|
|
1771
|
+
const horizontal = rule`${c$4.root}:not(${c$4.vertical}) {
|
|
1772
|
+
height: 0.5px;
|
|
1773
|
+
width: 100%;
|
|
1774
|
+
margin: ${tokens.space.lg} 0;
|
|
1775
|
+
}`;
|
|
1776
|
+
const vertical = rule`${c$4.vertical} {
|
|
1777
|
+
width: 0.5px;
|
|
1778
|
+
height: auto;
|
|
1779
|
+
align-self: stretch;
|
|
1780
|
+
margin: 0 ${tokens.space.lg};
|
|
1781
|
+
}`;
|
|
1451
1782
|
|
|
1452
1783
|
//#endregion
|
|
1453
|
-
//#region ../
|
|
1454
|
-
/**
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1784
|
+
//#region ../ui/src/components/input/input.style.ts
|
|
1785
|
+
/**
|
|
1786
|
+
* Input component styles
|
|
1787
|
+
*/
|
|
1788
|
+
var input_style_exports = /* @__PURE__ */ __exportAll({
|
|
1789
|
+
label: () => label$1,
|
|
1790
|
+
lg: () => lg$1,
|
|
1791
|
+
md: () => md$1,
|
|
1792
|
+
root: () => root$3,
|
|
1793
|
+
rootStates: () => rootStates,
|
|
1794
|
+
sm: () => sm$1,
|
|
1795
|
+
wrapper: () => wrapper
|
|
1796
|
+
});
|
|
1797
|
+
const c$3 = classes([
|
|
1798
|
+
"root",
|
|
1799
|
+
"wrapper",
|
|
1800
|
+
"label",
|
|
1801
|
+
"sm",
|
|
1802
|
+
"md",
|
|
1803
|
+
"lg"
|
|
1804
|
+
]);
|
|
1805
|
+
const wrapper = rule`${c$3.wrapper} {
|
|
1806
|
+
display: flex;
|
|
1807
|
+
flex-direction: column;
|
|
1808
|
+
gap: ${tokens.space.sm};
|
|
1809
|
+
font-family: ${tokens.fonts.base};
|
|
1810
|
+
}`;
|
|
1811
|
+
const label$1 = rule`${c$3.label} {
|
|
1812
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1813
|
+
font-weight: ${tokens.fontWeights.medium};
|
|
1814
|
+
color: ${tokens.colors.text};
|
|
1815
|
+
letter-spacing: -0.005em;
|
|
1816
|
+
}`;
|
|
1817
|
+
const root$3 = rule`${c$3.root} {
|
|
1818
|
+
display: block;
|
|
1819
|
+
width: 100%;
|
|
1820
|
+
border: 1.5px solid ${tokens.colors.border};
|
|
1821
|
+
border-radius: ${tokens.radii.sm};
|
|
1822
|
+
background: white;
|
|
1823
|
+
color: ${tokens.colors.text};
|
|
1824
|
+
font-family: ${tokens.fonts.base};
|
|
1825
|
+
font-size: ${tokens.fontSizes.md};
|
|
1826
|
+
line-height: ${tokens.lineHeights.normal};
|
|
1827
|
+
transition: all ${tokens.transitions.fast};
|
|
1828
|
+
outline: none;
|
|
1829
|
+
}`;
|
|
1830
|
+
const rootStates = rules(rule`${c$3.root}:focus {
|
|
1831
|
+
border-color: ${tokens.colors.primary};
|
|
1832
|
+
box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
|
|
1833
|
+
}`, rule`${c$3.root}:disabled {
|
|
1834
|
+
opacity: 0.5;
|
|
1835
|
+
cursor: not-allowed;
|
|
1836
|
+
background: ${tokens.colors.surface};
|
|
1837
|
+
}`, rule`${c$3.root}::placeholder {
|
|
1838
|
+
color: ${tokens.colors.textTertiary};
|
|
1839
|
+
}`);
|
|
1840
|
+
const sm$1 = rule`${c$3.sm} {
|
|
1841
|
+
padding: ${tokens.space.sm} ${tokens.space.md};
|
|
1842
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1843
|
+
}`;
|
|
1844
|
+
const md$1 = rule`${c$3.md} {
|
|
1845
|
+
padding: ${tokens.space.md} ${tokens.space.lg};
|
|
1846
|
+
font-size: ${tokens.fontSizes.md};
|
|
1847
|
+
}`;
|
|
1848
|
+
const lg$1 = rule`${c$3.lg} {
|
|
1849
|
+
padding: ${tokens.space.lg} ${tokens.space.xl};
|
|
1850
|
+
font-size: ${tokens.fontSizes.lg};
|
|
1851
|
+
}`;
|
|
1852
|
+
|
|
1853
|
+
//#endregion
|
|
1854
|
+
//#region ../ui/src/components/avatar/avatar.style.ts
|
|
1855
|
+
/**
|
|
1856
|
+
* Avatar component styles
|
|
1857
|
+
*/
|
|
1858
|
+
var avatar_style_exports = /* @__PURE__ */ __exportAll({
|
|
1859
|
+
fallback: () => fallback,
|
|
1860
|
+
image: () => image,
|
|
1861
|
+
lg: () => lg,
|
|
1862
|
+
md: () => md,
|
|
1863
|
+
root: () => root$2,
|
|
1864
|
+
sm: () => sm
|
|
1865
|
+
});
|
|
1866
|
+
const c$2 = classes([
|
|
1867
|
+
"root",
|
|
1868
|
+
"image",
|
|
1869
|
+
"fallback",
|
|
1870
|
+
"sm",
|
|
1871
|
+
"md",
|
|
1872
|
+
"lg"
|
|
1873
|
+
]);
|
|
1874
|
+
const root$2 = rule`${c$2.root} {
|
|
1875
|
+
display: inline-flex;
|
|
1876
|
+
align-items: center;
|
|
1877
|
+
justify-content: center;
|
|
1878
|
+
border-radius: 50%;
|
|
1879
|
+
overflow: hidden;
|
|
1880
|
+
background: ${tokens.colors.surface};
|
|
1881
|
+
border: 1.5px solid ${tokens.colors.border};
|
|
1882
|
+
flex-shrink: 0;
|
|
1883
|
+
font-family: ${tokens.fonts.base};
|
|
1884
|
+
user-select: none;
|
|
1885
|
+
}`;
|
|
1886
|
+
const image = rule`${c$2.image} {
|
|
1887
|
+
width: 100%;
|
|
1888
|
+
height: 100%;
|
|
1889
|
+
object-fit: cover;
|
|
1890
|
+
}`;
|
|
1891
|
+
const fallback = rule`${c$2.fallback} {
|
|
1892
|
+
font-weight: ${tokens.fontWeights.semibold};
|
|
1893
|
+
color: ${tokens.colors.textMuted};
|
|
1894
|
+
text-transform: uppercase;
|
|
1895
|
+
letter-spacing: 0.02em;
|
|
1896
|
+
}`;
|
|
1897
|
+
const sm = rule`${c$2.sm} {
|
|
1898
|
+
width: 32px;
|
|
1899
|
+
height: 32px;
|
|
1900
|
+
font-size: 0.75rem;
|
|
1901
|
+
}`;
|
|
1902
|
+
const md = rule`${c$2.md} {
|
|
1903
|
+
width: 40px;
|
|
1904
|
+
height: 40px;
|
|
1905
|
+
font-size: ${tokens.fontSizes.sm};
|
|
1906
|
+
}`;
|
|
1907
|
+
const lg = rule`${c$2.lg} {
|
|
1908
|
+
width: 48px;
|
|
1909
|
+
height: 48px;
|
|
1910
|
+
font-size: ${tokens.fontSizes.md};
|
|
1911
|
+
}`;
|
|
1912
|
+
|
|
1913
|
+
//#endregion
|
|
1914
|
+
//#region ../ui/src/components/kbd/kbd.style.ts
|
|
1915
|
+
/**
|
|
1916
|
+
* Kbd (keyboard) component styles
|
|
1917
|
+
*/
|
|
1918
|
+
var kbd_style_exports = /* @__PURE__ */ __exportAll({ root: () => root$1 });
|
|
1919
|
+
const c$1 = classes(["root"]);
|
|
1920
|
+
const root$1 = rule`${c$1.root} {
|
|
1921
|
+
display: inline-flex;
|
|
1922
|
+
align-items: center;
|
|
1923
|
+
justify-content: center;
|
|
1924
|
+
min-width: 1.5em;
|
|
1925
|
+
padding: 0.15rem 0.4rem;
|
|
1926
|
+
background: ${tokens.colors.surface};
|
|
1927
|
+
border: 0.5px solid ${tokens.colors.border};
|
|
1928
|
+
border-bottom-width: 2px;
|
|
1929
|
+
border-radius: 6px;
|
|
1930
|
+
font-family: ${tokens.fonts.base};
|
|
1931
|
+
font-size: 0.8125rem;
|
|
1932
|
+
font-weight: ${tokens.fontWeights.medium};
|
|
1933
|
+
color: ${tokens.colors.text};
|
|
1934
|
+
line-height: 1.4;
|
|
1935
|
+
white-space: nowrap;
|
|
1936
|
+
user-select: none;
|
|
1937
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
|
1938
|
+
}`;
|
|
1939
|
+
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region ../ui/src/components/switch/switch.style.ts
|
|
1942
|
+
/**
|
|
1943
|
+
* Switch component styles
|
|
1944
|
+
*/
|
|
1945
|
+
var switch_style_exports = /* @__PURE__ */ __exportAll({
|
|
1946
|
+
label: () => label,
|
|
1947
|
+
root: () => root,
|
|
1948
|
+
rootDisabled: () => rootDisabled,
|
|
1949
|
+
thumb: () => thumb,
|
|
1950
|
+
thumbOn: () => thumbOn,
|
|
1951
|
+
track: () => track,
|
|
1952
|
+
trackOn: () => trackOn
|
|
1953
|
+
});
|
|
1954
|
+
const c = classes([
|
|
1955
|
+
"root",
|
|
1956
|
+
"track",
|
|
1957
|
+
"trackOn",
|
|
1958
|
+
"thumb",
|
|
1959
|
+
"thumbOn",
|
|
1960
|
+
"label"
|
|
1961
|
+
]);
|
|
1962
|
+
const root = rule`${c.root} {
|
|
1963
|
+
display: inline-flex;
|
|
1964
|
+
align-items: center;
|
|
1965
|
+
gap: ${tokens.space.md};
|
|
1966
|
+
cursor: pointer;
|
|
1967
|
+
font-family: ${tokens.fonts.base};
|
|
1968
|
+
user-select: none;
|
|
1969
|
+
}`;
|
|
1970
|
+
const rootDisabled = rule`${c.root}[aria-disabled="true"] {
|
|
1971
|
+
opacity: 0.5;
|
|
1972
|
+
cursor: not-allowed;
|
|
1973
|
+
}`;
|
|
1974
|
+
const track = rule`${c.track} {
|
|
1975
|
+
position: relative;
|
|
1976
|
+
width: 44px;
|
|
1977
|
+
height: 24px;
|
|
1978
|
+
background: ${tokens.colors.border};
|
|
1979
|
+
border-radius: 12px;
|
|
1980
|
+
transition: background ${tokens.transitions.fast};
|
|
1981
|
+
flex-shrink: 0;
|
|
1982
|
+
}`;
|
|
1983
|
+
const trackOn = rule`${c.trackOn} {
|
|
1984
|
+
background: ${tokens.colors.primary};
|
|
1985
|
+
}`;
|
|
1986
|
+
const thumb = rule`${c.thumb} {
|
|
1987
|
+
position: absolute;
|
|
1988
|
+
top: 2px;
|
|
1989
|
+
left: 2px;
|
|
1990
|
+
width: 20px;
|
|
1991
|
+
height: 20px;
|
|
1992
|
+
background: white;
|
|
1993
|
+
border-radius: 50%;
|
|
1994
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
1995
|
+
transition: transform ${tokens.transitions.fast};
|
|
1996
|
+
}`;
|
|
1997
|
+
const thumbOn = rule`${c.thumbOn} {
|
|
1998
|
+
transform: translateX(20px);
|
|
1999
|
+
}`;
|
|
2000
|
+
const label = rule`${c.label} {
|
|
2001
|
+
font-size: ${tokens.fontSizes.sm};
|
|
2002
|
+
font-weight: ${tokens.fontWeights.medium};
|
|
2003
|
+
color: ${tokens.colors.text};
|
|
2004
|
+
letter-spacing: -0.005em;
|
|
2005
|
+
}`;
|
|
2006
|
+
|
|
2007
|
+
//#endregion
|
|
2008
|
+
//#region ../ui/src/css.ts
|
|
2009
|
+
/**
|
|
2010
|
+
* Pre-collected CSS for SSG/SSR usage
|
|
2011
|
+
*
|
|
2012
|
+
* Since @semajsx/style's inject() requires a DOM, this module provides
|
|
2013
|
+
* all component CSS as a static string for server-side rendering.
|
|
2014
|
+
*
|
|
2015
|
+
* @example
|
|
2016
|
+
* ```tsx
|
|
2017
|
+
* import { componentCSS } from "@semajsx/ui/css";
|
|
2018
|
+
*
|
|
2019
|
+
* // Include in a <style> tag for SSG output
|
|
2020
|
+
* <style>{componentCSS}</style>
|
|
2021
|
+
* ```
|
|
2022
|
+
*/
|
|
2023
|
+
function collectCSS(styles) {
|
|
2024
|
+
return Object.values(styles).filter((v) => isStyleToken(v)).map((t) => t.__cssTemplate).join("\n");
|
|
2025
|
+
}
|
|
2026
|
+
/** All @semajsx/ui component CSS (theme variables + component rules) */
|
|
2027
|
+
const componentCSS = [
|
|
2028
|
+
lightTheme.__cssTemplate,
|
|
2029
|
+
collectCSS(button_style_exports),
|
|
2030
|
+
collectCSS(card_style_exports),
|
|
2031
|
+
collectCSS(callout_style_exports),
|
|
2032
|
+
collectCSS(badge_style_exports),
|
|
2033
|
+
collectCSS(code_block_style_exports),
|
|
2034
|
+
collectCSS(tabs_style_exports),
|
|
2035
|
+
collectCSS(steps_style_exports),
|
|
2036
|
+
collectCSS(separator_style_exports),
|
|
2037
|
+
collectCSS(input_style_exports),
|
|
2038
|
+
collectCSS(avatar_style_exports),
|
|
2039
|
+
collectCSS(kbd_style_exports),
|
|
2040
|
+
collectCSS(switch_style_exports)
|
|
2041
|
+
].join("\n");
|
|
2042
|
+
|
|
2043
|
+
//#endregion
|
|
2044
|
+
//#region ../ui/src/components/button/button.tsx
|
|
2045
|
+
const variantStyles = {
|
|
2046
|
+
solid: [solid, solidStates],
|
|
2047
|
+
outline: [outline, outlineStates],
|
|
2048
|
+
ghost: [ghost, ghostStates]
|
|
2049
|
+
};
|
|
2050
|
+
const sizeStyles$2 = {
|
|
2051
|
+
sm: sm$2,
|
|
2052
|
+
md: md$2,
|
|
2053
|
+
lg: lg$2
|
|
2054
|
+
};
|
|
2055
|
+
function Button(props) {
|
|
2056
|
+
const variant = props.variant ?? "solid";
|
|
2057
|
+
const size = props.size ?? "md";
|
|
2058
|
+
const color = props.color ?? "default";
|
|
2059
|
+
return /* @__PURE__ */ jsx("button", {
|
|
2060
|
+
type: props.type ?? "button",
|
|
2061
|
+
disabled: props.disabled,
|
|
2062
|
+
class: [
|
|
2063
|
+
root$6,
|
|
2064
|
+
rootStates$1,
|
|
2065
|
+
...variantStyles[variant],
|
|
2066
|
+
sizeStyles$2[size],
|
|
2067
|
+
color === "danger" && [danger, dangerStates],
|
|
2068
|
+
props.class
|
|
2069
|
+
],
|
|
2070
|
+
onClick: props.onClick,
|
|
2071
|
+
"aria-label": props["aria-label"],
|
|
2072
|
+
children: props.children
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
//#endregion
|
|
2077
|
+
//#region ../ui/src/components/separator/separator.tsx
|
|
2078
|
+
function Separator(props) {
|
|
2079
|
+
const orientation = props.orientation ?? "horizontal";
|
|
2080
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2081
|
+
role: "separator",
|
|
2082
|
+
"aria-orientation": orientation,
|
|
2083
|
+
class: [
|
|
2084
|
+
root$4,
|
|
2085
|
+
horizontal,
|
|
2086
|
+
orientation === "vertical" && vertical,
|
|
2087
|
+
props.class
|
|
2088
|
+
],
|
|
2089
|
+
style: props.style
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
//#endregion
|
|
2094
|
+
//#region ../ui/src/components/input/input.tsx
|
|
2095
|
+
const sizeStyles$1 = {
|
|
2096
|
+
sm: sm$1,
|
|
2097
|
+
md: md$1,
|
|
2098
|
+
lg: lg$1
|
|
2099
|
+
};
|
|
2100
|
+
function Input(props) {
|
|
2101
|
+
const size = props.size ?? "md";
|
|
2102
|
+
const inputId = props.id ?? props.name;
|
|
2103
|
+
const input = /* @__PURE__ */ jsx("input", {
|
|
2104
|
+
type: props.type ?? "text",
|
|
2105
|
+
id: inputId,
|
|
2106
|
+
name: props.name,
|
|
2107
|
+
placeholder: props.placeholder,
|
|
2108
|
+
value: props.value,
|
|
2109
|
+
disabled: props.disabled,
|
|
2110
|
+
readOnly: props.readOnly,
|
|
2111
|
+
class: [
|
|
2112
|
+
root$3,
|
|
2113
|
+
rootStates,
|
|
2114
|
+
sizeStyles$1[size],
|
|
2115
|
+
props.class
|
|
2116
|
+
]
|
|
2117
|
+
});
|
|
2118
|
+
if (props.label) return /* @__PURE__ */ jsxs("div", {
|
|
2119
|
+
class: wrapper,
|
|
2120
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
2121
|
+
class: label$1,
|
|
2122
|
+
for: inputId,
|
|
2123
|
+
children: props.label
|
|
2124
|
+
}), input]
|
|
2125
|
+
});
|
|
2126
|
+
return input;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
//#endregion
|
|
2130
|
+
//#region ../ui/src/components/avatar/avatar.tsx
|
|
2131
|
+
const sizeStyles = {
|
|
2132
|
+
sm,
|
|
2133
|
+
md,
|
|
2134
|
+
lg
|
|
2135
|
+
};
|
|
2136
|
+
function Avatar(props) {
|
|
2137
|
+
const size = props.size ?? "md";
|
|
2138
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2139
|
+
class: [
|
|
2140
|
+
root$2,
|
|
2141
|
+
sizeStyles[size],
|
|
2142
|
+
props.class
|
|
2143
|
+
],
|
|
2144
|
+
role: "img",
|
|
2145
|
+
"aria-label": props.alt ?? props.initials ?? "Avatar",
|
|
2146
|
+
children: props.src ? /* @__PURE__ */ jsx("img", {
|
|
2147
|
+
class: image,
|
|
2148
|
+
src: props.src,
|
|
2149
|
+
alt: props.alt ?? ""
|
|
2150
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
2151
|
+
class: fallback,
|
|
2152
|
+
children: props.initials ?? "?"
|
|
2153
|
+
})
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
//#endregion
|
|
2158
|
+
//#region ../ui/src/components/kbd/kbd.tsx
|
|
2159
|
+
function Kbd(props) {
|
|
2160
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
2161
|
+
class: [root$1, props.class],
|
|
2162
|
+
children: props.children
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
//#endregion
|
|
2167
|
+
//#region ../ui/src/components/switch/switch.tsx
|
|
2168
|
+
function Switch(props) {
|
|
2169
|
+
const checked = props.checked ?? false;
|
|
2170
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2171
|
+
role: "switch",
|
|
2172
|
+
"aria-checked": checked ? "true" : "false",
|
|
2173
|
+
"aria-disabled": props.disabled ? "true" : void 0,
|
|
2174
|
+
class: [
|
|
2175
|
+
root,
|
|
2176
|
+
rootDisabled,
|
|
2177
|
+
props.class
|
|
2178
|
+
],
|
|
2179
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2180
|
+
class: [track, checked && trackOn],
|
|
2181
|
+
children: /* @__PURE__ */ jsx("div", { class: [thumb, checked && thumbOn] })
|
|
2182
|
+
}), props.label && /* @__PURE__ */ jsx("span", {
|
|
2183
|
+
class: label,
|
|
2184
|
+
children: props.label
|
|
2185
|
+
})]
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
//#endregion
|
|
2190
|
+
//#region ../ssg/src/plugins/docs-theme/components.tsx
|
|
2191
|
+
/** Concatenate class names, filtering falsy values */
|
|
2192
|
+
function cx(...args) {
|
|
2193
|
+
return args.filter(Boolean).join(" ");
|
|
2194
|
+
}
|
|
2195
|
+
function ComponentPreview({ label, children }) {
|
|
2196
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2197
|
+
class: "dt-preview",
|
|
2198
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2199
|
+
class: "dt-preview-box",
|
|
2200
|
+
children: [label && /* @__PURE__ */ jsx("span", {
|
|
2201
|
+
class: "dt-preview-label",
|
|
2202
|
+
children: label
|
|
2203
|
+
}), children]
|
|
2204
|
+
})
|
|
2205
|
+
});
|
|
2206
|
+
}
|
|
2207
|
+
function CodeBlock({ children, className, language }) {
|
|
2208
|
+
const lang = language || (className?.replace(/^language-/, "") ?? "text");
|
|
2209
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2210
|
+
class: "dt-code-block",
|
|
2211
|
+
children: [lang && lang !== "text" && /* @__PURE__ */ jsx("div", {
|
|
2212
|
+
class: "dt-code-header",
|
|
2213
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
2214
|
+
class: "dt-code-lang",
|
|
2215
|
+
children: lang
|
|
2216
|
+
})
|
|
2217
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
2218
|
+
class: className,
|
|
2219
|
+
children: /* @__PURE__ */ jsx("code", { children })
|
|
2220
|
+
})]
|
|
2221
|
+
});
|
|
2222
|
+
}
|
|
1474
2223
|
const DIFFICULTY_COLORS = {
|
|
1475
2224
|
beginner: "success",
|
|
1476
2225
|
intermediate: "warning",
|
|
@@ -1671,6 +2420,75 @@ function createComponents(options) {
|
|
|
1671
2420
|
})
|
|
1672
2421
|
] });
|
|
1673
2422
|
}
|
|
2423
|
+
function DocsIndexHome({ docs: docsList, guides: guidesList }) {
|
|
2424
|
+
const docsConf = options.docs;
|
|
2425
|
+
const guidesConf = options.guides;
|
|
2426
|
+
const docsBasePath = docsConf?.basePath ?? "/docs";
|
|
2427
|
+
const guidesBasePath = guidesConf?.basePath ?? "/guides";
|
|
2428
|
+
return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("div", {
|
|
2429
|
+
style: "max-width: 720px;",
|
|
2430
|
+
children: [
|
|
2431
|
+
/* @__PURE__ */ jsxs("div", {
|
|
2432
|
+
style: "margin-bottom: 3rem;",
|
|
2433
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
2434
|
+
class: cx("dt-page-title", "dt-anim-slide-up"),
|
|
2435
|
+
children: options.title
|
|
2436
|
+
}), options.description && /* @__PURE__ */ jsx("p", {
|
|
2437
|
+
class: cx("dt-page-desc", "dt-anim-slide-up", "dt-stagger-1"),
|
|
2438
|
+
children: options.description
|
|
2439
|
+
})]
|
|
2440
|
+
}),
|
|
2441
|
+
docsList.length > 0 && /* @__PURE__ */ jsxs("section", {
|
|
2442
|
+
class: "dt-fade-in",
|
|
2443
|
+
style: "margin-bottom: 2.5rem;",
|
|
2444
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
2445
|
+
class: "dt-category-heading",
|
|
2446
|
+
children: docsConf?.heading ?? "Documentation"
|
|
2447
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2448
|
+
style: "display: flex; flex-direction: column; gap: 0.75rem;",
|
|
2449
|
+
children: docsList.sort((a, b) => a.data.order - b.data.order).map((doc, i) => /* @__PURE__ */ jsx(Card, {
|
|
2450
|
+
variant: "link",
|
|
2451
|
+
href: `${docsBasePath}/${doc.slug}`,
|
|
2452
|
+
heading: doc.data.title,
|
|
2453
|
+
description: doc.data.description,
|
|
2454
|
+
class: cx("dt-anim-scale-in"),
|
|
2455
|
+
style: `animation-delay: ${.1 + i * .08}s;`
|
|
2456
|
+
}, doc.slug))
|
|
2457
|
+
})]
|
|
2458
|
+
}),
|
|
2459
|
+
guidesList.length > 0 && /* @__PURE__ */ jsxs("section", {
|
|
2460
|
+
class: "dt-fade-in",
|
|
2461
|
+
style: "margin-bottom: 2.5rem;",
|
|
2462
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
2463
|
+
class: "dt-category-heading",
|
|
2464
|
+
children: guidesConf?.heading ?? "Guides"
|
|
2465
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2466
|
+
style: "display: flex; flex-direction: column; gap: 0.75rem;",
|
|
2467
|
+
children: guidesList.sort((a, b) => a.data.order - b.data.order).map((guide, i) => /* @__PURE__ */ jsxs(Card, {
|
|
2468
|
+
variant: "link",
|
|
2469
|
+
href: `${guidesBasePath}/${guide.slug}`,
|
|
2470
|
+
class: cx("dt-anim-scale-in"),
|
|
2471
|
+
style: `animation-delay: ${.1 + i * .08}s;`,
|
|
2472
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2473
|
+
style: "display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.375rem;",
|
|
2474
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
2475
|
+
class: "dt-card-title",
|
|
2476
|
+
style: "margin: 0;",
|
|
2477
|
+
children: guide.data.title
|
|
2478
|
+
}), /* @__PURE__ */ jsx(Badge, {
|
|
2479
|
+
color: DIFFICULTY_COLORS[guide.data.difficulty] ?? "default",
|
|
2480
|
+
children: guide.data.difficulty
|
|
2481
|
+
})]
|
|
2482
|
+
}), guide.data.description && /* @__PURE__ */ jsx("p", {
|
|
2483
|
+
class: "dt-card-desc",
|
|
2484
|
+
children: guide.data.description
|
|
2485
|
+
})]
|
|
2486
|
+
}, guide.slug))
|
|
2487
|
+
})]
|
|
2488
|
+
})
|
|
2489
|
+
]
|
|
2490
|
+
}) });
|
|
2491
|
+
}
|
|
1674
2492
|
function DocsIndex({ docs: docsList }) {
|
|
1675
2493
|
const docsConf = options.docs;
|
|
1676
2494
|
const heading = docsConf?.heading ?? "Documentation";
|
|
@@ -1816,6 +2634,233 @@ function createComponents(options) {
|
|
|
1816
2634
|
})]
|
|
1817
2635
|
}) });
|
|
1818
2636
|
}
|
|
2637
|
+
function UIIndex({ components: componentsList }) {
|
|
2638
|
+
const uiConf = options.ui;
|
|
2639
|
+
const heading = uiConf?.heading ?? "Components";
|
|
2640
|
+
const desc = uiConf?.description ?? "";
|
|
2641
|
+
const basePath = uiConf?.basePath ?? "/ui";
|
|
2642
|
+
const byCategory = componentsList.reduce((acc, comp) => {
|
|
2643
|
+
const category = comp.data.category || "General";
|
|
2644
|
+
if (!acc[category]) acc[category] = [];
|
|
2645
|
+
acc[category].push(comp);
|
|
2646
|
+
return acc;
|
|
2647
|
+
}, {});
|
|
2648
|
+
Object.values(byCategory).forEach((items) => items.sort((a, b) => a.data.order - b.data.order));
|
|
2649
|
+
return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("div", {
|
|
2650
|
+
style: "max-width: 960px;",
|
|
2651
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2652
|
+
style: "margin-bottom: 3rem;",
|
|
2653
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
2654
|
+
class: cx("dt-page-title", "dt-anim-slide-up"),
|
|
2655
|
+
children: heading
|
|
2656
|
+
}), desc && /* @__PURE__ */ jsx("p", {
|
|
2657
|
+
class: cx("dt-page-desc", "dt-anim-slide-up", "dt-stagger-1"),
|
|
2658
|
+
children: desc
|
|
2659
|
+
})]
|
|
2660
|
+
}), Object.entries(byCategory).map(([category, items]) => /* @__PURE__ */ jsxs("section", {
|
|
2661
|
+
class: "dt-fade-in",
|
|
2662
|
+
style: "margin-bottom: 2.5rem;",
|
|
2663
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
2664
|
+
class: "dt-category-heading",
|
|
2665
|
+
children: category
|
|
2666
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2667
|
+
class: "dt-ui-grid",
|
|
2668
|
+
children: items.map((comp, i) => /* @__PURE__ */ jsxs("a", {
|
|
2669
|
+
href: `${basePath}/${comp.slug}`,
|
|
2670
|
+
class: cx("dt-ui-card", "dt-anim-scale-in"),
|
|
2671
|
+
style: `animation-delay: ${.05 + i * .05}s;`,
|
|
2672
|
+
children: [
|
|
2673
|
+
/* @__PURE__ */ jsx("div", {
|
|
2674
|
+
class: "dt-ui-card-preview",
|
|
2675
|
+
children: renderMiniPreview(comp.slug)
|
|
2676
|
+
}),
|
|
2677
|
+
/* @__PURE__ */ jsx("h3", {
|
|
2678
|
+
class: "dt-ui-card-name",
|
|
2679
|
+
children: comp.data.title
|
|
2680
|
+
}),
|
|
2681
|
+
comp.data.description && /* @__PURE__ */ jsx("p", {
|
|
2682
|
+
class: "dt-ui-card-desc",
|
|
2683
|
+
children: comp.data.description
|
|
2684
|
+
})
|
|
2685
|
+
]
|
|
2686
|
+
}, comp.slug))
|
|
2687
|
+
})]
|
|
2688
|
+
}, category))]
|
|
2689
|
+
}) });
|
|
2690
|
+
}
|
|
2691
|
+
/** Renders a small preview of the component for the index grid cards */
|
|
2692
|
+
function renderMiniPreview(slug) {
|
|
2693
|
+
switch (slug) {
|
|
2694
|
+
case "button": return /* @__PURE__ */ jsxs("div", {
|
|
2695
|
+
style: "display: flex; gap: 0.5rem; position: relative; z-index: 1;",
|
|
2696
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
2697
|
+
size: "sm",
|
|
2698
|
+
children: "Button"
|
|
2699
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
2700
|
+
size: "sm",
|
|
2701
|
+
variant: "outline",
|
|
2702
|
+
children: "Outline"
|
|
2703
|
+
})]
|
|
2704
|
+
});
|
|
2705
|
+
case "badge": return /* @__PURE__ */ jsxs("div", {
|
|
2706
|
+
style: "display: flex; gap: 0.5rem; position: relative; z-index: 1;",
|
|
2707
|
+
children: [
|
|
2708
|
+
/* @__PURE__ */ jsx(Badge, { children: "Default" }),
|
|
2709
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
2710
|
+
color: "success",
|
|
2711
|
+
children: "Success"
|
|
2712
|
+
}),
|
|
2713
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
2714
|
+
color: "warning",
|
|
2715
|
+
children: "Warning"
|
|
2716
|
+
})
|
|
2717
|
+
]
|
|
2718
|
+
});
|
|
2719
|
+
case "input": return /* @__PURE__ */ jsx("div", {
|
|
2720
|
+
style: "width: 160px; position: relative; z-index: 1;",
|
|
2721
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
2722
|
+
size: "sm",
|
|
2723
|
+
placeholder: "Type here..."
|
|
2724
|
+
})
|
|
2725
|
+
});
|
|
2726
|
+
case "switch": return /* @__PURE__ */ jsxs("div", {
|
|
2727
|
+
style: "display: flex; gap: 1rem; position: relative; z-index: 1;",
|
|
2728
|
+
children: [/* @__PURE__ */ jsx(Switch, {}), /* @__PURE__ */ jsx(Switch, { checked: true })]
|
|
2729
|
+
});
|
|
2730
|
+
case "avatar": return /* @__PURE__ */ jsxs("div", {
|
|
2731
|
+
style: "display: flex; gap: 0.5rem; position: relative; z-index: 1;",
|
|
2732
|
+
children: [
|
|
2733
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
2734
|
+
initials: "AB",
|
|
2735
|
+
size: "sm"
|
|
2736
|
+
}),
|
|
2737
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
2738
|
+
initials: "CD",
|
|
2739
|
+
size: "md"
|
|
2740
|
+
}),
|
|
2741
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
2742
|
+
initials: "EF",
|
|
2743
|
+
size: "lg"
|
|
2744
|
+
})
|
|
2745
|
+
]
|
|
2746
|
+
});
|
|
2747
|
+
case "separator": return /* @__PURE__ */ jsxs("div", {
|
|
2748
|
+
style: "width: 120px; position: relative; z-index: 1;",
|
|
2749
|
+
children: [
|
|
2750
|
+
/* @__PURE__ */ jsx("div", {
|
|
2751
|
+
style: "font-size: 0.75rem; color: #86868b; text-align: center;",
|
|
2752
|
+
children: "Above"
|
|
2753
|
+
}),
|
|
2754
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
2755
|
+
/* @__PURE__ */ jsx("div", {
|
|
2756
|
+
style: "font-size: 0.75rem; color: #86868b; text-align: center;",
|
|
2757
|
+
children: "Below"
|
|
2758
|
+
})
|
|
2759
|
+
]
|
|
2760
|
+
});
|
|
2761
|
+
case "kbd": return /* @__PURE__ */ jsxs("div", {
|
|
2762
|
+
style: "display: flex; gap: 0.25rem; align-items: center; position: relative; z-index: 1;",
|
|
2763
|
+
children: [
|
|
2764
|
+
/* @__PURE__ */ jsx(Kbd, { children: "Cmd" }),
|
|
2765
|
+
/* @__PURE__ */ jsx("span", {
|
|
2766
|
+
style: "color: #86868b; font-size: 0.75rem;",
|
|
2767
|
+
children: "+"
|
|
2768
|
+
}),
|
|
2769
|
+
/* @__PURE__ */ jsx(Kbd, { children: "K" })
|
|
2770
|
+
]
|
|
2771
|
+
});
|
|
2772
|
+
case "card": return /* @__PURE__ */ jsx("div", {
|
|
2773
|
+
style: "transform: scale(0.45); transform-origin: center; position: relative; z-index: 1; width: 240px;",
|
|
2774
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
2775
|
+
heading: "Card Title",
|
|
2776
|
+
description: "A brief description"
|
|
2777
|
+
})
|
|
2778
|
+
});
|
|
2779
|
+
case "callout": return /* @__PURE__ */ jsx("div", {
|
|
2780
|
+
style: "transform: scale(0.6); transform-origin: center; position: relative; z-index: 1; width: 260px;",
|
|
2781
|
+
children: /* @__PURE__ */ jsx(Callout, {
|
|
2782
|
+
type: "info",
|
|
2783
|
+
children: "Informational callout"
|
|
2784
|
+
})
|
|
2785
|
+
});
|
|
2786
|
+
case "tabs": return /* @__PURE__ */ jsx("div", {
|
|
2787
|
+
style: "transform: scale(0.7); transform-origin: center; position: relative; z-index: 1; width: 200px;",
|
|
2788
|
+
children: /* @__PURE__ */ jsx(Tabs, {
|
|
2789
|
+
defaultValue: "one",
|
|
2790
|
+
children: /* @__PURE__ */ jsxs(TabList, { children: [/* @__PURE__ */ jsx(Tab, {
|
|
2791
|
+
value: "one",
|
|
2792
|
+
children: "First"
|
|
2793
|
+
}), /* @__PURE__ */ jsx(Tab, {
|
|
2794
|
+
value: "two",
|
|
2795
|
+
children: "Second"
|
|
2796
|
+
})] })
|
|
2797
|
+
})
|
|
2798
|
+
});
|
|
2799
|
+
case "steps": return /* @__PURE__ */ jsx("div", {
|
|
2800
|
+
style: "transform: scale(0.4); transform-origin: center; position: relative; z-index: 1; width: 200px;",
|
|
2801
|
+
children: /* @__PURE__ */ jsxs(Steps, { children: [/* @__PURE__ */ jsx(Step, {
|
|
2802
|
+
title: "Install",
|
|
2803
|
+
number: 1,
|
|
2804
|
+
children: "bun add semajsx"
|
|
2805
|
+
}), /* @__PURE__ */ jsx(Step, {
|
|
2806
|
+
title: "Build",
|
|
2807
|
+
number: 2,
|
|
2808
|
+
children: "Create app"
|
|
2809
|
+
})] })
|
|
2810
|
+
});
|
|
2811
|
+
case "code-block": return /* @__PURE__ */ jsx("div", {
|
|
2812
|
+
style: "position: relative; z-index: 1; width: 160px;",
|
|
2813
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2814
|
+
style: "background: #1e1e1e; border-radius: 6px; padding: 8px 10px; font-family: ui-monospace, 'SF Mono', monospace; font-size: 0.625rem; color: #d4d4d4; line-height: 1.5; white-space: pre; overflow: hidden;",
|
|
2815
|
+
children: [
|
|
2816
|
+
/* @__PURE__ */ jsx("span", {
|
|
2817
|
+
style: "color: #c586c0;",
|
|
2818
|
+
children: "const"
|
|
2819
|
+
}),
|
|
2820
|
+
" ",
|
|
2821
|
+
/* @__PURE__ */ jsx("span", {
|
|
2822
|
+
style: "color: #9cdcfe;",
|
|
2823
|
+
children: "x"
|
|
2824
|
+
}),
|
|
2825
|
+
" ",
|
|
2826
|
+
/* @__PURE__ */ jsx("span", {
|
|
2827
|
+
style: "color: #d4d4d4;",
|
|
2828
|
+
children: "="
|
|
2829
|
+
}),
|
|
2830
|
+
" ",
|
|
2831
|
+
/* @__PURE__ */ jsx("span", {
|
|
2832
|
+
style: "color: #b5cea8;",
|
|
2833
|
+
children: "42"
|
|
2834
|
+
}),
|
|
2835
|
+
";"
|
|
2836
|
+
]
|
|
2837
|
+
})
|
|
2838
|
+
});
|
|
2839
|
+
default: return /* @__PURE__ */ jsx("div", {
|
|
2840
|
+
style: "font-size: 0.6875rem; color: #86868b; position: relative; z-index: 1;",
|
|
2841
|
+
children: slug
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
function UIPage({ component: comp, content }) {
|
|
2846
|
+
return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("article", {
|
|
2847
|
+
class: "dt-page-container",
|
|
2848
|
+
style: "max-width: 800px;",
|
|
2849
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2850
|
+
style: "margin-bottom: 2.5rem;",
|
|
2851
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
2852
|
+
class: cx("dt-page-title", "dt-anim-slide-up"),
|
|
2853
|
+
children: comp.data.title
|
|
2854
|
+
}), comp.data.description && /* @__PURE__ */ jsx("p", {
|
|
2855
|
+
class: cx("dt-content-desc", "dt-anim-slide-up", "dt-stagger-1"),
|
|
2856
|
+
children: comp.data.description
|
|
2857
|
+
})]
|
|
2858
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2859
|
+
class: cx("dt-content", "dt-fade-in"),
|
|
2860
|
+
children: content
|
|
2861
|
+
})]
|
|
2862
|
+
}) });
|
|
2863
|
+
}
|
|
1819
2864
|
function NotFound() {
|
|
1820
2865
|
return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsx("div", {
|
|
1821
2866
|
class: cx("dt-hero-bg", "dt-not-found-section"),
|
|
@@ -1857,13 +2902,214 @@ function createComponents(options) {
|
|
|
1857
2902
|
Document,
|
|
1858
2903
|
Layout,
|
|
1859
2904
|
HomePage,
|
|
2905
|
+
DocsIndexHome,
|
|
1860
2906
|
DocsIndex,
|
|
1861
2907
|
DocPage,
|
|
1862
2908
|
GuidesIndex,
|
|
1863
2909
|
GuidePage,
|
|
2910
|
+
UIIndex,
|
|
2911
|
+
UIPage,
|
|
1864
2912
|
NotFound,
|
|
2913
|
+
ComponentPreview,
|
|
1865
2914
|
Callout,
|
|
1866
|
-
CodeBlock
|
|
2915
|
+
CodeBlock,
|
|
2916
|
+
Tabs,
|
|
2917
|
+
TabList,
|
|
2918
|
+
Tab,
|
|
2919
|
+
TabPanel,
|
|
2920
|
+
Steps,
|
|
2921
|
+
Step,
|
|
2922
|
+
Button,
|
|
2923
|
+
Badge,
|
|
2924
|
+
Card,
|
|
2925
|
+
Separator,
|
|
2926
|
+
Input,
|
|
2927
|
+
Avatar,
|
|
2928
|
+
Kbd,
|
|
2929
|
+
Switch
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
//#endregion
|
|
2934
|
+
//#region ../ssg/src/plugins/llms/index.ts
|
|
2935
|
+
function normalizePath(path) {
|
|
2936
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
2937
|
+
}
|
|
2938
|
+
function resolveUrl(base, path) {
|
|
2939
|
+
if (!base) return path;
|
|
2940
|
+
return `${base.replace(/\/$/, "")}${path}`;
|
|
2941
|
+
}
|
|
2942
|
+
function getEntryTitle(entry) {
|
|
2943
|
+
return entry.data.title ?? entry.slug;
|
|
2944
|
+
}
|
|
2945
|
+
function getEntryDescription(entry) {
|
|
2946
|
+
return entry.data.description;
|
|
2947
|
+
}
|
|
2948
|
+
function formatLink(title, url, description) {
|
|
2949
|
+
return description ? `- [${title}](${url}): ${description}` : `- [${title}](${url})`;
|
|
2950
|
+
}
|
|
2951
|
+
/**
|
|
2952
|
+
* Generate llms.txt content following the llms.txt specification.
|
|
2953
|
+
*
|
|
2954
|
+
* Format:
|
|
2955
|
+
* - H1: site title (required)
|
|
2956
|
+
* - Blockquote: site description (optional)
|
|
2957
|
+
* - H2 sections: collection entries as markdown links
|
|
2958
|
+
* - ## Optional: additional links
|
|
2959
|
+
*
|
|
2960
|
+
* @see https://llmstxt.org/
|
|
2961
|
+
*/
|
|
2962
|
+
function generateLlmsTxt(options, sectionEntries) {
|
|
2963
|
+
const lines = [];
|
|
2964
|
+
lines.push(`# ${options.title}`);
|
|
2965
|
+
lines.push("");
|
|
2966
|
+
if (options.description) {
|
|
2967
|
+
lines.push(`> ${options.description}`);
|
|
2968
|
+
lines.push("");
|
|
2969
|
+
}
|
|
2970
|
+
for (const section of options.sections ?? []) {
|
|
2971
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
2972
|
+
if (entries.length === 0) continue;
|
|
2973
|
+
const basePath = normalizePath(section.basePath);
|
|
2974
|
+
lines.push(`## ${section.title}`);
|
|
2975
|
+
lines.push("");
|
|
2976
|
+
for (const entry of entries) {
|
|
2977
|
+
const title = getEntryTitle(entry);
|
|
2978
|
+
const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);
|
|
2979
|
+
const desc = getEntryDescription(entry);
|
|
2980
|
+
lines.push(formatLink(title, url, desc));
|
|
2981
|
+
}
|
|
2982
|
+
lines.push("");
|
|
2983
|
+
}
|
|
2984
|
+
if (options.links?.length) {
|
|
2985
|
+
lines.push("## Optional");
|
|
2986
|
+
lines.push("");
|
|
2987
|
+
for (const link of options.links) lines.push(formatLink(link.title, link.url, link.description));
|
|
2988
|
+
lines.push("");
|
|
2989
|
+
}
|
|
2990
|
+
return lines.join("\n");
|
|
2991
|
+
}
|
|
2992
|
+
/**
|
|
2993
|
+
* Generate llms-full.txt with complete content for each entry.
|
|
2994
|
+
* Includes the full markdown body of every collection entry.
|
|
2995
|
+
*/
|
|
2996
|
+
function generateLlmsFullTxt(options, sectionEntries) {
|
|
2997
|
+
const lines = [];
|
|
2998
|
+
lines.push(`# ${options.title}`);
|
|
2999
|
+
lines.push("");
|
|
3000
|
+
if (options.description) {
|
|
3001
|
+
lines.push(`> ${options.description}`);
|
|
3002
|
+
lines.push("");
|
|
3003
|
+
}
|
|
3004
|
+
for (const section of options.sections ?? []) {
|
|
3005
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
3006
|
+
if (entries.length === 0) continue;
|
|
3007
|
+
const basePath = normalizePath(section.basePath);
|
|
3008
|
+
lines.push(`## ${section.title}`);
|
|
3009
|
+
lines.push("");
|
|
3010
|
+
for (const entry of entries) {
|
|
3011
|
+
const title = getEntryTitle(entry);
|
|
3012
|
+
const url = resolveUrl(options.url, `${basePath}/${entry.slug}`);
|
|
3013
|
+
const desc = getEntryDescription(entry);
|
|
3014
|
+
lines.push(`### ${title}`);
|
|
3015
|
+
if (desc) {
|
|
3016
|
+
lines.push("");
|
|
3017
|
+
lines.push(`> ${desc}`);
|
|
3018
|
+
}
|
|
3019
|
+
lines.push("");
|
|
3020
|
+
lines.push(`Source: ${url}`);
|
|
3021
|
+
lines.push("");
|
|
3022
|
+
lines.push(entry.body.trim());
|
|
3023
|
+
lines.push("");
|
|
3024
|
+
lines.push("---");
|
|
3025
|
+
lines.push("");
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
return lines.join("\n");
|
|
3029
|
+
}
|
|
3030
|
+
function generateEntryMarkdown(entry) {
|
|
3031
|
+
const title = getEntryTitle(entry);
|
|
3032
|
+
const desc = getEntryDescription(entry);
|
|
3033
|
+
const lines = [];
|
|
3034
|
+
lines.push(`# ${title}`);
|
|
3035
|
+
if (desc) {
|
|
3036
|
+
lines.push("");
|
|
3037
|
+
lines.push(`> ${desc}`);
|
|
3038
|
+
}
|
|
3039
|
+
lines.push("");
|
|
3040
|
+
lines.push(entry.body.trim());
|
|
3041
|
+
lines.push("");
|
|
3042
|
+
return lines.join("\n");
|
|
3043
|
+
}
|
|
3044
|
+
/**
|
|
3045
|
+
* LLMs plugin for SSG.
|
|
3046
|
+
*
|
|
3047
|
+
* Generates `llms.txt`, `llms-full.txt`, and per-page `.md` files
|
|
3048
|
+
* following the llms.txt specification, making your site easily
|
|
3049
|
+
* consumable by LLMs and AI agents.
|
|
3050
|
+
*
|
|
3051
|
+
* @see https://llmstxt.org/
|
|
3052
|
+
*
|
|
3053
|
+
* @example
|
|
3054
|
+
* ```tsx
|
|
3055
|
+
* import { createSSG } from "@semajsx/ssg";
|
|
3056
|
+
* import { llms } from "@semajsx/ssg/plugins/llms";
|
|
3057
|
+
*
|
|
3058
|
+
* const ssg = createSSG({
|
|
3059
|
+
* outDir: "./dist",
|
|
3060
|
+
* plugins: [
|
|
3061
|
+
* llms({
|
|
3062
|
+
* title: "My Project",
|
|
3063
|
+
* description: "Documentation for My Project",
|
|
3064
|
+
* url: "https://docs.myproject.com",
|
|
3065
|
+
* sections: [
|
|
3066
|
+
* { title: "Documentation", collection: "docs", basePath: "/docs" },
|
|
3067
|
+
* ],
|
|
3068
|
+
* }),
|
|
3069
|
+
* ],
|
|
3070
|
+
* });
|
|
3071
|
+
* ```
|
|
3072
|
+
*/
|
|
3073
|
+
function llms(options) {
|
|
3074
|
+
let outDir = "";
|
|
3075
|
+
return {
|
|
3076
|
+
name: "llms",
|
|
3077
|
+
enforce: "post",
|
|
3078
|
+
configResolved(config) {
|
|
3079
|
+
outDir = config.outDir ?? "./dist";
|
|
3080
|
+
},
|
|
3081
|
+
async buildEnd(_result, ssg) {
|
|
3082
|
+
const genLlmsTxt = options.llmsTxt !== false;
|
|
3083
|
+
const genLlmsFullTxt = options.llmsFullTxt !== false;
|
|
3084
|
+
const genMarkdownPages = options.markdownPages !== false;
|
|
3085
|
+
const sectionEntries = /* @__PURE__ */ new Map();
|
|
3086
|
+
for (const section of options.sections ?? []) try {
|
|
3087
|
+
const entries = await ssg.getCollection(section.collection);
|
|
3088
|
+
sectionEntries.set(section.collection, entries);
|
|
3089
|
+
} catch {
|
|
3090
|
+
sectionEntries.set(section.collection, []);
|
|
3091
|
+
}
|
|
3092
|
+
await mkdir(outDir, { recursive: true });
|
|
3093
|
+
if (genLlmsTxt) {
|
|
3094
|
+
const content = generateLlmsTxt(options, sectionEntries);
|
|
3095
|
+
await writeFile(join(outDir, "llms.txt"), content, "utf-8");
|
|
3096
|
+
}
|
|
3097
|
+
if (genLlmsFullTxt) {
|
|
3098
|
+
const content = generateLlmsFullTxt(options, sectionEntries);
|
|
3099
|
+
await writeFile(join(outDir, "llms-full.txt"), content, "utf-8");
|
|
3100
|
+
}
|
|
3101
|
+
if (genMarkdownPages) for (const section of options.sections ?? []) {
|
|
3102
|
+
const basePath = normalizePath(section.basePath);
|
|
3103
|
+
const entries = sectionEntries.get(section.collection) ?? [];
|
|
3104
|
+
for (const entry of entries) {
|
|
3105
|
+
const mdPath = `${basePath}/${entry.slug}.md`;
|
|
3106
|
+
const fullPath = join(outDir, mdPath.slice(1));
|
|
3107
|
+
const content = generateEntryMarkdown(entry);
|
|
3108
|
+
await mkdir(dirname(fullPath), { recursive: true });
|
|
3109
|
+
await writeFile(fullPath, content, "utf-8");
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
1867
3113
|
};
|
|
1868
3114
|
}
|
|
1869
3115
|
|
|
@@ -1885,6 +3131,12 @@ const guidesSchema = z.object({
|
|
|
1885
3131
|
"advanced"
|
|
1886
3132
|
]).default("beginner")
|
|
1887
3133
|
});
|
|
3134
|
+
const uiSchema = z.object({
|
|
3135
|
+
title: z.string(),
|
|
3136
|
+
description: z.string().optional(),
|
|
3137
|
+
order: z.number().default(999),
|
|
3138
|
+
category: z.string().optional()
|
|
3139
|
+
});
|
|
1888
3140
|
/**
|
|
1889
3141
|
* Docs theme plugin for SSG.
|
|
1890
3142
|
*
|
|
@@ -1932,6 +3184,7 @@ function docsTheme(options) {
|
|
|
1932
3184
|
const components = createComponents(options);
|
|
1933
3185
|
const docsBasePath = options.docs?.basePath ?? "/docs";
|
|
1934
3186
|
const guidesBasePath = options.guides?.basePath ?? "/guides";
|
|
3187
|
+
const uiBasePath = options.ui?.basePath ?? "/ui";
|
|
1935
3188
|
const plugins = [{
|
|
1936
3189
|
name: "docs-theme",
|
|
1937
3190
|
config() {
|
|
@@ -1947,7 +3200,33 @@ function docsTheme(options) {
|
|
|
1947
3200
|
source: options.guides.source,
|
|
1948
3201
|
schema: guidesSchema
|
|
1949
3202
|
}));
|
|
1950
|
-
|
|
3203
|
+
if (options.ui) collections.push(defineCollection({
|
|
3204
|
+
name: "ui",
|
|
3205
|
+
source: options.ui.source,
|
|
3206
|
+
schema: uiSchema
|
|
3207
|
+
}));
|
|
3208
|
+
if (options.home !== false) if (options.home === "docs-index") routes.push({
|
|
3209
|
+
path: "/",
|
|
3210
|
+
component: components.DocsIndexHome,
|
|
3211
|
+
props: async (ssg) => ({
|
|
3212
|
+
title: options.title,
|
|
3213
|
+
docs: options.docs ? await ssg.getCollection("docs") : [],
|
|
3214
|
+
guides: options.guides ? await ssg.getCollection("guides") : []
|
|
3215
|
+
})
|
|
3216
|
+
});
|
|
3217
|
+
else if (typeof options.home === "function") {
|
|
3218
|
+
const CustomHome = options.home;
|
|
3219
|
+
routes.push({
|
|
3220
|
+
path: "/",
|
|
3221
|
+
component: (props) => CustomHome(props),
|
|
3222
|
+
props: async (ssg) => ({
|
|
3223
|
+
title: options.title,
|
|
3224
|
+
Layout: components.Layout,
|
|
3225
|
+
docs: options.docs ? await ssg.getCollection("docs") : [],
|
|
3226
|
+
guides: options.guides ? await ssg.getCollection("guides") : []
|
|
3227
|
+
})
|
|
3228
|
+
});
|
|
3229
|
+
} else routes.push({
|
|
1951
3230
|
path: "/",
|
|
1952
3231
|
component: components.HomePage,
|
|
1953
3232
|
props: { title: options.title }
|
|
@@ -2008,14 +3287,57 @@ function docsTheme(options) {
|
|
|
2008
3287
|
}
|
|
2009
3288
|
});
|
|
2010
3289
|
}
|
|
3290
|
+
if (options.ui) {
|
|
3291
|
+
routes.push({
|
|
3292
|
+
path: uiBasePath,
|
|
3293
|
+
component: components.UIIndex,
|
|
3294
|
+
props: async (ssg) => ({
|
|
3295
|
+
title: options.ui?.heading ?? "Components",
|
|
3296
|
+
components: await ssg.getCollection("ui")
|
|
3297
|
+
})
|
|
3298
|
+
});
|
|
3299
|
+
routes.push({
|
|
3300
|
+
path: `${uiBasePath}/:slug`,
|
|
3301
|
+
component: components.UIPage,
|
|
3302
|
+
getStaticPaths: async (ssg) => {
|
|
3303
|
+
const allComponents = await ssg.getCollection("ui");
|
|
3304
|
+
return Promise.all(allComponents.map(async (comp) => {
|
|
3305
|
+
const { Content } = await comp.render();
|
|
3306
|
+
return {
|
|
3307
|
+
params: { slug: comp.slug },
|
|
3308
|
+
props: {
|
|
3309
|
+
component: comp,
|
|
3310
|
+
content: Content(),
|
|
3311
|
+
title: `${comp.data.title} | ${options.title}`
|
|
3312
|
+
}
|
|
3313
|
+
};
|
|
3314
|
+
}));
|
|
3315
|
+
}
|
|
3316
|
+
});
|
|
3317
|
+
}
|
|
2011
3318
|
routes.push({
|
|
2012
3319
|
path: "/404",
|
|
2013
3320
|
component: components.NotFound,
|
|
2014
3321
|
props: { title: `404 - Page Not Found | ${options.title}` }
|
|
2015
3322
|
});
|
|
2016
3323
|
const mdxComponents = {
|
|
3324
|
+
ComponentPreview,
|
|
2017
3325
|
Callout,
|
|
2018
3326
|
CodeBlock,
|
|
3327
|
+
Tabs,
|
|
3328
|
+
TabList,
|
|
3329
|
+
Tab,
|
|
3330
|
+
TabPanel,
|
|
3331
|
+
Steps,
|
|
3332
|
+
Step,
|
|
3333
|
+
Button,
|
|
3334
|
+
Badge,
|
|
3335
|
+
Card,
|
|
3336
|
+
Separator,
|
|
3337
|
+
Input,
|
|
3338
|
+
Avatar,
|
|
3339
|
+
Kbd,
|
|
3340
|
+
Switch,
|
|
2019
3341
|
...options.mdx?.components
|
|
2020
3342
|
};
|
|
2021
3343
|
return {
|
|
@@ -2034,9 +3356,39 @@ function docsTheme(options) {
|
|
|
2034
3356
|
const lucideOpts = typeof options.lucide === "object" ? options.lucide : {};
|
|
2035
3357
|
plugins.push(lucide(lucideOpts));
|
|
2036
3358
|
}
|
|
3359
|
+
const hasContent = options.docs || options.guides || options.ui;
|
|
3360
|
+
if (options.llms !== false && hasContent) {
|
|
3361
|
+
const llmsOpts = typeof options.llms === "object" ? options.llms : {};
|
|
3362
|
+
const sections = [];
|
|
3363
|
+
if (options.docs) sections.push({
|
|
3364
|
+
title: options.docs.heading ?? "Documentation",
|
|
3365
|
+
collection: "docs",
|
|
3366
|
+
basePath: docsBasePath
|
|
3367
|
+
});
|
|
3368
|
+
if (options.guides) sections.push({
|
|
3369
|
+
title: options.guides.heading ?? "Guides",
|
|
3370
|
+
collection: "guides",
|
|
3371
|
+
basePath: guidesBasePath
|
|
3372
|
+
});
|
|
3373
|
+
if (options.ui) sections.push({
|
|
3374
|
+
title: options.ui.heading ?? "Components",
|
|
3375
|
+
collection: "ui",
|
|
3376
|
+
basePath: uiBasePath
|
|
3377
|
+
});
|
|
3378
|
+
plugins.push(llms({
|
|
3379
|
+
title: options.title,
|
|
3380
|
+
description: options.description,
|
|
3381
|
+
url: llmsOpts.url,
|
|
3382
|
+
sections,
|
|
3383
|
+
links: llmsOpts.links,
|
|
3384
|
+
llmsTxt: llmsOpts.llmsTxt,
|
|
3385
|
+
llmsFullTxt: llmsOpts.llmsFullTxt,
|
|
3386
|
+
markdownPages: llmsOpts.markdownPages
|
|
3387
|
+
}));
|
|
3388
|
+
}
|
|
2037
3389
|
return plugins;
|
|
2038
3390
|
}
|
|
2039
3391
|
|
|
2040
3392
|
//#endregion
|
|
2041
|
-
export { Callout, CodeBlock, docsTheme };
|
|
3393
|
+
export { Avatar, Badge, Button, Callout, Card, CodeBlock, ComponentPreview, Input, Kbd, Separator, Step, Steps, Switch, Tab, TabList, TabPanel, Tabs, docsTheme };
|
|
2042
3394
|
//# sourceMappingURL=docs-theme.mjs.map
|