@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.
Files changed (93) hide show
  1. package/README.md +163 -2
  2. package/components/arc-arrow-process/ArcArrowProcess.vue +361 -0
  3. package/components/arc-arrow-process/ArcArrowProcessArrow.vue +143 -0
  4. package/components/arc-arrow-process/ArcArrowProcessCallout.vue +361 -0
  5. package/components/arc-arrow-process/ArcArrowProcessContent.vue +38 -0
  6. package/components/arc-arrow-process/ArcArrowProcessHeading.vue +43 -0
  7. package/components/arc-arrow-process/ArcArrowProcessIcon.vue +154 -0
  8. package/components/arc-compare/ArcCompare.vue +443 -0
  9. package/components/arc-compare/ArcCompareBadge.vue +63 -0
  10. package/components/arc-compare/ArcCompareCallout.vue +386 -0
  11. package/components/arc-compare/ArcCompareContent.vue +52 -0
  12. package/components/arc-compare/ArcCompareContents.vue +18 -0
  13. package/components/arc-compare/ArcCompareHeading.vue +52 -0
  14. package/components/arc-compare/ArcCompareLeft.vue +183 -0
  15. package/components/arc-compare/ArcCompareRight.vue +183 -0
  16. package/components/arc-compare/ArcCompareTitle.vue +47 -0
  17. package/components/arrow-triad/ArrowTriad.vue +368 -0
  18. package/components/arrow-triad/ArrowTriadCallout.vue +300 -0
  19. package/components/arrow-triad/ArrowTriadContent.vue +38 -0
  20. package/components/arrow-triad/ArrowTriadHeading.vue +38 -0
  21. package/components/arrow-triad/ArrowTriadIcon.vue +96 -0
  22. package/components/chevron-card/ChevronCard.vue +237 -0
  23. package/components/chevron-card/ChevronCardBadge.vue +74 -0
  24. package/components/chevron-card/ChevronCardContent.vue +39 -0
  25. package/components/chevron-card/ChevronCardHeading.vue +39 -0
  26. package/components/comparison-table/ComparisonTable.vue +244 -0
  27. package/components/comparison-table/ComparisonTableCell.vue +88 -0
  28. package/components/comparison-table/ComparisonTableCol.vue +97 -0
  29. package/components/comparison-table/ComparisonTableCols.vue +74 -0
  30. package/components/comparison-table/ComparisonTableRow.vue +92 -0
  31. package/components/comparison-table/ComparisonTableRows.vue +21 -0
  32. package/components/hex-triad/HexTriad.vue +438 -0
  33. package/components/hex-triad/HexTriadBadge.vue +110 -0
  34. package/components/hex-triad/HexTriadCallout.vue +200 -0
  35. package/components/hex-triad/HexTriadCenterBadge.vue +51 -0
  36. package/components/hex-triad/HexTriadContent.vue +20 -0
  37. package/components/hex-triad/HexTriadHeading.vue +28 -0
  38. package/components/hex-triad/HexTriadLayer.vue +28 -0
  39. package/components/horiz-card/HorizCard.vue +318 -0
  40. package/components/horiz-card/HorizCardBadge.vue +75 -0
  41. package/components/horiz-card/HorizCardContent.vue +46 -0
  42. package/components/horiz-card/HorizCardHeading.vue +47 -0
  43. package/components/horiz-card/HorizCardIcon.vue +118 -0
  44. package/components/quad-hub/QuadHub.vue +642 -0
  45. package/components/quad-hub/QuadHubCallout.vue +267 -0
  46. package/components/quad-hub/QuadHubCenter.vue +53 -0
  47. package/components/quad-hub/QuadHubContent.vue +39 -0
  48. package/components/quad-hub/QuadHubHeading.vue +44 -0
  49. package/components/quad-hub/QuadHubIcon.vue +112 -0
  50. package/components/shifting-heading/TransitionHeading.vue +2 -2
  51. package/components/vert-card/VertCard.vue +389 -0
  52. package/components/vert-card/VertCardBadge.vue +72 -0
  53. package/components/vert-card/VertCardContent.vue +45 -0
  54. package/components/vert-card/VertCardHeading.vue +68 -0
  55. package/components/vert-card/VertCardIcon.vue +126 -0
  56. package/components/vert-card/VertCardTitle.vue +76 -0
  57. package/layouts/core/arc-toc.vue +76 -113
  58. package/layouts/core/bg-center.vue +32 -4
  59. package/layouts/shifting-heading/shifting-intro.vue +35 -7
  60. package/package.json +3 -2
  61. package/utils/arcArrowProcess/context.ts +28 -0
  62. package/utils/arcArrowProcess/createArcArrowProcessGeometry.ts +137 -0
  63. package/utils/arcArrowProcess/index.ts +3 -0
  64. package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +189 -0
  65. package/utils/arcCompare/context.ts +36 -0
  66. package/utils/arcCompare/createArcCompareGeometry.ts +254 -0
  67. package/utils/arcCompare/index.ts +3 -0
  68. package/utils/arcCompare/resolveArcCompareItems.ts +123 -0
  69. package/utils/arrowTriad/context.ts +38 -0
  70. package/utils/arrowTriad/createArrowTriadGeometry.ts +63 -0
  71. package/utils/arrowTriad/index.ts +3 -0
  72. package/utils/arrowTriad/resolveArrowTriadItems.ts +121 -0
  73. package/utils/chevronCard/context.ts +12 -0
  74. package/utils/chevronCard/createChevronCardGeometry.ts +48 -0
  75. package/utils/chevronCard/index.ts +2 -0
  76. package/utils/comparisonTable/constants.ts +72 -0
  77. package/utils/comparisonTable/context.ts +24 -0
  78. package/utils/comparisonTable/index.ts +2 -0
  79. package/utils/hexTriad/context.ts +25 -0
  80. package/utils/hexTriad/createHexTriadGeometry.ts +182 -0
  81. package/utils/hexTriad/index.ts +3 -0
  82. package/utils/hexTriad/resolveHexTriadItems.ts +63 -0
  83. package/utils/horizCard/context.ts +13 -0
  84. package/utils/horizCard/createHorizCardGeometry.ts +243 -0
  85. package/utils/horizCard/index.ts +2 -0
  86. package/utils/quadHub/context.ts +26 -0
  87. package/utils/quadHub/createQuadHubGeometry.ts +331 -0
  88. package/utils/quadHub/index.ts +3 -0
  89. package/utils/quadHub/resolveQuadHubItems.ts +214 -0
  90. package/utils/useDiagramAutoScale.ts +300 -0
  91. package/utils/vertCard/context.ts +18 -0
  92. package/utils/vertCard/createVertCardGeometry.ts +242 -0
  93. package/utils/vertCard/index.ts +2 -0
