@likec4/styles 1.32.2 → 1.33.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@likec4/styles
2
2
 
3
- Shared utilities for [PandaCSS](https://panda-css.com/)
3
+ Shared preset and generated styles for [PandaCSS](https://panda-css.com/)
4
4
 
5
5
  ## Usage
6
6
 
@@ -1,3 +1,4 @@
1
1
  /* eslint-disable */
2
2
  export * from './action-btn';
3
- export * from './likec4tag';
3
+ export * from './likec4tag';
4
+ export * from './markdown-block';
@@ -1,2 +1,3 @@
1
1
  export * from './action-btn.mjs';
2
- export * from './likec4tag.mjs';
2
+ export * from './likec4tag.mjs';
3
+ export * from './markdown-block.mjs';
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface MarkdownBlockVariant {
6
+ /**
7
+ * @default false
8
+ */
9
+ uselikec4palette: boolean
10
+ }
11
+
12
+ type MarkdownBlockVariantMap = {
13
+ [key in keyof MarkdownBlockVariant]: Array<MarkdownBlockVariant[key]>
14
+ }
15
+
16
+ export type MarkdownBlockVariantProps = {
17
+ [key in keyof MarkdownBlockVariant]?: ConditionalValue<MarkdownBlockVariant[key]> | undefined
18
+ }
19
+
20
+ export interface MarkdownBlockRecipe {
21
+ __type: MarkdownBlockVariantProps
22
+ (props?: MarkdownBlockVariantProps): string
23
+ raw: (props?: MarkdownBlockVariantProps) => MarkdownBlockVariantProps
24
+ variantMap: MarkdownBlockVariantMap
25
+ variantKeys: Array<keyof MarkdownBlockVariant>
26
+ splitVariantProps<Props extends MarkdownBlockVariantProps>(props: Props): [MarkdownBlockVariantProps, Pretty<DistributiveOmit<Props, keyof MarkdownBlockVariantProps>>]
27
+ getVariantProps: (props?: MarkdownBlockVariantProps) => MarkdownBlockVariantProps
28
+ }
29
+
30
+
31
+ export declare const markdownBlock: MarkdownBlockRecipe
@@ -0,0 +1,31 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const markdownBlockFn = /* @__PURE__ */ createRecipe('likec4-markdown-block', {
5
+ "uselikec4palette": false
6
+ }, [])
7
+
8
+ const markdownBlockVariantMap = {
9
+ "uselikec4palette": [
10
+ "true",
11
+ "false"
12
+ ]
13
+ }
14
+
15
+ const markdownBlockVariantKeys = Object.keys(markdownBlockVariantMap)
16
+
17
+ export const markdownBlock = /* @__PURE__ */ Object.assign(memo(markdownBlockFn.recipeFn), {
18
+ __recipe__: true,
19
+ __name__: 'markdownBlock',
20
+ __getCompoundVariantCss__: markdownBlockFn.__getCompoundVariantCss__,
21
+ raw: (props) => props,
22
+ variantKeys: markdownBlockVariantKeys,
23
+ variantMap: markdownBlockVariantMap,
24
+ merge(recipe) {
25
+ return mergeRecipes(this, recipe)
26
+ },
27
+ splitVariantProps(props) {
28
+ return splitProps(props, markdownBlockVariantKeys)
29
+ },
30
+ getVariantProps: markdownBlockFn.getVariantProps,
31
+ })
package/dist/styles.css CHANGED
@@ -86,9 +86,8 @@
86
86
  transition-property: opacity, filter;
87
87
  --transition-easing: var(--easings-in-out);
88
88
  transition-timing-function: var(--easings-in-out);
89
- --transition-duration: 800ms;
90
- transition-duration: 800ms;
91
- transition-delay: 200ms;
89
+ --transition-duration: 600ms;
90
+ transition-duration: 600ms;
92
91
  }
93
92
 
94
93
  [data-mantine-color-scheme="dark"] .likec4-root:not([data-likec4-reduced-graphics]) :where(.react-flow__edges, .react-flow__edgelabel-renderer) > svg {
@@ -174,11 +173,11 @@
174
173
  --font-sizes-md: calc(1rem * var(--mantine-scale));
175
174
  --font-sizes-lg: calc(1.125rem * var(--mantine-scale));
176
175
  --font-sizes-xl: calc(1.25rem * var(--mantine-scale));
177
- --font-sizes-likec4-xs: 0.750rem;
178
- --font-sizes-likec4-sm: 0.875rem;
179
- --font-sizes-likec4-md: 1.19rem;
180
- --font-sizes-likec4-lg: 1.50rem;
181
- --font-sizes-likec4-xl: 2.00rem;
176
+ --font-sizes-likec4-xs: 0.833rem;
177
+ --font-sizes-likec4-sm: 1.00rem;
178
+ --font-sizes-likec4-md: 1.20rem;
179
+ --font-sizes-likec4-lg: 1.44rem;
180
+ --font-sizes-likec4-xl: 1.73rem;
182
181
  --shadows-xs: 0 calc(0.0625rem * var(--mantine-scale)) calc(0.1875rem * var(--mantine-scale)) rgba(0, 0, 0, 0.05), 0 calc(0.0625rem * var(--mantine-scale)) calc(0.125rem * var(--mantine-scale)) rgba(0, 0, 0, 0.1);
183
182
  --shadows-sm: 0 calc(0.0625rem * var(--mantine-scale)) calc(0.1875rem * var(--mantine-scale)) rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 calc(0.625rem * var(--mantine-scale)) calc(0.9375rem * var(--mantine-scale)) calc(-0.3125rem * var(--mantine-scale)), rgba(0, 0, 0, 0.04) 0 calc(0.4375rem * var(--mantine-scale)) calc(0.4375rem * var(--mantine-scale)) calc(-0.3125rem * var(--mantine-scale));
184
183
  --shadows-md: 0 calc(0.0625rem * var(--mantine-scale)) calc(0.1875rem * var(--mantine-scale)) rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 calc(1.25rem * var(--mantine-scale)) calc(1.5625rem * var(--mantine-scale)) calc(-0.3125rem * var(--mantine-scale)), rgba(0, 0, 0, 0.04) 0 calc(0.625rem * var(--mantine-scale)) calc(0.625rem * var(--mantine-scale)) calc(-0.3125rem * var(--mantine-scale));
@@ -3814,6 +3813,242 @@
3814
3813
  .likec4-tag:is(:hover, [data-hover]) {
3815
3814
  background-color: var(--colors-likec4-tag-bg-hover);
3816
3815
  }
3816
+
3817
+ .likec4-markdown-block {
3818
+ pointer-events: all;
3819
+ --text-fz: 1rem;
3820
+ --typography-spacing: calc(0.75 * var(--text-fz) * var(--mantine-scale, 1));
3821
+ --text-fz-sm: calc(var(--text-fz) * var(--mantine-scale) / 1.125);
3822
+ --text-fz-md: calc(var(--text-fz) * var(--mantine-scale));
3823
+ --text-fw-headings: 600;
3824
+ padding-bottom: calc(.5 * var(--typography-spacing) + 1px);
3825
+ font-size: var(--text-fz-md);
3826
+ }
3827
+
3828
+ .likec4-markdown-block :where(h1, h2, h3, h4, h5, h6) {
3829
+ text-wrap: var(--mantine-heading-text-wrap);
3830
+ line-height: 1.5;
3831
+ font-family: var(--mantine-font-family-headings);
3832
+ margin-bottom: var(--typography-spacing);
3833
+ }
3834
+
3835
+ .likec4-markdown-block :where(img) {
3836
+ max-width: 100%;
3837
+ margin-bottom: var(--typography-spacing);
3838
+ }
3839
+
3840
+ .likec4-markdown-block :where(p) {
3841
+ white-space: preserve-breaks;
3842
+ font-size: var(--text-fz-md);
3843
+ margin-top: var(--spacing-0);
3844
+ margin-bottom: var(--typography-spacing);
3845
+ }
3846
+
3847
+ .likec4-markdown-block :where(a) {
3848
+ color: var(--mantine-color-anchor);
3849
+ text-decoration: none;
3850
+ font-size: var(--text-fz-md);
3851
+ font-weight: 500;
3852
+ }
3853
+
3854
+ .likec4-markdown-block :where(a):is(:hover, [data-hover]) {
3855
+ text-decoration: underline;
3856
+ }
3857
+
3858
+ .likec4-markdown-block :where(hr) {
3859
+ margin: var(--typography-spacing);
3860
+ border: var(--borders-none);
3861
+ border-bottom: 1px solid;
3862
+ }
3863
+
3864
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(hr) {
3865
+ border-color: var(--colors-mantine-colors-gray\[3\]);
3866
+ }
3867
+
3868
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(hr) {
3869
+ border-color: var(--colors-mantine-colors-dark\[3\]);
3870
+ }
3871
+
3872
+ .likec4-markdown-block :where(pre) {
3873
+ padding: var(--mantine-spacing-xs);
3874
+ margin: var(--spacing-0);
3875
+ border-radius: var(--mantine-radius-xs);
3876
+ line-height: var(--mantine-line-height);
3877
+ margin-top: var(--mantine-spacing-md);
3878
+ margin-bottom: var(--mantine-spacing-md);
3879
+ overflow-x: auto;
3880
+ font-family: var(--mantine-font-family-monospace);
3881
+ font-size: var(--text-fz-sm);
3882
+ }
3883
+
3884
+ .likec4-markdown-block :where(pre) :where(code) {
3885
+ padding: var(--spacing-0);
3886
+ border-radius: 0;
3887
+ color: inherit;
3888
+ border: 0;
3889
+ background-color: var(--colors-transparent);
3890
+ }
3891
+
3892
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(pre) {
3893
+ background-color: var(--colors-mantine-colors-gray\[0\]);
3894
+ }
3895
+
3896
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(pre) {
3897
+ background-color: var(--colors-mantine-colors-dark\[8\]);
3898
+ }
3899
+
3900
+ .likec4-markdown-block :where(code) {
3901
+ padding: 1px 4px;
3902
+ border-radius: 2px;
3903
+ line-height: var(--line-heights-1);
3904
+ font-family: var(--mantine-font-family-monospace);
3905
+ font-size: var(--text-fz-sm);
3906
+ }
3907
+
3908
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(code) {
3909
+ color: mantine.colors.black;
3910
+ background-color: var(--colors-mantine-colors-gray\[0\]);
3911
+ }
3912
+
3913
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(code) {
3914
+ color: var(--colors-mantine-colors-white);
3915
+ background-color: var(--colors-mantine-colors-dark\[5\]);
3916
+ }
3917
+
3918
+ .likec4-markdown-block :where(ul, ol):not([data-type="taskList"]) {
3919
+ padding-inline-start: var(--typography-spacing);
3920
+ margin-bottom: var(--typography-spacing);
3921
+ list-style-position: outside;
3922
+ }
3923
+
3924
+ .likec4-markdown-block :where(table) {
3925
+ width: 100%;
3926
+ border-collapse: collapse;
3927
+ caption-side: bottom;
3928
+ margin-bottom: var(--mantine-spacing-md);
3929
+ }
3930
+
3931
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(table) {
3932
+ --table-border-color: var(--mantine-color-gray-3);
3933
+ }
3934
+
3935
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(table) {
3936
+ --table-border-color: var(--mantine-color-dark-4);
3937
+ }
3938
+
3939
+ .likec4-markdown-block :where(table) :where(caption) {
3940
+ color: var(--mantine-color-dimmed);
3941
+ margin-top: var(--mantine-spacing-xs);
3942
+ font-size: var(--text-fz-sm);
3943
+ }
3944
+
3945
+ .likec4-markdown-block :where(table) :where(th) {
3946
+ text-align: left;
3947
+ padding: var(--mantine-spacing-xs) var(--mantine-spacing-xs);
3948
+ font-weight: bold;
3949
+ font-size: var(--text-fz-sm);
3950
+ }
3951
+
3952
+ .likec4-markdown-block :where(table) :where(thead th) {
3953
+ border-bottom: 1px solid;
3954
+ border-color: var(--table-border-color);
3955
+ }
3956
+
3957
+ .likec4-markdown-block :where(table) :where(tfoot th) {
3958
+ border-top: 1px solid;
3959
+ border-color: var(--table-border-color);
3960
+ }
3961
+
3962
+ .likec4-markdown-block :where(table) :where(td) {
3963
+ padding: var(--mantine-spacing-xs) var(--mantine-spacing-xs);
3964
+ border-bottom: 1px solid;
3965
+ border-color: var(--table-border-color);
3966
+ font-size: var(--text-fz-sm);
3967
+ }
3968
+
3969
+ .likec4-markdown-block :where(table) :where(tr:last-of-type td) {
3970
+ border-bottom: 0;
3971
+ }
3972
+
3973
+ .likec4-markdown-block :where(blockquote) {
3974
+ margin: var(--spacing-0);
3975
+ border-radius: var(--mantine-radius-sm);
3976
+ padding: var(--spacing-xs);
3977
+ font-size: var(--text-fz-md);
3978
+ line-height: var(--mantine-line-height);
3979
+ }
3980
+
3981
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(blockquote) {
3982
+ background-color: var(--colors-mantine-colors-gray\[1\]);
3983
+ }
3984
+
3985
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(blockquote) {
3986
+ background-color: var(--colors-mantine-colors-dark\[5\]);
3987
+ }
3988
+
3989
+ .likec4-markdown-block :where(blockquote):not(:first-child) {
3990
+ margin-top: var(--typography-spacing);
3991
+ }
3992
+
3993
+ .likec4-markdown-block :first-child {
3994
+ margin-top: var(--spacing-0);
3995
+ }
3996
+
3997
+ .likec4-markdown-block :last-child {
3998
+ margin-bottom: var(--spacing-0);
3999
+ }
4000
+
4001
+ .likec4-markdown-block :is(h1, h2, h3, h4, h5, h6):not(:first-child) {
4002
+ margin-top: var(--typography-spacing);
4003
+ }
4004
+
4005
+ .likec4-markdown-block :is(h1) {
4006
+ font-size: calc(1.476 * var(--text-fz) * var(--mantine-scale, 1));
4007
+ font-weight: var(--text-fw-headings);
4008
+ }
4009
+
4010
+ .likec4-markdown-block :is(h2) {
4011
+ font-size: calc(1.383 * var(--text-fz) * var(--mantine-scale, 1));
4012
+ font-weight: var(--text-fw-headings);
4013
+ }
4014
+
4015
+ .likec4-markdown-block :is(h3) {
4016
+ font-size: calc(1.296 * var(--text-fz) * var(--mantine-scale, 1));
4017
+ font-weight: var(--text-fw-headings);
4018
+ }
4019
+
4020
+ .likec4-markdown-block :is(h4) {
4021
+ font-size: calc(1.215 * var(--text-fz) * var(--mantine-scale, 1));
4022
+ font-weight: var(--text-fw-headings);
4023
+ }
4024
+
4025
+ .likec4-markdown-block :is(h5) {
4026
+ font-size: calc(1.138 * var(--text-fz) * var(--mantine-scale, 1));
4027
+ font-weight: var(--text-fw-headings);
4028
+ }
4029
+
4030
+ .likec4-markdown-block :is(h6) {
4031
+ font-size: calc(1.067 * var(--text-fz) * var(--mantine-scale, 1));
4032
+ font-weight: var(--text-fw-headings);
4033
+ }
4034
+
4035
+ .likec4-markdown-block :where(strong) {
4036
+ font-weight: 500;
4037
+ }
4038
+
4039
+ .likec4-markdown-block :where(mark) {
4040
+ font-size: var(--text-fz-md);
4041
+ }
4042
+
4043
+ [data-mantine-color-scheme="light"] .likec4-markdown-block :where(mark) {
4044
+ color: inherit;
4045
+ background-color: var(--colors-mantine-colors-yellow\[2\]);
4046
+ }
4047
+
4048
+ [data-mantine-color-scheme="dark"] .likec4-markdown-block :where(mark) {
4049
+ color: mantine.colors.black;
4050
+ background-color: var(--colors-mantine-colors-yellow\[5\]);
4051
+ }
3817
4052
  }
3818
4053
 
3819
4054
  .action-btn--size_md {
@@ -3913,6 +4148,62 @@
3913
4148
  .hover\:likec4-tag--autoTextColor_false:is(:hover, [data-hover]) > span {
3914
4149
  color: var(--colors-likec4-tag-text);
3915
4150
  }
4151
+
4152
+ .likec4-markdown-block--uselikec4palette_true {
4153
+ --typography-spacing: calc(0.25rem * var(--mantine-scale, 1));
4154
+ }
4155
+
4156
+ .likec4-markdown-block--uselikec4palette_true :where(a) {
4157
+ --mix-color: color-mix(in srgb, var(--colors-likec4-palette-fill) 45%, transparent);
4158
+ color: var(--mix-color, var(--colors-likec4-palette-fill));
4159
+ mix-blend-mode: difference;
4160
+ }
4161
+
4162
+ .likec4-markdown-block--uselikec4palette_true :where(code) {
4163
+ color: var(--colors-likec4-palette-hi-contrast);
4164
+ --mix-borderColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 85%, transparent);
4165
+ border-color: var(--mix-borderColor, var(--colors-likec4-palette-stroke));
4166
+ --mix-backgroundColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 70%, transparent);
4167
+ background-color: var(--mix-backgroundColor, var(--colors-likec4-palette-stroke));
4168
+ }
4169
+
4170
+ .likec4-markdown-block--uselikec4palette_true :where(strong) {
4171
+ color: color-mix(in srgb , var(--colors-likec4-palette-hi-contrast) 50%, var(--colors-likec4-palette-lo-contrast));
4172
+ }
4173
+
4174
+ .likec4-markdown-block--uselikec4palette_true :where(blockquote) {
4175
+ padding: var(--spacing-2xs);
4176
+ --mix-backgroundColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 65%, transparent);
4177
+ background-color: var(--mix-backgroundColor, var(--colors-likec4-palette-stroke));
4178
+ }
4179
+
4180
+ .hover\:likec4-markdown-block--uselikec4palette_true:is(:hover, [data-hover]) {
4181
+ --typography-spacing: calc(0.25rem * var(--mantine-scale, 1));
4182
+ }
4183
+
4184
+ .hover\:likec4-markdown-block--uselikec4palette_true:is(:hover, [data-hover]) :where(a) {
4185
+ --mix-color: color-mix(in srgb, var(--colors-likec4-palette-fill) 45%, transparent);
4186
+ color: var(--mix-color, var(--colors-likec4-palette-fill));
4187
+ mix-blend-mode: difference;
4188
+ }
4189
+
4190
+ .hover\:likec4-markdown-block--uselikec4palette_true:is(:hover, [data-hover]) :where(code) {
4191
+ color: var(--colors-likec4-palette-hi-contrast);
4192
+ --mix-borderColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 85%, transparent);
4193
+ border-color: var(--mix-borderColor, var(--colors-likec4-palette-stroke));
4194
+ --mix-backgroundColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 70%, transparent);
4195
+ background-color: var(--mix-backgroundColor, var(--colors-likec4-palette-stroke));
4196
+ }
4197
+
4198
+ .hover\:likec4-markdown-block--uselikec4palette_true:is(:hover, [data-hover]) :where(strong) {
4199
+ color: color-mix(in srgb , var(--colors-likec4-palette-hi-contrast) 50%, var(--colors-likec4-palette-lo-contrast));
4200
+ }
4201
+
4202
+ .hover\:likec4-markdown-block--uselikec4palette_true:is(:hover, [data-hover]) :where(blockquote) {
4203
+ padding: var(--spacing-2xs);
4204
+ --mix-backgroundColor: color-mix(in srgb, var(--colors-likec4-palette-stroke) 65%, transparent);
4205
+ background-color: var(--mix-backgroundColor, var(--colors-likec4-palette-stroke));
4206
+ }
3916
4207
  }
