@skalar-saas/design-system 0.1.67
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 +68 -0
- package/dist/design-system.css +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useDebounce.d.ts +7 -0
- package/dist/index-CVAu6nrM.cjs +15 -0
- package/dist/index-CVAu6nrM.cjs.map +1 -0
- package/dist/index-D9hMGhK3.js +6790 -0
- package/dist/index-D9hMGhK3.js.map +1 -0
- package/dist/index.d.ts +130 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +11508 -0
- package/dist/index.mjs.map +1 -0
- package/dist/layout/Container/Container.d.ts +62 -0
- package/dist/layout/Container/index.d.ts +2 -0
- package/dist/layout/PanelLayout/Panel.d.ts +20 -0
- package/dist/layout/PanelLayout/PanelContext.d.ts +10 -0
- package/dist/layout/PanelLayout/PanelLayout.d.ts +28 -0
- package/dist/layout/PanelLayout/PanelLayout.types.d.ts +146 -0
- package/dist/layout/PanelLayout/PanelMain.d.ts +19 -0
- package/dist/layout/PanelLayout/index.d.ts +6 -0
- package/dist/layout/PanelLayout/panelUtils.d.ts +74 -0
- package/dist/layout/PanelLayout/usePanelState.d.ts +25 -0
- package/dist/layout/Section/Section.d.ts +20 -0
- package/dist/layout/Section/index.d.ts +2 -0
- package/dist/layout/SplitPanelLayout/SplitPanelLayout.d.ts +57 -0
- package/dist/layout/SplitPanelLayout/index.d.ts +2 -0
- package/dist/layout/constants.d.ts +348 -0
- package/dist/layout/index.d.ts +31 -0
- package/dist/shared/icons/AICommentaryIcon.d.ts +11 -0
- package/dist/shared/icons/AIMessage.d.ts +2 -0
- package/dist/shared/icons/Add2Icon.d.ts +12 -0
- package/dist/shared/icons/AddIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowNarrowDownIcon.d.ts +6 -0
- package/dist/shared/icons/BookOutlined.d.ts +10 -0
- package/dist/shared/icons/Box2Icon.d.ts +6 -0
- package/dist/shared/icons/BoxIcon.d.ts +11 -0
- package/dist/shared/icons/CalendarIcon.d.ts +11 -0
- package/dist/shared/icons/CalendarIcon2.d.ts +12 -0
- package/dist/shared/icons/ChatIcon.d.ts +11 -0
- package/dist/shared/icons/ChevronDownIcon.d.ts +6 -0
- package/dist/shared/icons/ChevronUpIcon.d.ts +6 -0
- package/dist/shared/icons/CircleIcon.d.ts +6 -0
- package/dist/shared/icons/CopyIcon.d.ts +12 -0
- package/dist/shared/icons/DataArrowsOutlined.d.ts +10 -0
- package/dist/shared/icons/Edit2Icon.d.ts +12 -0
- package/dist/shared/icons/EyeIcon.d.ts +12 -0
- package/dist/shared/icons/EyeOffIcon.d.ts +12 -0
- package/dist/shared/icons/FilterFunnel02Icon.d.ts +6 -0
- package/dist/shared/icons/FlashIcon.d.ts +12 -0
- package/dist/shared/icons/GridIcon.d.ts +12 -0
- package/dist/shared/icons/InfoIcon.d.ts +12 -0
- package/dist/shared/icons/LayerIcon.d.ts +12 -0
- package/dist/shared/icons/LeftArrowIcon.d.ts +5 -0
- package/dist/shared/icons/MaximizeIcon.d.ts +12 -0
- package/dist/shared/icons/MessageProgrammingOutlined.d.ts +10 -0
- package/dist/shared/icons/MoreIcon.d.ts +12 -0
- package/dist/shared/icons/PlusCircleIcon.d.ts +6 -0
- package/dist/shared/icons/ProgrammingArrowsOutlined.d.ts +10 -0
- package/dist/shared/icons/QuestionCircle.d.ts +11 -0
- package/dist/shared/icons/RightArrowIcon.d.ts +5 -0
- package/dist/shared/icons/ShareIcon.d.ts +6 -0
- package/dist/shared/icons/SkalarLogo.d.ts +13 -0
- package/dist/shared/icons/SkalarLogoNoText.d.ts +13 -0
- package/dist/shared/icons/SlashIcon.d.ts +5 -0
- package/dist/shared/icons/SliderPointerDown.d.ts +10 -0
- package/dist/shared/icons/SliderPointerUp.d.ts +10 -0
- package/dist/shared/icons/SliderThumbIcon.d.ts +10 -0
- package/dist/shared/icons/StraightInfoIcon.d.ts +11 -0
- package/dist/shared/icons/TrashIcon.d.ts +12 -0
- package/dist/shared/icons/UnionIcon.d.ts +12 -0
- package/dist/shared/icons/UploadImageIcon.d.ts +10 -0
- package/dist/shared/icons/VideoPlayOutlined.d.ts +10 -0
- package/dist/shared/icons/XMark.d.ts +11 -0
- package/dist/shared/icons/XMarkAlert.d.ts +11 -0
- package/dist/shared/icons/index.d.ts +83 -0
- package/dist/shared/ui/Alert/Alert.d.ts +95 -0
- package/dist/shared/ui/Alert/index.d.ts +1 -0
- package/dist/shared/ui/AttachmentMessage/AttachmentMessage.d.ts +29 -0
- package/dist/shared/ui/AttachmentMessage/index.d.ts +1 -0
- package/dist/shared/ui/AuthActionWidget/AuthActionWidget.d.ts +18 -0
- package/dist/shared/ui/AuthActionWidget/index.d.ts +2 -0
- package/dist/shared/ui/AuthFormWidget/AuthFormWidget.d.ts +27 -0
- package/dist/shared/ui/AuthFormWidget/index.d.ts +2 -0
- package/dist/shared/ui/AuthSocialOptionsWidget/AuthSocialOptionsWidget.d.ts +25 -0
- package/dist/shared/ui/AuthSocialOptionsWidget/index.d.ts +2 -0
- package/dist/shared/ui/Avatar/Avatar.d.ts +38 -0
- package/dist/shared/ui/Avatar/index.d.ts +1 -0
- package/dist/shared/ui/AvatarGroup/AvatarGroup.d.ts +39 -0
- package/dist/shared/ui/AvatarGroup/index.d.ts +1 -0
- package/dist/shared/ui/Badge/Badge.d.ts +40 -0
- package/dist/shared/ui/Badge/index.d.ts +1 -0
- package/dist/shared/ui/BreadCrumb/BreadCrumb.d.ts +12 -0
- package/dist/shared/ui/BreadCrumb/index.d.ts +1 -0
- package/dist/shared/ui/Button/Button.d.ts +47 -0
- package/dist/shared/ui/Button/index.d.ts +1 -0
- package/dist/shared/ui/ButtonDropdown/ButtonDropdown.d.ts +53 -0
- package/dist/shared/ui/ButtonDropdown/index.d.ts +1 -0
- package/dist/shared/ui/ButtonGroup/ButtonGroup.d.ts +39 -0
- package/dist/shared/ui/ButtonGroup/index.d.ts +1 -0
- package/dist/shared/ui/Card/Card.d.ts +46 -0
- package/dist/shared/ui/Card/index.d.ts +2 -0
- package/dist/shared/ui/CardAction/CardAction.d.ts +28 -0
- package/dist/shared/ui/CardAction/index.d.ts +2 -0
- package/dist/shared/ui/ChatCollapsibleCheck/ChatCollapsibleCheck.d.ts +54 -0
- package/dist/shared/ui/ChatCollapsibleCheck/index.d.ts +2 -0
- package/dist/shared/ui/ChatCollapsibleContainer/ChatCollapsibleContainer.d.ts +32 -0
- package/dist/shared/ui/ChatCollapsibleContainer/index.d.ts +2 -0
- package/dist/shared/ui/ChatCollapsibleDialog/ChatCollapsibleDialog.d.ts +43 -0
- package/dist/shared/ui/ChatCollapsibleDialog/index.d.ts +2 -0
- package/dist/shared/ui/ChatCommandList/ChatCommandList.d.ts +78 -0
- package/dist/shared/ui/ChatCommandList/index.d.ts +2 -0
- package/dist/shared/ui/ChatCommandListItem/ChatCommandListItem.d.ts +88 -0
- package/dist/shared/ui/ChatCommandListItem/index.d.ts +2 -0
- package/dist/shared/ui/ChatHeader/ChatHeader.d.ts +38 -0
- package/dist/shared/ui/ChatHeader/index.d.ts +1 -0
- package/dist/shared/ui/ChatHistorial/ChatHistorial.d.ts +49 -0
- package/dist/shared/ui/ChatHistorial/index.d.ts +2 -0
- package/dist/shared/ui/ChatHistorialItem/ChatHistorialItem.d.ts +33 -0
- package/dist/shared/ui/ChatHistorialItem/index.d.ts +2 -0
- package/dist/shared/ui/ChatInputText/ChatInputText.d.ts +36 -0
- package/dist/shared/ui/ChatInputText/index.d.ts +1 -0
- package/dist/shared/ui/ChatMessage/ChatMessage.d.ts +27 -0
- package/dist/shared/ui/ChatMessage/index.d.ts +2 -0
- package/dist/shared/ui/ChatMessageOptions/ChatMessageOptions.d.ts +30 -0
- package/dist/shared/ui/ChatMessageOptions/index.d.ts +2 -0
- package/dist/shared/ui/ChatPanel/ChatPanel.d.ts +57 -0
- package/dist/shared/ui/ChatPanel/ChatPanel.types.d.ts +171 -0
- package/dist/shared/ui/ChatPanel/index.d.ts +2 -0
- package/dist/shared/ui/ChatTypingIndicator/ChatTypingIndicator.d.ts +17 -0
- package/dist/shared/ui/ChatTypingIndicator/index.d.ts +1 -0
- package/dist/shared/ui/Checkbox/Checkbox.d.ts +26 -0
- package/dist/shared/ui/Checkbox/index.d.ts +1 -0
- package/dist/shared/ui/Chip/Chip.d.ts +35 -0
- package/dist/shared/ui/Chip/index.d.ts +1 -0
- package/dist/shared/ui/ColorPalette/ColorPalette.d.ts +9 -0
- package/dist/shared/ui/ColumnHandler/ColumnHandler.d.ts +17 -0
- package/dist/shared/ui/ColumnHandler/PanelHandle.d.ts +32 -0
- package/dist/shared/ui/ColumnHandler/index.d.ts +4 -0
- package/dist/shared/ui/ComboBox/ComboBox.d.ts +69 -0
- package/dist/shared/ui/ComboBox/index.d.ts +1 -0
- package/dist/shared/ui/ContextualMenu/ContextualMenu.d.ts +47 -0
- package/dist/shared/ui/ContextualMenu/index.d.ts +2 -0
- package/dist/shared/ui/DateRangePicker/DateRangePicker.d.ts +47 -0
- package/dist/shared/ui/DateRangePicker/index.d.ts +1 -0
- package/dist/shared/ui/Divider/Divider.d.ts +8 -0
- package/dist/shared/ui/Divider/index.d.ts +1 -0
- package/dist/shared/ui/DragAndDropListItem/DragAndDropListItem.d.ts +54 -0
- package/dist/shared/ui/DragAndDropListItem/index.d.ts +2 -0
- package/dist/shared/ui/DropMenu/DropMenu.d.ts +58 -0
- package/dist/shared/ui/DropMenu/index.d.ts +1 -0
- package/dist/shared/ui/DropZone/DropZone.d.ts +47 -0
- package/dist/shared/ui/DropZone/index.d.ts +2 -0
- package/dist/shared/ui/Dropdown/Dropdown.d.ts +66 -0
- package/dist/shared/ui/Dropdown/index.d.ts +1 -0
- package/dist/shared/ui/DropdownMenu/DropdownMenu.d.ts +37 -0
- package/dist/shared/ui/ErrorBoundary/ErrorBoundary.d.ts +46 -0
- package/dist/shared/ui/ErrorBoundary/index.d.ts +2 -0
- package/dist/shared/ui/ErrorState/ErrorState.d.ts +51 -0
- package/dist/shared/ui/ErrorState/index.d.ts +2 -0
- package/dist/shared/ui/FloatingBar/FloatingBar.d.ts +92 -0
- package/dist/shared/ui/FloatingBar/index.d.ts +1 -0
- package/dist/shared/ui/FormFieldGroup/FormFieldGroup.d.ts +9 -0
- package/dist/shared/ui/FormFieldGroup/index.d.ts +2 -0
- package/dist/shared/ui/GridDraggableItem/GridDraggableItem.d.ts +45 -0
- package/dist/shared/ui/GridDraggableItem/index.d.ts +2 -0
- package/dist/shared/ui/Header/Header.d.ts +36 -0
- package/dist/shared/ui/Header/index.d.ts +2 -0
- package/dist/shared/ui/Header/useCalculateHeaderWidths.d.ts +31 -0
- package/dist/shared/ui/HeaderTabs/HeaderTabs.d.ts +36 -0
- package/dist/shared/ui/HeaderTabs/index.d.ts +2 -0
- package/dist/shared/ui/Icon/Icon.d.ts +37 -0
- package/dist/shared/ui/Icon/index.d.ts +1 -0
- package/dist/shared/ui/ImageUploader/ImageUploader.d.ts +38 -0
- package/dist/shared/ui/ImageUploader/index.d.ts +1 -0
- package/dist/shared/ui/InfoLabel/InfoLabel.d.ts +28 -0
- package/dist/shared/ui/InfoLabel/index.d.ts +2 -0
- package/dist/shared/ui/InputField/InputField.d.ts +55 -0
- package/dist/shared/ui/InputField/index.d.ts +1 -0
- package/dist/shared/ui/InputSearch/InputSearch.d.ts +44 -0
- package/dist/shared/ui/InputSearch/index.d.ts +1 -0
- package/dist/shared/ui/Kbd/Kbd.d.ts +8 -0
- package/dist/shared/ui/Kbd/index.d.ts +2 -0
- package/dist/shared/ui/LabelIcon/LabelIcon.d.ts +26 -0
- package/dist/shared/ui/LabelIcon/index.d.ts +2 -0
- package/dist/shared/ui/LabelWithIcon/LabelWithIcon.d.ts +27 -0
- package/dist/shared/ui/LabelWithIcon/index.d.ts +1 -0
- package/dist/shared/ui/LabelWithTooltip/LabelWithTooltip.d.ts +41 -0
- package/dist/shared/ui/LabelWithTooltip/index.d.ts +1 -0
- package/dist/shared/ui/Link/Link.d.ts +39 -0
- package/dist/shared/ui/Link/index.d.ts +1 -0
- package/dist/shared/ui/ListItem/ListItem.d.ts +72 -0
- package/dist/shared/ui/ListItem/index.d.ts +2 -0
- package/dist/shared/ui/Modal/Modal.d.ts +203 -0
- package/dist/shared/ui/Modal/index.d.ts +1 -0
- package/dist/shared/ui/ModuleCard/ModuleCard.d.ts +51 -0
- package/dist/shared/ui/ModuleCard/index.d.ts +1 -0
- package/dist/shared/ui/ModuleFieldItem/ModuleFieldItem.d.ts +53 -0
- package/dist/shared/ui/ModuleFieldItem/index.d.ts +1 -0
- package/dist/shared/ui/PanelHeader/PanelHeader.d.ts +37 -0
- package/dist/shared/ui/PanelHeader/index.d.ts +1 -0
- package/dist/shared/ui/PasswordResetWidget/PasswordResetWidget.d.ts +19 -0
- package/dist/shared/ui/PasswordResetWidget/index.d.ts +2 -0
- package/dist/shared/ui/ProductIcon/ProductIcon.d.ts +25 -0
- package/dist/shared/ui/ProductIcon/index.d.ts +1 -0
- package/dist/shared/ui/Progress/Progress.d.ts +29 -0
- package/dist/shared/ui/Progress/index.d.ts +1 -0
- package/dist/shared/ui/ProgressBar/ProgressBar.d.ts +21 -0
- package/dist/shared/ui/ProgressBar/index.d.ts +1 -0
- package/dist/shared/ui/ProgressCircle/ProgressCircle.d.ts +44 -0
- package/dist/shared/ui/ProgressCircle/index.d.ts +1 -0
- package/dist/shared/ui/ProgressCustomTooltip/ProgressCustomTooltip.d.ts +47 -0
- package/dist/shared/ui/ProgressCustomTooltip/index.d.ts +1 -0
- package/dist/shared/ui/ProgressTracker/ProgressTracker.d.ts +36 -0
- package/dist/shared/ui/ProgressTracker/index.d.ts +1 -0
- package/dist/shared/ui/ProjectActionCard/ProjectActionCard.d.ts +23 -0
- package/dist/shared/ui/ProjectActionCard/index.d.ts +2 -0
- package/dist/shared/ui/ProjectCard/ProjectCard.d.ts +46 -0
- package/dist/shared/ui/ProjectCard/index.d.ts +2 -0
- package/dist/shared/ui/ProjectCardPlan/ProjectCardPlan.d.ts +27 -0
- package/dist/shared/ui/ProjectCardPlan/index.d.ts +2 -0
- package/dist/shared/ui/Radio/Radio.d.ts +24 -0
- package/dist/shared/ui/Radio/index.d.ts +1 -0
- package/dist/shared/ui/RecoveryWidget/RecoveryWidget.d.ts +26 -0
- package/dist/shared/ui/RecoveryWidget/index.d.ts +2 -0
- package/dist/shared/ui/RelatedDataCard/RelatedDataCard.d.ts +47 -0
- package/dist/shared/ui/RelatedDataCard/index.d.ts +1 -0
- package/dist/shared/ui/SettingsCard/SettingsCard.d.ts +24 -0
- package/dist/shared/ui/SettingsCard/index.d.ts +2 -0
- package/dist/shared/ui/SidePanel/SidePanel.d.ts +26 -0
- package/dist/shared/ui/SidePanel/SidePanel.types.d.ts +27 -0
- package/dist/shared/ui/SidePanel/index.d.ts +2 -0
- package/dist/shared/ui/SupportCard/SupportCard.d.ts +19 -0
- package/dist/shared/ui/SupportCard/index.d.ts +2 -0
- package/dist/shared/ui/Switcher/Switcher.d.ts +41 -0
- package/dist/shared/ui/Switcher/index.d.ts +1 -0
- package/dist/shared/ui/Table/Table.d.ts +136 -0
- package/dist/shared/ui/Table/TableBody.d.ts +13 -0
- package/dist/shared/ui/Table/TableCell.d.ts +6 -0
- package/dist/shared/ui/Table/TableColumnFilter.d.ts +11 -0
- package/dist/shared/ui/Table/TableColumnHeader.d.ts +6 -0
- package/dist/shared/ui/Table/TableColumnVisibility.d.ts +7 -0
- package/dist/shared/ui/Table/TableContext.d.ts +31 -0
- package/dist/shared/ui/Table/TableEmptyState.d.ts +16 -0
- package/dist/shared/ui/Table/TableHeader.d.ts +5 -0
- package/dist/shared/ui/Table/TablePagination.d.ts +9 -0
- package/dist/shared/ui/Table/TableRoot.d.ts +6 -0
- package/dist/shared/ui/Table/TableRow.d.ts +8 -0
- package/dist/shared/ui/Table/configParser.d.ts +18 -0
- package/dist/shared/ui/Table/index.d.ts +15 -0
- package/dist/shared/ui/Table/mockData.d.ts +33 -0
- package/dist/shared/ui/Table/types.d.ts +66 -0
- package/dist/shared/ui/Tabs/Tabs.d.ts +59 -0
- package/dist/shared/ui/Tabs/index.d.ts +1 -0
- package/dist/shared/ui/Tag/Tag.d.ts +29 -0
- package/dist/shared/ui/Tag/index.d.ts +1 -0
- package/dist/shared/ui/TextArea/TextArea.d.ts +28 -0
- package/dist/shared/ui/TextArea/index.d.ts +1 -0
- package/dist/shared/ui/ThemeToggle/ThemeToggle.d.ts +29 -0
- package/dist/shared/ui/ThemeToggle/index.d.ts +1 -0
- package/dist/shared/ui/Toast/Toast.d.ts +54 -0
- package/dist/shared/ui/Toast/index.d.ts +2 -0
- package/dist/shared/ui/Toggle/Toggle.d.ts +24 -0
- package/dist/shared/ui/Toggle/index.d.ts +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.d.ts +103 -0
- package/dist/shared/ui/Tooltip/index.d.ts +1 -0
- package/dist/shared/ui/TypesPanel/TypesPanel.d.ts +28 -0
- package/dist/shared/ui/TypesPanel/index.d.ts +2 -0
- package/dist/shared/ui/TypesPanelBodyGrid/TypesPanelBodyGrid.d.ts +45 -0
- package/dist/shared/ui/TypesPanelBodyGrid/index.d.ts +2 -0
- package/dist/shared/ui/TypesPanelBodyList/TypesPanelBodyList.d.ts +45 -0
- package/dist/shared/ui/TypesPanelBodyList/index.d.ts +2 -0
- package/dist/shared/ui/TypesPanelHeader/TypesPanelHeader.d.ts +27 -0
- package/dist/shared/ui/TypesPanelHeader/index.d.ts +2 -0
- package/dist/shared/ui/TypesPanelHeaderSearch/TypesPanelHeaderSearch.d.ts +44 -0
- package/dist/shared/ui/TypesPanelHeaderSearch/index.d.ts +1 -0
- package/dist/shared/ui/UserMenu/UserMenu.d.ts +78 -0
- package/dist/shared/ui/UserMenu/index.d.ts +1 -0
- package/dist/shared/ui/VisualComposer/VisualComposer.d.ts +36 -0
- package/dist/shared/ui/VisualComposer/index.d.ts +2 -0
- package/dist/shared/ui/WidgetBuilderItemHoverAction/WidgetBuilderItemHoverAction.d.ts +15 -0
- package/dist/shared/ui/WidgetBuilderItemHoverAction/index.d.ts +2 -0
- package/dist/shared/ui/WidgetContainer/WidgetContainer.d.ts +23 -0
- package/dist/shared/ui/WidgetContainer/index.d.ts +2 -0
- package/dist/shared/ui/WidgetSidebar/WidgetSidebar.d.ts +70 -0
- package/dist/shared/ui/WidgetSidebar/index.d.ts +2 -0
- package/dist/shared/ui/WorkspaceSettings/WorkspaceSettings.d.ts +22 -0
- package/dist/shared/ui/WorkspaceSettings/index.d.ts +2 -0
- package/dist/shared/ui/index.d.ts +1 -0
- package/dist/shared/ui/slider/Slider.d.ts +96 -0
- package/dist/shared/ui/slider/index.d.ts +2 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/tailwind.d.ts +9 -0
- package/package.json +112 -0
- package/tailwind.preset.js +278 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single menu item in the contextual menu.
|
|
4
|
+
*/
|
|
5
|
+
export interface MenuItem {
|
|
6
|
+
/** Unique identifier for the menu item */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Display label for the menu item */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Optional icon component to display before the label */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** Callback fired when the menu item is clicked */
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
/** Whether this is a destructive action (renders in red) */
|
|
15
|
+
destructive?: boolean;
|
|
16
|
+
/** Whether the item is disabled */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Defines the public API for the ContextualMenu component.
|
|
21
|
+
*/
|
|
22
|
+
export interface ContextualMenuProps {
|
|
23
|
+
/** Array of menu items to display */
|
|
24
|
+
items: MenuItem[];
|
|
25
|
+
/** The trigger button element */
|
|
26
|
+
trigger: React.ReactNode;
|
|
27
|
+
/** Optional custom CSS classes for the container */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Alignment of the menu relative to the trigger */
|
|
30
|
+
align?: 'left' | 'right';
|
|
31
|
+
/** Offset from the trigger in pixels */
|
|
32
|
+
offset?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @file A contextual menu component that displays a list of actions.
|
|
36
|
+
* @description This component renders a dropdown menu that appears when clicking
|
|
37
|
+
* a trigger element. It supports icons, destructive actions (shown in red), and
|
|
38
|
+
* automatic positioning. The menu closes when clicking outside or selecting an item.
|
|
39
|
+
*
|
|
40
|
+
* @param {MenuItem[]} items - Array of menu items to display
|
|
41
|
+
* @param {React.ReactNode} trigger - The element that triggers the menu
|
|
42
|
+
* @param {string} [className] - Optional CSS classes for the container
|
|
43
|
+
* @param {'left' | 'right'} [align='right'] - Menu alignment relative to trigger
|
|
44
|
+
* @param {number} [offset=8] - Distance from trigger in pixels
|
|
45
|
+
* @returns {JSX.Element} The rendered ContextualMenu component
|
|
46
|
+
*/
|
|
47
|
+
export declare const ContextualMenu: ({ items, trigger, className, align, offset, }: ContextualMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DateRange } from "react-day-picker";
|
|
2
|
+
import "react-day-picker/style.css";
|
|
3
|
+
import "./DateRangePicker.css";
|
|
4
|
+
export type { DateRange } from "react-day-picker";
|
|
5
|
+
export type PickType = 'range' | 'single';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the DateRangePicker component
|
|
8
|
+
*/
|
|
9
|
+
export interface DateRangePickerProps {
|
|
10
|
+
/** Currently selected date range */
|
|
11
|
+
selected?: DateRange;
|
|
12
|
+
/** Callback fired when the date selection changes */
|
|
13
|
+
onSelect?: (range: DateRange | undefined) => void;
|
|
14
|
+
/** If true, disables the date picker */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Callback fired when the cancel button is clicked */
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
/** Callback fired when the accept button is clicked */
|
|
19
|
+
onAccept?: (range: DateRange | undefined) => void;
|
|
20
|
+
/** If true, displays two months side by side */
|
|
21
|
+
extraMonth?: boolean;
|
|
22
|
+
/** Selection mode: 'range' for date ranges, 'single' for single dates */
|
|
23
|
+
pickType?: PickType;
|
|
24
|
+
/** Additional CSS classes */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Label for the cancel button */
|
|
27
|
+
cancelLabel?: string;
|
|
28
|
+
/** Label for the accept button */
|
|
29
|
+
acceptLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* DateRangePicker - A simple calendar UI component for date selection
|
|
33
|
+
*
|
|
34
|
+
* Features:
|
|
35
|
+
* - Range or single date selection
|
|
36
|
+
* - Built-in Cancel and Accept buttons
|
|
37
|
+
* - Optional dual-month display
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <DateRangePicker
|
|
41
|
+
* selected={dateRange}
|
|
42
|
+
* onSelect={setDateRange}
|
|
43
|
+
* onAccept={(range) => console.log(range)}
|
|
44
|
+
* pickType="range"
|
|
45
|
+
* />
|
|
46
|
+
*/
|
|
47
|
+
export declare const DateRangePicker: ({ selected: selectedProp, onSelect, disabled, onCancel, onAccept, extraMonth, pickType, className, cancelLabel, acceptLabel, }: DateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateRangePicker, type DateRange, type PickType, type DateRangePickerProps } from './DateRangePicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider, type DividerProps } from './Divider';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DragAndDropListItemState = 'default' | 'hover' | 'active' | 'drag' | 'disabled';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the public API for the DragAndDropListItem component.
|
|
5
|
+
*/
|
|
6
|
+
export interface DragAndDropListItemProps {
|
|
7
|
+
/** The main text label displayed in the center. */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** The content to display inside the tooltip. If not provided, the right icon will be displayed without a tooltip. */
|
|
10
|
+
tooltipContent?: React.ReactNode;
|
|
11
|
+
/** The icon to trigger the tooltip on the right. Defaults to a question mark icon. */
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
/** Optional custom Tailwind CSS class for the right icon's color (e.g., 'text-danger-500'). */
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
/** The icon displayed on the left (drag handle). Defaults to PlusCircleIcon. */
|
|
16
|
+
leadingIcon?: React.ReactNode;
|
|
17
|
+
/** Optional custom Tailwind CSS class for the left icon's color (e.g., 'text-disabled'). */
|
|
18
|
+
leadingIconColor?: string;
|
|
19
|
+
/** Size for both icons in pixels. Defaults to 20. */
|
|
20
|
+
iconSize?: number;
|
|
21
|
+
/** Optional custom classes for the main container. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Optional custom classes for the label text. Will override default text styles. */
|
|
24
|
+
labelClassName?: string;
|
|
25
|
+
/** Font size for the label. Accepts Tailwind sizes ('xs', 'sm', etc.) or custom values ('14px', '1.5rem', etc.). Defaults to 'sm'. */
|
|
26
|
+
fontSize?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | string;
|
|
27
|
+
/** Font weight for the label. Defaults to 'semibold'. */
|
|
28
|
+
fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
29
|
+
/** Text color for the label. Defaults to 'text-med-em'. */
|
|
30
|
+
textColor?: string;
|
|
31
|
+
/** Optional click handler for the entire item. */
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
/** The interactive state of the item. */
|
|
34
|
+
state?: DragAndDropListItemState;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @file A drag and drop list item component with leading icon, label, and tooltip.
|
|
38
|
+
* @description This component displays a bordered container with an icon on the left,
|
|
39
|
+
* text label in the center, and a tooltip icon on the right. Designed for use in sortable/draggable lists.
|
|
40
|
+
* Built on top of Radix UI's Tooltip for robust accessibility and positioning.
|
|
41
|
+
*
|
|
42
|
+
* @param {React.ReactNode} children - The main text label.
|
|
43
|
+
* @param {React.ReactNode} tooltipContent - The content to be shown inside the tooltip.
|
|
44
|
+
* @param {React.ReactNode} [icon] - An optional custom icon component to trigger the tooltip.
|
|
45
|
+
* @param {string} [iconColor='text-disabled'] - An optional Tailwind CSS class to customize the icon's color.
|
|
46
|
+
* @param {string} [className] - Optional custom classes for the main container.
|
|
47
|
+
* @param {string} [labelClassName] - Optional custom classes for the label text (overrides defaults).
|
|
48
|
+
* @param {'xs' | 'sm' | 'base' | 'lg' | 'xl'} [fontSize='sm'] - Font size for the label.
|
|
49
|
+
* @param {'normal' | 'medium' | 'semibold' | 'bold'} [fontWeight='semibold'] - Font weight for the label.
|
|
50
|
+
* @param {string} [textColor=''] - Text color for the label.
|
|
51
|
+
* @param {DragAndDropListItemState} [state='default'] - The interactive state of the item.
|
|
52
|
+
* @returns {JSX.Element} The rendered DragAndDropListItem element.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DragAndDropListItem: React.MemoExoticComponent<({ children, tooltipContent, icon, iconColor, leadingIcon, leadingIconColor, iconSize, className, labelClassName, fontSize, fontWeight, textColor, onClick, state, }: DragAndDropListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListItemProps, ListItemSize } from '../ListItem/ListItem';
|
|
3
|
+
export type DropMenuSize = ListItemSize;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a single item in the DropMenu
|
|
6
|
+
*/
|
|
7
|
+
export interface DropMenuItemProps extends ListItemProps {
|
|
8
|
+
/** Unique identifier for the item */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Show a divider after this item */
|
|
11
|
+
showDividerAfter?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Defines the public API for the DropMenu component
|
|
15
|
+
*/
|
|
16
|
+
export interface DropMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
17
|
+
/** Array of items to display in the menu */
|
|
18
|
+
items: DropMenuItemProps[];
|
|
19
|
+
/** Optional header configuration (displays a minimal ListItem with only title) */
|
|
20
|
+
header?: {
|
|
21
|
+
title: string;
|
|
22
|
+
};
|
|
23
|
+
/** Size for the header (defaults to 'xs' for compact display) */
|
|
24
|
+
headerSize?: DropMenuSize;
|
|
25
|
+
/** Size to apply to all child ListItems */
|
|
26
|
+
size?: DropMenuSize;
|
|
27
|
+
/** Array of selected item IDs (for controlled selection) */
|
|
28
|
+
selectedIds?: string[];
|
|
29
|
+
/** Callback when an item is selected */
|
|
30
|
+
onSelect?: (id: string) => void;
|
|
31
|
+
/** If true, uses absolute positioning for dropdown behavior */
|
|
32
|
+
floating?: boolean;
|
|
33
|
+
/** Additional CSS classes for the container */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @file A dropdown menu component that displays a list of ListItem components
|
|
38
|
+
* @description This component renders a vertical menu container that can include:
|
|
39
|
+
* - Optional header (minimal ListItem with only title)
|
|
40
|
+
* - Multiple ListItem components with customizable props
|
|
41
|
+
* - Optional dividers between specific items
|
|
42
|
+
* - Selection management with controlled state
|
|
43
|
+
* - Absolute/floating positioning support
|
|
44
|
+
*
|
|
45
|
+
* The component acts as a static container (always visible) that composes ListItem
|
|
46
|
+
* components with consistent styling and behavior.
|
|
47
|
+
*
|
|
48
|
+
* @param {DropMenuItemProps[]} items - Array of items to display (required)
|
|
49
|
+
* @param {object} [header] - Optional header with title
|
|
50
|
+
* @param {DropMenuSize} [headerSize='xs'] - Size for the header (defaults to 'xs' for compact display)
|
|
51
|
+
* @param {DropMenuSize} [size='md'] - Size to apply to all ListItems
|
|
52
|
+
* @param {string[]} [selectedIds] - Array of selected item IDs
|
|
53
|
+
* @param {Function} [onSelect] - Callback when item is selected
|
|
54
|
+
* @param {boolean} [floating=false] - If true, uses absolute positioning
|
|
55
|
+
* @param {string} [className] - Additional CSS classes
|
|
56
|
+
* @returns {JSX.Element} The rendered DropMenu element
|
|
57
|
+
*/
|
|
58
|
+
export declare const DropMenu: ({ items, header, headerSize, size, selectedIds, onSelect, floating, className, ...props }: DropMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DropMenu, type DropMenuProps, type DropMenuItemProps, type DropMenuSize } from './DropMenu';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
export interface DropZoneProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drop zone is currently being hovered over during drag
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
isOver?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Height when the drop zone is active (being hovered)
|
|
10
|
+
* @default '56px'
|
|
11
|
+
*/
|
|
12
|
+
activeHeight?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* Height when the drop zone is inactive
|
|
15
|
+
* @default '0px'
|
|
16
|
+
*/
|
|
17
|
+
inactiveHeight?: string | number;
|
|
18
|
+
/**
|
|
19
|
+
* Duration of the expand/collapse animation in milliseconds
|
|
20
|
+
* @default 150
|
|
21
|
+
*/
|
|
22
|
+
transitionDuration?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Timing function for the animation
|
|
25
|
+
* @default 'ease-out'
|
|
26
|
+
*/
|
|
27
|
+
transitionTimingFunction?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Additional CSS classes
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Additional inline styles
|
|
34
|
+
*/
|
|
35
|
+
style?: CSSProperties;
|
|
36
|
+
/**
|
|
37
|
+
* Ref callback for drag-and-drop library integration
|
|
38
|
+
* Pass this to your drag library's drop ref (e.g., dnd-kit's setNodeRef)
|
|
39
|
+
*/
|
|
40
|
+
dropRef?: (node: HTMLDivElement | null) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Optional ID for the drop zone (useful for drag library data)
|
|
43
|
+
*/
|
|
44
|
+
id?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare const DropZone: React.NamedExoticComponent<DropZoneProps>;
|
|
47
|
+
export default DropZone;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropMenuItemProps } from '../DropMenu/DropMenu';
|
|
3
|
+
type DropdownVariant = 'default' | 'danger' | 'outlined';
|
|
4
|
+
type DropdownSize = 'sm' | 'md';
|
|
5
|
+
/**
|
|
6
|
+
* Defines the shape for a single item in the dropdown list (extends DropMenuItemProps).
|
|
7
|
+
*/
|
|
8
|
+
export interface DropdownItemProps extends DropMenuItemProps {
|
|
9
|
+
/** Unique identifier for the item (required) */
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Defines the public API for the Dropdown component.
|
|
14
|
+
*/
|
|
15
|
+
export interface DropdownProps {
|
|
16
|
+
/** The visual variant of the dropdown, used for different states. */
|
|
17
|
+
variant?: DropdownVariant;
|
|
18
|
+
/** The size of the dropdown. */
|
|
19
|
+
size?: DropdownSize;
|
|
20
|
+
/** The size of the dropdown menu (defaults to the dropdown size if not provided). */
|
|
21
|
+
menuSize?: DropdownSize;
|
|
22
|
+
/** The text label displayed above the dropdown. */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Helper text or an error message displayed below the dropdown. */
|
|
25
|
+
hint?: string;
|
|
26
|
+
/** An array of items to populate the dropdown. */
|
|
27
|
+
items: DropdownItemProps[];
|
|
28
|
+
/** A string for the initial, unselected option. */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** If true, the dropdown will be non-interactive. */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Optional custom CSS classes for additional styling. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** The currently selected item ID. */
|
|
35
|
+
value?: string;
|
|
36
|
+
/** Callback fired when an item is selected. */
|
|
37
|
+
onChange: (id: string) => void;
|
|
38
|
+
/** The id attribute for the dropdown button, used for associating the label. */
|
|
39
|
+
id?: string;
|
|
40
|
+
/** Optional custom height override. Accepts any CSS value (e.g., '12px', '48px', '3rem'). */
|
|
41
|
+
customHeight?: string;
|
|
42
|
+
/** Optional custom border radius override. Accepts any CSS value (e.g., '4px', '8px', '1rem'). */
|
|
43
|
+
customRadius?: string;
|
|
44
|
+
/** Optional custom placeholder color. Accepts Tailwind color classes (e.g., 'text-placeholder'). */
|
|
45
|
+
customPlaceholderColor?: string;
|
|
46
|
+
/** Optional custom background color. Accepts Tailwind color classes (e.g., 'bg-white') or CSS color values. */
|
|
47
|
+
customBackgroundColor?: string;
|
|
48
|
+
/** Optional leading icon to display at the start of the dropdown button. Defaults to Category icon if not provided. */
|
|
49
|
+
leadingIcon?: React.ReactNode;
|
|
50
|
+
/** If true, hides the leading icon completely. */
|
|
51
|
+
showLeadingIcon?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @file A dropdown component that renders ListItems for rich option display.
|
|
55
|
+
* @description This component provides a button trigger that opens a floating menu
|
|
56
|
+
* with ListItem components, allowing for complex option layouts with icons, descriptions, tags, etc.
|
|
57
|
+
*
|
|
58
|
+
* @param {DropdownVariant} [variant='default'] - The color theme of the dropdown.
|
|
59
|
+
* @param {DropdownSize} [size='md'] - The size of the dropdown.
|
|
60
|
+
* @param {DropdownItemProps[]} items - The array of items (extends ListItemProps).
|
|
61
|
+
* @param {string | undefined} value - The currently selected item ID.
|
|
62
|
+
* @param {(id: string) => void} onChange - Callback fired when an item is selected.
|
|
63
|
+
* @returns {JSX.Element} The rendered Dropdown element.
|
|
64
|
+
*/
|
|
65
|
+
export declare const Dropdown: ({ variant, size, menuSize, label, hint, items, disabled, placeholder, className, value, onChange, id, customHeight, customRadius, customPlaceholderColor, customBackgroundColor, leadingIcon, showLeadingIcon, }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dropdown, type DropdownProps, type DropdownItemProps } from './Dropdown';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Menu } from "@headlessui/react";
|
|
3
|
+
declare function DropdownMenu({ children, ...props }: React.ComponentProps<typeof Menu>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuTrigger({ as: AsComponent, className, ...props }: React.ComponentProps<"button"> & {
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuContent({ className, sideOffset: _sideOffset, children, ...props }: Omit<React.ComponentProps<"div">, "ref"> & {
|
|
8
|
+
sideOffset?: number;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DropdownMenuGroup({ children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DropdownMenuItem({ className, inset, variant, children, disabled, ...props }: React.ComponentProps<"button"> & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: "default" | "destructive";
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, disabled, ...props }: React.ComponentProps<"button"> & {
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DropdownMenuRadioGroup({ children, className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuRadioItem({ className, children, value: _value, checked, disabled, ...props }: React.ComponentProps<"button"> & {
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
value?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function DropdownMenuLabel({ className, inset, children, ...props }: React.ComponentProps<"div"> & {
|
|
24
|
+
inset?: boolean;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function DropdownMenuSub({ children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<"button"> & {
|
|
30
|
+
inset?: boolean;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function DropdownMenuSubContent({ className, children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function DropdownMenuItemContent({ icon, label }: {
|
|
34
|
+
icon?: React.ReactNode;
|
|
35
|
+
label: string;
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, DropdownMenuItemContent, };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { Component, ReactNode } from 'react';
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the component being wrapped (for logging/debugging)
|
|
5
|
+
*/
|
|
6
|
+
componentName?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Fallback UI to render when an error is caught
|
|
9
|
+
*/
|
|
10
|
+
fallback?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Callback function called when an error is caught
|
|
13
|
+
*/
|
|
14
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Title for the default fallback UI
|
|
17
|
+
* @default 'Something went wrong'
|
|
18
|
+
*/
|
|
19
|
+
defaultTitle?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Message for the default fallback UI
|
|
22
|
+
* @default 'An error occurred while rendering this component.'
|
|
23
|
+
*/
|
|
24
|
+
defaultMessage?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Label for the retry button in default fallback UI
|
|
27
|
+
* @default 'Try again'
|
|
28
|
+
*/
|
|
29
|
+
retryLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Children to render
|
|
32
|
+
*/
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
interface ErrorBoundaryState {
|
|
36
|
+
hasError: boolean;
|
|
37
|
+
error: Error | null;
|
|
38
|
+
}
|
|
39
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
40
|
+
constructor(props: ErrorBoundaryProps);
|
|
41
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
42
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
43
|
+
resetError: () => void;
|
|
44
|
+
render(): ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface ErrorStateProps {
|
|
3
|
+
/**
|
|
4
|
+
* Error icon or emoji to display
|
|
5
|
+
* @default '⚠️'
|
|
6
|
+
*/
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Error title/heading
|
|
10
|
+
* @default 'Something went wrong'
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Error message/description
|
|
15
|
+
*/
|
|
16
|
+
message?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Error object for technical details (shown in dev mode only)
|
|
19
|
+
*/
|
|
20
|
+
error?: Error;
|
|
21
|
+
/**
|
|
22
|
+
* Callback for retry action
|
|
23
|
+
*/
|
|
24
|
+
onRetry?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Label for the retry button
|
|
27
|
+
* @default 'Retry'
|
|
28
|
+
*/
|
|
29
|
+
retryLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to show error details in production
|
|
32
|
+
* @default false (only shows in development)
|
|
33
|
+
*/
|
|
34
|
+
showDetailsInProduction?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Additional CSS classes for the container
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to center the error state vertically
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
centered?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Maximum width of the error content
|
|
46
|
+
* @default 'max-w-sm'
|
|
47
|
+
*/
|
|
48
|
+
maxWidth?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare const ErrorState: React.NamedExoticComponent<ErrorStateProps>;
|
|
51
|
+
export default ErrorState;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonHierarchy, ButtonSize, ButtonVariant } from "../Button/Button";
|
|
3
|
+
import { DropMenuSize } from "../DropMenu/DropMenu";
|
|
4
|
+
/**
|
|
5
|
+
* Dropdown item for FloatingBar
|
|
6
|
+
*/
|
|
7
|
+
export type FloatingBarDropdownItem = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
showDividerAfter?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Base action properties
|
|
18
|
+
*/
|
|
19
|
+
type BaseAction = {
|
|
20
|
+
id: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
leadingIcon?: React.ReactNode;
|
|
23
|
+
trailingIcon?: React.ReactNode;
|
|
24
|
+
isActive?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Button variant - defaults to 'brand' */
|
|
27
|
+
variant?: ButtonVariant;
|
|
28
|
+
/** Button hierarchy - defaults to 'primary' */
|
|
29
|
+
hierarchy?: ButtonHierarchy;
|
|
30
|
+
/** Button size - defaults to 'sm' */
|
|
31
|
+
size?: ButtonSize;
|
|
32
|
+
/** Custom className for the button */
|
|
33
|
+
className?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Button action (default type)
|
|
37
|
+
*/
|
|
38
|
+
type ButtonAction = BaseAction & {
|
|
39
|
+
type?: "button";
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Dropdown action with items
|
|
44
|
+
*/
|
|
45
|
+
type DropdownAction = BaseAction & {
|
|
46
|
+
type: "dropdown";
|
|
47
|
+
items: FloatingBarDropdownItem[];
|
|
48
|
+
/** DropMenu size - defaults to 'sm' */
|
|
49
|
+
dropMenuSize?: DropMenuSize;
|
|
50
|
+
/** Custom className for the DropMenu */
|
|
51
|
+
dropMenuClassName?: string;
|
|
52
|
+
/** Custom color for destructive items - defaults to 'text-danger-em' */
|
|
53
|
+
destructiveColor?: string;
|
|
54
|
+
/** Show description in dropdown items - defaults to false */
|
|
55
|
+
showDescription?: boolean;
|
|
56
|
+
/** Show trailing icon in dropdown items - defaults to false */
|
|
57
|
+
showTrailingIcon?: boolean;
|
|
58
|
+
/** Show trailing text in dropdown items - defaults to false */
|
|
59
|
+
showTrailingText?: boolean;
|
|
60
|
+
/** Show tag in dropdown items - defaults to false */
|
|
61
|
+
showTag?: boolean;
|
|
62
|
+
/** Show checkbox in dropdown items - defaults to false */
|
|
63
|
+
showCheckbox?: boolean;
|
|
64
|
+
};
|
|
65
|
+
export type Action = ButtonAction | DropdownAction;
|
|
66
|
+
/**
|
|
67
|
+
* FloatingBar component props
|
|
68
|
+
*/
|
|
69
|
+
interface FloatingBarProps {
|
|
70
|
+
/** Array of action groups. Each group is an array of actions that will be visually connected */
|
|
71
|
+
groups: Action[][];
|
|
72
|
+
/** Optional custom CSS classes for the container */
|
|
73
|
+
className?: string;
|
|
74
|
+
/** Optional width for the bar */
|
|
75
|
+
width?: string | number;
|
|
76
|
+
/** Optional height for the bar */
|
|
77
|
+
height?: string | number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @file A floating container component for displaying groups of primary actions.
|
|
81
|
+
* @description The FloatingBar is a data-driven component that takes an array of action groups
|
|
82
|
+
* and renders them as visually separated button groups. Each group can contain buttons and/or dropdowns.
|
|
83
|
+
* Groups are rendered with spacing between them, while buttons within a group are visually connected.
|
|
84
|
+
*
|
|
85
|
+
* @param {Action[][]} groups - Array of action groups. Each group is an array of actions.
|
|
86
|
+
* @param {string} [className] - Optional CSS classes to apply to the bar's container.
|
|
87
|
+
* @param {string | number} [width] - An optional width for the bar.
|
|
88
|
+
* @param {string | number} [height] - An optional height for the bar.
|
|
89
|
+
* @returns {JSX.Element} The rendered FloatingBar element.
|
|
90
|
+
*/
|
|
91
|
+
export declare const FloatingBar: ({ groups, className, width, height, }: FloatingBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FloatingBar, type Action } from './FloatingBar';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FormFieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
onAction?: (action: "maximize" | "grid" | "add" | "copy" | "trash" | "addWidget") => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A component for displaying widget builder item hover action with an icon, title, and description.
|
|
7
|
+
* Includes a button group with predefined actions.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FormFieldGroup: ({ className, onAction, children, ...props }: FormFieldGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props interface for the GridDraggableItem component.
|
|
4
|
+
*/
|
|
5
|
+
export interface GridDraggableItemProps {
|
|
6
|
+
/**
|
|
7
|
+
* Icon to display at the center (can be any icon from iconsax-react or custom component)
|
|
8
|
+
*/
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Optional text label displayed below the icon
|
|
12
|
+
*/
|
|
13
|
+
text?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional callback fired when the item is clicked
|
|
16
|
+
*/
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Optional custom CSS classes
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* GridDraggableItem - A compact draggable item component for grid layouts.
|
|
25
|
+
*
|
|
26
|
+
* Features:
|
|
27
|
+
* - Fixed dimensions: 70px width × 60px height
|
|
28
|
+
* - Centered icon (20px) and optional text
|
|
29
|
+
* - Visual feedback with cursor-grab
|
|
30
|
+
* - Designed to be used within drag-and-drop grid systems
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // With icon and text
|
|
35
|
+
* <GridDraggableItem
|
|
36
|
+
* icon={<Home2 />}
|
|
37
|
+
* text="Home"
|
|
38
|
+
* onClick={() => console.log('clicked')}
|
|
39
|
+
* />
|
|
40
|
+
*
|
|
41
|
+
* // Icon only
|
|
42
|
+
* <GridDraggableItem icon={<Setting2 />} />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const GridDraggableItem: React.FC<GridDraggableItemProps>;
|