@likec4/styles 1.32.2 → 1.34.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 +26 -1
- package/dist/patterns/aspect-ratio.d.ts +0 -1
- package/dist/patterns/bleed.d.ts +0 -1
- package/dist/patterns/box.d.ts +0 -1
- package/dist/patterns/center.d.ts +0 -1
- package/dist/patterns/circle.d.ts +0 -1
- package/dist/patterns/container.d.ts +0 -1
- package/dist/patterns/cq.d.ts +0 -1
- package/dist/patterns/divider.d.ts +0 -1
- package/dist/patterns/flex.d.ts +0 -1
- package/dist/patterns/float.d.ts +0 -1
- package/dist/patterns/grid-item.d.ts +0 -1
- package/dist/patterns/grid.d.ts +0 -1
- package/dist/patterns/hstack.d.ts +0 -1
- package/dist/patterns/link-overlay.d.ts +0 -1
- package/dist/patterns/spacer.d.ts +0 -1
- package/dist/patterns/square.d.ts +0 -1
- package/dist/patterns/stack.d.ts +0 -1
- package/dist/patterns/visually-hidden.d.ts +0 -1
- package/dist/patterns/vstack.d.ts +0 -1
- package/dist/patterns/wrap.d.ts +0 -1
- package/dist/recipes/action-btn.d.ts +0 -2
- package/dist/recipes/index.d.ts +2 -1
- package/dist/recipes/index.mjs +2 -1
- package/dist/recipes/markdown-block.d.ts +31 -0
- package/dist/recipes/markdown-block.mjs +31 -0
- package/dist/styles.css +319 -29
- package/dist/tokens/index.mjs +5 -5
- package/dist/tokens/tokens.d.ts +1 -1
- package/dist/types/conditions.d.ts +6 -6
- package/package.json +18 -9
- package/preset.mjs +252 -16
- package/build.config.ts +0 -32
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.
|
|
4174
|
+
value: "0.833rem"
|
|
4175
4175
|
},
|
|
4176
4176
|
sm: {
|
|
4177
4177
|
description: "LikeC4 style text size: sm",
|
|
4178
|
-
value: "
|
|
4178
|
+
value: "1.00rem"
|
|
4179
4179
|
},
|
|
4180
4180
|
md: {
|
|
4181
4181
|
description: "LikeC4 style text size: md",
|
|
4182
|
-
value: "1.
|
|
4182
|
+
value: "1.20rem"
|
|
4183
4183
|
},
|
|
4184
4184
|
lg: {
|
|
4185
4185
|
description: "LikeC4 style text size: lg",
|
|
4186
|
-
value: "1.
|
|
4186
|
+
value: "1.44rem"
|
|
4187
4187
|
},
|
|
4188
4188
|
xl: {
|
|
4189
4189
|
description: "LikeC4 style text size: xl",
|
|
4190
|
-
value: "
|
|
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
|
-
|
|
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: `[
|
|
6516
|
-
lineHeight: 1.
|
|
6517
|
-
|
|
6518
|
-
|
|
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
|
}
|
|
@@ -6761,9 +6998,8 @@ const index = definePreset({
|
|
|
6761
6998
|
position: "relative",
|
|
6762
6999
|
width: "100%",
|
|
6763
7000
|
height: "100%",
|
|
6764
|
-
padding:
|
|
6765
|
-
margin:
|
|
6766
|
-
boxSizing: "border-box",
|
|
7001
|
+
padding: "0px",
|
|
7002
|
+
margin: "0px",
|
|
6767
7003
|
border: "0px solid transparent"
|
|
6768
7004
|
},
|
|
6769
7005
|
[`${root} .react-flow:is(.not-initialized)`]: {
|
|
@@ -6784,8 +7020,8 @@ const index = definePreset({
|
|
|
6784
7020
|
[`${rootNotReduced} ${nodeOrEdge}:has([data-likec4-dimmed="true"])`]: {
|
|
6785
7021
|
transitionProperty: "opacity, filter",
|
|
6786
7022
|
transitionTimingFunction: "{easings.inOut}",
|
|
6787
|
-
transitionDuration: "
|
|
6788
|
-
transitionDelay:
|
|
7023
|
+
transitionDuration: "600ms"
|
|
7024
|
+
// transitionDelay: '100ms',
|
|
6789
7025
|
},
|
|
6790
7026
|
[`[data-mantine-color-scheme="dark"] ${rootNotReduced} :where(.react-flow__edges, .react-flow__edgelabel-renderer) > svg`]: {
|
|
6791
7027
|
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
|
-
})
|