@alphacifer/slidev-addon-theme 0.0.9 → 0.0.11
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 +133 -75
- package/components/card/chevron-card/ChevronCard.vue +44 -32
- package/components/card/chevron-card/ChevronCardBadge.vue +14 -8
- package/components/card/chevron-card/ChevronCardContent.vue +15 -13
- package/components/card/chevron-card/style.css +12 -0
- package/components/card/{horiz-card/HorizCard.vue → horizontal-card/HorizontalCard.vue} +78 -85
- package/components/card/{horiz-card/HorizCardBadge.vue → horizontal-card/HorizontalCardBadge.vue} +15 -10
- package/components/card/{horiz-card/HorizCardContent.vue → horizontal-card/HorizontalCardContent.vue} +11 -11
- package/components/card/{horiz-card/HorizCardIcon.vue → horizontal-card/HorizontalCardIcon.vue} +24 -38
- package/components/card/horizontal-card/style.css +17 -0
- package/components/card/{vert-card/VertCard.vue → vertical-card/VerticalCard.vue} +80 -103
- package/components/card/{vert-card/VertCardBadge.vue → vertical-card/VerticalCardBadge.vue} +15 -10
- package/components/card/{vert-card/VertCardContent.vue → vertical-card/VerticalCardContent.vue} +13 -12
- package/components/card/{vert-card/VertCardIcon.vue → vertical-card/VerticalCardIcon.vue} +15 -33
- package/components/card/vertical-card/style.css +19 -0
- package/components/comparisons/arc-comparison/ArcComparison.vue +376 -80
- package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonContent.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +9 -4
- package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +39 -63
- package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +9 -8
- package/components/comparisons/arc-comparison/ArcComparisonRight.vue +39 -63
- package/components/comparisons/arc-comparison/style.css +27 -0
- package/components/comparisons/table-comparison/TableComparison.vue +17 -97
- package/components/comparisons/table-comparison/TableComparisonCell.vue +22 -20
- package/components/comparisons/table-comparison/{TableComparisonCol.vue → TableComparisonColumn.vue} +16 -14
- package/components/comparisons/table-comparison/{TableComparisonCols.vue → TableComparisonColumns.vue} +5 -8
- package/components/comparisons/table-comparison/TableComparisonRow.vue +10 -14
- package/components/comparisons/table-comparison/TableComparisonRows.vue +1 -4
- package/components/comparisons/table-comparison/style.css +15 -0
- package/components/core/Date.vue +2 -5
- package/components/core/QnA.vue +1 -1
- package/components/core/Quote.vue +3 -6
- package/components/core/ReflectedTitle.vue +2 -6
- package/components/core/Speaker.vue +5 -10
- package/components/core/TransitionHeading.vue +2 -5
- package/components/core/arc-orbit/ArcOrbit.vue +65 -84
- package/components/core/arc-orbit/ArcOrbitBadge.vue +9 -11
- package/components/core/arc-orbit/ArcOrbitCallout.vue +30 -32
- package/components/core/arc-orbit/ArcOrbitContent.vue +6 -12
- package/components/core/arc-orbit/ArcOrbitHeading.vue +13 -11
- package/components/core/arc-orbit/style.css +20 -0
- package/components/core/style.css +9 -0
- package/components/core/thanks/{ThanksContent.vue → SquareThanks.vue} +36 -31
- package/components/core/thanks/SquareThanksContent.vue +89 -0
- package/components/core/thanks/ThanksOutlineSquare.vue +2 -5
- package/components/core/thanks/ThanksSquare.vue +2 -5
- package/components/core/thanks/style.css +30 -0
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepth.vue +802 -0
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayer.vue +240 -0
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayerHeading.vue +96 -0
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayerPart.vue +501 -0
- package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayerSector.vue +162 -0
- package/components/defense-in-depth/arc-defense-in-depth/style.css +38 -0
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetrad.vue → rectangle-orbit-tetrad/RectangleOrbitTetrad.vue} +66 -63
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradCallout.vue → rectangle-orbit-tetrad/RectangleOrbitTetradCallout.vue} +62 -48
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradCenter.vue +54 -0
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradContent.vue +44 -0
- package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradHeading.vue +27 -0
- package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradIcon.vue → rectangle-orbit-tetrad/RectangleOrbitTetradIcon.vue} +23 -13
- package/components/facets/tetrad/rectangle-orbit-tetrad/style.css +22 -0
- package/components/facets/triad/arrow-triad/ArrowTriad.vue +99 -109
- package/components/facets/triad/arrow-triad/ArrowTriadCallout.vue +31 -59
- package/components/facets/triad/arrow-triad/ArrowTriadContent.vue +18 -13
- package/components/facets/triad/arrow-triad/ArrowTriadHeading.vue +20 -13
- package/components/facets/triad/arrow-triad/ArrowTriadIcon.vue +14 -9
- package/components/facets/triad/arrow-triad/style.css +15 -0
- package/components/facets/triad/gear-triad/GearTriad.vue +73 -64
- package/components/facets/triad/gear-triad/GearTriadCallout.vue +58 -53
- package/components/facets/triad/gear-triad/GearTriadCenter.vue +9 -4
- package/components/facets/triad/gear-triad/GearTriadContent.vue +21 -36
- package/components/facets/triad/gear-triad/GearTriadDetail.vue +92 -0
- package/components/facets/triad/gear-triad/GearTriadDetails.vue +169 -0
- package/components/facets/triad/gear-triad/GearTriadDetailsContent.vue +18 -0
- package/components/facets/triad/gear-triad/GearTriadDetailsHeading.vue +60 -0
- package/components/facets/triad/gear-triad/GearTriadHeading.vue +19 -13
- package/components/facets/triad/gear-triad/GearTriadIcon.vue +22 -9
- package/components/facets/triad/gear-triad/style.css +26 -0
- package/components/facets/triad/{hex-triad/HexTriad.vue → hexagon-triad/HexagonTriad.vue} +81 -63
- package/components/facets/triad/{hex-triad/HexTriadBadge.vue → hexagon-triad/HexagonTriadBadge.vue} +38 -12
- package/components/facets/triad/{hex-triad/HexTriadCallout.vue → hexagon-triad/HexagonTriadCallout.vue} +35 -31
- package/components/facets/triad/hexagon-triad/HexagonTriadCenterBadge.vue +74 -0
- package/components/facets/triad/hexagon-triad/HexagonTriadContent.vue +34 -0
- package/components/facets/triad/hexagon-triad/HexagonTriadHeading.vue +44 -0
- package/components/facets/triad/{hex-triad/HexTriadLayer.vue → hexagon-triad/HexagonTriadLayer.vue} +12 -4
- package/components/facets/triad/hexagon-triad/style.css +22 -0
- package/components/process/arc-arrow-process/ArcArrowProcess.vue +13 -35
- package/components/process/arc-arrow-process/ArcArrowProcessArrow.vue +20 -21
- package/components/process/arc-arrow-process/ArcArrowProcessCallout.vue +30 -71
- package/components/process/arc-arrow-process/ArcArrowProcessContent.vue +18 -13
- package/components/process/arc-arrow-process/ArcArrowProcessHeading.vue +18 -18
- package/components/process/arc-arrow-process/ArcArrowProcessIcon.vue +23 -11
- package/components/process/arc-arrow-process/style.css +20 -0
- package/components/pyramid/circular-pyramid/CircularPyramid.vue +276 -190
- package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +83 -98
- package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +136 -29
- package/components/pyramid/circular-pyramid/CircularPyramidStackHeading.vue +212 -0
- package/components/pyramid/circular-pyramid/style.css +26 -0
- package/components/pyramid/square-pyramid/SquarePyramid.vue +199 -83
- package/components/pyramid/square-pyramid/SquarePyramidStack.vue +87 -95
- package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +138 -27
- package/components/pyramid/square-pyramid/SquarePyramidStackHeading.vue +212 -0
- package/components/pyramid/square-pyramid/style.css +48 -0
- package/components/style.css +35 -0
- package/layouts/core/arc-toc.vue +40 -45
- package/layouts/core/bg-center.vue +7 -6
- package/layouts/core/style.css +17 -0
- package/layouts/shifting-heading/shifting-intro.vue +4 -13
- package/layouts/thanks/thanks.vue +5 -5
- package/package.json +8 -6
- package/style.css +17 -0
- package/uno.config.ts +1 -0
- package/utils/activateOnKeyboard.ts +14 -0
- package/utils/{chevronCard → card/chevron-card}/context.ts +1 -1
- package/utils/card/chevron-card/index.ts +1 -0
- package/utils/card/horizontal-card/context.ts +12 -0
- package/utils/{horizCard/createHorizCardGeometry.ts → card/horizontal-card/createHorizontalCardGeometry.ts} +10 -45
- package/utils/card/horizontal-card/index.ts +2 -0
- package/utils/card/vertical-card/context.ts +19 -0
- package/utils/{vertCard/createVertCardGeometry.ts → card/vertical-card/createVerticalCardGeometry.ts} +9 -130
- package/utils/card/vertical-card/index.ts +2 -0
- package/utils/colors.ts +93 -0
- package/utils/{arcComparison → comparisons/arc-comparison}/context.ts +0 -11
- package/utils/{arcComparison → comparisons/arc-comparison}/createArcComparisonGeometry.ts +1 -1
- package/utils/comparisons/arc-comparison/resolveArcComparisonItems.ts +33 -0
- package/utils/comparisons/table-comparison/constants.ts +47 -0
- package/utils/{tableComparison → comparisons/table-comparison}/context.ts +2 -2
- package/utils/{arcOrbit → core/arc-orbit}/resolveArcOrbitItems.ts +11 -15
- package/utils/defense-in-depth/arc-defense-in-depth/context.ts +113 -0
- package/utils/defense-in-depth/arc-defense-in-depth/createArcDefenseInDepthGeometry.ts +600 -0
- package/utils/defense-in-depth/arc-defense-in-depth/types.ts +144 -0
- package/utils/defense-in-depth/shared/colors.ts +51 -0
- package/utils/defense-in-depth/shared/constants.ts +22 -0
- package/utils/defense-in-depth/shared/types.ts +7 -0
- package/utils/facets/tetrad/rectangle-orbit-tetrad/context.ts +31 -0
- package/utils/{rectOrbitTetrad/createRectOrbitTetradGeometry.ts → facets/tetrad/rectangle-orbit-tetrad/createRectangleOrbitTetradGeometry.ts} +5 -104
- package/utils/facets/tetrad/rectangle-orbit-tetrad/index.ts +3 -0
- package/utils/{rectOrbitTetrad/resolveRectOrbitTetradItems.ts → facets/tetrad/rectangle-orbit-tetrad/resolveRectangleOrbitTetradItems.ts} +41 -49
- package/utils/{arrowTriad → facets/triad/arrow-triad}/resolveArrowTriadItems.ts +27 -28
- package/utils/{gearTriad → facets/triad/gear-triad}/context.ts +5 -5
- package/utils/{gearTriad → facets/triad/gear-triad}/createGearTriadGeometry.ts +2 -0
- package/utils/{gearTriad → facets/triad/gear-triad}/resolveGearTriadItems.ts +23 -24
- package/utils/facets/triad/hexagon-triad/context.ts +25 -0
- package/utils/{hexTriad/createHexTriadGeometry.ts → facets/triad/hexagon-triad/createHexagonTriadGeometry.ts} +11 -27
- package/utils/facets/triad/hexagon-triad/index.ts +3 -0
- package/utils/facets/triad/hexagon-triad/resolveHexagonTriadItems.ts +60 -0
- package/utils/{shiftingHeading → layouts/shifting-heading}/collectShiftingIntroNodes.ts +1 -0
- package/utils/layouts/table-of-contents/calculateTocCenterAlignmentOffset.ts +17 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/calculateTocMarkerPositions.ts +0 -12
- package/utils/{tableOfContents → layouts/table-of-contents}/createTocConnectorPath.ts +11 -5
- package/utils/{mergeUno → merge-uno}/classifyVisual.ts +1 -1
- package/utils/{mergeUno → merge-uno}/collectClassNames.ts +9 -3
- package/utils/process/arc-arrow-process/resolveArcArrowProcessItems.ts +180 -0
- package/utils/pyramid/circular-pyramid/context.ts +1 -4
- package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +6 -10
- package/utils/pyramid/shared/colors.ts +33 -83
- package/utils/pyramid/shared/constants.ts +3 -2
- package/utils/pyramid/shared/types.ts +0 -5
- package/utils/pyramid/square-pyramid/context.ts +1 -4
- package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +6 -10
- package/utils/useDiagramAutoScale.ts +64 -16
- package/utils/useMergedUnoAttrs.ts +9 -5
- package/components/card/chevron-card/ChevronCardHeading.vue +0 -39
- package/components/card/horiz-card/HorizCardHeading.vue +0 -47
- package/components/card/vert-card/VertCardHeading.vue +0 -68
- package/components/card/vert-card/VertCardTitle.vue +0 -76
- package/components/comparisons/arc-comparison/ArcComparisonContents.vue +0 -17
- package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +0 -29
- package/components/core/arc-orbit/ArcOrbitContents.vue +0 -18
- package/components/core/arc-orbit/ArcOrbitTitle.vue +0 -50
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue +0 -53
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue +0 -39
- package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue +0 -44
- package/components/facets/triad/gear-triad/GearTriadContents.vue +0 -111
- package/components/facets/triad/gear-triad/GearTriadDescription.vue +0 -38
- package/components/facets/triad/hex-triad/HexTriadCenterBadge.vue +0 -51
- package/components/facets/triad/hex-triad/HexTriadContent.vue +0 -20
- package/components/facets/triad/hex-triad/HexTriadHeading.vue +0 -28
- package/components/pyramid/circular-pyramid/CircularPyramidStackTitle.vue +0 -138
- package/components/pyramid/square-pyramid/SquarePyramidStackTitle.vue +0 -134
- package/layouts/core/table-of-contents.vue +0 -30
- package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +0 -189
- package/utils/arcComparison/resolveArcComparisonItems.ts +0 -102
- package/utils/chevronCard/createChevronCardGeometry.ts +0 -48
- package/utils/chevronCard/index.ts +0 -2
- package/utils/hexTriad/context.ts +0 -25
- package/utils/hexTriad/index.ts +0 -3
- package/utils/hexTriad/resolveHexTriadItems.ts +0 -63
- package/utils/horizCard/context.ts +0 -13
- package/utils/horizCard/index.ts +0 -2
- package/utils/pyramid/index.ts +0 -3
- package/utils/rectOrbitTetrad/context.ts +0 -31
- package/utils/rectOrbitTetrad/index.ts +0 -3
- package/utils/tableComparison/constants.ts +0 -72
- package/utils/tableOfContents/calculateTocCenterAlignmentOffset.ts +0 -11
- package/utils/vertCard/context.ts +0 -18
- package/utils/vertCard/index.ts +0 -2
- package/utils/{arcComparison → comparisons/arc-comparison}/index.ts +0 -0
- package/utils/{tableComparison → comparisons/table-comparison}/index.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/context.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/createArcOrbitGeometry.ts +0 -0
- package/utils/{arcOrbit → core/arc-orbit}/index.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/context.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/createArrowTriadGeometry.ts +0 -0
- package/utils/{arrowTriad → facets/triad/arrow-triad}/index.ts +0 -0
- package/utils/{gearTriad → facets/triad/gear-triad}/index.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/calculateUniformTocArticleWidth.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/createTocArcPath.ts +0 -0
- package/utils/{tableOfContents → layouts/table-of-contents}/index.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyLayout.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifySimple.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyTypography.ts +0 -0
- package/utils/{mergeUno → merge-uno}/classifyUtility.ts +0 -0
- package/utils/{mergeUno → merge-uno}/index.ts +0 -0
- package/utils/{mergeUno → merge-uno}/mergeClassValues.ts +0 -0
- package/utils/{mergeUno → merge-uno}/splitVariantScope.ts +1 -1
- package/utils/{mergeUno → merge-uno}/types.ts +0 -0
- package/utils/{arcArrowProcess → process/arc-arrow-process}/context.ts +1 -1
- /package/utils/{arcArrowProcess → process/arc-arrow-process}/createArcArrowProcessGeometry.ts +0 -0
- /package/utils/{arcArrowProcess → process/arc-arrow-process}/index.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Dispatch the same click event for Enter and Space on a focused control. */
|
|
2
|
+
export function activateOnKeyboard(event: KeyboardEvent): void {
|
|
3
|
+
if (
|
|
4
|
+
event.target !== event.currentTarget ||
|
|
5
|
+
(event.key !== 'Enter' && event.key !== ' ')
|
|
6
|
+
) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
event.currentTarget?.dispatchEvent(
|
|
12
|
+
new MouseEvent('click', { bubbles: true, cancelable: true }),
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { ComputedRef, InjectionKey } from 'vue';
|
|
|
2
2
|
|
|
3
3
|
export interface IChevronCardContext {
|
|
4
4
|
readonly step: ComputedRef<string | number>;
|
|
5
|
-
readonly color: ComputedRef<string>;
|
|
5
|
+
readonly color: ComputedRef<string | undefined>;
|
|
6
6
|
readonly cardBg: ComputedRef<string>;
|
|
7
7
|
readonly textColor: ComputedRef<string | undefined>;
|
|
8
8
|
readonly titleColor: ComputedRef<string | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type THorizontalCardBadgeVariant = 'outside' | 'none' | 'hidden';
|
|
4
|
+
|
|
5
|
+
export interface IHorizontalCardContext {
|
|
6
|
+
readonly color: ComputedRef<string>;
|
|
7
|
+
readonly step: ComputedRef<string | number>;
|
|
8
|
+
readonly textColor: ComputedRef<string | undefined>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const HORIZ_CARD_KEY: InjectionKey<IHorizontalCardContext> =
|
|
12
|
+
Symbol('HORIZ_CARD');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ICreateHorizontalCardPathParams {
|
|
2
2
|
readonly width: number;
|
|
3
3
|
readonly height: number;
|
|
4
4
|
readonly chamferX?: number;
|
|
@@ -7,7 +7,7 @@ export interface ICreateHorizCardPathParams {
|
|
|
7
7
|
readonly chamferFillet?: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface ICreateHorizontalCardAccentPathParams {
|
|
11
11
|
readonly width: number;
|
|
12
12
|
readonly height: number;
|
|
13
13
|
readonly chamferX?: number;
|
|
@@ -21,7 +21,7 @@ export interface ICreateHorizCardAccentPathParams {
|
|
|
21
21
|
readonly accentBottomFillet?: number;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export interface
|
|
24
|
+
export interface ICreateHorizontalCardBadgePathParams {
|
|
25
25
|
readonly width?: number;
|
|
26
26
|
readonly height?: number;
|
|
27
27
|
readonly topRadius?: number;
|
|
@@ -30,24 +30,19 @@ export interface ICreateHorizCardBadgePathParams {
|
|
|
30
30
|
readonly bottomRadius?: number;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export interface IHexToRgbaParams {
|
|
34
|
-
readonly hex: string;
|
|
35
|
-
readonly alpha?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
33
|
/**
|
|
39
|
-
* Generates an SVG path for the main
|
|
34
|
+
* Generates an SVG path for the main HorizontalCard body.
|
|
40
35
|
* Features rounded top-left, top-right, and bottom-right corners,
|
|
41
36
|
* and a smooth filleted chamfer at the bottom-left corner matching the design.
|
|
42
37
|
*/
|
|
43
|
-
export function
|
|
38
|
+
export function createHorizontalCardPath({
|
|
44
39
|
width,
|
|
45
40
|
height,
|
|
46
41
|
chamferX = Math.min(60, Math.round(width * 0.17)),
|
|
47
42
|
chamferY = Math.min(76, Math.round(height * 0.29)),
|
|
48
43
|
borderRadius = 24,
|
|
49
44
|
chamferFillet = 22,
|
|
50
|
-
}:
|
|
45
|
+
}: ICreateHorizontalCardPathParams): string {
|
|
51
46
|
const safeR = Math.max(
|
|
52
47
|
0,
|
|
53
48
|
Math.min(borderRadius, width / 2, (height - chamferY) / 2),
|
|
@@ -87,7 +82,7 @@ export function createHorizCardPath({
|
|
|
87
82
|
* (a top fillet and a bottom fillet) flanking the diagonal segment, perfectly mirroring
|
|
88
83
|
* the white card's dual filleted transitions.
|
|
89
84
|
*/
|
|
90
|
-
export function
|
|
85
|
+
export function createHorizontalCardAccentPath({
|
|
91
86
|
width,
|
|
92
87
|
height,
|
|
93
88
|
chamferX = Math.min(60, Math.round(width * 0.17)),
|
|
@@ -99,7 +94,7 @@ export function createHorizCardAccentPath({
|
|
|
99
94
|
accentThickness = 16,
|
|
100
95
|
accentTopFillet = 22,
|
|
101
96
|
accentBottomFillet = 22,
|
|
102
|
-
}:
|
|
97
|
+
}: ICreateHorizontalCardAccentPathParams): string {
|
|
103
98
|
const diagLen = Math.hypot(chamferX, chamferY);
|
|
104
99
|
const ux = diagLen > 0 ? chamferX / diagLen : 0;
|
|
105
100
|
const uy = diagLen > 0 ? chamferY / diagLen : 0;
|
|
@@ -171,14 +166,14 @@ export function createHorizCardAccentPath({
|
|
|
171
166
|
* 4. Bottom-Center pointed tip curve
|
|
172
167
|
* 5. Bottom-Left rounded corner
|
|
173
168
|
*/
|
|
174
|
-
export function
|
|
169
|
+
export function createHorizontalCardBadgePath({
|
|
175
170
|
width = 84,
|
|
176
171
|
height = 58,
|
|
177
172
|
topRadius = 12,
|
|
178
173
|
tipRadius = 8,
|
|
179
174
|
sideHeight = 46,
|
|
180
175
|
bottomRadius = 8,
|
|
181
|
-
}:
|
|
176
|
+
}: ICreateHorizontalCardBadgePathParams = {}): string {
|
|
182
177
|
const halfW = width / 2;
|
|
183
178
|
const dx = halfW;
|
|
184
179
|
const dy = height - sideHeight;
|
|
@@ -211,33 +206,3 @@ export function createHorizCardBadgePath({
|
|
|
211
206
|
'Z',
|
|
212
207
|
].join(' ');
|
|
213
208
|
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Converts a hex color string to an RGBA string with the given alpha transparency.
|
|
217
|
-
*/
|
|
218
|
-
export function hexToRgba({ hex, alpha = 0.15 }: IHexToRgbaParams): string {
|
|
219
|
-
let sanitized = hex.trim().replace(/^#/, '');
|
|
220
|
-
|
|
221
|
-
if (sanitized.length === 3) {
|
|
222
|
-
sanitized = sanitized
|
|
223
|
-
.split('')
|
|
224
|
-
.map((char) => {
|
|
225
|
-
return char + char;
|
|
226
|
-
})
|
|
227
|
-
.join('');
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (sanitized.length !== 6) {
|
|
231
|
-
return hex;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const r = Number.parseInt(sanitized.slice(0, 2), 16);
|
|
235
|
-
const g = Number.parseInt(sanitized.slice(2, 4), 16);
|
|
236
|
-
const b = Number.parseInt(sanitized.slice(4, 6), 16);
|
|
237
|
-
|
|
238
|
-
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
239
|
-
return hex;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
243
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type TVerticalCardBadgeVariant =
|
|
4
|
+
| 'outside'
|
|
5
|
+
| 'inside'
|
|
6
|
+
| 'none'
|
|
7
|
+
| 'hidden';
|
|
8
|
+
|
|
9
|
+
export interface IVerticalCardContext {
|
|
10
|
+
readonly color: ComputedRef<string>;
|
|
11
|
+
readonly cardBg: ComputedRef<string>;
|
|
12
|
+
readonly hasDivider?: ComputedRef<boolean>;
|
|
13
|
+
readonly step: ComputedRef<string | number>;
|
|
14
|
+
readonly textColor: ComputedRef<string | undefined>;
|
|
15
|
+
readonly badgeVariant: ComputedRef<TVerticalCardBadgeVariant>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const VERT_CARD_KEY: InjectionKey<IVerticalCardContext> =
|
|
19
|
+
Symbol('VERT_CARD');
|
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
readonly width: number;
|
|
3
|
-
readonly height: number;
|
|
4
|
-
readonly borderRadius?: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generates an SVG path for the main VertCard body.
|
|
9
|
-
* Features rounded corners on all four sides.
|
|
10
|
-
*/
|
|
11
|
-
export function createVertCardPath({
|
|
12
|
-
width,
|
|
13
|
-
height,
|
|
14
|
-
borderRadius = 24,
|
|
15
|
-
}: ICreateVertCardPathParams): string {
|
|
16
|
-
const safeR = Math.max(0, Math.min(borderRadius, width / 2, height / 2));
|
|
17
|
-
|
|
18
|
-
return [
|
|
19
|
-
`M ${safeR} 0`,
|
|
20
|
-
`H ${width - safeR}`,
|
|
21
|
-
`A ${safeR} ${safeR} 0 0 1 ${width} ${safeR}`,
|
|
22
|
-
`V ${height - safeR}`,
|
|
23
|
-
`A ${safeR} ${safeR} 0 0 1 ${width - safeR} ${height}`,
|
|
24
|
-
`H ${safeR}`,
|
|
25
|
-
`A ${safeR} ${safeR} 0 0 1 0 ${height - safeR}`,
|
|
26
|
-
`V ${safeR}`,
|
|
27
|
-
`A ${safeR} ${safeR} 0 0 1 ${safeR} 0`,
|
|
28
|
-
'Z',
|
|
29
|
-
].join(' ');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ICreateVertCardBottomBlobPathParams {
|
|
1
|
+
export interface ICreateVerticalCardBottomBlobPathParams {
|
|
33
2
|
readonly width: number;
|
|
34
3
|
readonly height: number;
|
|
35
4
|
readonly blobWidth?: number;
|
|
@@ -42,13 +11,13 @@ export interface ICreateVertCardBottomBlobPathParams {
|
|
|
42
11
|
* Curves down smoothly from the left edge into the bottom horizontal edge,
|
|
43
12
|
* adhering to the bottom-left rounded corner of the card.
|
|
44
13
|
*/
|
|
45
|
-
export function
|
|
14
|
+
export function createVerticalCardBottomBlobPath({
|
|
46
15
|
width,
|
|
47
16
|
height,
|
|
48
17
|
borderRadius = 24,
|
|
49
18
|
blobWidth = Math.round(width * 0.45),
|
|
50
19
|
blobHeight = Math.round(height * 0.24),
|
|
51
|
-
}:
|
|
20
|
+
}: ICreateVerticalCardBottomBlobPathParams): string {
|
|
52
21
|
const safeR = Math.max(0, Math.min(borderRadius, width / 2, height / 2));
|
|
53
22
|
const startY = height - blobHeight;
|
|
54
23
|
const endX = blobWidth;
|
|
@@ -68,7 +37,7 @@ export function createVertCardBottomBlobPath({
|
|
|
68
37
|
].join(' ');
|
|
69
38
|
}
|
|
70
39
|
|
|
71
|
-
export interface
|
|
40
|
+
export interface ICreateVerticalCardTopRightBlobPathParams {
|
|
72
41
|
readonly width: number;
|
|
73
42
|
readonly height: number;
|
|
74
43
|
readonly blobWidth?: number;
|
|
@@ -80,13 +49,13 @@ export interface ICreateVertCardTopRightBlobPathParams {
|
|
|
80
49
|
* Generates an SVG path for the organic accent blob/wave at the top-right corner.
|
|
81
50
|
* Symmetrical counterpart (180° rotation) to the bottom-left organic blob.
|
|
82
51
|
*/
|
|
83
|
-
export function
|
|
52
|
+
export function createVerticalCardTopRightBlobPath({
|
|
84
53
|
width,
|
|
85
54
|
height,
|
|
86
55
|
borderRadius = 24,
|
|
87
56
|
blobWidth = Math.round(width * 0.45),
|
|
88
57
|
blobHeight = Math.round(height * 0.24),
|
|
89
|
-
}:
|
|
58
|
+
}: ICreateVerticalCardTopRightBlobPathParams): string {
|
|
90
59
|
const safeR = Math.max(0, Math.min(borderRadius, width / 2, height / 2));
|
|
91
60
|
const startX = width - blobWidth;
|
|
92
61
|
const endY = blobHeight;
|
|
@@ -106,52 +75,7 @@ export function createVertCardTopRightBlobPath({
|
|
|
106
75
|
].join(' ');
|
|
107
76
|
}
|
|
108
77
|
|
|
109
|
-
export interface
|
|
110
|
-
readonly width: number;
|
|
111
|
-
readonly outerOffset?: number;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Generates an SVG path for the top-right diagonal outer accent band.
|
|
116
|
-
*/
|
|
117
|
-
export function createVertCardTopRightOuterStripePath({
|
|
118
|
-
width,
|
|
119
|
-
outerOffset = 72,
|
|
120
|
-
}: ICreateVertCardTopRightOuterStripePathParams): string {
|
|
121
|
-
return [
|
|
122
|
-
`M ${width - outerOffset} 0`,
|
|
123
|
-
`L ${width} ${outerOffset}`,
|
|
124
|
-
`L ${width} 0`,
|
|
125
|
-
'Z',
|
|
126
|
-
].join(' ');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface ICreateVertCardTopRightInnerStripePathParams {
|
|
130
|
-
readonly width: number;
|
|
131
|
-
readonly outerOffset?: number;
|
|
132
|
-
readonly stripeWidth?: number;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Generates an SVG path for the top-right diagonal inner accent band.
|
|
137
|
-
*/
|
|
138
|
-
export function createVertCardTopRightInnerStripePath({
|
|
139
|
-
width,
|
|
140
|
-
outerOffset = 72,
|
|
141
|
-
stripeWidth = 24,
|
|
142
|
-
}: ICreateVertCardTopRightInnerStripePathParams): string {
|
|
143
|
-
const innerOffset = outerOffset + stripeWidth;
|
|
144
|
-
|
|
145
|
-
return [
|
|
146
|
-
`M ${width - innerOffset} 0`,
|
|
147
|
-
`L ${width} ${innerOffset}`,
|
|
148
|
-
`L ${width} ${outerOffset}`,
|
|
149
|
-
`L ${width - outerOffset} 0`,
|
|
150
|
-
'Z',
|
|
151
|
-
].join(' ');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface ICreateVertCardBadgePathParams {
|
|
78
|
+
export interface ICreateVerticalCardBadgePathParams {
|
|
155
79
|
readonly width?: number;
|
|
156
80
|
readonly height?: number;
|
|
157
81
|
readonly tipRadius?: number;
|
|
@@ -165,14 +89,14 @@ export interface ICreateVertCardBadgePathParams {
|
|
|
165
89
|
* Features rounded corners on the left edge, smooth transition fillets,
|
|
166
90
|
* and a rounded arrow tip pointing into the card.
|
|
167
91
|
*/
|
|
168
|
-
export function
|
|
92
|
+
export function createVerticalCardBadgePath({
|
|
169
93
|
width = 62,
|
|
170
94
|
height = 48,
|
|
171
95
|
leftRadius = 8,
|
|
172
96
|
tipRadius = 6,
|
|
173
97
|
sideWidth = 42,
|
|
174
98
|
cornerRadius = 6,
|
|
175
|
-
}:
|
|
99
|
+
}: ICreateVerticalCardBadgePathParams = {}): string {
|
|
176
100
|
const halfH = height / 2;
|
|
177
101
|
const dx = width - sideWidth;
|
|
178
102
|
const dy = halfH;
|
|
@@ -195,48 +119,3 @@ export function createVertCardBadgePath({
|
|
|
195
119
|
'Z',
|
|
196
120
|
].join(' ');
|
|
197
121
|
}
|
|
198
|
-
|
|
199
|
-
export interface IHexToRgbaParams {
|
|
200
|
-
readonly hex: string;
|
|
201
|
-
readonly alpha?: number;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Converts a hex color string to an RGBA string with the given alpha transparency.
|
|
206
|
-
*/
|
|
207
|
-
export function hexToRgba({ hex, alpha = 0.16 }: IHexToRgbaParams): string {
|
|
208
|
-
const trimmed = hex.trim();
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
trimmed.startsWith('var(') ||
|
|
212
|
-
trimmed.startsWith('rgb') ||
|
|
213
|
-
trimmed.startsWith('hsl')
|
|
214
|
-
) {
|
|
215
|
-
return `color-mix(in srgb, ${trimmed} ${Math.round(alpha * 100)}%, transparent)`;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
let sanitized = trimmed.replace(/^#/, '');
|
|
219
|
-
|
|
220
|
-
if (sanitized.length === 3) {
|
|
221
|
-
sanitized = sanitized
|
|
222
|
-
.split('')
|
|
223
|
-
.map((char) => {
|
|
224
|
-
return char + char;
|
|
225
|
-
})
|
|
226
|
-
.join('');
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (sanitized.length !== 6) {
|
|
230
|
-
return hex;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const r = Number.parseInt(sanitized.slice(0, 2), 16);
|
|
234
|
-
const g = Number.parseInt(sanitized.slice(2, 4), 16);
|
|
235
|
-
const b = Number.parseInt(sanitized.slice(4, 6), 16);
|
|
236
|
-
|
|
237
|
-
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
|
|
238
|
-
return hex;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
242
|
-
}
|
package/utils/colors.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface IColorModifierParams {
|
|
2
|
+
readonly hex: string;
|
|
3
|
+
readonly ratio?: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface IModifyColorParams extends IColorModifierParams {
|
|
7
|
+
readonly target: 'white' | 'black';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface IRgbColor {
|
|
11
|
+
readonly red: number;
|
|
12
|
+
readonly green: number;
|
|
13
|
+
readonly blue: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function parseHexColor(hex: string): IRgbColor | undefined {
|
|
17
|
+
const raw = hex.trim().replace(/^#/, '');
|
|
18
|
+
const sanitized =
|
|
19
|
+
raw.length === 3
|
|
20
|
+
? raw
|
|
21
|
+
.split('')
|
|
22
|
+
.map((character) => {
|
|
23
|
+
return character + character;
|
|
24
|
+
})
|
|
25
|
+
.join('')
|
|
26
|
+
: raw;
|
|
27
|
+
|
|
28
|
+
if (sanitized.length !== 6) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const red = Number.parseInt(sanitized.slice(0, 2), 16);
|
|
33
|
+
const green = Number.parseInt(sanitized.slice(2, 4), 16);
|
|
34
|
+
const blue = Number.parseInt(sanitized.slice(4, 6), 16);
|
|
35
|
+
|
|
36
|
+
if ([red, green, blue].some(Number.isNaN)) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
red,
|
|
42
|
+
green,
|
|
43
|
+
blue,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function formatHexChannel(channel: number): string {
|
|
48
|
+
return Math.min(255, Math.max(0, Math.round(channel)))
|
|
49
|
+
.toString(16)
|
|
50
|
+
.padStart(2, '0');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function modifyColor({ hex, ratio = 0.5, target }: IModifyColorParams): string {
|
|
54
|
+
if (hex.trim().startsWith('var(')) {
|
|
55
|
+
const weight = Number(
|
|
56
|
+
((1 - Math.min(1, Math.max(0, ratio))) * 100).toFixed(4),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return `color-mix(in srgb, ${hex} ${weight}%, ${target})`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const color = parseHexColor(hex);
|
|
63
|
+
|
|
64
|
+
if (!color) {
|
|
65
|
+
return hex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const modifyChannel = (channel: number): number => {
|
|
69
|
+
if (target === 'white') {
|
|
70
|
+
return channel + (255 - channel) * ratio;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return channel * (1 - ratio);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return `#${formatHexChannel(modifyChannel(color.red))}${formatHexChannel(modifyChannel(color.green))}${formatHexChannel(modifyChannel(color.blue))}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function lightenColor({ hex, ratio }: IColorModifierParams): string {
|
|
80
|
+
return modifyColor({
|
|
81
|
+
hex,
|
|
82
|
+
ratio,
|
|
83
|
+
target: 'white',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function darkenColor({ hex, ratio }: IColorModifierParams): string {
|
|
88
|
+
return modifyColor({
|
|
89
|
+
hex,
|
|
90
|
+
ratio,
|
|
91
|
+
target: 'black',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
2
|
|
|
3
3
|
import type { IArcComparisonGeometry } from './createArcComparisonGeometry';
|
|
4
|
-
import type { IResolvedArcComparisonItem } from './resolveArcComparisonItems';
|
|
5
4
|
|
|
6
5
|
export interface IArcComparisonRootContext {
|
|
7
6
|
readonly animation: ComputedRef<boolean>;
|
|
@@ -23,18 +22,8 @@ export interface IArcComparisonSideContext {
|
|
|
23
22
|
readonly count: ComputedRef<number>;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
export interface IArcComparisonCalloutContext {
|
|
27
|
-
readonly side: 'left' | 'right';
|
|
28
|
-
readonly index: number;
|
|
29
|
-
readonly color: ComputedRef<string>;
|
|
30
|
-
readonly item: ComputedRef<IResolvedArcComparisonItem>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
25
|
export const ARC_COMPARISON_ROOT_KEY: InjectionKey<IArcComparisonRootContext> =
|
|
34
26
|
Symbol('ARC_COMPARISON_ROOT_KEY');
|
|
35
27
|
|
|
36
28
|
export const ARC_COMPARISON_SIDE_KEY: InjectionKey<IArcComparisonSideContext> =
|
|
37
29
|
Symbol('ARC_COMPARISON_SIDE_KEY');
|
|
38
|
-
|
|
39
|
-
export const ARC_COMPARISON_CALLOUT_KEY: InjectionKey<IArcComparisonCalloutContext> =
|
|
40
|
-
Symbol('ARC_COMPARISON_CALLOUT_KEY');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { resolveArcOrbitItems } from '../../core/arc-orbit';
|
|
2
|
+
|
|
3
|
+
export interface IArcComparisonItem {
|
|
4
|
+
readonly id?: string | number;
|
|
5
|
+
readonly title?: string;
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly color?: string;
|
|
8
|
+
readonly textColor?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IResolvedArcComparisonItem {
|
|
12
|
+
readonly id: string | number;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly color: string;
|
|
16
|
+
readonly textColor?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const DEFAULT_LEFT_COLOR = 'var(--alpha-arc-comparison-left-accent)';
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_RIGHT_COLOR = 'var(--alpha-arc-comparison-right-accent)';
|
|
22
|
+
|
|
23
|
+
export function resolveArcComparisonSideItems(
|
|
24
|
+
items?: readonly IArcComparisonItem[],
|
|
25
|
+
defaultColor = DEFAULT_LEFT_COLOR,
|
|
26
|
+
count = 3,
|
|
27
|
+
): readonly IResolvedArcComparisonItem[] {
|
|
28
|
+
return resolveArcOrbitItems({
|
|
29
|
+
items,
|
|
30
|
+
defaultColor,
|
|
31
|
+
count,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const DEFAULT_COL_COLORS: readonly string[] = [
|
|
2
|
+
'var(--alpha-table-comparison-col-1-background)',
|
|
3
|
+
'var(--alpha-table-comparison-col-2-background)',
|
|
4
|
+
'var(--alpha-table-comparison-col-3-background)',
|
|
5
|
+
'var(--alpha-table-comparison-col-4-background)',
|
|
6
|
+
'var(--alpha-table-comparison-col-5-background)',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_ROW_HEADER_COLOR = 'var(--alpha-table-comparison-row-bg)';
|
|
10
|
+
export const DEFAULT_ROW_HEADER_TEXT_COLOR =
|
|
11
|
+
'var(--alpha-table-comparison-row)';
|
|
12
|
+
export const DEFAULT_COL_HEADER_TEXT_COLOR =
|
|
13
|
+
'var(--alpha-table-comparison-col)';
|
|
14
|
+
export const DEFAULT_CELL_BG = 'var(--alpha-table-comparison-cell-bg)';
|
|
15
|
+
export const DEFAULT_CELL_COLOR = 'var(--alpha-table-comparison-cell)';
|
|
16
|
+
export const DEFAULT_BORDER_RADIUS = '8px';
|
|
17
|
+
export const DEFAULT_SPACING = '6px';
|
|
18
|
+
export const DEFAULT_ROW_HEADER_WIDTH = '160px';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Resolves a dimension input (number or string) into a CSS-ready unit string.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveDimension(
|
|
24
|
+
value: number | string | undefined,
|
|
25
|
+
defaultUnit = 'px',
|
|
26
|
+
): string | undefined {
|
|
27
|
+
if (value === undefined || value === null) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (typeof value === 'number') {
|
|
32
|
+
return `${value}${defaultUnit}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const trimmed = value.trim();
|
|
36
|
+
|
|
37
|
+
if (!trimmed) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// If already contains unit or percentage or calc/var, return as is
|
|
42
|
+
if (/^[+-]?\d+(\.\d+)?$/.test(trimmed)) {
|
|
43
|
+
return `${trimmed}${defaultUnit}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return trimmed;
|
|
47
|
+
}
|
|
@@ -13,12 +13,12 @@ export interface ITableComparisonContext {
|
|
|
13
13
|
readonly animation: ComputedRef<boolean>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export interface
|
|
16
|
+
export interface ITableComparisonColumnsContext {
|
|
17
17
|
readonly registerCol: () => number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const TABLE_COMPARISON_KEY: InjectionKey<ITableComparisonContext> =
|
|
21
21
|
Symbol('TABLE_COMPARISON_KEY');
|
|
22
22
|
|
|
23
|
-
export const TABLE_COMPARISON_COLS_KEY: InjectionKey<
|
|
23
|
+
export const TABLE_COMPARISON_COLS_KEY: InjectionKey<ITableComparisonColumnsContext> =
|
|
24
24
|
Symbol('TABLE_COMPARISON_COLS_KEY');
|
|
@@ -14,10 +14,7 @@ export interface IResolvedArcOrbitItem {
|
|
|
14
14
|
readonly textColor?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export const DEFAULT_ARC_ORBIT_COLOR = '
|
|
18
|
-
|
|
19
|
-
export const DEFAULT_LOREM_TEXT =
|
|
20
|
-
'Lorem ipsum dolor sit amet, constitutor adipiscing elit. Nam vulputate augue vel ligula.';
|
|
17
|
+
export const DEFAULT_ARC_ORBIT_COLOR = 'var(--alpha-arc-orbit-accent)';
|
|
21
18
|
|
|
22
19
|
export const DEFAULT_ARC_ORBIT_ITEMS: readonly [
|
|
23
20
|
IResolvedArcOrbitItem,
|
|
@@ -27,26 +24,26 @@ export const DEFAULT_ARC_ORBIT_ITEMS: readonly [
|
|
|
27
24
|
] = [
|
|
28
25
|
{
|
|
29
26
|
id: '01',
|
|
30
|
-
title: '
|
|
31
|
-
description:
|
|
27
|
+
title: '',
|
|
28
|
+
description: '',
|
|
32
29
|
color: DEFAULT_ARC_ORBIT_COLOR,
|
|
33
30
|
},
|
|
34
31
|
{
|
|
35
32
|
id: '02',
|
|
36
|
-
title: '
|
|
37
|
-
description:
|
|
33
|
+
title: '',
|
|
34
|
+
description: '',
|
|
38
35
|
color: DEFAULT_ARC_ORBIT_COLOR,
|
|
39
36
|
},
|
|
40
37
|
{
|
|
41
38
|
id: '03',
|
|
42
|
-
title: '
|
|
43
|
-
description:
|
|
39
|
+
title: '',
|
|
40
|
+
description: '',
|
|
44
41
|
color: DEFAULT_ARC_ORBIT_COLOR,
|
|
45
42
|
},
|
|
46
43
|
{
|
|
47
44
|
id: '04',
|
|
48
|
-
title: '
|
|
49
|
-
description:
|
|
45
|
+
title: '',
|
|
46
|
+
description: '',
|
|
50
47
|
color: DEFAULT_ARC_ORBIT_COLOR,
|
|
51
48
|
},
|
|
52
49
|
];
|
|
@@ -73,9 +70,8 @@ export function resolveArcOrbitItems(
|
|
|
73
70
|
? custom.id
|
|
74
71
|
: (defaultItem?.id ?? String(i + 1).padStart(2, '0'));
|
|
75
72
|
|
|
76
|
-
const title = custom?.title ?? defaultItem?.title ?? '
|
|
77
|
-
const description =
|
|
78
|
-
custom?.description ?? defaultItem?.description ?? DEFAULT_LOREM_TEXT;
|
|
73
|
+
const title = custom?.title ?? defaultItem?.title ?? '';
|
|
74
|
+
const description = custom?.description ?? defaultItem?.description ?? '';
|
|
79
75
|
const color = custom?.color ?? defaultColor;
|
|
80
76
|
const textColor = custom?.textColor ?? defaultItem?.textColor;
|
|
81
77
|
|