@orangecheck/ui 0.8.2 → 0.9.0
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/CHANGELOG.md +23 -0
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +35 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -85,9 +85,19 @@ var ENTRIES = [
|
|
|
85
85
|
docsHref: "https://docs.ochk.io/pledge"
|
|
86
86
|
}
|
|
87
87
|
];
|
|
88
|
+
var OWNER_ENTRIES = [
|
|
89
|
+
{
|
|
90
|
+
slug: "analytics",
|
|
91
|
+
href: "https://analytics.ochk.io",
|
|
92
|
+
label: "oc\xB7analytics",
|
|
93
|
+
sub: "owner cockpit",
|
|
94
|
+
docsHref: "https://analytics.ochk.io"
|
|
95
|
+
}
|
|
96
|
+
];
|
|
88
97
|
function EcosystemSwitcher({
|
|
89
98
|
current,
|
|
90
|
-
className
|
|
99
|
+
className,
|
|
100
|
+
showOwnerEntries = false
|
|
91
101
|
}) {
|
|
92
102
|
const [open, setOpen] = useState(false);
|
|
93
103
|
const containerRef = useRef(null);
|
|
@@ -137,7 +147,7 @@ function EcosystemSwitcher({
|
|
|
137
147
|
className: "bg-background absolute right-0 top-full z-[60] mt-2 w-72 border shadow-lg",
|
|
138
148
|
children: [
|
|
139
149
|
/* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the family" }),
|
|
140
|
-
/* @__PURE__ */ jsx("ul", { className: "py-1", children: ENTRIES.map((e) => {
|
|
150
|
+
/* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
|
|
141
151
|
const isActive2 = e.slug === current;
|
|
142
152
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
143
153
|
Link5,
|
|
@@ -275,6 +285,15 @@ var FAMILY_PROPERTIES = [
|
|
|
275
285
|
sub: "swear \u2014 bonded commitment",
|
|
276
286
|
docsHref: "https://docs.ochk.io/pledge",
|
|
277
287
|
category: "protocol"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
slug: "analytics",
|
|
291
|
+
origin: "https://analytics.ochk.io",
|
|
292
|
+
hostname: "analytics.ochk.io",
|
|
293
|
+
label: "oc\xB7analytics",
|
|
294
|
+
sub: "owner cockpit",
|
|
295
|
+
docsHref: "https://analytics.ochk.io",
|
|
296
|
+
category: "owner"
|
|
278
297
|
}
|
|
279
298
|
];
|
|
280
299
|
var SITE_STATE_LABEL = {
|
|
@@ -287,18 +306,20 @@ function findFamilyProperty(slug) {
|
|
|
287
306
|
var SECTIONS = [
|
|
288
307
|
{ category: "hub", label: "hub" },
|
|
289
308
|
{ category: "product", label: "products" },
|
|
290
|
-
{ category: "protocol", label: "protocols" }
|
|
309
|
+
{ category: "protocol", label: "protocols" },
|
|
310
|
+
{ category: "owner", label: "owner" }
|
|
291
311
|
];
|
|
292
312
|
function CategoryChip({ category }) {
|
|
293
313
|
if (category === "hub") return null;
|
|
294
|
-
const
|
|
314
|
+
const label = category === "product" ? "product" : category === "protocol" ? "protocol" : "owner";
|
|
315
|
+
const tone = category === "product" ? "border-primary/25 bg-primary/10 text-primary" : category === "protocol" ? "border-muted-foreground/20 bg-muted/40 text-muted-foreground/85" : "border-warning/30 bg-warning/10 text-warning";
|
|
295
316
|
return /* @__PURE__ */ jsx(
|
|
296
317
|
"span",
|
|
297
318
|
{
|
|
298
|
-
"aria-label":
|
|
299
|
-
className: "ml-1 hidden rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block " +
|
|
319
|
+
"aria-label": category === "product" ? "commercial product" : category === "protocol" ? "protocol reference" : "owner-only surface",
|
|
320
|
+
className: "ml-1 hidden rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block " + tone,
|
|
300
321
|
"data-oc-category": category,
|
|
301
|
-
children:
|
|
322
|
+
children: label
|
|
302
323
|
}
|
|
303
324
|
);
|
|
304
325
|
}
|
|
@@ -316,13 +337,14 @@ function SiteStateBadge({ state }) {
|
|
|
316
337
|
}
|
|
317
338
|
function MenuCategoryChip({ category }) {
|
|
318
339
|
if (category === "hub") return null;
|
|
319
|
-
const
|
|
340
|
+
const label = category === "product" ? "pro" : category === "protocol" ? "spec" : "own";
|
|
341
|
+
const tone = category === "product" ? "bg-primary/10 text-primary" : category === "protocol" ? "bg-muted/60 text-muted-foreground/80" : "bg-warning/15 text-warning";
|
|
320
342
|
return /* @__PURE__ */ jsx(
|
|
321
343
|
"span",
|
|
322
344
|
{
|
|
323
345
|
"aria-hidden": true,
|
|
324
|
-
className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " +
|
|
325
|
-
children:
|
|
346
|
+
className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " + tone,
|
|
347
|
+
children: label
|
|
326
348
|
}
|
|
327
349
|
);
|
|
328
350
|
}
|
|
@@ -333,7 +355,8 @@ function OcLogoDropdown({
|
|
|
333
355
|
children,
|
|
334
356
|
className,
|
|
335
357
|
triggerClassName,
|
|
336
|
-
popoverClassName
|
|
358
|
+
popoverClassName,
|
|
359
|
+
showOwnerEntries = false
|
|
337
360
|
}) {
|
|
338
361
|
const [open, setOpen] = useState(false);
|
|
339
362
|
const containerRef = useRef(null);
|
|
@@ -433,6 +456,7 @@ function OcLogoDropdown({
|
|
|
433
456
|
children: [
|
|
434
457
|
/* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the orangecheck family" }),
|
|
435
458
|
/* @__PURE__ */ jsx("div", { className: "max-h-[min(28rem,70vh)] overflow-y-auto py-1", role: "none", children: SECTIONS.map(({ category, label }) => {
|
|
459
|
+
if (category === "owner" && !showOwnerEntries) return null;
|
|
436
460
|
const sectionEntries = FAMILY_PROPERTIES.filter(
|
|
437
461
|
(e) => e.category === category
|
|
438
462
|
);
|