@flikk/ui 1.0.0-beta.27 → 1.0.0-beta.29
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/bg/1.webp +0 -0
- package/dist/bg/10.webp +0 -0
- package/dist/bg/11.webp +0 -0
- package/dist/bg/12.webp +0 -0
- package/dist/bg/13.webp +0 -0
- package/dist/bg/14.webp +0 -0
- package/dist/bg/15.webp +0 -0
- package/dist/bg/16.webp +0 -0
- package/dist/bg/17.webp +0 -0
- package/dist/bg/18.webp +0 -0
- package/dist/bg/19.webp +0 -0
- package/dist/bg/2.webp +0 -0
- package/dist/bg/20.webp +0 -0
- package/dist/bg/21.webp +0 -0
- package/dist/bg/22.webp +0 -0
- package/dist/bg/3.webp +0 -0
- package/dist/bg/4.webp +0 -0
- package/dist/bg/5.webp +0 -0
- package/dist/bg/6.webp +0 -0
- package/dist/bg/7.webp +0 -0
- package/dist/bg/8.webp +0 -0
- package/dist/bg/9.webp +0 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +7 -143
- package/dist/components/ai/PromptInput/VoiceRecorder.js +0 -88
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/canvas/Background.d.ts +19 -0
- package/dist/components/canvas/Background.js +23 -0
- package/dist/components/canvas/BaseNode.d.ts +15 -0
- package/dist/components/canvas/BaseNode.js +20 -0
- package/dist/components/canvas/CanvasToolbar.d.ts +34 -0
- package/dist/components/canvas/CanvasToolbar.js +34 -0
- package/dist/components/canvas/Edge.d.ts +35 -0
- package/dist/components/canvas/Edge.js +97 -0
- package/dist/components/canvas/EdgeLayer.d.ts +18 -0
- package/dist/components/canvas/EdgeLayer.js +111 -0
- package/dist/components/canvas/Handle.d.ts +11 -0
- package/dist/components/canvas/Handle.js +63 -0
- package/dist/components/canvas/MiniMap.d.ts +22 -0
- package/dist/components/canvas/MiniMap.js +105 -0
- package/dist/components/canvas/NodeCanvas.d.ts +10 -0
- package/dist/components/canvas/NodeCanvas.js +477 -0
- package/dist/components/canvas/NodeCanvas.theme.d.ts +7 -0
- package/dist/components/canvas/NodeCanvas.theme.js +9 -0
- package/dist/components/canvas/NodeCanvas.types.d.ts +187 -0
- package/dist/components/canvas/NodeControls.d.ts +25 -0
- package/dist/components/canvas/NodeControls.js +40 -0
- package/dist/components/canvas/NodeRenderer.d.ts +19 -0
- package/dist/components/canvas/NodeRenderer.js +117 -0
- package/dist/components/canvas/changes.d.ts +11 -0
- package/dist/components/canvas/changes.js +76 -0
- package/dist/components/canvas/context/CanvasContext.d.ts +32 -0
- package/dist/components/canvas/context/CanvasContext.js +14 -0
- package/dist/components/canvas/context/ConnectionContext.d.ts +33 -0
- package/dist/components/canvas/context/ConnectionContext.js +13 -0
- package/dist/components/canvas/context/HandleRegistry.d.ts +24 -0
- package/dist/components/canvas/context/HandleRegistry.js +15 -0
- package/dist/components/canvas/context/InteractionContext.d.ts +18 -0
- package/dist/components/canvas/context/InteractionContext.js +14 -0
- package/dist/components/canvas/context/NodeIdContext.d.ts +3 -0
- package/dist/components/canvas/context/NodeIdContext.js +15 -0
- package/dist/components/canvas/hooks/useConnection.d.ts +17 -0
- package/dist/components/canvas/hooks/useConnection.js +29 -0
- package/dist/components/canvas/hooks/useMarquee.d.ts +25 -0
- package/dist/components/canvas/hooks/useMarquee.js +91 -0
- package/dist/components/canvas/hooks/useNodeDrag.d.ts +23 -0
- package/dist/components/canvas/hooks/useNodeDrag.js +110 -0
- package/dist/components/canvas/hooks/usePanZoom.d.ts +30 -0
- package/dist/components/canvas/hooks/usePanZoom.js +189 -0
- package/dist/components/canvas/hooks/useViewport.d.ts +21 -0
- package/dist/components/canvas/hooks/useViewport.js +35 -0
- package/dist/components/canvas/index.d.ts +14 -0
- package/dist/components/canvas/index.js +12 -0
- package/dist/components/canvas/layout.d.ts +22 -0
- package/dist/components/canvas/layout.js +67 -0
- package/dist/components/canvas/utils.d.ts +4 -0
- package/dist/components/canvas/utils.js +16 -0
- package/dist/components/charts/AreaChart/AreaChart.js +136 -101
- package/dist/components/charts/AreaChart/AreaChart.types.d.ts +5 -5
- package/dist/components/charts/AreaChart/AreaChart.types.js +1 -0
- package/dist/components/charts/BarChart/BarChart.js +207 -143
- package/dist/components/charts/BarChart/BarChart.types.d.ts +4 -4
- package/dist/components/charts/BarChart/BarChart.types.js +1 -0
- package/dist/components/charts/ComboChart/ComboChart.types.d.ts +2 -2
- package/dist/components/charts/LineChart/LineChart.js +88 -72
- package/dist/components/charts/LineChart/LineChart.types.d.ts +3 -3
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.theme.js +5 -2
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +62 -72
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +10 -1
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +3 -9
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +33 -33
- package/dist/components/charts/StackedBarChart/StackedBarChart.types.d.ts +2 -2
- package/dist/components/charts/hooks/index.d.ts +2 -0
- package/dist/components/charts/hooks/useChartDimensions.d.ts +29 -0
- package/dist/components/charts/hooks/useChartDimensions.js +42 -0
- package/dist/components/charts/shared/ChartTooltip/ChartTooltip.theme.js +1 -1
- package/dist/components/charts/types/chart.types.d.ts +11 -2
- package/dist/components/charts/types/chart.types.js +10 -3
- package/dist/components/core/Avatar/Avatar.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.js +5 -1
- package/dist/components/core/AvatarGroup/AvatarGroup.theme.js +4 -2
- package/dist/components/core/Badge/Badge.js +1 -1
- package/dist/components/core/Badge/Badge.theme.js +16 -15
- package/dist/components/core/Button/Button.js +1 -1
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Card/Card.js +7 -3
- package/dist/components/core/Card/Card.theme.js +3 -3
- package/dist/components/core/Card/Card.types.d.ts +27 -2
- package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +2 -2
- package/dist/components/core/ContextMenu/ContextMenuItem.js +1 -1
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +1 -1
- package/dist/components/core/Dropdown/Dropdown.theme.js +3 -3
- package/dist/components/core/Dropdown/DropdownMenu.js +57 -29
- package/dist/components/core/HeroCard/HeroCard.d.ts +5 -0
- package/dist/components/core/HeroCard/HeroCard.js +99 -0
- package/dist/components/core/HeroCard/HeroCard.theme.d.ts +3 -0
- package/dist/components/core/HeroCard/HeroCard.theme.js +8 -0
- package/dist/components/core/HeroCard/HeroCard.types.d.ts +70 -0
- package/dist/components/core/HeroCard/index.d.ts +4 -0
- package/dist/components/core/Kbd/Kbd.theme.js +1 -1
- package/dist/components/core/Modal/Modal.d.ts +1 -1
- package/dist/components/core/Modal/Modal.js +2 -7
- package/dist/components/core/Modal/Modal.theme.js +4 -8
- package/dist/components/core/Modal/Modal.types.d.ts +0 -10
- package/dist/components/core/Modal/index.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStack.types.d.ts +1 -2
- package/dist/components/core/ModalStack/ModalStackModal.d.ts +1 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +2 -7
- package/dist/components/core/PageHeading/PageHeading.theme.js +2 -2
- package/dist/components/core/Popover/Popover.theme.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +242 -4
- package/dist/components/core/ScrollArea/ScrollArea.types.d.ts +12 -1
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.d.ts +4 -0
- package/dist/components/core/ScrollArea/smooth/SmoothScrollEngine.js +23 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.js +4 -0
- package/dist/components/core/ScrollArea/smooth/useSmoothScroll.types.d.ts +5 -0
- package/dist/components/core/Segmented/Segmented.theme.js +2 -2
- package/dist/components/core/Tooltip/Tooltip.theme.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.js +2 -0
- package/dist/components/data-display/DescriptionList/DescriptionList.js +23 -7
- package/dist/components/data-display/DescriptionList/DescriptionList.theme.js +10 -3
- package/dist/components/data-display/DescriptionList/DescriptionList.types.d.ts +49 -10
- package/dist/components/data-display/DescriptionList/index.d.ts +1 -1
- package/dist/components/data-display/Feed/Feed.js +28 -5
- package/dist/components/data-display/Feed/Feed.theme.js +1 -1
- package/dist/components/data-display/Feed/Feed.types.d.ts +32 -1
- package/dist/components/data-display/Feed/index.d.ts +1 -1
- package/dist/components/data-display/Metric/Metric.js +8 -8
- package/dist/components/data-display/Metric/Metric.theme.d.ts +3 -2
- package/dist/components/data-display/Metric/Metric.theme.js +50 -68
- package/dist/components/data-display/Metric/Metric.types.d.ts +19 -21
- package/dist/components/data-display/Table/Table.js +2 -2
- package/dist/components/data-display/Table/Table.theme.js +24 -4
- package/dist/components/data-display/Table/Table.types.d.ts +8 -0
- package/dist/components/data-display/Table/TableBody.js +2 -2
- package/dist/components/data-display/Table/TableCell.js +1 -1
- package/dist/components/data-display/Table/TableRow.d.ts +1 -1
- package/dist/components/data-display/Table/TableRow.js +9 -2
- package/dist/components/data-display/Timeline/Timeline.js +27 -5
- package/dist/components/data-display/Timeline/Timeline.theme.d.ts +10 -2
- package/dist/components/data-display/Timeline/Timeline.theme.js +14 -8
- package/dist/components/data-display/Timeline/Timeline.types.d.ts +48 -16
- package/dist/components/data-display/Timeline/Timeline.utils.d.ts +6 -0
- package/dist/components/data-display/Timeline/Timeline.utils.js +11 -0
- package/dist/components/data-display/Timeline/TimelineItem.js +13 -20
- package/dist/components/data-display/Timeline/TimelineMarker.js +10 -8
- package/dist/components/data-display/Timeline/index.d.ts +2 -2
- package/dist/components/effects/3d/index.d.ts +0 -2
- package/dist/components/effects/3d/index.js +0 -1
- package/dist/components/effects/DotPattern/DotPattern.js +1 -1
- package/dist/components/effects/Overlay/Overlay.theme.js +1 -2
- package/dist/components/effects/Preloader/Preloader.animations.d.ts +23 -0
- package/dist/components/effects/Preloader/Preloader.animations.js +150 -0
- package/dist/components/effects/Preloader/Preloader.d.ts +3 -0
- package/dist/components/effects/Preloader/Preloader.js +119 -0
- package/dist/components/effects/Preloader/Preloader.types.d.ts +63 -0
- package/dist/components/effects/Preloader/index.d.ts +2 -0
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +25 -14
- package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +2 -0
- package/dist/components/effects/TiltCard/TiltCard.d.ts +12 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.d.ts +28 -0
- package/dist/components/effects/TiltCard/TiltCard.glow.js +114 -0
- package/dist/components/effects/TiltCard/TiltCard.js +177 -0
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.d.ts → TiltCard/TiltCard.shaders.d.ts} +1 -1
- package/dist/components/effects/{SpotlightBorder/SpotlightBorder.shaders.js → TiltCard/TiltCard.shaders.js} +1 -1
- package/dist/components/effects/TiltCard/TiltCard.types.d.ts +88 -0
- package/dist/components/effects/TiltCard/index.d.ts +2 -0
- package/dist/components/effects/index.d.ts +4 -12
- package/dist/components/effects/index.js +2 -6
- package/dist/components/forms/Checkbox/Checkbox.js +7 -1
- package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
- package/dist/components/forms/FileUpload/FileUpload.js +1 -89
- package/dist/components/forms/FormLabel/FormLabel.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +2 -2
- package/dist/components/forms/Slider/Slider.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.js +27 -15
- package/dist/components/forms/Switch/Switch.theme.d.ts +36 -6
- package/dist/components/forms/Switch/Switch.theme.js +33 -4
- package/dist/components/forms/Switch/Switch.types.d.ts +12 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -2
- package/dist/components/forms/TimePicker/TimePickerContent.js +1 -90
- package/dist/components/forms/forms.theme.js +1 -1
- package/dist/components/forms/index.d.ts +0 -4
- package/dist/components/forms/index.js +0 -92
- package/dist/components/generative/GenerativeView.d.ts +21 -0
- package/dist/components/generative/GenerativeView.js +116 -0
- package/dist/components/generative/actions.d.ts +26 -0
- package/dist/components/generative/actions.js +51 -0
- package/dist/components/generative/index.d.ts +11 -0
- package/dist/components/generative/index.js +9 -0
- package/dist/components/generative/registry.d.ts +43 -0
- package/dist/components/generative/registry.js +114 -0
- package/dist/components/generative/resolvers.d.ts +35 -0
- package/dist/components/generative/resolvers.js +93 -0
- package/dist/components/generative/schema.generated.d.ts +2 -0
- package/dist/components/generative/schema.generated.js +1639 -0
- package/dist/components/generative/schemaTypes.d.ts +30 -0
- package/dist/components/generative/streaming.d.ts +39 -0
- package/dist/components/generative/streaming.js +283 -0
- package/dist/components/generative/tools.d.ts +21 -0
- package/dist/components/generative/tools.js +54 -0
- package/dist/components/generative/types.d.ts +41 -0
- package/dist/components/generative/useGenerativeStream.d.ts +37 -0
- package/dist/components/generative/useGenerativeStream.js +36 -0
- package/dist/components/generative/validate.d.ts +24 -0
- package/dist/components/generative/validate.js +259 -0
- package/dist/components/layout/AppShell/AppShell.theme.js +2 -2
- package/dist/components/layout/FormLayout/FormLayout.js +1 -90
- package/dist/components/layout/Grid/Grid.d.ts +3 -0
- package/dist/components/layout/Grid/Grid.js +50 -0
- package/dist/components/layout/Grid/Grid.theme.d.ts +2 -0
- package/dist/components/layout/Grid/Grid.theme.js +35 -0
- package/dist/components/layout/Grid/Grid.types.d.ts +57 -0
- package/dist/components/layout/Grid/index.d.ts +3 -0
- package/dist/components/layout/Section/Section.d.ts +3 -0
- package/dist/components/layout/Section/Section.js +18 -0
- package/dist/components/layout/Section/Section.theme.d.ts +2 -0
- package/dist/components/layout/Section/Section.theme.js +10 -0
- package/dist/components/layout/Section/Section.types.d.ts +34 -0
- package/dist/components/layout/Section/index.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.d.ts +3 -0
- package/dist/components/layout/Stack/Stack.js +19 -0
- package/dist/components/layout/Stack/Stack.theme.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.theme.js +10 -0
- package/dist/components/layout/Stack/Stack.types.d.ts +39 -0
- package/dist/components/layout/Stack/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/generative.schema.json +1637 -0
- package/dist/index.js +180 -180
- package/dist/registry.json +648 -464
- package/dist/styles.css +1 -1
- package/dist/tools.json +1731 -0
- package/package.json +17 -4
- package/src/global.scss +53 -101
- package/src/styles/theme.css +687 -493
- package/dist/bg/1.jpg +0 -0
- package/dist/bg/10.jpg +0 -0
- package/dist/bg/11.jpg +0 -0
- package/dist/bg/14.jpg +0 -0
- package/dist/bg/15.jpg +0 -0
- package/dist/bg/16.jpg +0 -0
- package/dist/bg/17.jpg +0 -0
- package/dist/bg/18.jpg +0 -0
- package/dist/bg/19.jpg +0 -0
- package/dist/bg/2.jpg +0 -0
- package/dist/bg/20.jpg +0 -0
- package/dist/bg/21.jpg +0 -0
- package/dist/bg/22.jpg +0 -0
- package/dist/bg/23.jpg +0 -0
- package/dist/bg/24.jpg +0 -0
- package/dist/bg/3.jpg +0 -0
- package/dist/bg/4.jpg +0 -0
- package/dist/bg/5.jpg +0 -0
- package/dist/bg/6.jpg +0 -0
- package/dist/bg/7.jpg +0 -0
- package/dist/bg/8.jpg +0 -0
- package/dist/bg/9.jpg +0 -0
- package/dist/components/effects/MorphingText/MorphingText.d.ts +0 -17
- package/dist/components/effects/MorphingText/MorphingText.js +0 -125
- package/dist/components/effects/MorphingText/MorphingText.types.d.ts +0 -18
- package/dist/components/effects/MorphingText/index.d.ts +0 -2
- package/dist/components/effects/PageTransition/PageTransition.animations.d.ts +0 -8
- package/dist/components/effects/PageTransition/PageTransition.animations.js +0 -53
- package/dist/components/effects/PageTransition/PageTransition.d.ts +0 -3
- package/dist/components/effects/PageTransition/PageTransition.js +0 -82
- package/dist/components/effects/PageTransition/PageTransition.types.d.ts +0 -15
- package/dist/components/effects/PageTransition/index.d.ts +0 -2
- package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +0 -26
- package/dist/components/effects/ParallaxSection/ParallaxSection.js +0 -71
- package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +0 -11
- package/dist/components/effects/ParallaxSection/index.d.ts +0 -2
- package/dist/components/effects/Spotlight/Spotlight.d.ts +0 -36
- package/dist/components/effects/Spotlight/Spotlight.js +0 -112
- package/dist/components/effects/Spotlight/Spotlight.types.d.ts +0 -29
- package/dist/components/effects/Spotlight/index.d.ts +0 -2
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.d.ts +0 -18
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.js +0 -213
- package/dist/components/effects/SpotlightBorder/SpotlightBorder.types.d.ts +0 -61
- package/dist/components/effects/SpotlightBorder/index.d.ts +0 -2
- package/dist/components/effects/StickyScroll/StickyScroll.d.ts +0 -30
- package/dist/components/effects/StickyScroll/StickyScroll.js +0 -128
- package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +0 -19
- package/dist/components/effects/StickyScroll/index.d.ts +0 -2
- package/dist/components/forms/CronInput/CronInput.d.ts +0 -3
- package/dist/components/forms/CronInput/CronInput.js +0 -113
- package/dist/components/forms/CronInput/CronInput.theme.d.ts +0 -6
- package/dist/components/forms/CronInput/CronInput.theme.js +0 -75
- package/dist/components/forms/CronInput/CronInput.types.d.ts +0 -109
- package/dist/components/forms/CronInput/CronInput.utils.d.ts +0 -67
- package/dist/components/forms/CronInput/CronInput.utils.js +0 -505
- package/dist/components/forms/CronInput/index.d.ts +0 -4
- /package/dist/components/effects/{SpotlightBorder/SpotlightBorder.types.js → TiltCard/TiltCard.types.js} +0 -0
package/dist/bg/1.webp
ADDED
|
Binary file
|
package/dist/bg/10.webp
ADDED
|
Binary file
|
package/dist/bg/11.webp
ADDED
|
Binary file
|
package/dist/bg/12.webp
ADDED
|
Binary file
|
package/dist/bg/13.webp
ADDED
|
Binary file
|
package/dist/bg/14.webp
ADDED
|
Binary file
|
package/dist/bg/15.webp
ADDED
|
Binary file
|
package/dist/bg/16.webp
ADDED
|
Binary file
|
package/dist/bg/17.webp
ADDED
|
Binary file
|
package/dist/bg/18.webp
ADDED
|
Binary file
|
package/dist/bg/19.webp
ADDED
|
Binary file
|
package/dist/bg/2.webp
ADDED
|
Binary file
|
package/dist/bg/20.webp
ADDED
|
Binary file
|
package/dist/bg/21.webp
ADDED
|
Binary file
|
package/dist/bg/22.webp
ADDED
|
Binary file
|
package/dist/bg/3.webp
ADDED
|
Binary file
|
package/dist/bg/4.webp
ADDED
|
Binary file
|
package/dist/bg/5.webp
ADDED
|
Binary file
|
package/dist/bg/6.webp
ADDED
|
Binary file
|
package/dist/bg/7.webp
ADDED
|
Binary file
|
package/dist/bg/8.webp
ADDED
|
Binary file
|
package/dist/bg/9.webp
ADDED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const codeBlockTheme = {
|
|
2
|
-
baseStyle: "relative rounded-[var(--codeblock-radius)] border border-[var(--color-border)] overflow-hidden bg-[var(--color-surface-sunken)]",
|
|
2
|
+
baseStyle: "relative rounded-[var(--codeblock-radius)] border border-[var(--color-border)] overflow-hidden bg-[var(--color-surface-sunken)] shadow-inner-real-sm",
|
|
3
3
|
header: "flex items-center justify-between px-3 py-1.5 bg-[var(--color-background-secondary)] border-b border-[var(--color-border)]",
|
|
4
4
|
headerLeft: "flex items-center gap-2 min-w-0 flex-1 ",
|
|
5
5
|
headerRight: "flex items-center gap-2 flex-shrink-0",
|
|
@@ -1,48 +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/DateRangePicker/DateRangePicker.js';
|
|
17
|
-
import '../../forms/DateRangePicker/DateRangePicker.theme.js';
|
|
18
|
-
import '../../forms/FileUpload/FileUpload.js';
|
|
19
|
-
import '../../forms/FileUpload/FileUploadProgress.js';
|
|
20
|
-
import '../../forms/TimePicker/TimePicker.js';
|
|
21
|
-
import { CloudArrowUpIcon, MicrophoneIcon, PaperClipIcon, LinkIcon, DocumentIcon, XMarkIcon, PlusIcon, AdjustmentsHorizontalIcon, ChevronDownIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
22
|
-
import { cn } from '../../../utils/cn.js';
|
|
23
|
-
import 'react-dom';
|
|
24
|
-
import '../../core/Accordion/Accordion.js';
|
|
25
|
-
import '../../core/AlertDialog/AlertDialog.js';
|
|
26
|
-
import '../../core/AspectRatio/AspectRatio.js';
|
|
27
|
-
import '../../core/Avatar/Avatar.js';
|
|
28
|
-
import '../../core/AvatarGroup/AvatarGroup.js';
|
|
29
|
-
import '../../core/Badge/Badge.js';
|
|
30
|
-
import '../../core/Breadcrumbs/Breadcrumbs.js';
|
|
31
|
-
import '../../core/Breadcrumbs/Breadcrumbs.theme.js';
|
|
32
|
-
import { Button } from '../../core/Button/Button.js';
|
|
33
|
-
import '../../core/ButtonGroup/ButtonGroup.js';
|
|
34
|
-
import '../../core/ButtonGroup/ButtonGroupSeparator.js';
|
|
35
|
-
import '../../core/ButtonGroup/ButtonGroupText.js';
|
|
36
|
-
import '../../core/Calendar/Calendar.js';
|
|
37
|
-
import '../../core/Calendar/CalendarMini/CalendarMini.js';
|
|
38
|
-
import '../../core/Card/Card.js';
|
|
39
|
-
import '../../core/CardStack/CardStack.js';
|
|
40
|
-
import '../../core/Carousel/Carousel.js';
|
|
41
|
-
import '../../core/Carousel/CarouselBody.js';
|
|
42
|
-
import '../../core/CommandPalette/CommandPalette.js';
|
|
43
|
-
import '../../core/Separator/Separator.js';
|
|
44
|
-
import '../../core/Drawer/Drawer.js';
|
|
45
|
-
import '../../core/Drawer/DrawerBody.js';
|
|
46
12
|
import { Dropdown } from '../../core/Dropdown/Dropdown.js';
|
|
47
13
|
import '../../core/Dropdown/DropdownTrigger.js';
|
|
48
14
|
import '../../core/Dropdown/DropdownMenu.js';
|
|
@@ -50,109 +16,7 @@ import '../../core/Dropdown/DropdownItem.js';
|
|
|
50
16
|
import '../../core/Dropdown/DropdownSection.js';
|
|
51
17
|
import '../../core/Dropdown/DropdownSeparator.js';
|
|
52
18
|
import '../../core/Dropdown/Dropdown.theme.js';
|
|
53
|
-
import '../../core/
|
|
54
|
-
import '../../core/Kbd/Kbd.js';
|
|
55
|
-
import '../../core/MenuItem/MenuItem.js';
|
|
56
|
-
import '../../core/Link/Link.js';
|
|
57
|
-
import '../../core/Modal/Modal.js';
|
|
58
|
-
import '../../core/ModalStack/ModalStack.js';
|
|
59
|
-
import '../../core/PageHeading/PageHeading.js';
|
|
60
|
-
import '../../core/Pagination/Pagination.js';
|
|
61
|
-
import '../../core/Popover/Popover.js';
|
|
62
|
-
import '../../core/Popover/PopoverContext.js';
|
|
63
|
-
import '../../core/Popover/PopoverBody.js';
|
|
64
|
-
import '../../core/Progress/Progress.js';
|
|
65
|
-
import '../../core/Rating/Rating.js';
|
|
66
|
-
import '../../core/ScrollArea/ScrollArea.js';
|
|
67
|
-
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
68
|
-
import '../../core/Segmented/Segmented.js';
|
|
69
|
-
import '../../core/Skeleton/Skeleton.js';
|
|
70
|
-
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
71
|
-
import '../../core/Tabs/Tabs.js';
|
|
72
|
-
import '../../core/Tabs/TabsList.js';
|
|
73
|
-
import '../../core/Tabs/TabsTrigger.js';
|
|
74
|
-
import '../../core/Tabs/TabsBody.js';
|
|
75
|
-
import '../../core/Tabs/TabsContext.js';
|
|
76
|
-
import '../../core/Tooltip/Tooltip.js';
|
|
77
|
-
import '../../core/Tooltip/Tooltip.animations.js';
|
|
78
|
-
import '../../core/Tree/Tree.js';
|
|
79
|
-
import '../../core/Tag/Tag.js';
|
|
80
|
-
import '../../core/Alert/Alert.js';
|
|
81
|
-
import '../../core/Toast/Toast.js';
|
|
82
|
-
import '../../core/Toast/ToastProvider.js';
|
|
83
|
-
import { StopIcon } from '@heroicons/react/24/solid';
|
|
84
|
-
import '../../core/Spinner/Spinner.js';
|
|
85
|
-
import '../../core/Message/Message.js';
|
|
86
|
-
import '../../core/Message/TypeWriter.js';
|
|
87
|
-
import '../../core/Message/MessageBody.js';
|
|
88
|
-
import '@heroicons/react/16/solid';
|
|
89
|
-
import '../../core/Empty/Empty.js';
|
|
90
|
-
import '../../core/Masonry/Masonry.js';
|
|
91
|
-
import '../../core/DragDrop/DragDrop.js';
|
|
92
|
-
import '../../core/Sortable/Sortable.js';
|
|
93
|
-
import '../../core/NavItem/NavItem.js';
|
|
94
|
-
import '../../core/Sidebar/Sidebar.js';
|
|
95
|
-
import '../../core/Sidebar/SidebarHeader.js';
|
|
96
|
-
import '../../core/Sidebar/SidebarContent.js';
|
|
97
|
-
import '../../core/Sidebar/SidebarFooter.js';
|
|
98
|
-
import '../../core/Sidebar/SidebarNav.js';
|
|
99
|
-
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
100
|
-
import '../../core/Sidebar/SidebarToggle.js';
|
|
101
|
-
import '../../core/Sidebar/SidebarMobileTrigger.js';
|
|
102
|
-
import '../../core/Sidebar/SidebarUserProfile.js';
|
|
103
|
-
import '../../core/Sidebar/SidebarLogo.js';
|
|
104
|
-
import '../../core/Sidebar/SidebarSearch.js';
|
|
105
|
-
import '../../core/Sidebar/SidebarCard.js';
|
|
106
|
-
import '../../core/Sidebar/SidebarContext.js';
|
|
107
|
-
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
108
|
-
import '../../core/ContextMenu/ContextMenu.js';
|
|
109
|
-
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
110
|
-
import '../../core/Pill/Pill.js';
|
|
111
|
-
import '../../core/Icon/Icon.js';
|
|
112
|
-
import '../../core/ImagePlaceholder/ImagePlaceholder.js';
|
|
113
|
-
import '../../forms/TimePicker/WheelColumn.js';
|
|
114
|
-
import '../../forms/TimePicker/TimePicker.theme.js';
|
|
115
|
-
import '../../forms/Slider/Slider.js';
|
|
116
|
-
import '../../forms/Slider/Slider.theme.js';
|
|
117
|
-
import '../../forms/Signature/Signature.js';
|
|
118
|
-
import '../../forms/Signature/Signature.theme.js';
|
|
119
|
-
import '../../forms/RichTextEditor/RichTextEditor.js';
|
|
120
|
-
import '../../forms/RichTextEditor/RichTextEditor.theme.js';
|
|
121
|
-
import '../../forms/InputOTP/InputOTP.js';
|
|
122
|
-
import '../../forms/InputOTP/InputOTP.theme.js';
|
|
123
|
-
import '../../forms/InputCreditCard/InputCreditCard.js';
|
|
124
|
-
import '../../forms/InputCreditCard/InputCreditCard.theme.js';
|
|
125
|
-
import '../../forms/InputAddress/InputAddress.js';
|
|
126
|
-
import '../../forms/InputAddress/InputAddress.theme.js';
|
|
127
|
-
import '../../forms/InputDate/InputDate.js';
|
|
128
|
-
import '../../forms/InputCounter/InputCounter.js';
|
|
129
|
-
import '../../forms/InputTag/InputTag.js';
|
|
130
|
-
import '../../forms/InputTag/InputTag.theme.js';
|
|
131
|
-
import '../../forms/Combobox/Combobox.js';
|
|
132
|
-
import '../../forms/Combobox/Combobox.theme.js';
|
|
133
|
-
import '../../forms/ColorPicker/ColorPicker.js';
|
|
134
|
-
import '../../forms/ColorPicker/ColorPickerContext.js';
|
|
135
|
-
import '../../forms/ColorPicker/ColorPickerTrigger.js';
|
|
136
|
-
import '../../forms/ColorPicker/ColorPickerBody.js';
|
|
137
|
-
import '../../forms/ColorPicker/ColorPicker2DCanvas.js';
|
|
138
|
-
import '../../forms/ColorPicker/ColorPickerSwatch.js';
|
|
139
|
-
import '../../forms/ColorPicker/ColorPickerSliders.js';
|
|
140
|
-
import '../../forms/ColorPicker/ColorPickerInput.js';
|
|
141
|
-
import '../../forms/ColorPicker/ColorPickerFormatSelector.js';
|
|
142
|
-
import '../../forms/ColorPicker/ColorPickerEyeDropper.js';
|
|
143
|
-
import '../../forms/ColorPicker/ColorPickerPresets.js';
|
|
144
|
-
import '../../forms/ColorPicker/ColorPickerSavedColors.js';
|
|
145
|
-
import '../../forms/ColorPicker/ColorPickerHeader.js';
|
|
146
|
-
import '../../forms/ColorPicker/ColorPickerGradient.js';
|
|
147
|
-
import '../../forms/ColorPicker/ColorPickerImage.js';
|
|
148
|
-
import '../../forms/SelectableCard/SelectableCard.js';
|
|
149
|
-
import '../../forms/Mention/Mention.js';
|
|
150
|
-
import '../../forms/Mention/Mention.theme.js';
|
|
151
|
-
import '../../forms/CronInput/CronInput.js';
|
|
152
|
-
import '../../forms/CronInput/CronInput.theme.js';
|
|
153
|
-
import { promptInputTheme } from './PromptInput.theme.js';
|
|
154
|
-
import { VoiceRecorder } from './VoiceRecorder.js';
|
|
155
|
-
import { dropzoneContainerVariants, dropzoneChildVariants, dropzoneActionIconVariants, textareaSwapVariants, iconSwapVariants } from './PromptInput.animations.js';
|
|
19
|
+
import { Button } from '../../core/Button/Button.js';
|
|
156
20
|
|
|
157
21
|
/**
|
|
158
22
|
* Default model options for the model selector
|
|
@@ -3,95 +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/Carousel/CarouselBody.js';
|
|
24
|
-
import '../../core/CommandPalette/CommandPalette.js';
|
|
25
|
-
import '../../core/Separator/Separator.js';
|
|
26
|
-
import '../../core/Drawer/Drawer.js';
|
|
27
|
-
import '../../core/Drawer/DrawerBody.js';
|
|
28
|
-
import '../../core/Dropdown/Dropdown.js';
|
|
29
|
-
import '../../core/Dropdown/DropdownTrigger.js';
|
|
30
|
-
import '../../core/Dropdown/DropdownMenu.js';
|
|
31
|
-
import '../../core/Dropdown/DropdownItem.js';
|
|
32
|
-
import '../../core/Dropdown/DropdownSection.js';
|
|
33
|
-
import '../../core/Dropdown/DropdownSeparator.js';
|
|
34
|
-
import '../../core/Dropdown/Dropdown.theme.js';
|
|
35
|
-
import '../../core/DotSeparator/DotSeparator.js';
|
|
36
|
-
import '../../core/Kbd/Kbd.js';
|
|
37
|
-
import '../../core/MenuItem/MenuItem.js';
|
|
38
|
-
import '../../core/Link/Link.js';
|
|
39
|
-
import '../../core/Modal/Modal.js';
|
|
40
|
-
import '../../core/ModalStack/ModalStack.js';
|
|
41
|
-
import '../../core/PageHeading/PageHeading.js';
|
|
42
|
-
import '../../core/Pagination/Pagination.js';
|
|
43
|
-
import '../../core/Popover/Popover.js';
|
|
44
|
-
import '../../core/Popover/PopoverContext.js';
|
|
45
|
-
import '../../core/Popover/PopoverBody.js';
|
|
46
|
-
import '../../core/Progress/Progress.js';
|
|
47
|
-
import '../../core/Rating/Rating.js';
|
|
48
|
-
import '../../core/ScrollArea/ScrollArea.js';
|
|
49
|
-
import '../../core/ScrollArea/smooth/SmoothScrollEngine.js';
|
|
50
|
-
import '../../core/Segmented/Segmented.js';
|
|
51
|
-
import '../../core/Skeleton/Skeleton.js';
|
|
52
|
-
import '../../core/SlidingNumber/SlidingNumber.js';
|
|
53
|
-
import '../../core/Tabs/Tabs.js';
|
|
54
|
-
import '../../core/Tabs/TabsList.js';
|
|
55
|
-
import '../../core/Tabs/TabsTrigger.js';
|
|
56
|
-
import '../../core/Tabs/TabsBody.js';
|
|
57
|
-
import '../../core/Tabs/TabsContext.js';
|
|
58
|
-
import '../../core/Tooltip/Tooltip.js';
|
|
59
|
-
import '../../core/Tooltip/Tooltip.animations.js';
|
|
60
|
-
import '../../core/Tree/Tree.js';
|
|
61
|
-
import '../../core/Tag/Tag.js';
|
|
62
|
-
import '../../core/Alert/Alert.js';
|
|
63
|
-
import '../../core/Toast/Toast.js';
|
|
64
|
-
import '../../core/Toast/ToastProvider.js';
|
|
65
|
-
import '@heroicons/react/24/solid';
|
|
66
|
-
import '../../core/Spinner/Spinner.js';
|
|
67
|
-
import '../../core/Message/Message.js';
|
|
68
|
-
import '../../core/Message/TypeWriter.js';
|
|
69
|
-
import '../../core/Message/MessageBody.js';
|
|
70
|
-
import '@heroicons/react/16/solid';
|
|
71
|
-
import '../../core/Empty/Empty.js';
|
|
72
|
-
import '../../core/Masonry/Masonry.js';
|
|
73
|
-
import '../../core/DragDrop/DragDrop.js';
|
|
74
|
-
import '../../core/Sortable/Sortable.js';
|
|
75
|
-
import '../../core/NavItem/NavItem.js';
|
|
76
|
-
import '../../core/Sidebar/Sidebar.js';
|
|
77
|
-
import '../../core/Sidebar/SidebarHeader.js';
|
|
78
|
-
import '../../core/Sidebar/SidebarContent.js';
|
|
79
|
-
import '../../core/Sidebar/SidebarFooter.js';
|
|
80
|
-
import '../../core/Sidebar/SidebarNav.js';
|
|
81
|
-
import '../../core/Sidebar/SidebarNavGroup.js';
|
|
82
|
-
import '../../core/Sidebar/SidebarToggle.js';
|
|
83
|
-
import '../../core/Sidebar/SidebarMobileTrigger.js';
|
|
84
|
-
import '../../core/Sidebar/SidebarUserProfile.js';
|
|
85
|
-
import '../../core/Sidebar/SidebarLogo.js';
|
|
86
|
-
import '../../core/Sidebar/SidebarSearch.js';
|
|
87
|
-
import '../../core/Sidebar/SidebarCard.js';
|
|
88
|
-
import '../../core/Sidebar/SidebarContext.js';
|
|
89
|
-
import '../../core/OfflineIndicator/OfflineIndicator.js';
|
|
90
|
-
import '../../core/ContextMenu/ContextMenu.js';
|
|
91
|
-
import '../../core/ContextMenu/ContextMenu.theme.js';
|
|
92
|
-
import '../../core/Pill/Pill.js';
|
|
93
|
-
import '../../core/Icon/Icon.js';
|
|
94
|
-
import '../../core/ImagePlaceholder/ImagePlaceholder.js';
|
|
95
7
|
|
|
96
8
|
/**
|
|
97
9
|
* Format seconds into MM:SS display
|
|
@@ -4,7 +4,7 @@ const tokenCounterTheme = {
|
|
|
4
4
|
countStyle: "font-medium text-[var(--color-text-primary)]",
|
|
5
5
|
labelStyle: "text-[var(--color-text-muted)]",
|
|
6
6
|
costStyle: "text-[var(--color-text-muted)] font-mono",
|
|
7
|
-
progressStyle: "h-1 bg-[var(--color-surface-sunken)] rounded-full overflow-hidden",
|
|
7
|
+
progressStyle: "h-1 bg-[var(--color-surface-sunken)] rounded-full overflow-hidden shadow-inner-real-sm",
|
|
8
8
|
progressBarStyle: "h-full bg-[var(--color-primary)] transition-all duration-200",
|
|
9
9
|
sizes: {
|
|
10
10
|
sm: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type BackgroundVariant = "dots" | "lines";
|
|
2
|
+
export interface BackgroundProps {
|
|
3
|
+
/** `dots` (default) or a `lines` grid. */
|
|
4
|
+
variant?: BackgroundVariant;
|
|
5
|
+
/** Spacing between dots / grid lines in flow units. Defaults to `18`. */
|
|
6
|
+
gap?: number;
|
|
7
|
+
/** Dot radius (px, constant) or line stroke width. Defaults to `1`. */
|
|
8
|
+
size?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A pannable / zoomable canvas backdrop. Lives at the pane level (behind the
|
|
13
|
+
* world) and follows the viewport via the SVG pattern origin + tile size, so the
|
|
14
|
+
* pattern tracks pan and its spacing scales with zoom. Non-interactive.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Background({ variant, gap, size, className, }: BackgroundProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace Background {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
import { useNodeCanvasContext } from './context/CanvasContext.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A pannable / zoomable canvas backdrop. Lives at the pane level (behind the
|
|
8
|
+
* world) and follows the viewport via the SVG pattern origin + tile size, so the
|
|
9
|
+
* pattern tracks pan and its spacing scales with zoom. Non-interactive.
|
|
10
|
+
*/
|
|
11
|
+
function Background({ variant = "dots", gap = 18, size = 1, className, }) {
|
|
12
|
+
const { viewport } = useNodeCanvasContext();
|
|
13
|
+
const id = useId();
|
|
14
|
+
const tile = gap * viewport.zoom;
|
|
15
|
+
return (jsxs("svg", { className: cn(
|
|
16
|
+
// border-secondary, not border: the hairline (93%) sits only 1% darker
|
|
17
|
+
// than the sunken pane (94%) and disappears — -secondary (87%) restores
|
|
18
|
+
// the ~7% delta the pattern had on the old white floor.
|
|
19
|
+
"absolute inset-0 w-full h-full z-0 pointer-events-none text-[var(--color-border-secondary)]", className), "aria-hidden": "true", children: [jsx("pattern", { id: id, x: viewport.x, y: viewport.y, width: tile, height: tile, patternUnits: "userSpaceOnUse", children: variant === "dots" ? (jsx("circle", { cx: tile / 2, cy: tile / 2, r: size, fill: "currentColor" })) : (jsx("path", { d: `M ${tile} 0 L 0 0 0 ${tile}`, fill: "none", stroke: "currentColor", strokeWidth: size })) }), jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })] }));
|
|
20
|
+
}
|
|
21
|
+
Background.displayName = "Background";
|
|
22
|
+
|
|
23
|
+
export { Background };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BaseNodeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Reflects selection with a primary-colored border. */
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Optional presentational shell for custom nodes — a themeable surface card so
|
|
9
|
+
* node types look consistent without re-deriving styles. Purely visual: the node
|
|
10
|
+
* wrapper rendered by `NodeRenderer` owns positioning, focus, drag, and selection.
|
|
11
|
+
*
|
|
12
|
+
* Put interactive controls inside and mark them `.nodrag` (or use a native
|
|
13
|
+
* `<button>`/`<input>`) to keep them clickable without starting a drag.
|
|
14
|
+
*/
|
|
15
|
+
export declare const BaseNode: React.ForwardRefExoticComponent<BaseNodeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Optional presentational shell for custom nodes — a themeable surface card so
|
|
7
|
+
* node types look consistent without re-deriving styles. Purely visual: the node
|
|
8
|
+
* wrapper rendered by `NodeRenderer` owns positioning, focus, drag, and selection.
|
|
9
|
+
*
|
|
10
|
+
* Put interactive controls inside and mark them `.nodrag` (or use a native
|
|
11
|
+
* `<button>`/`<input>`) to keep them clickable without starting a drag.
|
|
12
|
+
*/
|
|
13
|
+
const BaseNode = React__default.forwardRef(function BaseNode({ selected, className, children, ...rest }, ref) {
|
|
14
|
+
return (jsx("div", { ref: ref, className: cn("relative min-w-[8rem] rounded-[var(--canvas-node-radius,0.75rem)] border bg-[var(--color-surface)] shadow-sm", "transition-all duration-300", selected
|
|
15
|
+
? "border-[var(--color-surface)] ring-4 ring-[var(--color-primary)]"
|
|
16
|
+
: "border-[var(--color-border)] group-hover:border-[var(--color-border-hover)] group-hover:shadow-real-md", className), ...rest, children: children }));
|
|
17
|
+
});
|
|
18
|
+
BaseNode.displayName = "BaseNode";
|
|
19
|
+
|
|
20
|
+
export { BaseNode };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
declare const POSITIONS: {
|
|
3
|
+
readonly bottom: "bottom-6 left-1/2 -translate-x-1/2";
|
|
4
|
+
readonly top: "top-6 left-1/2 -translate-x-1/2";
|
|
5
|
+
};
|
|
6
|
+
/** A node type that can be added from the toolbar palette. */
|
|
7
|
+
export interface CanvasToolbarNodeOption {
|
|
8
|
+
type: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface CanvasToolbarProps {
|
|
13
|
+
/** Node types addable from the palette (consumer adds them via `onAddNode`). */
|
|
14
|
+
nodeOptions?: CanvasToolbarNodeOption[];
|
|
15
|
+
onAddNode?: (type: string) => void;
|
|
16
|
+
/** Show the Select / Hand (pan) tool toggle. Defaults to `true`. */
|
|
17
|
+
showTools?: boolean;
|
|
18
|
+
position?: keyof typeof POSITIONS;
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Custom app actions rendered at the end (e.g. Run, Undo/Redo). */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A floating, bottom-center canvas toolbar (FigJam/tldraw style). Built-in **Select /
|
|
25
|
+
* Hand** tool toggle (drives the engine `tool` mode) and a single **"+ Add node"**
|
|
26
|
+
* trigger opening a Dropdown menu of `nodeOptions`; a `children` slot holds
|
|
27
|
+
* app-specific actions. Marked `data-flikkui-nopan` so the pane never pans or steals
|
|
28
|
+
* clicks from it (the Dropdown menu portals with `data-flikkui-portal`, same rule).
|
|
29
|
+
*/
|
|
30
|
+
export declare function CanvasToolbar({ nodeOptions, onAddNode, showTools, position, className, children, }: CanvasToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare namespace CanvasToolbar {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CursorArrowRaysIcon, HandRaisedIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
import { Button } from '../core/Button/Button.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { Dropdown } from '../core/Dropdown/Dropdown.js';
|
|
7
|
+
import '../core/Dropdown/DropdownTrigger.js';
|
|
8
|
+
import '../core/Dropdown/DropdownMenu.js';
|
|
9
|
+
import '../core/Dropdown/DropdownItem.js';
|
|
10
|
+
import '../core/Dropdown/DropdownSection.js';
|
|
11
|
+
import '../core/Dropdown/DropdownSeparator.js';
|
|
12
|
+
import '../core/Dropdown/Dropdown.theme.js';
|
|
13
|
+
import { useNodeCanvasContext } from './context/CanvasContext.js';
|
|
14
|
+
|
|
15
|
+
const POSITIONS = {
|
|
16
|
+
bottom: "bottom-6 left-1/2 -translate-x-1/2",
|
|
17
|
+
top: "top-6 left-1/2 -translate-x-1/2",
|
|
18
|
+
};
|
|
19
|
+
const Divider = () => (jsx("span", { className: "mx-0.5 h-6 w-px bg-[var(--color-border)]", "aria-hidden": "true" }));
|
|
20
|
+
/**
|
|
21
|
+
* A floating, bottom-center canvas toolbar (FigJam/tldraw style). Built-in **Select /
|
|
22
|
+
* Hand** tool toggle (drives the engine `tool` mode) and a single **"+ Add node"**
|
|
23
|
+
* trigger opening a Dropdown menu of `nodeOptions`; a `children` slot holds
|
|
24
|
+
* app-specific actions. Marked `data-flikkui-nopan` so the pane never pans or steals
|
|
25
|
+
* clicks from it (the Dropdown menu portals with `data-flikkui-portal`, same rule).
|
|
26
|
+
*/
|
|
27
|
+
function CanvasToolbar({ nodeOptions, onAddNode, showTools = true, position = "bottom", className, children, }) {
|
|
28
|
+
const { tool, setTool } = useNodeCanvasContext();
|
|
29
|
+
const hasNodes = !!(nodeOptions === null || nodeOptions === void 0 ? void 0 : nodeOptions.length);
|
|
30
|
+
return (jsxs("div", { "data-flikkui-nopan": "", className: cn("absolute z-30 flex items-center gap-1 rounded-full border border-[var(--color-border)] bg-[var(--color-surface-overlay)]/60 backdrop-blur-lg p-1 shadow-real-lg", POSITIONS[position], className), children: [showTools && (jsxs(Fragment, { children: [jsx(Button, { variant: tool === "select" ? "soft" : "ghost", color: "neutral", size: "sm", iconOnly: true, onClick: () => setTool("select"), "aria-label": "Select tool", "aria-pressed": tool === "select", className: cn("rounded-full", tool === "select" && "shadow-inner"), children: jsx(CursorArrowRaysIcon, { className: "size-4" }) }), jsx(Button, { variant: tool === "pan" ? "soft" : "ghost", color: "neutral", size: "sm", iconOnly: true, onClick: () => setTool("pan"), "aria-label": "Hand (pan) tool", "aria-pressed": tool === "pan", className: cn("rounded-full", tool === "pan" && "shadow-inner"), children: jsx(HandRaisedIcon, { className: "size-4" }) })] })), showTools && hasNodes && jsx(Divider, {}), hasNodes && (jsxs(Dropdown, { placement: "top", offset: 10, onAction: (type) => onAddNode === null || onAddNode === void 0 ? void 0 : onAddNode(type), children: [jsx(Dropdown.Trigger, { children: jsxs(Button, { variant: "ghost", color: "neutral", size: "sm", className: "rounded-full gap-1.5", children: [jsx(PlusIcon, { className: "size-4" }), "Add node"] }) }), jsx(Dropdown.Menu, { "aria-label": "Add node", children: nodeOptions === null || nodeOptions === void 0 ? void 0 : nodeOptions.map((opt) => (jsx(Dropdown.Item, { itemKey: opt.type, startContent: opt.icon && (jsx("span", { className: "size-4 grid place-items-center text-[var(--color-text-muted)]", children: opt.icon })), children: opt.label }, opt.type))) })] })), children && (jsxs(Fragment, { children: [(showTools || hasNodes) && jsx(Divider, {}), children] }))] }));
|
|
31
|
+
}
|
|
32
|
+
CanvasToolbar.displayName = "CanvasToolbar";
|
|
33
|
+
|
|
34
|
+
export { CanvasToolbar };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { EdgeType, HandlePosition, XYPosition } from "./NodeCanvas.types";
|
|
3
|
+
/** Cubic-bezier path curving out from each handle's side. */
|
|
4
|
+
export declare function buildBezierPath(source: XYPosition, sourceSide: HandlePosition, target: XYPosition, targetSide: HandlePosition): string;
|
|
5
|
+
/** Build an orthogonal path, optionally rounding the corners (smoothstep). */
|
|
6
|
+
export declare function buildStepPath(source: XYPosition, sourceSide: HandlePosition, target: XYPosition, rounded: boolean, radius?: number): string;
|
|
7
|
+
/** The on-curve midpoint of an edge (for placing the × delete button). */
|
|
8
|
+
export declare function edgeMidpoint(type: EdgeType, source: XYPosition, sourceSide: HandlePosition, target: XYPosition, targetSide: HandlePosition): XYPosition;
|
|
9
|
+
/** Dispatch to the routing builder for the given edge type. */
|
|
10
|
+
export declare function buildEdgePath(type: EdgeType, source: XYPosition, sourceSide: HandlePosition, target: XYPosition, targetSide: HandlePosition): string;
|
|
11
|
+
export interface EdgeRenderProps {
|
|
12
|
+
id?: string;
|
|
13
|
+
type?: EdgeType;
|
|
14
|
+
source: XYPosition;
|
|
15
|
+
sourcePosition: HandlePosition;
|
|
16
|
+
target: XYPosition;
|
|
17
|
+
targetPosition: HandlePosition;
|
|
18
|
+
selected?: boolean;
|
|
19
|
+
/** Stroke color override (any CSS color). Selection still strokes `--color-primary`. */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Render dashed (used for the in-progress connection ghost). */
|
|
22
|
+
dashed?: boolean;
|
|
23
|
+
/** When provided, the edge is interactive (a wide transparent hit-path is rendered). */
|
|
24
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A single edge (bezier / step / smoothstep). Uses `vectorEffect="non-scaling-stroke"`
|
|
28
|
+
* so the line keeps a constant on-screen width at any zoom. When `onPointerDown` is
|
|
29
|
+
* set, a wide transparent hit-path makes it easy to click, and the visible stroke
|
|
30
|
+
* emphasizes on hover (via the group) and when selected.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Edge({ id, type, source, sourcePosition, target, targetPosition, selected, color, dashed, onPointerDown, }: EdgeRenderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace Edge {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cn } from '../../utils/cn.js';
|
|
3
|
+
|
|
4
|
+
function controlPoint(p, side, dist) {
|
|
5
|
+
switch (side) {
|
|
6
|
+
case "left":
|
|
7
|
+
return { x: p.x - dist, y: p.y };
|
|
8
|
+
case "right":
|
|
9
|
+
return { x: p.x + dist, y: p.y };
|
|
10
|
+
case "top":
|
|
11
|
+
return { x: p.x, y: p.y - dist };
|
|
12
|
+
case "bottom":
|
|
13
|
+
return { x: p.x, y: p.y + dist };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Cubic-bezier path curving out from each handle's side. */
|
|
17
|
+
function buildBezierPath(source, sourceSide, target, targetSide) {
|
|
18
|
+
const dist = Math.max(Math.hypot(target.x - source.x, target.y - source.y) * 0.4, 30);
|
|
19
|
+
const c1 = controlPoint(source, sourceSide, dist);
|
|
20
|
+
const c2 = controlPoint(target, targetSide, dist);
|
|
21
|
+
return `M ${source.x},${source.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${target.x},${target.y}`;
|
|
22
|
+
}
|
|
23
|
+
/** Orthogonal waypoints routed through a mid-line based on the source handle axis. */
|
|
24
|
+
function stepWaypoints(source, sourceSide, target) {
|
|
25
|
+
const horizontal = sourceSide === "left" || sourceSide === "right";
|
|
26
|
+
if (horizontal) {
|
|
27
|
+
const mx = (source.x + target.x) / 2;
|
|
28
|
+
return [source, { x: mx, y: source.y }, { x: mx, y: target.y }, target];
|
|
29
|
+
}
|
|
30
|
+
const my = (source.y + target.y) / 2;
|
|
31
|
+
return [source, { x: source.x, y: my }, { x: target.x, y: my }, target];
|
|
32
|
+
}
|
|
33
|
+
/** Build an orthogonal path, optionally rounding the corners (smoothstep). */
|
|
34
|
+
function buildStepPath(source, sourceSide, target, rounded, radius = 8) {
|
|
35
|
+
const pts = stepWaypoints(source, sourceSide, target);
|
|
36
|
+
if (!rounded) {
|
|
37
|
+
return (`M ${pts[0].x},${pts[0].y} ` +
|
|
38
|
+
pts.slice(1).map((p) => `L ${p.x},${p.y}`).join(" "));
|
|
39
|
+
}
|
|
40
|
+
let d = `M ${pts[0].x},${pts[0].y}`;
|
|
41
|
+
for (let i = 1; i < pts.length - 1; i++) {
|
|
42
|
+
const p0 = pts[i - 1];
|
|
43
|
+
const p1 = pts[i];
|
|
44
|
+
const p2 = pts[i + 1];
|
|
45
|
+
const len1 = Math.hypot(p1.x - p0.x, p1.y - p0.y) || 1;
|
|
46
|
+
const len2 = Math.hypot(p2.x - p1.x, p2.y - p1.y) || 1;
|
|
47
|
+
const r = Math.min(radius, len1 / 2, len2 / 2);
|
|
48
|
+
const a = { x: p1.x - ((p1.x - p0.x) / len1) * r, y: p1.y - ((p1.y - p0.y) / len1) * r };
|
|
49
|
+
const b = { x: p1.x + ((p2.x - p1.x) / len2) * r, y: p1.y + ((p2.y - p1.y) / len2) * r };
|
|
50
|
+
d += ` L ${a.x},${a.y} Q ${p1.x},${p1.y} ${b.x},${b.y}`;
|
|
51
|
+
}
|
|
52
|
+
const last = pts[pts.length - 1];
|
|
53
|
+
d += ` L ${last.x},${last.y}`;
|
|
54
|
+
return d;
|
|
55
|
+
}
|
|
56
|
+
/** The on-curve midpoint of an edge (for placing the × delete button). */
|
|
57
|
+
function edgeMidpoint(type, source, sourceSide, target, targetSide) {
|
|
58
|
+
if (type === "step" || type === "smoothstep") {
|
|
59
|
+
const pts = stepWaypoints(source, sourceSide, target);
|
|
60
|
+
return { x: (pts[1].x + pts[2].x) / 2, y: (pts[1].y + pts[2].y) / 2 };
|
|
61
|
+
}
|
|
62
|
+
// Cubic bezier evaluated at t = 0.5.
|
|
63
|
+
const dist = Math.max(Math.hypot(target.x - source.x, target.y - source.y) * 0.4, 30);
|
|
64
|
+
const c1 = controlPoint(source, sourceSide, dist);
|
|
65
|
+
const c2 = controlPoint(target, targetSide, dist);
|
|
66
|
+
return {
|
|
67
|
+
x: 0.125 * source.x + 0.375 * c1.x + 0.375 * c2.x + 0.125 * target.x,
|
|
68
|
+
y: 0.125 * source.y + 0.375 * c1.y + 0.375 * c2.y + 0.125 * target.y,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Dispatch to the routing builder for the given edge type. */
|
|
72
|
+
function buildEdgePath(type, source, sourceSide, target, targetSide) {
|
|
73
|
+
if (type === "step")
|
|
74
|
+
return buildStepPath(source, sourceSide, target, false);
|
|
75
|
+
if (type === "smoothstep")
|
|
76
|
+
return buildStepPath(source, sourceSide, target, true);
|
|
77
|
+
return buildBezierPath(source, sourceSide, target, targetSide);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A single edge (bezier / step / smoothstep). Uses `vectorEffect="non-scaling-stroke"`
|
|
81
|
+
* so the line keeps a constant on-screen width at any zoom. When `onPointerDown` is
|
|
82
|
+
* set, a wide transparent hit-path makes it easy to click, and the visible stroke
|
|
83
|
+
* emphasizes on hover (via the group) and when selected.
|
|
84
|
+
*/
|
|
85
|
+
function Edge({ id, type = "bezier", source, sourcePosition, target, targetPosition, selected, color, dashed, onPointerDown, }) {
|
|
86
|
+
const d = buildEdgePath(type, source, sourcePosition, target, targetPosition);
|
|
87
|
+
// Inline stroke beats the class strokes below; selection keeps priority.
|
|
88
|
+
const colorStyle = color && !selected ? { stroke: color } : undefined;
|
|
89
|
+
return (jsxs("g", { className: "group", children: [onPointerDown && (jsx("path", { d: d, fill: "none", stroke: "transparent", strokeWidth: 16, strokeLinecap: "round", "data-flikkui-edge": "", "data-edge-id": id, style: { pointerEvents: "stroke", cursor: "pointer" }, onPointerDown: onPointerDown })), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 8 : 6, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("pointer-events-none opacity-0 transition-opacity duration-150", selected
|
|
90
|
+
? "opacity-20 stroke-[var(--color-primary)]"
|
|
91
|
+
: "stroke-[var(--color-primary)] group-hover:opacity-10") }), jsx("path", { d: d, fill: "none", strokeWidth: selected ? 2.5 : 1.5, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", strokeDasharray: dashed ? "5 4" : undefined, style: colorStyle, className: cn("transition-[stroke,stroke-width] duration-150", selected
|
|
92
|
+
? "stroke-[var(--color-primary)]"
|
|
93
|
+
: "stroke-[var(--color-border)] group-hover:stroke-[var(--color-border-hover)]") })] }));
|
|
94
|
+
}
|
|
95
|
+
Edge.displayName = "Edge";
|
|
96
|
+
|
|
97
|
+
export { Edge, buildBezierPath, buildEdgePath, buildStepPath, edgeMidpoint };
|