@arbidocs/blocks 0.4.0 → 0.4.2

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 (74) hide show
  1. package/README.md +22 -0
  2. package/dist/{chunk-7G3JNSJB.cjs → chunk-2K33YGM6.cjs} +51 -14
  3. package/dist/chunk-2K33YGM6.cjs.map +1 -0
  4. package/dist/{chunk-S5T7ZTX2.js → chunk-2ORA62OF.js} +3 -3
  5. package/dist/{chunk-S5T7ZTX2.js.map → chunk-2ORA62OF.js.map} +1 -1
  6. package/dist/{chunk-RBXZYNVB.js → chunk-6P6AEQJB.js} +195 -35
  7. package/dist/chunk-6P6AEQJB.js.map +1 -0
  8. package/dist/{chunk-5TYEJOXY.js → chunk-7PEELPMA.js} +52 -15
  9. package/dist/chunk-7PEELPMA.js.map +1 -0
  10. package/dist/{chunk-KUA3BCT2.cjs → chunk-AE5FHFZ5.cjs} +6 -6
  11. package/dist/{chunk-KUA3BCT2.cjs.map → chunk-AE5FHFZ5.cjs.map} +1 -1
  12. package/dist/{chunk-FZQJ2S6P.cjs → chunk-DREI7EQ2.cjs} +197 -33
  13. package/dist/chunk-DREI7EQ2.cjs.map +1 -0
  14. package/dist/chunk-J2BGSWXM.cjs +990 -0
  15. package/dist/chunk-J2BGSWXM.cjs.map +1 -0
  16. package/dist/{chunk-6ALISABK.cjs → chunk-LRUCMZK6.cjs} +7 -4
  17. package/dist/{chunk-6ALISABK.cjs.map → chunk-LRUCMZK6.cjs.map} +1 -1
  18. package/dist/chunk-OBLSURHV.js +973 -0
  19. package/dist/chunk-OBLSURHV.js.map +1 -0
  20. package/dist/{chunk-DVLEQURC.js → chunk-QXEJXIP4.js} +7 -4
  21. package/dist/{chunk-DVLEQURC.js.map → chunk-QXEJXIP4.js.map} +1 -1
  22. package/dist/collaboration/index.cjs +1 -1
  23. package/dist/collaboration/index.js +1 -1
  24. package/dist/components/Chart.d.ts +9 -1
  25. package/dist/components/ContactForm.d.ts +15 -3
  26. package/dist/components/TeamGrid.d.ts +14 -2
  27. package/dist/components/editorial/ArticleList.d.ts +32 -0
  28. package/dist/components/editorial/Bands.d.ts +29 -0
  29. package/dist/components/editorial/EditorialHeading.d.ts +17 -0
  30. package/dist/components/editorial/EditorialHero.d.ts +46 -0
  31. package/dist/components/editorial/EditorialSection.d.ts +47 -0
  32. package/dist/components/editorial/Eyebrow.d.ts +14 -0
  33. package/dist/components/editorial/PanelGrid.d.ts +45 -0
  34. package/dist/components/editorial/ProfileCard.d.ts +27 -0
  35. package/dist/components/editorial/PullQuote.d.ts +17 -0
  36. package/dist/components/editorial/Reveal.d.ts +15 -0
  37. package/dist/components/editorial/index.d.ts +12 -0
  38. package/dist/components/editorial/lists.d.ts +42 -0
  39. package/dist/components/editorial/tone.d.ts +33 -0
  40. package/dist/facts/FactsViewToggle.d.ts +3 -1
  41. package/dist/facts/fact-row.d.ts +32 -0
  42. package/dist/facts/index.cjs +34 -5
  43. package/dist/facts/index.cjs.map +1 -1
  44. package/dist/facts/index.d.ts +1 -0
  45. package/dist/facts/index.js +31 -4
  46. package/dist/facts/index.js.map +1 -1
  47. package/dist/files/ViewToggle.d.ts +6 -2
  48. package/dist/files/ViewerChrome.d.ts +11 -14
  49. package/dist/files/index.cjs +20 -54
  50. package/dist/files/index.cjs.map +1 -1
  51. package/dist/files/index.js +17 -51
  52. package/dist/files/index.js.map +1 -1
  53. package/dist/index.cjs +161 -101
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +6 -6
  56. package/dist/shell/ActionCluster.d.ts +7 -2
  57. package/dist/shell/AskField.d.ts +6 -1
  58. package/dist/shell/index.cjs +42 -42
  59. package/dist/shell/index.js +1 -1
  60. package/dist/site/index.cjs +107 -47
  61. package/dist/site/index.d.ts +1 -0
  62. package/dist/site/index.js +2 -2
  63. package/dist/studio/index.cjs +71 -71
  64. package/dist/studio/index.js +3 -3
  65. package/package.json +3 -3
  66. package/src/blocks.css +17 -0
  67. package/dist/chunk-5TYEJOXY.js.map +0 -1
  68. package/dist/chunk-7G3JNSJB.cjs.map +0 -1
  69. package/dist/chunk-FZQJ2S6P.cjs.map +0 -1
  70. package/dist/chunk-MMYCZRKT.cjs +0 -168
  71. package/dist/chunk-MMYCZRKT.cjs.map +0 -1
  72. package/dist/chunk-RBXZYNVB.js.map +0 -1
  73. package/dist/chunk-UTWX2X2A.js +0 -165
  74. package/dist/chunk-UTWX2X2A.js.map +0 -1
