@orangecheck/app-design 1.0.0 → 1.1.1

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.
Files changed (66) hide show
  1. package/README.md +21 -5
  2. package/dist/chrome.d.mts +31 -42
  3. package/dist/chrome.d.ts +31 -42
  4. package/dist/chrome.js +502 -24
  5. package/dist/chrome.js.map +1 -1
  6. package/dist/chrome.mjs +497 -26
  7. package/dist/chrome.mjs.map +1 -1
  8. package/dist/code.d.mts +52 -0
  9. package/dist/code.d.ts +52 -0
  10. package/dist/code.js +534 -0
  11. package/dist/code.js.map +1 -0
  12. package/dist/code.mjs +522 -0
  13. package/dist/code.mjs.map +1 -0
  14. package/dist/components.d.mts +61 -117
  15. package/dist/components.d.ts +61 -117
  16. package/dist/components.js +2178 -106
  17. package/dist/components.js.map +1 -1
  18. package/dist/components.mjs +2150 -110
  19. package/dist/components.mjs.map +1 -1
  20. package/dist/docs-DhnstueM.d.ts +219 -0
  21. package/dist/docs-DiR6s43s.d.mts +219 -0
  22. package/dist/family.js +2 -1
  23. package/dist/family.js.map +1 -1
  24. package/dist/family.mjs +2 -1
  25. package/dist/family.mjs.map +1 -1
  26. package/dist/format.d.mts +12 -0
  27. package/dist/format.d.ts +12 -0
  28. package/dist/format.js +65 -0
  29. package/dist/format.js.map +1 -0
  30. package/dist/format.mjs +58 -0
  31. package/dist/format.mjs.map +1 -0
  32. package/dist/hero-Dn37il-9.d.mts +31 -0
  33. package/dist/hero-Dn37il-9.d.ts +31 -0
  34. package/dist/index.d.mts +10 -3
  35. package/dist/index.d.ts +10 -3
  36. package/dist/index.js +2675 -131
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +2621 -134
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/mdx.d.mts +58 -0
  41. package/dist/mdx.d.ts +58 -0
  42. package/dist/mdx.js +1719 -0
  43. package/dist/mdx.js.map +1 -0
  44. package/dist/mdx.mjs +1692 -0
  45. package/dist/mdx.mjs.map +1 -0
  46. package/dist/primitives.d.mts +22 -5
  47. package/dist/primitives.d.ts +22 -5
  48. package/dist/primitives.js +51 -5
  49. package/dist/primitives.js.map +1 -1
  50. package/dist/primitives.mjs +51 -7
  51. package/dist/primitives.mjs.map +1 -1
  52. package/dist/session.d.mts +18 -0
  53. package/dist/session.d.ts +18 -0
  54. package/dist/session.js +432 -0
  55. package/dist/session.js.map +1 -0
  56. package/dist/session.mjs +401 -0
  57. package/dist/session.mjs.map +1 -0
  58. package/dist/styles/code.css +97 -0
  59. package/dist/styles/theme.css +2 -0
  60. package/dist/styles/tokens.css +40 -0
  61. package/dist/styles.css +1 -0
  62. package/dist/tool-shell-B1C7ahKE.d.ts +81 -0
  63. package/dist/tool-shell-BDx_N5ai.d.mts +81 -0
  64. package/dist/tools-BggNN5DV.d.ts +131 -0
  65. package/dist/tools-DFIxIj5p.d.mts +131 -0
  66. package/package.json +31 -2
package/README.md CHANGED
@@ -28,14 +28,30 @@ family `OcThemeProvider` on the same page: it writes `data-oc-theme` and the sha
28
28
  | Entry | What |
29
29
  |---|---|
30
30
  | `/brand` | `Mark`, `AppIcon`, `Lockup`, `IsoCheck`, `HalftoneSphere` |
