@flikk/ui 1.0.0-beta.31 → 1.0.0-beta.32
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/CHANGELOG.md +295 -22
- package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
- package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
- package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
- package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
- package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
- package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
- package/dist/components/ai/AgentRequest/index.d.ts +3 -0
- package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +2 -2
- package/dist/components/ai/PromptInput/PromptInput.theme.js +2 -2
- package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
- package/dist/components/ai/Reasoning/Reasoning.js +27 -3
- package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
- package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
- package/dist/components/ai/Reasoning/Reasoning.types.d.ts +58 -5
- package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
- package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
- package/dist/components/ai/Reasoning/index.d.ts +2 -1
- package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
- package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
- package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
- package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
- package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
- package/dist/components/ai/StreamingResponse/StreamingResponse.js +13 -7
- package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
- package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
- package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
- package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
- package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
- package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
- package/dist/components/ai/index.d.ts +3 -2
- package/dist/components/ai/index.js +4 -0
- package/dist/components/canvas/BaseNode.js +1 -1
- package/dist/components/canvas/CanvasToolbar.js +0 -1
- package/dist/components/canvas/Edge.js +2 -2
- package/dist/components/canvas/NodeControls.js +0 -1
- package/dist/components/canvas/NodeRenderer.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
- package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
- package/dist/components/charts/AreaChart/AreaChart.js +3 -3
- package/dist/components/charts/AreaChart/AreaChart.theme.js +3 -3
- package/dist/components/charts/BarChart/BarChart.js +4 -4
- package/dist/components/charts/ComboChart/BarRenderer.js +2 -2
- package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
- package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.js +1 -1
- package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
- package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
- package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +49 -42
- package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
- package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
- package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
- package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
- package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
- package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
- package/dist/components/charts/Heatmap/index.d.ts +1 -1
- package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
- package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
- package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
- package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +1 -1
- package/dist/components/charts/LineChart/LineChart.js +2 -2
- package/dist/components/charts/LollipopChart/LollipopChart.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +1 -1
- package/dist/components/charts/StackedBarChart/StackedBarChart.js +3 -3
- package/dist/components/charts/hooks/useChartAccessibility.js +9 -6
- package/dist/components/charts/index.d.ts +4 -8
- package/dist/components/charts/index.js +2 -4
- package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
- package/dist/components/charts/shared/index.d.ts +1 -1
- package/dist/components/charts/theme/chart.theme.js +3 -3
- package/dist/components/charts/utils/animation-utils.d.ts +12 -7
- package/dist/components/charts/utils/animation-utils.js +19 -19
- package/dist/components/core/Accordion/Accordion.theme.js +1 -1
- package/dist/components/core/Alert/Alert.animations.d.ts +11 -4
- package/dist/components/core/Alert/Alert.animations.js +11 -4
- package/dist/components/core/Alert/Alert.js +16 -2
- package/dist/components/core/Alert/Alert.theme.js +1 -1
- package/dist/components/core/Alert/Alert.types.d.ts +4 -2
- package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/core/Avatar/Avatar.theme.js +1 -1
- package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
- package/dist/components/core/Badge/Badge.animations.js +5 -84
- package/dist/components/core/Badge/Badge.d.ts +7 -4
- package/dist/components/core/Badge/Badge.js +27 -64
- package/dist/components/core/Badge/Badge.theme.js +8 -12
- package/dist/components/core/Badge/Badge.types.d.ts +18 -34
- package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +4 -4
- package/dist/components/core/Button/Button.js +7 -43
- package/dist/components/core/Button/Button.theme.js +2 -2
- package/dist/components/core/Button/Button.types.d.ts +8 -12
- package/dist/components/core/Button/index.d.ts +0 -2
- package/dist/components/core/Calendar/Calendar.theme.js +1 -1
- package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
- package/dist/components/core/Card/Card.js +7 -2
- package/dist/components/core/Card/Card.theme.js +29 -1
- package/dist/components/core/Card/Card.types.d.ts +20 -0
- package/dist/components/core/Card/CardBody.js +9 -1
- package/dist/components/core/Card/CardContext.d.ts +13 -0
- package/dist/components/core/Card/CardContext.js +14 -0
- package/dist/components/core/Card/CardHeader.js +4 -1
- package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
- package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
- package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
- package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
- package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +21 -8
- package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
- package/dist/components/core/Drawer/Drawer.theme.js +1 -1
- package/dist/components/core/Drawer/DrawerHeader.js +0 -1
- package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
- package/dist/components/core/Link/Link.js +1 -1
- package/dist/components/core/Masonry/Masonry.theme.js +1 -1
- package/dist/components/core/MenuItem/MenuItem.js +2 -1
- package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
- package/dist/components/core/Message/Message.js +2 -0
- package/dist/components/core/Message/Message.theme.js +3 -3
- package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
- package/dist/components/core/Modal/Modal.animations.js +50 -11
- package/dist/components/core/Modal/Modal.js +5 -1
- package/dist/components/core/Modal/Modal.theme.js +1 -1
- package/dist/components/core/Modal/ModalHeader.js +0 -1
- package/dist/components/core/ModalStack/ModalStackModal.js +3 -1
- package/dist/components/core/NavItem/NavItem.js +3 -2
- package/dist/components/core/NavItem/NavItem.theme.js +1 -1
- package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +4 -2
- package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
- package/dist/components/core/Pagination/Pagination.theme.js +2 -2
- package/dist/components/core/Pill/Pill.js +2 -1
- package/dist/components/core/Pill/Pill.theme.js +4 -2
- package/dist/components/core/Popover/PopoverBody.js +16 -5
- package/dist/components/core/Progress/Progress.d.ts +0 -25
- package/dist/components/core/Progress/Progress.js +79 -11
- package/dist/components/core/Progress/Progress.theme.js +17 -0
- package/dist/components/core/Progress/Progress.types.d.ts +47 -1
- package/dist/components/core/Rating/Rating.theme.js +1 -1
- package/dist/components/core/Rating/Rating.types.d.ts +3 -2
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
- package/dist/components/core/Segmented/Segmented.theme.js +3 -3
- package/dist/components/core/Segmented/SegmentedContext.js +1 -0
- package/dist/components/core/Sidebar/Sidebar.js +5 -2
- package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
- package/dist/components/core/Sidebar/SidebarContent.js +1 -1
- package/dist/components/core/Sidebar/SidebarHeader.js +1 -1
- package/dist/components/core/Sidebar/SidebarSearch.js +2 -2
- package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
- package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
- package/dist/components/core/Sortable/Sortable.theme.js +1 -1
- package/dist/components/core/Tabs/Tabs.theme.js +1 -1
- package/dist/components/core/Tag/Tag.theme.js +1 -1
- package/dist/components/core/Toast/ToastProvider.js +1 -1
- package/dist/components/core/Tree/Tree.theme.js +1 -1
- package/dist/components/core/index.d.ts +0 -2
- package/dist/components/core/index.js +0 -4
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
- package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
- package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/core/shared/Ripple.d.ts +16 -0
- package/dist/components/core/shared/Ripple.js +141 -0
- package/dist/components/data-display/GanttChart/GanttChart.theme.js +6 -6
- package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
- package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
- package/dist/components/data-display/GanttChart/GanttToolbar.js +0 -1
- package/dist/components/data-display/KPI/KPI.js +11 -20
- package/dist/components/data-display/KPI/KPI.theme.js +8 -4
- package/dist/components/data-display/Metric/Metric.theme.js +4 -4
- package/dist/components/data-display/Table/Table.theme.js +2 -2
- package/dist/components/data-display/Table/TableColumnManager.js +1 -2
- package/dist/components/data-display/Table/TableContext.js +1 -0
- package/dist/components/data-display/Table/TableFilter.js +9 -2
- package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
- package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
- package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
- package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
- package/dist/components/effects/Overlay/Overlay.js +7 -3
- package/dist/components/effects/index.d.ts +0 -32
- package/dist/components/effects/index.js +0 -16
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
- package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
- package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
- package/dist/components/effects/shared/index.d.ts +1 -3
- package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
- package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
- package/dist/components/forms/Checkbox/Checkbox.theme.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerHeader.js +1 -1
- package/dist/components/forms/ColorPicker/ColorPickerImage.js +1 -1
- package/dist/components/forms/Combobox/Combobox.js +2 -0
- package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
- package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
- package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
- package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
- package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
- package/dist/components/forms/Radio/Radio.theme.js +1 -1
- package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
- package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1680
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
- package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
- package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
- package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
- package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
- package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
- package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
- package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
- package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
- package/dist/components/forms/RichTextEditor/editorState.js +103 -0
- package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
- package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
- package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
- package/dist/components/forms/Select/Select.js +4 -4
- package/dist/components/forms/Select/Select.types.d.ts +70 -7
- package/dist/components/forms/Select/useSelectState.d.ts +9 -3
- package/dist/components/forms/Select/useSelectState.js +4 -1
- package/dist/components/forms/SelectableCard/SelectableCard.js +2 -1
- package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
- package/dist/components/forms/Switch/Switch.theme.js +2 -2
- package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -1
- package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
- package/dist/components/forms/forms.theme.js +19 -5
- package/dist/components/forms/index.js +1 -0
- package/dist/components/generative/FormShell.d.ts +22 -0
- package/dist/components/generative/FormShell.js +102 -0
- package/dist/components/generative/GenerativeView.d.ts +52 -1
- package/dist/components/generative/GenerativeView.js +203 -11
- package/dist/components/generative/actions.d.ts +5 -0
- package/dist/components/generative/ai-sdk/index.d.ts +1 -0
- package/dist/components/generative/ai-sdk/index.js +1 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
- package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
- package/dist/components/generative/fieldBinding.d.ts +31 -0
- package/dist/components/generative/fieldBinding.js +33 -0
- package/dist/components/generative/fieldBinding.test.d.ts +1 -0
- package/dist/components/generative/formScope.d.ts +71 -0
- package/dist/components/generative/formScope.js +135 -0
- package/dist/components/generative/index.d.ts +4 -0
- package/dist/components/generative/index.js +4 -0
- package/dist/components/generative/registry.d.ts +2 -0
- package/dist/components/generative/registry.js +10 -10
- package/dist/components/generative/schema.generated.js +178 -292
- package/dist/components/generative/toToolResult.d.ts +21 -0
- package/dist/components/generative/toToolResult.js +15 -0
- package/dist/components/generative/toToolResult.test.d.ts +1 -0
- package/dist/components/generative/validate.d.ts +10 -1
- package/dist/components/generative/validate.js +126 -11
- package/dist/components/layout/Grid/Grid.js +1 -0
- package/dist/components/layout/Section/Section.theme.js +1 -1
- package/dist/components/layout/Stack/Stack.js +1 -0
- package/dist/generative.schema.json +178 -292
- package/dist/index.js +1 -4
- package/dist/registry.json +2599 -2375
- package/dist/shadcn-compat.css +5 -5
- package/dist/styles/theme.test.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/dist/test/render.d.ts +17 -0
- package/dist/themes/precision.css +232 -0
- package/dist/tools.json +179 -294
- package/dist/utils/index.d.ts +0 -1
- package/package.json +31 -1
- package/src/global.scss +21 -28
- package/src/styles/theme.css +124 -41
- package/src/styles/theme.test.ts +119 -0
- package/tailwind.preset.cjs +30 -20
- package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
- package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
- package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
- package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
- package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
- package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
- package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
- package/dist/components/charts/FunnelChart/index.d.ts +0 -4
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -208
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
- package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -60
- package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -19
- package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
- package/dist/components/core/Button/Button.ripple.d.ts +0 -71
- package/dist/components/core/Button/Button.ripple.js +0 -236
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
- package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
- package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
- package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
- package/dist/components/core/CardStack/CardStack.d.ts +0 -3
- package/dist/components/core/CardStack/CardStack.js +0 -187
- package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
- package/dist/components/core/CardStack/CardStack.theme.js +0 -33
- package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
- package/dist/components/core/CardStack/index.d.ts +0 -7
- package/dist/components/core/Carousel/Carousel.d.ts +0 -3
- package/dist/components/core/Carousel/Carousel.js +0 -83
- package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
- package/dist/components/core/Carousel/Carousel.theme.js +0 -20
- package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
- package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselBody.js +0 -59
- package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
- package/dist/components/core/Carousel/CarouselContext.js +0 -13
- package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselItem.js +0 -11
- package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselNext.js +0 -16
- package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
- package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
- package/dist/components/core/Carousel/index.d.ts +0 -3
- package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
- package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
- package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
- package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
- package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
- package/dist/components/effects/ColorPanels/index.d.ts +0 -2
- package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
- package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
- package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
- package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
- package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
- package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
- package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
- package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
- package/dist/components/effects/GlassEffect/index.d.ts +0 -2
- package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
- package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
- package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
- package/dist/components/effects/GlassSurface/index.d.ts +0 -2
- package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
- package/dist/components/effects/GodRays/GodRays.js +0 -68
- package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
- package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
- package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
- package/dist/components/effects/GodRays/GodRays.types.js +0 -3
- package/dist/components/effects/GodRays/index.d.ts +0 -2
- package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
- package/dist/components/effects/GridPattern/GridPattern.js +0 -65
- package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
- package/dist/components/effects/GridPattern/index.d.ts +0 -2
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
- package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
- package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
- package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
- package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
- package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
- package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
- package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
- package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
- package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
- package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
- package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
- package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
- package/dist/components/effects/ImageDithering/index.d.ts +0 -3
- package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
- package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
- package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
- package/dist/components/effects/MagneticElement/index.d.ts +0 -2
- package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
- package/dist/components/effects/Metaballs/Metaballs.js +0 -59
- package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
- package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
- package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
- package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
- package/dist/components/effects/Metaballs/index.d.ts +0 -2
- package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
- package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
- package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
- package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
- package/dist/components/effects/PaperTexture/index.d.ts +0 -2
- package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
- package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
- package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
- package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
- package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
- package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
- package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
- package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
- package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
- package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
- package/dist/components/effects/SmokeRing/index.d.ts +0 -2
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
- package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
- package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
- package/dist/components/effects/Water/Water.d.ts +0 -9
- package/dist/components/effects/Water/Water.js +0 -65
- package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
- package/dist/components/effects/Water/Water.shaders.js +0 -123
- package/dist/components/effects/Water/Water.types.d.ts +0 -25
- package/dist/components/effects/Water/index.d.ts +0 -2
- package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
- package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
- package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
- package/dist/components/effects/shared/imageUV.glsl.js +0 -26
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
- package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
- package/dist/utils/calendarUtils.d.ts +0 -60
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
- /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React__default, { useId, useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
4
|
-
import { cn } from '../../../utils/cn.js';
|
|
5
|
-
import { useDarkMode } from '../../../hooks/useDarkMode.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* GlassSurface Component
|
|
9
|
-
* Creates a realistic chromatic aberration glass effect using SVG filters.
|
|
10
|
-
* Works as a wrapper for any content.
|
|
11
|
-
*/
|
|
12
|
-
const GlassSurface = React__default.forwardRef(({ children, width, height, borderRadius = 20, borderWidth = 0.07, brightness: brightnessProp, opacity: opacityProp, blur: blurProp, displace: displaceProp, backgroundOpacity: backgroundOpacityProp, backgroundColor, saturation: saturationProp, distortionScale: distortionScaleProp, redOffset = 0, greenOffset = 10, blueOffset = 20, xChannel = "R", yChannel = "G", mixBlendMode: mixBlendModeProp, colorScheme = "auto", backdropBrightness = 1, frosted = false, className = "", style = {}, }, forwardedRef) => {
|
|
13
|
-
const uniqueId = useId().replace(/:/g, "-");
|
|
14
|
-
const filterId = `glass-filter-${uniqueId}`;
|
|
15
|
-
const redGradId = `red-grad-${uniqueId}`;
|
|
16
|
-
const blueGradId = `blue-grad-${uniqueId}`;
|
|
17
|
-
const noiseFilterId = `noise-filter-${uniqueId}`;
|
|
18
|
-
const [svgSupported, setSvgSupported] = useState(false);
|
|
19
|
-
const containerRef = useRef(null);
|
|
20
|
-
const feImageRef = useRef(null);
|
|
21
|
-
const redChannelRef = useRef(null);
|
|
22
|
-
const greenChannelRef = useRef(null);
|
|
23
|
-
const blueChannelRef = useRef(null);
|
|
24
|
-
const gaussianBlurRef = useRef(null);
|
|
25
|
-
const isDarkMode = useDarkMode();
|
|
26
|
-
const resolvedDark = colorScheme === "auto" ? isDarkMode : colorScheme === "dark";
|
|
27
|
-
// Theme-aware defaults: user-provided props always win
|
|
28
|
-
// Note: brightness/opacity control the displacement map center fill, NOT visual brightness.
|
|
29
|
-
// brightness=50 + opacity=1 = neutral center (no displacement), only edges refract.
|
|
30
|
-
// On light backgrounds, high displacement pulls in black out-of-bounds pixels → gray artifacts.
|
|
31
|
-
const brightness = brightnessProp !== null && brightnessProp !== void 0 ? brightnessProp : 50;
|
|
32
|
-
const opacity = opacityProp !== null && opacityProp !== void 0 ? opacityProp : (resolvedDark ? 0.93 : 1);
|
|
33
|
-
const blur = blurProp !== null && blurProp !== void 0 ? blurProp : 11;
|
|
34
|
-
const displace = displaceProp !== null && displaceProp !== void 0 ? displaceProp : 0.7;
|
|
35
|
-
const backgroundOpacity = backgroundOpacityProp !== null && backgroundOpacityProp !== void 0 ? backgroundOpacityProp : (resolvedDark ? 0.1 : 0);
|
|
36
|
-
const saturation = saturationProp !== null && saturationProp !== void 0 ? saturationProp : (resolvedDark ? 1.8 : 1.4);
|
|
37
|
-
const distortionScale = distortionScaleProp !== null && distortionScaleProp !== void 0 ? distortionScaleProp : (resolvedDark ? -180 : -40);
|
|
38
|
-
const mixBlendMode = mixBlendModeProp !== null && mixBlendModeProp !== void 0 ? mixBlendModeProp : (resolvedDark ? "difference" : "multiply");
|
|
39
|
-
/**
|
|
40
|
-
* Generates the SVG displacement map as a Data URI
|
|
41
|
-
*/
|
|
42
|
-
const generateDisplacementMap = () => {
|
|
43
|
-
var _a;
|
|
44
|
-
const rect = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
45
|
-
const actualWidth = (rect === null || rect === void 0 ? void 0 : rect.width) || 0;
|
|
46
|
-
const actualHeight = (rect === null || rect === void 0 ? void 0 : rect.height) || 0;
|
|
47
|
-
// Don't generate if size is 0
|
|
48
|
-
if (actualWidth === 0 || actualHeight === 0)
|
|
49
|
-
return "";
|
|
50
|
-
const edgeSize = Math.min(actualWidth, actualHeight) * (borderWidth * 0.5);
|
|
51
|
-
const svgContent = `
|
|
52
|
-
<svg viewBox="0 0 ${actualWidth} ${actualHeight}" xmlns="http://www.w3.org/2000/svg">
|
|
53
|
-
<defs>
|
|
54
|
-
<linearGradient id="${redGradId}" x1="100%" y1="0%" x2="0%" y2="0%">
|
|
55
|
-
<stop offset="0%" stop-color="#000"/>
|
|
56
|
-
<stop offset="100%" stop-color="red"/>
|
|
57
|
-
</linearGradient>
|
|
58
|
-
<linearGradient id="${blueGradId}" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
59
|
-
<stop offset="0%" stop-color="#000"/>
|
|
60
|
-
<stop offset="100%" stop-color="blue"/>
|
|
61
|
-
</linearGradient>
|
|
62
|
-
</defs>
|
|
63
|
-
<rect x="0" y="0" width="${actualWidth}" height="${actualHeight}" fill="black" />
|
|
64
|
-
<rect x="0" y="0" width="${actualWidth}" height="${actualHeight}" rx="${borderRadius}" fill="url(#${redGradId})" />
|
|
65
|
-
<rect x="0" y="0" width="${actualWidth}" height="${actualHeight}" rx="${borderRadius}" fill="url(#${blueGradId})" style="mix-blend-mode: ${mixBlendMode}" />
|
|
66
|
-
<rect x="${edgeSize}" y="${edgeSize}" width="${actualWidth - edgeSize * 2}" height="${actualHeight - edgeSize * 2}" rx="${borderRadius}" fill="hsl(0 0% ${brightness}% / ${opacity})" style="filter:blur(${blur}px)" />
|
|
67
|
-
</svg>
|
|
68
|
-
`;
|
|
69
|
-
return `data:image/svg+xml,${encodeURIComponent(svgContent)}`;
|
|
70
|
-
};
|
|
71
|
-
const updateDisplacementMap = () => {
|
|
72
|
-
const dataUri = generateDisplacementMap();
|
|
73
|
-
if (feImageRef.current && dataUri) {
|
|
74
|
-
feImageRef.current.setAttribute("href", dataUri);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
// Detect SVG Filter support (backwards compatibility for Safari/Firefox)
|
|
78
|
-
const supportsSVGFilters = () => {
|
|
79
|
-
if (typeof window === "undefined" || typeof document === "undefined")
|
|
80
|
-
return false;
|
|
81
|
-
const isWebkit = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
|
|
82
|
-
const isFirefox = /Firefox/.test(navigator.userAgent);
|
|
83
|
-
if (isWebkit || isFirefox)
|
|
84
|
-
return false;
|
|
85
|
-
const div = document.createElement("div");
|
|
86
|
-
div.style.backdropFilter = `url(#${filterId})`;
|
|
87
|
-
return div.style.backdropFilter !== "";
|
|
88
|
-
};
|
|
89
|
-
const supportsBackdrop = useMemo(() => { var _a; return typeof CSS !== 'undefined' && ((_a = CSS.supports) === null || _a === void 0 ? void 0 : _a.call(CSS, 'backdrop-filter', 'blur(1px)')); }, []);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
setSvgSupported(supportsSVGFilters());
|
|
92
|
-
}, []);
|
|
93
|
-
// Update filter attributes when props change
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
updateDisplacementMap();
|
|
96
|
-
const scale = distortionScale;
|
|
97
|
-
if (redChannelRef.current) {
|
|
98
|
-
redChannelRef.current.setAttribute("scale", (scale + redOffset).toString());
|
|
99
|
-
redChannelRef.current.setAttribute("xChannelSelector", xChannel);
|
|
100
|
-
redChannelRef.current.setAttribute("yChannelSelector", yChannel);
|
|
101
|
-
}
|
|
102
|
-
if (greenChannelRef.current) {
|
|
103
|
-
greenChannelRef.current.setAttribute("scale", (scale + greenOffset).toString());
|
|
104
|
-
greenChannelRef.current.setAttribute("xChannelSelector", xChannel);
|
|
105
|
-
greenChannelRef.current.setAttribute("yChannelSelector", yChannel);
|
|
106
|
-
}
|
|
107
|
-
if (blueChannelRef.current) {
|
|
108
|
-
blueChannelRef.current.setAttribute("scale", (scale + blueOffset).toString());
|
|
109
|
-
blueChannelRef.current.setAttribute("xChannelSelector", xChannel);
|
|
110
|
-
blueChannelRef.current.setAttribute("yChannelSelector", yChannel);
|
|
111
|
-
}
|
|
112
|
-
if (gaussianBlurRef.current) {
|
|
113
|
-
gaussianBlurRef.current.setAttribute("stdDeviation", displace.toString());
|
|
114
|
-
}
|
|
115
|
-
}, [
|
|
116
|
-
borderRadius,
|
|
117
|
-
borderWidth,
|
|
118
|
-
brightness,
|
|
119
|
-
opacity,
|
|
120
|
-
blur,
|
|
121
|
-
displace,
|
|
122
|
-
distortionScale,
|
|
123
|
-
redOffset,
|
|
124
|
-
greenOffset,
|
|
125
|
-
blueOffset,
|
|
126
|
-
xChannel,
|
|
127
|
-
yChannel,
|
|
128
|
-
mixBlendMode,
|
|
129
|
-
]);
|
|
130
|
-
// Ref to hold the latest updateDisplacementMap to avoid stale closures in ResizeObserver
|
|
131
|
-
const updateRef = useRef(updateDisplacementMap);
|
|
132
|
-
updateRef.current = updateDisplacementMap;
|
|
133
|
-
// ResizeObserver to handle dimension changes
|
|
134
|
-
useEffect(() => {
|
|
135
|
-
if (!containerRef.current)
|
|
136
|
-
return;
|
|
137
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
138
|
-
// Use requestAnimationFrame for smoother updates
|
|
139
|
-
requestAnimationFrame(() => updateRef.current());
|
|
140
|
-
});
|
|
141
|
-
resizeObserver.observe(containerRef.current);
|
|
142
|
-
return () => {
|
|
143
|
-
resizeObserver.disconnect();
|
|
144
|
-
};
|
|
145
|
-
}, []);
|
|
146
|
-
// Check if user is providing custom shadow via className
|
|
147
|
-
const hasCustomShadow = className === null || className === void 0 ? void 0 : className.includes("shadow");
|
|
148
|
-
const containerStyles = useMemo(() => {
|
|
149
|
-
const baseStyles = {
|
|
150
|
-
...style,
|
|
151
|
-
width: typeof width === "number" ? `${width}px` : width,
|
|
152
|
-
height: typeof height === "number" ? `${height}px` : height,
|
|
153
|
-
borderRadius: `${borderRadius}px`,
|
|
154
|
-
};
|
|
155
|
-
// Default blur for frosted effect
|
|
156
|
-
const frostedBlur = frosted ? "blur(12px)" : "";
|
|
157
|
-
if (svgSupported) {
|
|
158
|
-
// Determine background color: use prop if provided, otherwise auto-detect based on theme
|
|
159
|
-
const bgColor = backgroundColor || (resolvedDark ? "hsl(0 0% 0%)" : "hsl(0 0% 100%)");
|
|
160
|
-
// Convert color to rgba if needed to apply opacity
|
|
161
|
-
const getBackgroundWithOpacity = () => {
|
|
162
|
-
// If backgroundOpacity is 0, return transparent
|
|
163
|
-
if (backgroundOpacity === 0)
|
|
164
|
-
return "transparent";
|
|
165
|
-
// If color already has alpha channel (rgba, hsla), use as-is
|
|
166
|
-
if (bgColor.includes("rgba") || bgColor.includes("hsla")) {
|
|
167
|
-
return bgColor;
|
|
168
|
-
}
|
|
169
|
-
// For named colors, hex, rgb, hsl - wrap in color-mix for opacity
|
|
170
|
-
return `color-mix(in srgb, ${bgColor}, transparent ${(1 - backgroundOpacity) * 100}%)`;
|
|
171
|
-
};
|
|
172
|
-
return {
|
|
173
|
-
...baseStyles,
|
|
174
|
-
background: getBackgroundWithOpacity(),
|
|
175
|
-
backdropFilter: `url(#${filterId}) ${frostedBlur} brightness(${backdropBrightness}) saturate(${saturation})`,
|
|
176
|
-
WebkitBackdropFilter: `url(#${filterId}) ${frostedBlur} brightness(${backdropBrightness}) saturate(${saturation})`,
|
|
177
|
-
...(!resolvedDark && { border: "1px solid rgba(0, 0, 0, 0.06)" }),
|
|
178
|
-
...(hasCustomShadow
|
|
179
|
-
? {}
|
|
180
|
-
: {
|
|
181
|
-
boxShadow: resolvedDark
|
|
182
|
-
? `0 0 2px 1px color-mix(in oklch, white, transparent 65%) inset,
|
|
183
|
-
0 0 10px 4px color-mix(in oklch, white, transparent 85%) inset,
|
|
184
|
-
0px 4px 16px rgba(17, 17, 26, 0.05),
|
|
185
|
-
0px 8px 24px rgba(17, 17, 26, 0.05),
|
|
186
|
-
0px 16px 56px rgba(17, 17, 26, 0.05)`
|
|
187
|
-
: `0 8px 24px -12px rgba(0, 0, 0, 0.08),
|
|
188
|
-
0 4px 12px -4px rgba(0, 0, 0, 0.04)`,
|
|
189
|
-
}),
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
// Fallback for Safari/Firefox or when SVG filters aren't supported
|
|
194
|
-
const baseBlur = "12px";
|
|
195
|
-
// Increase blur significantly for frosted mode in fallback
|
|
196
|
-
const effectiveBlur = frosted ? "20px" : baseBlur;
|
|
197
|
-
const fallbackSaturate = "1.8";
|
|
198
|
-
const fallbackBrightness = resolvedDark ? "1.2" : "1.1";
|
|
199
|
-
const filterStr = `blur(${effectiveBlur}) saturate(${fallbackSaturate}) brightness(${fallbackBrightness})`;
|
|
200
|
-
if (resolvedDark) {
|
|
201
|
-
return {
|
|
202
|
-
...baseStyles,
|
|
203
|
-
background: supportsBackdrop
|
|
204
|
-
? "rgba(255, 255, 255, 0.1)"
|
|
205
|
-
: "rgba(0, 0, 0, 0.4)",
|
|
206
|
-
backdropFilter: supportsBackdrop ? filterStr : undefined,
|
|
207
|
-
WebkitBackdropFilter: supportsBackdrop ? filterStr : undefined,
|
|
208
|
-
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
209
|
-
...(hasCustomShadow
|
|
210
|
-
? {}
|
|
211
|
-
: {
|
|
212
|
-
boxShadow: `inset 0 1px 0 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 0 rgba(255, 255, 255, 0.1)`,
|
|
213
|
-
}),
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
return {
|
|
218
|
-
...baseStyles,
|
|
219
|
-
background: supportsBackdrop
|
|
220
|
-
? "rgba(255, 255, 255, 0.25)"
|
|
221
|
-
: "rgba(255, 255, 255, 0.4)",
|
|
222
|
-
backdropFilter: supportsBackdrop ? filterStr : undefined,
|
|
223
|
-
WebkitBackdropFilter: supportsBackdrop ? filterStr : undefined,
|
|
224
|
-
border: "1px solid rgba(255, 255, 255, 0.3)",
|
|
225
|
-
...(hasCustomShadow
|
|
226
|
-
? {}
|
|
227
|
-
: {
|
|
228
|
-
boxShadow: supportsBackdrop
|
|
229
|
-
? `0 8px 32px 0 rgba(31, 38, 135, 0.2), 0 2px 16px 0 rgba(31, 38, 135, 0.1), inset 0 1px 0 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 0 rgba(255, 255, 255, 0.2)`
|
|
230
|
-
: `inset 0 1px 0 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 0 rgba(255, 255, 255, 0.3)`,
|
|
231
|
-
}),
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}, [style, width, height, borderRadius, frosted, svgSupported, backgroundColor, resolvedDark, backgroundOpacity, filterId, backdropBrightness, saturation, hasCustomShadow, supportsBackdrop]);
|
|
236
|
-
const focusVisibleClasses = resolvedDark
|
|
237
|
-
? "focus-visible:outline-2 focus-visible:outline-[#0A84FF] focus-visible:outline-offset-2"
|
|
238
|
-
: "focus-visible:outline-2 focus-visible:outline-[#007AFF] focus-visible:outline-offset-2";
|
|
239
|
-
const mergedRef = useCallback((node) => {
|
|
240
|
-
containerRef.current = node;
|
|
241
|
-
if (typeof forwardedRef === "function")
|
|
242
|
-
forwardedRef(node);
|
|
243
|
-
else if (forwardedRef)
|
|
244
|
-
forwardedRef.current = node;
|
|
245
|
-
}, [forwardedRef]);
|
|
246
|
-
return (jsxs("div", { ref: mergedRef, className: cn("relative transition-opacity duration-[260ms] ease-out", focusVisibleClasses, className), style: containerStyles, children: [jsx("svg", { className: "w-full h-full pointer-events-none absolute inset-0 opacity-0 -z-10", xmlns: "http://www.w3.org/2000/svg", children: jsxs("defs", { children: [jsxs("filter", { id: filterId, colorInterpolationFilters: "sRGB", x: "0%", y: "0%", width: "100%", height: "100%", children: [jsx("feImage", { ref: feImageRef, x: "0", y: "0", width: "100%", height: "100%", preserveAspectRatio: "none", result: "map" }), jsx("feDisplacementMap", { ref: redChannelRef, in: "SourceGraphic", in2: "map", result: "dispRed" }), jsx("feColorMatrix", { in: "dispRed", type: "matrix", values: "1 0 0 0 0\n 0 0 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0", result: "red" }), jsx("feDisplacementMap", { ref: greenChannelRef, in: "SourceGraphic", in2: "map", result: "dispGreen" }), jsx("feColorMatrix", { in: "dispGreen", type: "matrix", values: "0 0 0 0 0\n 0 1 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0", result: "green" }), jsx("feDisplacementMap", { ref: blueChannelRef, in: "SourceGraphic", in2: "map", result: "dispBlue" }), jsx("feColorMatrix", { in: "dispBlue", type: "matrix", values: "0 0 0 0 0\n 0 0 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0", result: "blue" }), jsx("feBlend", { in: "red", in2: "green", mode: "screen", result: "rg" }), jsx("feBlend", { in: "rg", in2: "blue", mode: "screen", result: "output" }), jsx("feGaussianBlur", { ref: gaussianBlurRef, in: "output", stdDeviation: "0.7" })] }), jsx("filter", { id: noiseFilterId, x: "0%", y: "0%", width: "100%", height: "100%", children: jsx("feTurbulence", { type: "fractalNoise", baseFrequency: "0.65", numOctaves: "3", stitchTiles: "stitch" }) })] }) }), jsx("div", { className: "relative z-10 h-full rounded-[inherit]", children: children }), jsx("div", { className: "absolute inset-0 pointer-events-none rounded-[inherit] overflow-hidden z-20", children: frosted && (jsx("div", { className: "absolute inset-0 opacity-10 mix-blend-overlay", style: { filter: `url(#${noiseFilterId})` } })) })] }));
|
|
247
|
-
});
|
|
248
|
-
GlassSurface.displayName = "GlassSurface";
|
|
249
|
-
|
|
250
|
-
export { GlassSurface };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export type GlassChannel = "R" | "G" | "B";
|
|
3
|
-
export type GlassMixBlendMode = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity" | "plus-darker" | "plus-lighter";
|
|
4
|
-
export interface GlassSurfaceProps {
|
|
5
|
-
/** Content to be wrapped by the glass effect */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** Width of the component. If not provided, it will expand to fill parent or fit content. */
|
|
8
|
-
width?: number | string;
|
|
9
|
-
/** Height of the component. If not provided, it will expand to fill parent or fit content. */
|
|
10
|
-
height?: number | string;
|
|
11
|
-
/** Border radius for the glass effect in pixels */
|
|
12
|
-
borderRadius?: number;
|
|
13
|
-
/** Width of the refraction border (multiplier) */
|
|
14
|
-
borderWidth?: number;
|
|
15
|
-
/** Brightness of the inner glass area (0-100) */
|
|
16
|
-
brightness?: number;
|
|
17
|
-
/** Opacity of the inner glass area (0-1) */
|
|
18
|
-
opacity?: number;
|
|
19
|
-
/** Blur intensity for the inner glass area */
|
|
20
|
-
blur?: number;
|
|
21
|
-
/** Standard deviation for final displacement blur */
|
|
22
|
-
displace?: number;
|
|
23
|
-
/** Background opacity (for theme fallback) */
|
|
24
|
-
backgroundOpacity?: number;
|
|
25
|
-
/** Background color (CSS color value, e.g., 'white', '#fff', 'rgb(255,255,255)') */
|
|
26
|
-
backgroundColor?: string;
|
|
27
|
-
/** Saturation enhancement for the backdrop-filter */
|
|
28
|
-
saturation?: number;
|
|
29
|
-
/** Base displacement intensity for the chromatic aberration */
|
|
30
|
-
distortionScale?: number;
|
|
31
|
-
/** Red channel displacement offset */
|
|
32
|
-
redOffset?: number;
|
|
33
|
-
/** Green channel displacement offset */
|
|
34
|
-
greenOffset?: number;
|
|
35
|
-
/** Blue channel displacement offset */
|
|
36
|
-
blueOffset?: number;
|
|
37
|
-
/** SVG color channel used for X displacement */
|
|
38
|
-
xChannel?: GlassChannel;
|
|
39
|
-
/** SVG color channel used for Y displacement */
|
|
40
|
-
yChannel?: GlassChannel;
|
|
41
|
-
/** Blend mode for the internal gradient layers */
|
|
42
|
-
mixBlendMode?: GlassMixBlendMode;
|
|
43
|
-
/**
|
|
44
|
-
* Color scheme for the glass effect. Controls theme-aware defaults.
|
|
45
|
-
* - 'auto': detects system preference (default)
|
|
46
|
-
* - 'dark': force dark mode defaults
|
|
47
|
-
* - 'light': force light mode defaults
|
|
48
|
-
* @default 'auto'
|
|
49
|
-
*/
|
|
50
|
-
colorScheme?: "auto" | "dark" | "light";
|
|
51
|
-
/**
|
|
52
|
-
* Brightness multiplier for the backdrop-filter chain.
|
|
53
|
-
* Values > 1 brighten, < 1 darken. Only applies when SVG filters are supported.
|
|
54
|
-
* @default 1
|
|
55
|
-
*/
|
|
56
|
-
backdropBrightness?: number;
|
|
57
|
-
/**
|
|
58
|
-
* Enable frosted glass effect with noise texture
|
|
59
|
-
* @default false
|
|
60
|
-
*/
|
|
61
|
-
frosted?: boolean;
|
|
62
|
-
/** Additional CSS class names */
|
|
63
|
-
className?: string;
|
|
64
|
-
/** Inline styles for the container */
|
|
65
|
-
style?: React.CSSProperties;
|
|
66
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { GodRaysProps } from "./GodRays.types";
|
|
3
|
-
/**
|
|
4
|
-
* Animated volumetric light-ray burst radiating from center. WebGL2-
|
|
5
|
-
* powered; falls back to a static CSS conic-style gradient when WebGL2 is
|
|
6
|
-
* unavailable or the user prefers reduced motion.
|
|
7
|
-
*/
|
|
8
|
-
export declare const GodRays: React.FC<GodRaysProps>;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useMemo, useRef } from 'react';
|
|
4
|
-
import { useReducedMotion } from 'motion/react';
|
|
5
|
-
import { useIsClient } from '../../../hooks/useIsClient.js';
|
|
6
|
-
import { useDarkMode } from '../../../hooks/useDarkMode.js';
|
|
7
|
-
import { cn } from '../../../utils/cn.js';
|
|
8
|
-
import { ShaderCanvas } from '../shared/ShaderCanvas/ShaderCanvas.js';
|
|
9
|
-
import { resolveShaderColors, resolveShaderColor } from '../shared/resolveShaderColor.js';
|
|
10
|
-
import { godRaysFragmentShader } from './GodRays.shaders.js';
|
|
11
|
-
import { GOD_RAYS_MAX_COLORS } from './GodRays.types.js';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_COLORS = ["var(--color-primary-300)", "var(--color-primary)", "var(--color-primary-700)"];
|
|
14
|
-
const DEFAULT_COLOR_BACK = "var(--color-background)";
|
|
15
|
-
const DEFAULT_COLOR_BLOOM = "var(--color-primary-100)";
|
|
16
|
-
function useWebgl2Supported(disabled) {
|
|
17
|
-
return useMemo(() => {
|
|
18
|
-
if (disabled || typeof document === "undefined")
|
|
19
|
-
return false;
|
|
20
|
-
try {
|
|
21
|
-
return !!document.createElement("canvas").getContext("webgl2");
|
|
22
|
-
}
|
|
23
|
-
catch (_a) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}, [disabled]);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Animated volumetric light-ray burst radiating from center. WebGL2-
|
|
30
|
-
* powered; falls back to a static CSS conic-style gradient when WebGL2 is
|
|
31
|
-
* unavailable or the user prefers reduced motion.
|
|
32
|
-
*/
|
|
33
|
-
const GodRays = ({ colorBack = DEFAULT_COLOR_BACK, colorBloom = DEFAULT_COLOR_BLOOM, colors = DEFAULT_COLORS, spotty = 0.3, midSize = 0.4, midIntensity = 0.5, density = 0.5, intensity = 0.5, bloom = 0.5, speed = 1, className, style, ...props }) => {
|
|
34
|
-
var _a, _b, _c;
|
|
35
|
-
const isClient = useIsClient();
|
|
36
|
-
const shouldReduceMotion = useReducedMotion();
|
|
37
|
-
const isDark = useDarkMode();
|
|
38
|
-
const webglSupported = useWebgl2Supported(!!shouldReduceMotion);
|
|
39
|
-
const safeColors = colors.length > 0 ? colors.slice(0, GOD_RAYS_MAX_COLORS) : DEFAULT_COLORS;
|
|
40
|
-
const resolvedColors = useMemo(() => resolveShaderColors(safeColors),
|
|
41
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
-
[safeColors.join("|"), isDark]);
|
|
43
|
-
const resolvedBack = useMemo(() => resolveShaderColor(colorBack),
|
|
44
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
[colorBack, isDark]);
|
|
46
|
-
const resolvedBloom = useMemo(() => resolveShaderColor(colorBloom),
|
|
47
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
[colorBloom, isDark]);
|
|
49
|
-
const uniformsRef = useRef({});
|
|
50
|
-
for (let i = 0; i < GOD_RAYS_MAX_COLORS; i++) {
|
|
51
|
-
uniformsRef.current[`u_colors[${i}]`] =
|
|
52
|
-
(_b = (_a = resolvedColors[i]) !== null && _a !== void 0 ? _a : resolvedColors[resolvedColors.length - 1]) !== null && _b !== void 0 ? _b : [0, 0, 0, 0];
|
|
53
|
-
}
|
|
54
|
-
uniformsRef.current.u_colorsCount = resolvedColors.length;
|
|
55
|
-
uniformsRef.current.u_colorBack = resolvedBack;
|
|
56
|
-
uniformsRef.current.u_colorBloom = resolvedBloom;
|
|
57
|
-
uniformsRef.current.u_spotty = spotty;
|
|
58
|
-
uniformsRef.current.u_midSize = midSize;
|
|
59
|
-
uniformsRef.current.u_midIntensity = midIntensity;
|
|
60
|
-
uniformsRef.current.u_density = density;
|
|
61
|
-
uniformsRef.current.u_intensity = intensity;
|
|
62
|
-
uniformsRef.current.u_bloom = bloom;
|
|
63
|
-
uniformsRef.current.u_speed = speed;
|
|
64
|
-
const fallbackGradient = `radial-gradient(circle, ${(_c = safeColors[safeColors.length - 1]) !== null && _c !== void 0 ? _c : "var(--color-primary)"}, ${colorBack} 70%)`;
|
|
65
|
-
return (jsx("div", { className: cn("absolute inset-0 overflow-hidden pointer-events-none select-none", className), style: style, "aria-hidden": "true", ...props, children: isClient && webglSupported ? (jsx(ShaderCanvas, { fragmentShader: godRaysFragmentShader, uniformsRef: uniformsRef })) : (jsx("div", { className: "absolute inset-0", style: { background: fallbackGradient } })) }));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { GodRays };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GodRays fragment shader — adapted from paper-design/shaders' `god-rays.ts`
|
|
3
|
-
* (https://github.com/paper-design/shaders, Apache License 2.0).
|
|
4
|
-
*
|
|
5
|
-
* Simplified from the original: plain centered/aspect-corrected UV
|
|
6
|
-
* (gl_FragCoord/iResolution) instead of paper-design's ShaderSizingParams
|
|
7
|
-
* fit/scale/rotation engine; pure-hash GLSL (see shared/shaderNoise.glsl.ts)
|
|
8
|
-
* instead of pre-generated noise-texture sampling.
|
|
9
|
-
*/
|
|
10
|
-
export declare const godRaysFragmentShader = "#version 300 es\nprecision mediump float;\n\nuniform float iTime;\nuniform vec2 iResolution;\n\nuniform vec4 u_colorBack;\nuniform vec4 u_colorBloom;\nuniform vec4 u_colors[5];\nuniform float u_colorsCount;\n\nuniform float u_density;\nuniform float u_spotty;\nuniform float u_midSize;\nuniform float u_midIntensity;\nuniform float u_intensity;\nuniform float u_bloom;\nuniform float u_speed;\n\nout vec4 fragColor;\n\n\nconst float PI = 3.14159265359;\nconst float TWO_PI = 6.28318530718;\n\n\nvec2 rotate(vec2 v, float angle) {\n float s = sin(angle);\n float c = cos(angle);\n return mat2(c, -s, s, c) * v;\n}\n\n\nfloat randomR(vec2 st) {\n return fract(sin(dot(st, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\n\nfloat hash11(float p) {\n return randomR(vec2(p, p * 0.7919));\n}\n\nfloat valueNoise(vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n float a = randomR(i);\n float b = randomR(i + vec2(1.0, 0.0));\n float c = randomR(i + vec2(0.0, 1.0));\n float d = randomR(i + vec2(1.0, 1.0));\n vec2 u = f * f * (3.0 - 2.0 * f);\n float x1 = mix(a, b, u.x);\n float x2 = mix(c, d, u.x);\n return mix(x1, x2, u.y);\n}\n\nfloat raysShape(vec2 uv, float r, float freq, float intensity, float radius) {\n float a = atan(uv.y, uv.x);\n vec2 left = vec2(a * freq, r);\n vec2 right = vec2(fract(a / TWO_PI) * TWO_PI * freq, r);\n float n_left = pow(valueNoise(left), intensity);\n float n_right = pow(valueNoise(right), intensity);\n float shape = mix(n_right, n_left, smoothstep(-.15, .15, uv.x));\n return shape;\n}\n\nvoid main() {\n vec2 shape_uv = (gl_FragCoord.xy - 0.5 * iResolution.xy) / min(iResolution.x, iResolution.y);\n\n float t = .2 * u_speed * iTime;\n float radius = length(shape_uv);\n float spots = 6.5 * abs(u_spotty);\n float intensity = 4. - 3. * clamp(u_intensity, 0., 1.);\n\n float midSize = 10. * abs(u_midSize);\n float ms_lo = 0.02 * midSize;\n float ms_hi = max(midSize, 1e-6);\n float middleShape = pow(u_midIntensity, 0.3) * (1. - smoothstep(ms_lo, ms_hi, 3.0 * radius));\n middleShape = pow(middleShape, 5.0);\n\n vec3 accumColor = vec3(0.0);\n float accumAlpha = 0.0;\n\n for (int i = 0; i < 5; i++) {\n if (i >= int(u_colorsCount)) break;\n\n vec2 rotatedUV = rotate(shape_uv, float(i) + 1.0);\n\n float r1 = radius * (1.0 + 0.4 * float(i)) - 3.0 * t;\n float r2 = 0.5 * radius * (1.0 + spots) - 2.0 * t;\n float density = 6. * u_density + step(.5, u_density) * pow(4.5 * (u_density - .5), 4.);\n float f = mix(1.0, 3.0 + 0.5 * float(i), hash11(float(i) * 15.)) * density;\n\n float ray = raysShape(rotatedUV, r1, 5.0 * f, intensity, radius);\n ray *= raysShape(rotatedUV, r2, 4.0 * f, intensity, radius);\n ray += (1. + 4. * ray) * middleShape;\n ray = clamp(ray, 0.0, 1.0);\n\n float srcAlpha = u_colors[i].a * ray;\n vec3 srcColor = u_colors[i].rgb * srcAlpha;\n\n vec3 alphaBlendColor = accumColor + (1.0 - accumAlpha) * srcColor;\n float alphaBlendAlpha = accumAlpha + (1.0 - accumAlpha) * srcAlpha;\n\n vec3 addBlendColor = accumColor + srcColor;\n float addBlendAlpha = accumAlpha + srcAlpha;\n\n accumColor = mix(alphaBlendColor, addBlendColor, u_bloom);\n accumAlpha = mix(alphaBlendAlpha, addBlendAlpha, u_bloom);\n }\n\n float overlayAlpha = u_colorBloom.a;\n vec3 overlayColor = u_colorBloom.rgb * overlayAlpha;\n\n vec3 colorWithOverlay = accumColor + accumAlpha * overlayColor;\n accumColor = mix(accumColor, colorWithOverlay, u_bloom);\n\n vec3 bgColor = u_colorBack.rgb * u_colorBack.a;\n\n vec3 color = accumColor + (1. - accumAlpha) * bgColor;\n float opacity = accumAlpha + (1. - accumAlpha) * u_colorBack.a;\n color = clamp(color, 0., 1.);\n opacity = clamp(opacity, 0., 1.);\n\n fragColor = vec4(color, opacity);\n}\n";
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import 'react/jsx-runtime';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { glslDeclarePI, glslRotate2, glslHashFloat } from '../shared/shaderNoise.glsl.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* GodRays fragment shader — adapted from paper-design/shaders' `god-rays.ts`
|
|
7
|
-
* (https://github.com/paper-design/shaders, Apache License 2.0).
|
|
8
|
-
*
|
|
9
|
-
* Simplified from the original: plain centered/aspect-corrected UV
|
|
10
|
-
* (gl_FragCoord/iResolution) instead of paper-design's ShaderSizingParams
|
|
11
|
-
* fit/scale/rotation engine; pure-hash GLSL (see shared/shaderNoise.glsl.ts)
|
|
12
|
-
* instead of pre-generated noise-texture sampling.
|
|
13
|
-
*/
|
|
14
|
-
const godRaysFragmentShader = `#version 300 es
|
|
15
|
-
precision mediump float;
|
|
16
|
-
|
|
17
|
-
uniform float iTime;
|
|
18
|
-
uniform vec2 iResolution;
|
|
19
|
-
|
|
20
|
-
uniform vec4 u_colorBack;
|
|
21
|
-
uniform vec4 u_colorBloom;
|
|
22
|
-
uniform vec4 u_colors[5];
|
|
23
|
-
uniform float u_colorsCount;
|
|
24
|
-
|
|
25
|
-
uniform float u_density;
|
|
26
|
-
uniform float u_spotty;
|
|
27
|
-
uniform float u_midSize;
|
|
28
|
-
uniform float u_midIntensity;
|
|
29
|
-
uniform float u_intensity;
|
|
30
|
-
uniform float u_bloom;
|
|
31
|
-
uniform float u_speed;
|
|
32
|
-
|
|
33
|
-
out vec4 fragColor;
|
|
34
|
-
|
|
35
|
-
${glslDeclarePI}
|
|
36
|
-
${glslRotate2}
|
|
37
|
-
${glslHashFloat}
|
|
38
|
-
|
|
39
|
-
float hash11(float p) {
|
|
40
|
-
return randomR(vec2(p, p * 0.7919));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
float valueNoise(vec2 st) {
|
|
44
|
-
vec2 i = floor(st);
|
|
45
|
-
vec2 f = fract(st);
|
|
46
|
-
float a = randomR(i);
|
|
47
|
-
float b = randomR(i + vec2(1.0, 0.0));
|
|
48
|
-
float c = randomR(i + vec2(0.0, 1.0));
|
|
49
|
-
float d = randomR(i + vec2(1.0, 1.0));
|
|
50
|
-
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
51
|
-
float x1 = mix(a, b, u.x);
|
|
52
|
-
float x2 = mix(c, d, u.x);
|
|
53
|
-
return mix(x1, x2, u.y);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
float raysShape(vec2 uv, float r, float freq, float intensity, float radius) {
|
|
57
|
-
float a = atan(uv.y, uv.x);
|
|
58
|
-
vec2 left = vec2(a * freq, r);
|
|
59
|
-
vec2 right = vec2(fract(a / TWO_PI) * TWO_PI * freq, r);
|
|
60
|
-
float n_left = pow(valueNoise(left), intensity);
|
|
61
|
-
float n_right = pow(valueNoise(right), intensity);
|
|
62
|
-
float shape = mix(n_right, n_left, smoothstep(-.15, .15, uv.x));
|
|
63
|
-
return shape;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
void main() {
|
|
67
|
-
vec2 shape_uv = (gl_FragCoord.xy - 0.5 * iResolution.xy) / min(iResolution.x, iResolution.y);
|
|
68
|
-
|
|
69
|
-
float t = .2 * u_speed * iTime;
|
|
70
|
-
float radius = length(shape_uv);
|
|
71
|
-
float spots = 6.5 * abs(u_spotty);
|
|
72
|
-
float intensity = 4. - 3. * clamp(u_intensity, 0., 1.);
|
|
73
|
-
|
|
74
|
-
float midSize = 10. * abs(u_midSize);
|
|
75
|
-
float ms_lo = 0.02 * midSize;
|
|
76
|
-
float ms_hi = max(midSize, 1e-6);
|
|
77
|
-
float middleShape = pow(u_midIntensity, 0.3) * (1. - smoothstep(ms_lo, ms_hi, 3.0 * radius));
|
|
78
|
-
middleShape = pow(middleShape, 5.0);
|
|
79
|
-
|
|
80
|
-
vec3 accumColor = vec3(0.0);
|
|
81
|
-
float accumAlpha = 0.0;
|
|
82
|
-
|
|
83
|
-
for (int i = 0; i < 5; i++) {
|
|
84
|
-
if (i >= int(u_colorsCount)) break;
|
|
85
|
-
|
|
86
|
-
vec2 rotatedUV = rotate(shape_uv, float(i) + 1.0);
|
|
87
|
-
|
|
88
|
-
float r1 = radius * (1.0 + 0.4 * float(i)) - 3.0 * t;
|
|
89
|
-
float r2 = 0.5 * radius * (1.0 + spots) - 2.0 * t;
|
|
90
|
-
float density = 6. * u_density + step(.5, u_density) * pow(4.5 * (u_density - .5), 4.);
|
|
91
|
-
float f = mix(1.0, 3.0 + 0.5 * float(i), hash11(float(i) * 15.)) * density;
|
|
92
|
-
|
|
93
|
-
float ray = raysShape(rotatedUV, r1, 5.0 * f, intensity, radius);
|
|
94
|
-
ray *= raysShape(rotatedUV, r2, 4.0 * f, intensity, radius);
|
|
95
|
-
ray += (1. + 4. * ray) * middleShape;
|
|
96
|
-
ray = clamp(ray, 0.0, 1.0);
|
|
97
|
-
|
|
98
|
-
float srcAlpha = u_colors[i].a * ray;
|
|
99
|
-
vec3 srcColor = u_colors[i].rgb * srcAlpha;
|
|
100
|
-
|
|
101
|
-
vec3 alphaBlendColor = accumColor + (1.0 - accumAlpha) * srcColor;
|
|
102
|
-
float alphaBlendAlpha = accumAlpha + (1.0 - accumAlpha) * srcAlpha;
|
|
103
|
-
|
|
104
|
-
vec3 addBlendColor = accumColor + srcColor;
|
|
105
|
-
float addBlendAlpha = accumAlpha + srcAlpha;
|
|
106
|
-
|
|
107
|
-
accumColor = mix(alphaBlendColor, addBlendColor, u_bloom);
|
|
108
|
-
accumAlpha = mix(alphaBlendAlpha, addBlendAlpha, u_bloom);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
float overlayAlpha = u_colorBloom.a;
|
|
112
|
-
vec3 overlayColor = u_colorBloom.rgb * overlayAlpha;
|
|
113
|
-
|
|
114
|
-
vec3 colorWithOverlay = accumColor + accumAlpha * overlayColor;
|
|
115
|
-
accumColor = mix(accumColor, colorWithOverlay, u_bloom);
|
|
116
|
-
|
|
117
|
-
vec3 bgColor = u_colorBack.rgb * u_colorBack.a;
|
|
118
|
-
|
|
119
|
-
vec3 color = accumColor + (1. - accumAlpha) * bgColor;
|
|
120
|
-
float opacity = accumAlpha + (1. - accumAlpha) * u_colorBack.a;
|
|
121
|
-
color = clamp(color, 0., 1.);
|
|
122
|
-
opacity = clamp(opacity, 0., 1.);
|
|
123
|
-
|
|
124
|
-
fragColor = vec4(color, opacity);
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
|
-
export { godRaysFragmentShader };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
export declare const GOD_RAYS_MAX_COLORS = 5;
|
|
3
|
-
export interface GodRaysProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/** Background CSS color. Default: 'var(--color-background)'. */
|
|
5
|
-
colorBack?: string;
|
|
6
|
-
/** Additive highlight/bloom overlay color. Default: 'var(--color-primary-100)'. */
|
|
7
|
-
colorBloom?: string;
|
|
8
|
-
/** Ray colors, up to 5. Default: a 3-stop primary ramp. */
|
|
9
|
-
colors?: string[];
|
|
10
|
-
/** How fragmented/spotty the rays look, 0-1+. Default: 0.3. */
|
|
11
|
-
spotty?: number;
|
|
12
|
-
/** Central glow size. Default: 0.4. */
|
|
13
|
-
midSize?: number;
|
|
14
|
-
/** Central glow intensity, 0-1. Default: 0.5. */
|
|
15
|
-
midIntensity?: number;
|
|
16
|
-
/** Ray density. Default: 0.5. */
|
|
17
|
-
density?: number;
|
|
18
|
-
/** Ray sharpness, 0-1. Default: 0.5. */
|
|
19
|
-
intensity?: number;
|
|
20
|
-
/** Additive-vs-alpha blend for overlapping rays, 0-1. Default: 0.5. */
|
|
21
|
-
bloom?: number;
|
|
22
|
-
/** Animation speed multiplier. Default: 1. */
|
|
23
|
-
speed?: number;
|
|
24
|
-
className?: string;
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { GridPatternProps } from "./GridPattern.types";
|
|
3
|
-
/**
|
|
4
|
-
* GridPattern renders an SVG-based grid background pattern.
|
|
5
|
-
*
|
|
6
|
-
* Use it as an absolute-positioned decorative background inside a container
|
|
7
|
-
* with `position: relative`. The pattern is fully non-interactive
|
|
8
|
-
* (`pointer-events: none`) and sits at `z-index: 0` by default.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <div className="relative overflow-hidden h-96">
|
|
13
|
-
* <GridPattern size={48} color="var(--color-border)" fade animated />
|
|
14
|
-
* <div className="relative z-10">Your content here</div>
|
|
15
|
-
* </div>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare const GridPattern: React.ForwardRefExoticComponent<GridPatternProps & React.RefAttributes<HTMLDivElement>>;
|