3917
4208
 
3918
4209
  @layer utilities{
@@ -44,23 +44,23 @@ const tokens = {
44
44
  "variable": "var(--font-sizes-xl)"
45
45
  },
46
46
  "fontSizes.likec4.xs": {
47
- "value": "0.750rem",
47
+ "value": "0.833rem",
48
48
  "variable": "var(--font-sizes-likec4-xs)"
49
49
  },
50
50
  "fontSizes.likec4.sm": {
51
- "value": "0.875rem",
51
+ "value": "1.00rem",
52
52
  "variable": "var(--font-sizes-likec4-sm)"
53
53
  },
54
54
  "fontSizes.likec4.md": {
55
- "value": "1.19rem",
55
+ "value": "1.20rem",
56
56
  "variable": "var(--font-sizes-likec4-md)"
57
57
  },
58
58
  "fontSizes.likec4.lg": {
59
- "value": "1.50rem",
59
+ "value": "1.44rem",
60
60
  "variable": "var(--font-sizes-likec4-lg)"
61
61
  },
62
62
  "fontSizes.likec4.xl": {
63
- "value": "2.00rem",
63
+ "value": "1.73rem",
64
64
  "variable": "var(--font-sizes-likec4-xl)"
65
65
  },
66
66
  "shadows.xs": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likec4/styles",
3
3
  "license": "MIT",
4
- "version": "1.32.2",
4
+ "version": "1.33.0",
5
5
  "bugs": "https://github.com/likec4/likec4/issues",
6
6
  "homepage": "https://likec4.dev",
7
7
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -11,7 +11,8 @@
11
11
  "dist",
12
12
  "*.mts",
13
13
  "*.mjs",
14
- "*.ts"
14
+ "*.ts",
15
+ "!build.config.ts"
15
16
  ],
