@alphacifer/slidev-addon-theme 0.0.5 → 0.0.7
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 +163 -2
- package/components/arc-arrow-process/ArcArrowProcess.vue +361 -0
- package/components/arc-arrow-process/ArcArrowProcessArrow.vue +143 -0
- package/components/arc-arrow-process/ArcArrowProcessCallout.vue +361 -0
- package/components/arc-arrow-process/ArcArrowProcessContent.vue +38 -0
- package/components/arc-arrow-process/ArcArrowProcessHeading.vue +43 -0
- package/components/arc-arrow-process/ArcArrowProcessIcon.vue +154 -0
- package/components/arc-compare/ArcCompare.vue +443 -0
- package/components/arc-compare/ArcCompareBadge.vue +63 -0
- package/components/arc-compare/ArcCompareCallout.vue +386 -0
- package/components/arc-compare/ArcCompareContent.vue +52 -0
- package/components/arc-compare/ArcCompareContents.vue +18 -0
- package/components/arc-compare/ArcCompareHeading.vue +52 -0
- package/components/arc-compare/ArcCompareLeft.vue +183 -0
- package/components/arc-compare/ArcCompareRight.vue +183 -0
- package/components/arc-compare/ArcCompareTitle.vue +47 -0
- package/components/arrow-triad/ArrowTriad.vue +368 -0
- package/components/arrow-triad/ArrowTriadCallout.vue +300 -0
- package/components/arrow-triad/ArrowTriadContent.vue +38 -0
- package/components/arrow-triad/ArrowTriadHeading.vue +38 -0
- package/components/arrow-triad/ArrowTriadIcon.vue +96 -0
- package/components/chevron-card/ChevronCard.vue +237 -0
- package/components/chevron-card/ChevronCardBadge.vue +74 -0
- package/components/chevron-card/ChevronCardContent.vue +39 -0
- package/components/chevron-card/ChevronCardHeading.vue +39 -0
- package/components/comparison-table/ComparisonTable.vue +244 -0
- package/components/comparison-table/ComparisonTableCell.vue +88 -0
- package/components/comparison-table/ComparisonTableCol.vue +97 -0
- package/components/comparison-table/ComparisonTableCols.vue +74 -0
- package/components/comparison-table/ComparisonTableRow.vue +92 -0
- package/components/comparison-table/ComparisonTableRows.vue +21 -0
- package/components/hex-triad/HexTriad.vue +438 -0
- package/components/hex-triad/HexTriadBadge.vue +110 -0
- package/components/hex-triad/HexTriadCallout.vue +200 -0
- package/components/hex-triad/HexTriadCenterBadge.vue +51 -0
- package/components/hex-triad/HexTriadContent.vue +20 -0
- package/components/hex-triad/HexTriadHeading.vue +28 -0
- package/components/hex-triad/HexTriadLayer.vue +28 -0
- package/components/horiz-card/HorizCard.vue +318 -0
- package/components/horiz-card/HorizCardBadge.vue +75 -0
- package/components/horiz-card/HorizCardContent.vue +46 -0
- package/components/horiz-card/HorizCardHeading.vue +47 -0
- package/components/horiz-card/HorizCardIcon.vue +118 -0
- package/components/quad-hub/QuadHub.vue +642 -0
- package/components/quad-hub/QuadHubCallout.vue +267 -0
- package/components/quad-hub/QuadHubCenter.vue +53 -0
- package/components/quad-hub/QuadHubContent.vue +39 -0
- package/components/quad-hub/QuadHubHeading.vue +44 -0
- package/components/quad-hub/QuadHubIcon.vue +112 -0
- package/components/shifting-heading/TransitionHeading.vue +2 -2
- package/components/vert-card/VertCard.vue +389 -0
- package/components/vert-card/VertCardBadge.vue +72 -0
- package/components/vert-card/VertCardContent.vue +45 -0
- package/components/vert-card/VertCardHeading.vue +68 -0
- package/components/vert-card/VertCardIcon.vue +126 -0
- package/components/vert-card/VertCardTitle.vue +76 -0
- package/layouts/core/arc-toc.vue +76 -113
- package/layouts/core/bg-center.vue +32 -4
- package/layouts/shifting-heading/shifting-intro.vue +35 -7
- package/package.json +3 -2
- package/utils/arcArrowProcess/context.ts +28 -0
- package/utils/arcArrowProcess/createArcArrowProcessGeometry.ts +137 -0
- package/utils/arcArrowProcess/index.ts +3 -0
- package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +189 -0
- package/utils/arcCompare/context.ts +36 -0
- package/utils/arcCompare/createArcCompareGeometry.ts +254 -0
- package/utils/arcCompare/index.ts +3 -0
- package/utils/arcCompare/resolveArcCompareItems.ts +123 -0
- package/utils/arrowTriad/context.ts +38 -0
- package/utils/arrowTriad/createArrowTriadGeometry.ts +63 -0
- package/utils/arrowTriad/index.ts +3 -0
- package/utils/arrowTriad/resolveArrowTriadItems.ts +121 -0
- package/utils/chevronCard/context.ts +12 -0
- package/utils/chevronCard/createChevronCardGeometry.ts +48 -0
- package/utils/chevronCard/index.ts +2 -0
- package/utils/comparisonTable/constants.ts +72 -0
- package/utils/comparisonTable/context.ts +24 -0
- package/utils/comparisonTable/index.ts +2 -0
- package/utils/hexTriad/context.ts +25 -0
- package/utils/hexTriad/createHexTriadGeometry.ts +182 -0
- package/utils/hexTriad/index.ts +3 -0
- package/utils/hexTriad/resolveHexTriadItems.ts +63 -0
- package/utils/horizCard/context.ts +13 -0
- package/utils/horizCard/createHorizCardGeometry.ts +243 -0
- package/utils/horizCard/index.ts +2 -0
- package/utils/quadHub/context.ts +26 -0
- package/utils/quadHub/createQuadHubGeometry.ts +331 -0
- package/utils/quadHub/index.ts +3 -0
- package/utils/quadHub/resolveQuadHubItems.ts +214 -0
- package/utils/useDiagramAutoScale.ts +300 -0
- package/utils/vertCard/context.ts +18 -0
- package/utils/vertCard/createVertCardGeometry.ts +242 -0
- package/utils/vertCard/index.ts +2 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export interface IArcCompareItem {
|
|
2
|
+
readonly id?: string | number;
|
|
3
|
+
readonly title?: string;
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
readonly color?: string;
|
|
6
|
+
readonly textColor?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IResolvedArcCompareItem {
|
|
10
|
+
readonly id: string | number;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly color: string;
|
|
14
|
+
readonly textColor?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const DEFAULT_LEFT_COLOR = '#e87a36';
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_RIGHT_COLOR = '#208b9e';
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_LOREM_TEXT =
|
|
22
|
+
'Lorem ipsum dolor sit amet, constitutor adipiscing elit. Nam vulputate augue vel ligula.';
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_LEFT_ITEMS: readonly [
|
|
25
|
+
IResolvedArcCompareItem,
|
|
26
|
+
IResolvedArcCompareItem,
|
|
27
|
+
IResolvedArcCompareItem,
|
|
28
|
+
IResolvedArcCompareItem,
|
|
29
|
+
] = [
|
|
30
|
+
{
|
|
31
|
+
id: '01',
|
|
32
|
+
title: 'Add Text Here',
|
|
33
|
+
description: DEFAULT_LOREM_TEXT,
|
|
34
|
+
color: DEFAULT_LEFT_COLOR,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: '02',
|
|
38
|
+
title: 'Add Text Here',
|
|
39
|
+
description: DEFAULT_LOREM_TEXT,
|
|
40
|
+
color: DEFAULT_LEFT_COLOR,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: '03',
|
|
44
|
+
title: 'Add Text Here',
|
|
45
|
+
description: DEFAULT_LOREM_TEXT,
|
|
46
|
+
color: DEFAULT_LEFT_COLOR,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: '04',
|
|
50
|
+
title: 'Add Text Here',
|
|
51
|
+
description: DEFAULT_LOREM_TEXT,
|
|
52
|
+
color: DEFAULT_LEFT_COLOR,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export const DEFAULT_RIGHT_ITEMS: readonly [
|
|
57
|
+
IResolvedArcCompareItem,
|
|
58
|
+
IResolvedArcCompareItem,
|
|
59
|
+
IResolvedArcCompareItem,
|
|
60
|
+
IResolvedArcCompareItem,
|
|
61
|
+
] = [
|
|
62
|
+
{
|
|
63
|
+
id: '01',
|
|
64
|
+
title: 'Add Text Here',
|
|
65
|
+
description: DEFAULT_LOREM_TEXT,
|
|
66
|
+
color: DEFAULT_RIGHT_COLOR,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: '02',
|
|
70
|
+
title: 'Add Text Here',
|
|
71
|
+
description: DEFAULT_LOREM_TEXT,
|
|
72
|
+
color: DEFAULT_RIGHT_COLOR,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: '03',
|
|
76
|
+
title: 'Add Text Here',
|
|
77
|
+
description: DEFAULT_LOREM_TEXT,
|
|
78
|
+
color: DEFAULT_RIGHT_COLOR,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: '04',
|
|
82
|
+
title: 'Add Text Here',
|
|
83
|
+
description: DEFAULT_LOREM_TEXT,
|
|
84
|
+
color: DEFAULT_RIGHT_COLOR,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
export function resolveArcCompareSideItems(
|
|
89
|
+
items?: readonly IArcCompareItem[],
|
|
90
|
+
defaultColor = DEFAULT_LEFT_COLOR,
|
|
91
|
+
count = 3,
|
|
92
|
+
): readonly IResolvedArcCompareItem[] {
|
|
93
|
+
const result: IResolvedArcCompareItem[] = [];
|
|
94
|
+
|
|
95
|
+
for (let i = 0; i < count; i++) {
|
|
96
|
+
const custom = items?.[i];
|
|
97
|
+
const defaultItem =
|
|
98
|
+
defaultColor === DEFAULT_RIGHT_COLOR
|
|
99
|
+
? DEFAULT_RIGHT_ITEMS[i]
|
|
100
|
+
: DEFAULT_LEFT_ITEMS[i];
|
|
101
|
+
|
|
102
|
+
const id =
|
|
103
|
+
custom?.id !== undefined
|
|
104
|
+
? custom.id
|
|
105
|
+
: (defaultItem?.id ?? String(i + 1).padStart(2, '0'));
|
|
106
|
+
|
|
107
|
+
const title = custom?.title ?? defaultItem?.title ?? 'Add Text Here';
|
|
108
|
+
const description =
|
|
109
|
+
custom?.description ?? defaultItem?.description ?? DEFAULT_LOREM_TEXT;
|
|
110
|
+
const color = custom?.color ?? defaultColor;
|
|
111
|
+
const textColor = custom?.textColor ?? defaultItem?.textColor;
|
|
112
|
+
|
|
113
|
+
result.push({
|
|
114
|
+
id,
|
|
115
|
+
title,
|
|
116
|
+
description,
|
|
117
|
+
color,
|
|
118
|
+
textColor,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
import type { IResolvedArrowTriadItem } from './resolveArrowTriadItems';
|
|
4
|
+
|
|
5
|
+
export type TArrowTriadLayout =
|
|
6
|
+
| '2-left-1-right'
|
|
7
|
+
| '1-left-2-right'
|
|
8
|
+
| '2-left'
|
|
9
|
+
| '1-left';
|
|
10
|
+
|
|
11
|
+
export interface IArrowTriadRegistration {
|
|
12
|
+
readonly index: number;
|
|
13
|
+
readonly item: ComputedRef<IResolvedArrowTriadItem>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IArrowTriadRootContext {
|
|
17
|
+
readonly animation: ComputedRef<boolean>;
|
|
18
|
+
readonly layout: ComputedRef<TArrowTriadLayout>;
|
|
19
|
+
readonly registerCallout: () => IArrowTriadRegistration;
|
|
20
|
+
readonly items: ComputedRef<
|
|
21
|
+
readonly [
|
|
22
|
+
IResolvedArrowTriadItem,
|
|
23
|
+
IResolvedArrowTriadItem,
|
|
24
|
+
IResolvedArrowTriadItem,
|
|
25
|
+
]
|
|
26
|
+
>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IArrowTriadCalloutContext {
|
|
30
|
+
readonly item: ComputedRef<IResolvedArrowTriadItem>;
|
|
31
|
+
readonly index: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const ARROW_TRIAD_ROOT_KEY: InjectionKey<IArrowTriadRootContext> =
|
|
35
|
+
Symbol('ARROW_TRIAD_ROOT_KEY');
|
|
36
|
+
|
|
37
|
+
export const ARROW_TRIAD_CALLOUT_KEY: InjectionKey<IArrowTriadCalloutContext> =
|
|
38
|
+
Symbol('ARROW_TRIAD_CALLOUT_KEY');
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface IArrowTriadPathData {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly stemPath: string;
|
|
4
|
+
readonly outerHeadPoints: string;
|
|
5
|
+
readonly innerHeadPoints: string;
|
|
6
|
+
readonly neckLine: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IArrowTriadGeometry {
|
|
10
|
+
readonly viewBoxWidth: number;
|
|
11
|
+
readonly viewBoxHeight: number;
|
|
12
|
+
readonly blueArrow: IArrowTriadPathData;
|
|
13
|
+
readonly yellowArrow: IArrowTriadPathData;
|
|
14
|
+
readonly greenArrow: IArrowTriadPathData;
|
|
15
|
+
readonly dashedArcs: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Precision coordinates and SVG paths for the 3-way curved arrow triad diagram.
|
|
20
|
+
* Directly extracted from the design template (560 x 662):
|
|
21
|
+
* - Equilateral/isosceles triangle arrowheads with symmetrical barb overhangs.
|
|
22
|
+
* - Inset framed inner triangle facets with darker depth stroke.
|
|
23
|
+
* - Clean curved stems meeting at 120-degree central pie junction.
|
|
24
|
+
* - Concentric dashed guide lines centered in each gap.
|
|
25
|
+
*/
|
|
26
|
+
export function createArrowTriadGeometry(): IArrowTriadGeometry {
|
|
27
|
+
return {
|
|
28
|
+
viewBoxWidth: 560,
|
|
29
|
+
viewBoxHeight: 662,
|
|
30
|
+
yellowArrow: {
|
|
31
|
+
path: 'M 526 31 L 429 89 L 437 92 C 431 188, 383 244, 324 281 L 352 329 L 408 329 C 410 260, 435 190, 515 137 L 528 144 Z',
|
|
32
|
+
stemPath:
|
|
33
|
+
'M 352 329 L 408 329 C 410 260, 435 190, 515 137 L 437 92 C 431 188, 383 244, 324 281 Z',
|
|
34
|
+
outerHeadPoints: '429,89 526,31 528,144',
|
|
35
|
+
innerHeadPoints: '447,89 517,47 518,128',
|
|
36
|
+
neckLine: 'M 429 89 L 528 144',
|
|
37
|
+
},
|
|
38
|
+
greenArrow: {
|
|
39
|
+
path: 'M 523 629 L 424 574 L 437 566 C 431 470, 383 414, 324 377 L 352 329 L 408 329 C 410 398, 435 468, 515 521 L 521 516 Z',
|
|
40
|
+
stemPath:
|
|
41
|
+
'M 352 329 L 324 377 C 383 414, 431 470, 437 566 L 515 521 C 435 468, 410 398, 408 329 Z',
|
|
42
|
+
outerHeadPoints: '424,574 523,629 521,516',
|
|
43
|
+
innerHeadPoints: '512,531 514,613 443,573',
|
|
44
|
+
neckLine: 'M 424 574 L 521 516',
|
|
45
|
+
},
|
|
46
|
+
blueArrow: {
|
|
47
|
+
path: 'M 7 327 L 104 269 L 104 284 C 190 327, 263 313, 324 281 L 352 329 L 324 377 C 263 345, 190 331, 104 374 L 106 382 Z',
|
|
48
|
+
stemPath:
|
|
49
|
+
'M 352 329 L 324 281 C 263 313, 190 327, 104 284 L 104 374 C 190 331, 263 345, 324 377 Z',
|
|
50
|
+
outerHeadPoints: '104,269 7,327 106,382',
|
|
51
|
+
innerHeadPoints: '97,367 25,327 95,286',
|
|
52
|
+
neckLine: 'M 104 269 L 106 382',
|
|
53
|
+
},
|
|
54
|
+
dashedArcs: [
|
|
55
|
+
// Blue to Yellow (top-left)
|
|
56
|
+
'M 145 251 C 245 301, 383 221, 389 110',
|
|
57
|
+
// Yellow to Green (right crescent)
|
|
58
|
+
'M 523 189 C 430 250, 430 410, 523 471',
|
|
59
|
+
// Blue to Green (bottom-left)
|
|
60
|
+
'M 144 406 C 243 356, 381 436, 388 547',
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export interface IArrowTriadItem {
|
|
2
|
+
readonly id?: string | number;
|
|
3
|
+
readonly color?: string;
|
|
4
|
+
readonly depthColor?: string;
|
|
5
|
+
readonly title?: string;
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly icon?: string | object | false;
|
|
8
|
+
readonly cardBg?: string;
|
|
9
|
+
readonly textColor?: string;
|
|
10
|
+
readonly titleColor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IResolvedArrowTriadItem {
|
|
14
|
+
readonly id: string | number;
|
|
15
|
+
readonly color: string;
|
|
16
|
+
readonly depthColor: string;
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
readonly icon?: string | object | false;
|
|
20
|
+
readonly cardBg: string;
|
|
21
|
+
readonly textColor: string;
|
|
22
|
+
readonly titleColor: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const defaultItem0: IResolvedArrowTriadItem = {
|
|
26
|
+
id: '01',
|
|
27
|
+
color: '#fec201',
|
|
28
|
+
depthColor: '#d59b01',
|
|
29
|
+
title: 'TITLE TEXT HERE',
|
|
30
|
+
description:
|
|
31
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore',
|
|
32
|
+
icon: undefined,
|
|
33
|
+
cardBg: '#ffffff',
|
|
34
|
+
textColor: '#64748b',
|
|
35
|
+
titleColor: '#1e293b',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const defaultItem1: IResolvedArrowTriadItem = {
|
|
39
|
+
id: '02',
|
|
40
|
+
color: '#71ad49',
|
|
41
|
+
depthColor: '#548235',
|
|
42
|
+
title: 'TITLE TEXT HERE',
|
|
43
|
+
description:
|
|
44
|
+
'Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo cupidatat non proident, sunt',
|
|
45
|
+
icon: undefined,
|
|
46
|
+
cardBg: '#ffffff',
|
|
47
|
+
textColor: '#64748b',
|
|
48
|
+
titleColor: '#1e293b',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const defaultItem2: IResolvedArrowTriadItem = {
|
|
52
|
+
id: '03',
|
|
53
|
+
color: '#5b9bd5',
|
|
54
|
+
depthColor: '#41719c',
|
|
55
|
+
title: 'TITLE TEXT HERE',
|
|
56
|
+
description:
|
|
57
|
+
'Magna aliqua ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo',
|
|
58
|
+
icon: undefined,
|
|
59
|
+
cardBg: '#ffffff',
|
|
60
|
+
textColor: '#64748b',
|
|
61
|
+
titleColor: '#1e293b',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const DEFAULT_ARROW_TRIAD_ITEMS: readonly [
|
|
65
|
+
IResolvedArrowTriadItem,
|
|
66
|
+
IResolvedArrowTriadItem,
|
|
67
|
+
IResolvedArrowTriadItem,
|
|
68
|
+
] = [defaultItem0, defaultItem1, defaultItem2];
|
|
69
|
+
|
|
70
|
+
export function getDefaultArrowTriadItem(
|
|
71
|
+
index: number,
|
|
72
|
+
): IResolvedArrowTriadItem {
|
|
73
|
+
const safe = Math.abs(index) % 3;
|
|
74
|
+
|
|
75
|
+
if (safe === 1) {
|
|
76
|
+
return defaultItem1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (safe === 2) {
|
|
80
|
+
return defaultItem2;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return defaultItem0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function resolveSingleArrowTriadItem(
|
|
87
|
+
item: IArrowTriadItem | undefined,
|
|
88
|
+
fallbackIndex = 0,
|
|
89
|
+
): IResolvedArrowTriadItem {
|
|
90
|
+
const fallback = getDefaultArrowTriadItem(fallbackIndex);
|
|
91
|
+
|
|
92
|
+
if (!item) {
|
|
93
|
+
return fallback;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
id: item.id ?? fallback.id,
|
|
98
|
+
color: item.color ?? fallback.color,
|
|
99
|
+
depthColor: item.depthColor ?? fallback.depthColor,
|
|
100
|
+
title: item.title ?? fallback.title,
|
|
101
|
+
description: item.description ?? fallback.description,
|
|
102
|
+
icon: item.icon !== undefined ? item.icon : fallback.icon,
|
|
103
|
+
cardBg: item.cardBg ?? fallback.cardBg,
|
|
104
|
+
textColor: item.textColor ?? fallback.textColor,
|
|
105
|
+
titleColor: item.titleColor ?? fallback.titleColor,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function resolveArrowTriadItems(
|
|
110
|
+
items?: readonly IArrowTriadItem[],
|
|
111
|
+
): readonly [
|
|
112
|
+
IResolvedArrowTriadItem,
|
|
113
|
+
IResolvedArrowTriadItem,
|
|
114
|
+
IResolvedArrowTriadItem,
|
|
115
|
+
] {
|
|
116
|
+
return [
|
|
117
|
+
resolveSingleArrowTriadItem(items?.[0], 0),
|
|
118
|
+
resolveSingleArrowTriadItem(items?.[1], 1),
|
|
119
|
+
resolveSingleArrowTriadItem(items?.[2], 2),
|
|
120
|
+
];
|
|
121
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface IChevronCardContext {
|
|
4
|
+
readonly step: ComputedRef<string | number>;
|
|
5
|
+
readonly color: ComputedRef<string>;
|
|
6
|
+
readonly cardBg: ComputedRef<string>;
|
|
7
|
+
readonly textColor: ComputedRef<string | undefined>;
|
|
8
|
+
readonly titleColor: ComputedRef<string | undefined>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CHEVRON_CARD_KEY: InjectionKey<IChevronCardContext> =
|
|
12
|
+
Symbol('CHEVRON_CARD_KEY');
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ICreateChevronPathParams {
|
|
2
|
+
readonly width: number;
|
|
3
|
+
readonly height: number;
|
|
4
|
+
readonly notchDepth?: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Generates an SVG path for the chevron badge.
|
|
9
|
+
* Features an indented notched tail on the left and a protruding arrow tip on the right.
|
|
10
|
+
*/
|
|
11
|
+
export function createChevronPath({
|
|
12
|
+
width,
|
|
13
|
+
height,
|
|
14
|
+
notchDepth = 26,
|
|
15
|
+
}: ICreateChevronPathParams): string {
|
|
16
|
+
const safeNotch = Math.max(0, Math.min(notchDepth, width / 2));
|
|
17
|
+
const halfH = height / 2;
|
|
18
|
+
|
|
19
|
+
return `M 0 0 L ${width - safeNotch} 0 L ${width} ${halfH} L ${width - safeNotch} ${height} L 0 ${height} L ${safeNotch} ${halfH} Z`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ICreateChevronCardBodyPathParams {
|
|
23
|
+
readonly width: number;
|
|
24
|
+
readonly height: number;
|
|
25
|
+
readonly notchDepth?: number;
|
|
26
|
+
readonly borderRadius?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Generates an SVG path for the card body container.
|
|
31
|
+
* Left edge matches the chevron notch so slide background shows through;
|
|
32
|
+
* right edge features smooth rounded corners.
|
|
33
|
+
*/
|
|
34
|
+
export function createChevronCardBodyPath({
|
|
35
|
+
width,
|
|
36
|
+
height,
|
|
37
|
+
notchDepth = 26,
|
|
38
|
+
borderRadius = 18,
|
|
39
|
+
}: ICreateChevronCardBodyPathParams): string {
|
|
40
|
+
const safeNotch = Math.max(0, Math.min(notchDepth, width / 2));
|
|
41
|
+
const safeR = Math.max(
|
|
42
|
+
0,
|
|
43
|
+
Math.min(borderRadius, (width - safeNotch) / 2, height / 2),
|
|
44
|
+
);
|
|
45
|
+
const halfH = height / 2;
|
|
46
|
+
|
|
47
|
+
return `M 0 0 L ${width - safeR} 0 A ${safeR} ${safeR} 0 0 1 ${width} ${safeR} L ${width} ${height - safeR} A ${safeR} ${safeR} 0 0 1 ${width - safeR} ${height} L 0 ${height} L ${safeNotch} ${halfH} Z`;
|
|
48
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const DEFAULT_COL_COLORS: readonly string[] = [
|
|
2
|
+
'#354f82',
|
|
3
|
+
'#5b8bb3',
|
|
4
|
+
'#00a8a8',
|
|
5
|
+
'#00b884',
|
|
6
|
+
'#00875a',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_ROW_HEADER_COLOR = '#2e8b9a';
|
|
10
|
+
export const DEFAULT_ROW_HEADER_TEXT_COLOR = '#ffffff';
|
|
11
|
+
export const DEFAULT_COL_HEADER_TEXT_COLOR = '#ffffff';
|
|
12
|
+
export const DEFAULT_CELL_BG = '#d6e5ef';
|
|
13
|
+
export const DEFAULT_CELL_COLOR = '#475569';
|
|
14
|
+
export const DEFAULT_BORDER_RADIUS = '8px';
|
|
15
|
+
export const DEFAULT_SPACING = '6px';
|
|
16
|
+
export const DEFAULT_ROW_HEADER_WIDTH = '160px';
|
|
17
|
+
|
|
18
|
+
export interface IDefaultMockupCol {
|
|
19
|
+
readonly title: string;
|
|
20
|
+
readonly color: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface IDefaultMockupRow {
|
|
24
|
+
readonly title: string;
|
|
25
|
+
readonly cells: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const DEFAULT_MOCKUP_COLS: readonly IDefaultMockupCol[] = [
|
|
29
|
+
{ title: 'COLUMN 1', color: '#354f82' },
|
|
30
|
+
{ title: 'COLUMN 2', color: '#5b8bb3' },
|
|
31
|
+
{ title: 'COLUMN 3', color: '#00a8a8' },
|
|
32
|
+
{ title: 'COLUMN 4', color: '#00b884' },
|
|
33
|
+
{ title: 'COLUMN 5', color: '#00875a' },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const DEFAULT_MOCKUP_ROWS: readonly IDefaultMockupRow[] = [
|
|
37
|
+
{ title: 'ROW 1', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
38
|
+
{ title: 'ROW 2', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
39
|
+
{ title: 'ROW 3', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
40
|
+
{ title: 'ROW 4', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
41
|
+
{ title: 'ROW 5', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
42
|
+
{ title: 'ROW 6', cells: ['TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'] },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Resolves a dimension input (number or string) into a CSS-ready unit string.
|
|
47
|
+
*/
|
|
48
|
+
export function resolveDimension(
|
|
49
|
+
value: number | string | undefined,
|
|
50
|
+
defaultUnit = 'px',
|
|
51
|
+
): string | undefined {
|
|
52
|
+
if (value === undefined || value === null) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (typeof value === 'number') {
|
|
57
|
+
return `${value}${defaultUnit}`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const trimmed = value.trim();
|
|
61
|
+
|
|
62
|
+
if (!trimmed) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// If already contains unit or percentage or calc/var, return as is
|
|
67
|
+
if (/^[+-]?\d+(\.\d+)?$/.test(trimmed)) {
|
|
68
|
+
return `${trimmed}${defaultUnit}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return trimmed;
|
|
72
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface IComparisonTableContext {
|
|
4
|
+
readonly cellBg: ComputedRef<string>;
|
|
5
|
+
readonly cellColor: ComputedRef<string>;
|
|
6
|
+
readonly rowHeaderColor: ComputedRef<string>;
|
|
7
|
+
readonly rowHeaderTextColor: ComputedRef<string>;
|
|
8
|
+
readonly colHeaderTextColor: ComputedRef<string>;
|
|
9
|
+
readonly borderRadius: ComputedRef<string>;
|
|
10
|
+
readonly rowHeaderWidth: ComputedRef<string | undefined>;
|
|
11
|
+
readonly spacing: ComputedRef<string>;
|
|
12
|
+
readonly dense: ComputedRef<boolean>;
|
|
13
|
+
readonly animation: ComputedRef<boolean>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IComparisonTableColsContext {
|
|
17
|
+
readonly registerCol: () => number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const COMPARISON_TABLE_KEY: InjectionKey<IComparisonTableContext> =
|
|
21
|
+
Symbol('COMPARISON_TABLE_KEY');
|
|
22
|
+
|
|
23
|
+
export const COMPARISON_TABLE_COLS_KEY: InjectionKey<IComparisonTableColsContext> =
|
|
24
|
+
Symbol('COMPARISON_TABLE_COLS_KEY');
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
import type { IHexTriadItem } from './resolveHexTriadItems';
|
|
4
|
+
|
|
5
|
+
export interface IHexTriadRootContext {
|
|
6
|
+
readonly animation?: ComputedRef<boolean>;
|
|
7
|
+
readonly items: ComputedRef<readonly IHexTriadItem[]>;
|
|
8
|
+
readonly registerCallout: () => {
|
|
9
|
+
readonly index: number;
|
|
10
|
+
readonly item: ComputedRef<IHexTriadItem>;
|
|
11
|
+
readonly setBadgeText: (text: string | number) => void;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IHexTriadCalloutContext {
|
|
16
|
+
readonly index: number;
|
|
17
|
+
readonly item: ComputedRef<IHexTriadItem>;
|
|
18
|
+
readonly setBadgeText: (text: string | number) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const HEX_TRIAD_ROOT_KEY: InjectionKey<IHexTriadRootContext> =
|
|
22
|
+
Symbol('HEX_TRIAD_ROOT_KEY');
|
|
23
|
+
|
|
24
|
+
export const HEX_TRIAD_CALLOUT_KEY: InjectionKey<IHexTriadCalloutContext> =
|
|
25
|
+
Symbol('HEX_TRIAD_CALLOUT_KEY');
|