Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/sdk/ui/functions/OcAccountMenu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const metadata = {
function OcAccountMenu(props: OcAccountMenuProps): any;
```

Defined in: [account-menu.tsx:533](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L533)
Defined in: [account-menu.tsx:562](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L562)

Connected variant — pulls the session from `useOcSession()`. This is
what every consumer site with `<OcSessionProvider>` mounted should
Expand Down
2 changes: 1 addition & 1 deletion src/pages/sdk/ui/functions/OcAccountMenuView.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const metadata = {
function OcAccountMenuView(__namedParameters: OcAccountMenuViewProps): any;
```

Defined in: [account-menu.tsx:571](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L571)
Defined in: [account-menu.tsx:607](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L607)

Presentational variant — takes a session as an explicit prop. Use
this when your site runs its own auth context (e.g. ochk.io's
Expand Down
8 changes: 4 additions & 4 deletions src/pages/sdk/ui/interfaces/OcAccountMenuBuildInfo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export const metadata = {

# Interface: OcAccountMenuBuildInfo

Defined in: [account-menu.tsx:59](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L59)
Defined in: [account-menu.tsx:61](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L61)

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| &lt;a id="property-repo">&lt;/a> `repo?` | `string` | GitHub `owner/repo` slug — combined with `sha` to produce the `https://github.com/<repo>/commit/<sha>` link. | [account-menu.tsx:71](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L71) |
| &lt;a id="property-sha">&lt;/a> `sha?` | `string` | 7+ character commit SHA. Render as `'dev'` (or omit) for local dev to suppress the GitHub link. | [account-menu.tsx:66](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L66) |
| &lt;a id="property-version">&lt;/a> `version` | `string` | Display version string, e.g. `'0.5.0'` (rendered as `v0.5.0`). | [account-menu.tsx:61](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L61) |
| &lt;a id="property-repo">&lt;/a> `repo?` | `string` | GitHub `owner/repo` slug — combined with `sha` to produce the `https://github.com/<repo>/commit/<sha>` link. | [account-menu.tsx:73](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L73) |
| &lt;a id="property-sha">&lt;/a> `sha?` | `string` | 7+ character commit SHA. Render as `'dev'` (or omit) for local dev to suppress the GitHub link. | [account-menu.tsx:68](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L68) |
| &lt;a id="property-version">&lt;/a> `version` | `string` | Display version string, e.g. `'0.5.0'` (rendered as `v0.5.0`). | [account-menu.tsx:63](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L63) |
8 changes: 4 additions & 4 deletions src/pages/sdk/ui/interfaces/OcAccountMenuItem.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const metadata = {

# Interface: OcAccountMenuItem

Defined in: [account-menu.tsx:47](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L47)
Defined in: [account-menu.tsx:49](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L49)

`<OcAccountMenu>` — the canonical top-right account affordance for
every family site. Replaces the older inline-styled `OcAccountChip`
Expand Down Expand Up @@ -45,6 +45,6 @@ its tree (already standard in every consumer's `_app.tsx`).

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| &lt;a id="property-external">&lt;/a> `external?` | `boolean` | When `true`, opens in a new tab and renders a ↗ glyph after the label. Use for cross-domain links (e.g. `https://ochk.io/dashboard`). | [account-menu.tsx:56](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L56) |
| &lt;a id="property-href">&lt;/a> `href` | `string` | Same-origin path or absolute URL. | [account-menu.tsx:49](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L49) |
| &lt;a id="property-label">&lt;/a> `label` | `string` | Visible label. | [account-menu.tsx:51](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L51) |
| &lt;a id="property-external">&lt;/a> `external?` | `boolean` | When `true`, opens in a new tab and renders a ↗ glyph after the label. Use for cross-domain links (e.g. `https://ochk.io/dashboard`). | [account-menu.tsx:58](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L58) |
| &lt;a id="property-href">&lt;/a> `href` | `string` | Same-origin path or absolute URL. | [account-menu.tsx:51](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L51) |
| &lt;a id="property-label">&lt;/a> `label` | `string` | Visible label. | [account-menu.tsx:53](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L53) |
28 changes: 14 additions & 14 deletions src/pages/sdk/ui/interfaces/OcAccountMenuProps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const metadata = {

# Interface: OcAccountMenuProps

Defined in: [account-menu.tsx:109](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L109)
Defined in: [account-menu.tsx:138](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L138)

## Extended by

Expand All @@ -21,16 +21,16 @@ Defined in: [account-menu.tsx:109](https://github.com/orangecheck/oc-packages/bl

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| &lt;a id="property-build">&lt;/a> `build?` | [`OcAccountMenuBuildInfo`](OcAccountMenuBuildInfo.mdx) | Optional BuildFooter info. When present, renders a tiny mono footer at the bottom of the popover with `site · vX.Y.Z · sha` — the SHA links to the matching GitHub commit when `repo` is also provided. Drive this from your `next.config.ts` via `NEXT_PUBLIC_APP_VERSION` / `NEXT_PUBLIC_BUILD_SHA` env vars. | [account-menu.tsx:175](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L175) |
| &lt;a id="property-classname">&lt;/a> `className?` | `string` | className overrides for layout-level customisation. | [account-menu.tsx:183](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L183) |
| &lt;a id="property-current">&lt;/a> `current` | [`EcosystemSlug`](../type-aliases/EcosystemSlug.mdx) | Which family property this site IS. Used to label the section header (`§ signed in · vault.ochk.io`) and to suppress the family-dashboard menu item when the user is already on `home`. | [account-menu.tsx:115](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L115) |
| &lt;a id="property-menuitems">&lt;/a> `menuItems?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Site-specific menu items, rendered between the section header and the family-dashboard / sign-out rows. Keep this short — 2–6 entries is the sweet spot. Pass `[]` (or omit) for sites with no per-site routes worth surfacing. | [account-menu.tsx:144](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L144) |
| &lt;a id="property-popoverclassname">&lt;/a> `popoverClassName?` | `string` | - | [account-menu.tsx:185](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L185) |
| &lt;a id="property-primarynavlinks">&lt;/a> `primaryNavLinks?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Centered primary nav links (typically dashboard · docs · spec). Rendered inside the popover at viewport widths below `sm` (640px) — these are the same links the `<OcPrimaryNav>` row shows inline at sm+, but at ultra-small widths the inline row hides and this popover section takes its place. The result: one dropdown surface owns navigation on phones, no separate hamburger drawer required. | [account-menu.tsx:154](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L154) |
| &lt;a id="property-secondarynavlinks">&lt;/a> `secondaryNavLinks?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Tertiary nav links (about / contact / status / privacy / etc.). Always visible inside the popover. Folds the legacy mobile-only hamburger drawer's contents into the same dropdown as everything else, so there's exactly one nav surface to learn. | [account-menu.tsx:161](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L161) |
| &lt;a id="property-showfamilydashboard">&lt;/a> `showFamilyDashboard?` | `boolean` | When `true` (default), shows a `family dashboard ↗` link to `https://ochk.io/dashboard`. Set `false` for `home` (already there) or for sites that don't want it. | [account-menu.tsx:167](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L167) |
| &lt;a id="property-signinlabel">&lt;/a> `signInLabel?` | `string` | Label for the anonymous "sign in" affordance. Default `'sign in'`. | [account-menu.tsx:124](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L124) |
| &lt;a id="property-signinurl">&lt;/a> `signInUrl?` | `string` | Where the anonymous "sign in" affordance points. Default `'/signin'` — works with every site's in-place `<OcSignIn>` page. Pass `'https://ochk.io/signin'` if you want to bounce to the auth host instead. | [account-menu.tsx:122](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L122) |
| &lt;a id="property-signoutredirect">&lt;/a> `signOutRedirect?` | `string` | Where the browser lands after the user signs out. Default `'/'` — the current site's own home. On sign-out the menu fires `signOut()` (whose logout round-trip is `keepalive`, so it survives the navigation) and *immediately* hard-navigates here. Navigating in the same tick is deliberate: it forecloses the race where an auth-gated page observes the session flip to `anonymous` and runs its own redirect-to-sign-in first. Sign-out means "leave", not "go sign in again" — so the family default is the site's home, never a sign-in page or the auth host. | [account-menu.tsx:137](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L137) |
| &lt;a id="property-sitestate">&lt;/a> `siteState?` | [`SiteState`](../type-aliases/SiteState.mdx) | Optional lifecycle chip rendered inside the BuildFooter line (between site and version). Mirrors the chip on the logo so both surfaces agree. | [account-menu.tsx:181](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L181) |
| &lt;a id="property-triggerclassname">&lt;/a> `triggerClassName?` | `string` | - | [account-menu.tsx:184](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L184) |
| &lt;a id="property-build">&lt;/a> `build?` | [`OcAccountMenuBuildInfo`](OcAccountMenuBuildInfo.mdx) | Optional BuildFooter info. When present, renders a tiny mono footer at the bottom of the popover with `site · vX.Y.Z · sha` — the SHA links to the matching GitHub commit when `repo` is also provided. Drive this from your `next.config.ts` via `NEXT_PUBLIC_APP_VERSION` / `NEXT_PUBLIC_BUILD_SHA` env vars. | [account-menu.tsx:204](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L204) |
| &lt;a id="property-classname">&lt;/a> `className?` | `string` | className overrides for layout-level customisation. | [account-menu.tsx:212](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L212) |
| &lt;a id="property-current">&lt;/a> `current` | [`EcosystemSlug`](../type-aliases/EcosystemSlug.mdx) | Which family property this site IS. Used to label the section header (`§ signed in · vault.ochk.io`) and to suppress the family-dashboard menu item when the user is already on `home`. | [account-menu.tsx:144](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L144) |
| &lt;a id="property-menuitems">&lt;/a> `menuItems?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Site-specific menu items, rendered between the section header and the family-dashboard / sign-out rows. Keep this short — 2–6 entries is the sweet spot. Pass `[]` (or omit) for sites with no per-site routes worth surfacing. | [account-menu.tsx:173](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L173) |
| &lt;a id="property-popoverclassname">&lt;/a> `popoverClassName?` | `string` | - | [account-menu.tsx:214](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L214) |
| &lt;a id="property-primarynavlinks">&lt;/a> `primaryNavLinks?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Centered primary nav links (typically dashboard · docs · spec). Rendered inside the popover at viewport widths below `sm` (640px) — these are the same links the `<OcPrimaryNav>` row shows inline at sm+, but at ultra-small widths the inline row hides and this popover section takes its place. The result: one dropdown surface owns navigation on phones, no separate hamburger drawer required. | [account-menu.tsx:183](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L183) |
| &lt;a id="property-secondarynavlinks">&lt;/a> `secondaryNavLinks?` | readonly [`OcAccountMenuItem`](OcAccountMenuItem.mdx)[] | Tertiary nav links (about / contact / status / privacy / etc.). Always visible inside the popover. Folds the legacy mobile-only hamburger drawer's contents into the same dropdown as everything else, so there's exactly one nav surface to learn. | [account-menu.tsx:190](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L190) |
| &lt;a id="property-showfamilydashboard">&lt;/a> `showFamilyDashboard?` | `boolean` | When `true` (default), shows a `family dashboard ↗` link to `https://ochk.io/dashboard`. Set `false` for `home` (already there) or for sites that don't want it. | [account-menu.tsx:196](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L196) |
| &lt;a id="property-signinlabel">&lt;/a> `signInLabel?` | `string` | Label for the anonymous "sign in" affordance. Default `'sign in'`. | [account-menu.tsx:153](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L153) |
| &lt;a id="property-signinurl">&lt;/a> `signInUrl?` | `string` | Where the anonymous "sign in" affordance points. Default `'/signin'` — works with every site's in-place `<OcSignIn>` page. Pass `'https://ochk.io/signin'` if you want to bounce to the auth host instead. | [account-menu.tsx:151](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L151) |
| &lt;a id="property-signoutredirect">&lt;/a> `signOutRedirect?` | `string` | Where the browser lands after the user signs out. Default `'/'` — the current site's own home. On sign-out the menu fires `signOut()` (whose logout round-trip is `keepalive`, so it survives the navigation) and *immediately* hard-navigates here. Navigating in the same tick is deliberate: it forecloses the race where an auth-gated page observes the session flip to `anonymous` and runs its own redirect-to-sign-in first. Sign-out means "leave", not "go sign in again" — so the family default is the site's home, never a sign-in page or the auth host. | [account-menu.tsx:166](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L166) |
| &lt;a id="property-sitestate">&lt;/a> `siteState?` | [`SiteState`](../type-aliases/SiteState.mdx) | Optional lifecycle chip rendered inside the BuildFooter line (between site and version). Mirrors the chip on the logo so both surfaces agree. | [account-menu.tsx:210](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L210) |
| &lt;a id="property-triggerclassname">&lt;/a> `triggerClassName?` | `string` | - | [account-menu.tsx:213](https://github.com/orangecheck/oc-packages/blob/main/ui/src/account-menu.tsx#L213) |
Loading