@likec4/diagram 1.31.0 → 1.32.0
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/bundle/{chunk-BBzMXzCg.js → chunk-BvTQaUYl.js} +1675 -1207
- package/bundle/custom.js +50 -47
- package/bundle/index.js +2482 -2438
- package/dist/LikeC4CustomColors.d.ts +2 -7
- package/dist/LikeC4CustomColors.js +17 -6
- package/dist/LikeC4Diagram.d.ts +3 -2
- package/dist/LikeC4Diagram.js +10 -14
- package/dist/LikeC4Diagram.props.d.ts +28 -22
- package/dist/LikeC4ModelProvider.d.ts +5 -4
- package/dist/StaticLikeC4Diagram.d.ts +3 -2
- package/dist/StaticLikeC4Diagram.js +2 -2
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +2 -1
- package/dist/base/primitives/compound/CompoundActionButton.js +2 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -1
- package/dist/base/primitives/compound/CompoundTitle.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundTitle.js +2 -1
- package/dist/base/primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeLabel.css.js +1 -0
- package/dist/base/primitives/edge/EdgeLabel.d.ts +3 -3
- package/dist/base/primitives/edge/EdgeLabel.js +6 -4
- package/dist/base/primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeMarkers.d.ts +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +10 -9
- package/dist/base/primitives/element/ElementDetailsButton.js +2 -1
- package/dist/base/primitives/element/ElementShape.d.ts +1 -1
- package/dist/base/primitives/element/ElementTags.d.ts +14 -0
- package/dist/base/primitives/element/ElementTags.js +176 -0
- package/dist/base/primitives/element/ElementTitle.d.ts +5 -4
- package/dist/base/primitives/element/ElementTitle.js +6 -6
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/base/types.Base.d.ts +54 -0
- package/dist/base/types.Base.js +48 -0
- package/dist/base/types.d.ts +2 -52
- package/dist/bundle/LikeC4View.d.ts +2 -1
- package/dist/bundle/LikeC4View.js +8 -6
- package/dist/bundle/LikeC4View.props.d.ts +15 -4
- package/dist/bundle/ReactLikeC4.d.ts +4 -7
- package/dist/bundle/ReactLikeC4.js +3 -2
- package/dist/bundle/index.js +1 -1
- package/dist/components/ErrorFallback.d.ts +2 -0
- package/dist/components/ErrorFallback.js +29 -0
- package/dist/context/DiagramEventHandlers.d.ts +6 -5
- package/dist/context/DiagramFeatures.d.ts +2 -2
- package/dist/context/DiagramFeatures.js +3 -31
- package/dist/context/EnsureMantine.js +1 -1
- package/dist/context/IconRenderer.js +1 -4
- package/dist/context/RootContainer.js +5 -1
- package/dist/context/TagStylesContext.d.ts +7 -0
- package/dist/context/TagStylesContext.js +85 -0
- package/dist/custom/components.d.ts +1 -1
- package/dist/custom/customNodes.d.ts +27 -17
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useDiagram.d.ts +73 -38
- package/dist/hooks/useDiagram.js +7 -3
- package/dist/hooks/useMantinePortalProps.d.ts +2 -2
- package/dist/hooks/useSearchActor.d.ts +2 -0
- package/dist/hooks/useSearchActor.js +10 -0
- package/dist/hooks/useUpdateEffect.js +3 -0
- package/dist/hooks/useXYFlow.d.ts +39 -37
- package/dist/hooks/useXYFlow.js +5 -1
- package/dist/index.js +1 -1
- package/dist/likec4diagram/DiagramUI.js +7 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +4 -3
- package/dist/likec4diagram/DiagramXYFlow.js +104 -107
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +7 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +8 -0
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +7 -5
- package/dist/likec4diagram/custom/index.d.ts +7 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +39 -26
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
- package/dist/likec4diagram/types.d.ts +5 -5
- package/dist/likec4diagram/ui/controls/Controls.js +12 -4
- package/dist/likec4diagram/ui/notation/NotationPanel.js +1 -1
- package/dist/likec4diagram/useViewToNodesEdges.d.ts +5 -3
- package/dist/likec4diagram/useViewToNodesEdges.js +20 -30
- package/dist/likec4model/LikeC4ModelContext.d.ts +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +1 -1
- package/dist/likec4model/useLikeC4Model.d.ts +22 -10
- package/dist/likec4model/useLikeC4Model.js +11 -7
- package/dist/overlays/Overlays.js +4 -27
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.js +19 -12
- package/dist/overlays/element-details/TabPanelDeployments.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelDeployments.js +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelStructure.d.ts +1 -1
- package/dist/overlays/element-details/actor.d.ts +288 -286
- package/dist/overlays/overlay/Overlay.css.d.ts +57 -2
- package/dist/overlays/overlay/Overlay.css.js +76 -39
- package/dist/overlays/overlay/Overlay.d.ts +12 -0
- package/dist/overlays/overlay/Overlay.js +36 -25
- package/dist/overlays/overlaysActor.d.ts +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +3 -2
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/_types.d.ts +2 -2
- package/dist/overlays/relationship-details/actor.js +7 -7
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +3 -2
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -0
- package/dist/overlays/relationship-details/hooks.d.ts +10 -9
- package/dist/overlays/relationship-details/layout-to-xyflow.js +1 -0
- package/dist/overlays/relationship-details/layout.js +3 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +3 -2
- package/dist/overlays/relationships-browser/SelectElement.js +1 -1
- package/dist/overlays/relationships-browser/_types.d.ts +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +7 -7
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +3 -2
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +8 -5
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -0
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +10 -6
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +4 -3
- package/dist/search/Search.d.ts +5 -0
- package/dist/search/Search.js +192 -0
- package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.css.js +0 -1
- package/dist/search/components/ElementsColumn.d.ts +2 -0
- package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.js +21 -19
- package/dist/search/components/PickView.d.ts +4 -0
- package/dist/search/components/PickView.js +135 -0
- package/dist/search/components/SearchByTags.d.ts +1 -0
- package/dist/search/components/SearchByTags.js +116 -0
- package/dist/search/components/SearchInput.d.ts +2 -0
- package/dist/{likec4diagram/ui/search → search/components}/SearchInput.js +53 -34
- package/dist/{likec4diagram/ui/search → search/components}/ViewsColum.d.ts +3 -2
- package/dist/{likec4diagram/ui/search → search/components}/ViewsColum.js +14 -13
- package/dist/{likec4diagram/ui/search → search/components}/_shared.css.js +26 -35
- package/dist/{likec4diagram/ui/search/LikeC4Search.css.d.ts → search/components/styles.css.d.ts} +0 -2
- package/dist/search/components/styles.css.js +60 -0
- package/dist/{likec4diagram/ui/search → search/components}/utils.d.ts +1 -0
- package/dist/{likec4diagram/ui/search → search/components}/utils.js +7 -1
- package/dist/search/hooks.d.ts +16 -0
- package/dist/search/hooks.js +35 -0
- package/dist/search/searchActor.d.ts +90 -0
- package/dist/search/searchActor.js +75 -0
- package/dist/state/DiagramActorProvider.d.ts +9 -7
- package/dist/state/DiagramActorProvider.js +24 -18
- package/dist/state/assign.d.ts +0 -1
- package/dist/state/assign.js +9 -19
- package/dist/state/diagram-machine.d.ts +430 -176
- package/dist/state/diagram-machine.js +119 -54
- package/dist/state/syncManualLayoutActor.d.ts +2 -2
- package/dist/state/types.d.ts +2 -0
- package/dist/state/utils.d.ts +2 -0
- package/dist/state/utils.js +3 -0
- package/dist/styles-min.css +1 -1
- package/dist/styles-xyflow.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +18 -18
- package/panda.buildinfo.json +171 -148
- package/src/LikeC4CustomColors.tsx +21 -6
- package/src/LikeC4Diagram.props.ts +35 -30
- package/src/LikeC4Diagram.tsx +19 -20
- package/src/LikeC4ModelProvider.tsx +6 -5
- package/src/StaticLikeC4Diagram.tsx +8 -6
- package/src/base/const.ts +1 -1
- package/src/base/index.ts +2 -1
- package/src/base/primitives/compound/CompoundActionButton.tsx +2 -1
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -1
- package/src/base/primitives/compound/CompoundTitle.tsx +3 -2
- package/src/base/primitives/edge/EdgeContainer.tsx +2 -1
- package/src/base/primitives/edge/EdgeLabel.css.ts +1 -0
- package/src/base/primitives/edge/EdgeLabel.tsx +20 -15
- package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -1
- package/src/base/primitives/edge/EdgeMarkers.tsx +2 -1
- package/src/base/primitives/edge/EdgePath.tsx +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +11 -10
- package/src/base/primitives/element/ElementDetailsButton.tsx +2 -1
- package/src/base/primitives/element/ElementShape.tsx +2 -1
- package/src/base/primitives/element/ElementTags.tsx +182 -0
- package/src/base/primitives/element/ElementTitle.tsx +21 -15
- package/src/base/primitives/index.ts +1 -0
- package/src/base/types.Base.ts +104 -0
- package/src/base/types.ts +2 -99
- package/src/bundle/LikeC4View.props.ts +17 -4
- package/src/bundle/LikeC4View.tsx +17 -19
- package/src/bundle/ReactLikeC4.tsx +14 -26
- package/src/components/ErrorFallback.tsx +30 -0
- package/src/context/DiagramEventHandlers.tsx +5 -4
- package/src/context/DiagramFeatures.tsx +3 -22
- package/src/context/EnsureMantine.tsx +1 -1
- package/src/context/IconRenderer.tsx +1 -4
- package/src/context/RootContainer.tsx +9 -3
- package/src/context/TagStylesContext.tsx +96 -0
- package/src/custom/components.ts +2 -0
- package/src/custom/customNodes.tsx +24 -14
- package/src/custom/hooks.ts +1 -0
- package/src/hooks/index.ts +1 -1
- package/src/hooks/useCurrentViewId.ts +1 -4
- package/src/hooks/useDiagram.ts +104 -12
- package/src/hooks/useMantinePortalProps.ts +10 -1
- package/src/hooks/useSearchActor.ts +11 -0
- package/src/hooks/useUpdateEffect.ts +7 -4
- package/src/hooks/useXYFlow.ts +5 -0
- package/src/likec4diagram/DiagramUI.tsx +5 -0
- package/src/likec4diagram/DiagramXYFlow.tsx +115 -118
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +9 -0
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +10 -9
- package/src/likec4diagram/custom/nodes/nodes.tsx +45 -43
- package/src/likec4diagram/custom/nodes/toolbar/_shared.tsx +11 -3
- package/src/likec4diagram/types.ts +5 -3
- package/src/likec4diagram/ui/controls/Controls.tsx +11 -4
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +2 -2
- package/src/likec4diagram/useViewToNodesEdges.ts +34 -36
- package/src/likec4model/LikeC4ModelContext.ts +2 -2
- package/src/likec4model/useLikeC4ElementsTree.ts +1 -1
- package/src/likec4model/useLikeC4Model.ts +18 -16
- package/src/overlays/Overlays.tsx +5 -32
- package/src/overlays/element-details/ElementDetailsCard.tsx +25 -18
- package/src/overlays/element-details/TabPanelDeployments.tsx +3 -2
- package/src/overlays/element-details/TabPanelRelationships.tsx +2 -1
- package/src/overlays/element-details/TabPanelStructure.tsx +1 -1
- package/src/overlays/element-details/actor.ts +2 -2
- package/src/overlays/overlay/Overlay.css.ts +75 -38
- package/src/overlays/overlay/Overlay.tsx +43 -26
- package/src/overlays/overlaysActor.ts +1 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +4 -4
- package/src/overlays/relationship-details/_types.ts +2 -1
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +4 -0
- package/src/overlays/relationship-details/layout-to-xyflow.ts +1 -0
- package/src/overlays/relationship-details/layout.ts +3 -1
- package/src/overlays/relationships-browser/SelectElement.tsx +1 -1
- package/src/overlays/relationships-browser/_types.ts +2 -1
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +4 -0
- package/src/overlays/relationships-browser/layout.ts +12 -7
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +4 -4
- package/src/search/Search.tsx +237 -0
- package/src/{likec4diagram/ui/search → search/components}/ElementsColumn.css.ts +0 -29
- package/src/{likec4diagram/ui/search → search/components}/ElementsColumn.tsx +24 -22
- package/src/search/components/PickView.tsx +140 -0
- package/src/search/components/SearchByTags.tsx +109 -0
- package/src/{likec4diagram/ui/search → search/components}/SearchInput.tsx +63 -36
- package/src/{likec4diagram/ui/search → search/components}/ViewsColum.tsx +17 -18
- package/src/{likec4diagram/ui/search → search/components}/_shared.css.ts +26 -37
- package/src/{likec4diagram/ui/search/LikeC4Search.css.ts → search/components/styles.css.ts} +9 -36
- package/src/{likec4diagram/ui/search → search/components}/utils.ts +7 -0
- package/src/search/hooks.ts +41 -0
- package/src/search/searchActor.ts +99 -0
- package/src/state/DiagramActorProvider.tsx +36 -25
- package/src/state/assign.ts +10 -10
- package/src/state/diagram-machine.ts +115 -52
- package/src/state/syncManualLayoutActor.ts +1 -1
- package/src/state/types.ts +2 -0
- package/src/state/utils.ts +4 -0
- package/dist/base/types.js +0 -54
- package/dist/likec4diagram/ui/search/ElementsColumn.d.ts +0 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.css.js +0 -87
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +0 -2
- package/dist/likec4diagram/ui/search/LikeC4Search.js +0 -267
- package/dist/likec4diagram/ui/search/SearchInput.d.ts +0 -1
- package/dist/likec4diagram/ui/search/state.d.ts +0 -19
- package/dist/likec4diagram/ui/search/state.js +0 -63
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +0 -301
- package/src/likec4diagram/ui/search/state.ts +0 -78
- /package/dist/{likec4diagram/ui/search → search/components}/ElementsColumn.css.d.ts +0 -0
- /package/dist/{likec4diagram/ui/search → search/components}/ViewsColumn.css.d.ts +0 -0
- /package/dist/{likec4diagram/ui/search → search/components}/ViewsColumn.css.js +0 -0
- /package/dist/{likec4diagram/ui/search → search/components}/_shared.css.d.ts +0 -0
- /package/src/{likec4diagram/ui/search → search/components}/ViewsColumn.css.ts +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { css } from '@likec4/styles/css'
|
|
2
|
+
import { VStack } from '@likec4/styles/jsx'
|
|
3
|
+
import { FocusTrap, Grid, GridCol, Group, ScrollArea, Title } from '@mantine/core'
|
|
4
|
+
import {
|
|
5
|
+
useCallbackRef,
|
|
6
|
+
useHotkeys,
|
|
7
|
+
} from '@mantine/hooks'
|
|
8
|
+
import { useTimeoutEffect } from '@react-hookz/web'
|
|
9
|
+
import { useSelector } from '@xstate/react'
|
|
10
|
+
import { AnimatePresence, LayoutGroup } from 'motion/react'
|
|
11
|
+
import { memo, useRef } from 'react'
|
|
12
|
+
import { ErrorBoundary } from 'react-error-boundary'
|
|
13
|
+
import { isTruthy } from 'remeda'
|
|
14
|
+
import { ErrorFallback } from '../components/ErrorFallback'
|
|
15
|
+
import { DiagramFeatures } from '../context/DiagramFeatures'
|
|
16
|
+
import { Overlay } from '../overlays/overlay/Overlay'
|
|
17
|
+
import { ElementsColumn } from './components/ElementsColumn'
|
|
18
|
+
import { PickView } from './components/PickView'
|
|
19
|
+
import { SearchByTags } from './components/SearchByTags'
|
|
20
|
+
import { LikeC4SearchInput } from './components/SearchInput'
|
|
21
|
+
import { focusToFirstFoundElement, moveFocusToSearchInput } from './components/utils'
|
|
22
|
+
import { ViewsColumn } from './components/ViewsColum'
|
|
23
|
+
import { SearchActorContext, usePickViewFor } from './hooks'
|
|
24
|
+
import { type SearchActorRef, type SearchActorSnapshot } from './searchActor'
|
|
25
|
+
|
|
26
|
+
const dialog = css({
|
|
27
|
+
backgroundColor: `[rgb(34 34 34 / var(--_opacity, 95%))]`,
|
|
28
|
+
_light: {
|
|
29
|
+
backgroundColor: `[rgb(250 250 250 / var(--_opacity, 95%))]`,
|
|
30
|
+
},
|
|
31
|
+
backdropFilter: 'auto',
|
|
32
|
+
backdropBlur: 'var(--_blur, 10px)',
|
|
33
|
+
// base: `[rgb(34 34 34 / var(${backdropOpacity}))]`,
|
|
34
|
+
// _light: `[rgb(255 255 255/ var(${backdropOpacity}))]`,
|
|
35
|
+
// },
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const body = css({
|
|
39
|
+
// containerName: 'likec4-search',
|
|
40
|
+
// containerType: 'size',
|
|
41
|
+
// position: 'fixed',
|
|
42
|
+
// zIndex: 901,
|
|
43
|
+
// top: 0,
|
|
44
|
+
// left: 0,
|
|
45
|
+
width: '100%',
|
|
46
|
+
height: '100%',
|
|
47
|
+
maxHeight: '100vh',
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'column',
|
|
51
|
+
justifyContent: 'stretch',
|
|
52
|
+
gap: 'sm',
|
|
53
|
+
paddingTop: 20,
|
|
54
|
+
paddingLeft: 16,
|
|
55
|
+
paddingRight: 16,
|
|
56
|
+
paddingBottom: 8,
|
|
57
|
+
background: '[transparent]',
|
|
58
|
+
// backgroundColor: {
|
|
59
|
+
// _dark: `[rgb(34 34 34 / 0.95)]`,
|
|
60
|
+
// _light: `[rgb(255 255 255/ 0.95)]`,
|
|
61
|
+
// },
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const selectIsOpened = (s: SearchActorSnapshot) => !s.matches('inactive')
|
|
65
|
+
|
|
66
|
+
export const Search = memo<{ searchActorRef: SearchActorRef }>(({ searchActorRef }) => {
|
|
67
|
+
const isOpened = useSelector(searchActorRef, selectIsOpened)
|
|
68
|
+
|
|
69
|
+
const openSearch = () => {
|
|
70
|
+
searchActorRef.send({ type: 'open' })
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const sendClose = () => {
|
|
74
|
+
searchActorRef.send({ type: 'close' })
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const afterCloseCbRef = useRef<(() => void)>(null)
|
|
78
|
+
const close = useCallbackRef((cb?: () => void) => {
|
|
79
|
+
afterCloseCbRef.current = cb ?? null
|
|
80
|
+
sendClose()
|
|
81
|
+
})
|
|
82
|
+
const onExitComplete = useCallbackRef(() => {
|
|
83
|
+
if (afterCloseCbRef.current) {
|
|
84
|
+
afterCloseCbRef.current()
|
|
85
|
+
afterCloseCbRef.current = null
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
useHotkeys([
|
|
90
|
+
['mod+k', openSearch, {
|
|
91
|
+
preventDefault: true,
|
|
92
|
+
}],
|
|
93
|
+
['mod+f', openSearch, {
|
|
94
|
+
preventDefault: true,
|
|
95
|
+
}],
|
|
96
|
+
])
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<SearchActorContext
|
|
100
|
+
value={{
|
|
101
|
+
searchActorRef,
|
|
102
|
+
close,
|
|
103
|
+
}}>
|
|
104
|
+
<DiagramFeatures.Overlays>
|
|
105
|
+
<ErrorBoundary FallbackComponent={ErrorFallback} onReset={sendClose}>
|
|
106
|
+
<LayoutGroup>
|
|
107
|
+
<AnimatePresence onExitComplete={onExitComplete}>
|
|
108
|
+
{isOpened && (
|
|
109
|
+
<Overlay
|
|
110
|
+
fullscreen
|
|
111
|
+
withBackdrop={false}
|
|
112
|
+
backdrop={{
|
|
113
|
+
opacity: 0.9,
|
|
114
|
+
}}
|
|
115
|
+
classes={{
|
|
116
|
+
dialog,
|
|
117
|
+
body,
|
|
118
|
+
}}
|
|
119
|
+
openDelay={0}
|
|
120
|
+
onClose={close}
|
|
121
|
+
data-likec4-search="true"
|
|
122
|
+
>
|
|
123
|
+
<SearchOverlay close={close} searchActorRef={searchActorRef} />
|
|
124
|
+
</Overlay>
|
|
125
|
+
)}
|
|
126
|
+
</AnimatePresence>
|
|
127
|
+
</LayoutGroup>
|
|
128
|
+
</ErrorBoundary>
|
|
129
|
+
</DiagramFeatures.Overlays>
|
|
130
|
+
</SearchActorContext>
|
|
131
|
+
)
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
const scrollArea = css({
|
|
135
|
+
height: [
|
|
136
|
+
'100%',
|
|
137
|
+
'100cqh',
|
|
138
|
+
],
|
|
139
|
+
'& .mantine-ScrollArea-viewport': {
|
|
140
|
+
minHeight: '100%',
|
|
141
|
+
'& > div': {
|
|
142
|
+
minHeight: '100%',
|
|
143
|
+
height: '100%',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
const SearchOverlay = ({ close, searchActorRef }: { close: () => void; searchActorRef: SearchActorRef }) => {
|
|
149
|
+
const pickViewFor = usePickViewFor()
|
|
150
|
+
|
|
151
|
+
useTimeoutEffect(() => {
|
|
152
|
+
if (isTruthy(searchActorRef.getSnapshot().context.openedWithSearch)) {
|
|
153
|
+
focusToFirstFoundElement()
|
|
154
|
+
}
|
|
155
|
+
}, 150)
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<FocusTrap>
|
|
159
|
+
<Group
|
|
160
|
+
className={'group'}
|
|
161
|
+
wrap="nowrap"
|
|
162
|
+
onClick={e => {
|
|
163
|
+
e.stopPropagation()
|
|
164
|
+
moveFocusToSearchInput()
|
|
165
|
+
}}>
|
|
166
|
+
<VStack flex={1} px={'sm'}>
|
|
167
|
+
<LikeC4SearchInput />
|
|
168
|
+
<SearchByTags />
|
|
169
|
+
</VStack>
|
|
170
|
+
{
|
|
171
|
+
/* <Box
|
|
172
|
+
css={{
|
|
173
|
+
alignSelf: 'flex-start',
|
|
174
|
+
flex: '0 0 auto',
|
|
175
|
+
display: 'flex',
|
|
176
|
+
alignItems: 'center',
|
|
177
|
+
justifyContent: 'center',
|
|
178
|
+
minHeight: 50,
|
|
179
|
+
}}>
|
|
180
|
+
<ActionIcon
|
|
181
|
+
size={'lg'}
|
|
182
|
+
variant="default"
|
|
183
|
+
onClick={(e) => {
|
|
184
|
+
e.stopPropagation()
|
|
185
|
+
close()
|
|
186
|
+
}}>
|
|
187
|
+
<IconX />
|
|
188
|
+
</ActionIcon>
|
|
189
|
+
</Box> */
|
|
190
|
+
}
|
|
191
|
+
</Group>
|
|
192
|
+
<Grid>
|
|
193
|
+
<GridCol span={6}>
|
|
194
|
+
<Title component={'div'} order={6} c="dimmed" pl="sm">Elements</Title>
|
|
195
|
+
</GridCol>
|
|
196
|
+
<GridCol span={6}>
|
|
197
|
+
<Title component={'div'} order={6} c="dimmed" pl="sm">Views</Title>
|
|
198
|
+
</GridCol>
|
|
199
|
+
</Grid>
|
|
200
|
+
<Grid
|
|
201
|
+
className={css({
|
|
202
|
+
containerName: 'likec4-search-elements',
|
|
203
|
+
containerType: 'size',
|
|
204
|
+
overflow: 'hidden',
|
|
205
|
+
flexGrow: 1,
|
|
206
|
+
})}>
|
|
207
|
+
<GridCol span={6}>
|
|
208
|
+
<ScrollArea
|
|
209
|
+
type="scroll"
|
|
210
|
+
className={scrollArea}
|
|
211
|
+
pr="xs"
|
|
212
|
+
scrollbars="y">
|
|
213
|
+
<AnimatePresence>
|
|
214
|
+
<LayoutGroup id="likec4-search-elements">
|
|
215
|
+
<ElementsColumn />
|
|
216
|
+
</LayoutGroup>
|
|
217
|
+
</AnimatePresence>
|
|
218
|
+
</ScrollArea>
|
|
219
|
+
</GridCol>
|
|
220
|
+
<GridCol span={6}>
|
|
221
|
+
<ScrollArea
|
|
222
|
+
type="scroll"
|
|
223
|
+
className={scrollArea}
|
|
224
|
+
pr="xs"
|
|
225
|
+
scrollbars="y">
|
|
226
|
+
<AnimatePresence>
|
|
227
|
+
<LayoutGroup id="likec4-search-views">
|
|
228
|
+
<ViewsColumn />
|
|
229
|
+
</LayoutGroup>
|
|
230
|
+
</AnimatePresence>
|
|
231
|
+
</ScrollArea>
|
|
232
|
+
</GridCol>
|
|
233
|
+
</Grid>
|
|
234
|
+
{pickViewFor && <PickView elementFqn={pickViewFor} />}
|
|
235
|
+
</FocusTrap>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
@@ -14,7 +14,6 @@ export const treeRoot = css(
|
|
|
14
14
|
containerName: 'likec4-tree',
|
|
15
15
|
}),
|
|
16
16
|
{
|
|
17
|
-
overflow: 'hidden',
|
|
18
17
|
containerType: 'inline-size',
|
|
19
18
|
height: '100%',
|
|
20
19
|
},
|
|
@@ -65,40 +64,12 @@ export const elementId = css({
|
|
|
65
64
|
},
|
|
66
65
|
})
|
|
67
66
|
|
|
68
|
-
// const iconSizeVar = `var(${iconSize}, 32px)`
|
|
69
67
|
export const elementIcon = css({
|
|
70
68
|
['--likec4-icon-size']: '24px',
|
|
71
69
|
[whenContainerIsNarrow]: {
|
|
72
70
|
['--likec4-icon-size']: '18px',
|
|
73
71
|
},
|
|
74
72
|
})
|
|
75
|
-
// flex: `0 0 ${iconSizeVar}`,
|
|
76
|
-
// height: iconSizeVar,
|
|
77
|
-
// width: iconSizeVar,
|
|
78
|
-
// display: 'flex',
|
|
79
|
-
// alignItems: 'center',
|
|
80
|
-
// justifyContent: 'center',
|
|
81
|
-
// alignSelf: 'flex-start',
|
|
82
|
-
// marginTop: 4,
|
|
83
|
-
// [`& svg, & img`]: {
|
|
84
|
-
// width: '100%',
|
|
85
|
-
// height: 'auto',
|
|
86
|
-
// maxHeight: '100%',
|
|
87
|
-
// pointerEvents: 'none',
|
|
88
|
-
// },
|
|
89
|
-
// [`& img`]: {
|
|
90
|
-
// objectFit: 'contain',
|
|
91
|
-
// },
|
|
92
|
-
// '&.likec4-shape-icon svg': {
|
|
93
|
-
// color: `[var(${iconColor})]`,
|
|
94
|
-
// width: '90%',
|
|
95
|
-
// strokeWidth: 1.5,
|
|
96
|
-
// },
|
|
97
|
-
// [iconSize]: '24px',
|
|
98
|
-
// [whenContainerIsNarrow]: {
|
|
99
|
-
// [iconSize]: '18px',
|
|
100
|
-
// },
|
|
101
|
-
// })
|
|
102
73
|
|
|
103
74
|
export const elementViewsCount = css({
|
|
104
75
|
flex: 0,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type Fqn,
|
|
3
|
-
type LikeC4Model,
|
|
4
2
|
ifilter,
|
|
5
3
|
isAncestor,
|
|
6
4
|
nameFromFqn,
|
|
7
5
|
sortParentsFirst,
|
|
8
6
|
} from '@likec4/core'
|
|
7
|
+
import type { LikeC4Model } from '@likec4/core/model'
|
|
8
|
+
import type { Fqn } from '@likec4/core/types'
|
|
9
9
|
import { cx, cx as clsx } from '@likec4/styles/css'
|
|
10
10
|
import {
|
|
11
11
|
type RenderTreeNodePayload,
|
|
@@ -22,14 +22,15 @@ import {
|
|
|
22
22
|
import { useCallbackRef } from '@mantine/hooks'
|
|
23
23
|
import { IconChevronRight } from '@tabler/icons-react'
|
|
24
24
|
import * as m from 'motion/react-m'
|
|
25
|
-
import { type KeyboardEventHandler, useCallback, useEffect, useMemo } from 'react'
|
|
26
|
-
import { first, isEmpty, only,
|
|
27
|
-
import { IconOrShapeRenderer } from '
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
25
|
+
import { type KeyboardEventHandler, memo, useCallback, useEffect, useMemo } from 'react'
|
|
26
|
+
import { first, isEmpty, only, pipe, reduce } from 'remeda'
|
|
27
|
+
import { IconOrShapeRenderer } from '../../context/IconRenderer'
|
|
28
|
+
import { useDiagram } from '../../hooks/useDiagram'
|
|
29
|
+
import { sortByLabel } from '../../likec4model/useLikeC4ElementsTree'
|
|
30
|
+
import { useLikeC4Model } from '../../likec4model/useLikeC4Model'
|
|
31
|
+
import { useNormalizedSearch, useSearchActor } from '../hooks'
|
|
30
32
|
import { buttonsva } from './_shared.css'
|
|
31
33
|
import * as styles from './ElementsColumn.css'
|
|
32
|
-
import { setPickView, useCloseSearchAndNavigateTo, useNormalizedSearch } from './state'
|
|
33
34
|
import { centerY, moveFocusToSearchInput, stopAndPrevent } from './utils'
|
|
34
35
|
import { NothingFound } from './ViewsColum'
|
|
35
36
|
|
|
@@ -56,14 +57,13 @@ function buildNode(
|
|
|
56
57
|
|
|
57
58
|
const btn = buttonsva()
|
|
58
59
|
|
|
59
|
-
export
|
|
60
|
+
export const ElementsColumn = memo(() => {
|
|
61
|
+
const model = useLikeC4Model()
|
|
60
62
|
const search = useNormalizedSearch()
|
|
61
|
-
const model = useLikeC4Model(true)
|
|
62
|
-
|
|
63
63
|
const data = useMemo(() => {
|
|
64
64
|
const searchTerms = search.split('.')
|
|
65
65
|
let elements
|
|
66
|
-
if (isEmpty(
|
|
66
|
+
if (isEmpty(searchTerms) || searchTerms[0] === 'kind:') {
|
|
67
67
|
elements = model.elements()
|
|
68
68
|
} else {
|
|
69
69
|
elements = ifilter(model.elements(), element => {
|
|
@@ -120,7 +120,7 @@ export function ElementsColumn() {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
return <ElementsTree data={data} handleClick={handleClick} />
|
|
123
|
-
}
|
|
123
|
+
})
|
|
124
124
|
|
|
125
125
|
const setHoveredNode = () => {}
|
|
126
126
|
|
|
@@ -254,6 +254,7 @@ function ElementTreeNode(
|
|
|
254
254
|
component={m.button}
|
|
255
255
|
layout
|
|
256
256
|
tabIndex={-1}
|
|
257
|
+
data-value={element.id}
|
|
257
258
|
className={clsx(btn.root, 'group', 'likec4-element-button')}
|
|
258
259
|
{...views.length > 0 && {
|
|
259
260
|
onClick: (e) => {
|
|
@@ -297,7 +298,9 @@ function ElementTreeNode(
|
|
|
297
298
|
}
|
|
298
299
|
|
|
299
300
|
function useHandleElementSelection() {
|
|
300
|
-
const
|
|
301
|
+
const diagram = useDiagram()
|
|
302
|
+
const { searchActorRef } = useSearchActor()
|
|
303
|
+
// const naviconst { searchActorRef } = useSearchActor(gateTo = useCloseSearchAndNavigateTo()
|
|
301
304
|
|
|
302
305
|
return useCallback((element: LikeC4Model.Element) => {
|
|
303
306
|
const views = [...element.views()]
|
|
@@ -306,14 +309,13 @@ function useHandleElementSelection() {
|
|
|
306
309
|
}
|
|
307
310
|
const singleView = only(views)
|
|
308
311
|
if (singleView) {
|
|
309
|
-
|
|
312
|
+
if (singleView.id === diagram.currentView.id) {
|
|
313
|
+
searchActorRef.send({ type: 'close' })
|
|
314
|
+
} else {
|
|
315
|
+
diagram.navigateTo(singleView.id)
|
|
316
|
+
}
|
|
310
317
|
return
|
|
311
318
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
elementFqn: element.id,
|
|
315
|
-
scoped,
|
|
316
|
-
others,
|
|
317
|
-
})
|
|
318
|
-
}, [setPickView, navigateTo])
|
|
319
|
+
searchActorRef.send({ type: 'pickview.open', elementFqn: element.id })
|
|
320
|
+
}, [])
|
|
319
321
|
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { LikeC4ViewModel } from '@likec4/core/model'
|
|
2
|
+
import type { Fqn } from '@likec4/core/types'
|
|
3
|
+
import { ActionIcon, FocusTrap, Group, ScrollAreaAutosize, Stack, Title } from '@mantine/core'
|
|
4
|
+
import { useWindowEvent } from '@mantine/hooks'
|
|
5
|
+
import { IconX } from '@tabler/icons-react'
|
|
6
|
+
import * as m from 'motion/react-m'
|
|
7
|
+
import { useLikeC4Model } from '../../likec4model'
|
|
8
|
+
import { useSearchActor } from '../hooks'
|
|
9
|
+
import * as styles from './styles.css'
|
|
10
|
+
import { ViewButton } from './ViewsColum'
|
|
11
|
+
|
|
12
|
+
export function PickView({ elementFqn }: { elementFqn: Fqn }) {
|
|
13
|
+
const { searchActorRef } = useSearchActor()
|
|
14
|
+
const element = useLikeC4Model().element(elementFqn)
|
|
15
|
+
// const pickview = usePickView()
|
|
16
|
+
// const navigateTo = useCloseSearchAndNavigateTo()
|
|
17
|
+
// const focusTrapRef = useFocusTrap(!!pickview)
|
|
18
|
+
// useFocusReturn({
|
|
19
|
+
// opened: !!pickview,
|
|
20
|
+
// })
|
|
21
|
+
const scoped = [] as LikeC4ViewModel[]
|
|
22
|
+
const others = [] as LikeC4ViewModel[]
|
|
23
|
+
|
|
24
|
+
for (const view of element.views()) {
|
|
25
|
+
if (view.viewOf === element) {
|
|
26
|
+
scoped.push(view)
|
|
27
|
+
} else {
|
|
28
|
+
others.push(view)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const closePickView = () => {
|
|
33
|
+
searchActorRef.send({ type: 'pickview.close' })
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
useWindowEvent(
|
|
37
|
+
'keydown',
|
|
38
|
+
(event) => {
|
|
39
|
+
try {
|
|
40
|
+
if (event.key === 'Escape') {
|
|
41
|
+
event.stopPropagation()
|
|
42
|
+
event.preventDefault()
|
|
43
|
+
closePickView()
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.warn(e)
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
capture: true,
|
|
51
|
+
},
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<m.div
|
|
57
|
+
key="pickview-backdrop"
|
|
58
|
+
className={styles.pickviewBackdrop}
|
|
59
|
+
onClick={e => {
|
|
60
|
+
e.stopPropagation()
|
|
61
|
+
closePickView()
|
|
62
|
+
}}>
|
|
63
|
+
</m.div>
|
|
64
|
+
<m.div
|
|
65
|
+
key="pickview"
|
|
66
|
+
initial={{
|
|
67
|
+
opacity: 0,
|
|
68
|
+
scale: 0.95,
|
|
69
|
+
originY: 0,
|
|
70
|
+
translateX: '-50%',
|
|
71
|
+
translateY: -20,
|
|
72
|
+
}}
|
|
73
|
+
animate={{
|
|
74
|
+
opacity: 1,
|
|
75
|
+
scale: 1,
|
|
76
|
+
translateY: 0,
|
|
77
|
+
}}
|
|
78
|
+
exit={{
|
|
79
|
+
opacity: 0,
|
|
80
|
+
scale: 0.98,
|
|
81
|
+
translateY: -20,
|
|
82
|
+
transition: {
|
|
83
|
+
duration: 0.1,
|
|
84
|
+
},
|
|
85
|
+
}}
|
|
86
|
+
className={styles.pickview}
|
|
87
|
+
data-likec4-search-views>
|
|
88
|
+
<Group px="sm" py="md" justify="space-between">
|
|
89
|
+
<Title order={2} lh={1}>Select view</Title>
|
|
90
|
+
<ActionIcon
|
|
91
|
+
size={'md'}
|
|
92
|
+
variant="default"
|
|
93
|
+
onClick={(e) => {
|
|
94
|
+
e.stopPropagation()
|
|
95
|
+
closePickView()
|
|
96
|
+
}}>
|
|
97
|
+
<IconX />
|
|
98
|
+
</ActionIcon>
|
|
99
|
+
</Group>
|
|
100
|
+
<FocusTrap>
|
|
101
|
+
<ScrollAreaAutosize mah={'calc(100vh - 8rem - 50px)'} type="never">
|
|
102
|
+
{scoped.length > 0 && (
|
|
103
|
+
<Stack gap={'sm'} px={'sm'} className={styles.pickviewGroup}>
|
|
104
|
+
<Title order={6} c={'dimmed'}>scoped views of the element</Title>
|
|
105
|
+
{scoped.map((view, i) => (
|
|
106
|
+
<ViewButton
|
|
107
|
+
key={view.id}
|
|
108
|
+
view={view}
|
|
109
|
+
search={''}
|
|
110
|
+
loop
|
|
111
|
+
mod={{
|
|
112
|
+
autofocus: i === 0,
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
))}
|
|
116
|
+
</Stack>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{others.length > 0 && (
|
|
120
|
+
<Stack gap={'sm'} px={'sm'} className={styles.pickviewGroup}>
|
|
121
|
+
<Title order={6} c={'dimmed'}>views including this element</Title>
|
|
122
|
+
{others.map((view, i) => (
|
|
123
|
+
<ViewButton
|
|
124
|
+
key={view.id}
|
|
125
|
+
view={view}
|
|
126
|
+
search={''}
|
|
127
|
+
loop
|
|
128
|
+
mod={{
|
|
129
|
+
autofocus: i === 0 && scoped.length === 0,
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
))}
|
|
133
|
+
</Stack>
|
|
134
|
+
)}
|
|
135
|
+
</ScrollAreaAutosize>
|
|
136
|
+
</FocusTrap>
|
|
137
|
+
</m.div>
|
|
138
|
+
</>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { css } from '@likec4/styles/css'
|
|
2
|
+
import { HStack } from '@likec4/styles/jsx'
|
|
3
|
+
import { Button } from '@mantine/core'
|
|
4
|
+
import { IconX } from '@tabler/icons-react'
|
|
5
|
+
import { ElementTag } from '../../base/primitives'
|
|
6
|
+
import { useLikeC4Model } from '../../likec4model/useLikeC4Model'
|
|
7
|
+
import { useNormalizedSearch, useUpdateSearch } from '../hooks'
|
|
8
|
+
import { focusToFirstFoundElement, moveFocusToSearchInput } from './utils'
|
|
9
|
+
|
|
10
|
+
export function SearchByTags() {
|
|
11
|
+
let tags = useLikeC4Model().tagsSortedByUsage
|
|
12
|
+
let setSearch = useUpdateSearch()
|
|
13
|
+
let search = useNormalizedSearch()
|
|
14
|
+
let countBefore = tags.length
|
|
15
|
+
if (search.startsWith('#')) {
|
|
16
|
+
const searchTag = search.slice(1)
|
|
17
|
+
tags = tags.filter(({ tag }) => tag.toLocaleLowerCase().includes(searchTag))
|
|
18
|
+
}
|
|
19
|
+
if (tags.length === 0) {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const isFiltered = tags.length !== countBefore
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<HStack
|
|
27
|
+
css={{
|
|
28
|
+
gap: 'md',
|
|
29
|
+
paddingLeft: 48,
|
|
30
|
+
flexWrap: 'nowrap',
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<HStack
|
|
34
|
+
css={{
|
|
35
|
+
gap: 6,
|
|
36
|
+
flexWrap: 'wrap',
|
|
37
|
+
opacity: isFiltered ? 1 : .3,
|
|
38
|
+
grayscale: isFiltered ? 0 : .9,
|
|
39
|
+
filter: 'auto',
|
|
40
|
+
transition: 'fast',
|
|
41
|
+
_groupHover: {
|
|
42
|
+
opacity: 1,
|
|
43
|
+
grayscale: 0,
|
|
44
|
+
},
|
|
45
|
+
_groupFocusWithin: {
|
|
46
|
+
opacity: 1,
|
|
47
|
+
grayscale: 0,
|
|
48
|
+
},
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{tags.map(({ tag }) => (
|
|
52
|
+
// <Pill
|
|
53
|
+
// key={tag}
|
|
54
|
+
// data-likec4-tag={tag}
|
|
55
|
+
// className={cx(
|
|
56
|
+
// likec4tag(),
|
|
57
|
+
// css({
|
|
58
|
+
// minWidth: 'unset',
|
|
59
|
+
// cursor: 'pointer',
|
|
60
|
+
// }),
|
|
61
|
+
// )}
|
|
62
|
+
// onClick={(e) => {
|
|
63
|
+
// e.stopPropagation()
|
|
64
|
+
// setSearch(`#${tag}`)
|
|
65
|
+
// }}
|
|
66
|
+
// onRemove={() => {
|
|
67
|
+
// setSearch('#')
|
|
68
|
+
// moveFocusToSearchInput()
|
|
69
|
+
// }}
|
|
70
|
+
// withRemoveButton={tag === `${search.slice(1)}`}
|
|
71
|
+
// >
|
|
72
|
+
// <span style={{ opacity: 0.7, fontSize: '1.05em' }}>#</span>
|
|
73
|
+
// {tag}
|
|
74
|
+
// </Pill>
|
|
75
|
+
<ElementTag
|
|
76
|
+
key={tag}
|
|
77
|
+
tag={tag}
|
|
78
|
+
className={css({
|
|
79
|
+
userSelect: 'none',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
})}
|
|
82
|
+
onClick={(e) => {
|
|
83
|
+
e.stopPropagation()
|
|
84
|
+
setSearch(`#${tag}`)
|
|
85
|
+
// Let react to display filtered elements
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
focusToFirstFoundElement()
|
|
88
|
+
}, 350)
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
))}
|
|
92
|
+
</HStack>
|
|
93
|
+
{isFiltered && (
|
|
94
|
+
<Button
|
|
95
|
+
size="compact-xs"
|
|
96
|
+
variant="light"
|
|
97
|
+
onClick={(e) => {
|
|
98
|
+
e.stopPropagation()
|
|
99
|
+
setSearch('')
|
|
100
|
+
moveFocusToSearchInput()
|
|
101
|
+
}}
|
|
102
|
+
rightSection={<IconX size={14} />}
|
|
103
|
+
>
|
|
104
|
+
Clear
|
|
105
|
+
</Button>
|
|
106
|
+
)}
|
|
107
|
+
</HStack>
|
|
108
|
+
)
|
|
109
|
+
}
|