@tulipfarm/sprout 0.3.0 → 0.4.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/README.md +45 -40
- package/dist/components/accordion.d.ts +2 -2
- package/dist/components/accordion.js +9 -9
- package/dist/components/agent-fanout.d.ts +2 -2
- package/dist/components/agent-fanout.js +65 -87
- package/dist/components/alert-dialog.d.ts +6 -6
- package/dist/components/alert-dialog.js +20 -20
- package/dist/components/alert.d.ts +6 -6
- package/dist/components/alert.js +13 -13
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +2 -2
- package/dist/components/attachment.d.ts +17 -17
- package/dist/components/attachment.js +82 -115
- package/dist/components/avatar.d.ts +10 -10
- package/dist/components/avatar.js +14 -14
- package/dist/components/badge.d.ts +4 -4
- package/dist/components/badge.js +18 -18
- package/dist/components/board.d.ts +107 -0
- package/dist/components/board.js +640 -0
- package/dist/components/brand-icon.d.ts +6 -6
- package/dist/components/brand-icon.js +55 -63
- package/dist/components/breadcrumb.d.ts +11 -11
- package/dist/components/breadcrumb.js +16 -18
- package/dist/components/button-group.d.ts +6 -6
- package/dist/components/button-group.js +14 -14
- package/dist/components/button.d.ts +11 -11
- package/dist/components/button.js +46 -56
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +44 -53
- package/dist/components/canvas.d.ts +4 -4
- package/dist/components/canvas.js +39 -46
- package/dist/components/card.d.ts +6 -6
- package/dist/components/card.js +17 -17
- package/dist/components/carousel.d.ts +7 -7
- package/dist/components/carousel.js +57 -75
- package/dist/components/chart.d.ts +5 -112
- package/dist/components/chart.js +5 -172
- package/dist/components/chat-confirmation.d.ts +13 -11
- package/dist/components/chat-confirmation.js +32 -38
- package/dist/components/chat-input.d.ts +4 -4
- package/dist/components/chat-input.js +74 -81
- package/dist/components/chat-plan.d.ts +2 -2
- package/dist/components/chat-plan.js +15 -20
- package/dist/components/chat-sources.d.ts +8 -8
- package/dist/components/chat-sources.js +18 -27
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +9 -9
- package/dist/components/choice-list.d.ts +2 -2
- package/dist/components/choice-list.js +16 -18
- package/dist/components/code-block.d.ts +5 -5
- package/dist/components/code-block.js +26 -26
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/collapsible.js +7 -11
- package/dist/components/combobox.d.ts +3 -3
- package/dist/components/combobox.js +24 -24
- package/dist/components/command.d.ts +13 -13
- package/dist/components/command.js +61 -73
- package/dist/components/context-menu.d.ts +5 -5
- package/dist/components/context-menu.js +22 -22
- package/dist/components/dialog.d.ts +6 -6
- package/dist/components/dialog.js +23 -28
- package/dist/components/direction.d.ts +1 -1
- package/dist/components/direction.js +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -5
- package/dist/components/dropdown-menu.js +20 -20
- package/dist/components/field.d.ts +11 -11
- package/dist/components/field.js +41 -61
- package/dist/components/file-explorer.d.ts +2 -2
- package/dist/components/file-explorer.js +89 -105
- package/dist/components/file-viewer.d.ts +10 -10
- package/dist/components/file-viewer.js +112 -140
- package/dist/components/form.d.ts +7 -7
- package/dist/components/form.js +24 -28
- package/dist/components/glass-banner.d.ts +3 -3
- package/dist/components/glass-banner.js +21 -24
- package/dist/components/gradient-banner.d.ts +5 -5
- package/dist/components/gradient-banner.js +13 -22
- package/dist/components/hover-card.d.ts +4 -4
- package/dist/components/hover-card.js +6 -6
- package/dist/components/input-group.d.ts +11 -11
- package/dist/components/input-group.js +22 -36
- package/dist/components/input-otp.d.ts +10 -10
- package/dist/components/input-otp.js +13 -15
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +7 -7
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +5 -5
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +2 -2
- package/dist/components/mention-list.d.ts +3 -3
- package/dist/components/mention-list.js +10 -10
- package/dist/components/menubar.d.ts +6 -6
- package/dist/components/menubar.js +22 -22
- package/dist/components/message-actions.d.ts +2 -2
- package/dist/components/message-actions.js +29 -31
- package/dist/components/message-response.d.ts +3 -3
- package/dist/components/message-response.js +18 -18
- package/dist/components/message-scroller.d.ts +12 -12
- package/dist/components/message-scroller.js +44 -56
- package/dist/components/message.d.ts +11 -11
- package/dist/components/message.js +25 -25
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +15 -15
- package/dist/components/notice-banner.d.ts +2 -2
- package/dist/components/notice-banner.js +2 -2
- package/dist/components/page-content.d.ts +2 -2
- package/dist/components/page-content.js +2 -2
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.js +16 -16
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/pagination.js +17 -17
- package/dist/components/plan-outline.d.ts +2 -2
- package/dist/components/plan-outline.js +43 -60
- package/dist/components/popover.d.ts +6 -6
- package/dist/components/popover.js +15 -15
- package/dist/components/presence-cursor.d.ts +2 -2
- package/dist/components/presence-cursor.js +3 -3
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +8 -8
- package/dist/components/prompt-list.d.ts +3 -3
- package/dist/components/prompt-list.js +6 -6
- package/dist/components/questionnaire.d.ts +19 -19
- package/dist/components/questionnaire.js +183 -242
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +6 -6
- package/dist/components/reasoning-effort.d.ts +3 -3
- package/dist/components/reasoning-effort.js +9 -12
- package/dist/components/record-list.d.ts +66 -0
- package/dist/components/record-list.js +151 -0
- package/dist/components/resizable.d.ts +5 -5
- package/dist/components/resizable.js +76 -102
- package/dist/components/result-card.d.ts +10 -5
- package/dist/components/result-card.js +42 -53
- package/dist/components/result-notice.d.ts +18 -0
- package/dist/components/result-notice.js +29 -0
- package/dist/components/review-card.d.ts +6 -6
- package/dist/components/review-card.js +18 -18
- package/dist/components/rich-text-editor.d.ts +2 -2
- package/dist/components/rich-text-editor.js +56 -72
- package/dist/components/schema-diagram.d.ts +3 -3
- package/dist/components/schema-diagram.js +39 -53
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +10 -14
- package/dist/components/search-dialog.d.ts +6 -6
- package/dist/components/search-dialog.js +16 -16
- package/dist/components/search-field.d.ts +1 -1
- package/dist/components/search-field.js +11 -11
- package/dist/components/select.d.ts +3 -3
- package/dist/components/select.js +20 -20
- package/dist/components/selection-slot.d.ts +2 -2
- package/dist/components/selection-slot.js +6 -9
- package/dist/components/separator.d.ts +15 -15
- package/dist/components/separator.js +22 -27
- package/dist/components/settings-list.d.ts +3 -3
- package/dist/components/settings-list.js +5 -5
- package/dist/components/sheet.d.ts +6 -6
- package/dist/components/sheet.js +27 -27
- package/dist/components/sidebar.d.ts +22 -22
- package/dist/components/sidebar.js +57 -58
- package/dist/components/skeleton.d.ts +5 -5
- package/dist/components/skeleton.js +14 -21
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +6 -6
- package/dist/components/spinner.d.ts +5 -5
- package/dist/components/spinner.js +22 -26
- package/dist/components/sql-viewer.d.ts +14 -14
- package/dist/components/sql-viewer.js +99 -128
- package/dist/components/state-panel-samples.d.ts +2 -2
- package/dist/components/state-panel-samples.js +209 -245
- package/dist/components/state-panel.d.ts +2 -35
- package/dist/components/state-panel.js +2 -29
- package/dist/components/state-sample.d.ts +7 -7
- package/dist/components/state-sample.js +18 -31
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +7 -7
- package/dist/components/table-nuqs.d.ts +2 -2
- package/dist/components/table-nuqs.js +11 -12
- package/dist/components/table.d.ts +4 -4
- package/dist/components/table.js +166 -235
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +12 -12
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +6 -8
- package/dist/components/timeline.d.ts +3 -0
- package/dist/components/timeline.js +3 -0
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +19 -25
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +18 -20
- package/dist/components/toggle.d.ts +2 -2
- package/dist/components/toggle.js +8 -8
- package/dist/components/tool-activity.d.ts +1 -1
- package/dist/components/tool-activity.js +83 -110
- package/dist/components/toolbar-status.d.ts +2 -2
- package/dist/components/toolbar-status.js +7 -7
- package/dist/components/tooltip.d.ts +5 -5
- package/dist/components/tooltip.js +12 -11
- package/dist/components/typed-text.d.ts +2 -2
- package/dist/components/typed-text.js +10 -12
- package/dist/components/view-switcher.d.ts +51 -0
- package/dist/components/view-switcher.js +114 -0
- package/dist/index.d.ts +98 -93
- package/dist/index.js +98 -93
- package/dist/internal/chart-kit.d.ts +142 -0
- package/dist/internal/chart-kit.js +200 -0
- package/dist/internal/charts/bars.d.ts +61 -0
- package/dist/internal/charts/bars.js +86 -0
- package/dist/internal/charts/lines.d.ts +67 -0
- package/dist/internal/charts/lines.js +70 -0
- package/dist/internal/charts/more.d.ts +77 -0
- package/dist/internal/charts/more.js +68 -0
- package/dist/internal/charts/parts.d.ts +54 -0
- package/dist/internal/charts/parts.js +82 -0
- package/dist/internal/charts/timeline-dates.d.ts +38 -0
- package/dist/internal/charts/timeline-dates.js +113 -0
- package/dist/internal/charts/timeline-window.d.ts +31 -0
- package/dist/internal/charts/timeline-window.js +26 -0
- package/dist/internal/charts/timeline.d.ts +72 -0
- package/dist/internal/charts/timeline.js +287 -0
- package/dist/internal/classes.d.ts +1 -1
- package/dist/internal/classes.js +7 -9
- package/dist/internal/code-tokens.d.ts +2 -2
- package/dist/internal/code-tokens.js +12 -12
- package/dist/internal/fieldset.d.ts +1 -1
- package/dist/internal/fieldset.js +6 -6
- package/dist/internal/file-kind.d.ts +1 -1
- package/dist/internal/file-kind.js +43 -51
- package/dist/internal/flow.d.ts +4 -4
- package/dist/internal/flow.js +20 -23
- package/dist/internal/languages.js +999 -999
- package/dist/internal/message-scroller.d.ts +3 -3
- package/dist/internal/message-scroller.js +64 -112
- package/dist/internal/pressable.d.ts +1 -1
- package/dist/internal/pressable.js +7 -7
- package/dist/internal/state-panel.d.ts +35 -0
- package/dist/internal/state-panel.js +22 -0
- package/dist/internal/syntax.d.ts +2 -2
- package/dist/internal/syntax.js +36 -47
- package/dist/styles/accordion.css +3 -5
- package/dist/styles/agent-fanout.css +64 -60
- package/dist/styles/alert-dialog.css +12 -26
- package/dist/styles/alert.css +10 -15
- package/dist/styles/attachment.css +51 -93
- package/dist/styles/avatar.css +17 -24
- package/dist/styles/badge.css +11 -36
- package/dist/styles/board.css +571 -0
- package/dist/styles/brand-icon.css +7 -8
- package/dist/styles/breadcrumb.css +4 -7
- package/dist/styles/button-group.css +8 -14
- package/dist/styles/button.css +22 -27
- package/dist/styles/calendar.css +24 -36
- package/dist/styles/canvas.css +2 -3
- package/dist/styles/card.css +7 -23
- package/dist/styles/carousel.css +11 -12
- package/dist/styles/chart.css +215 -31
- package/dist/styles/chat-input.css +15 -39
- package/dist/styles/chat-plan.css +3 -4
- package/dist/styles/chat-sources.css +3 -6
- package/dist/styles/checkbox.css +11 -25
- package/dist/styles/choice-list.css +17 -31
- package/dist/styles/code-block.css +11 -25
- package/dist/styles/collapsible.css +10 -15
- package/dist/styles/combobox.css +11 -15
- package/dist/styles/command.css +5 -8
- package/dist/styles/context-menu.css +2 -2
- package/dist/styles/dialog.css +5 -16
- package/dist/styles/dropdown-menu.css +2 -2
- package/dist/styles/field.css +15 -21
- package/dist/styles/file-explorer.css +19 -33
- package/dist/styles/file-viewer.css +13 -17
- package/dist/styles/form.css +3 -3
- package/dist/styles/glass-banner.css +12 -47
- package/dist/styles/gradient-banner.css +17 -35
- package/dist/styles/hover-card.css +9 -15
- package/dist/styles/index.css +116 -108
- package/dist/styles/input-group.css +25 -41
- package/dist/styles/input-otp.css +5 -6
- package/dist/styles/input.css +5 -5
- package/dist/styles/kbd.css +1 -1
- package/dist/styles/label.css +9 -30
- package/dist/styles/mention-list.css +6 -8
- package/dist/styles/menubar.css +5 -6
- package/dist/styles/message-actions.css +1 -1
- package/dist/styles/message-response.css +3 -5
- package/dist/styles/message-scroller.css +14 -21
- package/dist/styles/message.css +23 -60
- package/dist/styles/navigation-menu.css +14 -29
- package/dist/styles/notice-banner.css +1 -2
- package/dist/styles/page-header.css +7 -10
- package/dist/styles/pagination.css +1 -4
- package/dist/styles/plan-outline.css +20 -37
- package/dist/styles/popover.css +10 -19
- package/dist/styles/presence-cursor.css +1 -2
- package/dist/styles/progress.css +2 -4
- package/dist/styles/prompt-list.css +6 -17
- package/dist/styles/questionnaire.css +16 -40
- package/dist/styles/radio-group.css +12 -23
- package/dist/styles/reasoning-effort.css +8 -15
- package/dist/styles/record-list.css +243 -0
- package/dist/styles/resizable.css +10 -11
- package/dist/styles/result-card.css +17 -3
- package/dist/styles/result-notice.css +80 -0
- package/dist/styles/review-card.css +2 -3
- package/dist/styles/rich-text-editor.css +1 -2
- package/dist/styles/schema-diagram.css +12 -17
- package/dist/styles/scroll-area.css +8 -10
- package/dist/styles/search-dialog.css +1 -5
- package/dist/styles/search-field.css +1 -2
- package/dist/styles/select.css +7 -7
- package/dist/styles/selection-slot.css +1 -2
- package/dist/styles/separator.css +7 -8
- package/dist/styles/settings-list.css +1 -2
- package/dist/styles/sheet.css +40 -73
- package/dist/styles/sidebar.css +17 -21
- package/dist/styles/skeleton.css +9 -11
- package/dist/styles/slider.css +11 -21
- package/dist/styles/spinner.css +2 -2
- package/dist/styles/sql-viewer.css +29 -29
- package/dist/styles/state-panel.css +8 -9
- package/dist/styles/state-sample.css +20 -33
- package/dist/styles/switch.css +11 -18
- package/dist/styles/table.css +51 -77
- package/dist/styles/tabs.css +12 -16
- package/dist/styles/textarea.css +3 -3
- package/dist/styles/themes/chatgpt.css +11 -23
- package/dist/styles/themes/claude.css +12 -24
- package/dist/styles/themes/cloudflare.css +11 -23
- package/dist/styles/themes/discord.css +11 -23
- package/dist/styles/themes/github.css +11 -23
- package/dist/styles/themes/grok.css +11 -23
- package/dist/styles/themes/linear.css +12 -25
- package/dist/styles/themes/neutral.css +11 -23
- package/dist/styles/themes/notion.css +11 -23
- package/dist/styles/themes/perplexity.css +11 -23
- package/dist/styles/themes/raycast.css +11 -23
- package/dist/styles/themes/spotify.css +11 -23
- package/dist/styles/themes/stripe.css +11 -23
- package/dist/styles/themes/supabase.css +11 -23
- package/dist/styles/themes/tulipfarm.css +9 -10
- package/dist/styles/themes/vercel.css +12 -25
- package/dist/styles/timeline.css +276 -0
- package/dist/styles/toast.css +13 -20
- package/dist/styles/toggle-group.css +17 -23
- package/dist/styles/toggle.css +8 -8
- package/dist/styles/tool-activity.css +7 -13
- package/dist/styles/toolbar-status.css +2 -7
- package/dist/styles/tooltip.css +15 -21
- package/dist/styles/view-switcher.css +279 -0
- package/package.json +21 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export interface ResultNoticeProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
3
|
+
/** How many items the view shows, such as 100. */
|
|
4
|
+
shown: number;
|
|
5
|
+
/** How many items exist, as a number or a capped count such as "10000+". */
|
|
6
|
+
total: number | string;
|
|
7
|
+
/** The plural name of the items, such as "rows" or "groups". */
|
|
8
|
+
noun: string;
|
|
9
|
+
/** A control at the end, such as a button that opens the result in Table. */
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A quiet strip inside a view that says the view shows only part of the
|
|
14
|
+
* result, such as "Showing the first 100 of 2,431 rows." Mount it whenever a
|
|
15
|
+
* chart or timeline cuts its result short. It renders nothing when `total` is
|
|
16
|
+
* an exact count that is not above `shown`, so it never claims more exist.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ResultNotice({ shown, total, noun, action, className, ...props }: ResultNoticeProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InfoCircle } from 'reicon-react/icons/InfoCircle';
|
|
3
|
+
import { cn } from '../internal/classes.js';
|
|
4
|
+
const countPattern = /^(\d+)(\+?)$/;
|
|
5
|
+
const formatCount = (value) => {
|
|
6
|
+
if (typeof value === 'number')
|
|
7
|
+
return value.toLocaleString('en-US');
|
|
8
|
+
const match = countPattern.exec(value.trim());
|
|
9
|
+
return match ? `${Number(match[1]).toLocaleString('en-US')}${match[2]}` : value;
|
|
10
|
+
};
|
|
11
|
+
/** The exact total, or undefined when it is capped ("10000+") or not a count. */
|
|
12
|
+
const exactCount = (value) => {
|
|
13
|
+
if (typeof value === 'number')
|
|
14
|
+
return value;
|
|
15
|
+
const match = countPattern.exec(value.trim());
|
|
16
|
+
return match && !match[2] ? Number(match[1]) : undefined;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A quiet strip inside a view that says the view shows only part of the
|
|
20
|
+
* result, such as "Showing the first 100 of 2,431 rows." Mount it whenever a
|
|
21
|
+
* chart or timeline cuts its result short. It renders nothing when `total` is
|
|
22
|
+
* an exact count that is not above `shown`, so it never claims more exist.
|
|
23
|
+
*/
|
|
24
|
+
export function ResultNotice({ shown, total, noun, action, className, ...props }) {
|
|
25
|
+
const exact = exactCount(total);
|
|
26
|
+
if (exact !== undefined && exact <= shown)
|
|
27
|
+
return null;
|
|
28
|
+
return (_jsxs("div", { "data-slot": "result-notice", className: cn('sprout-result-notice', className), ...props, children: [_jsxs("div", { className: "sprout-result-notice-content", children: [_jsx(InfoCircle, { "aria-hidden": "true", className: "sprout-result-notice-icon" }), _jsxs("p", { role: "status", "data-slot": "result-notice-message", className: "sprout-result-notice-message", children: [shown === 1 ? ('Showing the first of ') : (_jsxs(_Fragment, { children: ["Showing the first ", _jsx("strong", { children: formatCount(shown) }), " of", ' '] })), _jsx("strong", { children: formatCount(total) }), " ", noun, "."] })] }), action != null && action !== false && (_jsx("div", { "data-slot": "result-notice-action", className: "sprout-result-notice-action", children: action }))] }));
|
|
29
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ComponentProps, type ReactNode } from
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
2
|
export declare const reviewCardBadgeVariantNames: readonly ["default", "success", "warning", "info", "secondary", "destructive", "outline"];
|
|
3
3
|
export type ReviewCardBadgeVariant = (typeof reviewCardBadgeVariantNames)[number];
|
|
4
4
|
export type ReviewCardBadge = {
|
|
5
5
|
label: string;
|
|
6
6
|
variant: ReviewCardBadgeVariant;
|
|
7
7
|
};
|
|
8
|
-
export interface ReviewCardProps extends Omit<ComponentProps<
|
|
8
|
+
export interface ReviewCardProps extends Omit<ComponentProps<'section'>, 'title' | 'children'> {
|
|
9
9
|
/** A 14–16px icon shown in a tile before the title. */
|
|
10
10
|
icon: ReactNode;
|
|
11
11
|
title: string;
|
|
@@ -30,10 +30,10 @@ export interface ReviewCardProps extends Omit<ComponentProps<"section">, "title"
|
|
|
30
30
|
* details; the footer holds the outcome and the decision buttons.
|
|
31
31
|
*/
|
|
32
32
|
export declare function ReviewCard({ icon, title, badge, settled, status, actions, children, label, className, ...props }: ReviewCardProps): import("react").JSX.Element;
|
|
33
|
-
export type ReviewRowsProps = ComponentProps<
|
|
33
|
+
export type ReviewRowsProps = ComponentProps<'dl'>;
|
|
34
34
|
/** A bordered list of labeled facts, such as Change, Table, and Trigger. */
|
|
35
35
|
export declare function ReviewRows({ className, ...props }: ReviewRowsProps): import("react").JSX.Element;
|
|
36
|
-
export interface ReviewRowProps extends Omit<ComponentProps<
|
|
36
|
+
export interface ReviewRowProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
37
37
|
label: string;
|
|
38
38
|
/** The value: text, badges, or a stacked new and current value. */
|
|
39
39
|
children: ReactNode;
|
|
@@ -44,7 +44,7 @@ export type ReviewStep = {
|
|
|
44
44
|
summary: ReactNode;
|
|
45
45
|
detail?: ReactNode;
|
|
46
46
|
};
|
|
47
|
-
export interface ReviewStepsProps extends Omit<ComponentProps<
|
|
47
|
+
export interface ReviewStepsProps extends Omit<ComponentProps<'div'>, 'title' | 'children'> {
|
|
48
48
|
/** Short heading, such as “3 steps”. */
|
|
49
49
|
title: string;
|
|
50
50
|
steps: readonly ReviewStep[];
|
|
@@ -55,7 +55,7 @@ export type ReviewValue = {
|
|
|
55
55
|
name: string;
|
|
56
56
|
value: string;
|
|
57
57
|
};
|
|
58
|
-
export interface ReviewValuesProps extends Omit<ComponentProps<
|
|
58
|
+
export interface ReviewValuesProps extends Omit<ComponentProps<'dl'>, 'children'> {
|
|
59
59
|
values: readonly ReviewValue[];
|
|
60
60
|
}
|
|
61
61
|
/** Exact names and values in monospace, such as headers or written fields. */
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useId, useState } from
|
|
4
|
-
import { ChevronDown } from
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { Badge } from
|
|
7
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { ChevronDown } from 'reicon-react/icons/ChevronDown';
|
|
5
|
+
import { cn } from '../internal/classes.js';
|
|
6
|
+
import { Badge } from './badge.js';
|
|
7
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js';
|
|
8
8
|
export const reviewCardBadgeVariantNames = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
'default',
|
|
10
|
+
'success',
|
|
11
|
+
'warning',
|
|
12
|
+
'info',
|
|
13
|
+
'secondary',
|
|
14
|
+
'destructive',
|
|
15
|
+
'outline',
|
|
16
16
|
];
|
|
17
17
|
/**
|
|
18
18
|
* A card that asks someone to review a proposed change before it happens:
|
|
@@ -29,21 +29,21 @@ export function ReviewCard({ icon, title, badge, settled = false, status, action
|
|
|
29
29
|
}
|
|
30
30
|
const showActions = open && actions != null && actions !== false;
|
|
31
31
|
const showStatus = status != null && status !== false;
|
|
32
|
-
return (_jsxs("section", { "data-slot": "review-card", "data-settled": settled || undefined, "data-open": open || undefined, "aria-label": label, "aria-labelledby": label ? undefined : titleId, ...props, className: cn(
|
|
32
|
+
return (_jsxs("section", { "data-slot": "review-card", "data-settled": settled || undefined, "data-open": open || undefined, "aria-label": label, "aria-labelledby": label ? undefined : titleId, ...props, className: cn('sprout-review-card', className), children: [_jsxs(Collapsible, { open: open, onOpenChange: setOpen, children: [_jsxs("div", { className: "sprout-review-card-header", children: [_jsx("span", { "aria-hidden": "true", className: "sprout-review-card-icon", children: icon }), _jsx("h4", { id: titleId, className: "sprout-review-card-title", children: _jsx(CollapsibleTrigger, { className: "sprout-review-card-trigger", children: title }) }), _jsx(Badge, { variant: badge.variant, className: "sprout-review-card-badge", children: badge.label }), _jsx(ChevronDown, { size: 16, "aria-hidden": "true", "data-slot": "collapsible-indicator", className: "sprout-review-card-chevron" })] }), _jsx(CollapsibleContent, { variant: "card", children: _jsx("div", { className: "sprout-review-card-body", children: children }) })] }), (showStatus || showActions) && (_jsxs("div", { className: "sprout-review-card-footer", children: [status, showActions && _jsx("div", { className: "sprout-review-card-actions", children: actions })] }))] }));
|
|
33
33
|
}
|
|
34
34
|
/** A bordered list of labeled facts, such as Change, Table, and Trigger. */
|
|
35
35
|
export function ReviewRows({ className, ...props }) {
|
|
36
|
-
return
|
|
36
|
+
return _jsx("dl", { "data-slot": "review-rows", ...props, className: cn('sprout-review-rows', className) });
|
|
37
37
|
}
|
|
38
38
|
/** One fact: the label on the left and its value on the right. */
|
|
39
39
|
export function ReviewRow({ label, children, className, ...props }) {
|
|
40
|
-
return (_jsxs("div", { "data-slot": "review-row", ...props, className: cn(
|
|
40
|
+
return (_jsxs("div", { "data-slot": "review-row", ...props, className: cn('sprout-review-row', className), children: [_jsx("dt", { className: "sprout-review-row-label", children: label }), _jsx("dd", { className: "sprout-review-row-value", children: children })] }));
|
|
41
41
|
}
|
|
42
42
|
/** A numbered list of what will happen, each with optional detail below. */
|
|
43
43
|
export function ReviewSteps({ title, steps, className, ...props }) {
|
|
44
|
-
return (_jsxs("div", { "data-slot": "review-steps", ...props, className: cn(
|
|
44
|
+
return (_jsxs("div", { "data-slot": "review-steps", ...props, className: cn('sprout-review-steps', className), children: [_jsx("h5", { className: "sprout-review-steps-title", children: title }), _jsx("ol", { className: "sprout-review-steps-list", children: steps.map((step, index) => (_jsxs("li", { className: "sprout-review-step", children: [_jsx("span", { "aria-hidden": "true", className: "sprout-review-step-number", children: index + 1 }), _jsxs("div", { className: "sprout-review-step-content", children: [_jsx("p", { className: "sprout-review-step-summary", children: step.summary }), step.detail] })] }, index))) })] }));
|
|
45
45
|
}
|
|
46
46
|
/** Exact names and values in monospace, such as headers or written fields. */
|
|
47
47
|
export function ReviewValues({ values, className, ...props }) {
|
|
48
|
-
return (_jsx("dl", { "data-slot": "review-values", ...props, className: cn(
|
|
48
|
+
return (_jsx("dl", { "data-slot": "review-values", ...props, className: cn('sprout-review-values', className), children: values.map(({ name, value }) => (_jsxs("div", { className: "sprout-review-value", children: [_jsx("dt", { className: "sprout-review-value-name", children: name }), _jsx("dd", { className: "sprout-review-value-text", children: value })] }, name))) }));
|
|
49
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ReactNode, type Ref } from
|
|
2
|
-
import { type Editor, type Extensions, type JSONContent } from
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type Editor, type Extensions, type JSONContent } from '@tiptap/core';
|
|
3
3
|
export declare const richTextEditorSizeNames: readonly ["default", "compact"];
|
|
4
4
|
export type RichTextEditorSize = (typeof richTextEditorSizeNames)[number];
|
|
5
5
|
/** A Tiptap JSON document, such as `{ type: "doc", content: [{ type: "paragraph" }] }`. */
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useImperativeHandle, useMemo, useRef
|
|
4
|
-
import { EditorContent, useEditor } from
|
|
5
|
-
import { Extension, InputRule
|
|
6
|
-
import { Fragment, Slice
|
|
7
|
-
import { Plugin, PluginKey, TextSelection
|
|
8
|
-
import { canSplit } from
|
|
9
|
-
import StarterKit from
|
|
10
|
-
import Placeholder from
|
|
11
|
-
import { cn } from
|
|
12
|
-
export const richTextEditorSizeNames = [
|
|
3
|
+
import { useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
|
+
import { EditorContent, useEditor } from '@tiptap/react';
|
|
5
|
+
import { Extension, InputRule } from '@tiptap/core';
|
|
6
|
+
import { Fragment, Slice } from '@tiptap/pm/model';
|
|
7
|
+
import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state';
|
|
8
|
+
import { canSplit } from '@tiptap/pm/transform';
|
|
9
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
10
|
+
import Placeholder from '@tiptap/extension-placeholder';
|
|
11
|
+
import { cn } from '../internal/classes.js';
|
|
12
|
+
export const richTextEditorSizeNames = ['default', 'compact'];
|
|
13
13
|
const fenceLanguage = /^[\w+#.-]{1,32}$/;
|
|
14
14
|
const typedFence = /```([\w+#.-]{1,32})?\s$/;
|
|
15
15
|
const fenceOnly = /^```([\w+#.-]{1,32})?$/;
|
|
16
16
|
const openingFence = /^ {0,3}(?:(`{3,})([^`]*)|(~{3,})(.*))$/;
|
|
17
17
|
function isFenceLine(state) {
|
|
18
18
|
const { $from, empty } = state.selection;
|
|
19
|
-
if (!empty ||
|
|
20
|
-
$from.parent.type.name !== "paragraph" ||
|
|
21
|
-
$from.parentOffset !== $from.parent.content.size)
|
|
19
|
+
if (!empty || $from.parent.type.name !== 'paragraph' || $from.parentOffset !== $from.parent.content.size)
|
|
22
20
|
return false;
|
|
23
|
-
return fenceOnly.test($from.parent
|
|
24
|
-
.textBetween(0, $from.parentOffset, undefined, "\n")
|
|
25
|
-
.split("\n")
|
|
26
|
-
.at(-1) ?? "");
|
|
21
|
+
return fenceOnly.test($from.parent.textBetween(0, $from.parentOffset, undefined, '\n').split('\n').at(-1) ?? '');
|
|
27
22
|
}
|
|
28
23
|
function markdownBlocks(schema, text) {
|
|
29
24
|
const blocks = [];
|
|
30
|
-
const lines = text.replace(/\r\n?/g,
|
|
25
|
+
const lines = text.replace(/\r\n?/g, '\n').split('\n');
|
|
31
26
|
while (lines.length) {
|
|
32
27
|
const line = lines.shift();
|
|
33
28
|
const open = openingFence.exec(line);
|
|
@@ -39,15 +34,15 @@ function markdownBlocks(schema, text) {
|
|
|
39
34
|
const fence = open[1] ?? open[3];
|
|
40
35
|
const info = (open[2] ?? open[4]).trim().split(/\s/)[0];
|
|
41
36
|
const closing = new RegExp(`^ {0,3}${fence[0]}{${fence.length},}\\s*$`);
|
|
42
|
-
const end = lines.findIndex(
|
|
43
|
-
const code = (end === -1 ? lines.splice(0) : lines.splice(0, end + 1).slice(0, -1)).join(
|
|
37
|
+
const end = lines.findIndex(candidate => closing.test(candidate));
|
|
38
|
+
const code = (end === -1 ? lines.splice(0) : lines.splice(0, end + 1).slice(0, -1)).join('\n');
|
|
44
39
|
blocks.push(schema.nodes.codeBlock.create({ language: fenceLanguage.test(info) ? info : null }, code ? schema.text(code) : null));
|
|
45
40
|
}
|
|
46
41
|
return blocks;
|
|
47
42
|
}
|
|
48
43
|
// StarterKit's fence rule only fires at the start of a paragraph, but Shift+Enter leaves the fence after a hard break.
|
|
49
44
|
const MarkdownCodeFence = Extension.create({
|
|
50
|
-
name:
|
|
45
|
+
name: 'markdownCodeFence',
|
|
51
46
|
priority: 1000,
|
|
52
47
|
addInputRules() {
|
|
53
48
|
return [
|
|
@@ -57,20 +52,17 @@ const MarkdownCodeFence = Extension.create({
|
|
|
57
52
|
const { tr, schema } = state;
|
|
58
53
|
const codeBlock = schema.nodes.codeBlock;
|
|
59
54
|
const $from = tr.doc.resolve(range.from);
|
|
60
|
-
if ($from.parent.type.name !==
|
|
61
|
-
range.to !== $from.end())
|
|
55
|
+
if ($from.parent.type.name !== 'paragraph' || range.to !== $from.end())
|
|
62
56
|
return null;
|
|
63
57
|
const before = $from.nodeBefore;
|
|
64
58
|
const attrs = { language: match[1] ?? null };
|
|
65
59
|
if (!before) {
|
|
66
|
-
if (!$from
|
|
67
|
-
.node(-1)
|
|
68
|
-
.canReplaceWith($from.index(-1), $from.indexAfter(-1), codeBlock))
|
|
60
|
+
if (!$from.node(-1).canReplaceWith($from.index(-1), $from.indexAfter(-1), codeBlock))
|
|
69
61
|
return null;
|
|
70
62
|
tr.delete(range.from, range.to).setBlockType(range.from, range.from, codeBlock, attrs);
|
|
71
63
|
return;
|
|
72
64
|
}
|
|
73
|
-
if (before.type.name !==
|
|
65
|
+
if (before.type.name !== 'hardBreak')
|
|
74
66
|
return null;
|
|
75
67
|
const splitAt = range.from - before.nodeSize;
|
|
76
68
|
tr.delete(splitAt, range.to);
|
|
@@ -85,19 +77,16 @@ const MarkdownCodeFence = Extension.create({
|
|
|
85
77
|
addProseMirrorPlugins() {
|
|
86
78
|
return [
|
|
87
79
|
new Plugin({
|
|
88
|
-
key: new PluginKey(
|
|
80
|
+
key: new PluginKey('markdownCodeFencePaste'),
|
|
89
81
|
props: {
|
|
90
82
|
handlePaste: (view, event) => {
|
|
91
|
-
const text = event.clipboardData?.getData(
|
|
83
|
+
const text = event.clipboardData?.getData('text/plain') ?? '';
|
|
92
84
|
if (view.state.selection.$from.parent.type.spec.code ||
|
|
93
|
-
!text.split(/\r\n?|\n/).some(
|
|
85
|
+
!text.split(/\r\n?|\n/).some(line => openingFence.test(line)))
|
|
94
86
|
return false;
|
|
95
87
|
const blocks = markdownBlocks(view.state.schema, text);
|
|
96
|
-
const slice = new Slice(Fragment.from(blocks), blocks[0]?.type.name ===
|
|
97
|
-
view.dispatch(view.state.tr
|
|
98
|
-
.replaceSelection(slice)
|
|
99
|
-
.scrollIntoView()
|
|
100
|
-
.setMeta("paste", true));
|
|
88
|
+
const slice = new Slice(Fragment.from(blocks), blocks[0]?.type.name === 'paragraph' ? 1 : 0, blocks.at(-1)?.type.name === 'paragraph' ? 1 : 0);
|
|
89
|
+
view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView().setMeta('paste', true));
|
|
101
90
|
return true;
|
|
102
91
|
},
|
|
103
92
|
},
|
|
@@ -106,26 +95,26 @@ const MarkdownCodeFence = Extension.create({
|
|
|
106
95
|
},
|
|
107
96
|
});
|
|
108
97
|
const MessageFormatting = Extension.create({
|
|
109
|
-
name:
|
|
98
|
+
name: 'messageFormatting',
|
|
110
99
|
extendMarkSchema(extension) {
|
|
111
|
-
if (extension.name ===
|
|
100
|
+
if (extension.name === 'link')
|
|
112
101
|
return { inclusive: false };
|
|
113
102
|
return {};
|
|
114
103
|
},
|
|
115
104
|
addProseMirrorPlugins() {
|
|
116
105
|
return [
|
|
117
106
|
new Plugin({
|
|
118
|
-
key: new PluginKey(
|
|
107
|
+
key: new PluginKey('clearDeletedLink'),
|
|
119
108
|
appendTransaction(transactions, oldState, state) {
|
|
120
109
|
const link = state.schema.marks.link;
|
|
121
110
|
if (!link ||
|
|
122
|
-
!transactions.some(
|
|
111
|
+
!transactions.some(transaction => transaction.docChanged) ||
|
|
123
112
|
state.doc.content.size >= oldState.doc.content.size ||
|
|
124
113
|
!state.selection.empty ||
|
|
125
|
-
!state.storedMarks?.some(
|
|
114
|
+
!state.storedMarks?.some(mark => mark.type === link))
|
|
126
115
|
return null;
|
|
127
116
|
if (state.selection.$from.parent.content.size &&
|
|
128
|
-
state.selection.$from.marks().some(
|
|
117
|
+
state.selection.$from.marks().some(mark => mark.type === link))
|
|
129
118
|
return null;
|
|
130
119
|
return state.tr.removeStoredMark(link);
|
|
131
120
|
},
|
|
@@ -140,7 +129,7 @@ function within(state, name) {
|
|
|
140
129
|
return true;
|
|
141
130
|
return false;
|
|
142
131
|
}
|
|
143
|
-
const allowedProtocols = [
|
|
132
|
+
const allowedProtocols = ['http:', 'https:', 'mailto:'];
|
|
144
133
|
const baseExtensions = [
|
|
145
134
|
StarterKit.configure({
|
|
146
135
|
heading: { levels: [1, 2, 3] },
|
|
@@ -150,8 +139,7 @@ const baseExtensions = [
|
|
|
150
139
|
openOnClick: false,
|
|
151
140
|
isAllowedUri: (url, context) => {
|
|
152
141
|
const protocol = /^[a-z][a-z\d+.-]*:/i.exec(url)?.[0].toLowerCase();
|
|
153
|
-
return
|
|
154
|
-
(!protocol || allowedProtocols.includes(protocol)));
|
|
142
|
+
return context.defaultValidate(url) && (!protocol || allowedProtocols.includes(protocol));
|
|
155
143
|
},
|
|
156
144
|
},
|
|
157
145
|
}),
|
|
@@ -164,9 +152,9 @@ const baseExtensions = [
|
|
|
164
152
|
* itself `data-slot="input-group-control"`, so an `InputGroup` around it draws
|
|
165
153
|
* the border, focus, and invalid states.
|
|
166
154
|
*/
|
|
167
|
-
export function RichTextEditor({ ref, size, condensed = false, value, onChange, onSend, extensions = [], placeholder =
|
|
168
|
-
const scale = size ??
|
|
169
|
-
const inline = condensed || scale ===
|
|
155
|
+
export function RichTextEditor({ ref, size, condensed = false, value, onChange, onSend, extensions = [], placeholder = 'Ask anything…', disabled = false, ariaLabel = 'Message', ariaInvalid = false, ariaDescribedBy, ariaExpanded, ariaControls, ariaActiveDescendant, toolbarAddon, className, }) {
|
|
156
|
+
const scale = size ?? 'default';
|
|
157
|
+
const inline = condensed || scale === 'compact';
|
|
170
158
|
const onSendRef = useRef(onSend);
|
|
171
159
|
const onChangeRef = useRef(onChange);
|
|
172
160
|
const placeholderRef = useRef(placeholder);
|
|
@@ -175,11 +163,7 @@ export function RichTextEditor({ ref, size, condensed = false, value, onChange,
|
|
|
175
163
|
onChangeRef.current = onChange;
|
|
176
164
|
placeholderRef.current = placeholder;
|
|
177
165
|
suggestionOpenRef.current = ariaExpanded ?? false;
|
|
178
|
-
const configured = useMemo(() => [
|
|
179
|
-
...baseExtensions,
|
|
180
|
-
Placeholder.configure({ placeholder: () => placeholderRef.current }),
|
|
181
|
-
...extensions,
|
|
182
|
-
], [extensions]);
|
|
166
|
+
const configured = useMemo(() => [...baseExtensions, Placeholder.configure({ placeholder: () => placeholderRef.current }), ...extensions], [extensions]);
|
|
183
167
|
const editor = useEditor({
|
|
184
168
|
immediatelyRender: false,
|
|
185
169
|
extensions: configured,
|
|
@@ -188,37 +172,37 @@ export function RichTextEditor({ ref, size, condensed = false, value, onChange,
|
|
|
188
172
|
editorProps: {
|
|
189
173
|
// useEditor re-applies editorProps on every render, so these stay current.
|
|
190
174
|
attributes: {
|
|
191
|
-
|
|
192
|
-
role:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
175
|
+
'data-slot': 'input-group-control',
|
|
176
|
+
role: 'textbox',
|
|
177
|
+
'aria-label': ariaLabel,
|
|
178
|
+
'aria-disabled': String(disabled),
|
|
179
|
+
'aria-multiline': 'true',
|
|
180
|
+
'aria-autocomplete': 'list',
|
|
181
|
+
'aria-invalid': ariaInvalid ? 'true' : 'false',
|
|
198
182
|
// ARIA forbids aria-expanded on a textbox; aria-controls and aria-activedescendant carry the open list.
|
|
199
|
-
...(ariaDescribedBy && {
|
|
200
|
-
...(ariaControls && {
|
|
183
|
+
...(ariaDescribedBy && { 'aria-describedby': ariaDescribedBy }),
|
|
184
|
+
...(ariaControls && { 'aria-controls': ariaControls }),
|
|
201
185
|
...(ariaActiveDescendant && {
|
|
202
|
-
|
|
186
|
+
'aria-activedescendant': ariaActiveDescendant,
|
|
203
187
|
}),
|
|
204
|
-
class:
|
|
188
|
+
class: 'sprout-rich-text-editor-content',
|
|
205
189
|
},
|
|
206
190
|
handleKeyDown: (view, event) => {
|
|
207
191
|
if (event.isComposing)
|
|
208
192
|
return false;
|
|
209
|
-
if ((event.metaKey || event.ctrlKey) && event.key ===
|
|
193
|
+
if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {
|
|
210
194
|
event.preventDefault();
|
|
211
195
|
onSendRef.current();
|
|
212
196
|
return true;
|
|
213
197
|
}
|
|
214
|
-
if (event.key ===
|
|
198
|
+
if (event.key === 'Enter' && suggestionOpenRef.current)
|
|
215
199
|
return false;
|
|
216
|
-
if (event.key ===
|
|
200
|
+
if (event.key === 'Enter' && isFenceLine(view.state))
|
|
217
201
|
return false;
|
|
218
|
-
if (event.key ===
|
|
202
|
+
if (event.key === 'Enter' &&
|
|
219
203
|
!event.shiftKey &&
|
|
220
|
-
!within(view.state,
|
|
221
|
-
!within(view.state,
|
|
204
|
+
!within(view.state, 'listItem') &&
|
|
205
|
+
!within(view.state, 'codeBlock')) {
|
|
222
206
|
event.preventDefault();
|
|
223
207
|
onSendRef.current();
|
|
224
208
|
return true;
|
|
@@ -231,7 +215,7 @@ export function RichTextEditor({ ref, size, condensed = false, value, onChange,
|
|
|
231
215
|
useImperativeHandle(ref, () => ({
|
|
232
216
|
focus: () => editor?.commands.focus(),
|
|
233
217
|
editor: () => editor,
|
|
234
|
-
setContent:
|
|
218
|
+
setContent: content => editor?.commands.setContent(content, { emitUpdate: true }),
|
|
235
219
|
}), [editor]);
|
|
236
220
|
useEffect(() => {
|
|
237
221
|
editor?.setEditable(!disabled, false);
|
|
@@ -244,5 +228,5 @@ export function RichTextEditor({ ref, size, condensed = false, value, onChange,
|
|
|
244
228
|
if (editor && !editor.state.doc.eq(editor.schema.nodeFromJSON(value)))
|
|
245
229
|
editor.commands.setContent(value, { emitUpdate: false });
|
|
246
230
|
}, [editor, value]);
|
|
247
|
-
return (_jsxs("div", { "data-slot": "rich-text-editor", "data-size": scale, "data-condensed": condensed || undefined, "data-disabled": disabled || undefined, className: cn(
|
|
231
|
+
return (_jsxs("div", { "data-slot": "rich-text-editor", "data-size": scale, "data-condensed": condensed || undefined, "data-disabled": disabled || undefined, className: cn('sprout-rich-text-editor', `sprout-rich-text-editor-size-${scale}`, condensed && 'sprout-rich-text-editor-condensed', className), children: [_jsx("div", { className: "sprout-rich-text-editor-body", children: _jsx(EditorContent, { editor: editor }) }), toolbarAddon && (_jsx("div", { "data-slot": "rich-text-editor-toolbar", className: cn('sprout-rich-text-editor-toolbar', inline && 'sprout-rich-text-editor-toolbar-inline'), children: toolbarAddon }))] }));
|
|
248
232
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributes } from
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
2
|
export declare const schemaTableStateNames: readonly ["new", "changed", "unchanged", "linked"];
|
|
3
3
|
export declare const schemaChangeNames: readonly ["added", "changed", "removed"];
|
|
4
4
|
export declare const schemaDiagramLayoutNames: readonly ["auto", "horizontal", "vertical"];
|
|
@@ -30,7 +30,7 @@ export interface SchemaLink {
|
|
|
30
30
|
target: string;
|
|
31
31
|
label: string;
|
|
32
32
|
}
|
|
33
|
-
export interface SchemaDiagramProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
33
|
+
export interface SchemaDiagramProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'children'> {
|
|
34
34
|
tables: readonly SchemaTable[];
|
|
35
35
|
links: readonly SchemaLink[];
|
|
36
36
|
/** Names the diagram for assistive tech, such as “Schema diagram for Launch tracker”. */
|
|
@@ -46,7 +46,7 @@ export interface SchemaDiagramProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
46
46
|
* with proposed changes marked on each table and field.
|
|
47
47
|
*/
|
|
48
48
|
export declare function SchemaDiagram({ tables, links, label, layout: layoutName, className, ...props }: SchemaDiagramProps): import("react").JSX.Element;
|
|
49
|
-
export interface SchemaLegendProps extends Omit<HTMLAttributes<HTMLUListElement>,
|
|
49
|
+
export interface SchemaLegendProps extends Omit<HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
50
50
|
}
|
|
51
51
|
/** Explains the change colors, the unique key, and the required mark. */
|
|
52
52
|
export declare function SchemaLegend({ className, ...props }: SchemaLegendProps): import("react").JSX.Element;
|