@@ -33,10 +33,22 @@ export interface ContactFormProps {
33
33
  onSubmit?: (values: Record<string, string>) => void | Promise<void>;
34
34
  /** Message shown after a client-side (no-action) submit. */
35
35
  successMessage?: string;
36
- /** Replaces the success message block. */
37
- renderSuccess?: (values: Record<string, string>) => ReactNode;
36
+ /**
37
+ * Replaces the success message block. The second argument returns the form to its initial
38
+ * state (no remount with `key` needed), e.g. for a "send another" button.
39
+ */
40
+ renderSuccess?: (values: Record<string, string>, reset: () => void) => ReactNode;
41
+ /** With the default success message, adds a button with this label that resets the form. */
42
+ resetLabel?: string;
43
+ /** Called with every field's current value on each change (and not on the initial render). */
44
+ onValuesChange?: (values: Record<string, string>) => void;
45
+ /**
46
+ * Content between the fields and the submit button: a note that depends on a field, a consent
47
+ * line, a summary. A function receives the current values and re-renders on every change.
48
+ */
49
+ footerSlot?: ReactNode | ((values: Record<string, string>) => ReactNode);
38
50
  testId?: string;
39
51
  testIds?: Partial<ContactFormTestIds>;
40
52
  }
41
53
  /** A configurable lead/contact form. Posts to `action`, hands values to `onSubmit`, or confirms. */
42
- export declare function ContactForm({ fields, submitLabel, action, onSubmit, successMessage, renderSuccess, testId, testIds, }: ContactFormProps): import("react").JSX.Element;
54
+ export declare function ContactForm({ fields, submitLabel, action, onSubmit, successMessage, renderSuccess, resetLabel, onValuesChange, footerSlot, testId, testIds, }: ContactFormProps): import("react").JSX.Element;
@@ -1,18 +1,30 @@
1
+ import type { ReactNode } from 'react';
1
2
  import { type BlockLinkComponent } from './blockLink';
2
3
  export interface TeamMember {
3
4
  name: string;
4
5
  role?: string;
6
+ /** An accent line under the role (practice, team). */
7
+ kicker?: string;
5
8
  bio?: string;
6
9
  avatarUrl?: string;
7
10
  /** When set, the card becomes a link to this person's detail page. */
8
11
  href?: string;
12
+ /** Overrides this card's test id (default `{testId}-item-{index}`). */
13
+ testId?: string;
9
14
  }
