@mks2508/mks-ui 0.5.4 → 0.5.8
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/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +23 -4
- package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +2 -2
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +292 -31
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +7 -0
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +6 -1
- package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-Cm6-VceQ.css → DynamicToggle-DJLwEkHr.css} +116 -51
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +116 -51
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -0
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +9 -3
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +61 -31
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.d.ts +9 -3
- package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.js +68 -37
- package/package.json +52 -13
- package/src/assets/react.svg +0 -1
- package/src/core/index.ts +0 -7
- package/src/core/types.ts +0 -82
- package/src/css.d.ts +0 -7
- package/src/index.css +0 -129
- package/src/index.ts +0 -29
- package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +0 -278
- package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +0 -97
- package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +0 -155
- package/src/react-ui/blocks/Terminal/Terminal.theme.ts +0 -80
- package/src/react-ui/blocks/Terminal/Terminal.types.ts +0 -438
- package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +0 -38
- package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +0 -254
- package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +0 -73
- package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +0 -269
- package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +0 -326
- package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +0 -230
- package/src/react-ui/blocks/Terminal/XTermAdapter.ts +0 -163
- package/src/react-ui/blocks/Terminal/chrome.ts +0 -25
- package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +0 -316
- package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +0 -218
- package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +0 -386
- package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +0 -67
- package/src/react-ui/blocks/Terminal/components/index.ts +0 -10
- package/src/react-ui/blocks/Terminal/display.ts +0 -46
- package/src/react-ui/blocks/Terminal/hooks/index.ts +0 -22
- package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +0 -229
- package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +0 -292
- package/src/react-ui/blocks/Terminal/index.ts +0 -111
- package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +0 -330
- package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +0 -242
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +0 -202
- package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +0 -140
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +0 -68
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +0 -85
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +0 -383
- package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +0 -439
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +0 -550
- package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +0 -259
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +0 -75
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +0 -266
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +0 -82
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +0 -112
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +0 -178
- package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +0 -203
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +0 -252
- package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +0 -334
- package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +0 -261
- package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +0 -248
- package/src/react-ui/blocks/Terminal/panel/index.ts +0 -72
- package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +0 -59
- package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +0 -59
- package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +0 -180
- package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +0 -248
- package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +0 -283
- package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +0 -686
- package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +0 -466
- package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +0 -343
- package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +0 -167
- package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +0 -348
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +0 -251
- package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +0 -390
- package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +0 -320
- package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +0 -20
- package/src/react-ui/blocks/Terminal/parsing/index.ts +0 -69
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +0 -68
- package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +0 -436
- package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +0 -14
- package/src/react-ui/blocks/index.ts +0 -11
- package/src/react-ui/components/MorphingPopover/MorphingPopover.types.ts +0 -49
- package/src/react-ui/components/MorphingPopover/index.tsx +0 -186
- package/src/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -153
- package/src/react-ui/components/index.ts +0 -9
- package/src/react-ui/hooks/Animation/UseAutoHeight.tsx +0 -123
- package/src/react-ui/hooks/DOM/UseIsInView.tsx +0 -44
- package/src/react-ui/hooks/Formatting/UseListFormat.ts +0 -134
- package/src/react-ui/hooks/State/UseControlledState.tsx +0 -57
- package/src/react-ui/hooks/State/UseDataState.tsx +0 -76
- package/src/react-ui/hooks/index.ts +0 -20
- package/src/react-ui/icons/index.ts +0 -12
- package/src/react-ui/icons/lucide-animated/activity.tsx +0 -109
- package/src/react-ui/icons/lucide-animated/arrow-down-to-line.tsx +0 -51
- package/src/react-ui/icons/lucide-animated/arrow-up.tsx +0 -50
- package/src/react-ui/icons/lucide-animated/bell-electric.tsx +0 -124
- package/src/react-ui/icons/lucide-animated/bell.tsx +0 -93
- package/src/react-ui/icons/lucide-animated/bot.tsx +0 -122
- package/src/react-ui/icons/lucide-animated/box.tsx +0 -117
- package/src/react-ui/icons/lucide-animated/check.tsx +0 -21
- package/src/react-ui/icons/lucide-animated/circle-check.tsx +0 -107
- package/src/react-ui/icons/lucide-animated/delete.tsx +0 -133
- package/src/react-ui/icons/lucide-animated/download.tsx +0 -99
- package/src/react-ui/icons/lucide-animated/edit-2.tsx +0 -21
- package/src/react-ui/icons/lucide-animated/globe.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/home.tsx +0 -103
- package/src/react-ui/icons/lucide-animated/index.ts +0 -38
- package/src/react-ui/icons/lucide-animated/layers.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +0 -143
- package/src/react-ui/icons/lucide-animated/list.tsx +0 -54
- package/src/react-ui/icons/lucide-animated/package.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/palette.tsx +0 -25
- package/src/react-ui/icons/lucide-animated/plus.tsx +0 -92
- package/src/react-ui/icons/lucide-animated/refresh-cw.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/rocket.tsx +0 -24
- package/src/react-ui/icons/lucide-animated/save.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/search.tsx +0 -94
- package/src/react-ui/icons/lucide-animated/settings.tsx +0 -92
- package/src/react-ui/icons/lucide-animated/terminal.tsx +0 -46
- package/src/react-ui/icons/lucide-animated/trash-2.tsx +0 -25
- package/src/react-ui/icons/lucide-animated/trending-down.tsx +0 -151
- package/src/react-ui/icons/lucide-animated/trending-up.tsx +0 -150
- package/src/react-ui/icons/lucide-animated/type.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/upload.tsx +0 -23
- package/src/react-ui/icons/lucide-animated/x.tsx +0 -102
- package/src/react-ui/index.ts +0 -30
- package/src/react-ui/lib/get-strict-context.tsx +0 -56
- package/src/react-ui/lib/icon-wrapper.tsx +0 -70
- package/src/react-ui/lib/index.ts +0 -9
- package/src/react-ui/lib/utils.ts +0 -24
- package/src/react-ui/primitives/AutoHeight/index.tsx +0 -74
- package/src/react-ui/primitives/CountingNumber/index.tsx +0 -147
- package/src/react-ui/primitives/Highlight/Highlight.types.ts +0 -136
- package/src/react-ui/primitives/Highlight/index.tsx +0 -577
- package/src/react-ui/primitives/Slot/index.tsx +0 -128
- package/src/react-ui/primitives/index.ts +0 -16
- package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +0 -123
- package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +0 -80
- package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +0 -77
- package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +0 -58
- package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +0 -244
- package/src/react-ui/primitives/waapi/Gooey/index.ts +0 -50
- package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +0 -48
- package/src/react-ui/primitives/waapi/Morph/Morph.types.ts +0 -106
- package/src/react-ui/primitives/waapi/Morph/MorphContext.tsx +0 -21
- package/src/react-ui/primitives/waapi/Morph/index.tsx +0 -56
- package/src/react-ui/primitives/waapi/Morph/techniques/index.ts +0 -12
- package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +0 -89
- package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +0 -176
- package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +0 -87
- package/src/react-ui/primitives/waapi/Morph/useMorph.ts +0 -101
- package/src/react-ui/primitives/waapi/Reorder/Reorder.types.ts +0 -177
- package/src/react-ui/primitives/waapi/Reorder/index.tsx +0 -260
- package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +0 -47
- package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +0 -209
- package/src/react-ui/primitives/waapi/Reorder/utils/separatorCoordination.ts +0 -104
- package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.ts +0 -14
- package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.types.ts +0 -84
- package/src/react-ui/primitives/waapi/SlidingNumber/index.tsx +0 -474
- package/src/react-ui/primitives/waapi/SlidingText/SlidingText.styles.ts +0 -32
- package/src/react-ui/primitives/waapi/SlidingText/SlidingText.types.ts +0 -69
- package/src/react-ui/primitives/waapi/SlidingText/index.tsx +0 -140
- package/src/react-ui/primitives/waapi/core/animationConstants.ts +0 -215
- package/src/react-ui/primitives/waapi/core/index.ts +0 -53
- package/src/react-ui/primitives/waapi/core/types.ts +0 -200
- package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +0 -430
- package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +0 -81
- package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +0 -138
- package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +0 -106
- package/src/react-ui/primitives/waapi/index.ts +0 -139
- package/src/react-ui/styles/animations.css +0 -369
- package/src/react-ui/ui/Accordion/Accordion.styles.ts +0 -72
- package/src/react-ui/ui/Accordion/Accordion.types.ts +0 -199
- package/src/react-ui/ui/Accordion/index.tsx +0 -362
- package/src/react-ui/ui/AlertDialog/AlertDialog.styles.ts +0 -38
- package/src/react-ui/ui/AlertDialog/AlertDialog.types.ts +0 -296
- package/src/react-ui/ui/AlertDialog/index.tsx +0 -540
- package/src/react-ui/ui/Badge/Badge.styles.ts +0 -43
- package/src/react-ui/ui/Badge/Badge.types.ts +0 -26
- package/src/react-ui/ui/Badge/index.tsx +0 -34
- package/src/react-ui/ui/Button/Button.styles.ts +0 -57
- package/src/react-ui/ui/Button/Button.types.ts +0 -63
- package/src/react-ui/ui/Button/index.tsx +0 -155
- package/src/react-ui/ui/Card/Card.styles.ts +0 -32
- package/src/react-ui/ui/Card/Card.types.ts +0 -39
- package/src/react-ui/ui/Card/index.tsx +0 -130
- package/src/react-ui/ui/Checkbox/Checkbox.styles.ts +0 -40
- package/src/react-ui/ui/Checkbox/Checkbox.types.ts +0 -98
- package/src/react-ui/ui/Checkbox/index.tsx +0 -233
- package/src/react-ui/ui/Combobox/Combobox.styles.ts +0 -34
- package/src/react-ui/ui/Combobox/Combobox.types.ts +0 -89
- package/src/react-ui/ui/Combobox/index.tsx +0 -331
- package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +0 -38
- package/src/react-ui/ui/CornerBracket/CornerBracket.types.ts +0 -15
- package/src/react-ui/ui/CornerBracket/index.tsx +0 -49
- package/src/react-ui/ui/DataCard/DataCard.styles.ts +0 -94
- package/src/react-ui/ui/DataCard/DataCard.types.ts +0 -125
- package/src/react-ui/ui/DataCard/index.tsx +0 -340
- package/src/react-ui/ui/Dialog/Dialog.styles.ts +0 -59
- package/src/react-ui/ui/Dialog/Dialog.types.ts +0 -284
- package/src/react-ui/ui/Dialog/index.tsx +0 -452
- package/src/react-ui/ui/DropdownMenu/DropdownMenu.styles.ts +0 -35
- package/src/react-ui/ui/DropdownMenu/DropdownMenu.types.ts +0 -81
- package/src/react-ui/ui/DropdownMenu/index.tsx +0 -300
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -303
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +0 -85
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +0 -174
- package/src/react-ui/ui/DynamicToggle/index.tsx +0 -294
- package/src/react-ui/ui/DynamicToggle/prototype-v7.html +0 -615
- package/src/react-ui/ui/DynamicToggle/prototype.html +0 -419
- package/src/react-ui/ui/Field/Field.styles.ts +0 -47
- package/src/react-ui/ui/Field/Field.types.ts +0 -60
- package/src/react-ui/ui/Field/index.tsx +0 -254
- package/src/react-ui/ui/Input/Input.styles.ts +0 -11
- package/src/react-ui/ui/Input/Input.types.ts +0 -10
- package/src/react-ui/ui/Input/index.tsx +0 -32
- package/src/react-ui/ui/InputGroup/InputGroup.styles.ts +0 -53
- package/src/react-ui/ui/InputGroup/InputGroup.types.ts +0 -44
- package/src/react-ui/ui/InputGroup/index.tsx +0 -149
- package/src/react-ui/ui/Label/Label.styles.ts +0 -10
- package/src/react-ui/ui/Label/Label.types.ts +0 -9
- package/src/react-ui/ui/Label/index.tsx +0 -27
- package/src/react-ui/ui/Menu/Menu.styles.ts +0 -71
- package/src/react-ui/ui/Menu/Menu.types.ts +0 -425
- package/src/react-ui/ui/Menu/index.tsx +0 -900
- package/src/react-ui/ui/Popover/Popover.styles.ts +0 -55
- package/src/react-ui/ui/Popover/Popover.types.ts +0 -261
- package/src/react-ui/ui/Popover/index.tsx +0 -422
- package/src/react-ui/ui/Progress/Progress.styles.ts +0 -36
- package/src/react-ui/ui/Progress/Progress.types.ts +0 -162
- package/src/react-ui/ui/Progress/index.tsx +0 -254
- package/src/react-ui/ui/Select/Select.styles.ts +0 -30
- package/src/react-ui/ui/Select/Select.types.ts +0 -51
- package/src/react-ui/ui/Select/index.tsx +0 -225
- package/src/react-ui/ui/Separator/Separator.styles.ts +0 -10
- package/src/react-ui/ui/Separator/Separator.types.ts +0 -10
- package/src/react-ui/ui/Separator/index.tsx +0 -37
- package/src/react-ui/ui/Switch/Switch.styles.ts +0 -50
- package/src/react-ui/ui/Switch/Switch.types.ts +0 -155
- package/src/react-ui/ui/Switch/index.tsx +0 -253
- package/src/react-ui/ui/Tabs/Tabs.css +0 -39
- package/src/react-ui/ui/Tabs/Tabs.styles.ts +0 -148
- package/src/react-ui/ui/Tabs/Tabs.types.ts +0 -255
- package/src/react-ui/ui/Tabs/index.tsx +0 -529
- package/src/react-ui/ui/TextFlow/TextFlow.styles.ts +0 -36
- package/src/react-ui/ui/TextFlow/TextFlow.types.ts +0 -118
- package/src/react-ui/ui/TextFlow/index.tsx +0 -276
- package/src/react-ui/ui/Textarea/Textarea.styles.ts +0 -10
- package/src/react-ui/ui/Textarea/Textarea.types.ts +0 -9
- package/src/react-ui/ui/Textarea/index.tsx +0 -27
- package/src/react-ui/ui/Tooltip/Tooltip.styles.ts +0 -43
- package/src/react-ui/ui/Tooltip/Tooltip.types.ts +0 -253
- package/src/react-ui/ui/Tooltip/index.tsx +0 -394
- package/src/react-ui/ui/index.ts +0 -41
- package/src/types/css-modules.d.ts +0 -18
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Animated Tooltip component built on Base UI Tooltip and Motion.
|
|
5
|
-
*
|
|
6
|
-
* Provides a positioned tooltip with scale entrance animation,
|
|
7
|
-
* optional cursor-following via spring-animated motion values,
|
|
8
|
-
* arrow support, and full AnimatePresence exit transitions.
|
|
9
|
-
* All sub-components accept a `slots` prop for class-name overrides
|
|
10
|
-
* following the StyleSlots pattern.
|
|
11
|
-
*
|
|
12
|
-
* @module @mks2508/mks-ui/react/ui/Tooltip
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* import {
|
|
17
|
-
* TooltipProvider,
|
|
18
|
-
* Tooltip,
|
|
19
|
-
* TooltipTrigger,
|
|
20
|
-
* TooltipPortal,
|
|
21
|
-
* TooltipPositioner,
|
|
22
|
-
* TooltipPopup,
|
|
23
|
-
* TooltipArrow,
|
|
24
|
-
* } from '@mks2508/mks-ui';
|
|
25
|
-
*
|
|
26
|
-
* function Example() {
|
|
27
|
-
* return (
|
|
28
|
-
* <TooltipProvider>
|
|
29
|
-
* <Tooltip followCursor="x">
|
|
30
|
-
* <TooltipTrigger>
|
|
31
|
-
* <button>Hover me</button>
|
|
32
|
-
* </TooltipTrigger>
|
|
33
|
-
* <TooltipPortal>
|
|
34
|
-
* <TooltipPositioner sideOffset={4}>
|
|
35
|
-
* <TooltipPopup>
|
|
36
|
-
* <TooltipArrow />
|
|
37
|
-
* Helpful information
|
|
38
|
-
* </TooltipPopup>
|
|
39
|
-
* </TooltipPositioner>
|
|
40
|
-
* </TooltipPortal>
|
|
41
|
-
* </Tooltip>
|
|
42
|
-
* </TooltipProvider>
|
|
43
|
-
* );
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
import * as React from 'react';
|
|
49
|
-
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
50
|
-
import {
|
|
51
|
-
AnimatePresence,
|
|
52
|
-
motion,
|
|
53
|
-
useMotionValue,
|
|
54
|
-
useSpring,
|
|
55
|
-
} from 'motion/react';
|
|
56
|
-
|
|
57
|
-
import { getStrictContext } from '@/react-ui/lib/get-strict-context';
|
|
58
|
-
import { useControlledState } from '@/react-ui/hooks/State/UseControlledState';
|
|
59
|
-
import { cn } from '@/react-ui/lib/utils';
|
|
60
|
-
|
|
61
|
-
import { tooltipStyles } from './Tooltip.styles';
|
|
62
|
-
import type {
|
|
63
|
-
TooltipContextType,
|
|
64
|
-
ITooltipProps,
|
|
65
|
-
ITooltipProviderProps,
|
|
66
|
-
ITooltipTriggerProps,
|
|
67
|
-
ITooltipPortalProps,
|
|
68
|
-
ITooltipPositionerProps,
|
|
69
|
-
ITooltipPopupProps,
|
|
70
|
-
ITooltipArrowProps,
|
|
71
|
-
} from './Tooltip.types';
|
|
72
|
-
|
|
73
|
-
/* -------------------------------------------------------------------------- */
|
|
74
|
-
/* Context */
|
|
75
|
-
/* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
const [LocalTooltipProvider, useTooltip] =
|
|
78
|
-
getStrictContext<TooltipContextType>('TooltipContext');
|
|
79
|
-
|
|
80
|
-
/* -------------------------------------------------------------------------- */
|
|
81
|
-
/* TooltipProvider */
|
|
82
|
-
/* -------------------------------------------------------------------------- */
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Shared configuration provider for a group of tooltips.
|
|
86
|
-
* Sets defaults like delay, skip-delay, and close-delay for all nested Tooltips.
|
|
87
|
-
*
|
|
88
|
-
* @param props - Provider props forwarded to Base UI Tooltip.Provider
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```tsx
|
|
92
|
-
* <TooltipProvider delay={200}>
|
|
93
|
-
* <Tooltip>...</Tooltip>
|
|
94
|
-
* <Tooltip>...</Tooltip>
|
|
95
|
-
* </TooltipProvider>
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
function TooltipProvider({ slots: _slots, ...props }: ITooltipProviderProps) {
|
|
99
|
-
return (
|
|
100
|
-
<TooltipPrimitive.Provider data-slot="tooltip-provider" {...props} />
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* -------------------------------------------------------------------------- */
|
|
105
|
-
/* Tooltip (Root) */
|
|
106
|
-
/* -------------------------------------------------------------------------- */
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Root Tooltip component.
|
|
110
|
-
* Manages controlled/uncontrolled open state, cursor-following motion values,
|
|
111
|
-
* and provides context to children.
|
|
112
|
-
*
|
|
113
|
-
* @param props - Tooltip root props including `followCursor` and spring options
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```tsx
|
|
117
|
-
* <Tooltip followCursor="x" followCursorSpringOptions={{ stiffness: 300 }}>
|
|
118
|
-
* <TooltipTrigger>Hover</TooltipTrigger>
|
|
119
|
-
* <TooltipPortal>
|
|
120
|
-
* <TooltipPositioner>
|
|
121
|
-
* <TooltipPopup>Content</TooltipPopup>
|
|
122
|
-
* </TooltipPositioner>
|
|
123
|
-
* </TooltipPortal>
|
|
124
|
-
* </Tooltip>
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
function Tooltip({
|
|
128
|
-
followCursor = false,
|
|
129
|
-
followCursorSpringOptions = { stiffness: 200, damping: 17 },
|
|
130
|
-
slots,
|
|
131
|
-
config: _config,
|
|
132
|
-
...props
|
|
133
|
-
}: ITooltipProps) {
|
|
134
|
-
const [isOpen, setIsOpen] = useControlledState({
|
|
135
|
-
value: props?.open,
|
|
136
|
-
defaultValue: props?.defaultOpen,
|
|
137
|
-
onChange: props?.onOpenChange,
|
|
138
|
-
});
|
|
139
|
-
const x = useMotionValue(0);
|
|
140
|
-
const y = useMotionValue(0);
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<LocalTooltipProvider
|
|
144
|
-
value={{
|
|
145
|
-
isOpen,
|
|
146
|
-
setIsOpen,
|
|
147
|
-
x,
|
|
148
|
-
y,
|
|
149
|
-
followCursor,
|
|
150
|
-
followCursorSpringOptions,
|
|
151
|
-
}}
|
|
152
|
-
>
|
|
153
|
-
<TooltipPrimitive.Root
|
|
154
|
-
data-slot="tooltip"
|
|
155
|
-
{...props}
|
|
156
|
-
onOpenChange={setIsOpen}
|
|
157
|
-
/>
|
|
158
|
-
</LocalTooltipProvider>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/* -------------------------------------------------------------------------- */
|
|
163
|
-
/* TooltipTrigger */
|
|
164
|
-
/* -------------------------------------------------------------------------- */
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Trigger element that shows the tooltip on hover/focus.
|
|
168
|
-
* Tracks mouse position when `followCursor` is enabled on the parent Tooltip.
|
|
169
|
-
*
|
|
170
|
-
* @param props - Trigger props forwarded to Base UI Tooltip.Trigger
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```tsx
|
|
174
|
-
* <TooltipTrigger>
|
|
175
|
-
* <button>Hover me</button>
|
|
176
|
-
* </TooltipTrigger>
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
function TooltipTrigger({
|
|
180
|
-
onMouseMove,
|
|
181
|
-
slots,
|
|
182
|
-
className,
|
|
183
|
-
...props
|
|
184
|
-
}: ITooltipTriggerProps) {
|
|
185
|
-
const { x, y, followCursor } = useTooltip();
|
|
186
|
-
|
|
187
|
-
const handleMouseMove = (
|
|
188
|
-
event: Parameters<NonNullable<ITooltipTriggerProps['onMouseMove']>>[0],
|
|
189
|
-
) => {
|
|
190
|
-
onMouseMove?.(event);
|
|
191
|
-
|
|
192
|
-
const target = event.currentTarget.getBoundingClientRect();
|
|
193
|
-
|
|
194
|
-
if (followCursor === 'x' || followCursor === true) {
|
|
195
|
-
const eventOffsetX = event.clientX - target.left;
|
|
196
|
-
const offsetXFromCenter = (eventOffsetX - target.width / 2) / 2;
|
|
197
|
-
x.set(offsetXFromCenter);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (followCursor === 'y' || followCursor === true) {
|
|
201
|
-
const eventOffsetY = event.clientY - target.top;
|
|
202
|
-
const offsetYFromCenter = (eventOffsetY - target.height / 2) / 2;
|
|
203
|
-
y.set(offsetYFromCenter);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
return (
|
|
208
|
-
<TooltipPrimitive.Trigger
|
|
209
|
-
data-slot="tooltip-trigger"
|
|
210
|
-
className={cn(tooltipStyles.trigger, slots?.trigger, className)}
|
|
211
|
-
onMouseMove={handleMouseMove}
|
|
212
|
-
{...props}
|
|
213
|
-
/>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/* -------------------------------------------------------------------------- */
|
|
218
|
-
/* TooltipPortal */
|
|
219
|
-
/* -------------------------------------------------------------------------- */
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Portal wrapper with AnimatePresence for coordinated enter/exit animations.
|
|
223
|
-
* Internally sets `keepMounted` so motion exit animations play correctly.
|
|
224
|
-
*
|
|
225
|
-
* @param props - Portal props (without keepMounted)
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```tsx
|
|
229
|
-
* <TooltipPortal>
|
|
230
|
-
* <TooltipPositioner>
|
|
231
|
-
* <TooltipPopup>...</TooltipPopup>
|
|
232
|
-
* </TooltipPositioner>
|
|
233
|
-
* </TooltipPortal>
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
function TooltipPortal({ slots: _slots, ...props }: ITooltipPortalProps) {
|
|
237
|
-
const { isOpen } = useTooltip();
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<AnimatePresence>
|
|
241
|
-
{isOpen && (
|
|
242
|
-
<TooltipPrimitive.Portal
|
|
243
|
-
keepMounted
|
|
244
|
-
data-slot="tooltip-portal"
|
|
245
|
-
{...props}
|
|
246
|
-
/>
|
|
247
|
-
)}
|
|
248
|
-
</AnimatePresence>
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/* -------------------------------------------------------------------------- */
|
|
253
|
-
/* TooltipPositioner */
|
|
254
|
-
/* -------------------------------------------------------------------------- */
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Positioning wrapper that automatically places the popup relative to the trigger.
|
|
258
|
-
*
|
|
259
|
-
* @param props - Positioner props forwarded to Base UI Tooltip.Positioner
|
|
260
|
-
*
|
|
261
|
-
* @example
|
|
262
|
-
* ```tsx
|
|
263
|
-
* <TooltipPositioner sideOffset={4}>
|
|
264
|
-
* <TooltipPopup>Content</TooltipPopup>
|
|
265
|
-
* </TooltipPositioner>
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
function TooltipPositioner({
|
|
269
|
-
slots,
|
|
270
|
-
className,
|
|
271
|
-
...props
|
|
272
|
-
}: ITooltipPositionerProps) {
|
|
273
|
-
return (
|
|
274
|
-
<TooltipPrimitive.Positioner
|
|
275
|
-
data-slot="tooltip-positioner"
|
|
276
|
-
className={cn(tooltipStyles.positioner, slots?.positioner, className)}
|
|
277
|
-
{...props}
|
|
278
|
-
/>
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/* -------------------------------------------------------------------------- */
|
|
283
|
-
/* TooltipPopup */
|
|
284
|
-
/* -------------------------------------------------------------------------- */
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Main tooltip content container with scale entrance animation.
|
|
288
|
-
* Supports spring-animated cursor-following when `followCursor` is enabled
|
|
289
|
-
* on the parent Tooltip.
|
|
290
|
-
*
|
|
291
|
-
* @param props - Popup props including motion transition overrides
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* ```tsx
|
|
295
|
-
* <TooltipPopup slots={{ popup: 'bg-primary text-primary-foreground' }}>
|
|
296
|
-
* Helpful information
|
|
297
|
-
* </TooltipPopup>
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
function TooltipPopup({
|
|
301
|
-
transition = { type: 'spring', stiffness: 300, damping: 25 },
|
|
302
|
-
style,
|
|
303
|
-
slots,
|
|
304
|
-
className,
|
|
305
|
-
...props
|
|
306
|
-
}: ITooltipPopupProps) {
|
|
307
|
-
const { x, y, followCursor, followCursorSpringOptions } = useTooltip();
|
|
308
|
-
const translateX = useSpring(x, followCursorSpringOptions);
|
|
309
|
-
const translateY = useSpring(y, followCursorSpringOptions);
|
|
310
|
-
|
|
311
|
-
return (
|
|
312
|
-
<TooltipPrimitive.Popup
|
|
313
|
-
render={
|
|
314
|
-
<motion.div
|
|
315
|
-
key="tooltip-popup"
|
|
316
|
-
data-slot="tooltip-popup"
|
|
317
|
-
className={cn(tooltipStyles.popup, slots?.popup, className)}
|
|
318
|
-
initial={{ opacity: 0, scale: 0.5 }}
|
|
319
|
-
animate={{ opacity: 1, scale: 1 }}
|
|
320
|
-
exit={{ opacity: 0, scale: 0.5 }}
|
|
321
|
-
transition={transition}
|
|
322
|
-
style={{
|
|
323
|
-
x:
|
|
324
|
-
followCursor === 'x' || followCursor === true
|
|
325
|
-
? translateX
|
|
326
|
-
: undefined,
|
|
327
|
-
y:
|
|
328
|
-
followCursor === 'y' || followCursor === true
|
|
329
|
-
? translateY
|
|
330
|
-
: undefined,
|
|
331
|
-
...style,
|
|
332
|
-
}}
|
|
333
|
-
{...(props as any)}
|
|
334
|
-
/>
|
|
335
|
-
}
|
|
336
|
-
/>
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/* -------------------------------------------------------------------------- */
|
|
341
|
-
/* TooltipArrow */
|
|
342
|
-
/* -------------------------------------------------------------------------- */
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Directional arrow pointing toward the trigger element.
|
|
346
|
-
*
|
|
347
|
-
* @param props - Arrow props forwarded to Base UI Tooltip.Arrow
|
|
348
|
-
*
|
|
349
|
-
* @example
|
|
350
|
-
* ```tsx
|
|
351
|
-
* <TooltipArrow slots={{ arrow: 'fill-primary' }} />
|
|
352
|
-
* ```
|
|
353
|
-
*/
|
|
354
|
-
function TooltipArrow({ slots, className, ...props }: ITooltipArrowProps) {
|
|
355
|
-
return (
|
|
356
|
-
<TooltipPrimitive.Arrow
|
|
357
|
-
data-slot="tooltip-arrow"
|
|
358
|
-
className={cn(tooltipStyles.arrow, slots?.arrow, className)}
|
|
359
|
-
{...props}
|
|
360
|
-
/>
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/* -------------------------------------------------------------------------- */
|
|
365
|
-
/* Exports */
|
|
366
|
-
/* -------------------------------------------------------------------------- */
|
|
367
|
-
|
|
368
|
-
export {
|
|
369
|
-
TooltipProvider,
|
|
370
|
-
Tooltip,
|
|
371
|
-
TooltipTrigger,
|
|
372
|
-
TooltipPortal,
|
|
373
|
-
TooltipPositioner,
|
|
374
|
-
TooltipPopup,
|
|
375
|
-
TooltipArrow,
|
|
376
|
-
useTooltip,
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// Re-exports from types
|
|
380
|
-
export type {
|
|
381
|
-
ITooltipProviderProps,
|
|
382
|
-
ITooltipProps,
|
|
383
|
-
ITooltipTriggerProps,
|
|
384
|
-
ITooltipPortalProps,
|
|
385
|
-
ITooltipPositionerProps,
|
|
386
|
-
ITooltipPopupProps,
|
|
387
|
-
ITooltipArrowProps,
|
|
388
|
-
TooltipContextType,
|
|
389
|
-
TooltipSlot,
|
|
390
|
-
ITooltipConfig,
|
|
391
|
-
} from './Tooltip.types';
|
|
392
|
-
|
|
393
|
-
// Re-exports from styles
|
|
394
|
-
export { tooltipStyles } from './Tooltip.styles';
|
package/src/react-ui/ui/index.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UI components barrel export.
|
|
3
|
-
*
|
|
4
|
-
* All public UI components built on Base UI primitives with StyleSlots/CVA pattern.
|
|
5
|
-
*
|
|
6
|
-
* @module @mks2508/mks-ui/react/ui
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// Animate UI components
|
|
10
|
-
export * from './Accordion';
|
|
11
|
-
export * from './AlertDialog';
|
|
12
|
-
export * from './Checkbox';
|
|
13
|
-
export * from './Dialog';
|
|
14
|
-
export * from './Menu';
|
|
15
|
-
export * from './Popover';
|
|
16
|
-
export * from './Progress';
|
|
17
|
-
export * from './Switch';
|
|
18
|
-
export * from './Tabs';
|
|
19
|
-
export * from './Tooltip';
|
|
20
|
-
|
|
21
|
-
// Base UI components
|
|
22
|
-
export * from './Badge';
|
|
23
|
-
export * from './Button';
|
|
24
|
-
export * from './Card';
|
|
25
|
-
export * from './Combobox';
|
|
26
|
-
export * from './CornerBracket';
|
|
27
|
-
export * from './DropdownMenu';
|
|
28
|
-
export * from './Field';
|
|
29
|
-
export * from './Input';
|
|
30
|
-
export * from './InputGroup';
|
|
31
|
-
export * from './Label';
|
|
32
|
-
export * from './Select';
|
|
33
|
-
export * from './Separator';
|
|
34
|
-
export * from './Textarea';
|
|
35
|
-
export * from './DataCard';
|
|
36
|
-
|
|
37
|
-
// WAAPI-based components
|
|
38
|
-
export * from './TextFlow';
|
|
39
|
-
|
|
40
|
-
// CSS-animated components
|
|
41
|
-
export * from './DynamicToggle';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type declarations for CSS modules
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
declare module '*.module.css' {
|
|
6
|
-
const classes: { [key: string]: string };
|
|
7
|
-
export default classes;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare module '*.module.scss' {
|
|
11
|
-
const classes: { [key: string]: string };
|
|
12
|
-
export default classes;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare module '*.module.sass' {
|
|
16
|
-
const classes: { [key: string]: string };
|
|
17
|
-
export default classes;
|
|
18
|
-
}
|