@flamingo-stack/openframe-frontend-core 0.0.302 → 0.0.303-snapshot.20260622160827
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/{chunk-YLD4WH67.js → chunk-2X4HTRQ4.js} +10 -22
- package/dist/chunk-2X4HTRQ4.js.map +1 -0
- package/dist/{chunk-LFXZJZKO.js → chunk-45DC5AJC.js} +2 -2
- package/dist/{chunk-ZDN6OEWV.cjs → chunk-7KTSRZI4.cjs} +483 -549
- package/dist/chunk-7KTSRZI4.cjs.map +1 -0
- package/dist/{chunk-3I7T732P.cjs → chunk-A25ZI7HO.cjs} +12 -12
- package/dist/{chunk-3I7T732P.cjs.map → chunk-A25ZI7HO.cjs.map} +1 -1
- package/dist/{chunk-K4ZENCQE.cjs → chunk-BMNGBMSN.cjs} +26 -26
- package/dist/{chunk-K4ZENCQE.cjs.map → chunk-BMNGBMSN.cjs.map} +1 -1
- package/dist/{chunk-5D76BUKB.js → chunk-DOYOOBP4.js} +2 -2
- package/dist/{chunk-TTHXHSVU.cjs → chunk-FVLEE7YZ.cjs} +23 -35
- package/dist/chunk-FVLEE7YZ.cjs.map +1 -0
- package/dist/{chunk-JHNAQUWK.js → chunk-INZOAK77.js} +2 -2
- package/dist/{chunk-N7XM5HTI.js → chunk-JO6EUJGU.js} +21 -27
- package/dist/chunk-JO6EUJGU.js.map +1 -0
- package/dist/{chunk-LWJYIEPP.cjs → chunk-MZRNARMO.cjs} +37 -37
- package/dist/{chunk-LWJYIEPP.cjs.map → chunk-MZRNARMO.cjs.map} +1 -1
- package/dist/{chunk-BD4YJSRZ.cjs → chunk-O4TIFKDG.cjs} +7 -7
- package/dist/{chunk-BD4YJSRZ.cjs.map → chunk-O4TIFKDG.cjs.map} +1 -1
- package/dist/{chunk-TMLDWPTS.cjs → chunk-RNF2E736.cjs} +11 -10
- package/dist/chunk-RNF2E736.cjs.map +1 -0
- package/dist/{chunk-HLJLLNOB.cjs → chunk-UAJAJFI6.cjs} +44 -50
- package/dist/chunk-UAJAJFI6.cjs.map +1 -0
- package/dist/{chunk-A22ZO5SB.js → chunk-X5N6ANEO.js} +4 -3
- package/dist/{chunk-A22ZO5SB.js.map → chunk-X5N6ANEO.js.map} +1 -1
- package/dist/{chunk-HRDN27UP.js → chunk-Y2D2RJQX.js} +2701 -2767
- package/dist/chunk-Y2D2RJQX.js.map +1 -0
- package/dist/{chunk-IXCQFNF7.js → chunk-YV73VRRY.js} +2 -2
- package/dist/{chunk-RBZCSKFW.cjs → chunk-Z7322A4A.cjs} +5 -5
- package/dist/{chunk-RBZCSKFW.cjs.map → chunk-Z7322A4A.cjs.map} +1 -1
- package/dist/{chunk-ZUALRZHW.js → chunk-ZXIM2DJM.js} +2 -2
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/hooks/use-chat-identity.d.ts +7 -1
- package/dist/components/chat/hooks/use-chat-identity.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-empty-state-config.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/doc-viewer.d.ts +3 -4
- package/dist/components/docs/doc-viewer.d.ts.map +1 -1
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/docs/use-docs-resolve-link.d.ts.map +1 -1
- package/dist/components/docs/use-document-tree.d.ts.map +1 -1
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/features/time-tracker/time-tracker-panel.d.ts.map +1 -1
- package/dist/components/index.cjs +172 -178
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +8 -14
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/page-layout.d.ts +1 -10
- package/dist/components/layout/page-layout.d.ts.map +1 -1
- package/dist/components/layout/title-block.d.ts +1 -17
- package/dist/components/layout/title-block.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +23 -23
- package/dist/components/onboarding-guides/index.js +3 -3
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/dev-section/dev-section-page.d.ts +0 -9
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/dev-section/dev-section-view.d.ts.map +1 -1
- package/dist/components/shared/dev-section/index.d.ts +1 -1
- package/dist/components/shared/dev-section/index.d.ts.map +1 -1
- package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +60 -60
- package/dist/components/tickets/index.js +3 -3
- package/dist/components/ui/index.cjs +2 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +0 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -5
- package/dist/index.cjs +2 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -5
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +25 -3
- package/src/components/chat/hooks/use-chat-identity.ts +13 -2
- package/src/components/chat/hooks/use-empty-state-config.ts +30 -16
- package/src/components/chat/hooks/use-slash-commands.ts +24 -8
- package/src/components/docs/doc-viewer.tsx +25 -22
- package/src/components/docs/use-docs-resolve-link.ts +2 -1
- package/src/components/docs/use-document-tree.ts +3 -2
- package/src/components/features/time-tracker/time-tracker-header-button.tsx +1 -1
- package/src/components/features/time-tracker/time-tracker-panel.tsx +9 -4
- package/src/components/layout/page-layout.tsx +28 -14
- package/src/components/layout/title-block.tsx +86 -40
- package/src/components/shared/dev-section/dev-section-page.tsx +1 -9
- package/src/components/shared/dev-section/dev-section-view.tsx +9 -14
- package/src/components/shared/dev-section/index.ts +1 -1
- package/src/components/shared/doc-search/use-doc-search.ts +2 -1
- package/src/components/ui/index.ts +0 -1
- package/dist/chunk-HLJLLNOB.cjs.map +0 -1
- package/dist/chunk-HRDN27UP.js.map +0 -1
- package/dist/chunk-N7XM5HTI.js.map +0 -1
- package/dist/chunk-TMLDWPTS.cjs.map +0 -1
- package/dist/chunk-TTHXHSVU.cjs.map +0 -1
- package/dist/chunk-YLD4WH67.js.map +0 -1
- package/dist/chunk-ZDN6OEWV.cjs.map +0 -1
- package/dist/components/layout/page-header.d.ts +0 -78
- package/dist/components/layout/page-header.d.ts.map +0 -1
- package/dist/components/layout/page-with-header.d.ts +0 -67
- package/dist/components/layout/page-with-header.d.ts.map +0 -1
- package/src/components/layout/page-header.tsx +0 -182
- package/src/components/layout/page-with-header.tsx +0 -110
- /package/dist/{chunk-LFXZJZKO.js.map → chunk-45DC5AJC.js.map} +0 -0
- /package/dist/{chunk-5D76BUKB.js.map → chunk-DOYOOBP4.js.map} +0 -0
- /package/dist/{chunk-JHNAQUWK.js.map → chunk-INZOAK77.js.map} +0 -0
- /package/dist/{chunk-IXCQFNF7.js.map → chunk-YV73VRRY.js.map} +0 -0
- /package/dist/{chunk-ZUALRZHW.js.map → chunk-ZXIM2DJM.js.map} +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Page-header primitive — the canonical "back-button + title + subtitle
|
|
4
|
-
* + (optional) image / actions" chrome every lib page uses.
|
|
5
|
-
*
|
|
6
|
-
* Owns the SSOT for the page-header DOM/CSS that the rest of the lib
|
|
7
|
-
* was duplicating: pre-`mb` top padding, h1 typography (`text-h2`), h6
|
|
8
|
-
* subtitle (`text-h6`), the gap between the back button and the title
|
|
9
|
-
* block, and the right-side actions slot. Consumers either render this
|
|
10
|
-
* directly (e.g. `<DocViewer>` / `<DocsHubPage>`) or compose it through
|
|
11
|
-
* the `<TitleBlock>` adapter which adds the `PageActions` /
|
|
12
|
-
* `ActionsMenu` / selector wiring on top.
|
|
13
|
-
*
|
|
14
|
-
* Why this exists: knowledge-hub vs releases sat at different vertical
|
|
15
|
-
* rhythms (px-perfect mismatch on title baseline + subtitle offset)
|
|
16
|
-
* because the docs surface hand-rolled its own chrome instead of going
|
|
17
|
-
* through `TitleBlock`. Centralizing the layout here means every
|
|
18
|
-
* embeddable lib page (DocViewer, DevSectionPage, LegalDocumentPage,
|
|
19
|
-
* OnboardingGuideDetailView) renders pixel-identical title/subtitle/
|
|
20
|
-
* back-button typography + spacing — and a future spacing/typography
|
|
21
|
-
* tweak is one file.
|
|
22
|
-
*/
|
|
23
|
-
export interface PageHeaderProps {
|
|
24
|
-
/** Page title (h1). Plain string — ReactNode is intentionally not
|
|
25
|
-
* supported here so every consumer renders the same typography. */
|
|
26
|
-
title?: string;
|
|
27
|
-
/** Optional icon rendered inline before the title text (e.g. the
|
|
28
|
-
* rocket emoji on /releases, the docs icon on /knowledge-base).
|
|
29
|
-
* Same `flex items-center gap-3` row as `<DevSectionView>`'s hero. */
|
|
30
|
-
titleIcon?: React.ReactNode;
|
|
31
|
-
/** Page subtitle (description paragraph). */
|
|
32
|
-
subtitle?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Render a yellow accent dot (`.`) after the title. Mirrors the
|
|
35
|
-
* hub's legacy `<AdminPageHeader accentDot>` flag — now lib-wide so
|
|
36
|
-
* surfaces like `/knowledge-base` keep their existing accent styling
|
|
37
|
-
* after the migration.
|
|
38
|
-
*/
|
|
39
|
-
accentDot?: boolean;
|
|
40
|
-
/** Optional thumbnail / hero image rendered to the left of the
|
|
41
|
-
* title block. Used by entity-image-style headers (onboarding
|
|
42
|
-
* guides, knowledge-base entries). */
|
|
43
|
-
image?: {
|
|
44
|
-
src: string;
|
|
45
|
-
alt?: string;
|
|
46
|
-
};
|
|
47
|
-
/** Back-button shown above the title block. Hidden on mobile (matches
|
|
48
|
-
* the existing TitleBlock + DocViewer behavior). */
|
|
49
|
-
backButton?: {
|
|
50
|
-
label?: string;
|
|
51
|
-
onClick: () => void;
|
|
52
|
-
};
|
|
53
|
-
/** Right-side actions slot (action buttons / menu / tab selector).
|
|
54
|
-
* Composed externally (e.g. `<TitleBlock>` builds `PageActions` + menu
|
|
55
|
-
* + selector and passes the result here). */
|
|
56
|
-
actions?: React.ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Visual variant.
|
|
59
|
-
* - `plain` (default): transparent background, no border.
|
|
60
|
-
* - `card`: card background, border, and padding on mobile only —
|
|
61
|
-
* collapses to plain on md+ (legacy `TitleBlock` variant — kept so
|
|
62
|
-
* surfaces that depend on the card affordance don't regress).
|
|
63
|
-
*/
|
|
64
|
-
variant?: 'plain' | 'card';
|
|
65
|
-
/** When the consumer wraps `<PageHeader>` in its OWN spacing container
|
|
66
|
-
* (e.g. `<DevSectionView>`'s `gap-10 flex-col`), the default `mb-l`
|
|
67
|
-
* bottom margin doubles up. Pass `noBottomMargin` to opt out. */
|
|
68
|
-
noBottomMargin?: boolean;
|
|
69
|
-
/** Same as `noBottomMargin` for the default `pt-l` top padding. Set
|
|
70
|
-
* this when PageHeader is nested INSIDE another layout that already
|
|
71
|
-
* provides top spacing (e.g. `<DevSectionView>`'s hero, which sits
|
|
72
|
-
* inside `<PageLayout>`'s children flow). */
|
|
73
|
-
noTopPadding?: boolean;
|
|
74
|
-
className?: string;
|
|
75
|
-
}
|
|
76
|
-
export declare function PageHeader({ title, titleIcon, subtitle, accentDot, image, backButton, actions, variant, noBottomMargin, noTopPadding, className, }: PageHeaderProps): React.JSX.Element;
|
|
77
|
-
export default PageHeader;
|
|
78
|
-
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/components/layout/page-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,eAAe;IAC9B;wEACoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;2EAEuE;IACvE,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;2CAEuC;IACvC,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACrC;yDACqD;IACrD,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;IACpD;;kDAE8C;IAC9C,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC1B;;sEAEkE;IAClE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;kDAG8C;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAmBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,KAAK,EACL,UAAU,EACV,OAAO,EACP,OAAiB,EACjB,cAAsB,EACtB,YAAoB,EACpB,SAAS,GACV,EAAE,eAAe,qBA0EjB;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type PageHeaderProps } from './page-header';
|
|
3
|
-
/**
|
|
4
|
-
* `<PageWithHeader>` — the canonical 4-layer unified-chrome wrapper that
|
|
5
|
-
* every public lib/hub page now uses (Knowledge Hub, Roadmap, FAQs,
|
|
6
|
-
* Authors, Blog, Vendors, Case Studies, Interviews, Investor Updates,
|
|
7
|
-
* /webinars-/podcasts-/events, hub admin-but-public pages, …).
|
|
8
|
-
*
|
|
9
|
-
* Renders the same JSX tree every consumer was hand-rolling individually
|
|
10
|
-
* before this helper landed:
|
|
11
|
-
*
|
|
12
|
-
* PageShell ← bg-ods-bg, max-w-[1920px],
|
|
13
|
-
* page-shell-px/pt/pb gutters
|
|
14
|
-
* PageLayout backButton ← TitleBlock → PageHeader #1 (back-btn row
|
|
15
|
-
* only, pt-l + mb-l)
|
|
16
|
-
* div.w-full.flex-col.gap-10 ← matches DevSectionView's hero container
|
|
17
|
-
* PageHeader title/subtitle ← PageHeader #2 (noTopPadding +
|
|
18
|
-
* titleIcon accentDot noBottomMargin so PageLayout's gap-l owns
|
|
19
|
-
* noTopPadding the spacing between #1 and #2)
|
|
20
|
-
* noBottomMargin
|
|
21
|
-
* children ← page-specific body (search, lists, forms)
|
|
22
|
-
*
|
|
23
|
-
* Why this exists: 15+ pages copy-pasted the EXACT same nesting + the
|
|
24
|
-
* EXACT same `noTopPadding + noBottomMargin + accentDot` triplet on the
|
|
25
|
-
* inner `<PageHeader>`. Forgetting one of those flags collapsed the gap
|
|
26
|
-
* to ~8px (the FAQs-vs-Onboarding-Guides bug). Centralizing the chain
|
|
27
|
-
* here makes the spacing invariant compiler-enforced — consumers can't
|
|
28
|
-
* pick the wrong combination.
|
|
29
|
-
*
|
|
30
|
-
* **Back button is config-driven by default.** Consumers don't have to
|
|
31
|
-
* thread `useRouter()` + `() => router.push('/')` themselves anymore —
|
|
32
|
-
* the helper supplies a sane default (`{ label: 'Back to home', href: '/' }`).
|
|
33
|
-
* Hosts whose `/` lives elsewhere should pass their own `href`. Pass
|
|
34
|
-
* `backButton={false}` to suppress entirely (the lib's own
|
|
35
|
-
* `<DocsHubPage>` does this on the platform-home docs landing).
|
|
36
|
-
*/
|
|
37
|
-
export interface PageWithHeaderProps {
|
|
38
|
-
/** Title — passed straight to inner `<PageHeader>`. */
|
|
39
|
-
title?: string;
|
|
40
|
-
/** Inline icon rendered before the title (lucide / SVG node). Wrap with
|
|
41
|
-
* `SECTION_HERO_ICON_CLASS` at the call site, or use the lib's
|
|
42
|
-
* `<PageHeader>`'s `titleIcon` ReactNode signature directly. */
|
|
43
|
-
titleIcon?: PageHeaderProps['titleIcon'];
|
|
44
|
-
/** Subtitle (1-2 lines, auto-clamped to 2 + min-h-[56px]). */
|
|
45
|
-
subtitle?: string;
|
|
46
|
-
/** Render yellow accent dot after the title (default true — matches every
|
|
47
|
-
* unified surface). Pass `false` to opt out. */
|
|
48
|
-
accentDot?: boolean;
|
|
49
|
-
/** Back-button config. Defaults to `{ label: 'Back to home', href: '/' }`.
|
|
50
|
-
* Pass `false` to hide entirely (platform-home docs landings). */
|
|
51
|
-
backButton?: {
|
|
52
|
-
label?: string;
|
|
53
|
-
href?: string;
|
|
54
|
-
} | false;
|
|
55
|
-
/** Optional image (entity-image-style — onboarding guides etc.). */
|
|
56
|
-
image?: PageHeaderProps['image'];
|
|
57
|
-
/** Optional actions slot (right side of header). */
|
|
58
|
-
actions?: React.ReactNode;
|
|
59
|
-
/** Page body — search bars, lists, forms, sections. Rendered INSIDE the
|
|
60
|
-
* gap-10 flex column so it shares gutters + vertical rhythm with the
|
|
61
|
-
* header. */
|
|
62
|
-
children: React.ReactNode;
|
|
63
|
-
/** Extra class applied to the gap-10 content wrapper. */
|
|
64
|
-
contentClassName?: string;
|
|
65
|
-
}
|
|
66
|
-
export declare function PageWithHeader({ title, titleIcon, subtitle, accentDot, backButton, image, actions, children, contentClassName, }: PageWithHeaderProps): React.JSX.Element;
|
|
67
|
-
//# sourceMappingURL=page-with-header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-with-header.d.ts","sourceRoot":"","sources":["../../../src/components/layout/page-with-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;qEAEiE;IACjE,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;qDACiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;uEACmE;IACnE,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAA;IACtD,oEAAoE;IACpE,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;IAChC,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;kBAEc;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,SAAS,EACT,QAAQ,EACR,SAAgB,EAChB,UAAU,EACV,KAAK,EACL,OAAO,EACP,QAAQ,EACR,gBAAgB,GACjB,EAAE,mBAAmB,qBA8BrB"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { cn } from '../../utils/cn'
|
|
5
|
-
import { EntityImage } from '../ui/entity-image'
|
|
6
|
-
import { BackButton } from './back-button'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Page-header primitive — the canonical "back-button + title + subtitle
|
|
10
|
-
* + (optional) image / actions" chrome every lib page uses.
|
|
11
|
-
*
|
|
12
|
-
* Owns the SSOT for the page-header DOM/CSS that the rest of the lib
|
|
13
|
-
* was duplicating: pre-`mb` top padding, h1 typography (`text-h2`), h6
|
|
14
|
-
* subtitle (`text-h6`), the gap between the back button and the title
|
|
15
|
-
* block, and the right-side actions slot. Consumers either render this
|
|
16
|
-
* directly (e.g. `<DocViewer>` / `<DocsHubPage>`) or compose it through
|
|
17
|
-
* the `<TitleBlock>` adapter which adds the `PageActions` /
|
|
18
|
-
* `ActionsMenu` / selector wiring on top.
|
|
19
|
-
*
|
|
20
|
-
* Why this exists: knowledge-hub vs releases sat at different vertical
|
|
21
|
-
* rhythms (px-perfect mismatch on title baseline + subtitle offset)
|
|
22
|
-
* because the docs surface hand-rolled its own chrome instead of going
|
|
23
|
-
* through `TitleBlock`. Centralizing the layout here means every
|
|
24
|
-
* embeddable lib page (DocViewer, DevSectionPage, LegalDocumentPage,
|
|
25
|
-
* OnboardingGuideDetailView) renders pixel-identical title/subtitle/
|
|
26
|
-
* back-button typography + spacing — and a future spacing/typography
|
|
27
|
-
* tweak is one file.
|
|
28
|
-
*/
|
|
29
|
-
export interface PageHeaderProps {
|
|
30
|
-
/** Page title (h1). Plain string — ReactNode is intentionally not
|
|
31
|
-
* supported here so every consumer renders the same typography. */
|
|
32
|
-
title?: string
|
|
33
|
-
/** Optional icon rendered inline before the title text (e.g. the
|
|
34
|
-
* rocket emoji on /releases, the docs icon on /knowledge-base).
|
|
35
|
-
* Same `flex items-center gap-3` row as `<DevSectionView>`'s hero. */
|
|
36
|
-
titleIcon?: React.ReactNode
|
|
37
|
-
/** Page subtitle (description paragraph). */
|
|
38
|
-
subtitle?: string
|
|
39
|
-
/**
|
|
40
|
-
* Render a yellow accent dot (`.`) after the title. Mirrors the
|
|
41
|
-
* hub's legacy `<AdminPageHeader accentDot>` flag — now lib-wide so
|
|
42
|
-
* surfaces like `/knowledge-base` keep their existing accent styling
|
|
43
|
-
* after the migration.
|
|
44
|
-
*/
|
|
45
|
-
accentDot?: boolean
|
|
46
|
-
/** Optional thumbnail / hero image rendered to the left of the
|
|
47
|
-
* title block. Used by entity-image-style headers (onboarding
|
|
48
|
-
* guides, knowledge-base entries). */
|
|
49
|
-
image?: { src: string; alt?: string }
|
|
50
|
-
/** Back-button shown above the title block. Hidden on mobile (matches
|
|
51
|
-
* the existing TitleBlock + DocViewer behavior). */
|
|
52
|
-
backButton?: { label?: string; onClick: () => void }
|
|
53
|
-
/** Right-side actions slot (action buttons / menu / tab selector).
|
|
54
|
-
* Composed externally (e.g. `<TitleBlock>` builds `PageActions` + menu
|
|
55
|
-
* + selector and passes the result here). */
|
|
56
|
-
actions?: React.ReactNode
|
|
57
|
-
/**
|
|
58
|
-
* Visual variant.
|
|
59
|
-
* - `plain` (default): transparent background, no border.
|
|
60
|
-
* - `card`: card background, border, and padding on mobile only —
|
|
61
|
-
* collapses to plain on md+ (legacy `TitleBlock` variant — kept so
|
|
62
|
-
* surfaces that depend on the card affordance don't regress).
|
|
63
|
-
*/
|
|
64
|
-
variant?: 'plain' | 'card'
|
|
65
|
-
/** When the consumer wraps `<PageHeader>` in its OWN spacing container
|
|
66
|
-
* (e.g. `<DevSectionView>`'s `gap-10 flex-col`), the default `mb-l`
|
|
67
|
-
* bottom margin doubles up. Pass `noBottomMargin` to opt out. */
|
|
68
|
-
noBottomMargin?: boolean
|
|
69
|
-
/** Same as `noBottomMargin` for the default `pt-l` top padding. Set
|
|
70
|
-
* this when PageHeader is nested INSIDE another layout that already
|
|
71
|
-
* provides top spacing (e.g. `<DevSectionView>`'s hero, which sits
|
|
72
|
-
* inside `<PageLayout>`'s children flow). */
|
|
73
|
-
noTopPadding?: boolean
|
|
74
|
-
className?: string
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Title typography — copied verbatim from <DevSectionView>'s hero h1
|
|
78
|
-
// (`src/components/shared/dev-section/dev-section-view.tsx`). The user-
|
|
79
|
-
// reported "header text not aligned" between /knowledge-base and
|
|
80
|
-
// /releases bottomed out here: DevSectionView rendered text-h1 with
|
|
81
|
-
// tracking-[-1.12px] while this component used text-h2 — visually huge
|
|
82
|
-
// gap. Now both render through the exact same class string. DevSectionView
|
|
83
|
-
// is being refactored in this commit to delegate to <PageHeader> so the
|
|
84
|
-
// shared-component claim is enforced at the code level too.
|
|
85
|
-
const TITLE_CLASS = 'text-h1 tracking-[-1.12px] text-ods-text-primary flex items-center gap-3'
|
|
86
|
-
// Subtitle ALWAYS occupies exactly 2 lines of vertical space.
|
|
87
|
-
// `min-h-[56px]` (= 2 × 28px leading) reserves the row height so a
|
|
88
|
-
// single-line subtitle doesn't shrink the header — page-to-page height
|
|
89
|
-
// stays consistent.
|
|
90
|
-
// `line-clamp-2` caps long copy at 2 lines + ellipsis so wrapping doesn't
|
|
91
|
-
// push the search bar down.
|
|
92
|
-
const SUBTITLE_CLASS = "font-['DM_Sans'] font-medium text-[18px] leading-[28px] text-ods-text-secondary max-w-3xl line-clamp-2 min-h-[56px]"
|
|
93
|
-
|
|
94
|
-
export function PageHeader({
|
|
95
|
-
title,
|
|
96
|
-
titleIcon,
|
|
97
|
-
subtitle,
|
|
98
|
-
accentDot,
|
|
99
|
-
image,
|
|
100
|
-
backButton,
|
|
101
|
-
actions,
|
|
102
|
-
variant = 'plain',
|
|
103
|
-
noBottomMargin = false,
|
|
104
|
-
noTopPadding = false,
|
|
105
|
-
className,
|
|
106
|
-
}: PageHeaderProps) {
|
|
107
|
-
return (
|
|
108
|
-
<div
|
|
109
|
-
className={cn(
|
|
110
|
-
'flex items-end justify-between gap-[var(--spacing-system-m)]',
|
|
111
|
-
'md:flex-col md:items-start md:justify-start lg:flex-row lg:items-end lg:justify-between',
|
|
112
|
-
!noTopPadding && 'pt-[var(--spacing-system-l)]',
|
|
113
|
-
variant === 'card'
|
|
114
|
-
? cn(
|
|
115
|
-
'bg-ods-card border-b border-ods-border',
|
|
116
|
-
'px-[var(--spacing-system-l)] pb-[var(--spacing-system-l)]',
|
|
117
|
-
'md:bg-transparent md:border-b-0',
|
|
118
|
-
'md:px-0 md:pb-0',
|
|
119
|
-
!noBottomMargin && 'md:mb-[var(--spacing-system-l)]',
|
|
120
|
-
)
|
|
121
|
-
: !noBottomMargin && 'mb-[var(--spacing-system-l)]',
|
|
122
|
-
className,
|
|
123
|
-
)}
|
|
124
|
-
>
|
|
125
|
-
<div className="flex flex-col gap-[var(--spacing-system-xs)] flex-1 min-w-0">
|
|
126
|
-
{backButton && (
|
|
127
|
-
<BackButton
|
|
128
|
-
onClick={backButton.onClick}
|
|
129
|
-
label={backButton.label}
|
|
130
|
-
className="hidden md:inline-flex"
|
|
131
|
-
/>
|
|
132
|
-
)}
|
|
133
|
-
{/* Title + subtitle stack. Matches `<DevSectionView>`'s hero
|
|
134
|
-
* exactly: `space-y-4` between h1 and p, `flex items-center
|
|
135
|
-
* gap-3` for icon-inline title row, identical class strings.
|
|
136
|
-
* Image (entity-image-style) prefixes the title row, NOT a
|
|
137
|
-
* separate column with its own vertical rhythm — that's the
|
|
138
|
-
* legacy TitleBlock 2-col layout which broke the title-to-
|
|
139
|
-
* subtitle gap. */}
|
|
140
|
-
{(title || subtitle || image || titleIcon) && (
|
|
141
|
-
<div className="space-y-4">
|
|
142
|
-
{(title || image || titleIcon) && (
|
|
143
|
-
<h1 className={TITLE_CLASS}>
|
|
144
|
-
{image && (
|
|
145
|
-
<EntityImage
|
|
146
|
-
src={image.src}
|
|
147
|
-
alt={image.alt}
|
|
148
|
-
fallbackText={image.alt || title}
|
|
149
|
-
/>
|
|
150
|
-
)}
|
|
151
|
-
{titleIcon}
|
|
152
|
-
{title && (
|
|
153
|
-
<span>
|
|
154
|
-
{title}
|
|
155
|
-
{accentDot && <span className="text-ods-accent">.</span>}
|
|
156
|
-
</span>
|
|
157
|
-
)}
|
|
158
|
-
</h1>
|
|
159
|
-
)}
|
|
160
|
-
{(title || titleIcon || image) && (
|
|
161
|
-
// Always render the subtitle <p> when the title block exists,
|
|
162
|
-
// even when `subtitle` is empty — `SUBTITLE_CLASS` reserves
|
|
163
|
-
// `min-h-[56px]` so headers WITH and WITHOUT subtitles share a
|
|
164
|
-
// baseline (the JSDoc on SUBTITLE_CLASS claims "ALWAYS occupies
|
|
165
|
-
// exactly 2 lines"; gating the <p> on truthy `subtitle` broke
|
|
166
|
-
// that contract — pages without subtitle were ~56px shorter).
|
|
167
|
-
// Falsy subtitles render an NBSP placeholder so the empty <p>
|
|
168
|
-
// still takes its reserved height.
|
|
169
|
-
<p className={SUBTITLE_CLASS}>{subtitle || ' '}</p>
|
|
170
|
-
)}
|
|
171
|
-
</div>
|
|
172
|
-
)}
|
|
173
|
-
</div>
|
|
174
|
-
|
|
175
|
-
{actions && (
|
|
176
|
-
<div className="flex gap-2 items-center shrink-0">{actions}</div>
|
|
177
|
-
)}
|
|
178
|
-
</div>
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export default PageHeader
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { useRouter } from '../../embed-shims/next-navigation'
|
|
5
|
-
import { PageShell } from './article-detail-layout'
|
|
6
|
-
import { PageLayout } from './page-layout'
|
|
7
|
-
import { PageHeader, type PageHeaderProps } from './page-header'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* `<PageWithHeader>` — the canonical 4-layer unified-chrome wrapper that
|
|
11
|
-
* every public lib/hub page now uses (Knowledge Hub, Roadmap, FAQs,
|
|
12
|
-
* Authors, Blog, Vendors, Case Studies, Interviews, Investor Updates,
|
|
13
|
-
* /webinars-/podcasts-/events, hub admin-but-public pages, …).
|
|
14
|
-
*
|
|
15
|
-
* Renders the same JSX tree every consumer was hand-rolling individually
|
|
16
|
-
* before this helper landed:
|
|
17
|
-
*
|
|
18
|
-
* PageShell ← bg-ods-bg, max-w-[1920px],
|
|
19
|
-
* page-shell-px/pt/pb gutters
|
|
20
|
-
* PageLayout backButton ← TitleBlock → PageHeader #1 (back-btn row
|
|
21
|
-
* only, pt-l + mb-l)
|
|
22
|
-
* div.w-full.flex-col.gap-10 ← matches DevSectionView's hero container
|
|
23
|
-
* PageHeader title/subtitle ← PageHeader #2 (noTopPadding +
|
|
24
|
-
* titleIcon accentDot noBottomMargin so PageLayout's gap-l owns
|
|
25
|
-
* noTopPadding the spacing between #1 and #2)
|
|
26
|
-
* noBottomMargin
|
|
27
|
-
* children ← page-specific body (search, lists, forms)
|
|
28
|
-
*
|
|
29
|
-
* Why this exists: 15+ pages copy-pasted the EXACT same nesting + the
|
|
30
|
-
* EXACT same `noTopPadding + noBottomMargin + accentDot` triplet on the
|
|
31
|
-
* inner `<PageHeader>`. Forgetting one of those flags collapsed the gap
|
|
32
|
-
* to ~8px (the FAQs-vs-Onboarding-Guides bug). Centralizing the chain
|
|
33
|
-
* here makes the spacing invariant compiler-enforced — consumers can't
|
|
34
|
-
* pick the wrong combination.
|
|
35
|
-
*
|
|
36
|
-
* **Back button is config-driven by default.** Consumers don't have to
|
|
37
|
-
* thread `useRouter()` + `() => router.push('/')` themselves anymore —
|
|
38
|
-
* the helper supplies a sane default (`{ label: 'Back to home', href: '/' }`).
|
|
39
|
-
* Hosts whose `/` lives elsewhere should pass their own `href`. Pass
|
|
40
|
-
* `backButton={false}` to suppress entirely (the lib's own
|
|
41
|
-
* `<DocsHubPage>` does this on the platform-home docs landing).
|
|
42
|
-
*/
|
|
43
|
-
export interface PageWithHeaderProps {
|
|
44
|
-
/** Title — passed straight to inner `<PageHeader>`. */
|
|
45
|
-
title?: string
|
|
46
|
-
/** Inline icon rendered before the title (lucide / SVG node). Wrap with
|
|
47
|
-
* `SECTION_HERO_ICON_CLASS` at the call site, or use the lib's
|
|
48
|
-
* `<PageHeader>`'s `titleIcon` ReactNode signature directly. */
|
|
49
|
-
titleIcon?: PageHeaderProps['titleIcon']
|
|
50
|
-
/** Subtitle (1-2 lines, auto-clamped to 2 + min-h-[56px]). */
|
|
51
|
-
subtitle?: string
|
|
52
|
-
/** Render yellow accent dot after the title (default true — matches every
|
|
53
|
-
* unified surface). Pass `false` to opt out. */
|
|
54
|
-
accentDot?: boolean
|
|
55
|
-
/** Back-button config. Defaults to `{ label: 'Back to home', href: '/' }`.
|
|
56
|
-
* Pass `false` to hide entirely (platform-home docs landings). */
|
|
57
|
-
backButton?: { label?: string; href?: string } | false
|
|
58
|
-
/** Optional image (entity-image-style — onboarding guides etc.). */
|
|
59
|
-
image?: PageHeaderProps['image']
|
|
60
|
-
/** Optional actions slot (right side of header). */
|
|
61
|
-
actions?: React.ReactNode
|
|
62
|
-
/** Page body — search bars, lists, forms, sections. Rendered INSIDE the
|
|
63
|
-
* gap-10 flex column so it shares gutters + vertical rhythm with the
|
|
64
|
-
* header. */
|
|
65
|
-
children: React.ReactNode
|
|
66
|
-
/** Extra class applied to the gap-10 content wrapper. */
|
|
67
|
-
contentClassName?: string
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function PageWithHeader({
|
|
71
|
-
title,
|
|
72
|
-
titleIcon,
|
|
73
|
-
subtitle,
|
|
74
|
-
accentDot = true,
|
|
75
|
-
backButton,
|
|
76
|
-
image,
|
|
77
|
-
actions,
|
|
78
|
-
children,
|
|
79
|
-
contentClassName,
|
|
80
|
-
}: PageWithHeaderProps) {
|
|
81
|
-
const router = useRouter()
|
|
82
|
-
|
|
83
|
-
const backCfg =
|
|
84
|
-
backButton === false
|
|
85
|
-
? undefined
|
|
86
|
-
: {
|
|
87
|
-
label: backButton?.label ?? 'Back to home',
|
|
88
|
-
onClick: () => router.push(backButton?.href ?? '/'),
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<PageShell>
|
|
93
|
-
<PageLayout backButton={backCfg}>
|
|
94
|
-
<div className={`w-full flex flex-col gap-10${contentClassName ? ` ${contentClassName}` : ''}`}>
|
|
95
|
-
<PageHeader
|
|
96
|
-
title={title}
|
|
97
|
-
titleIcon={titleIcon}
|
|
98
|
-
subtitle={subtitle}
|
|
99
|
-
accentDot={accentDot}
|
|
100
|
-
image={image}
|
|
101
|
-
actions={actions}
|
|
102
|
-
noTopPadding
|
|
103
|
-
noBottomMargin
|
|
104
|
-
/>
|
|
105
|
-
{children}
|
|
106
|
-
</div>
|
|
107
|
-
</PageLayout>
|
|
108
|
-
</PageShell>
|
|
109
|
-
)
|
|
110
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|