31
- | `/primitives` | `Button`, `Badge`, `Card`, form controls, `Dialog`, `Sheet`, `Popover`, `Tooltip`, `DropdownMenu`, `Tabs`, `Toaster` |
32
- | `/components` | `Display`, `Eyebrow`, `Section`, `StepGrid`, `PackageCard`, `TruthTable`, `Sats`, `DataTable`, `Notice`, `ProgressSteps`, `ErrorPage`, the public page blocks (`SectionHeading`, `FactBlock`, `ProofStrip`, `Closing`, `LegalDocument` …) and the protocol page blocks (`ProtocolGrid`, `AppGrid`, `ProtocolHero`, `SpecCard`, `VerifyBox`, `ComparisonTable`, `VerifyReport`, `SignMessage`) |
33
- | `/chrome` | `SiteHeader`, `SiteFooter`, `FamilyMenu`, `SkipLink`, `SiteBanner`, `SignInFrame`, `AppShell`, `AccountMenu`, `ThemeToggle` |
31
+ | `/primitives` | `Button`, `Badge`, `Card`, form controls (`Input size="sm"` for tools), `Dialog`, `Sheet`, `Popover`, `Tooltip`, `DropdownMenu`, `Tabs`, `Toaster`, `DensityProvider` |
32
+ | `/components` | `Display`, `Eyebrow`, `Section`, `StepGrid`, `PackageCard`, `TruthTable`, `Sats`, `DataTable`, `Notice`, `ProgressSteps`, `ErrorPage`, the public page blocks (`SectionHeading`, `FactBlock`, `ProofStrip`, `Closing`, `LegalDocument` …), the protocol page blocks (`ProtocolGrid`, `AppGrid`, `ProtocolHero`, `SpecCard`, `VerifyBox`, `ComparisonTable`, `VerifyReport`, `SignMessage`), code (`CodeBlock`, `CodeTabs`, `InstallTabs`), the docs blocks (`Breadcrumbs`, `DocsPager`, `OnThisPage`, `Callout`, `Steps`, `LinkCard`, `ApiTable`, `Diagram`, `SearchDialog`) and the tool parts (`ArtifactView`, `DropZone`, `FormSection`, `StateBadge`, `AnchorStatus`, `BlockHeight`, `BlockCountdown`, `Meter`, `FilterChips`, `ToolGrid`) |
33
+ | `/chrome` | `SiteHeader`, `SiteFooter`, `FamilyMenu`, `SkipLink`, `SiteBanner`, `SignInFrame`, `AppShell`, `AccountMenu`, `ThemeToggle`, `DocsShell`, `DocsNav`, `ToolShell`, `SessionAccountView` |
34
+ | `/mdx` | `mdxComponents` and `createMdxComponents({ mermaid })`: markdown in the system's type |
35
+ | `/code` | `rehypeCode` (highlights fences at build time), `highlight`, `highlightToHtml`; no React |
36
+ | `/format` | `explorerUrl`, `shortenMiddle`, `formatBlockHeight`, `blocksToDuration`, `formatUtc`, `formatBytes`; no React |
37
+ | `/session` | `SessionAccount`, read from `@orangecheck/auth-client` (an optional peer: install it to use this entry) |
34
38
  | `/family` | every public site as data (`FAMILY`, `PROTOCOLS`, `OCHK_IO_NAV`, `LEGAL_LINKS`); no React |
35
39
  | `/tokens` | the palette as data, for OG images and charts |
36
40
 
37
- `yarn test` fails if any text token drops under WCAG AA in light or dark, or if a
38
- rule could match without the attribute. `scripts/halftone.py` turns any photo into
41
+ Docs written in MDX get highlighted code from the build and the system's type:
42
+
43
+ ```ts
44
+ // next.config.ts
45
+ import { rehypeCode } from '@orangecheck/app-design/code';
46
+ const withMDX = createMDX({ options: { rehypePlugins: [rehypeCode] } });
47
+
48
+ // _app.tsx: <MDXProvider components={createMdxComponents({ mermaid: () => import('mermaid') })}>
49
+ ```
50
+
51
+ `yarn test` fails if any text token (the syntax colours included) drops under WCAG
52
+ AA in light or dark, if a rule could match without the attribute, if the
53
+ highlighter changes a character of the code it colours, or if a component stops
54
+ doing what its story shows. `scripts/halftone.py` turns any photo into
39
55
  the dot layer of a `HalftoneSphere`.
40
56
 
41
57
  MIT © OrangeCheck. Inter and JetBrains Mono are SIL OFL 1.1.
package/dist/chrome.d.mts CHANGED
@@ -1,6 +1,11 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { e as FooterColumn, d as FamilySlug, N as NavItem } from './index-C6hDqOOS.mjs';
4
+ import { T as TocItem } from './hero-Dn37il-9.mjs';
5
+ import { a as Status } from './status-badge-DRwGhB0h.mjs';
6
+ export { A as AccountMenu, a as AccountMenuItem, b as AppShell, O as OCHK_APP_ACCOUNT, S as SessionAccountView, c as SessionState, d as ShellNavGroup, e as ShellNavItem, f as ShellSection, T as ThemeToggle, g as ToolShell, h as ToolShellProps } from './tool-shell-BDx_N5ai.mjs';
7
+ import './tools-DFIxIj5p.mjs';
8
+ import './format.mjs';
4
9
 
