@likec4/styles 1.40.0 → 1.42.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.
@@ -3,28 +3,23 @@ import type { ConditionalValue } from '../types/index';
3
3
  import type { DistributiveOmit, Pretty } from '../types/system-types';
4
4
 
5
5
  interface ElementNodeDataVariant {
6
- /**
7
- * @default false
8
- */
9
- hasIcon: boolean
10
- hasDescription: boolean
11
- hasTechnology: boolean
6
+
12
7
  }
13
8
 
14
9
  type ElementNodeDataVariantMap = {
15
10
  [key in keyof ElementNodeDataVariant]: Array<ElementNodeDataVariant[key]>
16
11
  }
17
12
 
18
- type ElementNodeDataSlot = "root" | "textContainer" | "title" | "description" | "technology" | "icon"
13
+
19
14
 
20
15
  export type ElementNodeDataVariantProps = {
21
- [key in keyof ElementNodeDataVariant]?: ElementNodeDataVariant[key] | undefined
16
+ [key in keyof ElementNodeDataVariant]?: ConditionalValue<ElementNodeDataVariant[key]> | undefined
22
17
  }
23
18
 
24
19
  export interface ElementNodeDataRecipe {
25
- __slot: ElementNodeDataSlot
20
+
26
21
  __type: ElementNodeDataVariantProps
27
- (props?: ElementNodeDataVariantProps): Pretty<Record<ElementNodeDataSlot, string>>
22
+ (props?: ElementNodeDataVariantProps): string
28
23
  raw: (props?: ElementNodeDataVariantProps) => ElementNodeDataVariantProps
29
24
  variantMap: ElementNodeDataVariantMap
30
25
  variantKeys: Array<keyof ElementNodeDataVariant>
@@ -1,82 +1,24 @@
1
- import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
- import { createRecipe } from './create-recipe.mjs';
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
3
 
4
- const elementNodeDataDefaultVariants = {
5
- "hasIcon": false
6
- }
7
- const elementNodeDataCompoundVariants = [
8
- {
9
- "hasDescription": true,
10
- "hasTechnology": true,
11
- "css": {
12
- "textContainer": {
13
- "gap": "6px"
14
- }
15
- }
16
- }
17
- ]
4
+ const elementNodeDataFn = /* @__PURE__ */ createRecipe('likec4-element-node-data', {}, [])
18
5
 
19
- const elementNodeDataSlotNames = [
20
- [
21
- "root",
22
- "likec4-el-node-data__root"
23
- ],
24
- [
25
- "textContainer",
26
- "likec4-el-node-data__textContainer"
27
- ],
28
- [
29
- "title",
30
- "likec4-el-node-data__title"
31
- ],
32
- [
33
- "description",
34
- "likec4-el-node-data__description"
35
- ],
36
- [
37
- "technology",
38
- "likec4-el-node-data__technology"
39
- ],
40
- [
41
- "icon",
42
- "likec4-el-node-data__icon"
43
- ]
44
- ]
45
- const elementNodeDataSlotFns = /* @__PURE__ */ elementNodeDataSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, elementNodeDataDefaultVariants, getSlotCompoundVariant(elementNodeDataCompoundVariants, slotName))])
6
+ const elementNodeDataVariantMap = {}
46
7
 
