@orangecheck/ui 0.8.1 → 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 +55 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to **`@orangecheck/ui`** will be documented in this file.
|
|
4
|
+
|
|
5
|
+
This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
6
|
+
and [Semantic Versioning](https://semver.org/). This package is family-internal
|
|
7
|
+
(consumed only by the `*.ochk.io` sub-sites); the surface is intentionally
|
|
8
|
+
small and the API may evolve quickly.
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
- _(no pending changes)_
|
|
13
|
+
|
|
14
|
+
## [0.1.0] — Initial published state
|
|
15
|
+
|
|
16
|
+
Initial public release. Family-internal UI for the `.ochk.io` sub-sites:
|
|
17
|
+
|
|
18
|
+
- `<EcosystemSwitcher>` — cross-product dropdown for jumping between every
|
|
19
|
+
site in the OrangeCheck family. Lifted out of seven near-identical copies
|
|
20
|
+
living in each web repo.
|
|
21
|
+
|
|
22
|
+
[Unreleased]: https://github.com/orangecheck/oc-packages/compare/ui-v0.1.0...HEAD
|
|
23
|
+
[0.1.0]: https://github.com/orangecheck/oc-packages/releases/tag/ui-v0.1.0
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type EcosystemSlug = 'home' | 'docs' | 'fleet' | 'me' | 'vault' | 'attest' | 'lock' | 'vote' | 'stamp' | 'agent' | 'pledge';
|
|
4
|
+
type EcosystemSlug = 'home' | 'docs' | 'fleet' | 'me' | 'vault' | 'attest' | 'lock' | 'vote' | 'stamp' | 'agent' | 'pledge' | 'analytics';
|
|
5
5
|
interface EcosystemSwitcherProps {
|
|
6
6
|
current: EcosystemSlug;
|
|
7
7
|
className?: string;
|
|
8
|
+
showOwnerEntries?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare function EcosystemSwitcher({ current, className, }: EcosystemSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function EcosystemSwitcher({ current, className, showOwnerEntries, }: EcosystemSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
|
-
type FamilyCategory = 'hub' | 'product' | 'protocol';
|
|
12
|
+
type FamilyCategory = 'hub' | 'product' | 'protocol' | 'owner';
|
|
12
13
|
interface FamilyProperty {
|
|
13
14
|
slug: EcosystemSlug;
|
|
14
15
|
origin: string;
|
|
@@ -31,8 +32,9 @@ interface OcLogoDropdownProps {
|
|
|
31
32
|
className?: string;
|
|
32
33
|
triggerClassName?: string;
|
|
33
34
|
popoverClassName?: string;
|
|
35
|
+
showOwnerEntries?: boolean;
|
|
34
36
|
}
|
|
35
|
-
declare function OcLogoDropdown({ current, homeHref, siteState, children, className, triggerClassName, popoverClassName, }: OcLogoDropdownProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function OcLogoDropdown({ current, homeHref, siteState, children, className, triggerClassName, popoverClassName, showOwnerEntries, }: OcLogoDropdownProps): react_jsx_runtime.JSX.Element;
|
|
36
38
|
|
|
37
39
|
interface OcAccountMenuItem {
|
|
38
40
|
href: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
type EcosystemSlug = 'home' | 'docs' | 'fleet' | 'me' | 'vault' | 'attest' | 'lock' | 'vote' | 'stamp' | 'agent' | 'pledge';
|
|
4
|
+
type EcosystemSlug = 'home' | 'docs' | 'fleet' | 'me' | 'vault' | 'attest' | 'lock' | 'vote' | 'stamp' | 'agent' | 'pledge' | 'analytics';
|
|
5
5
|
interface EcosystemSwitcherProps {
|
|
6
6
|
current: EcosystemSlug;
|
|
7
7
|
className?: string;
|
|
8
|
+
showOwnerEntries?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare function EcosystemSwitcher({ current, className, }: EcosystemSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function EcosystemSwitcher({ current, className, showOwnerEntries, }: EcosystemSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
|
-
type FamilyCategory = 'hub' | 'product' | 'protocol';
|
|
12
|
+
type FamilyCategory = 'hub' | 'product' | 'protocol' | 'owner';
|
|
12
13
|
interface FamilyProperty {
|
|
13
14
|
slug: EcosystemSlug;
|
|
14
15
|
origin: string;
|
|
@@ -31,8 +32,9 @@ interface OcLogoDropdownProps {
|
|
|
31
32
|
className?: string;
|
|
32
33
|
triggerClassName?: string;
|
|
33
34
|
popoverClassName?: string;
|
|
35
|
+
showOwnerEntries?: boolean;
|
|
34
36
|
}
|
|
35
|
-
declare function OcLogoDropdown({ current, homeHref, siteState, children, className, triggerClassName, popoverClassName, }: OcLogoDropdownProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare function OcLogoDropdown({ current, homeHref, siteState, children, className, triggerClassName, popoverClassName, showOwnerEntries, }: OcLogoDropdownProps): react_jsx_runtime.JSX.Element;
|
|
36
38
|
|
|
37
39
|
interface OcAccountMenuItem {
|
|
38
40
|
href: string;
|
package/dist/index.js
CHANGED
|
@@ -91,9 +91,19 @@ var ENTRIES = [
|
|
|
91
91
|
docsHref: "https://docs.ochk.io/pledge"
|
|
92
92
|
}
|
|
93
93
|
];
|
|
94
|
+
var OWNER_ENTRIES = [
|
|
95
|
+
{
|
|
96
|
+
slug: "analytics",
|
|
97
|
+
href: "https://analytics.ochk.io",
|
|
98
|
+
label: "oc\xB7analytics",
|
|
99
|
+
sub: "owner cockpit",
|
|
100
|
+
docsHref: "https://analytics.ochk.io"
|
|
101
|
+
}
|
|
102
|
+
];
|
|
94
103
|
function EcosystemSwitcher({
|
|
95
104
|
current,
|
|
96
|
-
className
|
|
105
|
+
className,
|
|
106
|
+
showOwnerEntries = false
|
|
97
107
|
}) {
|
|
98
108
|
const [open, setOpen] = react.useState(false);
|
|
99
109
|
const containerRef = react.useRef(null);
|
|
@@ -143,7 +153,7 @@ function EcosystemSwitcher({
|
|
|
143
153
|
className: "bg-background absolute right-0 top-full z-[60] mt-2 w-72 border shadow-lg",
|
|
144
154
|
children: [
|
|
145
155
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the family" }),
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "py-1", children: ENTRIES.map((e) => {
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
|
|
147
157
|
const isActive2 = e.slug === current;
|
|
148
158
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
149
159
|
Link5__default.default,
|
|
@@ -281,6 +291,15 @@ var FAMILY_PROPERTIES = [
|
|
|
281
291
|
sub: "swear \u2014 bonded commitment",
|
|
282
292
|
docsHref: "https://docs.ochk.io/pledge",
|
|
283
293
|
category: "protocol"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
slug: "analytics",
|
|
297
|
+
origin: "https://analytics.ochk.io",
|
|
298
|
+
hostname: "analytics.ochk.io",
|
|
299
|
+
label: "oc\xB7analytics",
|
|
300
|
+
sub: "owner cockpit",
|
|
301
|
+
docsHref: "https://analytics.ochk.io",
|
|
302
|
+
category: "owner"
|
|
284
303
|
}
|
|
285
304
|
];
|
|
286
305
|
var SITE_STATE_LABEL = {
|
|
@@ -293,18 +312,20 @@ function findFamilyProperty(slug) {
|
|
|
293
312
|
var SECTIONS = [
|
|
294
313
|
{ category: "hub", label: "hub" },
|
|
295
314
|
{ category: "product", label: "products" },
|
|
296
|
-
{ category: "protocol", label: "protocols" }
|
|
315
|
+
{ category: "protocol", label: "protocols" },
|
|
316
|
+
{ category: "owner", label: "owner" }
|
|
297
317
|
];
|
|
298
318
|
function CategoryChip({ category }) {
|
|
299
319
|
if (category === "hub") return null;
|
|
300
|
-
const
|
|
320
|
+
const label = category === "product" ? "product" : category === "protocol" ? "protocol" : "owner";
|
|
321
|
+
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";
|
|
301
322
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
302
323
|
"span",
|
|
303
324
|
{
|
|
304
|
-
"aria-label":
|
|
305
|
-
className: "ml-1 hidden rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block " +
|
|
325
|
+
"aria-label": category === "product" ? "commercial product" : category === "protocol" ? "protocol reference" : "owner-only surface",
|
|
326
|
+
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,
|
|
306
327
|
"data-oc-category": category,
|
|
307
|
-
children:
|
|
328
|
+
children: label
|
|
308
329
|
}
|
|
309
330
|
);
|
|
310
331
|
}
|
|
@@ -322,13 +343,14 @@ function SiteStateBadge({ state }) {
|
|
|
322
343
|
}
|
|
323
344
|
function MenuCategoryChip({ category }) {
|
|
324
345
|
if (category === "hub") return null;
|
|
325
|
-
const
|
|
346
|
+
const label = category === "product" ? "pro" : category === "protocol" ? "spec" : "own";
|
|
347
|
+
const tone = category === "product" ? "bg-primary/10 text-primary" : category === "protocol" ? "bg-muted/60 text-muted-foreground/80" : "bg-warning/15 text-warning";
|
|
326
348
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
327
349
|
"span",
|
|
328
350
|
{
|
|
329
351
|
"aria-hidden": true,
|
|
330
|
-
className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " +
|
|
331
|
-
children:
|
|
352
|
+
className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " + tone,
|
|
353
|
+
children: label
|
|
332
354
|
}
|
|
333
355
|
);
|
|
334
356
|
}
|
|
@@ -339,7 +361,8 @@ function OcLogoDropdown({
|
|
|
339
361
|
children,
|
|
340
362
|
className,
|
|
341
363
|
triggerClassName,
|
|
342
|
-
popoverClassName
|
|
364
|
+
popoverClassName,
|
|
365
|
+
showOwnerEntries = false
|
|
343
366
|
}) {
|
|
344
367
|
const [open, setOpen] = react.useState(false);
|
|
345
368
|
const containerRef = react.useRef(null);
|
|
@@ -375,7 +398,7 @@ function OcLogoDropdown({
|
|
|
375
398
|
"div",
|
|
376
399
|
{
|
|
377
400
|
ref: containerRef,
|
|
378
|
-
className: "relative " + (className ?? ""),
|
|
401
|
+
className: "relative inline-flex items-center " + (className ?? ""),
|
|
379
402
|
"data-oc-logo-dropdown": "",
|
|
380
403
|
"data-oc-current-category": currentCategory,
|
|
381
404
|
"data-oc-site-state": siteState,
|
|
@@ -403,24 +426,28 @@ function OcLogoDropdown({
|
|
|
403
426
|
"aria-hidden": true,
|
|
404
427
|
className: "text-muted-foreground/70 group-hover:text-foreground/80 h-3.5 w-3.5 shrink-0 transition-transform duration-200 " + (open ? "rotate-180" : "")
|
|
405
428
|
}
|
|
406
|
-
)
|
|
407
|
-
|
|
408
|
-
|
|
429
|
+
)
|
|
430
|
+
]
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
434
|
+
Link5__default.default,
|
|
435
|
+
{
|
|
436
|
+
href: homeHref,
|
|
437
|
+
"aria-label": "go to " + homeHref + " (this site's home)",
|
|
438
|
+
onClick: () => setOpen(false),
|
|
439
|
+
tabIndex: open ? 0 : -1,
|
|
440
|
+
className: "hover:text-primary group/home -ml-1 hidden items-center gap-1 rounded-sm px-1.5 py-1 font-mono text-[9px] tracking-widest uppercase transition-all duration-200 sm:inline-flex " + (open ? "pointer-events-auto translate-x-0 text-muted-foreground/70 opacity-100 hover:bg-accent/30" : "pointer-events-none -translate-x-1 opacity-0"),
|
|
441
|
+
"data-oc-logo-dropdown-home-hint": "",
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
444
|
+
lucideReact.CornerDownLeft,
|
|
409
445
|
{
|
|
410
446
|
"aria-hidden": true,
|
|
411
|
-
className: "
|
|
412
|
-
"data-oc-logo-dropdown-home-hint": "",
|
|
413
|
-
children: [
|
|
414
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
415
|
-
lucideReact.CornerDownLeft,
|
|
416
|
-
{
|
|
417
|
-
className: "h-3 w-3 " + (open ? "motion-safe:animate-pulse" : "")
|
|
418
|
-
}
|
|
419
|
-
),
|
|
420
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary/70", children: "home" })
|
|
421
|
-
]
|
|
447
|
+
className: "h-3 w-3 group-hover/home:text-primary " + (open ? "motion-safe:animate-pulse" : "")
|
|
422
448
|
}
|
|
423
|
-
)
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary/70 group-hover/home:text-primary", children: "home" })
|
|
424
451
|
]
|
|
425
452
|
}
|
|
426
453
|
),
|
|
@@ -435,6 +462,7 @@ function OcLogoDropdown({
|
|
|
435
462
|
children: [
|
|
436
463
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the orangecheck family" }),
|
|
437
464
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-[min(28rem,70vh)] overflow-y-auto py-1", role: "none", children: SECTIONS.map(({ category, label }) => {
|
|
465
|
+
if (category === "owner" && !showOwnerEntries) return null;
|
|
438
466
|
const sectionEntries = FAMILY_PROPERTIES.filter(
|
|
439
467
|
(e) => e.category === category
|
|
440
468
|
);
|