5
10
  interface SiteHeaderProps {
6
11
  home?: string;
@@ -11,9 +16,11 @@ interface SiteHeaderProps {
11
16
  search?: ReactNode;
12
17
  actions?: ReactNode;
13
18
  variant?: 'site' | 'tool';
19
+ navOnPhone?: boolean;
20
+ menu?: ReactNode;
14
21
  className?: string;
15
22
  }
16
- declare function SiteHeader({ home, brand, product, family, nav, search, actions, variant, className, }: SiteHeaderProps): react.JSX.Element;
23
+ declare function SiteHeader({ home, brand, product, family, nav, search, actions, variant, navOnPhone, menu: menuExtra, className, }: SiteHeaderProps): react.JSX.Element;
17
24
  declare function SkipLink({ href, children }: {
18
25
  href?: string;
19
26
  children?: ReactNode;
@@ -60,53 +67,35 @@ declare function SignInFrame({ title, lead, children, error, fineprint, brand, h
60
67
  className?: string;
61
68
  }): react.JSX.Element;
62
69
 
63
- interface ShellNavItem {
70
+ interface DocsNavItem {
64
71
  href: string;
65
- label: string;
66
- icon?: ReactNode;
67
- active?: boolean;
68
- badge?: ReactNode;
69
- }
70
- interface ShellNavGroup {
71
- label?: string;
72
- items: ShellNavItem[];
72
+ label: ReactNode;
73
+ badge?: Status | ReactNode;
73
74
  }
74
- interface ShellSection {
75
- id: string;
75
+ interface DocsNavSection {
76
76
  label: string;
77
- title?: string;
78
- href: string;
79
- groups: ShellNavGroup[];
77
+ items: DocsNavItem[];
80
78
  }
81
- declare function AppShell({ nav, sections, activeSection, page: pageOverride, persistent, home, account, banner, footer, children, className, }: {
82
- nav?: ShellNavGroup[];
83
- sections?: ShellSection[];
84
- activeSection?: string;
85
- page?: string;
86
- persistent?: ShellNavGroup[];
87
- home?: string;
88
- account?: ReactNode;
89
- banner?: ReactNode;
90
- footer?: ReactNode;
91
- children: ReactNode;
79
+ declare function DocsNav({ sections, current, onNavigate, className, }: {
80
+ sections: readonly DocsNavSection[];
81
+ current: string;
82
+ onNavigate?: () => void;
92
83
  className?: string;
93
84
  }): react.JSX.Element;
94
- interface AccountMenuItem {
95
- label: string;
96
- href?: string;
97
- onSelect?: () => void;
98
- icon?: ReactNode;
99
- destructive?: boolean;
85
+ declare const DOCS_HEADER_NAV: readonly NavItem[];
86
+ interface DocsShellProps {
87
+ nav: readonly DocsNavSection[];
88
+ current: string;
89
+ header?: ReactNode;
90
+ search?: ReactNode;
91
+ actions?: ReactNode;
92
+ breadcrumbs?: ReactNode;
93
+ toc?: TocItem[];
94
+ pager?: ReactNode;
95
+ footer?: ReactNode;
96
+ children: ReactNode;
100
97
  }
101
- declare function AccountMenu({ name, detail, items, nameFrom, }: {
102
- name: string;
103
- detail?: string;
104
- items: (AccountMenuItem | 'separator')[];
105
- nameFrom?: 'sm' | 'lg';
106
- }): react.JSX.Element;
107
- declare function ThemeToggle({ className }: {
108
- className?: string;
109
- }): react.JSX.Element;
98
+ declare function DocsShell({ nav, current, header, search, actions, breadcrumbs, toc, pager, footer, children, }: DocsShellProps): react.JSX.Element;
110
99
 
111
100
  interface ShellPlace {
112
101
  section?: string;
@@ -115,4 +104,4 @@ interface ShellPlace {
115
104
  declare const ShellContext: react.Context<ShellPlace>;
116
105
  declare function useShellPlace(): ShellPlace;
117
106
 
118
- export { AccountMenu, type AccountMenuItem, AppShell, FamilyMenu, FooterColumn, NavItem, ShellContext, type ShellNavGroup, type ShellNavItem, type ShellPlace, type ShellSection, SignInFrame, SiteBanner, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderProps, SkipLink, ThemeToggle, useShellPlace };
107
+ export { DOCS_HEADER_NAV, DocsNav, type DocsNavItem, type DocsNavSection, DocsShell, type DocsShellProps, FamilyMenu, FooterColumn, NavItem, ShellContext, type ShellPlace, SignInFrame, SiteBanner, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderProps, SkipLink, useShellPlace };
package/dist/chrome.d.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { e as FooterColumn, d as FamilySlug, N as NavItem } from './index-C6hDqOOS.js';
4
+ import { T as TocItem } from './hero-Dn37il-9.js';
5
+ import { a as Status } from './status-badge-BEOxeY9j.js';
6
+ export { A as AccountMenu, a as AccountMenuItem, b as AppShell, O as OCHK_APP_ACCOUNT, S as SessionAccountView, c as SessionState, d as ShellNavGroup, e as ShellNavItem, f as ShellSection, T as ThemeToggle, g as ToolShell, h as ToolShellProps } from './tool-shell-B1C7ahKE.js';
7
+ import './tools-BggNN5DV.js';
8
+ import './format.js';
4
9
 
5
10
  interface SiteHeaderProps {
6
11
  home?: string;
@@ -11,9 +16,11 @@ interface SiteHeaderProps {
11
16
  search?: ReactNode;
12
17
  actions?: ReactNode;
13
18
  variant?: 'site' | 'tool';
19
+ navOnPhone?: boolean;
20
+ menu?: ReactNode;
14
21
  className?: string;
15
22
  }
16
- declare function SiteHeader({ home, brand, product, family, nav, search, actions, variant, className, }: SiteHeaderProps): react.JSX.Element;
23
+ declare function SiteHeader({ home, brand, product, family, nav, search, actions, variant, navOnPhone, menu: menuExtra, className, }: SiteHeaderProps): react.JSX.Element;
17
24
  declare function SkipLink({ href, children }: {
18
25
  href?: string;
19
26
  children?: ReactNode;
@@ -60,53 +67,35 @@ declare function SignInFrame({ title, lead, children, error, fineprint, brand, h
60
67
  className?: string;
61
68
  }): react.JSX.Element;
62
69
 
63
- interface ShellNavItem {
70
+ interface DocsNavItem {
64
71
  href: string;
65
- label: string;
66
- icon?: ReactNode;
67
- active?: boolean;
68
- badge?: ReactNode;
69
- }
70
- interface ShellNavGroup {
71
- label?: string;
72
- items: ShellNavItem[];
72
+ label: ReactNode;
73
+ badge?: Status | ReactNode;
73
74
  }
74
- interface ShellSection {
75
- id: string;
75
+ interface DocsNavSection {
76
76
  label: string;
77
- title?: string;
78
- href: string;
79
- groups: ShellNavGroup[];
77
+ items: DocsNavItem[];
80
78
  }
81
- declare function AppShell({ nav, sections, activeSection, page: pageOverride, persistent, home, account, banner, footer, children, className, }: {
82
- nav?: ShellNavGroup[];
83
- sections?: ShellSection[];
84
- activeSection?: string;
85
- page?: string;
86
- persistent?: ShellNavGroup[];
87
- home?: string;
88
- account?: ReactNode;
89
- banner?: ReactNode;
90
- footer?: ReactNode;
91
- children: ReactNode;
79
+ declare function DocsNav({ sections, current, onNavigate, className, }: {
80
+ sections: readonly DocsNavSection[];
81
+ current: string;
82
+ onNavigate?: () => void;
92
83
  className?: string;
93
84
  }): react.JSX.Element;
94
- interface AccountMenuItem {
95
- label: string;
96
- href?: string;
97
- onSelect?: () => void;
98
- icon?: ReactNode;
99
- destructive?: boolean;
85
+ declare const DOCS_HEADER_NAV: readonly NavItem[];
86
+ interface DocsShellProps {
87
+ nav: readonly DocsNavSection[];
88
+ current: string;
89
+ header?: ReactNode;
90
+ search?: ReactNode;
91
+ actions?: ReactNode;
92
+ breadcrumbs?: ReactNode;
93
+ toc?: TocItem[];
94
+ pager?: ReactNode;
95
+ footer?: ReactNode;
96
+ children: ReactNode;
100
97
  }
101
- declare function AccountMenu({ name, detail, items, nameFrom, }: {
102
- name: string;
103
- detail?: string;
104
- items: (AccountMenuItem | 'separator')[];
105
- nameFrom?: 'sm' | 'lg';
106
- }): react.JSX.Element;
107
- declare function ThemeToggle({ className }: {
108
- className?: string;
109
- }): react.JSX.Element;
98
+ declare function DocsShell({ nav, current, header, search, actions, breadcrumbs, toc, pager, footer, children, }: DocsShellProps): react.JSX.Element;
110
99
 
111
100
  interface ShellPlace {
112
101
  section?: string;
@@ -115,4 +104,4 @@ interface ShellPlace {
115
104
  declare const ShellContext: react.Context<ShellPlace>;
116
105
  declare function useShellPlace(): ShellPlace;
117
106
 
118
- export { AccountMenu, type AccountMenuItem, AppShell, FamilyMenu, FooterColumn, NavItem, ShellContext, type ShellNavGroup, type ShellNavItem, type ShellPlace, type ShellSection, SignInFrame, SiteBanner, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderProps, SkipLink, ThemeToggle, useShellPlace };
107
+ export { DOCS_HEADER_NAV, DocsNav, type DocsNavItem, type DocsNavSection, DocsShell, type DocsShellProps, FamilyMenu, FooterColumn, NavItem, ShellContext, type ShellPlace, SignInFrame, SiteBanner, SiteFooter, type SiteFooterProps, SiteHeader, type SiteHeaderProps, SkipLink, useShellPlace };