@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/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);
|
|
@@ -439,6 +462,7 @@ function OcLogoDropdown({
|
|
|
439
462
|
children: [
|
|
440
463
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the orangecheck family" }),
|
|
441
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;
|
|
442
466
|
const sectionEntries = FAMILY_PROPERTIES.filter(
|
|
443
467
|
(e) => e.category === category
|
|
444
468
|
);
|