16
17
  "publishConfig": {
17
18
  "registry": "https://registry.npmjs.org",
@@ -58,26 +59,34 @@
58
59
  "peerDependencies": {
59
60
  "@pandacss/dev": "^0.53.7"
60
61
  },
62
+ "peerDependenciesMeta": {
63
+ "@pandacss/dev": {
64
+ "optional": true
65
+ }
66
+ },
61
67
  "devDependencies": {
68
+ "@types/node": "~20.19.1",
62
69
  "@pandabox/panda-plugins": "^0.0.8",
63
70
  "@pandabox/utils": "^0.0.5",
64
71
  "@pandabox/unplugin": "^0.2.2",
65
72
  "@types/picomatch": "^4.0.0",
66
- "@types/react": "19.1.5",
67
- "@types/react-dom": "19.1.5",
73
+ "@types/react": "19.1.8",
74
+ "@types/react-dom": "19.1.6",
68
75
  "@pandacss/dev": "^0.53.7",
69
76
  "postcss": "8.5.5",
70
77
  "nano-spawn": "^1.0.2",
71
78
  "unbuild": "3.5.0",
72
79
  "typescript": "5.8.3",
73
- "@likec4/style-preset": "1.32.2",
74
- "@likec4/tsconfig": "1.32.2"
80
+ "@likec4/style-preset": "1.33.0",
81
+ "@likec4/tsconfig": "1.33.0"
75
82
  },
76
83
  "scripts": {
77
84
  "typecheck": "tsc --build --verbose",
78
85
  "build": "unbuild",
79
86
  "generate": "panda codegen && panda cssgen",
80
87
  "emit-pkg": "panda emit-pkg --base dist",
81
- "clean": "pnpm rimraf dist lib"
88
+ "clean": "pnpm rimraf dist lib",
89
+ "pack": "pnpm pack",
90
+ "lint:package": "pnpx publint ./package.tgz"
82
91
  }
83
92
  }