10
15
  export interface TeamGridProps {
11
16
  members: TeamMember[];
12
17
  columns?: '2' | '3' | '4';
18
+ /**
19
+ * `centered`: the stacked, centred card. `profile`: the start-aligned editorial card
20
+ * (`ProfileCard`: clamped bio, meta pinned to the foot, arrow on linked cards).
21
+ */
22
+ variant?: 'centered' | 'profile';
23
+ /** Per-member content under the bio (practice chips, focus areas, links). */
24
+ renderMeta?: (member: TeamMember, index: number) => ReactNode;
13
25
  /** Inject a router link (adapted to `href`) so linked cards navigate in-SPA. */
14
26
  linkComponent?: BlockLinkComponent;
15
27
  testId?: string;
16
28
  }
17
- /** A grid of people cards: avatar, name, role and an optional short bio. */
18
- export declare function TeamGrid({ members, columns, linkComponent, testId }: TeamGridProps): import("react").JSX.Element;
29
+ /** A grid of people cards: avatar, name, role and an optional short bio and meta slot. */
30
+ export declare function TeamGrid({ members, columns, variant, renderMeta, linkComponent, testId, }: TeamGridProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type BlockLinkComponent } from '../blockLink';
3
+ export interface ArticleItem {
4
+ title: ReactNode;
5
+ summary?: ReactNode;
6
+ /** Category or type, shown as an accent label. */
7
+ kicker?: ReactNode;
8
+ /** Short facts joined with a middle dot: author, date, reading time. */
9
+ meta?: ReactNode[];
10
+ href?: string;
11
+ imageUrl?: string;
12
+ imageAlt?: string;
13
+ testId?: string;
14
+ }
15
+ export interface ArticleListProps {
16
+ items: ArticleItem[];
17
+ /**
18
+ * `cards`: a grid of cards. `rows`: ruled rows (kicker and meta beside the title), best for an
19
+ * archive.
20
+ */
21
+ layout?: 'cards' | 'rows';
22
+ /** `cards` only: the first item is a large card beside a column of the rest from `lg`. */
23
+ featureFirst?: boolean;
24
+ columns?: 2 | 3;
25
+ linkComponent?: BlockLinkComponent;
26
+ /** Rendered instead of the list when `items` is empty. */
27
+ empty?: ReactNode;
28
+ className?: string;
29
+ testId?: string;
30
+ }
31
+ /** Article, insight or news items as cards (optionally with a lead card) or ruled archive rows. */
32
+ export declare function ArticleList({ items, layout, featureFirst, columns, linkComponent, empty, className, testId, }: ArticleListProps): import("react").JSX.Element | null;
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type EditorialSurface } from './EditorialHero';
3
+ export interface ProofStripProps {
4
+ /** The lead statement (an icon and a sentence). */
5
+ lead?: ReactNode;
6
+ /** Short labels: standards, memberships, clients. */
7
+ items: ReactNode[];
8
+ /** Accessible name of the label list. */
9
+ label?: string;
10
+ surface?: EditorialSurface;
11
+ className?: string;
12
+ testId?: string;
13
+ }
14
+ /** A thin band of proof points: a lead statement and a row of short uppercase labels. */
15
+ export declare function ProofStrip({ lead, items, label, surface, className, testId, }: ProofStripProps): import("react").JSX.Element;
16
+ export interface CtaBandProps {
17
+ title: ReactNode;
18
+ lead?: ReactNode;
19
+ /** Buttons or links. */
20
+ actions?: ReactNode;
21
+ /** Decoration behind the copy (image, texture), hidden from assistive tech. */
22
+ backdrop?: ReactNode;
23
+ /** Default `inverse`: a dark closing band. */
24
+ surface?: EditorialSurface;
25
+ className?: string;
26
+ testId?: string;
27
+ }
28
+ /** Closing call-to-action band: centred heading, lead and actions over an optional backdrop. */
29
+ export declare function CtaBand({ title, lead, actions, backdrop, surface, className, testId, }: CtaBandProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type EditorialTone } from './tone';
3
+ export interface EditorialHeadingProps {
4
+ eyebrow?: ReactNode;
5
+ /** Section number or label shown with the eyebrow. */
6
+ index?: number | string;
7
+ title: ReactNode;
8
+ lead?: ReactNode;
9
+ /** Heading element level (default 2). */
10
+ level?: 1 | 2 | 3;
11
+ align?: 'start' | 'center';
12
+ tone?: EditorialTone;
13
+ className?: string;
14
+ testId?: string;
15
+ }
16
+ /** Section heading: numbered or labelled eyebrow, display title and lead. */
17
+ export declare function EditorialHeading({ eyebrow, index, title, lead, level, align, tone, className, testId, }: EditorialHeadingProps): import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type EditorialTone } from './tone';
3
+ export type EditorialSurface = 'plain' | 'muted' | 'inverse';
4
+ export interface EditorialHeroTestIds {
5
+ root: string;
6
+ eyebrow: string;
7
+ title: string;
8
+ lede: string;
9
+ actions: string;
10
+ aside: string;
11
+ }
12
+ export interface EditorialHeroProps {
13
+ eyebrow?: ReactNode;
14
+ /** Show the accent rule before the eyebrow. */
15
+ eyebrowRule?: boolean;
16
+ /** The headline: text or any node. */
17
+ title: ReactNode;
18
+ /** A phrase inside a string `title` set in the italic accent. */
19
+ emphasis?: string;
20
+ /** The paragraph under the headline. */
21
+ lede?: ReactNode;
22
+ /** Buttons or links under the lede. */
23
+ actions?: ReactNode;
24
+ /** Anything under the actions (badges, a trust line). */
25
+ footer?: ReactNode;
26
+ /** The figure beside (below on phones) the copy: an image frame, a card, a media slot. */
27
+ aside?: ReactNode;
28
+ /** Decoration behind the copy (texture, wash, background image). Hidden from assistive tech. */
29
+ backdrop?: ReactNode;
30
+ /** `start` copy, or `center` (no aside). */
31
+ align?: 'start' | 'center';
32
+ /** `page`: a page-opening header band. `cover`: the larger home-page hero. */
33
+ size?: 'page' | 'cover';
34
+ surface?: EditorialSurface;
35
+ className?: string;
36
+ testId?: string;
37
+ testIds?: Partial<EditorialHeroTestIds>;
38
+ }
39
+ export declare const SURFACE_CLASS: Record<EditorialSurface, string>;
40
+ export declare const SURFACE_TONE: Record<EditorialSurface, EditorialTone>;
41
+ /**
42
+ * Editorial opening band: eyebrow, display headline with an italic accent phrase, lede, actions
43
+ * and an optional aside (image, card). Covers a page header (no aside, `size="page"`), a split
44
+ * hero (aside) and a centred landing hero (`align="center"`, `size="cover"`).
45
+ */
46
+ export declare function EditorialHero({ eyebrow, eyebrowRule, title, emphasis, lede, actions, footer, aside, backdrop, align, size, surface, className, testId, testIds, }: EditorialHeroProps): import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type EditorialSurface } from './EditorialHero';
3
+ export interface EditorialSectionProps {
4
+ id?: string;
5
+ eyebrow?: ReactNode;
6
+ /** Section number or label: `1` renders `01`. */
7
+ index?: number | string;
8
+ title?: ReactNode;
9
+ lead?: ReactNode;
10
+ /** Sits beside the heading from `sm` up (a "see all" link or button). */
11
+ action?: ReactNode;
12
+ /**
13
+ * `stacked`: heading above the content. `split`: heading column beside the content from `lg`.
14
+ * `split-wide`: the same with a wider content column.
15
+ */
16
+ layout?: 'stacked' | 'split' | 'split-wide';
17
+ /** `plain`, `muted` (tinted band) or `inverse` (dark band on a light theme). */
18
+ surface?: EditorialSurface;
19
+ /** Hairline above and below the band. */
20
+ bordered?: boolean;
21
+ /** Vertical rhythm. */
22
+ spacing?: 'md' | 'lg';
23
+ /** Backdrop behind the content (texture, image), hidden from assistive tech. */
24
+ backdrop?: ReactNode;
25
+ /** Accessible name when there is no `title`. */
26
+ 'aria-label'?: string;
27
+ children?: ReactNode;
28
+ className?: string;
29
+ testId?: string;
30
+ }
31
+ /**
32
+ * A page band: numbered or labelled heading, optional action, and content stacked below or in a
33
+ * second column. Sets the tone for the parts inside it, so the same list or panel grid reads on
34
+ * a plain, tinted or inverse band.
35
+ */
36
+ export declare function EditorialSection({ id, eyebrow, index, title, lead, action, layout, surface, bordered, spacing, backdrop, 'aria-label': ariaLabel, children, className, testId, }: EditorialSectionProps): import("react").JSX.Element;
37
+ export interface EditorialProseProps {
38
+ /** One entry per paragraph. */
39
+ paragraphs: ReactNode[];
40
+ /** Two columns from `md` up (paragraphs never split across columns). */
41
+ columns?: 1 | 2;
42
+ size?: 'base' | 'lg';
43
+ className?: string;
44
+ testId?: string;
45
+ }
46
+ /** Long-form paragraphs set at a readable measure, in one or two columns. */
47
+ export declare function EditorialProse({ paragraphs, columns, size, className, testId, }: EditorialProseProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type EditorialTone } from './tone';
3
+ export interface EyebrowProps {
4
+ children: ReactNode;
5
+ /** A number or label before the text: `1` renders `01`. */
6
+ index?: number | string;
7
+ /** A short accent rule before the text. */
8
+ rule?: boolean;
9
+ tone?: EditorialTone;
10
+ className?: string;
11
+ testId?: string;
12
+ }
13
+ /** Small uppercase label above a heading: optional index and accent rule. */
14
+ export declare function Eyebrow({ children, index, rule, tone, className, testId }: EyebrowProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type BlockLinkComponent } from '../blockLink';
3
+ import { type EditorialTone } from './tone';
4
+ export interface PanelItem {
5
+ title: ReactNode;
6
+ body?: ReactNode;
7
+ /** Icon in a bordered tile. */
8
+ icon?: ReactNode;
9
+ /** Explicit number or label; with `numbered` on the grid it defaults to the position. */
10
+ index?: number | string;
11
+ /** A small label above the title (category). */
12
+ kicker?: ReactNode;
13
+ /** Bulleted points under the body. */
14
+ points?: ReactNode[];
15
+ /** Chips at the foot. */
16
+ tags?: string[];
17
+ /** Anything at the foot (a meta line, a link). */
18
+ footer?: ReactNode;
19
+ /** Makes the whole panel a link. */
20
+ href?: string;
21
+ testId?: string;
22
+ }
23
+ export interface PanelGridProps {
24
+ items: PanelItem[];
25
+ columns?: 2 | 3 | 4;
26
+ /** `cards`: separate bordered panels. `joined`: one hairline-ruled table of cells. */
27
+ variant?: 'cards' | 'joined';
28
+ /** Number the panels 01, 02, ... */
29
+ numbered?: boolean;
30
+ /** Fade each panel in on scroll, staggered. */
31
+ reveal?: boolean;
32
+ /** Router link for panels with an `href`. */
33
+ linkComponent?: BlockLinkComponent;
34
+ /** Heading level of the panel titles (default 3). */
35
+ headingLevel?: 2 | 3 | 4;
36
+ tone?: EditorialTone;
37
+ className?: string;
38
+ testId?: string;
39
+ }
40
+ /**
41
+ * Icon, title and body panels: principles, process steps, capability cards, security pillars,
42
+ * practice areas. Cards or a joined hairline table, optional numbers, bullet points, chips and
43
+ * a link per panel.
44
+ */
45
+ export declare function PanelGrid({ items, columns, variant, numbered, reveal, linkComponent, headingLevel, tone, className, testId, }: PanelGridProps): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type BlockLinkComponent } from '../blockLink';
3
+ export interface ProfileCardProps {
4
+ name: string;
5
+ role?: string;
6
+ /** An accent line under the role (practice, team). */
7
+ kicker?: string;
8
+ bio?: string;
9
+ avatarUrl?: string;
10
+ /** Replaces the avatar (a photo frame, a monogram). */
11
+ avatar?: ReactNode;
12
+ /** Extra classes of the avatar fallback, e.g. a host tint. */
13
+ avatarClassName?: string;
14
+ /** Chips, links or stats under the bio, pinned to the card foot. */
15
+ meta?: ReactNode;
16
+ /** Makes the whole card a link to the profile. */
17
+ href?: string;
18
+ linkComponent?: BlockLinkComponent;
19
+ /** Lines of bio shown before truncation (0 shows it all). */
20
+ bioLines?: 0 | 2 | 3 | 4;
21
+ /** Heading level of the name (default 3). */
22
+ headingLevel?: 2 | 3 | 4;
23
+ className?: string;
24
+ testId?: string;
25
+ }
26
+ /** A person's card: avatar, name, role, kicker, clamped bio and a meta slot. */
27
+ export declare function ProfileCard({ name, role, kicker, bio, avatarUrl, avatar, avatarClassName, meta, href, linkComponent, bioLines, headingLevel, className, testId, }: ProfileCardProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PullQuoteProps {
3
+ quote: ReactNode;
4
+ /** Who said it. */
5
+ attribution?: {
6
+ name: ReactNode;
7
+ role?: ReactNode;
8
+ };
9
+ /** Link to the source. */
10
+ cite?: string;
11
+ align?: 'start' | 'center';
12
+ size?: 'md' | 'lg';
13
+ className?: string;
14
+ testId?: string;
15
+ }
16
+ /** A large display quotation with an accent rule and attribution. */
17
+ export declare function PullQuote({ quote, attribution, cite, align, size, className, testId, }: PullQuoteProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface RevealProps {
3
+ children: ReactNode;
4
+ /** Delay in ms before the reveal starts (stagger siblings with `index * 90`). */
5
+ delay?: number;
6
+ className?: string;
7
+ testId?: string;
8
+ }
9
+ /**
10
+ * Fade-and-rise on first scroll into view. Content is fully visible until the part has mounted
11
+ * and found an `IntersectionObserver`, so server rendering, no-JS and jsdom show everything; the
12
+ * hidden state and transition live in `blocks.css` (`[data-reveal]`) and collapse under
13
+ * `prefers-reduced-motion`.
14
+ */
15
+ export declare function Reveal({ children, delay, className, testId }: RevealProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export { Eyebrow, type EyebrowProps } from './Eyebrow';
2
+ export { EditorialHeading, type EditorialHeadingProps } from './EditorialHeading';
3
+ export { EditorialHero, type EditorialHeroProps, type EditorialHeroTestIds, type EditorialSurface, } from './EditorialHero';
4
+ export { EditorialSection, EditorialProse, type EditorialSectionProps, type EditorialProseProps, } from './EditorialSection';
5
+ export { PanelGrid, type PanelGridProps, type PanelItem } from './PanelGrid';
6
+ export { DefinitionList, CheckList, TagList, type DefinitionListProps, type DefinitionItem, type CheckListProps, type TagListProps, } from './lists';
7
+ export { PullQuote, type PullQuoteProps } from './PullQuote';
8
+ export { ArticleList, type ArticleListProps, type ArticleItem } from './ArticleList';
9
+ export { ProfileCard, type ProfileCardProps } from './ProfileCard';
10
+ export { ProofStrip, CtaBand, type ProofStripProps, type CtaBandProps } from './Bands';
11
+ export { Reveal, type RevealProps } from './Reveal';
12
+ export { type EditorialTone } from './tone';
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface DefinitionItem {
3
+ term: ReactNode;
4
+ description: ReactNode;
5
+ /** A leading icon; without one the `dot` marker is used when `marker="dot"`. */
6
+ icon?: ReactNode;
7
+ testId?: string;
8
+ }
9
+ export interface DefinitionListProps {
10
+ items: DefinitionItem[];
11
+ /**
12
+ * `rows`: each entry is a lifted row with a marker. `ruled`: a spec sheet, term and description
13
+ * side by side between hairlines.
14
+ */
15
+ layout?: 'rows' | 'ruled';
16
+ /** Marker of an entry with no `icon` in the `rows` layout. */
17
+ marker?: 'dot' | 'none';
18
+ className?: string;
19
+ testId?: string;
20
+ }
21
+ /** Term and description pairs (`<dl>`): feature rows, a spec sheet, a definition list. */
22
+ export declare function DefinitionList({ items, layout, marker, className, testId, }: DefinitionListProps): import("react").JSX.Element;
23
+ export interface CheckListProps {
24
+ items: ReactNode[];
25
+ /** Two columns from `sm` up. */
26
+ columns?: 1 | 2;
27
+ /** Replaces the check mark. */
28
+ icon?: ReactNode;
29
+ className?: string;
30
+ testId?: string;
31
+ }
32
+ /** A list of points, each with a ringed check mark. */
33
+ export declare function CheckList({ items, columns, icon, className, testId }: CheckListProps): import("react").JSX.Element;
34
+ export interface TagListProps {
35
+ items: string[];
36
+ /** Accessible name of the list. */
37
+ label?: string;
38
+ className?: string;
39
+ testId?: string;
40
+ }
41
+ /** Small bordered chips: sectors, focus areas, topics. */
42
+ export declare function TagList({ items, label, className, testId }: TagListProps): import("react").JSX.Element | null;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Editorial parts read their colours from the theme tokens only. `inverse` flips the page
3
+ * tokens (`bg-foreground text-background`) for dark bands on a light theme; on a theme that is
4
+ * already dark, leave `default` and let the host tokens do the work.
5
+ */
6
+ export type EditorialTone = 'default' | 'inverse';
7
+ export interface EditorialToneClasses {
8
+ /** Body text colour of the band. */
9
+ text: string;
10
+ /** Secondary copy (lede, descriptions). */
11
+ muted: string;
12
+ /** Tertiary copy (meta lines, small print). */
13
+ subtle: string;
14
+ /** Accent text (links, kickers, markers). */
15
+ accent: string;
16
+ /** Hairline between rows and around bands. */
17
+ hairline: string;
18
+ /** A lifted surface (panel, row, chip). */
19
+ panel: string;
20
+ /** Hover state of an interactive panel. */
21
+ panelHover: string;
22
+ /** Small bordered chip. */
23
+ chip: string;
24
+ /** Icon tile. */
25
+ tile: string;
26
+ }
27
+ export declare const EditorialToneContext: import("react").Context<EditorialTone>;
28
+ /** The tone of the enclosing band, unless a part overrides it. */
29
+ export declare function useEditorialTone(override?: EditorialTone): EditorialToneClasses & {
30
+ tone: EditorialTone;
31
+ };
32
+ /** `01`, `02`, ... for a numbered label; strings pass through. */
33
+ export declare function formatIndex(index: number | string): string;
@@ -32,5 +32,7 @@ export interface FactsViewToggleProps {
32
32
  labels?: Partial<FactsViewToggleLabels>;
33
33
  /** Item test ids are `${testIdPrefix}-${mode}-button` (default `facts-layout`). */
34
34
  testIdPrefix?: string;
35
+ /** Per-mode item ids that replace the prefixed ones. */
36
+ testIds?: Partial<Record<FactsViewMode, string>>;
35
37
  }
36
- export declare function FactsViewToggle({ viewMode, onChange, collapsed, labels, testIdPrefix, }: FactsViewToggleProps): import("react").JSX.Element;
38
+ export declare function FactsViewToggle({ viewMode, onChange, collapsed, labels, testIdPrefix, testIds, }: FactsViewToggleProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import type { FactRowView } from './factColumns';
2
+ /**
3
+ * A fact as a host with plain records usually holds it: camelCase, optional flags, tags as
4
+ * strings. `toFactRow` maps it to the `FactRowView` that `FactsTable` and `createFactColumns`
5
+ * read, so a host without the SDK type needs no adapter of its own.
6
+ */
7
+ export interface PlainFactRecord {
8
+ id: string;
9
+ text: string;
10
+ pinned?: boolean;
11
+ confirmed?: boolean;
12
+ shared?: boolean;
13
+ /** ISO date (or date-time) the fact starts. */
14
+ dateStart?: string | null;
15
+ dateEnd?: string | null;
16
+ timezone?: string | null;
17
+ tags?: Array<string | {
18
+ name: string;
19
+ }> | null;
20
+ /** Passages that support the fact; only their count is shown. */
21
+ citations?: unknown[] | null;
22
+ createdBy?: string | null;
23
+ createdAt?: string | null;
24
+ updatedAt?: string | null;
25
+ }
26
+ /** The row plus the record it came from, so callbacks can hand the host its own object back. */
27
+ export type PlainFactRow<T extends PlainFactRecord> = FactRowView & {
28
+ record: T;
29
+ };
30
+ /** Map one plain record to a grid row. Missing flags are `false`, missing lists are empty. */
31
+ export declare function toFactRow<T extends PlainFactRecord>(record: T): PlainFactRow<T>;
32
+ export declare function toFactRows<T extends PlainFactRecord>(records: T[]): PlainFactRow<T>[];
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk6ALISABK_cjs = require('../chunk-6ALISABK.cjs');
4
+ var chunkLRUCMZK6_cjs = require('../chunk-LRUCMZK6.cjs');
5
5
  var chunkOUW6G4O2_cjs = require('../chunk-OUW6G4O2.cjs');
6
6
  var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
7
7
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
@@ -502,7 +502,7 @@ function FactsTable({
502
502
  ]
503
503
  );
504
504
  return /* @__PURE__ */ jsxRuntime.jsx(
505
- chunk6ALISABK_cjs.GridView,
505
+ chunkLRUCMZK6_cjs.GridView,
506
506
  {
507
507
  testId,
508
508
  items: facts,
@@ -519,6 +519,29 @@ function FactsTable({
519
519
  }
520
520
  );
521
521
  }
522
+
523
+ // src/facts/fact-row.ts
524
+ function toFactRow(record) {
525
+ return {
526
+ external_id: record.id,
527
+ text: record.text,
528
+ pinned: record.pinned ?? false,
529
+ confirmed: record.confirmed ?? false,
530
+ shared: record.shared ?? false,
531
+ date_start: record.dateStart ?? null,
532
+ date_end: record.dateEnd ?? null,
533
+ timezone: record.timezone ?? null,
534
+ tags: (record.tags ?? []).map((t) => typeof t === "string" ? { name: t } : t),
535
+ citations: record.citations ?? [],
536
+ created_by_ext_id: record.createdBy ?? null,
537
+ created_at: record.createdAt ?? null,
538
+ updated_at: record.updatedAt ?? null,
539
+ record
540
+ };
541
+ }
542
+ function toFactRows(records) {
543
+ return records.map(toFactRow);
544
+ }
522
545
  var DEFAULT_FACT_LABELS_CELL_LABELS = {
523
546
  edit: "Edit labels",
524
547
  searchPlaceholder: "Search or create...",
@@ -1270,11 +1293,15 @@ function FactsViewToggle({
1270
1293
  onChange,
1271
1294
  collapsed = false,
1272
1295
  labels,
1273
- testIdPrefix
1296
+ testIdPrefix,
1297
+ testIds
1274
1298
  }) {
1275
- const options = createOptions({ ...DEFAULT_FACTS_VIEW_TOGGLE_LABELS, ...labels });
1299
+ const options = createOptions({ ...DEFAULT_FACTS_VIEW_TOGGLE_LABELS, ...labels }).map((o) => ({
1300
+ ...o,
1301
+ testId: testIds?.[o.value]
1302
+ }));
1276
1303
  return /* @__PURE__ */ jsxRuntime.jsx(
1277
- chunk6ALISABK_cjs.ViewToggle,
1304
+ chunkLRUCMZK6_cjs.ViewToggle,
1278
1305
  {
1279
1306
  options,
1280
1307
  value: viewMode,
@@ -2367,6 +2394,8 @@ exports.factDateSpanToFields = factDateSpanToFields;
2367
2394
  exports.renderPreviewInline = renderPreviewInline;
2368
2395
  exports.sourceDocCount = sourceDocCount;
2369
2396
  exports.supportedTimezones = supportedTimezones;
2397
+ exports.toFactRow = toFactRow;
2398
+ exports.toFactRows = toFactRows;
2370
2399
  exports.toPreviewLine = toPreviewLine;
2371
2400
  //# sourceMappingURL=index.cjs.map
2372
2401
  //# sourceMappingURL=index.cjs.map