@flikk/ui 1.0.0-beta.11 → 1.0.0-beta.12
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/dist/components/ai/ApprovalCard/ApprovalCard.js +1 -1
- package/dist/components/ai/MessageHistory/MessageHistory.js +1 -0
- package/dist/components/ai/PromptInput/PromptInput.js +7 -125
- package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -77
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +1 -0
- package/dist/components/ai/index.js +1 -0
- package/dist/components/core/Accordion/Accordion.d.ts +1 -1
- package/dist/components/core/Accordion/Accordion.js +2 -2
- package/dist/components/core/Accordion/Accordion.theme.d.ts +2 -2
- package/dist/components/core/Accordion/Accordion.theme.js +4 -4
- package/dist/components/core/Accordion/Accordion.types.d.ts +23 -18
- package/dist/components/core/Accordion/AccordionBody.d.ts +3 -0
- package/dist/components/core/Accordion/{AccordionContent.js → AccordionBody.js} +4 -4
- package/dist/components/core/Accordion/AccordionItem.js +1 -1
- package/dist/components/core/Accordion/AccordionTrigger.js +16 -7
- package/dist/components/core/Accordion/index.d.ts +2 -2
- package/dist/components/core/Alert/Alert.js +5 -1
- package/dist/components/core/Alert/Alert.types.d.ts +3 -3
- package/dist/components/core/Breadcrumbs/Breadcrumbs.js +7 -3
- package/dist/components/core/Breadcrumbs/Breadcrumbs.types.d.ts +1 -1
- package/dist/components/core/Button/Button.js +2 -8
- package/dist/components/core/Button/Button.theme.js +7 -7
- package/dist/components/core/Calendar/Calendar.js +3 -3
- package/dist/components/core/Card/Card.d.ts +2 -2
- package/dist/components/core/Card/Card.js +3 -3
- package/dist/components/core/Card/Card.theme.js +3 -3
- package/dist/components/core/Card/Card.types.d.ts +4 -4
- package/dist/components/core/Card/CardBody.d.ts +3 -0
- package/dist/components/core/Card/CardBody.js +11 -0
- package/dist/components/core/Card/index.d.ts +2 -2
- package/dist/components/core/Carousel/Carousel.js +4 -4
- package/dist/components/core/Carousel/Carousel.types.d.ts +4 -4
- package/dist/components/core/Carousel/CarouselBody.d.ts +4 -0
- package/dist/components/core/Carousel/{CarouselContent.js → CarouselBody.js} +3 -3
- package/dist/components/core/Carousel/index.d.ts +2 -1
- package/dist/components/core/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.js +6 -6
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +2 -2
- package/dist/components/core/ContextMenu/ContextMenuBody.d.ts +6 -0
- package/dist/components/core/ContextMenu/{ContextMenuContent.js → ContextMenuBody.js} +4 -4
- package/dist/components/core/ContextMenu/ContextMenuSubBody.d.ts +6 -0
- package/dist/components/core/ContextMenu/{ContextMenuSubContent.js → ContextMenuSubBody.js} +4 -4
- package/dist/components/core/ContextMenu/index.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.d.ts +2 -2
- package/dist/components/core/Drawer/Drawer.js +28 -9
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/Drawer.types.d.ts +8 -6
- package/dist/components/core/Drawer/DrawerBody.d.ts +5 -0
- package/dist/components/core/Drawer/DrawerBody.js +11 -0
- package/dist/components/core/Drawer/index.d.ts +2 -1
- package/dist/components/core/Dropdown/Dropdown.types.d.ts +3 -3
- package/dist/components/core/Dropdown/DropdownSection.js +3 -1
- package/dist/components/core/MenuItem/MenuItem.js +3 -1
- package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/core/Message/Message.d.ts +1 -1
- package/dist/components/core/Message/Message.js +2 -2
- package/dist/components/core/Message/Message.types.d.ts +1 -1
- package/dist/components/core/Message/MessageBody.d.ts +8 -0
- package/dist/components/core/Message/{MessageContent.js → MessageBody.js} +3 -3
- package/dist/components/core/Message/index.d.ts +2 -0
- package/dist/components/core/Modal/Modal.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/Modal.types.d.ts +5 -2
- package/dist/components/core/ModalStack/ModalStackModal.js +1 -0
- package/dist/components/core/PageHeading/PageHeading.types.d.ts +1 -1
- package/dist/components/core/PageHeading/PageHeadingBackButton.js +3 -1
- package/dist/components/core/Popover/Popover.d.ts +1 -1
- package/dist/components/core/Popover/Popover.js +4 -4
- package/dist/components/core/Popover/Popover.theme.d.ts +1 -1
- package/dist/components/core/Popover/Popover.theme.js +2 -2
- package/dist/components/core/Popover/Popover.types.d.ts +3 -3
- package/dist/components/core/Popover/PopoverBody.d.ts +7 -0
- package/dist/components/core/Popover/{PopoverContent.js → PopoverBody.js} +5 -5
- package/dist/components/core/Popover/index.d.ts +4 -3
- package/dist/components/core/Tabs/Tabs.animations.d.ts +2 -2
- package/dist/components/core/Tabs/Tabs.animations.js +3 -3
- package/dist/components/core/Tabs/Tabs.d.ts +1 -1
- package/dist/components/core/Tabs/Tabs.js +3 -3
- package/dist/components/core/Tabs/Tabs.theme.d.ts +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +2 -2
- package/dist/components/core/Tabs/Tabs.types.d.ts +9 -9
- package/dist/components/core/Tabs/TabsBody.d.ts +6 -0
- package/dist/components/core/Tabs/{TabsContent.js → TabsBody.js} +8 -8
- package/dist/components/core/Tabs/index.d.ts +2 -2
- package/dist/components/core/Toast/Toast.js +5 -1
- package/dist/components/core/Toast/Toast.types.d.ts +9 -9
- package/dist/components/core/index.js +6 -2
- package/dist/components/data-display/Feed/Feed.js +10 -2
- package/dist/components/data-display/Feed/Feed.types.d.ts +4 -4
- package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +1 -1
- package/dist/components/data-display/KPI/KPI.js +2 -2
- package/dist/components/data-display/KPI/KPI.types.d.ts +3 -3
- package/dist/components/data-display/Metric/Metric.js +2 -2
- package/dist/components/data-display/Metric/Metric.types.d.ts +3 -3
- package/dist/components/data-display/Table/TableColumnManager.js +2 -1
- package/dist/components/data-display/Table/TableFilter.js +2 -1
- package/dist/components/forms/Checkbox/Checkbox.js +1 -1
- package/dist/components/forms/Checkbox/Checkbox.types.d.ts +5 -5
- package/dist/components/forms/Checkbox/CheckboxGroup.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/forms/ColorPicker/ColorPicker.js +2 -2
- package/dist/components/forms/ColorPicker/ColorPicker.types.d.ts +2 -2
- package/dist/components/forms/ColorPicker/ColorPickerBody.d.ts +7 -0
- package/dist/components/forms/ColorPicker/{ColorPickerContent.js → ColorPickerBody.js} +5 -5
- package/dist/components/forms/ColorPicker/index.d.ts +2 -2
- package/dist/components/forms/DatePicker/DatePicker.d.ts +7 -3
- package/dist/components/forms/DatePicker/DatePicker.js +6 -5
- package/dist/components/forms/DatePicker/DatePicker.theme.js +3 -3
- package/dist/components/forms/DatePicker/DatePicker.types.d.ts +9 -4
- package/dist/components/forms/DatePicker/DatePickerBody.d.ts +7 -0
- package/dist/components/forms/DatePicker/{DatePickerContent.js → DatePickerBody.js} +10 -9
- package/dist/components/forms/DatePicker/index.d.ts +2 -2
- package/dist/components/forms/FileUpload/FileUpload.js +0 -78
- package/dist/components/forms/Input/Input.js +2 -2
- package/dist/components/forms/Input/Input.types.d.ts +4 -4
- package/dist/components/forms/Radio/Radio.js +1 -1
- package/dist/components/forms/Radio/Radio.types.d.ts +5 -5
- package/dist/components/forms/Radio/RadioGroup.js +1 -1
- package/dist/components/forms/Select/Select.js +2 -2
- package/dist/components/forms/Select/Select.types.d.ts +4 -4
- package/dist/components/forms/Switch/Switch.js +1 -1
- package/dist/components/forms/Switch/Switch.types.d.ts +4 -4
- package/dist/components/forms/Textarea/Textarea.js +2 -2
- package/dist/components/forms/Textarea/Textarea.types.d.ts +4 -4
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -78
- package/dist/components/forms/index.d.ts +2 -2
- package/dist/components/forms/index.js +2 -80
- package/dist/components/layout/FormLayout/FormLayout.d.ts +0 -2
- package/dist/components/layout/FormLayout/FormLayout.js +12 -6
- package/dist/components/layout/FormLayout/FormLayout.theme.js +2 -5
- package/dist/components/layout/FormLayout/FormLayout.types.d.ts +8 -26
- package/dist/components/layout/FormLayout/FormLayoutSection.js +3 -2
- package/dist/components/layout/FormLayout/index.d.ts +1 -1
- package/dist/index.js +196 -198
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/core/Accordion/AccordionContent.d.ts +0 -3
- package/dist/components/core/Card/CardContent.d.ts +0 -3
- package/dist/components/core/Card/CardContent.js +0 -11
- package/dist/components/core/Carousel/CarouselContent.d.ts +0 -4
- package/dist/components/core/ContextMenu/ContextMenuContent.d.ts +0 -6
- package/dist/components/core/ContextMenu/ContextMenuSubContent.d.ts +0 -6
- package/dist/components/core/Drawer/DrawerContent.d.ts +0 -5
- package/dist/components/core/Drawer/DrawerContent.js +0 -11
- package/dist/components/core/Message/MessageContent.d.ts +0 -8
- package/dist/components/core/Popover/PopoverContent.d.ts +0 -7
- package/dist/components/core/Tabs/TabsContent.d.ts +0 -6
- package/dist/components/forms/ColorPicker/ColorPickerContent.d.ts +0 -7
- package/dist/components/forms/DatePicker/DatePickerContent.d.ts +0 -7
- package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +0 -3
- package/dist/components/layout/FormLayout/FormLayoutBody.js +0 -91
- package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +0 -3
- package/dist/components/layout/FormLayout/FormLayoutHeader.js +0 -12
|
@@ -10,7 +10,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
10
10
|
const ApprovalCard = ({ title, subtitle, variant = "default", riskLevel = "medium", onApprove, onDeny, children, isApproving = false, className, }) => {
|
|
11
11
|
const riskColor = approvalCardTheme.badgeColors[riskLevel];
|
|
12
12
|
const riskIcon = riskLevel === "critical" || riskLevel === "high" ? (jsx(ExclamationTriangleIcon, { className: "" })) : (jsx(CheckCircleIcon, { className: "" }));
|
|
13
|
-
return (jsxs(Card, { className: cn(approvalCardTheme.baseStyle, approvalCardTheme.variants[variant], className), children: [jsx(Card.Header, { children: jsx("div", { className: "flex flex-col items-start", children: jsxs(Badge, { variant: "outline", color: riskColor, size: "sm", iconStart: riskIcon, className: "font-semibold shadow", children: [riskLevel.toUpperCase(), " RISK"] }) }) }), jsxs(Card.
|
|
13
|
+
return (jsxs(Card, { className: cn(approvalCardTheme.baseStyle, approvalCardTheme.variants[variant], className), children: [jsx(Card.Header, { children: jsx("div", { className: "flex flex-col items-start", children: jsxs(Badge, { variant: "outline", color: riskColor, size: "sm", iconStart: riskIcon, className: "font-semibold shadow", children: [riskLevel.toUpperCase(), " RISK"] }) }) }), jsxs(Card.Body, { className: "space-y-3", children: [jsxs("div", { className: "space-y-1", children: [jsx(Card.Title, { className: "", children: title }), subtitle && (jsx("p", { className: "text-sm md:text-base text-[var(--color-text-secondary)]/80", children: subtitle }))] }), children && (jsx("div", { className: "bg-[var(--color-background-secondary)] rounded-md p-3 text-sm font-mono border border-[var(--color-border)] overflow-x-auto", children: children }))] }), jsxs(Card.Footer, { className: "justify-end gap-2 mt-3", children: [jsx(Button, { variant: "outline", color: "neutral", size: "sm", onClick: onDeny, children: "Deny" }), jsx(Button, { color: riskColor, size: "sm", state: isApproving ? "loading" : "default", onClick: onApprove, children: "Approve" })] })] }));
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { ApprovalCard };
|
|
@@ -3,6 +3,7 @@ import React__default, { useRef, useCallback, useEffect, useMemo } from 'react';
|
|
|
3
3
|
import { messageHistoryTheme } from './MessageHistory.theme.js';
|
|
4
4
|
import { Message } from '../../core/Message/Message.js';
|
|
5
5
|
import '../../core/Message/TypeWriter.js';
|
|
6
|
+
import '../../core/Message/MessageBody.js';
|
|
6
7
|
import { cn } from '../../../utils/cn.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -1,43 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useState, useRef, useId, useEffect, useCallback } from 'react';
|
|
3
3
|
import { AnimatePresence, motion } from 'motion/react';
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
4
|
+
import { cn } from '../../../utils/cn.js';
|
|
5
|
+
import { CloudArrowUpIcon, MicrophoneIcon, PaperClipIcon, LinkIcon, DocumentIcon, XMarkIcon, PlusIcon, AdjustmentsHorizontalIcon, ChevronDownIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
6
|
+
import { StopIcon } from '@heroicons/react/24/solid';
|
|
7
|
+
import { promptInputTheme } from './PromptInput.theme.js';
|
|
8
|
+
import { VoiceRecorder } from './VoiceRecorder.js';
|
|
9
|
+
import { dropzoneContainerVariants, dropzoneChildVariants, dropzoneActionIconVariants, textareaSwapVariants, iconSwapVariants } from './PromptInput.animations.js';
|
|
8
10
|
import { Textarea } from '../../forms/Textarea/Textarea.js';
|
|
9
11
|
import '../../forms/Textarea/Textarea.theme.js';
|
|
10
|
-
import '../../forms/FormLabel/FormLabel.js';
|
|
11
|
-
import '../../forms/Radio/Radio.js';
|
|
12
|
-
import '../../forms/Checkbox/Checkbox.js';
|
|
13
|
-
import '../../forms/Switch/Switch.js';
|
|
14
|
-
import '../../forms/DatePicker/DatePicker.js';
|
|
15
|
-
import '../../forms/DatePicker/DatePicker.theme.js';
|
|
16
|
-
import '../../forms/FileUpload/FileUpload.js';
|
|
17
|
-
import '../../forms/TimePicker/TimePicker.js';
|
|
18
|
-
import { CloudArrowUpIcon, MicrophoneIcon, PaperClipIcon, LinkIcon, DocumentIcon, XMarkIcon, PlusIcon, AdjustmentsHorizontalIcon, ChevronDownIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
19
|
-
import { cn } from '../../../utils/cn.js';
|
|
20
|
-
import 'react-dom';
|
|
21
|
-
import '../../core/Accordion/Accordion.js';
|
|
22
|
-
import '../../core/AlertDialog/AlertDialog.js';
|
|
23
|
-
import '../../core/AspectRatio/AspectRatio.js';
|
|
24
|
-
import '../../core/Avatar/Avatar.js';
|
|
25
|
-
import '../../core/AvatarGroup/AvatarGroup.js';
|
|
26
|
-
import '../../core/Badge/Badge.js';
|
|
27
|
-
import '../../core/Breadcrumbs/Breadcrumbs.js';
|
|
28
|
-
import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
|
|
29
|
-
import { Button } from '../../core/Button/Button.js';
|
|
30
|
-
import '../../core/ButtonGroup/ButtonGroup.js';
|
|
31
|
-
import '../../core/ButtonGroup/ButtonGroupSeparator.js';
|
|
32
|
-
import '../../core/ButtonGroup/ButtonGroupText.js';
|
|
33
|
-
import '../../core/Calendar/Calendar.js';
|
|
34
|
-
import '../../core/Calendar/CalendarMini/CalendarMini.js';
|
|
35
|
-
import '../../core/Card/Card.js';
|
|
36
|
-
import '../../core/CardStack/CardStack.js';
|
|
37
|
-
import '../../core/Carousel/Carousel.js';
|
|
38
|
-
import '../../core/CommandPalette/CommandPalette.js';
|
|
39
|
-
import '../../core/Separator/Separator.js';
|
|
40
|
-
import '../../core/Drawer/Drawer.js';
|
|
41
12
|
import { Dropdown } from '../../core/Dropdown/Dropdown.js';
|
|
42
13
|
import '../../core/Dropdown/DropdownTrigger.js';
|
|
43
14
|
import '../../core/Dropdown/DropdownMenu.js';
|
|
@@ -45,96 +16,7 @@ import '../../core/Dropdown/DropdownItem.js';
|
|
|
45
16
|
import '../../core/Dropdown/DropdownSection.js';
|
|
46
17
|
import '../../core/Dropdown/DropdownSeparator.js';
|
|
47
18
|
import '../../core/Dropdown/Dropdown.theme.js';
|
|
48
|
-
import '../../core/
|
|
49
|
-
import '../../core/MenuItem/MenuItem.js';
|
|
50
|
-
import '../../core/Link/Link.js';
|
|
51
|
-
import '../../core/Loader/Loader.js';
|
|
52
|
-
import '../../core/Modal/Modal.js';
|
|
53
|
-
import '../../core/ModalStack/ModalStack.js';
|
|
54
|
-
import '../../core/PageHeading/PageHeading.js';
|
|
55
|
-
import '../../core/Pagination/Pagination.js';
|
|
56
|
-
import '../../core/Popover/Popover.js';
|
|
57
|
-
import '../../core/Popover/PopoverContext.js';
|
|
58
|
-
import '../../core/Progress/Progress.js';
|
|
59
|
-
import '../../core/Rating/Rating.js';
|
|
60
|
-
import '../../core/ScrollArea/ScrollArea.js';
|
|
61
|
-
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
62
|
-
import '../../core/Segmented/Segmented.js';
|
|
63
|
-
import '../../core/Skeleton/Skeleton.js';
|
|
64
|
-
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
65
|
-
import '../../core/Tabs/Tabs.js';
|
|
66
|
-
import '../../core/Tabs/TabsList.js';
|
|
67
|
-
import '../../core/Tabs/TabsTrigger.js';
|
|
68
|
-
import '../../core/Tabs/TabsContent.js';
|
|
69
|
-
import '../../core/Tabs/TabsContext.js';
|
|
70
|
-
import '../../core/Tooltip/Tooltip.js';
|
|
71
|
-
import '../../core/Tooltip/Tooltip.animations.js';
|
|
72
|
-
import '../../core/Tree/Tree.js';
|
|
73
|
-
import '../../core/Tag/Tag.js';
|
|
74
|
-
import '../../core/Alert/Alert.js';
|
|
75
|
-
import '../../core/Toast/Toast.js';
|
|
76
|
-
import '../../core/Toast/ToastProvider.js';
|
|
77
|
-
import { StopIcon } from '@heroicons/react/24/solid';
|
|
78
|
-
import '../../core/Spinner/Spinner.js';
|
|
79
|
-
import '../../core/Message/Message.js';
|
|
80
|
-
import '../../core/Message/TypeWriter.js';
|
|
81
|
-
import '../../core/Empty/Empty.js';
|
|
82
|
-
import '../../core/Masonry/Masonry.js';
|
|
83
|
-
import '../../core/DragDrop/DragDrop.js';
|
|
84
|
-
import '../../core/Sortable/Sortable.js';
|
|
85
|
-
import '../../core/NavItem/NavItem.js';
|
|
86
|
-
import '../../core/Sidebar/Sidebar.js';
|
|
87
|
-
import '../../core/Sidebar/SidebarHeader.js';
|
|
88
|
-
import '../../core/Sidebar/SidebarContent.js';
|
|
89
|
-
import '../../core/Sidebar/SidebarFooter.js';
|
|
90
|
-
import '../../core/Sidebar/SidebarNav.js';
|
|
91
|
-
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
92
|
-
import '../../core/Sidebar/SidebarToggle.js';
|
|
93
|
-
import '../../core/Sidebar/SidebarContext.js';
|
|
94
|
-
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
95
|
-
import '../../core/ContextMenu/ContextMenu.js';
|
|
96
|
-
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
97
|
-
import '../../core/Pill/Pill.js';
|
|
98
|
-
import '../../core/SocialIcon/SocialIcon.js';
|
|
99
|
-
import '../../forms/TimePicker/WheelColumn.js';
|
|
100
|
-
import '../../forms/TimePicker/TimePicker.theme.js';
|
|
101
|
-
import '../../forms/Slider/Slider.js';
|
|
102
|
-
import '../../forms/Slider/Slider.theme.js';
|
|
103
|
-
import '../../forms/Signature/Signature.js';
|
|
104
|
-
import '../../forms/Signature/Signature.theme.js';
|
|
105
|
-
import '../../forms/RichTextEditor/RichTextEditor.js';
|
|
106
|
-
import '../../forms/RichTextEditor/RichTextEditor.theme.js';
|
|
107
|
-
import '../../forms/InputOTP/InputOTP.js';
|
|
108
|
-
import '../../forms/InputOTP/InputOTP.theme.js';
|
|
109
|
-
import '../../forms/InputCreditCard/InputCreditCard.js';
|
|
110
|
-
import '../../forms/InputCreditCard/InputCreditCard.theme.js';
|
|
111
|
-
import '../../forms/InputAddress/InputAddress.js';
|
|
112
|
-
import '../../forms/InputAddress/InputAddress.theme.js';
|
|
113
|
-
import '../../forms/InputDate/InputDate.js';
|
|
114
|
-
import '../../forms/InputCounter/InputCounter.js';
|
|
115
|
-
import '../../forms/InputTag/InputTag.js';
|
|
116
|
-
import '../../forms/InputTag/InputTag.theme.js';
|
|
117
|
-
import '../../forms/Combobox/Combobox.js';
|
|
118
|
-
import '../../forms/Combobox/Combobox.theme.js';
|
|
119
|
-
import '../../forms/ColorPicker/ColorPicker.js';
|
|
120
|
-
import '../../forms/ColorPicker/ColorPickerTrigger.js';
|
|
121
|
-
import '../../forms/ColorPicker/ColorPickerContent.js';
|
|
122
|
-
import '../../forms/ColorPicker/ColorPicker2DCanvas.js';
|
|
123
|
-
import '../../forms/ColorPicker/ColorPickerSwatch.js';
|
|
124
|
-
import '../../forms/ColorPicker/ColorPickerSliders.js';
|
|
125
|
-
import '../../forms/ColorPicker/ColorPickerInput.js';
|
|
126
|
-
import '../../forms/ColorPicker/ColorPickerFormatSelector.js';
|
|
127
|
-
import '../../forms/ColorPicker/ColorPickerEyeDropper.js';
|
|
128
|
-
import '../../forms/ColorPicker/ColorPickerPresets.js';
|
|
129
|
-
import '../../forms/SelectableCard/SelectableCard.js';
|
|
130
|
-
import '../../forms/TransferList/TransferList.js';
|
|
131
|
-
import '../../forms/Mention/Mention.js';
|
|
132
|
-
import '../../forms/Mention/Mention.theme.js';
|
|
133
|
-
import '../../forms/CronInput/CronInput.js';
|
|
134
|
-
import '../../forms/CronInput/CronInput.theme.js';
|
|
135
|
-
import { promptInputTheme } from './PromptInput.theme.js';
|
|
136
|
-
import { VoiceRecorder } from './VoiceRecorder.js';
|
|
137
|
-
import { dropzoneContainerVariants, dropzoneChildVariants, dropzoneActionIconVariants, textareaSwapVariants, iconSwapVariants } from './PromptInput.animations.js';
|
|
19
|
+
import { Button } from '../../core/Button/Button.js';
|
|
138
20
|
|
|
139
21
|
/**
|
|
140
22
|
* Default model options for the model selector
|
|
@@ -3,84 +3,7 @@ import { useState, useRef, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import { motion } from 'motion/react';
|
|
4
4
|
import { PlayIcon, PauseIcon, CheckIcon } from '@heroicons/react/24/outline';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
|
-
import '../../core/Accordion/Accordion.js';
|
|
7
|
-
import '../../core/AlertDialog/AlertDialog.js';
|
|
8
|
-
import '../../core/AspectRatio/AspectRatio.js';
|
|
9
|
-
import '../../core/Avatar/Avatar.js';
|
|
10
|
-
import '../../core/AvatarGroup/AvatarGroup.js';
|
|
11
|
-
import '../../core/Badge/Badge.js';
|
|
12
|
-
import '../../core/Breadcrumbs/Breadcrumbs.js';
|
|
13
|
-
import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
|
|
14
6
|
import { Button } from '../../core/Button/Button.js';
|
|
15
|
-
import '../../core/ButtonGroup/ButtonGroup.js';
|
|
16
|
-
import '../../core/ButtonGroup/ButtonGroupSeparator.js';
|
|
17
|
-
import '../../core/ButtonGroup/ButtonGroupText.js';
|
|
18
|
-
import '../../core/Calendar/Calendar.js';
|
|
19
|
-
import '../../core/Calendar/CalendarMini/CalendarMini.js';
|
|
20
|
-
import '../../core/Card/Card.js';
|
|
21
|
-
import '../../core/CardStack/CardStack.js';
|
|
22
|
-
import '../../core/Carousel/Carousel.js';
|
|
23
|
-
import '../../core/CommandPalette/CommandPalette.js';
|
|
24
|
-
import '../../core/Separator/Separator.js';
|
|
25
|
-
import '../../core/Drawer/Drawer.js';
|
|
26
|
-
import '../../core/Dropdown/Dropdown.js';
|
|
27
|
-
import '../../core/Dropdown/DropdownTrigger.js';
|
|
28
|
-
import '../../core/Dropdown/DropdownMenu.js';
|
|
29
|
-
import '../../core/Dropdown/DropdownItem.js';
|
|
30
|
-
import '../../core/Dropdown/DropdownSection.js';
|
|
31
|
-
import '../../core/Dropdown/DropdownSeparator.js';
|
|
32
|
-
import '../../core/Dropdown/Dropdown.theme.js';
|
|
33
|
-
import '../../core/Kbd/Kbd.js';
|
|
34
|
-
import '../../core/MenuItem/MenuItem.js';
|
|
35
|
-
import '../../core/Link/Link.js';
|
|
36
|
-
import '../../core/Loader/Loader.js';
|
|
37
|
-
import '../../core/Modal/Modal.js';
|
|
38
|
-
import '../../core/ModalStack/ModalStack.js';
|
|
39
|
-
import '../../core/PageHeading/PageHeading.js';
|
|
40
|
-
import '../../core/Pagination/Pagination.js';
|
|
41
|
-
import '../../core/Popover/Popover.js';
|
|
42
|
-
import '../../core/Popover/PopoverContext.js';
|
|
43
|
-
import '../../core/Progress/Progress.js';
|
|
44
|
-
import '../../core/Rating/Rating.js';
|
|
45
|
-
import '../../core/ScrollArea/ScrollArea.js';
|
|
46
|
-
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
47
|
-
import '../../core/Segmented/Segmented.js';
|
|
48
|
-
import '../../core/Skeleton/Skeleton.js';
|
|
49
|
-
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
50
|
-
import '../../core/Tabs/Tabs.js';
|
|
51
|
-
import '../../core/Tabs/TabsList.js';
|
|
52
|
-
import '../../core/Tabs/TabsTrigger.js';
|
|
53
|
-
import '../../core/Tabs/TabsContent.js';
|
|
54
|
-
import '../../core/Tabs/TabsContext.js';
|
|
55
|
-
import '../../core/Tooltip/Tooltip.js';
|
|
56
|
-
import '../../core/Tooltip/Tooltip.animations.js';
|
|
57
|
-
import '../../core/Tree/Tree.js';
|
|
58
|
-
import '../../core/Tag/Tag.js';
|
|
59
|
-
import '../../core/Alert/Alert.js';
|
|
60
|
-
import '../../core/Toast/Toast.js';
|
|
61
|
-
import '../../core/Toast/ToastProvider.js';
|
|
62
|
-
import '@heroicons/react/24/solid';
|
|
63
|
-
import '../../core/Spinner/Spinner.js';
|
|
64
|
-
import '../../core/Message/Message.js';
|
|
65
|
-
import '../../core/Message/TypeWriter.js';
|
|
66
|
-
import '../../core/Empty/Empty.js';
|
|
67
|
-
import '../../core/Masonry/Masonry.js';
|
|
68
|
-
import '../../core/DragDrop/DragDrop.js';
|
|
69
|
-
import '../../core/Sortable/Sortable.js';
|
|
70
|
-
import '../../core/NavItem/NavItem.js';
|
|
71
|
-
import '../../core/Sidebar/Sidebar.js';
|
|
72
|
-
import '../../core/Sidebar/SidebarHeader.js';
|
|
73
|
-
import '../../core/Sidebar/SidebarContent.js';
|
|
74
|
-
import '../../core/Sidebar/SidebarFooter.js';
|
|
75
|
-
import '../../core/Sidebar/SidebarNav.js';
|
|
76
|
-
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
77
|
-
import '../../core/Sidebar/SidebarToggle.js';
|
|
78
|
-
import '../../core/Sidebar/SidebarContext.js';
|
|
79
|
-
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
80
|
-
import '../../core/ContextMenu/ContextMenu.js';
|
|
81
|
-
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
82
|
-
import '../../core/Pill/Pill.js';
|
|
83
|
-
import '../../core/SocialIcon/SocialIcon.js';
|
|
84
7
|
|
|
85
8
|
/**
|
|
86
9
|
* Format seconds into MM:SS display
|
|
@@ -3,6 +3,7 @@ import { useRef, useEffect } from 'react';
|
|
|
3
3
|
import { useStreamingSSE } from '../../../hooks/useStreamingSSE.js';
|
|
4
4
|
import { Message } from '../../core/Message/Message.js';
|
|
5
5
|
import { TypeWriter } from '../../core/Message/TypeWriter.js';
|
|
6
|
+
import '../../core/Message/MessageBody.js';
|
|
6
7
|
import { ErrorDisplay } from './ErrorDisplay.js';
|
|
7
8
|
import { MarkdownRenderer } from './MarkdownRenderer.js';
|
|
8
9
|
import { AnimatedText } from './AnimatedText.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Message } from '../core/Message/Message.js';
|
|
2
2
|
export { messageTheme } from '../core/Message/Message.theme.js';
|
|
3
3
|
import '../core/Message/TypeWriter.js';
|
|
4
|
+
import '../core/Message/MessageBody.js';
|
|
4
5
|
export { MessageHistory } from './MessageHistory/MessageHistory.js';
|
|
5
6
|
export { messageHistoryTheme } from './MessageHistory/MessageHistory.theme.js';
|
|
6
7
|
export { PromptInput } from './PromptInput/PromptInput.js';
|
|
@@ -7,5 +7,5 @@ export declare const Accordion: {
|
|
|
7
7
|
} & {
|
|
8
8
|
Item: React.ForwardRefExoticComponent<import("./Accordion.types").AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Trigger: React.ForwardRefExoticComponent<import("./Accordion.types").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
|
|
10
|
+
Body: React.ForwardRefExoticComponent<import("./Accordion.types").AccordionBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
};
|
|
@@ -3,7 +3,7 @@ import { useContext, createContext, useState, useCallback } from 'react';
|
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
import { accordionTheme } from './Accordion.theme.js';
|
|
5
5
|
import { AccordionTrigger } from './AccordionTrigger.js';
|
|
6
|
-
import {
|
|
6
|
+
import { AccordionBody } from './AccordionBody.js';
|
|
7
7
|
import { AccordionItem } from './AccordionItem.js';
|
|
8
8
|
|
|
9
9
|
// Create context for the main Accordion component
|
|
@@ -50,7 +50,7 @@ AccordionRoot.displayName = "Accordion";
|
|
|
50
50
|
const Accordion = Object.assign(AccordionRoot, {
|
|
51
51
|
Item: AccordionItem,
|
|
52
52
|
Trigger: AccordionTrigger,
|
|
53
|
-
|
|
53
|
+
Body: AccordionBody,
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
export { Accordion, useAccordionContext };
|
|
@@ -9,10 +9,10 @@ const accordionTheme = {
|
|
|
9
9
|
itemStyleStacked: "bg-white border-t border-[var(--color-border)] first-of-type:border-t-0",
|
|
10
10
|
// Trigger styles (shared across variants)
|
|
11
11
|
triggerStyle: "flex w-full gap-3 items-center px-4 py-2.5 text-left font-medium transition-all duration-200 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 text-[var(--color-text-primary)]",
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
12
|
+
// Body styles (shared across variants)
|
|
13
|
+
bodyStyle: "data-[state=closed]:max-h-0 data-[state=open]:max-h-[320px] accordion-content overflow-hidden",
|
|
14
|
+
// Body inner wrapper styles
|
|
15
|
+
bodyInnerStyle: "p-4 pb-2.5 pt-0",
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export { accordionTheme };
|
|
@@ -53,8 +53,8 @@ export interface AccordionContextValue {
|
|
|
53
53
|
theme: AccordionThemeOverrides & {
|
|
54
54
|
baseStyle: string;
|
|
55
55
|
triggerStyle: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
bodyStyle: string;
|
|
57
|
+
bodyInnerStyle: string;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -91,33 +91,38 @@ export interface AccordionTriggerProps extends React.HTMLAttributes<HTMLButtonEl
|
|
|
91
91
|
children: React.ReactNode;
|
|
92
92
|
className?: string;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Override the default indicator (chevron) icon.
|
|
95
|
+
* Set to `null` to hide it entirely — equivalent to `showChevron={false}`.
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
chevron?: React.ReactNode | null;
|
|
97
98
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
99
|
+
* Rotation degrees applied to the chevron icon when open.
|
|
100
|
+
* Default: 45 (for PlusIcon). Use 180 for a chevron-down, 90 for a right-arrow, 0 for none.
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
chevronRotation?: number;
|
|
102
103
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
104
|
+
* Position of the chevron icon.
|
|
105
|
+
* - `"right"` (default): pushed to the far right after children.
|
|
106
|
+
* - `"left"`: appears before children.
|
|
107
|
+
* No effect when `chevron` is explicitly provided.
|
|
108
|
+
* @default "right"
|
|
105
109
|
*/
|
|
106
|
-
|
|
110
|
+
chevronPosition?: "left" | "right";
|
|
107
111
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
112
|
+
* Set to `false` to hide the chevron icon entirely.
|
|
113
|
+
* Equivalent to passing `chevron={null}`.
|
|
114
|
+
* @default true
|
|
110
115
|
*/
|
|
111
|
-
|
|
116
|
+
showChevron?: boolean;
|
|
112
117
|
/**
|
|
113
|
-
* @deprecated Use `
|
|
118
|
+
* @deprecated Use `chevronRotation` instead.
|
|
114
119
|
*/
|
|
115
120
|
iconRotation?: number;
|
|
116
121
|
}
|
|
117
122
|
/**
|
|
118
|
-
*
|
|
123
|
+
* Body props
|
|
119
124
|
*/
|
|
120
|
-
export interface
|
|
125
|
+
export interface AccordionBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
121
126
|
children: React.ReactNode;
|
|
122
127
|
className?: string;
|
|
123
128
|
}
|
|
@@ -128,8 +133,8 @@ export interface AccordionThemeOverrides {
|
|
|
128
133
|
baseStyle?: string;
|
|
129
134
|
baseStyleStacked?: string;
|
|
130
135
|
triggerStyle?: string;
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
bodyStyle?: string;
|
|
137
|
+
bodyInnerStyle?: string;
|
|
133
138
|
itemStyle?: string;
|
|
134
139
|
itemStyleStacked?: string;
|
|
135
140
|
}
|
|
@@ -6,7 +6,7 @@ import { useAccordionItemContext } from './AccordionItem.js';
|
|
|
6
6
|
import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
|
|
7
7
|
import { accordionAnimations, accordionContentAnimations } from './Accordion.animations.js';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const AccordionBody = React__default.forwardRef(({ children, className, ...rest }, ref) => {
|
|
10
10
|
const { theme } = useAccordionContext();
|
|
11
11
|
const { isOpen, contentId, triggerId } = useAccordionItemContext();
|
|
12
12
|
const shouldReduceMotion = useReducedMotion();
|
|
@@ -14,8 +14,8 @@ const AccordionContent = React__default.forwardRef(({ children, className, ...re
|
|
|
14
14
|
const instantTransition = shouldReduceMotion ? { duration: 0 } : undefined;
|
|
15
15
|
// Filter out conflicting props to avoid type issues
|
|
16
16
|
const { onDrag, onDragEnd, onDragStart, onAnimationStart, onAnimationEnd, onTransitionEnd, onTransitionStart, ...safeProps } = rest;
|
|
17
|
-
return (jsx(AnimatePresence, { initial: false, children: isOpen && (jsx(motion.div, { ref: ref, id: contentId, role: "region", "aria-labelledby": triggerId, className: theme === null || theme === void 0 ? void 0 : theme.
|
|
17
|
+
return (jsx(AnimatePresence, { initial: false, children: isOpen && (jsx(motion.div, { ref: ref, id: contentId, role: "region", "aria-labelledby": triggerId, className: theme === null || theme === void 0 ? void 0 : theme.bodyStyle, "data-state": isOpen ? "open" : "closed", "aria-hidden": !isOpen, initial: "collapsed", animate: "open", exit: "collapsed", variants: accordionAnimations, transition: instantTransition, ...safeProps, children: jsx(motion.div, { className: cn(theme === null || theme === void 0 ? void 0 : theme.bodyInnerStyle, className), variants: accordionContentAnimations, initial: "collapsed", animate: "open", exit: "collapsed", transition: instantTransition, children: children }) })) }));
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
AccordionBody.displayName = "Accordion.Body";
|
|
20
20
|
|
|
21
|
-
export {
|
|
21
|
+
export { AccordionBody };
|
|
@@ -9,7 +9,7 @@ const AccordionItemContext = createContext(undefined);
|
|
|
9
9
|
const useAccordionItemContext = () => {
|
|
10
10
|
const ctx = useContext(AccordionItemContext);
|
|
11
11
|
if (!ctx)
|
|
12
|
-
throw new Error("Accordion.Trigger and Accordion.
|
|
12
|
+
throw new Error("Accordion.Trigger and Accordion.Body must be used within Accordion.Item");
|
|
13
13
|
return ctx;
|
|
14
14
|
};
|
|
15
15
|
const AccordionItem = React__default.forwardRef(({ children, className, value, ...props }, ref) => {
|
|
@@ -7,17 +7,26 @@ import { motion } from 'motion/react';
|
|
|
7
7
|
import { PlusIcon } from '@heroicons/react/24/outline';
|
|
8
8
|
import { createTriggerIconVariants } from './Accordion.animations.js';
|
|
9
9
|
|
|
10
|
-
const AccordionTrigger = React__default.forwardRef(({ children, className,
|
|
10
|
+
const AccordionTrigger = React__default.forwardRef(({ children, className, chevron, chevronRotation, iconRotation, chevronPosition = "right", showChevron = true, ...props }, ref) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const { theme } = useAccordionContext();
|
|
13
13
|
const { isOpen, toggle, triggerId, contentId } = useAccordionItemContext();
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const resolvedChevronRotation = (_a = chevronRotation !== null && chevronRotation !== void 0 ? chevronRotation : iconRotation) !== null && _a !== void 0 ? _a : 45;
|
|
15
|
+
// Resolve the indicator icon, respecting showChevron and chevron overrides
|
|
16
|
+
const defaultChevronIcon = jsx(PlusIcon, { className: "size-4", strokeWidth: 2 });
|
|
17
|
+
const resolvedChevron = !showChevron || chevron === null
|
|
16
18
|
? null
|
|
17
|
-
:
|
|
18
|
-
?
|
|
19
|
-
:
|
|
20
|
-
|
|
19
|
+
: chevron !== undefined
|
|
20
|
+
? chevron
|
|
21
|
+
: chevronPosition === "left"
|
|
22
|
+
? null // rendered in the left slot instead
|
|
23
|
+
: defaultChevronIcon;
|
|
24
|
+
// When chevronPosition="left", render the default animated chevron before children
|
|
25
|
+
const useDefaultOnLeft = showChevron && chevron === null
|
|
26
|
+
? false
|
|
27
|
+
: showChevron && chevronPosition === "left" && chevron === undefined;
|
|
28
|
+
const animatedChevron = (rotation, extraClass) => (jsx(motion.div, { initial: false, animate: isOpen ? "open" : "closed", variants: createTriggerIconVariants(rotation), className: cn("flex items-center justify-center shrink-0", extraClass), children: defaultChevronIcon }));
|
|
29
|
+
return (jsxs("button", { ref: ref, type: "button", id: triggerId, className: cn(theme === null || theme === void 0 ? void 0 : theme.triggerStyle, className), "aria-expanded": isOpen, "aria-controls": contentId, "data-state": isOpen ? "open" : "closed", onClick: toggle, ...props, children: [useDefaultOnLeft && animatedChevron(resolvedChevronRotation), children, resolvedChevron && (jsx(motion.div, { initial: false, animate: isOpen ? "open" : "closed", variants: createTriggerIconVariants(resolvedChevronRotation), className: "flex items-center justify-center shrink-0 ml-auto", children: resolvedChevron }))] }));
|
|
21
30
|
});
|
|
22
31
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
23
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Accordion } from "./Accordion";
|
|
2
|
-
import { AccordionProps, AccordionTriggerProps,
|
|
2
|
+
import { AccordionProps, AccordionTriggerProps, AccordionBodyProps, AccordionItemProps, AccordionContextValue, AccordionItemContextValue, AccordionThemeOverrides } from "./Accordion.types";
|
|
3
3
|
export { Accordion };
|
|
4
|
-
export type { AccordionProps, AccordionItemProps, AccordionTriggerProps,
|
|
4
|
+
export type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionBodyProps, AccordionContextValue, AccordionItemContextValue, AccordionThemeOverrides, };
|
|
@@ -33,7 +33,11 @@ const Alert = React__default.forwardRef(({ variant = "default", color = "primary
|
|
|
33
33
|
const IconComponent = defaultIcons[color];
|
|
34
34
|
return (jsx("div", { className: "flex-shrink-0 w-6 h-6 mt-1", "aria-hidden": "true", children: jsx(IconComponent, { className: cn("w-6 h-6", iconColor) }) }));
|
|
35
35
|
};
|
|
36
|
-
const alertNode = (jsxs("div", { ref: ref, className: cn(alertTheme.baseStyle, alertTheme.variants[variant], className), role: "alert", "aria-live": "assertive", "aria-atomic": "true", ...props, children: [renderIconOrAvatar(), jsxs("div", { className: `flex-1 min-w-0 ${showDismiss ? "mr-5" : ""}`, children: [title && (
|
|
36
|
+
const alertNode = (jsxs("div", { ref: ref, className: cn(alertTheme.baseStyle, alertTheme.variants[variant], className), role: "alert", "aria-live": "assertive", "aria-atomic": "true", ...props, children: [renderIconOrAvatar(), jsxs("div", { className: `flex-1 min-w-0 ${showDismiss ? "mr-5" : ""}`, children: [title && (typeof title === 'string'
|
|
37
|
+
? jsx("div", { className: cn("font-semibold text-[var(--color-text-primary)]"), children: title })
|
|
38
|
+
: title), subtitle && (typeof subtitle === 'string'
|
|
39
|
+
? jsx("div", { className: "text-[var(--color-text-secondary)]/90 mt-1", children: subtitle })
|
|
40
|
+
: subtitle), children && jsx("div", { className: "mt-2", children: children }), actions && (jsx("div", { className: "flex items-center gap-2 mt-6", children: actions }))] }), showDismiss && (jsx(Button, { variant: "link", color: "neutral", size: "sm", iconOnly: true, onClick: handleDismiss, "aria-label": "Dismiss alert", className: "rounded-full absolute top-2 right-2 flex-shrink-0", children: jsx(XMarkIcon, { className: "size-4", strokeWidth: 2 }) }))] }));
|
|
37
41
|
if (darkMode) {
|
|
38
42
|
return jsx("div", { className: "dark", children: alertNode });
|
|
39
43
|
}
|
|
@@ -23,15 +23,15 @@ export interface AlertTheme {
|
|
|
23
23
|
dismissible: string;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
27
27
|
/** Visual variant */
|
|
28
28
|
variant?: AlertVariant;
|
|
29
29
|
/** Semantic color */
|
|
30
30
|
color?: AlertColor;
|
|
31
31
|
/** The main title/message of the alert */
|
|
32
|
-
title?:
|
|
32
|
+
title?: ReactNode;
|
|
33
33
|
/** Additional subtitle text */
|
|
34
|
-
subtitle?:
|
|
34
|
+
subtitle?: ReactNode;
|
|
35
35
|
/** Whether the alert can be dismissed */
|
|
36
36
|
dismissible?: boolean;
|
|
37
37
|
/**
|
|
@@ -42,8 +42,10 @@ const Breadcrumbs = ({ items, separator, maxItems = 4, variant = "default", clas
|
|
|
42
42
|
// Render individual breadcrumb item
|
|
43
43
|
const renderItem = (item, index, isLast) => {
|
|
44
44
|
const isCurrentPage = isLast || !item.href;
|
|
45
|
-
const itemContent = (jsxs(Fragment, { children: [showIcons && item.iconStart && (jsx("span", { className: "mr-1.5 flex-shrink-0", children: item.iconStart })), item.label
|
|
46
|
-
|
|
45
|
+
const itemContent = (jsxs(Fragment, { children: [showIcons && item.iconStart && (jsx("span", { className: "mr-1.5 flex-shrink-0", children: item.iconStart })), typeof item.label === 'string'
|
|
46
|
+
? jsx("span", { children: item.label })
|
|
47
|
+
: item.label] }));
|
|
48
|
+
return (jsx("span", { className: "flex items-center text-base", children: isCurrentPage ? (jsx("span", { className: cn("flex items-center", theme.current), "aria-current": "page", children: itemContent })) : (jsx("a", { href: item.href, className: cn("flex items-center", theme.link), "aria-label": typeof item.label === 'string' ? `Navigate to ${item.label}` : undefined, children: itemContent })) }, `breadcrumb-${index}`));
|
|
47
49
|
};
|
|
48
50
|
// Render separator
|
|
49
51
|
const renderSeparator = (index) => {
|
|
@@ -60,7 +62,9 @@ const Breadcrumbs = ({ items, separator, maxItems = 4, variant = "default", clas
|
|
|
60
62
|
window.location.href = selectedItem.href;
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
|
-
return (jsxs(Dropdown, { isOpen: isEllipsisOpen, onOpenChange: setIsEllipsisOpen, onAction: handleEllipsisAction, placement: "bottom-start", offset: 8, children: [jsx(Dropdown.Trigger, { children: jsx("button", { type: "button", className: cn(theme.ellipsis), "aria-label": `Navigate to one of ${hiddenItems.length} hidden breadcrumbs`, children: "..." }) }), jsx(Dropdown.Menu, { "aria-label": "Hidden breadcrumb items", children: hiddenItems.map((item, index) => (jsx(Dropdown.Item, { itemKey: `hidden-${index}`, startContent: showIcons && item.iconStart, children: item.label
|
|
65
|
+
return (jsxs(Dropdown, { isOpen: isEllipsisOpen, onOpenChange: setIsEllipsisOpen, onAction: handleEllipsisAction, placement: "bottom-start", offset: 8, children: [jsx(Dropdown.Trigger, { children: jsx("button", { type: "button", className: cn(theme.ellipsis), "aria-label": `Navigate to one of ${hiddenItems.length} hidden breadcrumbs`, children: "..." }) }), jsx(Dropdown.Menu, { "aria-label": "Hidden breadcrumb items", children: hiddenItems.map((item, index) => (jsx(Dropdown.Item, { itemKey: `hidden-${index}`, startContent: showIcons && item.iconStart, children: typeof item.label === 'string'
|
|
66
|
+
? jsx("span", { children: item.label })
|
|
67
|
+
: item.label }, `hidden-${index}`))) })] }, "ellipsis"));
|
|
64
68
|
};
|
|
65
69
|
// Build the breadcrumb elements
|
|
66
70
|
const breadcrumbElements = [];
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
*/
|
|
5
5
|
export interface BreadcrumbItem {
|
|
6
6
|
/** The display text for the breadcrumb item */
|
|
7
|
-
label:
|
|
7
|
+
label: React.ReactNode;
|
|
8
8
|
/** Optional href for navigation. If not provided, item is treated as current page */
|
|
9
9
|
href?: string;
|
|
10
10
|
/** Optional icon to display at the start (before the label) */
|
|
@@ -59,13 +59,7 @@ const Button = React__default.forwardRef(({ children, className = "", iconOnly =
|
|
|
59
59
|
console.error("Error in button click handler:", error);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
}, [
|
|
63
|
-
onClick,
|
|
64
|
-
isDisabled,
|
|
65
|
-
enableRipple,
|
|
66
|
-
shouldReduceMotion,
|
|
67
|
-
createRipple,
|
|
68
|
-
]);
|
|
62
|
+
}, [onClick, isDisabled, enableRipple, shouldReduceMotion, createRipple]);
|
|
69
63
|
// Compute theme classes (direct computation - faster than useMemo)
|
|
70
64
|
const sizeClasses = ((_b = (_a = buttonTheme.sizes) === null || _a === void 0 ? void 0 : _a[size]) === null || _b === void 0 ? void 0 : _b[iconOnly ? "iconOnly" : resolvedVariant === "link" ? "link" : "default"]) || "";
|
|
71
65
|
const colorClasses = ((_c = buttonTheme.variantColors[resolvedVariant]) === null || _c === void 0 ? void 0 : _c[resolvedColor]) || "";
|
|
@@ -112,7 +106,7 @@ const Button = React__default.forwardRef(({ children, className = "", iconOnly =
|
|
|
112
106
|
}, [buttonRef]);
|
|
113
107
|
return (jsxs(motion.button, { ...restProps /* React drag events conflict with motion drag events */, ...animationProps, ref: mergedRef, type: "button", className: cn(buttonTheme.baseStyle, colorClasses, variantClasses, sizeClasses, blockStyle, stateClasses, darkMode && "dark", className), disabled: isDisabled, "data-state": state, "data-color": resolvedColor, "data-variant": resolvedVariant, "data-size": size, "data-icon-only": iconOnly ? "true" : "false", "data-block": block ? "true" : "false", "aria-disabled": isDisabled || undefined, "aria-invalid": isError || undefined, "aria-label": ariaLabel, onClick: handleClick, children: [showReflection &&
|
|
114
108
|
resolvedVariant !== "link" &&
|
|
115
|
-
resolvedVariant !== "outline" && (jsx("div", { className: "absolute top-0.25 right-0.25 left-0.25 h-3
|
|
109
|
+
resolvedVariant !== "outline" && (jsx("div", { className: "absolute top-0.25 right-0.25 left-0.25 h-3 border-t-[0.5px] border-white/40 rounded-t-[calc(var(--button-radius)-1.25px)] opacity-60" })), isLoading && (jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: jsx(Spinner, { size: "sm", color: color, className: spinnerClassName }) })), jsx("span", { className: cn("inline-flex items-center gap-2 whitespace-nowrap", isLoading && "opacity-0"), children: children }), enableRipple &&
|
|
116
110
|
ripples.map((ripple) => {
|
|
117
111
|
const animation = getRippleAnimation(effect, ripple, rippleScale);
|
|
118
112
|
return (jsx(motion.span, { initial: animation.initial, animate: animation.animate, transition: animation.transition, className: cn("absolute rounded-full size-5 pointer-events-none ", animation.className, rippleClassName ||
|