@@ -0,0 +1,331 @@
1
+ export interface IQuadPoint {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ }
5
+
6
+ export interface IQuadBox {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ readonly rx: number;
10
+ readonly width: number;
11
+ readonly height: number;
12
+ }
13
+
14
+ export interface IQuadHubCoordinates {
15
+ readonly centerX: number;
16
+ readonly centerY: number;
17
+ readonly arcPaths: readonly [string, string, string, string];
18
+ readonly arcRadius: number;
19
+ readonly hubRadius: number;
20
+ readonly quadrants: readonly [IQuadBox, IQuadBox, IQuadBox, IQuadBox];
21
+ readonly viewBoxSize: number;
22
+ readonly iconPositions: readonly [
23
+ IQuadPoint,
24
+ IQuadPoint,
25
+ IQuadPoint,
26
+ IQuadPoint,
27
+ ];
28
+ readonly arcBorderWidth: number;
29
+ readonly numberPositions: readonly [
30
+ IQuadPoint,
31
+ IQuadPoint,
32
+ IQuadPoint,
33
+ IQuadPoint,
34
+ ];
35
+ }
36
+
37
+ function createArcPath(
38
+ cx: number,
39
+ cy: number,
40
+ radius: number,
41
+ startAngleDeg: number,
42
+ endAngleDeg: number,
43
+ ): string {
44
+ const startRad = (startAngleDeg * Math.PI) / 180;
45
+ const endRad = (endAngleDeg * Math.PI) / 180;
46
+
47
+ const x1 = Number((cx + radius * Math.cos(startRad)).toFixed(2));
48
+ const y1 = Number((cy + radius * Math.sin(startRad)).toFixed(2));
49
+ const x2 = Number((cx + radius * Math.cos(endRad)).toFixed(2));
50
+ const y2 = Number((cy + radius * Math.sin(endRad)).toFixed(2));
51
+
52
+ const largeArcFlag = Math.abs(endAngleDeg - startAngleDeg) > 180 ? 1 : 0;
53
+
54
+ return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${x2} ${y2}`;
55
+ }
56
+
57
+ export interface ICalculateQuadHubCoordinatesParams {
58
+ readonly gap?: number;
59
+ readonly width?: number;
60
+ readonly height?: number;
61
+ readonly arcRadius?: number;
62
+ readonly hubRadius?: number;
63
+ readonly arcInsetDeg?: number;
64
+ readonly viewBoxSize?: number;
65
+ readonly cornerRadius?: number;
66
+ readonly iconPaddingX?: number;
67
+ readonly iconPaddingY?: number;
68
+ readonly arcBorderWidth?: number;
69
+ }
70
+
71
+ /**
72
+ * Calculates geometric coordinates for the QuadHub layout.
73
+ * Indices (Clockwise starting Top-Left):
74
+ * 0: Top-Left (01)
75
+ * 1: Top-Right (02)
76
+ * 2: Bottom-Right (03)
77
+ * 3: Bottom-Left (04)
78
+ */
79
+ export function calculateQuadHubCoordinates({
80
+ gap = 14,
81
+ width = 136,
82
+ height = 150,
83
+ hubRadius = 58,
84
+ arcRadius = 104,
85
+ arcInsetDeg = 11,
86
+ viewBoxSize = 360,
87
+ cornerRadius = 26,
88
+ iconPaddingX = 30,
89
+ iconPaddingY = 32,
90
+ arcBorderWidth = 5,
91
+ }: ICalculateQuadHubCoordinatesParams = {}): IQuadHubCoordinates {
92
+ const centerX = viewBoxSize / 2;
93
+ const centerY = viewBoxSize / 2;
94
+ const halfGap = gap / 2;
95
+
96
+ // Quadrants:
97
+ // 0: Top-Left (1)
98
+ const q0: IQuadBox = {
99
+ x: centerX - halfGap - width,
100
+ y: centerY - halfGap - height,
101
+ rx: cornerRadius,
102
+ width,
103
+ height,
104
+ };
105
+
106
+ // 1: Top-Right (2)
107
+ const q1: IQuadBox = {
108
+ x: centerX + halfGap,
109
+ y: centerY - halfGap - height,
110
+ rx: cornerRadius,
111
+ width,
112
+ height,
113
+ };
114
+
115
+ // 2: Bottom-Right (3)
116
+ const q2: IQuadBox = {
117
+ x: centerX + halfGap,
118
+ y: centerY + halfGap,
119
+ rx: cornerRadius,
120
+ width,
121
+ height,
122
+ };
123
+
124
+ // 3: Bottom-Left (4)
125
+ const q3: IQuadBox = {
126
+ x: centerX - halfGap - width,
127
+ y: centerY + halfGap,
128
+ rx: cornerRadius,
129
+ width,
130
+ height,
131
+ };
132
+
133
+ // Number positions (centered in the arc ribbon between hubRadius and arcRadius)
134
+ const numberRadius = (hubRadius + arcRadius) / 2;
135
+ const rad = (38 * Math.PI) / 180;
136
+ const offsetX = Number((numberRadius * Math.cos(rad)).toFixed(2));
137
+ const offsetY = Number((numberRadius * Math.sin(rad)).toFixed(2));
138
+
139
+ // 0: Top-Left (1)
140
+ const num0: IQuadPoint = {
141
+ x: centerX - offsetX,
142
+ y: centerY - offsetY,
143
+ };
144
+ // 1: Top-Right (2)
145
+ const num1: IQuadPoint = {
146
+ x: centerX + offsetX,
147
+ y: centerY - offsetY,
148
+ };
149
+ // 2: Bottom-Right (3)
150
+ const num2: IQuadPoint = {
151
+ x: centerX + offsetX,
152
+ y: centerY + offsetY,
153
+ };
154
+ // 3: Bottom-Left (4)
155
+ const num3: IQuadPoint = {
156
+ x: centerX - offsetX,
157
+ y: centerY + offsetY,
158
+ };
159
+
160
+ // Icon positions (in outer corner of each block)
161
+ // 0: Top-Left (1)
162
+ const icon0: IQuadPoint = {
163
+ x: q0.x + iconPaddingX,
164
+ y: q0.y + iconPaddingY,
165
+ };
166
+ // 1: Top-Right (2)
167
+ const icon1: IQuadPoint = {
168
+ x: q1.x + q1.width - iconPaddingX,
169
+ y: q1.y + iconPaddingY,
170
+ };
171
+ // 2: Bottom-Right (3)
172
+ const icon2: IQuadPoint = {
173
+ x: q2.x + q2.width - iconPaddingX,
174
+ y: q2.y + q2.height - iconPaddingY,
175
+ };
176
+ // 3: Bottom-Left (4)
177
+ const icon3: IQuadPoint = {
178
+ x: q3.x + iconPaddingX,
179
+ y: q3.y + q3.height - iconPaddingY,
180
+ };
181
+
182
+ // In SVG, stroke of width W centered on radius R extends [R - W/2, R + W/2].
183
+ // By placing the arc path center at arcRadius + arcBorderWidth / 2, the inner edge
184
+ // of the stroke is exactly arcRadius, touching the pastel circle with zero overlay.
185
+ const arcStrokeRadius = arcRadius + arcBorderWidth / 2;
186
+
187
+ // 0: Top-Left (1)
188
+ const p0 = createArcPath(
189
+ centerX,
190
+ centerY,
191
+ arcStrokeRadius,
192
+ -180 + arcInsetDeg,
193
+ -90 - arcInsetDeg,
194
+ );
195
+ // 1: Top-Right (2)
196
+ const p1 = createArcPath(
197
+ centerX,
198
+ centerY,
199
+ arcStrokeRadius,
200
+ -90 + arcInsetDeg,
201
+ 0 - arcInsetDeg,
202
+ );
203
+ // 2: Bottom-Right (3)
204
+ const p2 = createArcPath(
205
+ centerX,
206
+ centerY,
207
+ arcStrokeRadius,
208
+ 0 + arcInsetDeg,
209
+ 90 - arcInsetDeg,
210
+ );
211
+ // 3: Bottom-Left (4)
212
+ const p3 = createArcPath(
213
+ centerX,
214
+ centerY,
215
+ arcStrokeRadius,
216
+ 90 + arcInsetDeg,
217
+ 180 - arcInsetDeg,
218
+ );
219
+
220
+ return {
221
+ centerX,
222
+ centerY,
223
+ arcPaths: [p0, p1, p2, p3],
224
+ arcRadius,
225
+ hubRadius,
226
+ quadrants: [q0, q1, q2, q3],
227
+ viewBoxSize,
228
+ iconPositions: [icon0, icon1, icon2, icon3],
229
+ arcBorderWidth,
230
+ numberPositions: [num0, num1, num2, num3],
231
+ };
232
+ }
233
+
234
+ export interface ILightenColorParams {
235
+ readonly hex: string;
236
+ readonly ratio?: number;
237
+ }
238
+
239
+ /**
240
+ * Automatically lightens a base hex color by mixing it with white.
241
+ * ratio: 0 = original color, 1 = pure white.
242
+ */
243
+ export function lightenColor({
244
+ hex,
245
+ ratio = 0.5,
246
+ }: ILightenColorParams): string {
247
+ const raw = hex.trim().replace(/^#/, '');
248
+ const sanitized =
249
+ raw.length === 3
250
+ ? raw
251
+ .split('')
252
+ .map((char) => {
253
+ return char + char;
254
+ })
255
+ .join('')
256
+ : raw;
257
+
258
+ if (sanitized.length !== 6) {
259
+ return hex;
260
+ }
261
+
262
+ const r = Number.parseInt(sanitized.slice(0, 2), 16);
263
+ const g = Number.parseInt(sanitized.slice(2, 4), 16);
264
+ const b = Number.parseInt(sanitized.slice(4, 6), 16);
265
+
266
+ if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
267
+ return hex;
268
+ }
269
+
270
+ const clamp = (val: number): number => {
271
+ return Math.min(255, Math.max(0, Math.round(val)));
272
+ };
273
+
274
+ const lr = clamp(r + (255 - r) * ratio);
275
+ const lg = clamp(g + (255 - g) * ratio);
276
+ const lb = clamp(b + (255 - b) * ratio);
277
+
278
+ const toHex = (n: number): string => {
279
+ return n.toString(16).padStart(2, '0');
280
+ };
281
+
282
+ return `#${toHex(lr)}${toHex(lg)}${toHex(lb)}`;
283
+ }
284
+
285
+ export interface IDarkenColorParams {
286
+ readonly hex: string;
287
+ readonly ratio?: number;
288
+ }
289
+
290
+ /**
291
+ * Automatically darkens a base hex color by mixing it with black.
292
+ * ratio: 0 = original color, 1 = pure black.
293
+ */
294
+ export function darkenColor({ hex, ratio = 0.18 }: IDarkenColorParams): string {
295
+ const raw = hex.trim().replace(/^#/, '');
296
+ const sanitized =
297
+ raw.length === 3
298
+ ? raw
299
+ .split('')
300
+ .map((char) => {
301
+ return char + char;
302
+ })
303
+ .join('')
304
+ : raw;
305
+
306
+ if (sanitized.length !== 6) {
307
+ return hex;
308
+ }
309
+
310
+ const r = Number.parseInt(sanitized.slice(0, 2), 16);
311
+ const g = Number.parseInt(sanitized.slice(2, 4), 16);
312
+ const b = Number.parseInt(sanitized.slice(4, 6), 16);
313
+
314
+ if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
315
+ return hex;
316
+ }
317
+
318
+ const clamp = (val: number): number => {
319
+ return Math.min(255, Math.max(0, Math.round(val)));
320
+ };
321
+
322
+ const dr = clamp(r * (1 - ratio));
323
+ const dg = clamp(g * (1 - ratio));
324
+ const db = clamp(b * (1 - ratio));
325
+
326
+ const toHex = (n: number): string => {
327
+ return n.toString(16).padStart(2, '0');
328
+ };
329
+
330
+ return `#${toHex(dr)}${toHex(dg)}${toHex(db)}`;
331
+ }
@@ -0,0 +1,3 @@
1
+ export * from './context';
2
+ export * from './createQuadHubGeometry';
3
+ export * from './resolveQuadHubItems';
@@ -0,0 +1,214 @@
1
+ import { lightenColor } from './createQuadHubGeometry';
2
+
3
+ export type TQuadHubIcon = string | object | boolean;
4
+
5
+ export interface IQuadHubItem {
6
+ readonly id?: string | number;
7
+ /**
8
+ * Optional icon: icon class (e.g. 'i-lucide-user'), component object,
9
+ * built-in name ('user' | 'academic' | 'briefcase' | 'target'), or false to hide.
10
+ */
11
+ readonly icon?: TQuadHubIcon;
12
+ readonly color?: string;
13
+ readonly cardBg?: string;
14
+ readonly arcColor?: string;
15
+ readonly arcRatio?: number;
16
+ readonly textColor?: string;
17
+ readonly titleColor?: string;
18
+ readonly arcBorderColor?: string;
19
+ readonly arcBorderRatio?: number;
20
+ }
21
+
22
+ export interface IResolvedQuadHubItem extends IQuadHubItem {
23
+ readonly id: string | number;
24
+ readonly color: string;
25
+ readonly cardBg: string;
26
+ readonly arcColor: string;
27
+ readonly textColor: string;
28
+ readonly titleColor: string;
29
+ readonly arcBorderColor: string;
30
+ }
31
+
32
+ export const DEFAULT_QUAD_HUB_ITEMS: readonly [
33
+ IResolvedQuadHubItem,
34
+ IResolvedQuadHubItem,
35
+ IResolvedQuadHubItem,
36
+ IResolvedQuadHubItem,
37
+ ] = [
38
+ // 0: Top-Left (01) - Golden Orange
39
+ {
40
+ id: '01',
41
+ icon: 'user',
42
+ color: '#f29e4b',
43
+ cardBg: lightenColor({
44
+ hex: '#f29e4b',
45
+ ratio: 0.9,
46
+ }),
47
+ arcColor: lightenColor({
48
+ hex: '#f29e4b',
49
+ ratio: 0.55,
50
+ }),
51
+ textColor: '#555555',
52
+ titleColor: '#e6882c',
53
+ arcBorderColor: lightenColor({
54
+ hex: '#f29e4b',
55
+ ratio: 0.8,
56
+ }),
57
+ },
58
+ // 1: Top-Right (02) - Fresh Sage Green
59
+ {
60
+ id: '02',
61
+ icon: 'academic',
62
+ color: '#a4cb81',
63
+ cardBg: lightenColor({
64
+ hex: '#a4cb81',
65
+ ratio: 0.9,
66
+ }),
67
+ arcColor: lightenColor({
68
+ hex: '#a4cb81',
69
+ ratio: 0.55,
70
+ }),
71
+ textColor: '#555555',
72
+ titleColor: '#8bb863',
73
+ arcBorderColor: lightenColor({
74
+ hex: '#a4cb81',
75
+ ratio: 0.8,
76
+ }),
77
+ },
78
+ // 2: Bottom-Right (03) - Seafoam Teal
79
+ {
80
+ id: '03',
81
+ icon: 'briefcase',
82
+ color: '#62b6a8',
83
+ cardBg: lightenColor({
84
+ hex: '#62b6a8',
85
+ ratio: 0.9,
86
+ }),
87
+ arcColor: lightenColor({
88
+ hex: '#62b6a8',
89
+ ratio: 0.55,
90
+ }),
91
+ textColor: '#555555',
92
+ titleColor: '#4ea798',
93
+ arcBorderColor: lightenColor({
94
+ hex: '#62b6a8',
95
+ ratio: 0.8,
96
+ }),
97
+ },
98
+ // 3: Bottom-Left (04) - Coral Rose Pink
99
+ {
100
+ id: '04',
101
+ icon: 'target',
102
+ color: '#e9717a',
103
+ cardBg: lightenColor({
104
+ hex: '#e9717a',
105
+ ratio: 0.9,
106
+ }),
107
+ arcColor: lightenColor({
108
+ hex: '#e9717a',
109
+ ratio: 0.55,
110
+ }),
111
+ textColor: '#555555',
112
+ titleColor: '#e45b65',
113
+ arcBorderColor: lightenColor({
114
+ hex: '#e9717a',
115
+ ratio: 0.8,
116
+ }),
117
+ },
118
+ ] as const;
119
+
120
+ export function resolveSingleItem(
121
+ defaultItem: IResolvedQuadHubItem,
122
+ userItem?: IQuadHubItem,
123
+ defaultArcRatio = 0.55,
124
+ defaultArcBorderRatio = 0.8,
125
+ ): IResolvedQuadHubItem {
126
+ const merged = {
127
+ ...defaultItem,
128
+ ...(userItem ?? {}),
129
+ };
130
+
131
+ const baseColor = merged.color ?? defaultItem.color;
132
+ const resolvedArcRatio = merged.arcRatio ?? defaultArcRatio;
133
+ const resolvedArcBorderRatio = merged.arcBorderRatio ?? defaultArcBorderRatio;
134
+
135
+ const isColorChanged = userItem?.color !== undefined;
136
+
137
+ return {
138
+ ...merged,
139
+ id: merged.id ?? defaultItem.id,
140
+ color: baseColor,
141
+ cardBg:
142
+ userItem?.cardBg ??
143
+ (isColorChanged
144
+ ? lightenColor({
145
+ hex: baseColor,
146
+ ratio: 0.9,
147
+ })
148
+ : defaultItem.cardBg),
149
+ arcColor:
150
+ userItem?.arcColor ??
151
+ (isColorChanged || userItem?.arcRatio !== undefined
152
+ ? lightenColor({
153
+ hex: baseColor,
154
+ ratio: resolvedArcRatio,
155
+ })
156
+ : defaultItem.arcColor),
157
+ textColor: merged.textColor ?? defaultItem.textColor,
158
+ titleColor:
159
+ merged.titleColor ??
160
+ (isColorChanged ? baseColor : defaultItem.titleColor),
161
+ arcBorderColor:
162
+ userItem?.arcBorderColor ??
163
+ (isColorChanged || userItem?.arcBorderRatio !== undefined
164
+ ? lightenColor({
165
+ hex: baseColor,
166
+ ratio: resolvedArcBorderRatio,
167
+ })
168
+ : defaultItem.arcBorderColor),
169
+ };
170
+ }
171
+
172
+ export interface IResolveQuadHubItemsParams {
173
+ readonly items?: readonly IQuadHubItem[];
174
+ readonly arcRatio?: number;
175
+ readonly arcBorderRatio?: number;
176
+ }
177
+
178
+ export function resolveQuadHubItems({
179
+ items = [],
180
+ arcRatio = 0.55,
181
+ arcBorderRatio = 0.8,
182
+ }: IResolveQuadHubItemsParams = {}): readonly [
183
+ IResolvedQuadHubItem,
184
+ IResolvedQuadHubItem,
185
+ IResolvedQuadHubItem,
186
+ IResolvedQuadHubItem,
187
+ ] {
188
+ return [
189
+ resolveSingleItem(
190
+ DEFAULT_QUAD_HUB_ITEMS[0],
191
+ items[0],
192
+ arcRatio,
193
+ arcBorderRatio,
194
+ ),
195
+ resolveSingleItem(
196
+ DEFAULT_QUAD_HUB_ITEMS[1],
197
+ items[1],
198
+ arcRatio,
199
+ arcBorderRatio,
200
+ ),
201
+ resolveSingleItem(
202
+ DEFAULT_QUAD_HUB_ITEMS[2],
203
+ items[2],
204
+ arcRatio,
205
+ arcBorderRatio,
206
+ ),
207
+ resolveSingleItem(
208
+ DEFAULT_QUAD_HUB_ITEMS[3],
209
+ items[3],
210
+ arcRatio,
211
+ arcBorderRatio,
212
+ ),
213
+ ] as const;
214
+ }