@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
|
@@ -5,47 +5,51 @@ import {
|
|
|
5
5
|
Fragment,
|
|
6
6
|
provide,
|
|
7
7
|
useSlots,
|
|
8
|
+
isVNode,
|
|
8
9
|
type VNode,
|
|
9
10
|
} from 'vue';
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
createHorizontalCardAccentPath,
|
|
14
|
+
createHorizontalCardPath,
|
|
14
15
|
HORIZ_CARD_KEY,
|
|
15
|
-
|
|
16
|
-
} from '../../../utils/
|
|
16
|
+
type THorizontalCardBadgeVariant,
|
|
17
|
+
} from '../../../utils/card/horizontal-card';
|
|
17
18
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
18
19
|
|
|
19
20
|
defineOptions({
|
|
20
|
-
name: '
|
|
21
|
+
name: 'HorizontalCard',
|
|
21
22
|
inheritAttrs: false,
|
|
22
23
|
});
|
|
23
24
|
|
|
24
|
-
export interface
|
|
25
|
+
export interface IHorizontalCardProps {
|
|
25
26
|
readonly color?: string;
|
|
26
27
|
readonly dots?: boolean;
|
|
27
|
-
readonly title?: string;
|
|
28
|
+
readonly title?: string | VNode;
|
|
28
29
|
readonly cardBg?: string;
|
|
29
30
|
readonly textColor?: string;
|
|
30
|
-
readonly titleColor?: string;
|
|
31
|
-
readonly lightColor?: string;
|
|
32
|
-
readonly description?: string;
|
|
33
31
|
readonly step?: string | number;
|
|
34
32
|
readonly icon?: string | object;
|
|
35
33
|
readonly hasIconCircle?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Controls the badge display mode:
|
|
36
|
+
* - 'outside': ribbon badge anchored over the top border (default)
|
|
37
|
+
* - 'none' | 'hidden': badge is completely hidden
|
|
38
|
+
*/
|
|
39
|
+
readonly variant?: THorizontalCardBadgeVariant;
|
|
40
|
+
readonly badgeVariant?: THorizontalCardBadgeVariant;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
const props = withDefaults(defineProps<
|
|
43
|
+
const props = withDefaults(defineProps<IHorizontalCardProps>(), {
|
|
39
44
|
dots: true,
|
|
40
45
|
step: '01',
|
|
41
46
|
icon: undefined,
|
|
42
|
-
color: '
|
|
43
|
-
cardBg: '
|
|
44
|
-
title:
|
|
47
|
+
color: 'var(--alpha-horizontal-card-accent)',
|
|
48
|
+
cardBg: 'var(--alpha-horizontal-card-bg)',
|
|
49
|
+
title: undefined,
|
|
45
50
|
textColor: undefined,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
description: undefined,
|
|
51
|
+
variant: undefined,
|
|
52
|
+
badgeVariant: 'outside',
|
|
49
53
|
hasIconCircle: undefined,
|
|
50
54
|
});
|
|
51
55
|
|
|
@@ -78,19 +82,15 @@ function flattenVNodes(nodes: VNode[]): VNode[] {
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
function isBadgeNode(node: VNode): boolean {
|
|
81
|
-
return hasComponentName(node.type, '
|
|
85
|
+
return hasComponentName(node.type, 'HorizontalCardBadge');
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
function isIconNode(node: VNode): boolean {
|
|
85
|
-
return hasComponentName(node.type, '
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function isHeadingNode(node: VNode): boolean {
|
|
89
|
-
return hasComponentName(node.type, 'HorizCardHeading');
|
|
89
|
+
return hasComponentName(node.type, 'HorizontalCardIcon');
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function isContentNode(node: VNode): boolean {
|
|
93
|
-
return hasComponentName(node.type, '
|
|
93
|
+
return hasComponentName(node.type, 'HorizontalCardContent');
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
const defaultNodes = computed(() => {
|
|
@@ -109,62 +109,53 @@ const slottedIcon = computed(() => {
|
|
|
109
109
|
return defaultNodes.value.find(isIconNode);
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
const slottedHeading = computed(() => {
|
|
113
|
-
return defaultNodes.value.find(isHeadingNode);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
112
|
const slottedContent = computed(() => {
|
|
117
113
|
return defaultNodes.value.find(isContentNode);
|
|
118
114
|
});
|
|
119
115
|
|
|
120
116
|
const otherSlottedNodes = computed(() => {
|
|
121
117
|
return defaultNodes.value.filter((node) => {
|
|
122
|
-
return (
|
|
123
|
-
!isBadgeNode(node) &&
|
|
124
|
-
!isIconNode(node) &&
|
|
125
|
-
!isHeadingNode(node) &&
|
|
126
|
-
!isContentNode(node)
|
|
127
|
-
);
|
|
118
|
+
return !isBadgeNode(node) && !isIconNode(node) && !isContentNode(node);
|
|
128
119
|
});
|
|
129
120
|
});
|
|
130
121
|
|
|
131
|
-
const
|
|
132
|
-
return props.color
|
|
122
|
+
const customColor = computed(() => {
|
|
123
|
+
return props.color !== 'var(--alpha-horizontal-card-accent)'
|
|
124
|
+
? props.color
|
|
125
|
+
: undefined;
|
|
133
126
|
});
|
|
134
127
|
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
props.lightColor ??
|
|
138
|
-
hexToRgba({
|
|
139
|
-
alpha: 0.16,
|
|
140
|
-
hex: props.color,
|
|
141
|
-
})
|
|
142
|
-
);
|
|
128
|
+
const resolvedColor = computed(() => {
|
|
129
|
+
return props.color;
|
|
143
130
|
});
|
|
144
131
|
|
|
145
132
|
const resolvedCardBg = computed(() => {
|
|
146
133
|
return props.cardBg;
|
|
147
134
|
});
|
|
148
135
|
|
|
149
|
-
const resolvedTitleColor = computed(() => {
|
|
150
|
-
return props.titleColor ?? props.color;
|
|
151
|
-
});
|
|
152
|
-
|
|
153
136
|
const resolvedTextColor = computed(() => {
|
|
154
137
|
return props.textColor;
|
|
155
138
|
});
|
|
156
139
|
|
|
140
|
+
const resolvedBadgeVariant = computed<THorizontalCardBadgeVariant>(() => {
|
|
141
|
+
return props.variant ?? props.badgeVariant ?? 'outside';
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const isBadgeVisible = computed(() => {
|
|
145
|
+
return (
|
|
146
|
+
resolvedBadgeVariant.value !== 'none' &&
|
|
147
|
+
resolvedBadgeVariant.value !== 'hidden'
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
|
|
157
151
|
const resolvedStep = computed(() => {
|
|
158
152
|
return props.step;
|
|
159
153
|
});
|
|
160
154
|
|
|
161
155
|
provide(HORIZ_CARD_KEY, {
|
|
162
156
|
step: resolvedStep,
|
|
163
|
-
color:
|
|
164
|
-
|
|
165
|
-
lightColor: resolvedLightColor,
|
|
166
|
-
titleColor: resolvedTitleColor,
|
|
167
|
-
textColor: resolvedTextColor as ComputedRef<string | undefined>,
|
|
157
|
+
color: customColor as ComputedRef<string>,
|
|
158
|
+
textColor: resolvedTextColor,
|
|
168
159
|
});
|
|
169
160
|
|
|
170
161
|
// Fixed coordinate grid for crisp SVG vector drawing
|
|
@@ -172,7 +163,7 @@ const CARD_WIDTH = 360;
|
|
|
172
163
|
const CARD_HEIGHT = 260;
|
|
173
164
|
|
|
174
165
|
const cardPath = computed(() => {
|
|
175
|
-
return
|
|
166
|
+
return createHorizontalCardPath({
|
|
176
167
|
chamferX: 60,
|
|
177
168
|
chamferY: 76,
|
|
178
169
|
borderRadius: 24,
|
|
@@ -183,7 +174,7 @@ const cardPath = computed(() => {
|
|
|
183
174
|
});
|
|
184
175
|
|
|
185
176
|
const accentPath = computed(() => {
|
|
186
|
-
return
|
|
177
|
+
return createHorizontalCardAccentPath({
|
|
187
178
|
chamferX: 60,
|
|
188
179
|
chamferY: 76,
|
|
189
180
|
chamferFillet: 22,
|
|
@@ -205,27 +196,39 @@ const isIconActive = computed(() => {
|
|
|
205
196
|
});
|
|
206
197
|
|
|
207
198
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
208
|
-
'alpha-
|
|
199
|
+
'alpha-horizontal-card relative inline-block select-none w-90 h-65 font-sans',
|
|
209
200
|
);
|
|
210
201
|
</script>
|
|
211
202
|
|
|
212
203
|
<template>
|
|
213
|
-
<div
|
|
204
|
+
<div
|
|
205
|
+
v-bind="forwardedAttrs()"
|
|
206
|
+
:class="className()"
|
|
207
|
+
:style="{
|
|
208
|
+
'--alpha-horizontal-card-accent': customColor,
|
|
209
|
+
'--alpha-horizontal-card-title': customColor,
|
|
210
|
+
'--alpha-horizontal-card-bg':
|
|
211
|
+
props.cardBg !== 'var(--alpha-horizontal-card-bg)'
|
|
212
|
+
? resolvedCardBg
|
|
213
|
+
: undefined,
|
|
214
|
+
}"
|
|
215
|
+
>
|
|
214
216
|
<!-- SVG Vector Layer: Bottom-left accent blob + filleted chamfered card outline -->
|
|
215
217
|
<svg
|
|
216
|
-
|
|
218
|
+
aria-hidden="true"
|
|
219
|
+
class="absolute -left-7 -top-4 w-104 h-73 pointer-events-none overflow-visible"
|
|
217
220
|
viewBox="-28 -16 416 292"
|
|
218
221
|
xmlns="http://www.w3.org/2000/svg"
|
|
219
222
|
>
|
|
220
223
|
<!-- Layer 1: Solid accent shape behind the card & chamfer -->
|
|
221
224
|
<path
|
|
222
|
-
class="alpha-
|
|
225
|
+
class="alpha-horizontal-card__accent"
|
|
223
226
|
:d="accentPath"
|
|
224
227
|
:fill="resolvedColor"
|
|
225
228
|
/>
|
|
226
229
|
<!-- Layer 2: Main card body with stroke border and filleted chamfered cut -->
|
|
227
230
|
<path
|
|
228
|
-
class="alpha-
|
|
231
|
+
class="alpha-horizontal-card__body"
|
|
229
232
|
:d="cardPath"
|
|
230
233
|
:fill="resolvedCardBg"
|
|
231
234
|
:stroke="resolvedColor"
|
|
@@ -234,10 +237,10 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
234
237
|
/>
|
|
235
238
|
</svg>
|
|
236
239
|
<!-- Ribbon Step Badge at top left (hangs over the top border) -->
|
|
237
|
-
<div class="absolute left-
|
|
240
|
+
<div v-if="isBadgeVisible" class="absolute left-5 -top-5 z-10">
|
|
238
241
|
<slot name="badge">
|
|
239
242
|
<component :is="slottedBadge" v-if="slottedBadge" />
|
|
240
|
-
<
|
|
243
|
+
<HorizontalCardBadge v-else :step="resolvedStep" :color="customColor" />
|
|
241
244
|
</slot>
|
|
242
245
|
</div>
|
|
243
246
|
<!-- Card Content Layer -->
|
|
@@ -253,38 +256,28 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
253
256
|
<template v-if="isIconActive">
|
|
254
257
|
<slot name="icon">
|
|
255
258
|
<component :is="slottedIcon" v-if="slottedIcon" />
|
|
256
|
-
<
|
|
259
|
+
<HorizontalCardIcon
|
|
257
260
|
v-else
|
|
258
261
|
:icon="props.icon"
|
|
259
|
-
:color="
|
|
260
|
-
:light-color="resolvedLightColor"
|
|
262
|
+
:color="customColor"
|
|
261
263
|
:size="100"
|
|
262
264
|
/>
|
|
263
265
|
</slot>
|
|
264
266
|
</template>
|
|
265
267
|
<!-- Heading + Body Description -->
|
|
266
268
|
<div class="flex-1 flex flex-col justify-center min-w-0 pr-1">
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
>
|
|
274
|
-
|
|
275
|
-
</
|
|
276
|
-
</
|
|
277
|
-
<slot name="
|
|
269
|
+
<h4
|
|
270
|
+
v-if="$slots.title || props.title != null"
|
|
271
|
+
class="alpha-horizontal-card-title mb-2 font-bold text-(--alpha-horizontal-card-title)"
|
|
272
|
+
>
|
|
273
|
+
<slot v-if="$slots.title" name="title" />
|
|
274
|
+
<component :is="props.title" v-else-if="isVNode(props.title)" />
|
|
275
|
+
<span v-else-if="typeof props.title === 'string'">{{
|
|
276
|
+
props.title
|
|
277
|
+
}}</span>
|
|
278
|
+
</h4>
|
|
279
|
+
<slot name="content">
|
|
278
280
|
<component :is="slottedContent" v-if="slottedContent" />
|
|
279
|
-
<HorizCardContent
|
|
280
|
-
v-else
|
|
281
|
-
:color="resolvedTextColor"
|
|
282
|
-
class="text-[11px] leading-[1.45]"
|
|
283
|
-
>
|
|
284
|
-
<template v-if="props.description">
|
|
285
|
-
{{ props.description }}
|
|
286
|
-
</template>
|
|
287
|
-
</HorizCardContent>
|
|
288
281
|
</slot>
|
|
289
282
|
<!-- Any other custom slotted components -->
|
|
290
283
|
<component
|
package/components/card/{horiz-card/HorizCardBadge.vue → horizontal-card/HorizontalCardBadge.vue}
RENAMED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
createHorizontalCardBadgePath,
|
|
6
6
|
HORIZ_CARD_KEY,
|
|
7
|
-
} from '../../../utils/
|
|
7
|
+
} from '../../../utils/card/horizontal-card';
|
|
8
8
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
9
|
|
|
10
10
|
defineOptions({
|
|
11
11
|
inheritAttrs: false,
|
|
12
|
-
name: '
|
|
12
|
+
name: 'HorizontalCardBadge',
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
export interface
|
|
15
|
+
export interface IHorizontalCardBadgeProps {
|
|
16
16
|
/**
|
|
17
17
|
* Badge fill color. Overrides context color.
|
|
18
18
|
*/
|
|
@@ -23,7 +23,7 @@ export interface IHorizCardBadgeProps {
|
|
|
23
23
|
readonly step?: string | number;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const props = withDefaults(defineProps<
|
|
26
|
+
const props = withDefaults(defineProps<IHorizontalCardBadgeProps>(), {
|
|
27
27
|
step: undefined,
|
|
28
28
|
color: undefined,
|
|
29
29
|
});
|
|
@@ -31,14 +31,18 @@ const props = withDefaults(defineProps<IHorizCardBadgeProps>(), {
|
|
|
31
31
|
const context = inject(HORIZ_CARD_KEY, undefined);
|
|
32
32
|
|
|
33
33
|
const resolvedColor = computed(() => {
|
|
34
|
-
return
|
|
34
|
+
return (
|
|
35
|
+
props.color ??
|
|
36
|
+
context?.color.value ??
|
|
37
|
+
'var(--alpha-horizontal-card-badge-bg, var(--alpha-horizontal-card-accent))'
|
|
38
|
+
);
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
const resolvedStep = computed(() => {
|
|
38
42
|
return props.step ?? context?.step.value ?? '01';
|
|
39
43
|
});
|
|
40
44
|
|
|
41
|
-
const badgePath =
|
|
45
|
+
const badgePath = createHorizontalCardBadgePath({
|
|
42
46
|
width: 84,
|
|
43
47
|
height: 58,
|
|
44
48
|
tipRadius: 8,
|
|
@@ -48,14 +52,15 @@ const badgePath = createHorizCardBadgePath({
|
|
|
48
52
|
});
|
|
49
53
|
|
|
50
54
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
51
|
-
'alpha-
|
|
55
|
+
'alpha-horizontal-card-badge inline-flex items-center justify-center select-none',
|
|
52
56
|
);
|
|
53
57
|
</script>
|
|
54
58
|
|
|
55
59
|
<template>
|
|
56
60
|
<div v-bind="forwardedAttrs()" :class="className()">
|
|
57
61
|
<svg
|
|
58
|
-
|
|
62
|
+
aria-hidden="true"
|
|
63
|
+
class="w-21 h-14.5 overflow-visible drop-shadow-sm"
|
|
59
64
|
viewBox="0 0 84 58"
|
|
60
65
|
xmlns="http://www.w3.org/2000/svg"
|
|
61
66
|
>
|
|
@@ -65,7 +70,7 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
65
70
|
y="27"
|
|
66
71
|
text-anchor="middle"
|
|
67
72
|
dominant-baseline="central"
|
|
68
|
-
fill="
|
|
73
|
+
fill="var(--alpha-horizontal-card-badge)"
|
|
69
74
|
class="font-sans font-bold text-[25px] tracking-tight"
|
|
70
75
|
>
|
|
71
76
|
<slot>{{ resolvedStep }}</slot>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
|
-
import { HORIZ_CARD_KEY } from '../../../utils/
|
|
4
|
+
import { HORIZ_CARD_KEY } from '../../../utils/card/horizontal-card';
|
|
5
5
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
6
6
|
|
|
7
7
|
defineOptions({
|
|
8
8
|
inheritAttrs: false,
|
|
9
|
-
name: '
|
|
9
|
+
name: 'HorizontalCardContent',
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
export interface
|
|
12
|
+
export interface IHorizontalCardContentProps {
|
|
13
13
|
/**
|
|
14
14
|
* Content text color. Overrides context textColor.
|
|
15
15
|
*/
|
|
16
16
|
readonly color?: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const props = withDefaults(defineProps<
|
|
19
|
+
const props = withDefaults(defineProps<IHorizontalCardContentProps>(), {
|
|
20
20
|
color: undefined,
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ const contentColor = computed(() => {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
30
|
-
'alpha-
|
|
30
|
+
'alpha-horizontal-card-content font-sans text-xs leading-relaxed text-(--alpha-horizontal-card-content) opacity-90',
|
|
31
31
|
);
|
|
32
32
|
</script>
|
|
33
33
|
|
|
@@ -35,12 +35,12 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
35
35
|
<p
|
|
36
36
|
v-bind="forwardedAttrs()"
|
|
37
37
|
:class="className()"
|
|
38
|
-
:style="
|
|
38
|
+
:style="
|
|
39
|
+
contentColor && !contentColor.includes('--alpha-horizontal-card-content')
|
|
40
|
+
? { '--alpha-horizontal-card-content': contentColor }
|
|
41
|
+
: undefined
|
|
42
|
+
"
|
|
39
43
|
>
|
|
40
|
-
<slot
|
|
41
|
-
Lorem ipsum dolor sit amet, nibh est. A magna maecenas, quam magna nec
|
|
42
|
-
quis, lorem nunc. Suspendisse viverra sodales mauris, cras pharetra proin
|
|
43
|
-
egestas.
|
|
44
|
-
</slot>
|
|
44
|
+
<slot />
|
|
45
45
|
</p>
|
|
46
46
|
</template>
|
package/components/card/{horiz-card/HorizCardIcon.vue → horizontal-card/HorizontalCardIcon.vue}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
|
-
import { HORIZ_CARD_KEY
|
|
4
|
+
import { HORIZ_CARD_KEY } from '../../../utils/card/horizontal-card';
|
|
5
5
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
6
6
|
|
|
7
7
|
defineOptions({
|
|
8
8
|
inheritAttrs: false,
|
|
9
|
-
name: '
|
|
9
|
+
name: 'HorizontalCardIcon',
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
export interface
|
|
12
|
+
export interface IHorizontalCardIconProps {
|
|
13
13
|
/**
|
|
14
14
|
* Optional icon class (e.g. 'i-carbon-search') or component.
|
|
15
15
|
*/
|
|
@@ -18,10 +18,6 @@ export interface IHorizCardIconProps {
|
|
|
18
18
|
* Foreground icon color. Overrides context color.
|
|
19
19
|
*/
|
|
20
20
|
readonly color?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Circular background color. Overrides context lightColor.
|
|
23
|
-
*/
|
|
24
|
-
readonly lightColor?: string;
|
|
25
21
|
/**
|
|
26
22
|
* Circle size in pixels or CSS string.
|
|
27
23
|
* @default 96
|
|
@@ -29,32 +25,24 @@ export interface IHorizCardIconProps {
|
|
|
29
25
|
readonly size?: number | string;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
const props = withDefaults(defineProps<
|
|
28
|
+
const props = withDefaults(defineProps<IHorizontalCardIconProps>(), {
|
|
33
29
|
size: 96,
|
|
34
30
|
icon: undefined,
|
|
35
31
|
color: undefined,
|
|
36
|
-
lightColor: undefined,
|
|
37
32
|
});
|
|
38
33
|
|
|
39
34
|
const context = inject(HORIZ_CARD_KEY, undefined);
|
|
40
35
|
|
|
41
|
-
const
|
|
42
|
-
return props.color ?? context?.color.value
|
|
36
|
+
const customColor = computed(() => {
|
|
37
|
+
return props.color ?? context?.color.value;
|
|
43
38
|
});
|
|
44
39
|
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (context?.lightColor.value) {
|
|
51
|
-
return context.lightColor.value;
|
|
40
|
+
const customLightColor = computed(() => {
|
|
41
|
+
if (customColor.value) {
|
|
42
|
+
return `color-mix(in srgb, ${customColor.value} 16%, transparent)`;
|
|
52
43
|
}
|
|
53
44
|
|
|
54
|
-
return
|
|
55
|
-
hex: resolvedColor.value,
|
|
56
|
-
alpha: 0.16,
|
|
57
|
-
});
|
|
45
|
+
return undefined;
|
|
58
46
|
});
|
|
59
47
|
|
|
60
48
|
const resolvedSize = computed(() => {
|
|
@@ -71,7 +59,7 @@ const isComponentIcon = computed(() => {
|
|
|
71
59
|
});
|
|
72
60
|
|
|
73
61
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
74
|
-
'alpha-
|
|
62
|
+
'alpha-horizontal-card-icon rounded-full flex items-center justify-center shrink-0 transition-transform duration-300 select-none bg-(--alpha-horizontal-card-icon-bg) text-(--alpha-horizontal-card-icon)',
|
|
75
63
|
);
|
|
76
64
|
</script>
|
|
77
65
|
|
|
@@ -82,25 +70,16 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
82
70
|
:style="{
|
|
83
71
|
width: resolvedSize,
|
|
84
72
|
height: resolvedSize,
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
'--alpha-horizontal-card-icon-bg': customLightColor,
|
|
74
|
+
'--alpha-horizontal-card-icon': customColor,
|
|
87
75
|
}"
|
|
88
76
|
>
|
|
89
77
|
<slot>
|
|
90
|
-
<component
|
|
91
|
-
|
|
92
|
-
v-if="isComponentIcon"
|
|
93
|
-
class="text-4xl"
|
|
94
|
-
:style="{ color: resolvedColor }"
|
|
95
|
-
/>
|
|
96
|
-
<div
|
|
97
|
-
v-else-if="isStringIcon"
|
|
98
|
-
:class="props.icon"
|
|
99
|
-
class="text-4xl"
|
|
100
|
-
:style="{ color: resolvedColor }"
|
|
101
|
-
/>
|
|
78
|
+
<component :is="props.icon" v-if="isComponentIcon" class="text-4xl" />
|
|
79
|
+
<div v-else-if="isStringIcon" :class="props.icon" class="text-4xl" />
|
|
102
80
|
<!-- Default search icon matching the reference card -->
|
|
103
81
|
<svg
|
|
82
|
+
aria-hidden="true"
|
|
104
83
|
v-else
|
|
105
84
|
class="w-12 h-12"
|
|
106
85
|
viewBox="0 0 24 24"
|
|
@@ -111,7 +90,14 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
111
90
|
stroke-linejoin="round"
|
|
112
91
|
>
|
|
113
92
|
<circle cx="11" cy="11" r="7" />
|
|
114
|
-
<line
|
|
93
|
+
<line
|
|
94
|
+
x1="16.5"
|
|
95
|
+
y1="16.5"
|
|
96
|
+
x2="21"
|
|
97
|
+
y2="21"
|
|
98
|
+
stroke-width="3"
|
|
99
|
+
stroke-linecap="round"
|
|
100
|
+
/>
|
|
115
101
|
</svg>
|
|
116
102
|
</slot>
|
|
117
103
|
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Color defaults shared by this component family. */
|
|
2
|
+
@layer alpha-theme-tokens {
|
|
3
|
+
:root {
|
|
4
|
+
--alpha-horizontal-card-accent: #ea583a;
|
|
5
|
+
--alpha-horizontal-card-badge: #ffffff;
|
|
6
|
+
/* Resolved from the component accent or props unless overridden. */
|
|
7
|
+
--alpha-horizontal-card-badge-bg: var(--alpha-horizontal-card-accent);
|
|
8
|
+
--alpha-horizontal-card-bg: #ffffff;
|
|
9
|
+
--alpha-horizontal-card-content: var(--alpha-foreground-primary, #475569);
|
|
10
|
+
/* Resolved from the component accent or props unless overridden. */
|
|
11
|
+
--alpha-horizontal-card-title: var(--alpha-horizontal-card-accent);
|
|
12
|
+
/* Resolved from the component accent or props unless overridden. */
|
|
13
|
+
--alpha-horizontal-card-icon: var(--alpha-horizontal-card-accent);
|
|
14
|
+
/* Resolved from the component accent or props unless overridden. */
|
|
15
|
+
--alpha-horizontal-card-icon-bg: color-mix(in srgb, var(--alpha-horizontal-card-accent) 16%, transparent);
|
|
16
|
+
}
|
|
17
|
+
}
|