@likec4/diagram 1.35.0 → 1.36.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.
Files changed (214) hide show
  1. package/bundle/{chunk-C0Eg81Gj.js → chunk-7MPUJFHj.js} +315 -311
  2. package/bundle/custom.js +52 -52
  3. package/bundle/index.js +1583 -739
  4. package/dist/LikeC4Diagram.js +6 -6
  5. package/dist/LikeC4Diagram.props.d.ts +2 -3
  6. package/dist/LikeC4ModelProvider.d.ts +3 -3
  7. package/dist/LikeC4ProjectsProvider.d.ts +17 -0
  8. package/dist/LikeC4ProjectsProvider.js +22 -0
  9. package/dist/LikeC4Styles.d.ts +1 -0
  10. package/dist/LikeC4Styles.js +94 -0
  11. package/dist/StaticLikeC4Diagram.d.ts +3 -3
  12. package/dist/base/BaseXYFlow.js +23 -26
  13. package/dist/base/primitives/MarkdownBlock.d.ts +7 -1
  14. package/dist/base/primitives/MarkdownBlock.js +1 -1
  15. package/dist/base/primitives/compound/CompoundActionButton.js +2 -2
  16. package/dist/base/primitives/compound/CompoundDetailsButton.js +2 -2
  17. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +4 -4
  18. package/dist/base/primitives/compound/CompoundNodeContainer.js +1 -4
  19. package/dist/base/primitives/compound/CompoundTitle.js +9 -8
  20. package/dist/base/primitives/compound/actionbtns.css.js +6 -6
  21. package/dist/base/primitives/edge/EdgeActionButton.js +2 -2
  22. package/dist/base/primitives/edge/EdgeContainer.js +4 -7
  23. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -22
  24. package/dist/base/primitives/edge/EdgeLabel.css.js +6 -84
  25. package/dist/base/primitives/edge/EdgeLabel.js +16 -6
  26. package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -6
  27. package/dist/base/primitives/edge/EdgeMarkers.js +3 -3
  28. package/dist/base/primitives/edge/edge.css.d.ts +0 -2
  29. package/dist/base/primitives/edge/edge.css.js +1 -55
  30. package/dist/base/primitives/element/ElementActionButtons.js +2 -2
  31. package/dist/base/primitives/element/ElementDetailsButton.js +8 -7
  32. package/dist/base/primitives/element/ElementNodeContainer.css.js +4 -4
  33. package/dist/base/primitives/element/ElementNodeContainer.js +1 -4
  34. package/dist/base/primitives/element/ElementShape.css.js +11 -11
  35. package/dist/base/primitives/element/ElementTags.d.ts +1 -0
  36. package/dist/base/primitives/element/ElementTags.js +17 -14
  37. package/dist/bundle/LikeC4View.d.ts +1 -1
  38. package/dist/bundle/LikeC4View.js +7 -1
  39. package/dist/bundle/LikeC4View.props.d.ts +1 -2
  40. package/dist/bundle/ReactLikeC4.d.ts +1 -1
  41. package/dist/bundle/ViewNotFound.js +1 -1
  42. package/dist/bundle/index.d.ts +2 -1
  43. package/dist/bundle/index.js +1 -0
  44. package/dist/bundle/styles.css.js +1 -1
  45. package/dist/components/ErrorFallback.js +1 -1
  46. package/dist/components/GithubIcon.d.ts +2 -0
  47. package/dist/components/GithubIcon.js +17 -0
  48. package/dist/components/Link.d.ts +4 -3
  49. package/dist/components/Link.js +84 -87
  50. package/dist/components/NavigationLink.d.ts +2 -2
  51. package/dist/components/SearchControl.css.js +6 -5
  52. package/dist/context/DiagramEventHandlers.d.ts +6 -6
  53. package/dist/context/DiagramEventHandlers.js +4 -7
  54. package/dist/globals.css.js +3 -0
  55. package/dist/hooks/useXYFlow.d.ts +10 -10
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/likec4diagram/custom/edges/NotePopover.css.js +2 -2
  59. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
  60. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
  61. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.js +7 -7
  62. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +3 -3
  63. package/dist/likec4diagram/custom/edges/edges.css.js +4 -4
  64. package/dist/likec4diagram/custom/index.d.ts +2 -2
  65. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -2
  66. package/dist/likec4diagram/ui/controls/styles.css.js +5 -5
  67. package/dist/likec4diagram/ui/notation/NotationPanel.css.js +11 -11
  68. package/dist/likec4diagram/ui/notation/NotationPanel.js +2 -5
  69. package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.js +10 -10
  70. package/dist/likec4model/LikeC4ProjectsContext.d.ts +7 -0
  71. package/dist/likec4model/LikeC4ProjectsContext.js +5 -0
  72. package/dist/likec4model/index.d.ts +1 -0
  73. package/dist/likec4model/useLikeC4Project.d.ts +22 -0
  74. package/dist/likec4model/useLikeC4Project.js +23 -0
  75. package/dist/navigationpanel/NavigationPanel.js +15 -17
  76. package/dist/navigationpanel/NavigationPanelControls.js +34 -21
  77. package/dist/navigationpanel/NavigationPanelDropdown.js +33 -17
  78. package/dist/navigationpanel/_common.js +4 -1
  79. package/dist/navigationpanel/actor.d.ts +11 -15
  80. package/dist/navigationpanel/actor.js +14 -15
  81. package/dist/navigationpanel/controls/BurgerButton.js +5 -7
  82. package/dist/navigationpanel/controls/NavigationButtons.js +37 -24
  83. package/dist/navigationpanel/controls/OpenSource.js +1 -1
  84. package/dist/navigationpanel/controls/SearchControl.js +6 -4
  85. package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
  86. package/dist/navigationpanel/controls/ViewDetailsCard.d.ts +2 -0
  87. package/dist/navigationpanel/controls/ViewDetailsCard.js +232 -0
  88. package/dist/navigationpanel/controls/index.d.ts +1 -0
  89. package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -0
  90. package/dist/navigationpanel/dropdown/ProjectsMenu.js +75 -0
  91. package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
  92. package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +19 -20
  93. package/dist/navigationpanel/editorpanel/styles.js +5 -5
  94. package/dist/navigationpanel/hooks.d.ts +2 -2
  95. package/dist/navigationpanel/styles.css.js +0 -2
  96. package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +12 -7
  97. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +14 -0
  98. package/dist/node_modules/.pnpm/@tabler_icons-react@3.34.1_react@19.1.1/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +14 -0
  99. package/dist/overlays/element-details/ElementDetailsCard.css.js +18 -17
  100. package/dist/overlays/element-details/ElementDetailsCard.js +8 -13
  101. package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -4
  102. package/dist/overlays/element-details/TabPanelRelationships.css.js +7 -7
  103. package/dist/overlays/overlay/Overlay.css.d.ts +3 -3
  104. package/dist/overlays/overlay/Overlay.css.js +8 -7
  105. package/dist/overlays/relationship-details/SelectEdge.css.js +8 -8
  106. package/dist/overlays/relationships-browser/SelectElement.css.js +1 -1
  107. package/dist/search/Search.js +6 -6
  108. package/dist/search/components/ElementsColumn.css.js +5 -5
  109. package/dist/search/components/SearchByTags.js +3 -2
  110. package/dist/search/components/ViewsColum.js +1 -1
  111. package/dist/search/components/ViewsColumn.css.js +1 -1
  112. package/dist/search/components/_shared.css.js +3 -3
  113. package/dist/search/components/styles.css.js +5 -5
  114. package/dist/state/DiagramActorProvider.js +34 -15
  115. package/dist/state/diagram-machine.d.ts +29 -247
  116. package/dist/state/diagram-machine.js +16 -16
  117. package/dist/styles-min.css +1 -1
  118. package/dist/styles.css +1 -1
  119. package/dist/styles.css2.js +1 -1
  120. package/package.json +10 -8
  121. package/panda.buildinfo.json +254 -326
  122. package/src/LikeC4Diagram.props.ts +2 -2
  123. package/src/LikeC4Diagram.tsx +2 -2
  124. package/src/LikeC4ModelProvider.tsx +4 -4
  125. package/src/LikeC4ProjectsProvider.tsx +41 -0
  126. package/src/LikeC4Styles.tsx +107 -0
  127. package/src/StaticLikeC4Diagram.tsx +3 -3
  128. package/src/base/BaseXYFlow.tsx +24 -29
  129. package/src/base/primitives/MarkdownBlock.tsx +11 -3
  130. package/src/base/primitives/compound/CompoundActionButton.tsx +2 -2
  131. package/src/base/primitives/compound/CompoundDetailsButton.tsx +2 -2
  132. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +4 -13
  133. package/src/base/primitives/compound/CompoundNodeContainer.tsx +0 -3
  134. package/src/base/primitives/compound/CompoundTitle.tsx +8 -8
  135. package/src/base/primitives/compound/actionbtns.css.ts +6 -6
  136. package/src/base/primitives/edge/EdgeActionButton.tsx +2 -2
  137. package/src/base/primitives/edge/EdgeContainer.tsx +3 -6
  138. package/src/base/primitives/edge/EdgeLabel.css.ts +4 -83
  139. package/src/base/primitives/edge/EdgeLabel.tsx +16 -10
  140. package/src/base/primitives/edge/EdgeLabelContainer.tsx +1 -6
  141. package/src/base/primitives/edge/EdgeMarkers.tsx +3 -3
  142. package/src/base/primitives/edge/edge.css.ts +0 -60
  143. package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
  144. package/src/base/primitives/element/ElementDetailsButton.tsx +7 -7
  145. package/src/base/primitives/element/ElementNodeContainer.css.ts +4 -4
  146. package/src/base/primitives/element/ElementNodeContainer.tsx +0 -3
  147. package/src/base/primitives/element/ElementShape.css.ts +11 -11
  148. package/src/base/primitives/element/ElementTags.tsx +17 -14
  149. package/src/bundle/LikeC4View.props.ts +1 -2
  150. package/src/bundle/LikeC4View.tsx +10 -3
  151. package/src/bundle/ReactLikeC4.tsx +1 -2
  152. package/src/bundle/ViewNotFound.tsx +1 -1
  153. package/src/bundle/index.ts +2 -1
  154. package/src/bundle/styles.css.ts +1 -1
  155. package/src/components/ErrorFallback.tsx +1 -1
  156. package/src/components/GithubIcon.tsx +16 -0
  157. package/src/components/Link.tsx +102 -113
  158. package/src/components/NavigationLink.tsx +2 -1
  159. package/src/components/SearchControl.css.ts +5 -5
  160. package/src/context/DiagramEventHandlers.tsx +12 -12
  161. package/src/globals.css +71 -0
  162. package/src/index.ts +5 -0
  163. package/src/likec4diagram/custom/edges/NotePopover.css.ts +2 -2
  164. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
  165. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.ts +7 -7
  166. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +3 -3
  167. package/src/likec4diagram/custom/edges/edges.css.ts +4 -4
  168. package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +2 -2
  169. package/src/likec4diagram/ui/controls/styles.css.ts +5 -5
  170. package/src/likec4diagram/ui/notation/NotationPanel.css.ts +11 -11
  171. package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -4
  172. package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.css.ts +10 -10
  173. package/src/likec4model/LikeC4ProjectsContext.ts +9 -0
  174. package/src/likec4model/index.ts +8 -0
  175. package/src/likec4model/useLikeC4Project.ts +61 -0
  176. package/src/navigationpanel/NavigationPanel.tsx +16 -17
  177. package/src/navigationpanel/NavigationPanelControls.tsx +24 -46
  178. package/src/navigationpanel/NavigationPanelDropdown.tsx +32 -16
  179. package/src/navigationpanel/_common.tsx +4 -1
  180. package/src/navigationpanel/actor.ts +14 -15
  181. package/src/navigationpanel/controls/BurgerButton.tsx +5 -7
  182. package/src/navigationpanel/controls/NavigationButtons.tsx +9 -1
  183. package/src/navigationpanel/controls/OpenSource.tsx +1 -1
  184. package/src/navigationpanel/controls/SearchControl.tsx +6 -4
  185. package/src/navigationpanel/controls/ToggleReadonly.tsx +3 -3
  186. package/src/navigationpanel/controls/ViewDetailsCard.tsx +244 -0
  187. package/src/navigationpanel/controls/index.ts +1 -0
  188. package/src/navigationpanel/dropdown/ProjectsMenu.tsx +74 -0
  189. package/src/navigationpanel/editorpanel/EditorPanel.tsx +3 -3
  190. package/src/navigationpanel/editorpanel/ManualLayoutToolsButton.tsx +19 -22
  191. package/src/navigationpanel/editorpanel/styles.ts +5 -5
  192. package/src/navigationpanel/hooks.tsx +2 -2
  193. package/src/navigationpanel/styles.css.ts +0 -2
  194. package/src/navigationpanel/walkthrough/ActiveWalkthroughControls.tsx +9 -4
  195. package/src/overlays/element-details/ElementDetailsCard.css.ts +17 -17
  196. package/src/overlays/element-details/ElementDetailsCard.tsx +8 -13
  197. package/src/overlays/element-details/TabPanelDeployments.css.ts +4 -4
  198. package/src/overlays/element-details/TabPanelRelationships.css.ts +7 -7
  199. package/src/overlays/overlay/Overlay.css.ts +7 -7
  200. package/src/overlays/relationship-details/SelectEdge.css.ts +8 -8
  201. package/src/overlays/relationships-browser/SelectElement.css.ts +1 -1
  202. package/src/search/Search.tsx +6 -6
  203. package/src/search/components/ElementsColumn.css.ts +5 -5
  204. package/src/search/components/SearchByTags.tsx +2 -2
  205. package/src/search/components/ViewsColum.tsx +1 -1
  206. package/src/search/components/ViewsColumn.css.ts +1 -1
  207. package/src/search/components/_shared.css.ts +3 -3
  208. package/src/search/components/styles.css.ts +5 -5
  209. package/src/state/DiagramActorProvider.tsx +45 -20
  210. package/src/state/diagram-machine.ts +22 -16
  211. package/dist/LikeC4CustomColors.d.ts +0 -2
  212. package/dist/LikeC4CustomColors.js +0 -45
  213. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +0 -45
  214. package/src/LikeC4CustomColors.tsx +0 -85