package/preset.mjs CHANGED
@@ -4171,23 +4171,23 @@ const theme$1 = {
4171
4171
  likec4: {
4172
4172
  xs: {
4173
4173
  description: "LikeC4 style text size: xs",
4174
- value: "0.750rem"
4174
+ value: "0.833rem"
4175
4175
  },
4176
4176
  sm: {
4177
4177
  description: "LikeC4 style text size: sm",
4178
- value: "0.875rem"
4178
+ value: "1.00rem"
4179
4179
  },
4180
4180
  md: {
4181
4181
  description: "LikeC4 style text size: md",
4182
- value: "1.19rem"
4182
+ value: "1.20rem"
4183
4183
  },
4184
4184
  lg: {
4185
4185
  description: "LikeC4 style text size: lg",
4186
- value: "1.50rem"
4186
+ value: "1.44rem"
4187
4187
  },
4188
4188
  xl: {
4189
4189
  description: "LikeC4 style text size: xl",
4190
- value: "2.00rem"
4190
+ value: "1.73rem"
4191
4191
  }
4192
4192
  }
4193
4193
  },
@@ -6422,10 +6422,247 @@ const likec4tag = defineRecipe({
6422
6422
  conditions: ["hover"]
6423
6423
  }]
6424
6424
  });
6425
+ const markdownBlock = defineRecipe({
6426
+ className: "likec4-markdown-block",
6427
+ jsx: ["MarkdownBlock"],
6428
+ base: {
6429
+ pointerEvents: "all",
6430
+ "--text-fz": "1rem",
6431
+ "--typography-spacing": "calc(0.75 * var(--text-fz) * var(--mantine-scale, 1))",
6432
+ "--text-fz-sm": "calc(var(--text-fz) * var(--mantine-scale) / 1.125)",
6433
+ "--text-fz-md": "calc(var(--text-fz) * var(--mantine-scale))",
6434
+ "--text-fw-headings": "600",
6435
+ paddingBottom: "calc(.5 * var(--typography-spacing) + 1px)",
6436
+ fontSize: "var(--text-fz-md)",
6437
+ "& :first-child": {
6438
+ marginTop: 0
6439
+ },
6440
+ "& :last-child": {
6441
+ marginBottom: 0
6442
+ },
6443
+ "& :where(h1, h2, h3, h4, h5, h6)": {
6444
+ lineHeight: "1.5",
6445
+ textWrap: "var(--mantine-heading-text-wrap)",
6446
+ fontFamily: "var(--mantine-font-family-headings)",
6447
+ marginBottom: "var(--typography-spacing)"
6448
+ },
6449
+ "& :is(h1, h2, h3, h4, h5, h6):not(:first-child)": {
6450
+ marginTop: "var(--typography-spacing)"
6451
+ },
6452
+ "& :is(h1)": {
6453
+ fontSize: "calc(1.476 * var(--text-fz) * var(--mantine-scale, 1))",
6454
+ fontWeight: "var(--text-fw-headings)"
6455
+ },
6456
+ "& :is(h2)": {
6457
+ fontSize: "calc(1.383 * var(--text-fz) * var(--mantine-scale, 1))",
6458
+ // lineHeight: 'var(--mantine-h2-line-height)',
6459
+ fontWeight: "var(--text-fw-headings)"
6460
+ },
6461
+ "& :is(h3)": {
6462
+ fontSize: "calc(1.296 * var(--text-fz) * var(--mantine-scale, 1))",
6463
+ // lineHeight: 'var(--mantine-h3-line-height)',
6464
+ fontWeight: "var(--text-fw-headings)"
6465
+ },
6466
+ "& :is(h4)": {
6467
+ fontSize: "calc(1.215 * var(--text-fz) * var(--mantine-scale, 1))",
6468
+ // lineHeight: 'var(--mantine-h4-line-height)',
6469
+ fontWeight: "var(--text-fw-headings)"
6470
+ },
6471
+ "& :is(h5)": {
6472
+ fontSize: "calc(1.138 * var(--text-fz) * var(--mantine-scale, 1))",
6473
+ // lineHeight: 'var(--mantine-h4-line-height)',
6474
+ fontWeight: "var(--text-fw-headings)"
6475
+ },
6476
+ "& :is(h6)": {
6477
+ fontSize: "calc(1.067 * var(--text-fz) * var(--mantine-scale, 1))",
6478
+ // lineHeight: 'var(--mantine-h4-line-height)',
6479
+ fontWeight: "var(--text-fw-headings)"
6480
+ },
6481
+ "& :where(img)": {
6482
+ maxWidth: "100%",
6483
+ marginBottom: "var(--typography-spacing)"
6484
+ },
6485
+ "& :where(p)": {
6486
+ fontSize: "var(--text-fz-md)",
6487
+ marginTop: "0",
6488
+ marginBottom: "var(--typography-spacing)",
6489
+ whiteSpace: "preserve-breaks"
6490
+ },
6491
+ "& :where(strong)": {
6492
+ fontWeight: "500"
6493
+ },
6494
+ "& :where(mark)": {
6495
+ fontSize: "var(--text-fz-md)",
6496
+ _light: {
6497
+ backgroundColor: "mantine.colors.yellow[2]",
6498
+ color: "inherit"
6499
+ },
6500
+ _dark: {
6501
+ backgroundColor: "mantine.colors.yellow[5]",
6502
+ color: "mantine.colors.black"
6503
+ }
6504
+ },
6505
+ "& :where(a)": {
6506
+ fontSize: "var(--text-fz-md)",
6507
+ color: "var(--mantine-color-anchor)",
6508
+ textDecoration: "none",
6509
+ fontWeight: "500",
6510
+ _hover: {
6511
+ textDecoration: "underline"
6512
+ }
6513
+ },
6514
+ "& :where(hr)": {
6515
+ margin: "var(--typography-spacing)",
6516
+ border: "none",
6517
+ borderBottom: "1px solid",
6518
+ _light: {
6519
+ borderColor: "mantine.colors.gray[3]"
6520
+ },
6521
+ _dark: {
6522
+ borderColor: "mantine.colors.dark[3]"
6523
+ }
6524
+ },
6525
+ "& :where(pre)": {
6526
+ padding: "var(--mantine-spacing-xs)",
6527
+ lineHeight: "var(--mantine-line-height)",
6528
+ margin: "0",
6529
+ marginTop: "var(--mantine-spacing-md)",
6530
+ marginBottom: "var(--mantine-spacing-md)",
6531
+ overflowX: "auto",
6532
+ fontFamily: "var(--mantine-font-family-monospace)",
6533
+ fontSize: "var(--text-fz-sm)",
6534
+ borderRadius: "var(--mantine-radius-xs)",
6535
+ _light: {
6536
+ backgroundColor: "mantine.colors.gray[0]"
6537
+ },
6538
+ _dark: {
6539
+ backgroundColor: "mantine.colors.dark[8]"
6540
+ },
6541
+ "& :where(code)": {
6542
+ backgroundColor: "transparent",
6543
+ padding: "0",
6544
+ borderRadius: "0",
6545
+ color: "inherit",
6546
+ border: "0"
6547
+ }
6548
+ },
6549
+ "& :where(code)": {
6550
+ lineHeight: "1",
6551
+ padding: "1px 4px",
6552
+ borderRadius: "2px",
6553
+ fontFamily: "var(--mantine-font-family-monospace)",
6554
+ fontSize: "var(--text-fz-sm)",
6555
+ _light: {
6556
+ backgroundColor: "mantine.colors.gray[0]",
6557
+ color: "mantine.colors.black"
6558
+ },
6559
+ _dark: {
6560
+ backgroundColor: "mantine.colors.dark[5]",
6561
+ color: "mantine.colors.white"
6562
+ }
6563
+ },
6564
+ '& :where(ul, ol):not([data-type="taskList"])': {
6565
+ marginBottom: "var(--typography-spacing)",
6566
+ paddingInlineStart: "var(--typography-spacing)",
6567
+ listStylePosition: "outside"
6568
+ },
6569
+ "& :where(table)": {
6570
+ width: "100%",
6571
+ borderCollapse: "collapse",
6572
+ captionSide: "bottom",
6573
+ marginBottom: "var(--mantine-spacing-md)",
6574
+ _light: {
6575
+ ["--table-border-color"]: "var(--mantine-color-gray-3)"
6576
+ },
6577
+ _dark: {
6578
+ ["--table-border-color"]: "var(--mantine-color-dark-4)"
6579
+ },
6580
+ "& :where(caption)": {
6581
+ marginTop: "var(--mantine-spacing-xs)",
6582
+ fontSize: "var(--text-fz-sm)",
6583
+ color: "var(--mantine-color-dimmed)"
6584
+ },
6585
+ "& :where(th)": {
6586
+ textAlign: "left",
6587
+ fontWeight: "bold",
6588
+ fontSize: "var(--text-fz-sm)",
6589
+ padding: "var(--mantine-spacing-xs) var(--mantine-spacing-xs)"
6590
+ },
6591
+ "& :where(thead th)": {
6592
+ borderBottom: "1px solid",
6593
+ borderColor: "var(--table-border-color)"
6594
+ },
6595
+ "& :where(tfoot th)": {
6596
+ borderTop: "1px solid",
6597
+ borderColor: "var(--table-border-color)"
6598
+ },
6599
+ "& :where(td)": {
6600
+ padding: "var(--mantine-spacing-xs) var(--mantine-spacing-xs)",
6601
+ borderBottom: "1px solid",
6602
+ borderColor: "var(--table-border-color)",
6603
+ fontSize: "var(--text-fz-sm)"
6604
+ },
6605
+ "& :where(tr:last-of-type td)": {
6606
+ borderBottom: "0"
6607
+ }
6608
+ },
6609
+ "& :where(blockquote)": {
6610
+ fontSize: "var(--text-fz-md)",
6611
+ lineHeight: "var(--mantine-line-height)",
6612
+ margin: "0",
6613
+ borderRadius: "var(--mantine-radius-sm)",
6614
+ padding: "xs",
6615
+ _light: {
6616
+ backgroundColor: "mantine.colors.gray[1]"
6617
+ },
6618
+ _dark: {
6619
+ backgroundColor: "mantine.colors.dark[5]"
6620
+ },
6621
+ "&:not(:first-child)": {
6622
+ marginTop: "var(--typography-spacing)"
6623
+ }
6624
+ }
6625
+ },
6626
+ variants: {
6627
+ /**
6628
+ * When markdown block is used inside a diagram node, this variant should be used to apply the likec4 palette.
6629
+ */
6630
+ uselikec4palette: {
6631
+ true: {
6632
+ "--typography-spacing": "calc(0.25rem * var(--mantine-scale, 1))",
6633
+ "& :where(a)": {
6634
+ color: "likec4.palette.fill/45",
6635
+ mixBlendMode: "difference"
6636
+ },
6637
+ "& :where(code)": {
6638
+ borderColor: "likec4.palette.stroke/85",
6639
+ color: "likec4.palette.hiContrast",
6640
+ backgroundColor: "likec4.palette.stroke/70"
6641
+ },
6642
+ "& :where(strong)": {
6643
+ color: `color-mix(in srgb , {colors.likec4.palette.hiContrast} 50%, {colors.likec4.palette.loContrast})`
6644
+ },
6645
+ "& :where(blockquote)": {
6646
+ padding: "2xs",
6647
+ backgroundColor: "likec4.palette.stroke/65"
6648
+ }
6649
+ },
6650
+ false: {}
6651
+ }
6652
+ },
6653
+ defaultVariants: {
6654
+ uselikec4palette: false
6655
+ },
6656
+ staticCss: [{
6657
+ uselikec4palette: ["true"],
6658
+ conditions: ["hover"]
6659
+ }]
6660
+ });
6425
6661
  const recipes = {
6426
6662
  __proto__: null,
6427
6663
  actionBtn,
6428
- likec4tag
6664
+ likec4tag,
6665
+ markdownBlock
6429
6666
  };