47
- const elementNodeDataFn = memo((props = {}) => {
48
- return Object.fromEntries(elementNodeDataSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
49
- })
8
+ const elementNodeDataVariantKeys = Object.keys(elementNodeDataVariantMap)
50
9
 
51
- const elementNodeDataVariantKeys = [
52
- "hasIcon",
53
- "hasDescription",
54
- "hasTechnology"
55
- ]
56
- const getVariantProps = (variants) => ({ ...elementNodeDataDefaultVariants, ...compact(variants) })
57
-
58
- export const elementNodeData = /* @__PURE__ */ Object.assign(elementNodeDataFn, {
59
- __recipe__: false,
10
+ export const elementNodeData = /* @__PURE__ */ Object.assign(memo(elementNodeDataFn.recipeFn), {
11
+ __recipe__: true,
60
12
  __name__: 'elementNodeData',
13
+ __getCompoundVariantCss__: elementNodeDataFn.__getCompoundVariantCss__,
61
14
  raw: (props) => props,
62
- classNameMap: {},
63
15
  variantKeys: elementNodeDataVariantKeys,
64
- variantMap: {
65
- "hasIcon": [
66
- "false",
67
- "true"
68
- ],
69
- "hasDescription": [
70
- "false",
71
- "true"
72
- ],
73
- "hasTechnology": [
74
- "false",
75
- "true"
76
- ]
77
- },
16
+ variantMap: elementNodeDataVariantMap,
17
+ merge(recipe) {
18
+ return mergeRecipes(this, recipe)
19
+ },
78
20
  splitVariantProps(props) {
79
21
  return splitProps(props, elementNodeDataVariantKeys)
80
22
  },
81
- getVariantProps
23
+ getVariantProps: elementNodeDataFn.getVariantProps,
82
24
  })
@@ -2,11 +2,11 @@
2
2
  export * from './action-btn';
3
3
  export * from './compound-node';
4
4
  export * from './edge-action-btn';
5
- export * from './element-node-icon';
5
+ export * from './element-node-data';
6
6
  export * from './element-shape-recipe';
7
7
  export * from './likec4tag';
8
8
  export * from './markdown-block';
9
9
  export * from './navigation-panel-action-icon';
10
+ export * from './overlay';
10
11
  export * from './edge-label';
11
- export * from './element-node-data';
12
12
  export * from './navigation-link';
@@ -1,11 +1,11 @@
1
1
  export * from './action-btn.mjs';
2
2
  export * from './compound-node.mjs';
3
3
  export * from './edge-action-btn.mjs';
4
- export * from './element-node-icon.mjs';
4
+ export * from './element-node-data.mjs';
5
5
  export * from './element-shape-recipe.mjs';
6
6
  export * from './likec4tag.mjs';
7
7
  export * from './markdown-block.mjs';
8
8
  export * from './navigation-panel-action-icon.mjs';
9
+ export * from './overlay.mjs';
9
10
  export * from './edge-label.mjs';
10
- export * from './element-node-data.mjs';
11
11
  export * from './navigation-link.mjs';
@@ -0,0 +1,40 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface OverlayVariant {
6
+ /**
7
+ * @default false
8
+ */
9
+ fullscreen: boolean
10
+ /**
11
+ * @default true
12
+ */
13
+ withBackdrop: boolean
14
+ }
15
+
16
+ type OverlayVariantMap = {
17
+ [key in keyof OverlayVariant]: Array<OverlayVariant[key]>
18
+ }
19
+
20
+
21
+
22
+ export type OverlayVariantProps = {
23
+ [key in keyof OverlayVariant]?: ConditionalValue<OverlayVariant[key]> | undefined
24
+ }
25
+
26
+ export interface OverlayRecipe {
27
+
28
+ __type: OverlayVariantProps
29
+ (props?: OverlayVariantProps): string
30
+ raw: (props?: OverlayVariantProps) => OverlayVariantProps
31
+ variantMap: OverlayVariantMap
32
+ variantKeys: Array<keyof OverlayVariant>
33
+ splitVariantProps<Props extends OverlayVariantProps>(props: Props): [OverlayVariantProps, Pretty<DistributiveOmit<Props, keyof OverlayVariantProps>>]
34
+ getVariantProps: (props?: OverlayVariantProps) => OverlayVariantProps
35
+ }
36
+
37
+ /**
38
+ * Recipe for Overlay Dialog
39
+ */
40
+ export declare const overlay: OverlayRecipe
@@ -0,0 +1,36 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const overlayFn = /* @__PURE__ */ createRecipe('likec4-overlay', {
5
+ "fullscreen": false,
6
+ "withBackdrop": true
7
+ }, [])
8
+
9
+ const overlayVariantMap = {
10
+ "fullscreen": [
11
+ "false",
12
+ "true"
13
+ ],
14
+ "withBackdrop": [
15
+ "false",
16
+ "true"
17
+ ]
18
+ }
19
+
20
+ const overlayVariantKeys = Object.keys(overlayVariantMap)
21
+
22
+ export const overlay = /* @__PURE__ */ Object.assign(memo(overlayFn.recipeFn), {
23
+ __recipe__: true,
24
+ __name__: 'overlay',
25
+ __getCompoundVariantCss__: overlayFn.__getCompoundVariantCss__,
26
+ raw: (props) => props,
27
+ variantKeys: overlayVariantKeys,
28
+ variantMap: overlayVariantMap,
29
+ merge(recipe) {
30
+ return mergeRecipes(this, recipe)
31
+ },
32
+ splitVariantProps(props) {
33
+ return splitProps(props, overlayVariantKeys)
34
+ },
35
+ getVariantProps: overlayFn.getVariantProps,
36
+ })
@@ -9667,6 +9667,18 @@ const tokens = {
9667
9667
  "value": "var(--colors-likec4-panel-border)",
9668
9668
  "variable": "var(--colors-likec4-dropdown-border)"
9669
9669
  },
9670
+ "colors.likec4.overlay.backdrop": {
9671
+ "value": "var(--colors-likec4-overlay-backdrop)",
9672
+ "variable": "var(--colors-likec4-overlay-backdrop)"
9673
+ },
9674
+ "colors.likec4.overlay.body": {
9675
+ "value": "var(--colors-mantine-colors-body)",
9676
+ "variable": "var(--colors-likec4-overlay-body)"
9677
+ },
9678
+ "colors.likec4.overlay.border": {
9679
+ "value": "color-mix(in srgb, var(--colors-mantine-colors-default-border) 50%, transparent)",
9680
+ "variable": "var(--colors-likec4-overlay-border)"
9681
+ },
9670
9682
  "spacing.-0": {
9671
9683
  "value": "calc(var(--spacing-0) * -1)",
9672
9684
  "variable": "var(--spacing-0)"
@@ -11750,6 +11762,22 @@ const tokens = {
11750
11762
  "colors.colorPalette.dropdown.border": {
11751
11763
  "value": "var(--colors-color-palette-dropdown-border)",
11752
11764
  "variable": "var(--colors-color-palette-dropdown-border)"
11765
+ },
11766
+ "colors.colorPalette.overlay.backdrop": {
11767
+ "value": "var(--colors-color-palette-overlay-backdrop)",
11768
+ "variable": "var(--colors-color-palette-overlay-backdrop)"
11769
+ },
11770
+ "colors.colorPalette.backdrop": {
11771
+ "value": "var(--colors-color-palette-backdrop)",
11772
+ "variable": "var(--colors-color-palette-backdrop)"
11773
+ },
11774
+ "colors.colorPalette.overlay.body": {
11775
+ "value": "var(--colors-color-palette-overlay-body)",
11776
+ "variable": "var(--colors-color-palette-overlay-body)"
11777
+ },
11778
+ "colors.colorPalette.overlay.border": {
11779
+ "value": "var(--colors-color-palette-overlay-border)",
11780
+ "variable": "var(--colors-color-palette-overlay-border)"
11753
11781
  }
11754
11782
  }
11755
11783