@jfrader/storybook-docs 0.0.0-stage → 0.4.4
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/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/app.d.ts +1 -0
- package/dist/base.d.ts +3 -0
- package/dist/build/catalog.d.ts +20 -0
- package/dist/build/code.d.ts +2 -0
- package/dist/build/global-styles.d.ts +1 -0
- package/dist/build/guidance.d.ts +4 -0
- package/dist/build/module-ids.d.ts +2 -0
- package/dist/build/props.d.ts +10 -0
- package/dist/build/releases.d.ts +7 -0
- package/dist/build/site.d.ts +2 -0
- package/dist/build/storybook-test.d.ts +2 -0
- package/dist/build/tokens.d.ts +2 -0
- package/dist/code.d.ts +16 -0
- package/dist/component-demo.d.ts +23 -0
- package/dist/config.d.ts +98 -0
- package/dist/controls.d.ts +49 -0
- package/dist/css.d.ts +1 -0
- package/dist/guidance-model.d.ts +74 -0
- package/dist/guidance.d.ts +9 -0
- package/dist/index.css +420 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1971 -0
- package/dist/pages/component-page.d.ts +4 -0
- package/dist/pages/foundations-color.d.ts +3 -0
- package/dist/pages/foundations-effects.d.ts +3 -0
- package/dist/pages/foundations-spacing.d.ts +3 -0
- package/dist/pages/foundations-type.d.ts +3 -0
- package/dist/pages/overview.d.ts +3 -0
- package/dist/pages/releases.d.ts +3 -0
- package/dist/prop-docs.d.ts +20 -0
- package/dist/props.d.ts +4 -0
- package/dist/scan.d.ts +19 -0
- package/dist/search-match.d.ts +21 -0
- package/dist/search.d.ts +5 -0
- package/dist/sections.d.ts +52 -0
- package/dist/skeleton.d.ts +11 -0
- package/dist/start.d.ts +4 -0
- package/dist/story-view.d.ts +20 -0
- package/dist/styles.css +685 -0
- package/dist/toc.d.ts +19 -0
- package/dist/virtual.d.ts +42 -0
- package/dist/vite-plugin.d.ts +10 -0
- package/dist/vite-plugin.js +697 -0
- package/docs/CONFIG.md +287 -0
- package/docs/RELEASING.md +153 -0
- package/package.json +75 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PropDoc {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
typeUnavailable?: boolean;
|
|
5
|
+
required: boolean;
|
|
6
|
+
defaultValue: string | null;
|
|
7
|
+
description: string;
|
|
8
|
+
inheritedFrom?: string;
|
|
9
|
+
tags?: {
|
|
10
|
+
name: string;
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
members?: PropDoc[];
|
|
14
|
+
}
|
|
15
|
+
export interface ComponentPropsDoc {
|
|
16
|
+
name: string;
|
|
17
|
+
props: PropDoc[];
|
|
18
|
+
/** Native element whose full prop set also applies (e.g. `button` for Dialog.Trigger). */
|
|
19
|
+
native?: string;
|
|
20
|
+
}
|
package/dist/props.d.ts
ADDED
package/dist/scan.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Minimal glob: `*` matches within a path segment, `**` matches any depth. */
|
|
2
|
+
export declare function matchGlob(pattern: string, candidate: string): boolean;
|
|
3
|
+
/** Every file under `rootDir` whose path relative to it matches the glob. */
|
|
4
|
+
export declare function collectMatches(rootDir: string, pattern: string): string[];
|
|
5
|
+
/** The meta title lives in the module's `meta` object — fixtures elsewhere in the file also
|
|
6
|
+
contain `title:` keys, so the scan is scoped to the meta declaration first. */
|
|
7
|
+
export declare function extractTitle(source: string): string | null;
|
|
8
|
+
export interface StoryFileFacts {
|
|
9
|
+
title: string;
|
|
10
|
+
stories: string[];
|
|
11
|
+
hasComponent: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function readStoryFile(file: string): StoryFileFacts | null;
|
|
14
|
+
export declare const toKebab: (value: string) => string;
|
|
15
|
+
export declare function storyIdentity(file: string, title: string): {
|
|
16
|
+
group: string;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CatalogEntry } from './config';
|
|
2
|
+
export declare const MAX_COMPONENTS = 10;
|
|
3
|
+
export declare const MAX_STORIES_PER_COMPONENT = 2;
|
|
4
|
+
export interface SearchRow {
|
|
5
|
+
entry: CatalogEntry;
|
|
6
|
+
story?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TextSegment {
|
|
9
|
+
text: string;
|
|
10
|
+
match: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Splits `text` around the first case-insensitive occurrence of `needle`; never produces HTML. */
|
|
13
|
+
export declare function highlightSegments(text: string, needle: string): TextSegment[];
|
|
14
|
+
/**
|
|
15
|
+
* Ranked option rows: a component row when the component itself matches, followed by up to
|
|
16
|
+
* `MAX_STORIES_PER_COMPONENT` rows for its stories whose names match.
|
|
17
|
+
*/
|
|
18
|
+
export declare function searchCatalog(catalog: CatalogEntry[], query: string): SearchRow[];
|
|
19
|
+
export declare const rowKey: (row: SearchRow) => string;
|
|
20
|
+
export declare const rowLabel: (row: SearchRow) => string;
|
|
21
|
+
export declare const rowPath: (row: SearchRow) => string;
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Storybook's docs parameters, as this design system authors them: a component description, a
|
|
2
|
+
* per-story description, authoring prose and an optional code sample that overrides the snippet
|
|
3
|
+
* the engine would generate. */
|
|
4
|
+
export type DocsParameters = {
|
|
5
|
+
description?: {
|
|
6
|
+
component?: string;
|
|
7
|
+
story?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Plain text or `- ` bulleted lines about behaviour and composition. */
|
|
10
|
+
usage?: string;
|
|
11
|
+
source?: {
|
|
12
|
+
code?: string;
|
|
13
|
+
language?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function mergeAnnotations(...values: Array<Record<string, unknown> | undefined>): Record<string, unknown>;
|
|
17
|
+
export interface StorySection {
|
|
18
|
+
title: string;
|
|
19
|
+
stories: string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function sectionStories(stories: string[]): StorySection[];
|
|
22
|
+
export interface ExampleStory {
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
args?: Record<string, unknown>;
|
|
26
|
+
play?: unknown;
|
|
27
|
+
}
|
|
28
|
+
/** Prefer a complete composition (a highlighted block or placeholder card) over a bare
|
|
29
|
+
* Default. Otherwise lead with Default/Primary, then authored or named showcases.
|
|
30
|
+
* Overlay anatomy (an invoker plus a floating/list part), or an Open/PersistentOpen sibling
|
|
31
|
+
* plus boolean open args and an onOpenChange callback, identifies surfaces without component-name
|
|
32
|
+
* lists. The latter conservatively excludes plays referencing userEvent/fireEvent: open permission
|
|
33
|
+
* can still require focus, typing or caret setup. It leaves already-open introductions and unrelated
|
|
34
|
+
* expanded/viewer states alone. Prefer an Open/Persistent showcase, then a safe
|
|
35
|
+
* composition with authored open args. Suffixed names require open args; plain Open/Persistent
|
|
36
|
+
* names can stand alone. Only those names may bypass the `open` state filter;
|
|
37
|
+
* controlled, disabled, theme and other debug fixtures remain excluded. Callers exclude !autodocs.
|
|
38
|
+
* Provider/Viewport anatomy and a Persistent name alone do not imply populated notifications:
|
|
39
|
+
* a queue may still need a click. Without an eligible open sibling, retain the normal choice.
|
|
40
|
+
* Null defaults defer single-widget inference until their initial visibility is known.
|
|
41
|
+
* Ties keep source order. */
|
|
42
|
+
export declare function selectExample(stories: ExampleStory[], parts?: string[], defaults?: Record<string, unknown> | null): string | null;
|
|
43
|
+
/** Only story-authored values: never synthesize children or component defaults. */
|
|
44
|
+
export declare function usageSnippet(componentName: string, args: Record<string, unknown> | undefined): string | null;
|
|
45
|
+
export declare function buildUsageSnippet({ componentName, from, args, source, jsxName, component }: {
|
|
46
|
+
componentName: string;
|
|
47
|
+
from: string;
|
|
48
|
+
args?: Record<string, unknown>;
|
|
49
|
+
source?: string;
|
|
50
|
+
jsxName?: string;
|
|
51
|
+
component?: unknown;
|
|
52
|
+
}): string | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Loading placeholders. One primitive, reused wherever something async is coming:
|
|
5
|
+
* example frames, the guidance block, the props table and the component header.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Skeleton({ width, height, lines, }: {
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number;
|
|
10
|
+
lines?: number;
|
|
11
|
+
}): ReactNode;
|
package/dist/start.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { CatalogEntry } from './config';
|
|
4
|
+
/** Renders a story from its own module: meta decorators, the meta component with merged args, the
|
|
5
|
+
* story's own decorators, or the story's render — the same composition order Storybook uses. */
|
|
6
|
+
export declare function StoryView({ module, story, overrides, }: {
|
|
7
|
+
module: Record<string, unknown>;
|
|
8
|
+
story: string;
|
|
9
|
+
overrides?: Record<string, unknown>;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/** Lazily imports the same module Storybook loads; resolves once per entry. */
|
|
12
|
+
export declare function useStoryModule(entry: CatalogEntry): {
|
|
13
|
+
module: Record<string, unknown> | null;
|
|
14
|
+
error: string | null;
|
|
15
|
+
};
|
|
16
|
+
/** Mounts children only once they have been scrolled near, so pages with many stories stay cheap. */
|
|
17
|
+
export declare function LazySection({ children, placeholder }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
}): import("react").JSX.Element;
|