sefaria-ui-components 0.1.0
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 +246 -0
- package/dist/index.cjs +8712 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +238 -0
- package/dist/index.d.ts +238 -0
- package/dist/index.js +8697 -0
- package/dist/index.js.map +1 -0
- package/package.json +75 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CSSProperties, ComponentType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Simple event system for component-to-parent communication.
|
|
6
|
+
*
|
|
7
|
+
* Components emit events with a type and optional data payload.
|
|
8
|
+
* Parents handle events via a single onEvent callback.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // In a component:
|
|
12
|
+
* type MyEvents = TextBlockEvent<'click', { x: number }> | TextBlockEvent<'hover'>;
|
|
13
|
+
* props.onEvent?.({ type: 'click', data: { x: 100 } });
|
|
14
|
+
*
|
|
15
|
+
* // In a parent:
|
|
16
|
+
* <TextBlock
|
|
17
|
+
* onEvent={(event) => {
|
|
18
|
+
* if (event.type === 'click') console.log(event.data.x);
|
|
19
|
+
* }}
|
|
20
|
+
* />
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Base event type. All component events extend this.
|
|
24
|
+
*/
|
|
25
|
+
interface ComponentEvent<TType extends string = string, TData = undefined> {
|
|
26
|
+
type: TType;
|
|
27
|
+
data: TData;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Helper to create typed events for a component.
|
|
31
|
+
* The component name prefix helps with debugging and filtering.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* type ClickEvent = ComponentEventOf<'TextBlock', 'click', { x: number }>;
|
|
35
|
+
* // Results in: { type: 'TextBlock:click', data: { x: number } }
|
|
36
|
+
*/
|
|
37
|
+
type ComponentEventOf<TComponent extends string, TType extends string, TData = undefined> = ComponentEvent<`${TComponent}:${TType}`, TData>;
|
|
38
|
+
/**
|
|
39
|
+
* Event handler type. Components accept this as their onEvent prop.
|
|
40
|
+
*/
|
|
41
|
+
type EventHandler<TEvent extends ComponentEvent<string, unknown> = ComponentEvent<string, unknown>> = (event: TEvent) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Helper to create an event object with proper typing.
|
|
44
|
+
*/
|
|
45
|
+
declare function createEvent<TType extends string, TData = undefined>(type: TType, data?: TData): ComponentEvent<TType, TData>;
|
|
46
|
+
/**
|
|
47
|
+
* Helper to emit an event through an optional handler.
|
|
48
|
+
* Safely handles undefined handlers.
|
|
49
|
+
*/
|
|
50
|
+
declare function emitEvent<TEvent extends ComponentEvent>(handler: EventHandler<TEvent> | undefined, event: TEvent): void;
|
|
51
|
+
/**
|
|
52
|
+
* Type guard to check if an event matches a specific type.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* if (isEventType(event, 'TextBlock:click')) {
|
|
56
|
+
* // event.data is typed correctly
|
|
57
|
+
* }
|
|
58
|
+
*/
|
|
59
|
+
declare function isEventType<TEvent extends ComponentEvent, TType extends TEvent["type"]>(event: TEvent, type: TType): event is Extract<TEvent, {
|
|
60
|
+
type: TType;
|
|
61
|
+
}>;
|
|
62
|
+
|
|
63
|
+
type FollowupAction = "explain" | "summarize" | "translate" | "suggest_questions" | "commentary_top" | "commentary_consensus" | "commentary_disagreements" | "commentary_unusual" | "connect_to_life" | "trace_usage";
|
|
64
|
+
declare const FOLLOWUP_MESSAGE_PREFIX = "__FOLLOWUP__";
|
|
65
|
+
declare const FOLLOWUP_TEMPLATES: Record<FollowupAction, string>;
|
|
66
|
+
declare function renderFollowupTemplate(action: FollowupAction, citation: string): string;
|
|
67
|
+
declare function buildFollowupUserMessage(params: {
|
|
68
|
+
action: FollowupAction;
|
|
69
|
+
citation: string;
|
|
70
|
+
includeRePrefix: boolean;
|
|
71
|
+
}): string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Response type from the Sefaria Text API.
|
|
75
|
+
*/
|
|
76
|
+
interface SefariaTextResponse {
|
|
77
|
+
ref?: string;
|
|
78
|
+
heRef?: string;
|
|
79
|
+
text?: unknown;
|
|
80
|
+
he?: unknown;
|
|
81
|
+
versions?: Array<{
|
|
82
|
+
text?: unknown;
|
|
83
|
+
language?: string;
|
|
84
|
+
versionTitle?: string;
|
|
85
|
+
isPrimary?: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
sections?: unknown;
|
|
88
|
+
toSections?: unknown;
|
|
89
|
+
primary_category?: unknown;
|
|
90
|
+
type?: unknown;
|
|
91
|
+
categories?: unknown;
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Events emitted by TextBlock.
|
|
96
|
+
*/
|
|
97
|
+
type TextBlockClickEvent = ComponentEventOf<'TextBlock', 'click', {
|
|
98
|
+
ref: string;
|
|
99
|
+
}>;
|
|
100
|
+
type TextBlockLinkClickEvent = ComponentEventOf<'TextBlock', 'linkClick', {
|
|
101
|
+
ref: string;
|
|
102
|
+
href: string;
|
|
103
|
+
}>;
|
|
104
|
+
type TextBlockFollowupEvent = ComponentEventOf<'TextBlock', 'followup', {
|
|
105
|
+
ref: string;
|
|
106
|
+
action: FollowupAction;
|
|
107
|
+
}>;
|
|
108
|
+
type TextBlockEvent = TextBlockClickEvent | TextBlockLinkClickEvent | TextBlockFollowupEvent;
|
|
109
|
+
interface TextBlockProps {
|
|
110
|
+
/** Sefaria citation reference (e.g., "Genesis 1:1") */
|
|
111
|
+
sefRef?: string;
|
|
112
|
+
/** Data from Sefaria Text API. If <code>sefariaData</code> is provided, renders full text. */
|
|
113
|
+
sefariaData?: SefariaTextResponse;
|
|
114
|
+
/** If true, fetches data from the Sefaria API when <code>sefariaData</code> is not provided. */
|
|
115
|
+
fetchData?: boolean;
|
|
116
|
+
/** Initial display <code>language</code>: translation, bilingual, or Hebrew. */
|
|
117
|
+
language?: string;
|
|
118
|
+
/** Preferred translation <code>versionTitle</code> from the Sefaria API. */
|
|
119
|
+
versionTitle?: string;
|
|
120
|
+
/** Show the "Follow up" button with action menu */
|
|
121
|
+
showFollowup?: boolean;
|
|
122
|
+
/** Event handler for component events */
|
|
123
|
+
onEvent?: EventHandler<TextBlockEvent>;
|
|
124
|
+
/** Additional CSS class name */
|
|
125
|
+
className?: string;
|
|
126
|
+
/** Additional inline styles */
|
|
127
|
+
style?: CSSProperties;
|
|
128
|
+
}
|
|
129
|
+
declare function TextBlockInner({ sefRef, sefariaData, fetchData, language, versionTitle, showFollowup, onEvent, className, style, }: TextBlockProps): react_jsx_runtime.JSX.Element;
|
|
130
|
+
/**
|
|
131
|
+
* TextBlock displays a Sefaria text source with a colored border indicating its category.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* // Loading state - only <code>ref</code> provided
|
|
135
|
+
* <TextBlock ref="Genesis 1:1" />
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* // Full render with data
|
|
139
|
+
* <TextBlock ref="Genesis 1:1" sefariaData={apiResponse} />
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* // With event handling
|
|
143
|
+
* <TextBlock
|
|
144
|
+
* ref="Genesis 1:1"
|
|
145
|
+
* sefariaData={data}
|
|
146
|
+
* onEvent={(event) => {
|
|
147
|
+
* if (event.type === 'TextBlock:click') {
|
|
148
|
+
* console.log('Clicked:', event.data.ref);
|
|
149
|
+
* }
|
|
150
|
+
* }}
|
|
151
|
+
* />
|
|
152
|
+
*/
|
|
153
|
+
declare const TextBlock: typeof TextBlockInner;
|
|
154
|
+
|
|
155
|
+
interface GalleryExample<P = Record<string, unknown>> {
|
|
156
|
+
title: string;
|
|
157
|
+
description?: string;
|
|
158
|
+
props: P;
|
|
159
|
+
wrapper?: ComponentType<{
|
|
160
|
+
children: ReactNode;
|
|
161
|
+
}>;
|
|
162
|
+
}
|
|
163
|
+
interface GalleryConfig<P = Record<string, unknown>> {
|
|
164
|
+
name: string;
|
|
165
|
+
description: string;
|
|
166
|
+
/** Short noun phrase for overview cards (e.g., "Sefaria text display") */
|
|
167
|
+
shortDescription?: string;
|
|
168
|
+
component: ComponentType<P>;
|
|
169
|
+
examples: GalleryExample<P>[];
|
|
170
|
+
sourceCode: string;
|
|
171
|
+
/** Ordered list of props to display on docs pages. */
|
|
172
|
+
propsList?: string[];
|
|
173
|
+
/** Props for a simple example shown on the overview page */
|
|
174
|
+
overviewExample?: P;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare const textBlockGallery: GalleryConfig<TextBlockProps>;
|
|
178
|
+
|
|
179
|
+
interface CalendarBlockProps {
|
|
180
|
+
/** Calendar title in English, as returned by the API. */
|
|
181
|
+
calendar: string;
|
|
182
|
+
/** Show a text preview when no description is available. */
|
|
183
|
+
showText?: boolean;
|
|
184
|
+
/** Additional CSS class name */
|
|
185
|
+
className?: string;
|
|
186
|
+
/** Additional inline styles */
|
|
187
|
+
style?: CSSProperties;
|
|
188
|
+
}
|
|
189
|
+
declare function CalendarBlock({ calendar, showText, className, style }: CalendarBlockProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const colors: {
|
|
192
|
+
readonly darkteal: "#004e5f";
|
|
193
|
+
readonly raspberry: "#7c406f";
|
|
194
|
+
readonly green: "#5d956f";
|
|
195
|
+
readonly paleblue: "#9ab8cb";
|
|
196
|
+
readonly blue: "#4871bf";
|
|
197
|
+
readonly orange: "#cb6158";
|
|
198
|
+
readonly lightpink: "#c7a7b4";
|
|
199
|
+
readonly darkblue: "#073570";
|
|
200
|
+
readonly darkpink: "#ab4e66";
|
|
201
|
+
readonly lavender: "#7f85a9";
|
|
202
|
+
readonly yellow: "#ccb479";
|
|
203
|
+
readonly purple: "#594176";
|
|
204
|
+
readonly lightblue: "#5a99b7";
|
|
205
|
+
readonly lightgreen: "#97b386";
|
|
206
|
+
readonly red: "#802f3e";
|
|
207
|
+
readonly teal: "#00827f";
|
|
208
|
+
readonly lightbg: "#B8D4D3";
|
|
209
|
+
readonly tan: "#D4896C";
|
|
210
|
+
};
|
|
211
|
+
declare const categoryColors: Record<string, string>;
|
|
212
|
+
declare function categoryColor(cat: unknown): string;
|
|
213
|
+
declare const palette: {
|
|
214
|
+
colors: {
|
|
215
|
+
readonly darkteal: "#004e5f";
|
|
216
|
+
readonly raspberry: "#7c406f";
|
|
217
|
+
readonly green: "#5d956f";
|
|
218
|
+
readonly paleblue: "#9ab8cb";
|
|
219
|
+
readonly blue: "#4871bf";
|
|
220
|
+
readonly orange: "#cb6158";
|
|
221
|
+
readonly lightpink: "#c7a7b4";
|
|
222
|
+
readonly darkblue: "#073570";
|
|
223
|
+
readonly darkpink: "#ab4e66";
|
|
224
|
+
readonly lavender: "#7f85a9";
|
|
225
|
+
readonly yellow: "#ccb479";
|
|
226
|
+
readonly purple: "#594176";
|
|
227
|
+
readonly lightblue: "#5a99b7";
|
|
228
|
+
readonly lightgreen: "#97b386";
|
|
229
|
+
readonly red: "#802f3e";
|
|
230
|
+
readonly teal: "#00827f";
|
|
231
|
+
readonly lightbg: "#B8D4D3";
|
|
232
|
+
readonly tan: "#D4896C";
|
|
233
|
+
};
|
|
234
|
+
categoryColors: Record<string, string>;
|
|
235
|
+
categoryColor: typeof categoryColor;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export { CalendarBlock, type CalendarBlockProps, type ComponentEvent, type ComponentEventOf, type EventHandler, FOLLOWUP_MESSAGE_PREFIX, FOLLOWUP_TEMPLATES, type FollowupAction, type GalleryConfig, type GalleryExample, type SefariaTextResponse, TextBlock, type TextBlockClickEvent, type TextBlockEvent, type TextBlockLinkClickEvent, type TextBlockProps, buildFollowupUserMessage, categoryColor, categoryColors, colors, createEvent, emitEvent, isEventType, palette, renderFollowupTemplate, textBlockGallery };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CSSProperties, ComponentType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Simple event system for component-to-parent communication.
|
|
6
|
+
*
|
|
7
|
+
* Components emit events with a type and optional data payload.
|
|
8
|
+
* Parents handle events via a single onEvent callback.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // In a component:
|
|
12
|
+
* type MyEvents = TextBlockEvent<'click', { x: number }> | TextBlockEvent<'hover'>;
|
|
13
|
+
* props.onEvent?.({ type: 'click', data: { x: 100 } });
|
|
14
|
+
*
|
|
15
|
+
* // In a parent:
|
|
16
|
+
* <TextBlock
|
|
17
|
+
* onEvent={(event) => {
|
|
18
|
+
* if (event.type === 'click') console.log(event.data.x);
|
|
19
|
+
* }}
|
|
20
|
+
* />
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Base event type. All component events extend this.
|
|
24
|
+
*/
|
|
25
|
+
interface ComponentEvent<TType extends string = string, TData = undefined> {
|
|
26
|
+
type: TType;
|
|
27
|
+
data: TData;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Helper to create typed events for a component.
|
|
31
|
+
* The component name prefix helps with debugging and filtering.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* type ClickEvent = ComponentEventOf<'TextBlock', 'click', { x: number }>;
|
|
35
|
+
* // Results in: { type: 'TextBlock:click', data: { x: number } }
|
|
36
|
+
*/
|
|
37
|
+
type ComponentEventOf<TComponent extends string, TType extends string, TData = undefined> = ComponentEvent<`${TComponent}:${TType}`, TData>;
|
|
38
|
+
/**
|
|
39
|
+
* Event handler type. Components accept this as their onEvent prop.
|
|
40
|
+
*/
|
|
41
|
+
type EventHandler<TEvent extends ComponentEvent<string, unknown> = ComponentEvent<string, unknown>> = (event: TEvent) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Helper to create an event object with proper typing.
|
|
44
|
+
*/
|
|
45
|
+
declare function createEvent<TType extends string, TData = undefined>(type: TType, data?: TData): ComponentEvent<TType, TData>;
|
|
46
|
+
/**
|
|
47
|
+
* Helper to emit an event through an optional handler.
|
|
48
|
+
* Safely handles undefined handlers.
|
|
49
|
+
*/
|
|
50
|
+
declare function emitEvent<TEvent extends ComponentEvent>(handler: EventHandler<TEvent> | undefined, event: TEvent): void;
|
|
51
|
+
/**
|
|
52
|
+
* Type guard to check if an event matches a specific type.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* if (isEventType(event, 'TextBlock:click')) {
|
|
56
|
+
* // event.data is typed correctly
|
|
57
|
+
* }
|
|
58
|
+
*/
|
|
59
|
+
declare function isEventType<TEvent extends ComponentEvent, TType extends TEvent["type"]>(event: TEvent, type: TType): event is Extract<TEvent, {
|
|
60
|
+
type: TType;
|
|
61
|
+
}>;
|
|
62
|
+
|
|
63
|
+
type FollowupAction = "explain" | "summarize" | "translate" | "suggest_questions" | "commentary_top" | "commentary_consensus" | "commentary_disagreements" | "commentary_unusual" | "connect_to_life" | "trace_usage";
|
|
64
|
+
declare const FOLLOWUP_MESSAGE_PREFIX = "__FOLLOWUP__";
|
|
65
|
+
declare const FOLLOWUP_TEMPLATES: Record<FollowupAction, string>;
|
|
66
|
+
declare function renderFollowupTemplate(action: FollowupAction, citation: string): string;
|
|
67
|
+
declare function buildFollowupUserMessage(params: {
|
|
68
|
+
action: FollowupAction;
|
|
69
|
+
citation: string;
|
|
70
|
+
includeRePrefix: boolean;
|
|
71
|
+
}): string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Response type from the Sefaria Text API.
|
|
75
|
+
*/
|
|
76
|
+
interface SefariaTextResponse {
|
|
77
|
+
ref?: string;
|
|
78
|
+
heRef?: string;
|
|
79
|
+
text?: unknown;
|
|
80
|
+
he?: unknown;
|
|
81
|
+
versions?: Array<{
|
|
82
|
+
text?: unknown;
|
|
83
|
+
language?: string;
|
|
84
|
+
versionTitle?: string;
|
|
85
|
+
isPrimary?: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
sections?: unknown;
|
|
88
|
+
toSections?: unknown;
|
|
89
|
+
primary_category?: unknown;
|
|
90
|
+
type?: unknown;
|
|
91
|
+
categories?: unknown;
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Events emitted by TextBlock.
|
|
96
|
+
*/
|
|
97
|
+
type TextBlockClickEvent = ComponentEventOf<'TextBlock', 'click', {
|
|
98
|
+
ref: string;
|
|
99
|
+
}>;
|
|
100
|
+
type TextBlockLinkClickEvent = ComponentEventOf<'TextBlock', 'linkClick', {
|
|
101
|
+
ref: string;
|
|
102
|
+
href: string;
|
|
103
|
+
}>;
|
|
104
|
+
type TextBlockFollowupEvent = ComponentEventOf<'TextBlock', 'followup', {
|
|
105
|
+
ref: string;
|
|
106
|
+
action: FollowupAction;
|
|
107
|
+
}>;
|
|
108
|
+
type TextBlockEvent = TextBlockClickEvent | TextBlockLinkClickEvent | TextBlockFollowupEvent;
|
|
109
|
+
interface TextBlockProps {
|
|
110
|
+
/** Sefaria citation reference (e.g., "Genesis 1:1") */
|
|
111
|
+
sefRef?: string;
|
|
112
|
+
/** Data from Sefaria Text API. If <code>sefariaData</code> is provided, renders full text. */
|
|
113
|
+
sefariaData?: SefariaTextResponse;
|
|
114
|
+
/** If true, fetches data from the Sefaria API when <code>sefariaData</code> is not provided. */
|
|
115
|
+
fetchData?: boolean;
|
|
116
|
+
/** Initial display <code>language</code>: translation, bilingual, or Hebrew. */
|
|
117
|
+
language?: string;
|
|
118
|
+
/** Preferred translation <code>versionTitle</code> from the Sefaria API. */
|
|
119
|
+
versionTitle?: string;
|
|
120
|
+
/** Show the "Follow up" button with action menu */
|
|
121
|
+
showFollowup?: boolean;
|
|
122
|
+
/** Event handler for component events */
|
|
123
|
+
onEvent?: EventHandler<TextBlockEvent>;
|
|
124
|
+
/** Additional CSS class name */
|
|
125
|
+
className?: string;
|
|
126
|
+
/** Additional inline styles */
|
|
127
|
+
style?: CSSProperties;
|
|
128
|
+
}
|
|
129
|
+
declare function TextBlockInner({ sefRef, sefariaData, fetchData, language, versionTitle, showFollowup, onEvent, className, style, }: TextBlockProps): react_jsx_runtime.JSX.Element;
|
|
130
|
+
/**
|
|
131
|
+
* TextBlock displays a Sefaria text source with a colored border indicating its category.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* // Loading state - only <code>ref</code> provided
|
|
135
|
+
* <TextBlock ref="Genesis 1:1" />
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* // Full render with data
|
|
139
|
+
* <TextBlock ref="Genesis 1:1" sefariaData={apiResponse} />
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* // With event handling
|
|
143
|
+
* <TextBlock
|
|
144
|
+
* ref="Genesis 1:1"
|
|
145
|
+
* sefariaData={data}
|
|
146
|
+
* onEvent={(event) => {
|
|
147
|
+
* if (event.type === 'TextBlock:click') {
|
|
148
|
+
* console.log('Clicked:', event.data.ref);
|
|
149
|
+
* }
|
|
150
|
+
* }}
|
|
151
|
+
* />
|
|
152
|
+
*/
|
|
153
|
+
declare const TextBlock: typeof TextBlockInner;
|
|
154
|
+
|
|
155
|
+
interface GalleryExample<P = Record<string, unknown>> {
|
|
156
|
+
title: string;
|
|
157
|
+
description?: string;
|
|
158
|
+
props: P;
|
|
159
|
+
wrapper?: ComponentType<{
|
|
160
|
+
children: ReactNode;
|
|
161
|
+
}>;
|
|
162
|
+
}
|
|
163
|
+
interface GalleryConfig<P = Record<string, unknown>> {
|
|
164
|
+
name: string;
|
|
165
|
+
description: string;
|
|
166
|
+
/** Short noun phrase for overview cards (e.g., "Sefaria text display") */
|
|
167
|
+
shortDescription?: string;
|
|
168
|
+
component: ComponentType<P>;
|
|
169
|
+
examples: GalleryExample<P>[];
|
|
170
|
+
sourceCode: string;
|
|
171
|
+
/** Ordered list of props to display on docs pages. */
|
|
172
|
+
propsList?: string[];
|
|
173
|
+
/** Props for a simple example shown on the overview page */
|
|
174
|
+
overviewExample?: P;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
declare const textBlockGallery: GalleryConfig<TextBlockProps>;
|
|
178
|
+
|
|
179
|
+
interface CalendarBlockProps {
|
|
180
|
+
/** Calendar title in English, as returned by the API. */
|
|
181
|
+
calendar: string;
|
|
182
|
+
/** Show a text preview when no description is available. */
|
|
183
|
+
showText?: boolean;
|
|
184
|
+
/** Additional CSS class name */
|
|
185
|
+
className?: string;
|
|
186
|
+
/** Additional inline styles */
|
|
187
|
+
style?: CSSProperties;
|
|
188
|
+
}
|
|
189
|
+
declare function CalendarBlock({ calendar, showText, className, style }: CalendarBlockProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const colors: {
|
|
192
|
+
readonly darkteal: "#004e5f";
|
|
193
|
+
readonly raspberry: "#7c406f";
|
|
194
|
+
readonly green: "#5d956f";
|
|
195
|
+
readonly paleblue: "#9ab8cb";
|
|
196
|
+
readonly blue: "#4871bf";
|
|
197
|
+
readonly orange: "#cb6158";
|
|
198
|
+
readonly lightpink: "#c7a7b4";
|
|
199
|
+
readonly darkblue: "#073570";
|
|
200
|
+
readonly darkpink: "#ab4e66";
|
|
201
|
+
readonly lavender: "#7f85a9";
|
|
202
|
+
readonly yellow: "#ccb479";
|
|
203
|
+
readonly purple: "#594176";
|
|
204
|
+
readonly lightblue: "#5a99b7";
|
|
205
|
+
readonly lightgreen: "#97b386";
|
|
206
|
+
readonly red: "#802f3e";
|
|
207
|
+
readonly teal: "#00827f";
|
|
208
|
+
readonly lightbg: "#B8D4D3";
|
|
209
|
+
readonly tan: "#D4896C";
|
|
210
|
+
};
|
|
211
|
+
declare const categoryColors: Record<string, string>;
|
|
212
|
+
declare function categoryColor(cat: unknown): string;
|
|
213
|
+
declare const palette: {
|
|
214
|
+
colors: {
|
|
215
|
+
readonly darkteal: "#004e5f";
|
|
216
|
+
readonly raspberry: "#7c406f";
|
|
217
|
+
readonly green: "#5d956f";
|
|
218
|
+
readonly paleblue: "#9ab8cb";
|
|
219
|
+
readonly blue: "#4871bf";
|
|
220
|
+
readonly orange: "#cb6158";
|
|
221
|
+
readonly lightpink: "#c7a7b4";
|
|
222
|
+
readonly darkblue: "#073570";
|
|
223
|
+
readonly darkpink: "#ab4e66";
|
|
224
|
+
readonly lavender: "#7f85a9";
|
|
225
|
+
readonly yellow: "#ccb479";
|
|
226
|
+
readonly purple: "#594176";
|
|
227
|
+
readonly lightblue: "#5a99b7";
|
|
228
|
+
readonly lightgreen: "#97b386";
|
|
229
|
+
readonly red: "#802f3e";
|
|
230
|
+
readonly teal: "#00827f";
|
|
231
|
+
readonly lightbg: "#B8D4D3";
|
|
232
|
+
readonly tan: "#D4896C";
|
|
233
|
+
};
|
|
234
|
+
categoryColors: Record<string, string>;
|
|
235
|
+
categoryColor: typeof categoryColor;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export { CalendarBlock, type CalendarBlockProps, type ComponentEvent, type ComponentEventOf, type EventHandler, FOLLOWUP_MESSAGE_PREFIX, FOLLOWUP_TEMPLATES, type FollowupAction, type GalleryConfig, type GalleryExample, type SefariaTextResponse, TextBlock, type TextBlockClickEvent, type TextBlockEvent, type TextBlockLinkClickEvent, type TextBlockProps, buildFollowupUserMessage, categoryColor, categoryColors, colors, createEvent, emitEvent, isEventType, palette, renderFollowupTemplate, textBlockGallery };
|