@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
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { AlertDialog as AlertDialogPrimitive } from
|
|
4
|
-
import { mergeProps } from
|
|
5
|
-
import { useRender } from
|
|
6
|
-
import { cn, stateClassName } from
|
|
7
|
-
import { Button
|
|
8
|
-
export const alertDialogSizeNames = [
|
|
3
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
4
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
5
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
6
|
+
import { cn, stateClassName } from '../internal/classes.js';
|
|
7
|
+
import { Button } from './button.js';
|
|
8
|
+
export const alertDialogSizeNames = ['default', 'sm'];
|
|
9
9
|
export function AlertDialog(props) {
|
|
10
10
|
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
11
11
|
}
|
|
12
12
|
export function AlertDialogTrigger(props) {
|
|
13
|
-
return
|
|
13
|
+
return _jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
14
14
|
}
|
|
15
15
|
export function AlertDialogPortal(props) {
|
|
16
|
-
return
|
|
16
|
+
return _jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
17
17
|
}
|
|
18
18
|
export function AlertDialogOverlay({ className, ...props }) {
|
|
19
|
-
return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", ...props, className: stateClassName(
|
|
19
|
+
return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", ...props, className: stateClassName('sprout-alert-dialog-overlay', className) }));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* The alert dialog surface. It renders its own portal and overlay, so place
|
|
23
23
|
* it directly inside `AlertDialog`.
|
|
24
24
|
*/
|
|
25
|
-
export function AlertDialogContent({ className, size =
|
|
26
|
-
return (_jsxs(AlertDialogPortal, { container: container, children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, ...props, className: stateClassName(
|
|
25
|
+
export function AlertDialogContent({ className, size = 'default', container, ...props }) {
|
|
26
|
+
return (_jsxs(AlertDialogPortal, { container: container, children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, ...props, className: stateClassName('sprout-alert-dialog-content', className) })] }));
|
|
27
27
|
}
|
|
28
28
|
function part(slot, base) {
|
|
29
29
|
return function AlertDialogPart({ className, render, ref, ...props }) {
|
|
30
30
|
return useRender({
|
|
31
|
-
defaultTagName:
|
|
31
|
+
defaultTagName: 'div',
|
|
32
32
|
ref,
|
|
33
33
|
render,
|
|
34
|
-
props: mergeProps({
|
|
34
|
+
props: mergeProps({ 'data-slot': slot, className: cn(base, className) }, props),
|
|
35
35
|
state: { slot },
|
|
36
36
|
});
|
|
37
37
|
};
|
|
@@ -41,20 +41,20 @@ function part(slot, base) {
|
|
|
41
41
|
* `sm` dialogs; from 640px a `default` dialog aligns it to the start with the
|
|
42
42
|
* media beside the text.
|
|
43
43
|
*/
|
|
44
|
-
export const AlertDialogHeader = part(
|
|
44
|
+
export const AlertDialogHeader = part('alert-dialog-header', 'sprout-alert-dialog-header');
|
|
45
45
|
/**
|
|
46
46
|
* A tinted action bar pinned to the bottom edge. Actions stack in reverse
|
|
47
47
|
* order on narrow screens and align right from 640px; `sm` dialogs always
|
|
48
48
|
* split it into two equal columns.
|
|
49
49
|
*/
|
|
50
|
-
export const AlertDialogFooter = part(
|
|
50
|
+
export const AlertDialogFooter = part('alert-dialog-footer', 'sprout-alert-dialog-footer');
|
|
51
51
|
/** A 40px tile for an icon above or beside the title. */
|
|
52
|
-
export const AlertDialogMedia = part(
|
|
52
|
+
export const AlertDialogMedia = part('alert-dialog-media', 'sprout-alert-dialog-media');
|
|
53
53
|
export function AlertDialogTitle({ className, ...props }) {
|
|
54
|
-
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", ...props, className: stateClassName(
|
|
54
|
+
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", ...props, className: stateClassName('sprout-alert-dialog-title', className) }));
|
|
55
55
|
}
|
|
56
56
|
export function AlertDialogDescription({ className, ...props }) {
|
|
57
|
-
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", ...props, className: stateClassName(
|
|
57
|
+
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", ...props, className: stateClassName('sprout-alert-dialog-description', className) }));
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* The confirming button. It does not close the dialog by itself, so the
|
|
@@ -64,6 +64,6 @@ export function AlertDialogAction(props) {
|
|
|
64
64
|
return _jsx(Button, { "data-slot": "alert-dialog-action", ...props });
|
|
65
65
|
}
|
|
66
66
|
/** Closes the dialog. An outline button unless `variant` says otherwise. */
|
|
67
|
-
export function AlertDialogCancel({ variant =
|
|
67
|
+
export function AlertDialogCancel({ variant = 'outline', size = 'default', ...props }) {
|
|
68
68
|
return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-cancel", render: _jsx(Button, { variant: variant, size: size }), ...props }));
|
|
69
69
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useRender } from
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
export declare const alertVariantNames: readonly ["default", "destructive"];
|
|
3
3
|
export type AlertVariant = (typeof alertVariantNames)[number];
|
|
4
4
|
export interface AlertVariantOptions {
|
|
5
5
|
variant?: AlertVariant | null;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function alertVariants({ variant, className
|
|
8
|
+
export declare function alertVariants({ variant, className }?: AlertVariantOptions): string;
|
|
9
9
|
export interface AlertState extends Record<string, unknown> {
|
|
10
|
-
slot:
|
|
10
|
+
slot: 'alert';
|
|
11
11
|
variant: AlertVariant;
|
|
12
12
|
}
|
|
13
|
-
export interface AlertProps extends useRender.ComponentProps<
|
|
13
|
+
export interface AlertProps extends useRender.ComponentProps<'div', AlertState> {
|
|
14
14
|
variant?: AlertVariant;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -18,11 +18,11 @@ export interface AlertProps extends useRender.ComponentProps<"div", AlertState>
|
|
|
18
18
|
* pass `role="status"` or `role="note"` for messages that should not interrupt.
|
|
19
19
|
*/
|
|
20
20
|
export declare function Alert({ className, variant, render, ref, role, ...props }: AlertProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
21
|
-
type PartSlot =
|
|
21
|
+
type PartSlot = 'alert-title' | 'alert-description' | 'alert-action';
|
|
22
22
|
export interface AlertPartState extends Record<string, unknown> {
|
|
23
23
|
slot: PartSlot;
|
|
24
24
|
}
|
|
25
|
-
export type AlertPartProps = useRender.ComponentProps<
|
|
25
|
+
export type AlertPartProps = useRender.ComponentProps<'div', AlertPartState>;
|
|
26
26
|
export declare const AlertTitle: ({ className, render, ref, ...props }: AlertPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
27
27
|
export declare const AlertDescription: ({ className, render, ref, ...props }: AlertPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
28
28
|
/** Pins a compact control, such as an Undo button, to the top-right corner. */
|
package/dist/components/alert.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { mergeProps } from
|
|
2
|
-
import { useRender } from
|
|
3
|
-
import { cn } from
|
|
4
|
-
export const alertVariantNames = [
|
|
5
|
-
export function alertVariants({ variant, className
|
|
6
|
-
return cn(
|
|
1
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { cn } from '../internal/classes.js';
|
|
4
|
+
export const alertVariantNames = ['default', 'destructive'];
|
|
5
|
+
export function alertVariants({ variant, className } = {}) {
|
|
6
|
+
return cn('sprout-alert', `sprout-alert-${variant ?? 'default'}`, className);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* A static message block. It announces itself with `role="alert"` by default;
|
|
10
10
|
* pass `role="status"` or `role="note"` for messages that should not interrupt.
|
|
11
11
|
*/
|
|
12
|
-
export function Alert({ className, variant =
|
|
12
|
+
export function Alert({ className, variant = 'default', render, ref, role = 'alert', ...props }) {
|
|
13
13
|
return useRender({
|
|
14
|
-
defaultTagName:
|
|
14
|
+
defaultTagName: 'div',
|
|
15
15
|
ref,
|
|
16
16
|
render,
|
|
17
17
|
props: mergeProps({ role, className: alertVariants({ variant, className }) }, props),
|
|
18
|
-
state: { slot:
|
|
18
|
+
state: { slot: 'alert', variant },
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
function part(slot, base) {
|
|
22
22
|
return function AlertPart({ className, render, ref, ...props }) {
|
|
23
23
|
return useRender({
|
|
24
|
-
defaultTagName:
|
|
24
|
+
defaultTagName: 'div',
|
|
25
25
|
ref,
|
|
26
26
|
render,
|
|
27
27
|
props: mergeProps({ className: cn(base, className) }, props),
|
|
@@ -29,7 +29,7 @@ function part(slot, base) {
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
export const AlertTitle = part(
|
|
33
|
-
export const AlertDescription = part(
|
|
32
|
+
export const AlertTitle = part('alert-title', 'sprout-alert-title');
|
|
33
|
+
export const AlertDescription = part('alert-description', 'sprout-alert-description');
|
|
34
34
|
/** Pins a compact control, such as an Undo button, to the top-right corner. */
|
|
35
|
-
export const AlertAction = part(
|
|
35
|
+
export const AlertAction = part('alert-action', 'sprout-alert-action');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps } from
|
|
2
|
-
export interface AspectRatioProps extends ComponentProps<
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export interface AspectRatioProps extends ComponentProps<'div'> {
|
|
3
3
|
/** Width divided by height, such as `16 / 9`, `4 / 3`, or `1`. */
|
|
4
4
|
ratio: number;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from
|
|
2
|
+
import { cn } from '../internal/classes.js';
|
|
3
3
|
/** Keeps its content at a fixed width-to-height ratio as its width changes. */
|
|
4
4
|
export function AspectRatio({ ratio, className, style, ...props }) {
|
|
5
|
-
return (_jsx("div", { "data-slot": "aspect-ratio", className: cn(
|
|
5
|
+
return (_jsx("div", { "data-slot": "aspect-ratio", className: cn('sprout-aspect-ratio', className), style: { ...style, '--sprout-aspect-ratio': ratio }, ...props }));
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ComponentProps, type ReactElement } from
|
|
2
|
-
import { useRender } from
|
|
3
|
-
import { type FileKind } from
|
|
4
|
-
import { type ButtonProps } from
|
|
1
|
+
import { type ComponentProps, type ReactElement } from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { type FileKind } from '../internal/file-kind.js';
|
|
4
|
+
import { type ButtonProps } from './button.js';
|
|
5
5
|
export declare const attachmentStateNames: readonly ["idle", "uploading", "processing", "error", "done"];
|
|
6
6
|
export declare const attachmentSizeNames: readonly ["default", "sm", "xs"];
|
|
7
7
|
export declare const attachmentOrientationNames: readonly ["horizontal", "vertical"];
|
|
@@ -19,7 +19,7 @@ export type FileAttachmentVariant = (typeof fileAttachmentVariantNames)[number];
|
|
|
19
19
|
export type FileAttachmentState = (typeof fileAttachmentStateNames)[number];
|
|
20
20
|
export type FileTypeIconSize = (typeof fileTypeIconSizeNames)[number];
|
|
21
21
|
export type { FileKind };
|
|
22
|
-
export interface AttachmentProps extends ComponentProps<
|
|
22
|
+
export interface AttachmentProps extends ComponentProps<'div'> {
|
|
23
23
|
/** `idle` dashes the border, `uploading` and `processing` shimmer the title and dim image media, `error` turns it red. */
|
|
24
24
|
state?: AttachmentState | undefined;
|
|
25
25
|
size?: AttachmentSize | undefined;
|
|
@@ -27,23 +27,23 @@ export interface AttachmentProps extends ComponentProps<"div"> {
|
|
|
27
27
|
}
|
|
28
28
|
/** A file card built from media, content, and actions. */
|
|
29
29
|
export declare function Attachment({ className, state, size, orientation, ...props }: AttachmentProps): import("react").JSX.Element;
|
|
30
|
-
export interface AttachmentMediaProps extends ComponentProps<
|
|
30
|
+
export interface AttachmentMediaProps extends ComponentProps<'div'> {
|
|
31
31
|
/** `icon` centers an icon or spinner; `image` crops an `img` to the square. */
|
|
32
32
|
variant?: AttachmentMediaVariant | undefined;
|
|
33
33
|
}
|
|
34
34
|
export declare function AttachmentMedia({ className, variant, ...props }: AttachmentMediaProps): import("react").JSX.Element;
|
|
35
|
-
export declare function AttachmentContent({ className, ...props }: ComponentProps<
|
|
35
|
+
export declare function AttachmentContent({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
36
36
|
/** A single-line name. It shimmers while the attachment uploads or processes. */
|
|
37
|
-
export declare function AttachmentTitle({ className, ...props }: ComponentProps<
|
|
38
|
-
export declare function AttachmentDescription({ className, ...props }: ComponentProps<
|
|
37
|
+
export declare function AttachmentTitle({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
|
|
38
|
+
export declare function AttachmentDescription({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
|
|
39
39
|
/** Sits above the trigger. Vertical attachments float it over the media corner. */
|
|
40
|
-
export declare function AttachmentActions({ className, ...props }: ComponentProps<
|
|
40
|
+
export declare function AttachmentActions({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
41
41
|
/** A ghost `icon-xs` Button. Give icon-only actions an `aria-label`. */
|
|
42
42
|
export declare function AttachmentAction({ variant, size, ...props }: ButtonProps): import("react").JSX.Element;
|
|
43
|
-
export type AttachmentTriggerProps = useRender.ComponentProps<
|
|
43
|
+
export type AttachmentTriggerProps = useRender.ComponentProps<'button'>;
|
|
44
44
|
/** Stretches over the whole attachment so a click anywhere opens it. Name it with `aria-label`. */
|
|
45
45
|
export declare function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
46
|
-
export interface AttachmentGroupProps extends ComponentProps<
|
|
46
|
+
export interface AttachmentGroupProps extends ComponentProps<'div'> {
|
|
47
47
|
/**
|
|
48
48
|
* `carousel` scrolls one row sideways with edge arrows, `grid` makes two
|
|
49
49
|
* columns (three from 640px), `inline` wraps, and `list` stacks.
|
|
@@ -51,7 +51,7 @@ export interface AttachmentGroupProps extends ComponentProps<"div"> {
|
|
|
51
51
|
variant?: AttachmentGroupVariant | undefined;
|
|
52
52
|
}
|
|
53
53
|
export declare function AttachmentGroup(props: AttachmentGroupProps): import("react").JSX.Element;
|
|
54
|
-
export interface FileTypeIconProps extends Omit<ComponentProps<
|
|
54
|
+
export interface FileTypeIconProps extends Omit<ComponentProps<'svg'>, 'children'> {
|
|
55
55
|
name: string;
|
|
56
56
|
mediaType: string;
|
|
57
57
|
/** `sm` is 20 × 24px for rows and chips; `lg` is 30 × 36px for grid previews. */
|
|
@@ -60,10 +60,10 @@ export interface FileTypeIconProps extends Omit<ComponentProps<"svg">, "children
|
|
|
60
60
|
/** A paper glyph with a colored extension badge, such as PDF or XLSX. Decorative. */
|
|
61
61
|
export declare function FileTypeIcon({ name, mediaType, size, className, ...props }: FileTypeIconProps): import("react").JSX.Element;
|
|
62
62
|
export type AttachmentFileSource = {
|
|
63
|
-
kind:
|
|
63
|
+
kind: 'local';
|
|
64
64
|
file: File;
|
|
65
65
|
} | {
|
|
66
|
-
kind:
|
|
66
|
+
kind: 'remote';
|
|
67
67
|
url: string;
|
|
68
68
|
};
|
|
69
69
|
export interface AttachmentFile {
|
|
@@ -93,7 +93,7 @@ export interface FileAttachmentProps {
|
|
|
93
93
|
/** Peeks at images, text, code, JSON, and Markdown in a card on hover or focus. Needs a `source` or `url`. */
|
|
94
94
|
preview?: boolean | undefined;
|
|
95
95
|
/** The verb in the open button's name, such as “Download report.pdf”. */
|
|
96
|
-
actionLabel?:
|
|
96
|
+
actionLabel?: 'Inspect' | 'Download' | undefined;
|
|
97
97
|
className?: string | undefined;
|
|
98
98
|
}
|
|
99
99
|
/** A ready-made file row, card, inline mention, or chip with upload states, retry, and remove. */
|
|
@@ -115,4 +115,4 @@ export interface LocalFileAttachmentProps {
|
|
|
115
115
|
preview?: boolean | undefined;
|
|
116
116
|
}
|
|
117
117
|
/** A chip for a `File` still in browser memory, with a live image preview. */
|
|
118
|
-
export declare function LocalFileAttachment({ file, onRemove, onOpen, viewable, preview
|
|
118
|
+
export declare function LocalFileAttachment({ file, onRemove, onOpen, viewable, preview }: LocalFileAttachmentProps): import("react").JSX.Element;
|