@likec4/styles 1.41.0 → 1.42.1

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
+ })
@@ -9608,7 +9608,7 @@ const tokens = {
9608
9608
  "variable": "var(--colors-yellow-p3-a-12)"
9609
9609
  },
9610
9610
  "colors.likec4.background": {
9611
- "value": "var(--colors-mantine-colors-body)",
9611
+ "value": "var(--mantine-color-body)",
9612
9612
  "variable": "var(--colors-likec4-background)"
9613
9613
  },
9614
9614
  "colors.likec4.tag.bg": {
@@ -9631,24 +9631,20 @@ const tokens = {
9631
9631
  "value": "var(--colors-likec4-panel-bg)",
9632
9632
  "variable": "var(--colors-likec4-panel-bg)"
9633
9633
  },
9634
- "colors.likec4.panel.bg.whenPanning": {
9635
- "value": "var(--colors-likec4-panel-bg-when-panning)",
9636
- "variable": "var(--colors-likec4-panel-bg-when-panning)"
9637
- },
9638
9634
  "colors.likec4.panel.border": {
9639
9635
  "value": "var(--colors-likec4-panel-border)",
9640
9636
  "variable": "var(--colors-likec4-panel-border)"
9641
9637
  },
9642
9638
  "colors.likec4.panel.action-icon.text": {
9643
- "value": "color-mix(in srgb, var(--colors-mantine-colors-text) 70%, transparent)",
9639
+ "value": "color-mix(in srgb, var(--mantine-color-text) 80%, transparent)",
9644
9640
  "variable": "var(--colors-likec4-panel-action-icon-text)"
9645
9641
  },
9646
9642
  "colors.likec4.panel.action-icon.text.hover": {
9647
- "value": "var(--colors-mantine-colors-text)",
9643
+ "value": "var(--mantine-color-bright)",
9648
9644
  "variable": "var(--colors-likec4-panel-action-icon-text-hover)"
9649
9645
  },
9650
9646
  "colors.likec4.panel.action-icon.text.disabled": {
9651
- "value": "var(--colors-mantine-colors-dimmed)",
9647
+ "value": "var(--mantine-color-dimmed)",
9652
9648
  "variable": "var(--colors-likec4-panel-action-icon-text-disabled)"
9653
9649
  },
9654
9650
  "colors.likec4.panel.action-icon.bg": {
@@ -9667,6 +9663,18 @@ const tokens = {
9667
9663
  "value": "var(--colors-likec4-panel-border)",
9668
9664
  "variable": "var(--colors-likec4-dropdown-border)"
9669
9665
  },
9666
+ "colors.likec4.overlay.backdrop": {
9667
+ "value": "var(--colors-likec4-overlay-backdrop)",
9668
+ "variable": "var(--colors-likec4-overlay-backdrop)"
9669
+ },
9670
+ "colors.likec4.overlay.body": {
9671
+ "value": "var(--mantine-color-body)",
9672
+ "variable": "var(--colors-likec4-overlay-body)"
9673
+ },
9674
+ "colors.likec4.overlay.border": {
9675
+ "value": "color-mix(in srgb, var(--colors-mantine-colors-default-border) 50%, transparent)",
9676
+ "variable": "var(--colors-likec4-overlay-border)"
9677
+ },
9670
9678
  "spacing.-0": {
9671
9679
  "value": "calc(var(--spacing-0) * -1)",
9672
9680
  "variable": "var(--spacing-0)"
@@ -11675,18 +11683,6 @@ const tokens = {
11675
11683
  "value": "var(--colors-color-palette-panel-bg)",
11676
11684
  "variable": "var(--colors-color-palette-panel-bg)"
11677
11685
  },
11678
- "colors.colorPalette.panel.bg.whenPanning": {
11679
- "value": "var(--colors-color-palette-panel-bg-when-panning)",
11680
- "variable": "var(--colors-color-palette-panel-bg-when-panning)"
11681
- },
11682
- "colors.colorPalette.bg.whenPanning": {
11683
- "value": "var(--colors-color-palette-bg-when-panning)",
11684
- "variable": "var(--colors-color-palette-bg-when-panning)"
11685
- },
11686
- "colors.colorPalette.whenPanning": {
11687
- "value": "var(--colors-color-palette-when-panning)",
11688
- "variable": "var(--colors-color-palette-when-panning)"
11689
- },
11690
11686
  "colors.colorPalette.panel.border": {
11691
11687
  "value": "var(--colors-color-palette-panel-border)",
11692
11688
  "variable": "var(--colors-color-palette-panel-border)"
@@ -11750,6 +11746,22 @@ const tokens = {
11750
11746
  "colors.colorPalette.dropdown.border": {
11751
11747
  "value": "var(--colors-color-palette-dropdown-border)",
11752
11748
  "variable": "var(--colors-color-palette-dropdown-border)"
11749
+ },
11750
+ "colors.colorPalette.overlay.backdrop": {
11751
+ "value": "var(--colors-color-palette-overlay-backdrop)",
11752
+ "variable": "var(--colors-color-palette-overlay-backdrop)"
11753
+ },
11754
+ "colors.colorPalette.backdrop": {
11755
+ "value": "var(--colors-color-palette-backdrop)",
11756
+ "variable": "var(--colors-color-palette-backdrop)"
11757
+ },
11758
+ "colors.colorPalette.overlay.body": {
11759
+ "value": "var(--colors-color-palette-overlay-body)",
11760
+ "variable": "var(--colors-color-palette-overlay-body)"
11761
+ },
11762
+ "colors.colorPalette.overlay.border": {
11763
+ "value": "var(--colors-color-palette-overlay-border)",
11764
+ "variable": "var(--colors-color-palette-overlay-border)"
11753
11765
  }
11754
11766
  }
11755
11767