6430
6667
  const layerStyles = defineLayerStyles({
6431
6668
  likec4: {
@@ -6503,7 +6740,7 @@ const textStyles = defineTextStyles({
6503
6740
  fontWeight: 500,
6504
6741
  fontSize: "[var(--likec4-text-size)]",
6505
6742
  lineHeight: 1.15,
6506
- textWrap: "balance",
6743
+ textWrapStyle: "balance",
6507
6744
  whiteSpace: "preserve-breaks"
6508
6745
  }
6509
6746
  },
@@ -6512,10 +6749,10 @@ const textStyles = defineTextStyles({
6512
6749
  value: {
6513
6750
  fontFamily: "var(--likec4-element-font, {fonts.likec4})",
6514
6751
  fontWeight: 400,
6515
- fontSize: `[calc(var(--likec4-text-size) * 0.74)]`,
6516
- lineHeight: 1.2,
6517
- textWrap: "pretty",
6518
- whiteSpace: "preserve-breaks"
6752
+ fontSize: `[var(--likec4-text-size) * 0.74]`,
6753
+ lineHeight: 1.3,
6754
+ textWrapStyle: "pretty",
6755
+ "--text-fz": `[calc(var(--likec4-text-size) * 0.74)]`
6519
6756
  }
6520
6757
  }
6521
6758
  }
@@ -6784,8 +7021,8 @@ const index = definePreset({
6784
7021
  [`${rootNotReduced} ${nodeOrEdge}:has([data-likec4-dimmed="true"])`]: {
6785
7022
  transitionProperty: "opacity, filter",
6786
7023
  transitionTimingFunction: "{easings.inOut}",
6787
- transitionDuration: "800ms",
6788
- transitionDelay: "200ms"
7024
+ transitionDuration: "600ms"
7025
+ // transitionDelay: '100ms',
6789
7026
  },
6790
7027
  [`[data-mantine-color-scheme="dark"] ${rootNotReduced} :where(.react-flow__edges, .react-flow__edgelabel-renderer) > svg`]: {
6791
7028
  mixBlendMode: "plus-lighter"
package/build.config.ts DELETED
@@ -1,32 +0,0 @@
1
- import spawn from 'nano-spawn'
2
- import { defineBuildConfig } from 'unbuild'
3
-
4
- export default defineBuildConfig({
5
- entries: [
6
- 'preset.ts',
7
- ],
8
- outDir: '.',
9
- clean: false,
10
- stub: false,
11
- declaration: 'node16',
12
- failOnWarn: false,
13
- alias: {
14
- '@likec4/style-preset/src': '@likec4/style-preset',
15
- },
16
- rollup: {
17
- inlineDependencies: true,
18
- dts: {
19
- compilerOptions: {
20
- baseUrl: '.',
21
- paths: {
22
- '@likec4/style-preset/src': ['../style-preset/src/index.ts'],
23
- },
24
- },
25
- },
26
- },
27
- hooks: {
28
- async 'build:before'(ctx) {
29
- await spawn('pnpm', ['generate'])
30
- },
31
- },
32
- })