@@ -1,13 +1,13 @@
1
1
  import { extractStep, isStepEdgeId } from '@likec4/core'
2
2
  import type { DiagramEdge } from '@likec4/core/types'
3
- import { cx } from '@likec4/styles/css'
3
+ import { css, cx } from '@likec4/styles/css'
4
4
  import { type BoxProps, Box } from '@likec4/styles/jsx'
5
+ import { edgeLabel } from '@likec4/styles/recipes'
5
6
  import { Text } from '@mantine/core'
6
7
  import { type PropsWithChildren, forwardRef } from 'react'
7
8
  import { isTruthy } from 'remeda'
8
9
  import type { UndefinedOnPartialDeep } from 'type-fest'
9
10
  import type { EdgeProps } from '../../types'
10
- import { labelsva } from './EdgeLabel.css'
11
11
 
12
12
  type Data = UndefinedOnPartialDeep<
13
13
  Pick<
@@ -40,27 +40,33 @@ export const EdgeLabel = forwardRef<HTMLDivElement, EdgeLabelProps>((
40
40
  ref,
41
41
  ) => {
42
42
  const stepNum = isStepEdgeId(id) ? extractStep(id) : null
43
- const classes = labelsva({
43
+ const classes = edgeLabel({
44
44
  isStepEdge: stepNum !== null,
45
45
  })
46
46
 
47
47
  return (
48
- <Box ref={ref} className={cx(classes.root!, className)} {...rest}>
48
+ <Box ref={ref} className={cx(classes.root, className)} {...rest}>
49
49
  {stepNum !== null && (
50
- <Box className={classes.stepNumber!}>
50
+ <Box className={classes.stepNumber}>
51
51
  {stepNum}
52
52
  </Box>
53
53
  )}
54
- <Box className={classes.labelContents!}>
54
+ <Box className={classes.labelContents}>
55
55
  {isTruthy(label) && (
56
- <Text component="div" className={classes.labelText!} lineClamp={5}>
56
+ <Box
57
+ className={cx(
58
+ classes.labelText,
59
+ css({
60
+ lineClamp: 5,
61
+ }),
62
+ )}>
57
63
  {label}
58
- </Text>
64
+ </Box>
59
65
  )}
60
66
  {isTruthy(technology) && (
61
- <Text component="div" className={classes.labelTechnology!}>
67
+ <Box className={classes.labelTechnology}>
62
68
  {'[ ' + technology + ' ]'}
63
- </Text>
69
+ </Box>
64
70
  )}
65
71
  {children}
66
72
  </Box>
@@ -1,12 +1,11 @@
1
1
  import type { DiagramEdge } from '@likec4/core/types'
2
- import { css, cx } from '@likec4/styles/css'
2
+ import { cx } from '@likec4/styles/css'
3
3
  import { EdgeLabelRenderer } from '@xyflow/react'
4
4
  import { type HTMLAttributes } from 'react'
5
5
  import { isNumber } from 'remeda'
6
6
  import type { UndefinedOnPartialDeep } from 'type-fest'
7
7
  import { ZIndexes } from '../../const'
8
8
  import type { EdgeProps } from '../../types'
9
- import { edgeVars } from './edge.css'
10
9
  import { edgeLabelContainer, translate as _translate } from './EdgeLabel.css'
11
10
 
12
11
  type Data = UndefinedOnPartialDeep<
@@ -71,10 +70,6 @@ export function EdgeLabelContainer({
71
70
  <div
72
71
  key={id}
73
72
  className={cx(
74
- css({
75
- likec4RelationPalette: color,
76
- }),
77
- edgeVars,
78
73
  edgeLabelContainer,
79
74
  'nodrag nopan',
80
75
  'likec4-edge-label-container',
@@ -72,7 +72,7 @@ const OArrow = (props: SVGProps<SVGMarkerElement>) => (
72
72
  <path
73
73
  d="M 0 0 L 8 3 L 0 6 L 1 3 z"
74
74
  stroke="context-stroke"
75
- fill="var(--likec4-background-color)"
75
+ fill="context-stroke"
76
76
  strokeWidth={1.25}
77
77
  strokeLinejoin="miter"
78
78
  strokeLinecap={'square'}
@@ -113,7 +113,7 @@ const ODiamond = (props: SVGProps<SVGMarkerElement>) => (
113
113
  <path
114
114
  d="M5,0 L10,4 L5,8 L0,4 Z"
115
115
  stroke="context-stroke"
116
- fill="var(--likec4-background-color)"
116
+ fill="context-stroke"
117
117
  strokeWidth={1.25}
118
118
  strokeLinecap={'round'}
119
119
  />
@@ -149,7 +149,7 @@ const ODot = (props: SVGProps<SVGMarkerElement>) => (
149
149
  <circle
150
150
  strokeWidth={1.25}
151
151
  stroke="context-stroke"
152
- fill="var(--likec4-background-color)"
152
+ fill="context-stroke"
153
153
  cx={4}
154
154
  cy={4}
155
155
  r={3}
@@ -2,31 +2,6 @@ import { css } from '@likec4/styles/css'
2
2
 
3
3
  const isSelected = '.react-flow__edge.selected'
4
4
 
5
- const edgeStroke = '--xy-edge-stroke'
6
- const edgeStrokeSelected = '--xy-edge-stroke-selected'
7
- const labelColor = '--xy-edge-label-color'
8
- const labelBg = '--xy-edge-label-background-color'
9
-
10
- export const edgeVars = css({
11
- [edgeStroke]: '{colors.likec4.relation.stroke}',
12
- [edgeStrokeSelected]: '{colors.likec4.relation.stroke.selected}',
13
- [labelColor]: {
14
- base: '{colors.likec4.relation.label}',
15
- _light: `color-mix(in srgb, {colors.likec4.relation.label}, rgba(255 255 255 / 0.85) 40%)`,
16
- },
17
- [labelBg]: {
18
- _light: `{colors.likec4.relation.label.bg/60}`,
19
- _dark: `{colors.likec4.relation.label.bg/50}`,
20
- },
21
- ['--xy-edge-stroke-width']: '3',
22
- '&:is([data-likec4-hovered=\'true\'],[data-edge-active=\'true\'])': {
23
- [edgeStroke]: '{colors.likec4.relation.stroke.selected}',
24
- _whenSelected: {
25
- ['--xy-edge-stroke-width']: '4',
26
- },
27
- },
28
- })
29
-
30
5
  export const edgeContainer = css({
31
6
  _reduceGraphics: {
32
7
  transition: 'none',
@@ -98,38 +73,3 @@ export const cssEdgePath = css({
98
73
  animationName: 'none',
99
74
  },
100
75
  })
101
-
102
- const aiBg = {
103
- var: '--ai-bg',
104
- ref: 'var(--ai-bg)',
105
- } as const
106
-
107
- export const actionBtn = css({
108
- // zIndex: 'calc(var(--layer-overlays, 1) + 1)',
109
- pointerEvents: 'all',
110
- // color: `xyedge.label`,
111
- cursor: 'pointer',
112
- opacity: 0.75,
113
- transition: 'fast',
114
- // backgroundColor: aiBg.ref,
115
- [aiBg.var]: 'var(--xy-edge-label-background-color)',
116
- '--ai-hover': `color-mix(in srgb , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
117
- '--ai-size': `var(--ai-size-sm)`,
118
- '--ai-radius': `var(--mantine-radius-sm)`,
119
- _hover: {
120
- translateY: '1px',
121
- scale: 1.15,
122
- },
123
- _active: {
124
- translateY: '-1px',
125
- scale: '0.9',
126
- },
127
- _whenHovered: {
128
- opacity: 1,
129
- },
130
- '& .tabler-icon': {
131
- width: '80%',
132
- height: '80%',
133
- strokeWidth: '2',
134
- },
135
- })
@@ -15,9 +15,9 @@ type ElementActionButtonsProps = NodeProps & {
15
15
  const container = css({
16
16
  position: 'absolute',
17
17
  zIndex: 1,
18
- top: `calc(100% - 30px)`,
18
+ top: `[calc(100% - 30px)]`,
19
19
  transform: 'translateX(-50%)',
20
- left: `50%`,
20
+ left: `[50%]`,
21
21
  width: 'auto',
22
22
  minHeight: '30px',
23
23
  display: 'flex',
@@ -15,20 +15,20 @@ type ElementDetailsButtonProps = NodeProps & {
15
15
 
16
16
  const container = css({
17
17
  position: 'absolute',
18
- top: 2,
19
- right: 2,
18
+ top: '0.5',
19
+ right: '0.5',
20
20
  _shapeBrowser: {
21
- right: '5px',
21
+ right: '[5px]',
22
22
  },
23
23
  _shapeCylinder: {
24
- top: '14px',
24
+ top: '[14px]',
25
25
  },
26
26
  _shapeStorage: {
27
- top: '14px',
27
+ top: '[14px]',
28
28
  },
29
29
  _shapeQueue: {
30
- top: '1px',
31
- right: '12px',
30
+ top: '[1px]',
31
+ right: '3', // 12px
32
32
  },
33
33
  _smallZoom: {
34
34
  display: 'none',
@@ -4,8 +4,8 @@ export const container = style({
4
4
  position: 'relative',
5
5
  width: '100%',
6
6
  height: '100%',
7
- padding: 0,
8
- margin: 0,
7
+ padding: '0',
8
+ margin: '0',
9
9
  display: 'flex',
10
10
  alignItems: 'center',
11
11
  justifyContent: 'center',
@@ -13,8 +13,8 @@ export const container = style({
13
13
  _before: {
14
14
  content: '" "',
15
15
  position: 'absolute',
16
- top: 'calc(100% - 4px)',
17
- left: 0,
16
+ top: '[calc(100% - 4px)]',
17
+ left: '0',
18
18
  width: '100%',
19
19
  height: '24px',
20
20
  background: '[transparent]',
@@ -92,9 +92,6 @@ export const ElementNodeContainer = forwardRef<HTMLDivElement, ElementNodeContai
92
92
  <m.div
93
93
  ref={ref}
94
94
  className={cx(
95
- css({
96
- likec4Palette: data.color,
97
- }),
98
95
  styles.container,
99
96
  'group',
100
97
  'likec4-element-node',
@@ -4,7 +4,7 @@ export const indicator = css({
4
4
  _smallZoom: {
5
5
  visibility: 'hidden',
6
6
  },
7
- stroke: 'likec4.palette.loContrast',
7
+ stroke: 'var(--likec4-palette-loContrast)',
8
8
  fill: '[none]',
9
9
 
10
10
  strokeWidth: 8,
@@ -12,7 +12,7 @@ export const indicator = css({
12
12
  visibility: 'hidden',
13
13
  pointerEvents: 'none',
14
14
  _light: {
15
- stroke: `[color-mix(in srgb, {colors.likec4.palette.fill} 50%,rgb(121, 121, 121))]`,
15
+ stroke: `[color-mix(in srgb, var(--likec4-palette-fill) 50%,rgb(121, 121, 121))]`,
16
16
  },
17
17
  _whenFocused: {
18
18
  visibility: 'visible',
@@ -27,29 +27,29 @@ export const indicator = css({
27
27
  })
28
28
 
29
29
  export const fillElementFill = css({
30
- fill: 'likec4.palette.fill',
30
+ fill: 'var(--likec4-palette-fill)',
31
31
  })
32
32
 
33
33
  export const fillElementStroke = css({
34
- fill: 'likec4.palette.stroke',
34
+ fill: 'var(--likec4-palette-stroke)',
35
35
  })
36
36
 
37
37
  export const fillMixStroke = css({
38
- fill: '[color-mix(in srgb, {colors.likec4.palette.stroke} 90%, {colors.likec4.palette.fill})]',
38
+ fill: '[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]',
39
39
  '.shape-svg-multiple &': {
40
- fill: 'likec4.palette.fill',
40
+ fill: 'var(--likec4-palette-fill)',
41
41
  },
42
42
  })
43
43
 
44
44
  const shapeBase = css.raw({
45
- top: 0,
46
- left: 0,
45
+ top: '0',
46
+ left: '0',
47
47
  position: 'absolute',
48
48
  width: '100%',
49
49
  height: '100%',
50
50
  pointerEvents: 'none',
51
- fill: 'likec4.palette.fill',
52
- stroke: 'likec4.palette.stroke',
51
+ fill: 'var(--likec4-palette-fill)',
52
+ stroke: 'var(--likec4-palette-stroke)',
53
53
  overflow: 'visible',
54
54
  // zIndex is removed to improve rendering performance
55
55
  // this forces to keep shape in the same layer as the node
@@ -82,7 +82,7 @@ export const shapeSvg = css(shapeBase, {
82
82
  transitionDelay: '0ms',
83
83
  filter: `
84
84
  drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))
85
- drop-shadow(0 1px 1px color-mix(in srgb, {colors.likec4.palette.stroke} 40%, transparent))
85
+ drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))
86
86
  drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))
87
87
  `,
88
88
  _whenHovered: {
@@ -15,10 +15,11 @@ import type { NodeProps } from '../../types'
15
15
 
16
16
  export type ElementTagProps = {
17
17
  tag: string
18
+ cursor?: 'pointer' | 'default'
18
19
  } & Omit<BoxProps, 'children'>
19
20
 
20
21
  export const ElementTag = forwardRef<HTMLDivElement, ElementTagProps>(
21
- ({ tag, className, ...props }, ref) => {
22
+ ({ tag, cursor = 'default', className, ...props }, ref) => {
22
23
  const spec = useTagSpecification(tag)
23
24
  return (
24
25
  <Box
@@ -31,8 +32,9 @@ export const ElementTag = forwardRef<HTMLDivElement, ElementTagProps>(
31
32
  className,
32
33
  )}
33
34
  {...props}
35
+ style={{ cursor }}
34
36
  >
35
- <span style={{ opacity: 0.7, fontSize: '1.05em' }}>#</span>
37
+ <span>#</span>
36
38
  <span>{tag}</span>
37
39
  </Box>
38
40
  )
@@ -99,23 +101,23 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
99
101
  'likec4-element-tags',
100
102
  hstack({
101
103
  pointerEvents: 'all',
102
- gap: 4,
104
+ gap: '1',
103
105
  alignItems: 'flex-end',
104
106
  justifyItems: 'stretch',
105
107
  position: 'absolute',
106
108
  width: '100%',
107
- bottom: 0,
108
- left: 0,
109
- padding: 4,
109
+ bottom: '0',
110
+ left: '0',
111
+ padding: '1',
110
112
  _shapeCylinder: {
111
- bottom: 5,
113
+ bottom: '[5px]',
112
114
  },
113
115
  _shapeStorage: {
114
- bottom: 5,
116
+ bottom: '[5px]',
115
117
  },
116
118
  _shapeQueue: {
117
- bottom: 0,
118
- paddingLeft: 14,
119
+ bottom: '0',
120
+ paddingLeft: '[14px]',
119
121
  },
120
122
  }),
121
123
  )}
@@ -147,11 +149,12 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
147
149
  <HStack
148
150
  ref={tagsToolbarRef}
149
151
  css={{
150
- gap: 4,
152
+ gap: '0.5',
153
+ alignItems: 'baseline',
151
154
  flexWrap: 'wrap',
152
155
  pb: 'sm',
153
156
  translate: 'auto',
154
- x: -8,
157
+ x: '[-8px]',
155
158
  maxWidth,
156
159
  }}
157
160
  >
@@ -164,8 +167,8 @@ export const ElementTags = memo(({ id, data: { tags, width, hovered = false } }:
164
167
  cursor: 'pointer',
165
168
  ...(zoomIsLargeEnough && {
166
169
  fontSize: 'lg',
167
- borderRadius: 4,
168
- px: 6,
170
+ borderRadius: '[4px]',
171
+ px: '1.5', // 6px
169
172
  }),
170
173
  })}
171
174
  onClick={e => {
@@ -1,5 +1,4 @@
1
- import type { WhereOperator } from '@likec4/core/types'
2
- import type * as aux from '@likec4/core/types/_aux'
1
+ import type { aux, WhereOperator } from '@likec4/core/types'
3
2
  import type { CSSProperties } from 'react'
4
3
  import type {
5
4
  CustomNodes,
@@ -1,5 +1,4 @@
1
- import type { Any, DiagramView } from '@likec4/core/types'
2
- import type * as aux from '@likec4/core/types/_aux'
1
+ import type { Any, aux, DiagramView } from '@likec4/core/types'
3
2
  import { cx } from '@likec4/styles/css'
4
3
  import { ActionIcon, Box } from '@mantine/core'
5
4
  import { shallowEqual } from '@mantine/hooks'
@@ -8,6 +7,7 @@ import { memo, useState } from 'react'
8
7
  import { isBoolean } from 'remeda'
9
8
  import { FramerMotionConfig } from '../context/FramerMotionConfig'
10
9
  import { LikeC4Diagram } from '../LikeC4Diagram'
10
+ import type { ViewPadding } from '../LikeC4Diagram.props'
11
11
  import { useLikeC4Model } from '../likec4model/useLikeC4Model'
12
12
  import { Overlay } from '../overlays/overlay/Overlay'
13
13
  import type { LikeC4ViewProps } from './LikeC4View.props'
@@ -37,6 +37,13 @@ export function LikeC4View<A extends aux.Any = aux.UnknownLayouted>({
37
37
  return <LikeC4ViewInner view={view.$view} {...props} />
38
38
  }
39
39
 
40
+ const DEFAULT_BROWSER_PADDING: ViewPadding = {
41
+ top: '50px',
42
+ bottom: '16px',
43
+ left: '16px',
44
+ right: '16px',
45
+ }
46
+
40
47
  type LikeC4ViewInnerProps<A extends aux.Any> = Omit<LikeC4ViewProps<A>, 'viewId'> & {
41
48
  view: DiagramView<A>
42
49
  }
@@ -162,7 +169,7 @@ const LikeC4ViewInner = memo<LikeC4ViewInnerProps<aux.Any>>(({
162
169
  controls="next"
163
170
  readonly
164
171
  fitView
165
- fitViewPadding={'32px'}
172
+ fitViewPadding={DEFAULT_BROWSER_PADDING}
166
173
  {...props}
167
174
  {...browserProps}
168
175
  showNotations={(browserProps.showNotations ?? true) &&
@@ -1,5 +1,4 @@
1
- import type { Any, DiagramView } from '@likec4/core/types'
2
- import type * as aux from '@likec4/core/types/_aux'
1
+ import type { Any, aux, DiagramView } from '@likec4/core/types'
3
2
  import { cx } from '@likec4/styles/css'
4
3
  import { type CSSProperties } from 'react'
5
4
  import { isFunction, isString } from 'remeda'
@@ -3,7 +3,7 @@ import type { PropsWithChildren } from 'react'
3
3
  export const ErrorMessage = ({ children }: PropsWithChildren) => (
4
4
  <div
5
5
  style={{
6
- margin: '1rem 0',
6
+ margin: '[1rem 0]',
7
7
  }}>
8
8
  <div
9
9
  style={{
@@ -19,7 +19,8 @@ export { LikeC4View } from './LikeC4View'
19
19
  export type { LikeC4BrowserProps, LikeC4ViewProps } from './LikeC4View.props'
20
20
  export { ReactLikeC4, type ReactLikeC4Props } from './ReactLikeC4'
21
21
 
22
- export { LikeC4ModelProvider } from './LikeC4ModelProvider'
22
+ export { LikeC4ProjectsProvider, type LikeC4ProjectsProviderProps } from '../LikeC4ProjectsProvider'
23
+ export { LikeC4ModelProvider, type LikeC4ModelProviderProps } from './LikeC4ModelProvider'
23
24
 
24
25
  export { ViewNotFound } from './ViewNotFound'
25
26
 
@@ -18,7 +18,7 @@ export const DefaultTheme = createTheme({
18
18
  primaryColor: 'indigo',
19
19
  cursorType: 'pointer',
20
20
  defaultRadius: 'sm',
21
- fontFamily: 'var(--fonts-likec4)',
21
+ fontFamily: 'var(--likec4-app-font, var(--likec4-app-font-default))',
22
22
  headings: {
23
23
  fontWeight: '500',
24
24
  sizes: {
@@ -10,7 +10,7 @@ import {
10
10
  export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
11
11
  const errorString = error instanceof Error ? error.message : 'Unknown error'
12
12
  return (
13
- <Box pos={'fixed'} top={0} left={0} w={'100%'} p={0} style={{ zIndex: 1000 }}>
13
+ <Box pos={'fixed'} top={'0'} left={'0'} w={'100%'} p={'0'} style={{ zIndex: 1000 }}>
14
14
  <Notification
15
15
  icon={<IconX style={{ width: 16, height: 16 }} />}
16
16
  styles={{
@@ -0,0 +1,16 @@
1
+ import type { SVGProps } from 'react'
2
+ import { forwardRef } from 'react'
3
+
4
+ export const GithubIcon = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>((props, ref) => (
5
+ <svg
6
+ height="24"
7
+ width="24"
8
+ fill="currentColor"
9
+ {...props}
10
+ viewBox="0 0 24 24"
11
+ ref={ref}
12
+ >
13
+ <path d="M12 1C5.923 1 1 5.923 1 12c0 4.867 3.149 8.979 7.521 10.436.55.096.756-.233.756-.522 0-.262-.013-1.128-.013-2.049-2.764.509-3.479-.674-3.699-1.292-.124-.317-.66-1.293-1.127-1.554-.385-.207-.936-.715-.014-.729.866-.014 1.485.797 1.691 1.128.99 1.663 2.571 1.196 3.204.907.096-.715.385-1.196.701-1.471-2.448-.275-5.005-1.224-5.005-5.432 0-1.196.426-2.186 1.128-2.956-.111-.275-.496-1.402.11-2.915 0 0 .921-.288 3.024 1.128a10.193 10.193 0 0 1 2.75-.371c.936 0 1.871.123 2.75.371 2.104-1.43 3.025-1.128 3.025-1.128.605 1.513.221 2.64.111 2.915.701.77 1.127 1.747 1.127 2.956 0 4.222-2.571 5.157-5.019 5.432.399.344.743 1.004.743 2.035 0 1.471-.014 2.654-.014 3.025 0 .289.206.632.756.522C19.851 20.979 23 16.854 23 12c0-6.077-4.922-11-11-11Z">
14
+ </path>
15
+ </svg>
16
+ ))