react-lib-tools 0.0.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.
- package/LICENSE.md +21 -0
- package/dist/react-lib-tools.cjs +8 -0
- package/dist/react-lib-tools.cjs.map +1 -0
- package/dist/react-lib-tools.css +1 -0
- package/dist/react-lib-tools.d.ts +177 -0
- package/dist/react-lib-tools.js +9373 -0
- package/dist/react-lib-tools.js.map +1 -0
- package/package.json +110 -0
- package/scripts/compile-docs.ts +22 -0
- package/scripts/compile-examples.ts +71 -0
- package/scripts/utils/docs/compileComponent.ts +116 -0
- package/scripts/utils/docs/compileComponents.ts +74 -0
- package/scripts/utils/docs/compileImperativeHandle.ts +48 -0
- package/scripts/utils/docs/compileImperativeHandles.ts +45 -0
- package/scripts/utils/docs/formatDescriptionText.ts +11 -0
- package/scripts/utils/docs/getPropTypeText.ts +28 -0
- package/scripts/utils/docs/insertPropsMarkdown.ts +29 -0
- package/scripts/utils/docs/parseDescription.ts +59 -0
- package/scripts/utils/docs/propsToTable.ts +48 -0
- package/scripts/utils/examples/trimExcludedText.ts +13 -0
- package/scripts/utils/getFilesWithExtensions.ts +31 -0
- package/scripts/utils/initialize.ts +34 -0
- package/scripts/utils/rmFilesWithExtensions.ts +13 -0
- package/scripts/utils/syntax-highlight.ts +255 -0
- package/styles.css +127 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tok-comment{color:var(--color-slate-500)}.tok-keyword{color:var(--color-pink-400)}.tok-operator{color:var(--color-slate-400)}.tok-propertyName{color:var(--color-sky-300)}.tok-punctuation{color:var(--color-slate-400)}.tok-string{color:var(--color-teal-300)}.tok-string2{color:var(--color-sky-300)}.tok-typeName{color:var(--color-pink-400)}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
5
|
+
import { HTMLAttributes } from 'react';
|
|
6
|
+
import { InputHTMLAttributes } from 'react';
|
|
7
|
+
import { JSX } from 'react/jsx-runtime';
|
|
8
|
+
import { LazyExoticComponent } from 'react';
|
|
9
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
10
|
+
import { PropsWithChildren } from 'react';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
|
|
13
|
+
export declare function AppRoot({ hideVersions, navLinks, packageDescription, packageName, routes }: {
|
|
14
|
+
hideVersions?: boolean | undefined;
|
|
15
|
+
navLinks: ReactNode;
|
|
16
|
+
packageDescription: ReactNode;
|
|
17
|
+
packageName: string;
|
|
18
|
+
routes: Record<string, LazyExoticComponent<ComponentType<unknown>>>;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare function assert(expectedCondition: unknown, message?: string): asserts expectedCondition;
|
|
22
|
+
|
|
23
|
+
export declare function Block({ children, className, ...rest }: PropsWithChildren<HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
className?: string;
|
|
25
|
+
}>): JSX.Element;
|
|
26
|
+
|
|
27
|
+
export declare function Box({ align, children, className, direction, gap, grow, justify, shrink, style, wrap, ...rest }: HTMLAttributes<HTMLDivElement> & {
|
|
28
|
+
align?: "center" | "end" | "start" | "stretch" | undefined;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
direction: "column" | "row";
|
|
31
|
+
gap?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | undefined;
|
|
32
|
+
grow?: 0 | 1 | undefined;
|
|
33
|
+
justify?: "around" | "between" | "center" | "end" | "start" | "stretch" | undefined;
|
|
34
|
+
shrink?: 0 | 1 | undefined;
|
|
35
|
+
style?: CSSProperties | undefined;
|
|
36
|
+
wrap?: boolean | undefined;
|
|
37
|
+
}): JSX.Element;
|
|
38
|
+
|
|
39
|
+
export declare function Button({ children, className, disabled, intent, ...rest }: PropsWithChildren<{
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
disabled?: boolean | undefined;
|
|
42
|
+
intent?: Intent | undefined;
|
|
43
|
+
onClick?: ((event: MouseEvent_2) => void) | undefined;
|
|
44
|
+
}>): JSX.Element;
|
|
45
|
+
|
|
46
|
+
export declare function Callout({ children, className, html, inline, intent, minimal, ...rest }: PropsWithChildren<HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
html?: boolean;
|
|
49
|
+
inline?: boolean;
|
|
50
|
+
intent?: Intent;
|
|
51
|
+
minimal?: boolean;
|
|
52
|
+
}>): JSX.Element;
|
|
53
|
+
|
|
54
|
+
export declare function Checkbox({ checked, children, className, indeterminate, onChange, ...rest }: PropsWithChildren<Omit<HTMLAttributes<HTMLElement>, "defaultChecked" | "onChange"> & {
|
|
55
|
+
checked: boolean;
|
|
56
|
+
className?: string | undefined;
|
|
57
|
+
indeterminate?: boolean;
|
|
58
|
+
onChange: (value: boolean) => void;
|
|
59
|
+
}>): JSX.Element;
|
|
60
|
+
|
|
61
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
62
|
+
|
|
63
|
+
export declare function Code({ className, html }: {
|
|
64
|
+
className?: string;
|
|
65
|
+
html: string;
|
|
66
|
+
}): JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare type ComponentMetadata = {
|
|
69
|
+
description: Section[];
|
|
70
|
+
filePath: string;
|
|
71
|
+
name: string;
|
|
72
|
+
props: {
|
|
73
|
+
[name: string]: ComponentPropMetadata;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare type ComponentPropMetadata = {
|
|
78
|
+
description: Section[];
|
|
79
|
+
html: string;
|
|
80
|
+
name: string;
|
|
81
|
+
required: boolean;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export declare function ComponentProps({ json, section }: {
|
|
85
|
+
json: ComponentMetadata;
|
|
86
|
+
section: string;
|
|
87
|
+
}): JSX.Element;
|
|
88
|
+
|
|
89
|
+
export declare function DocsSection({ className, sections }: {
|
|
90
|
+
className?: string;
|
|
91
|
+
sections: Section[];
|
|
92
|
+
}): JSX.Element;
|
|
93
|
+
|
|
94
|
+
export declare function ErrorBoundary({ children }: PropsWithChildren): JSX.Element;
|
|
95
|
+
|
|
96
|
+
export declare function ExternalLink({ children, className, href, target, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
97
|
+
|
|
98
|
+
export declare function Header({ section, title }: {
|
|
99
|
+
section?: string;
|
|
100
|
+
title: string;
|
|
101
|
+
}): JSX.Element;
|
|
102
|
+
|
|
103
|
+
export declare function ImperativeHandle({ json, section }: {
|
|
104
|
+
json: ImperativeHandleMetadata;
|
|
105
|
+
section: string;
|
|
106
|
+
}): JSX.Element;
|
|
107
|
+
|
|
108
|
+
declare type ImperativeHandleMetadata = {
|
|
109
|
+
description: Section[];
|
|
110
|
+
filePath: string;
|
|
111
|
+
name: string;
|
|
112
|
+
methods: ImperativeHandleMethodMetadata[];
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
declare type ImperativeHandleMethodMetadata = {
|
|
116
|
+
description: Section[];
|
|
117
|
+
html: string;
|
|
118
|
+
name: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export declare function Input<Type extends string>({ children, className, onChange, value, ...rest }: PropsWithChildren<Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
|
|
122
|
+
className?: string | undefined;
|
|
123
|
+
onChange: (value: Type) => void;
|
|
124
|
+
value: Type;
|
|
125
|
+
}>): JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare type Intent = "danger" | "none" | "primary" | "success" | "warning";
|
|
128
|
+
|
|
129
|
+
export declare function Link({ children, onClick, to, ...rest }: Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
130
|
+
children?: ReactNode | RenderFunction;
|
|
131
|
+
to: string;
|
|
132
|
+
}): JSX.Element;
|
|
133
|
+
|
|
134
|
+
export declare function LoadingSpinner(): JSX.Element;
|
|
135
|
+
|
|
136
|
+
export declare function NavLink({ children, className, path }: PropsWithChildren<{
|
|
137
|
+
className?: string | undefined;
|
|
138
|
+
path: string;
|
|
139
|
+
}>): JSX.Element;
|
|
140
|
+
|
|
141
|
+
export declare function NavSection({ children, label }: PropsWithChildren<{
|
|
142
|
+
label: ReactNode;
|
|
143
|
+
}>): JSX.Element;
|
|
144
|
+
|
|
145
|
+
declare type Option_2<Value extends string> = {
|
|
146
|
+
label: string;
|
|
147
|
+
value: Value;
|
|
148
|
+
};
|
|
149
|
+
export { Option_2 as Option }
|
|
150
|
+
|
|
151
|
+
export declare function Radio<Value extends string>({ checked, children, className, name, onChange, value, ...rest }: PropsWithChildren<Omit<HTMLAttributes<HTMLElement>, "defaultChecked" | "onChange"> & {
|
|
152
|
+
checked: boolean;
|
|
153
|
+
name: string;
|
|
154
|
+
onChange: (value: Value) => void;
|
|
155
|
+
value: Value;
|
|
156
|
+
}>): JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare type RenderFunction = (params: {
|
|
159
|
+
isActive: boolean;
|
|
160
|
+
isPending: boolean;
|
|
161
|
+
}) => ReactNode;
|
|
162
|
+
|
|
163
|
+
declare type Section = {
|
|
164
|
+
content: string;
|
|
165
|
+
intent?: Intent | undefined;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export declare function Select<Value extends string>({ className, defaultValue, onChange, options, placeholder, value }: {
|
|
169
|
+
className?: string;
|
|
170
|
+
defaultValue?: Option_2<Value> | undefined;
|
|
171
|
+
onChange: (value: Option_2<Value>) => void;
|
|
172
|
+
options: Option_2<Value>[];
|
|
173
|
+
placeholder?: string;
|
|
174
|
+
value: Option_2<Value> | undefined;
|
|
175
|
+
}): JSX.Element;
|
|
176
|
+
|
|
177
|
+
export { }
|