@likec4/styles 1.44.0 → 1.45.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.
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import type { SlotRecipeRuntimeFn, RecipeVariantProps } from '../types/recipe';
3
3
  import type { JsxHTMLProps, JsxStyleProps, Assign } from '../types/system-types';
4
- import type { JsxFactoryOptions, ComponentProps } from '../types/jsx';
4
+ import type { JsxFactoryOptions, ComponentProps, DataAttrs, AsProps } from '../types/jsx';
5
5
  import type { ComponentType, ElementType } from 'react'
6
6
 
7
7
  interface UnstyledProps {
@@ -19,11 +19,11 @@ type SlotRecipe = SvaFn | SlotRecipeFn
19
19
  type InferSlot<R extends SlotRecipe> = R extends SlotRecipeFn ? R['__slot'] : R extends SvaFn<infer S> ? S : never
20
20
 
21
21
  interface WithProviderOptions<P = {}> {
22
- defaultProps?: Partial<P> | undefined
22
+ defaultProps?: (Partial<P> & DataAttrs) | undefined
23
23
  }
24
24
 
25
25
  type StyleContextProvider<T extends ElementType, R extends SlotRecipe> = ComponentType<
26
- JsxHTMLProps<ComponentProps<T> & UnstyledProps, Assign<RecipeVariantProps<R>, JsxStyleProps>>
26
+ JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, Assign<RecipeVariantProps<R>, JsxStyleProps>>
27
27
  >
28
28
 
29
29
  type StyleContextRootProvider<T extends ElementType, R extends SlotRecipe> = ComponentType<
@@ -31,7 +31,7 @@ type StyleContextRootProvider<T extends ElementType, R extends SlotRecipe> = Com
31
31
  >
32
32
 
33
33
  type StyleContextConsumer<T extends ElementType> = ComponentType<
34
- JsxHTMLProps<ComponentProps<T> & UnstyledProps, JsxStyleProps>
34
+ JsxHTMLProps<ComponentProps<T> & UnstyledProps & AsProps, JsxStyleProps>
35
35
  >
36
36
 
37
37
  export interface StyleContext<R extends SlotRecipe> {
@@ -5,9 +5,29 @@ import { styled } from './factory.mjs';
5
5
  import { getDisplayName } from './factory-helper.mjs';
6
6
  import { createContext, useContext, createElement, forwardRef } from 'react'
7
7
 
8
+ function createSafeContext(contextName) {
9
+ const Context = createContext(undefined)
10
+ const useStyleContext = (componentName, slot) => {
11
+ const context = useContext(Context)
12
+ if (context === undefined) {
13
+ const componentInfo = componentName ? `Component "${componentName}"` : 'A component'
14
+ const slotInfo = slot ? ` (slot: "${slot}")` : ''
15
+
16
+ throw new Error(
17
+ `${componentInfo}${slotInfo} cannot access ${contextName} because it's missing its Provider.`
18
+ )
19
+ }
20
+ return context
21
+ }
22
+ return [Context, useStyleContext]
23
+ }
24
+
8
25
  export function createStyleContext(recipe) {
9
- const StyleContext = createContext({})
10
26
  const isConfigRecipe = '__recipe__' in recipe
27
+ const recipeName = isConfigRecipe && recipe.__name__ ? recipe.__name__ : undefined
28
+ const contextName = recipeName ? `createStyleContext("${recipeName}")` : 'createStyleContext'
29
+
30
+ const [StyleContext, useStyleContext] = createSafeContext(contextName)
11
31
  const svaFn = isConfigRecipe ? recipe : sva(recipe.config)
12
32
 
13
33
  const getResolvedProps = (props, slotStyles) => {
@@ -71,9 +91,10 @@ export function createStyleContext(recipe) {
71
91
 
72
92
  const withContext = (Component, slot, options) => {
73
93
  const StyledComponent = styled(Component, {}, options)
94
+ const componentName = getDisplayName(Component)
74
95
 
75
96
  const WithContext = forwardRef((props, ref) => {
76
- const slotStyles = useContext(StyleContext)
97
+ const slotStyles = useStyleContext(componentName, slot)
77
98
 
78
99
  const propsWithClass = { ...props, className: props.className ?? options?.defaultProps?.className }
79
100
  const resolvedProps = getResolvedProps(propsWithClass, slotStyles[slot])
@@ -84,7 +105,6 @@ export function createStyleContext(recipe) {
84
105
  })
85
106
  })
86
107
 
87
- const componentName = getDisplayName(Component)
88
108
  WithContext.displayName = `withContext(${componentName})`
89
109
 
90
110
  return WithContext
package/dist/preset.mjs CHANGED
@@ -3935,11 +3935,11 @@ function createPreset(options) {
3935
3935
  const keyframes = defineKeyframes({
3936
3936
  "indicatorOpacity": {
3937
3937
  "0%": {
3938
- opacity: 0.9,
3938
+ opacity: 0.8,
3939
3939
  strokeOpacity: 0.8
3940
3940
  },
3941
3941
  "100%": {
3942
- opacity: 0.6,
3942
+ opacity: 0.4,
3943
3943
  strokeOpacity: 0.4
3944
3944
  }
3945
3945
  },
@@ -4750,12 +4750,16 @@ const paletteGlobalVars = {
4750
4750
  };
4751
4751
  const mantine = {
4752
4752
  colors: {
4753
+ white: "var(--mantine-color-white)",
4754
+ black: "var(--mantine-color-black)",
4753
4755
  text: "var(--mantine-color-text)",
4754
4756
  body: "var(--mantine-color-body)",
4755
4757
  defaultBorder: "var(--mantine-color-default-border)",
4756
4758
  dimmed: "var(--mantine-color-dimmed)",
4757
4759
  dark: {
4760
+ "3": "var(--mantine-color-dark-3)",
4758
4761
  "4": "var(--mantine-color-dark-4)",
4762
+ "5": "var(--mantine-color-dark-5)",
4759
4763
  "6": "var(--mantine-color-dark-6)",
4760
4764
  "7": "var(--mantine-color-dark-7)",
4761
4765
  "8": "var(--mantine-color-dark-8)"
@@ -4763,11 +4767,16 @@ const mantine = {
4763
4767
  gray: {
4764
4768
  "1": "var(--mantine-color-gray-1)",
4765
4769
  "2": "var(--mantine-color-gray-2)",
4770
+ "3": "var(--mantine-color-gray-3)",
4766
4771
  "4": "var(--mantine-color-gray-4)"
4767
4772
  },
4768
4773
  green: {
4769
4774
  "6": "var(--mantine-color-green-6)"
4770
4775
  },
4776
+ yellow: {
4777
+ "2": "var(--mantine-color-yellow-2)",
4778
+ "5": "var(--mantine-color-yellow-5)"
4779
+ },
4771
4780
  orange: {
4772
4781
  "1": "var(--mantine-color-orange-1)",
4773
4782
  "3": "var(--mantine-color-orange-3)",
@@ -4827,9 +4836,9 @@ const conditions = {
4827
4836
  smallZoom: ':where([data-likec4-zoom-small="true"]) &',
4828
4837
  compoundTransparent: ":where([data-compound-transparent]) &",
4829
4838
  edgeActive: ':where([data-likec4-edge-active="true"]) &',
4830
- whenHovered: ':where(.react-flow__node, .react-flow__edge):has([data-likec4-hovered="true"]) &',
4831
- whenSelectable: ":where(.react-flow__node, .react-flow__edge):is(.selectable) &",
4832
- whenSelected: ":where(.react-flow__node, .react-flow__edge):is(.selected) &",
4839
+ whenHovered: ':where(.react-flow__node:has([data-likec4-hovered="true"]), .react-flow__edge:has([data-likec4-hovered="true"]), .likec4-edge-container[data-likec4-hovered="true"]) &',
4840
+ whenSelectable: ":where(.react-flow__node, .react-flow__edge, .likec4-edge-container):is(.selectable) &",
4841
+ whenSelected: ":where(.react-flow__node, .react-flow__edge, .likec4-edge-container):is(.selected) &",
4833
4842
  whenDimmed: ":where(.react-flow__node, .react-flow__edge):has([data-likec4-dimmed]) &",
4834
4843
  whenFocused: ":where(.react-flow__node, .react-flow__edge):is(:focus-visible, :focus, :focus-within) &"
4835
4844
  // likec4Color: ':where([data-likec4-color]) &',
@@ -4872,14 +4881,28 @@ const globalCss = {
4872
4881
  width: "100%",
4873
4882
  height: "100%",
4874
4883
  border: "0px solid transparent",
4884
+ background: "transparent",
4875
4885
  containerName: "likec4-root",
4876
4886
  containerType: "size",
4887
+ _print: {
4888
+ "& .react-flow__background": {
4889
+ display: "none"
4890
+ },
4891
+ "& .react-flow": {
4892
+ background: "transparent !important",
4893
+ "--xy-background-color": "transparent !important"
4894
+ },
4895
+ "& *": {
4896
+ colorAdjust: "exact!",
4897
+ printColorAdjust: "exact!"
4898
+ }
4899
+ },
4877
4900
  "& .mantine-ActionIcon-icon .tabler-icon": {
4878
4901
  width: "75%",
4879
4902
  height: "75%"
4880
4903
  },
4881
4904
  "& .react-flow": {
4882
- contain: "paint",
4905
+ contain: "paint layout",
4883
4906
  "--xy-background-color": "var(--colors-likec4-background)",
4884
4907
  "--xy-background-pattern-color": "var(--colors-likec4-background-pattern, var(--colors-likec4-background))",
4885
4908
  "&:is(.not-initialized)": {
@@ -4912,11 +4935,11 @@ const globalCss = {
4912
4935
  "--xy-edge-label-color": "var(--likec4-palette-relation-label)",
4913
4936
  "--xy-edge-label-background-color": "var(--likec4-palette-relation-label-bg)",
4914
4937
  _dark: {
4915
- "--xy-edge-label-background-color": "color-mix(in srgb, var(--likec4-palette-relation-label-bg) 50%, transparent)"
4938
+ "--xy-edge-label-background-color": "color-mix(in oklab, var(--likec4-palette-relation-label-bg) 50%, transparent)"
4916
4939
  },
4917
4940
  _light: {
4918
- "--xy-edge-label-color": "color-mix(in srgb, var(--likec4-palette-relation-label), rgba(255 255 255 / 0.85) 40%)",
4919
- "--xy-edge-label-background-color": "color-mix(in srgb, var(--likec4-palette-relation-label-bg) 60%, transparent)"
4941
+ "--xy-edge-label-color": "color-mix(in oklab, var(--likec4-palette-relation-label), rgba(255 255 255 / 0.85) 40%)",
4942
+ "--xy-edge-label-background-color": "color-mix(in oklab, var(--likec4-palette-relation-label-bg) 60%, transparent)"
4920
4943
  },
4921
4944
  '&:is([data-likec4-hovered="true"], [data-edge-active="true"])': {
4922
4945
  "--xy-edge-stroke-width": 4,
@@ -4946,19 +4969,22 @@ const globalCss = {
4946
4969
  "& :where(.react-flow__edges, .react-flow__edgelabel-renderer) > :where(svg, .likec4-edge-label-container)": {
4947
4970
  mixBlendMode: {
4948
4971
  _dark: "plus-lighter",
4949
- _light: "screen"
4972
+ _light: "screen",
4973
+ _print: "normal!"
4950
4974
  }
4951
4975
  },
4952
4976
  "&:has(.react-flow__node-seq-parallel) :where(.react-flow__edges > svg)": {
4953
4977
  mixBlendMode: {
4954
4978
  // _dark: 'plus-lighter',
4955
- _light: "color-burn"
4979
+ _light: "color-burn",
4980
+ _print: "normal!"
4956
4981
  }
4957
4982
  },
4958
4983
  "& .react-flow__node-seq-parallel": {
4959
4984
  mixBlendMode: {
4960
4985
  _dark: "luminosity",
4961
- _light: "color-burn"
4986
+ _light: "color-burn",
4987
+ _print: "normal!"
4962
4988
  }
4963
4989
  }
4964
4990
  },
@@ -5074,18 +5100,20 @@ const actionBtn = defineRecipe({
5074
5100
  className: "action-btn",
5075
5101
  description: "Action Button within Diagram Node (Bottom-Center)",
5076
5102
  base: {
5077
- pointerEvents: "all",
5078
- cursor: "pointer",
5079
5103
  color: "var(--actionbtn-color)",
5080
5104
  opacity: 0.75,
5081
5105
  "--actionbtn-color": "var(--likec4-palette-loContrast)",
5082
5106
  "--actionbtn-color-hovered": "var(--likec4-palette-loContrast)",
5083
5107
  "--actionbtn-color-hovered-btn": "var(--likec4-palette-hiContrast)",
5084
- "--actionbtn-bg-idle": `color-mix(in srgb , var(--likec4-palette-fill), transparent 99%)`,
5085
- "--actionbtn-bg-hovered": `color-mix(in srgb , var(--likec4-palette-fill) 65%, var(--likec4-palette-stroke))`,
5086
- "--actionbtn-bg-hovered-btn": `color-mix(in srgb , var(--likec4-palette-fill) 50%, var(--likec4-palette-stroke))`,
5108
+ "--actionbtn-bg-idle": `color-mix(in oklab , var(--likec4-palette-fill), transparent 99%)`,
5109
+ "--actionbtn-bg-hovered": `color-mix(in oklab , var(--likec4-palette-fill) 65%, var(--likec4-palette-stroke))`,
5110
+ "--actionbtn-bg-hovered-btn": `color-mix(in oklab , var(--likec4-palette-fill) 50%, var(--likec4-palette-stroke))`,
5087
5111
  "--ai-bg": `var(--actionbtn-bg-idle)`,
5088
5112
  background: `var(--ai-bg)`,
5113
+ _whenSelectable: {
5114
+ pointerEvents: "all",
5115
+ cursor: "pointer"
5116
+ },
5089
5117
  _whenHovered: {
5090
5118
  opacity: 1,
5091
5119
  color: "var(--actionbtn-color-hovered)",
@@ -5104,6 +5132,9 @@ const actionBtn = defineRecipe({
5104
5132
  },
5105
5133
  "& *": {
5106
5134
  pointerEvents: "none"
5135
+ },
5136
+ _print: {
5137
+ display: "none"
5107
5138
  }
5108
5139
  },
5109
5140
  variants: {
@@ -5194,17 +5225,17 @@ const compoundNode = defineRecipe({
5194
5225
  borderRadius: borderRadius$1.ref,
5195
5226
  boxSizing: "border-box",
5196
5227
  ["--likec4-palette-outline"]: {
5197
- _light: "color-mix(in srgb, var(--likec4-palette-stroke) 80%, var(--likec4-palette-hiContrast))",
5198
- _dark: "color-mix(in srgb, var(--likec4-palette-stroke) 60%, var(--likec4-palette-hiContrast))"
5228
+ base: "oklab(from var(--likec4-palette-stroke) calc(l - 0.05) a b)",
5229
+ _dark: "oklab(from var(--likec4-palette-stroke) calc(l + 0.2) a b)"
5199
5230
  },
5200
5231
  [borderWidth.var]: "3px",
5201
5232
  [borderRadius$1.var]: "6px",
5202
5233
  [compoundTransparency.var]: "100%",
5203
5234
  [borderTransparency.var]: "100%",
5204
- [indicatorSpacing.var]: `calc(${borderWidth.ref} + 2px)`,
5235
+ [indicatorSpacing.var]: `calc(${borderWidth.ref} + 1px)`,
5205
5236
  [compoundColor.var]: "var(--likec4-palette-loContrast)",
5206
5237
  color: compoundColor.ref,
5207
- _after: {
5238
+ _before: {
5208
5239
  position: "absolute",
5209
5240
  content: '" "',
5210
5241
  top: `[calc(-1 * ${indicatorSpacing.ref})]`,
@@ -5221,7 +5252,7 @@ const compoundNode = defineRecipe({
5221
5252
  _whenFocused: "block",
5222
5253
  _whenSelected: "block"
5223
5254
  },
5224
- animationStyle: "indicatorOpacity",
5255
+ animationStyle: "indicator",
5225
5256
  animationPlayState: {
5226
5257
  base: "paused",
5227
5258
  _whenFocused: "running",
@@ -5268,7 +5299,8 @@ const compoundNode = defineRecipe({
5268
5299
  justifyContent: "center",
5269
5300
  mixBlendMode: {
5270
5301
  base: "hard-light",
5271
- _reduceGraphicsOnPan: "normal"
5302
+ _reduceGraphicsOnPan: "normal",
5303
+ _print: "normal!"
5272
5304
  },
5273
5305
  [`& svg, & img`]: {
5274
5306
  width: "100%",
@@ -5291,7 +5323,7 @@ const compoundNode = defineRecipe({
5291
5323
  actionBtn: {
5292
5324
  "--actionbtn-color": compoundColor.ref,
5293
5325
  "--actionbtn-color-hovered": compoundColor.ref,
5294
- "--actionbtn-color-hovered-btn": `color-mix(in srgb, ${compoundColor.ref} 80%, #fff)`,
5326
+ "--actionbtn-color-hovered-btn": `color-mix(in oklab, ${compoundColor.ref} 80%, #fff)`,
5295
5327
  opacity: {
5296
5328
  base: 0.6,
5297
5329
  _whenHovered: 0.75,
@@ -5300,6 +5332,9 @@ const compoundNode = defineRecipe({
5300
5332
  },
5301
5333
  _noReduceGraphics: {
5302
5334
  transition: "fast"
5335
+ },
5336
+ _print: {
5337
+ display: "none"
5303
5338
  }
5304
5339
  },
5305
5340
  navigationBtn: {
@@ -5308,6 +5343,9 @@ const compoundNode = defineRecipe({
5308
5343
  left: "0.5",
5309
5344
  _smallZoom: {
5310
5345
  display: "none"
5346
+ },
5347
+ _print: {
5348
+ display: "none"
5311
5349
  }
5312
5350
  },
5313
5351
  detailsBtn: {
@@ -5316,6 +5354,9 @@ const compoundNode = defineRecipe({
5316
5354
  right: "0.5",
5317
5355
  _smallZoom: {
5318
5356
  display: "none"
5357
+ },
5358
+ _print: {
5359
+ display: "none"
5319
5360
  }
5320
5361
  }
5321
5362
  }),
@@ -5334,8 +5375,8 @@ const compoundNode = defineRecipe({
5334
5375
  }),
5335
5376
  true: parts$3({
5336
5377
  root: {
5337
- backgroundColor: `[color-mix(in srgb, var(--likec4-palette-fill) ${compoundTransparency.ref}, transparent)]`,
5338
- borderColor: `[color-mix(in srgb, var(--likec4-palette-stroke) ${borderTransparency.ref}, transparent)]`
5378
+ backgroundColor: `color-mix(in oklab, var(--likec4-palette-fill) ${compoundTransparency.ref}, transparent)`,
5379
+ borderColor: `color-mix(in oklab, var(--likec4-palette-stroke) ${borderTransparency.ref}, transparent)`
5339
5380
  }
5340
5381
  })
5341
5382
  },
@@ -5345,7 +5386,7 @@ const compoundNode = defineRecipe({
5345
5386
  root: {
5346
5387
  [compoundColor.var]: {
5347
5388
  base: "var(--likec4-palette-stroke)",
5348
- _dark: "[color-mix(in srgb, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))]"
5389
+ _dark: "[color-mix(in oklab, var(--likec4-palette-loContrast) 60%, var(--likec4-palette-fill))]"
5349
5390
  }
5350
5391
  },
5351
5392
  actionBtn: {
@@ -5411,7 +5452,7 @@ const edgeActionBtn = defineRecipe({
5411
5452
  translate: "auto",
5412
5453
  // '--ai-bg': 'var(--xy-edge-label-background-color)',
5413
5454
  "--ai-bg": "transparent",
5414
- "--ai-hover": `color-mix(in srgb , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
5455
+ "--ai-hover": `color-mix(in oklab , var(--xy-edge-label-background-color), {colors.likec4.mixColor} 10%)`,
5415
5456
  "--ai-size": `var(--ai-size-sm)`,
5416
5457
  "--ai-radius": `{radii.sm}`,
5417
5458
  _hover: {
@@ -5430,6 +5471,9 @@ const edgeActionBtn = defineRecipe({
5430
5471
  width: "80%",
5431
5472
  height: "80%",
5432
5473
  strokeWidth: "2"
5474
+ },
5475
+ _print: {
5476
+ display: "none"
5433
5477
  }
5434
5478
  },
5435
5479
  variants: {},
@@ -5635,9 +5679,10 @@ const elementShapeRecipe = defineRecipe({
5635
5679
  pointerEvents: "none",
5636
5680
  overflow: "visible",
5637
5681
  ["--likec4-palette-outline"]: {
5638
- _light: "color-mix(in srgb, var(--likec4-palette-stroke) 60%, var(--likec4-palette-hiContrast))",
5639
- _dark: "color-mix(in srgb, var(--likec4-palette-stroke) 30%, var(--likec4-palette-loContrast))"
5640
- }
5682
+ base: "oklab(from var(--likec4-palette-stroke) calc(l - 0.05) a b)",
5683
+ _dark: "oklab(from var(--likec4-palette-stroke) calc(l + 0.2) a b)"
5684
+ },
5685
+ ["--likec4-outline-size"]: `4px`
5641
5686
  },
5642
5687
  outline: {
5643
5688
  visibility: {
@@ -5666,11 +5711,11 @@ const elementShapeRecipe = defineRecipe({
5666
5711
  boxShadow: {
5667
5712
  base: [
5668
5713
  "0 2px 1px 0 rgb(0 0 0 / 21%)",
5669
- "0 1px 1px 0 color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent)",
5714
+ "0 1px 1px 0 color-mix(in oklab, var(--likec4-palette-stroke) 40%, transparent)",
5670
5715
  "0 5px 3px 0 rgb(0 0 0 / 10%)"
5671
5716
  ].join(","),
5672
5717
  _whenHovered: {
5673
- _light: `rgba(38, 57, 77, 95%) 0px 20px 30px -10px`,
5718
+ base: `rgba(38, 57, 77, 95%) 0px 20px 30px -10px`,
5674
5719
  _dark: `rgba(10, 11, 16, 90%) 0px 20px 30px -10px`
5675
5720
  },
5676
5721
  _whenSelected: "none",
@@ -5681,8 +5726,7 @@ const elementShapeRecipe = defineRecipe({
5681
5726
  base: "background-color 120ms linear, box-shadow 130ms {easings.inOut}",
5682
5727
  _reduceGraphicsOnPan: "none"
5683
5728
  },
5684
- transitionDelay: "0ms",
5685
- ["--likec4-outline-size"]: `4px`
5729
+ transitionDelay: "0ms"
5686
5730
  },
5687
5731
  multipleHtml: {
5688
5732
  position: "absolute",
@@ -5710,13 +5754,13 @@ const elementShapeRecipe = defineRecipe({
5710
5754
  outline: {
5711
5755
  position: "absolute",
5712
5756
  content: '" "',
5713
- top: `[calc(-1 * var(--likec4-outline-size))]`,
5714
- left: `[calc(-1 * var(--likec4-outline-size))]`,
5715
- width: `[calc(100% + 2 * var(--likec4-outline-size))]`,
5716
- height: `[calc(100% + 2 * var(--likec4-outline-size))]`,
5757
+ top: `[calc(-1 * var(--likec4-outline-size) - 1px)]`,
5758
+ left: `[calc(-1 * var(--likec4-outline-size) - 1px)]`,
5759
+ width: `[calc(100% + 2 * var(--likec4-outline-size) + 2px)]`,
5760
+ height: `[calc(100% + 2 * var(--likec4-outline-size) + 2px)]`,
5717
5761
  borderStyle: "solid",
5718
5762
  borderWidth: "var(--likec4-outline-size)",
5719
- borderRadius: "[10px]",
5763
+ borderRadius: "11px",
5720
5764
  borderColor: "var(--likec4-palette-outline)",
5721
5765
  animationStyle: "indicator"
5722
5766
  }
@@ -5730,7 +5774,7 @@ const elementShapeRecipe = defineRecipe({
5730
5774
  filter: {
5731
5775
  base: [
5732
5776
  "drop-shadow(0 2px 1px rgba(0, 0, 0, 0.21))",
5733
- "drop-shadow(0 1px 1px color-mix(in srgb, var(--likec4-palette-stroke) 40%, transparent))",
5777
+ "drop-shadow(0 1px 1px color-mix(in oklab, var(--likec4-palette-stroke) 40%, transparent))",
5734
5778
  "drop-shadow(0 5px 3px rgba(0, 0, 0, 0.1))"
5735
5779
  ].join("\n"),
5736
5780
  _whenHovered: [
@@ -5751,7 +5795,7 @@ const elementShapeRecipe = defineRecipe({
5751
5795
  fill: "var(--likec4-palette-stroke)"
5752
5796
  },
5753
5797
  '& [data-likec4-fill="mix-stroke"]': {
5754
- fill: "[color-mix(in srgb, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]"
5798
+ fill: "[color-mix(in oklab, var(--likec4-palette-stroke) 90%, var(--likec4-palette-fill))]"
5755
5799
  }
5756
5800
  },
5757
5801
  multipleSvg: {
@@ -5781,7 +5825,7 @@ const elementShapeRecipe = defineRecipe({
5781
5825
  outline: {
5782
5826
  stroke: "var(--likec4-palette-outline)",
5783
5827
  fill: "[none]",
5784
- strokeWidth: 8,
5828
+ strokeWidth: 3,
5785
5829
  strokeOpacity: 0.8,
5786
5830
  animationStyle: "indicator"
5787
5831
  }
@@ -5829,7 +5873,10 @@ const likec4tag = defineRecipe({
5829
5873
  filter: "invert(1) grayscale(1) brightness(1.3) contrast(1000)",
5830
5874
  background: "inherit",
5831
5875
  backgroundClip: "text",
5832
- mixBlendMode: "plus-lighter"
5876
+ mixBlendMode: {
5877
+ base: "plus-lighter",
5878
+ _print: "normal!"
5879
+ }
5833
5880
  }
5834
5881
  }
5835
5882
  }
@@ -5856,12 +5903,12 @@ const markdownBlock = defineRecipe({
5856
5903
  "--typography-spacing": "calc(0.75 * var(--text-fz-md))",
5857
5904
  "--text-fw-headings": "600",
5858
5905
  "--code-background": {
5859
- _light: "var(--mantine-color-gray-2)",
5860
- _dark: "var(--mantine-color-dark-8)"
5906
+ base: mantine.colors.gray[2],
5907
+ _dark: mantine.colors.dark[8]
5861
5908
  },
5862
5909
  "--code-color": {
5863
- _light: "var(--mantine-color-black)",
5864
- _dark: "var(--mantine-color-white)"
5910
+ base: mantine.colors.black,
5911
+ _dark: mantine.colors.white
5865
5912
  },
5866
5913
  fontSize: "var(--text-fz-md)",
5867
5914
  lineHeight: "var(--mantine-line-height)",
@@ -5923,12 +5970,10 @@ const markdownBlock = defineRecipe({
5923
5970
  },
5924
5971
  "& :where(mark)": {
5925
5972
  fontSize: "var(--text-fz-md)",
5926
- _light: {
5927
- backgroundColor: "mantine.colors.yellow[2]",
5928
- color: "inherit"
5929
- },
5973
+ backgroundColor: mantine.colors.yellow[2],
5974
+ color: "inherit",
5930
5975
  _dark: {
5931
- backgroundColor: "mantine.colors.yellow[5]",
5976
+ backgroundColor: mantine.colors.yellow[5],
5932
5977
  color: "var(--mantine-color-black)"
5933
5978
  }
5934
5979
  },
@@ -5947,8 +5992,8 @@ const markdownBlock = defineRecipe({
5947
5992
  border: "none",
5948
5993
  borderBottom: "1px solid",
5949
5994
  borderColor: {
5950
- _light: "mantine.colors.gray[3]",
5951
- _dark: "mantine.colors.dark[3]"
5995
+ base: mantine.colors.gray[3],
5996
+ _dark: mantine.colors.dark[3]
5952
5997
  }
5953
5998
  },
5954
5999
  "& :where(pre)": {
@@ -6032,8 +6077,8 @@ const markdownBlock = defineRecipe({
6032
6077
  borderRadius: "var(--mantine-radius-sm)",
6033
6078
  padding: "xs",
6034
6079
  backgroundColor: {
6035
- _light: "var(--mantine-color-gray-1)",
6036
- _dark: "var(--mantine-color-dark-5)"
6080
+ base: mantine.colors.gray[1],
6081
+ _dark: mantine.colors.dark[5]
6037
6082
  },
6038
6083
  "&:not(:first-child)": {
6039
6084
  marginTop: "var(--typography-spacing)"
@@ -6046,15 +6091,18 @@ const markdownBlock = defineRecipe({
6046
6091
  */
6047
6092
  uselikec4palette: {
6048
6093
  true: {
6049
- "--code-background": "color-mix(in srgb , var(--likec4-palette-stroke) 70%, transparent)",
6094
+ "--code-background": "color-mix(in oklab , var(--likec4-palette-stroke) 70%, transparent)",
6050
6095
  "--code-color": "var(--likec4-palette-loContrast)",
6051
6096
  "--typography-spacing": "calc(0.5 * var(--text-fz-md))",
6052
6097
  "& :where(a)": {
6053
6098
  color: "var(--likec4-palette-fill)/45",
6054
- mixBlendMode: "difference"
6099
+ mixBlendMode: {
6100
+ base: "difference",
6101
+ _print: "normal!"
6102
+ }
6055
6103
  },
6056
6104
  "& :where(strong)": {
6057
- color: `color-mix(in srgb , var(--likec4-palette-hiContrast) 50%, var(--likec4-palette-loContrast))`
6105
+ color: `color-mix(in oklab , var(--likec4-palette-hiContrast) 50%, var(--likec4-palette-loContrast))`
6058
6106
  },
6059
6107
  "& :where(blockquote)": {
6060
6108
  padding: "xxs",
@@ -6252,7 +6300,7 @@ const overlay = defineRecipe({
6252
6300
  dialog: {
6253
6301
  _backdrop: {
6254
6302
  backdropFilter: `blur(var(${backdropBlur}))`,
6255
- background: `color-mix(in srgb, {colors.likec4.overlay.backdrop} var(${backdropOpacity}), transparent)`
6303
+ background: `color-mix(in oklab, {colors.likec4.overlay.backdrop} var(${backdropOpacity}), transparent)`
6256
6304
  }
6257
6305
  }
6258
6306
  }
@@ -6498,12 +6546,12 @@ const edgeLabel = defineSlotRecipe({
6498
6546
  borderRadius: "4px",
6499
6547
  minWidth: "24px"
6500
6548
  },
6501
- background: `[color-mix(in srgb, var(--likec4-palette-relation-label-bg), {colors.likec4.mixColor} 10%)]`,
6549
+ background: `[color-mix(in oklab, var(--likec4-palette-relation-label-bg), {colors.likec4.mixColor} 10%)]`,
6502
6550
  fontVariantNumeric: "tabular-nums",
6503
6551
  // _dark: {
6504
6552
  [':where([data-likec4-color="gray"]) &']: {
6505
6553
  _dark: {
6506
- background: `[color-mix(in srgb, var(--likec4-palette-relation-label-bg), {colors.likec4.mixColor} 15%)]`
6554
+ background: `[color-mix(in oklab, var(--likec4-palette-relation-label-bg), {colors.likec4.mixColor} 15%)]`
6507
6555
  }
6508
6556
  }
6509
6557
  },
@@ -256,11 +256,11 @@ export interface Conditions {
256
256
  "_compoundTransparent": string
257
257
  /** `:where([data-likec4-edge-active="true"]) &` */
258
258
  "_edgeActive": string
259
- /** `:where(.react-flow__node, .react-flow__edge):has([data-likec4-hovered="true"]) &` */
259
+ /** `:where(.react-flow__node:has([data-likec4-hovered="true"]), .react-flow__edge:has([data-likec4-hovered="true"]), .likec4-edge-container[data-likec4-hovered="true"]) &` */
260
260
  "_whenHovered": string
261
- /** `:where(.react-flow__node, .react-flow__edge):is(.selectable) &` */
261
+ /** `:where(.react-flow__node, .react-flow__edge, .likec4-edge-container):is(.selectable) &` */
262
262
  "_whenSelectable": string
263
- /** `:where(.react-flow__node, .react-flow__edge):is(.selected) &` */
263
+ /** `:where(.react-flow__node, .react-flow__edge, .likec4-edge-container):is(.selected) &` */
264
264
  "_whenSelected": string
265
265
  /** `:where(.react-flow__node, .react-flow__edge):has([data-likec4-dimmed]) &` */
266
266
  "_whenDimmed": string
@@ -7,6 +7,8 @@ interface Dict {
7
7
  [k: string]: unknown
8
8
  }
9
9
 
10
+ export type DataAttrs = Record<`data-${string}`, unknown>
11
+
10
12
  export interface UnstyledProps {
11
13
  /**
12
14
  * Whether to remove recipe styles
@@ -36,7 +38,7 @@ interface RecipeFn {
36
38
 
37
39
  export interface JsxFactoryOptions<TProps extends Dict> {
38
40
  dataAttr?: boolean
39
- defaultProps?: Partial<TProps>
41
+ defaultProps?: Partial<TProps> & DataAttrs
40
42
  shouldForwardProp?: (prop: string, variantKeys: string[]) => boolean
41
43
  forwardProps?: string[]
42
44
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@likec4/styles",
3
3
  "description": "Shared PandaCSS preset and generated styles, used in LikeC4",
4
4
  "license": "MIT",
5
- "version": "1.44.0",
5
+ "version": "1.45.0",
6
6
  "bugs": "https://github.com/likec4/likec4/issues",
7
7
  "homepage": "https://likec4.dev",
8
8
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -71,8 +71,8 @@
71
71
  "./dev": "./dev.ts"
72
72
  },
73
73
  "peerDependencies": {
74
- "@pandacss/dev": "^1.4.3",
75
- "@pandacss/types": "^1.4.3",
74
+ "@pandacss/dev": "^1.5.1",
75
+ "@pandacss/types": "^1.5.1",
76
76
  "react": "^18.x || ^19.x",
77
77
  "@types/react": "^18.x || ^19.x"
78
78
  },
@@ -89,18 +89,18 @@
89
89
  "@pandabox/panda-plugins": "^0.0.8",
90
90
  "@pandabox/utils": "^0.0.5",
91
91
  "@pandabox/unplugin": "^0.2.2",
92
- "@pandacss/dev": "^1.4.3",
93
- "@pandacss/types": "^1.4.3",
92
+ "@pandacss/dev": "^1.5.1",
93
+ "@pandacss/types": "^1.5.1",
94
94
  "@types/picomatch": "^4.0.2",
95
- "@types/react": "19.2.2",
96
- "@types/react-dom": "19.2.2",
95
+ "@types/react": "19.2.6",
96
+ "@types/react-dom": "19.2.3",
97
97
  "postcss": "8.5.6",
98
98
  "nano-spawn": "^1.0.3",
99
99
  "unbuild": "3.5.0",
100
100
  "typescript": "5.9.3",
101
- "@likec4/style-preset": "1.44.0",
102
- "@likec4/tsconfig": "1.44.0",
103
- "@likec4/devops": "1.42.0"
101
+ "@likec4/style-preset": "1.45.0",
102
+ "@likec4/devops": "1.42.0",
103
+ "@likec4/tsconfig": "1.45.0"
104
104
  },
105
105
  "scripts": {
106
106
  "typecheck": "tsc --build --verbose",