@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { activateOnKeyboard } from '../../../utils/activateOnKeyboard';
|
|
2
3
|
import {
|
|
3
4
|
type ComputedRef,
|
|
4
5
|
computed,
|
|
@@ -7,6 +8,8 @@ import {
|
|
|
7
8
|
provide,
|
|
8
9
|
ref,
|
|
9
10
|
useSlots,
|
|
11
|
+
isVNode,
|
|
12
|
+
watch,
|
|
10
13
|
type VNode,
|
|
11
14
|
} from 'vue';
|
|
12
15
|
|
|
@@ -14,14 +17,10 @@ import {
|
|
|
14
17
|
ARC_ORBIT_ROOT_KEY,
|
|
15
18
|
createArcOrbitGeometry,
|
|
16
19
|
DEFAULT_ARC_ORBIT_COLOR,
|
|
17
|
-
type IArcOrbitItem,
|
|
18
20
|
type TArcOrbitPosition,
|
|
19
|
-
} from '../../../utils/
|
|
21
|
+
} from '../../../utils/core/arc-orbit';
|
|
20
22
|
import { useDiagramAutoScale } from '../../../utils/useDiagramAutoScale';
|
|
21
23
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
22
|
-
import ArcOrbitCallout from './ArcOrbitCallout.vue';
|
|
23
|
-
import ArcOrbitContents from './ArcOrbitContents.vue';
|
|
24
|
-
import ArcOrbitTitle from './ArcOrbitTitle.vue';
|
|
25
24
|
|
|
26
25
|
defineOptions({
|
|
27
26
|
inheritAttrs: false,
|
|
@@ -32,8 +31,7 @@ export interface IArcOrbitProps {
|
|
|
32
31
|
readonly position?: TArcOrbitPosition;
|
|
33
32
|
readonly count?: number;
|
|
34
33
|
readonly color?: string;
|
|
35
|
-
readonly title?: string;
|
|
36
|
-
readonly items?: readonly IArcOrbitItem[];
|
|
34
|
+
readonly title?: string | VNode;
|
|
37
35
|
readonly animation?: boolean;
|
|
38
36
|
readonly height?: number | string;
|
|
39
37
|
readonly startDelay?: number;
|
|
@@ -54,7 +52,6 @@ const props = withDefaults(defineProps<IArcOrbitProps>(), {
|
|
|
54
52
|
count: undefined,
|
|
55
53
|
color: DEFAULT_ARC_ORBIT_COLOR,
|
|
56
54
|
title: undefined,
|
|
57
|
-
items: undefined,
|
|
58
55
|
animation: true,
|
|
59
56
|
height: undefined,
|
|
60
57
|
startDelay: undefined,
|
|
@@ -111,25 +108,6 @@ const resolvedStartDelay = computed(() => {
|
|
|
111
108
|
return 0;
|
|
112
109
|
});
|
|
113
110
|
|
|
114
|
-
interface INamedComponent {
|
|
115
|
-
readonly name?: string;
|
|
116
|
-
readonly __name?: string;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function hasComponentName(type: unknown, name: string): boolean {
|
|
120
|
-
if (typeof type === 'object' && type !== null) {
|
|
121
|
-
const comp = type as INamedComponent;
|
|
122
|
-
|
|
123
|
-
return comp.name === name || comp.__name === name;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (typeof type === 'function') {
|
|
127
|
-
return (type as { name?: string }).name === name;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
111
|
function isSignificantNode(node: VNode): boolean {
|
|
134
112
|
if (typeof node.type === 'symbol') {
|
|
135
113
|
if (typeof node.children === 'string' && !node.children.trim()) {
|
|
@@ -158,14 +136,6 @@ function flattenVNodes(nodes: VNode[]): VNode[] {
|
|
|
158
136
|
return result;
|
|
159
137
|
}
|
|
160
138
|
|
|
161
|
-
function isTitleNode(node: VNode): boolean {
|
|
162
|
-
return (
|
|
163
|
-
hasComponentName(node.type, 'ArcOrbitTitle') ||
|
|
164
|
-
hasComponentName(node.type, 'ArcComparisonTitle') ||
|
|
165
|
-
node.type === ArcOrbitTitle
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
139
|
const defaultNodes = computed(() => {
|
|
170
140
|
if (!slots.default) {
|
|
171
141
|
return [];
|
|
@@ -174,14 +144,6 @@ const defaultNodes = computed(() => {
|
|
|
174
144
|
return flattenVNodes(slots.default());
|
|
175
145
|
});
|
|
176
146
|
|
|
177
|
-
const titleNode = computed(() => {
|
|
178
|
-
return defaultNodes.value.find(isTitleNode);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const bodyNodes = computed(() => {
|
|
182
|
-
return defaultNodes.value.filter((node) => !isTitleNode(node));
|
|
183
|
-
});
|
|
184
|
-
|
|
185
147
|
const resolvedCount = computed(() => {
|
|
186
148
|
if (props.count === 4 || (props.count as unknown) === '4') {
|
|
187
149
|
return 4;
|
|
@@ -219,6 +181,7 @@ const registerCallout = (id?: symbol): number | ComputedRef<number> => {
|
|
|
219
181
|
if (!registeredCalloutIds.value.includes(id)) {
|
|
220
182
|
registeredCalloutIds.value.push(id);
|
|
221
183
|
}
|
|
184
|
+
|
|
222
185
|
return computed(() => registeredCalloutIds.value.indexOf(id));
|
|
223
186
|
}
|
|
224
187
|
|
|
@@ -233,11 +196,21 @@ const unregisterCallout = (id: symbol): void => {
|
|
|
233
196
|
);
|
|
234
197
|
};
|
|
235
198
|
|
|
236
|
-
const currentTitle = ref<string>(
|
|
199
|
+
const currentTitle = ref<string>(
|
|
200
|
+
typeof props.title === 'string' ? props.title : '',
|
|
201
|
+
);
|
|
202
|
+
watch(
|
|
203
|
+
() => props.title,
|
|
204
|
+
(title) => {
|
|
205
|
+
currentTitle.value = typeof title === 'string' ? title : '';
|
|
206
|
+
},
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
const orbitColor = computed(() => props.color ?? DEFAULT_ARC_ORBIT_COLOR);
|
|
237
210
|
|
|
238
211
|
provide(ARC_ORBIT_ROOT_KEY, {
|
|
239
212
|
position: computed(() => props.position ?? 'left'),
|
|
240
|
-
color:
|
|
213
|
+
color: orbitColor,
|
|
241
214
|
pointsCount: resolvedCount,
|
|
242
215
|
geo,
|
|
243
216
|
animation: isAnimated,
|
|
@@ -249,7 +222,7 @@ provide(ARC_ORBIT_ROOT_KEY, {
|
|
|
249
222
|
registerCallout,
|
|
250
223
|
unregisterCallout,
|
|
251
224
|
edgeOffset: computed(() => props.edgeOffset ?? 30),
|
|
252
|
-
items: computed(() =>
|
|
225
|
+
items: computed(() => []),
|
|
253
226
|
});
|
|
254
227
|
|
|
255
228
|
const { resolvedScale, containerHeight } = useDiagramAutoScale({
|
|
@@ -284,6 +257,12 @@ const resolvedHeightStyle = computed(() => {
|
|
|
284
257
|
return undefined;
|
|
285
258
|
});
|
|
286
259
|
|
|
260
|
+
const customColor = computed(() => {
|
|
261
|
+
return props.color && props.color !== DEFAULT_ARC_ORBIT_COLOR
|
|
262
|
+
? props.color
|
|
263
|
+
: undefined;
|
|
264
|
+
});
|
|
265
|
+
|
|
287
266
|
const hubStyle = computed(() => {
|
|
288
267
|
const hubR = geo.value.hubRadius;
|
|
289
268
|
const centerY = geo.value.hubCenter.y;
|
|
@@ -299,7 +278,7 @@ const hubStyle = computed(() => {
|
|
|
299
278
|
});
|
|
300
279
|
|
|
301
280
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
302
|
-
'alpha-arc-orbit w-full flex-1 flex flex-col justify-center select-none font-sans relative min-h-0',
|
|
281
|
+
'alpha-arc-orbit w-full flex-1 flex flex-col justify-center select-none font-sans relative min-h-0 border-0 p-0 m-0 min-w-0 bg-transparent',
|
|
303
282
|
);
|
|
304
283
|
|
|
305
284
|
function handleClick(event: MouseEvent): void {
|
|
@@ -308,8 +287,9 @@ function handleClick(event: MouseEvent): void {
|
|
|
308
287
|
</script>
|
|
309
288
|
|
|
310
289
|
<template>
|
|
311
|
-
<
|
|
290
|
+
<fieldset
|
|
312
291
|
ref="rootRef"
|
|
292
|
+
aria-label="Arc orbit diagram"
|
|
313
293
|
v-bind="forwardedAttrs()"
|
|
314
294
|
:class="[
|
|
315
295
|
className(),
|
|
@@ -319,15 +299,16 @@ function handleClick(event: MouseEvent): void {
|
|
|
319
299
|
:data-position="props.position"
|
|
320
300
|
:style="{
|
|
321
301
|
height: resolvedHeightStyle,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
'--arc-orbit-
|
|
302
|
+
'--alpha-arc-orbit-start-delay': `${resolvedStartDelay}ms`,
|
|
303
|
+
'--alpha-arc-orbit-accent': customColor,
|
|
304
|
+
'--alpha-arc-orbit-title': customColor,
|
|
325
305
|
}"
|
|
326
306
|
@click="handleClick"
|
|
307
|
+
@keydown="activateOnKeyboard"
|
|
327
308
|
>
|
|
328
309
|
<!-- Relative stage container -->
|
|
329
310
|
<div
|
|
330
|
-
class="alpha-arc-orbit__stage relative flex items-center justify-center overflow-visible
|
|
311
|
+
class="alpha-arc-orbit__stage relative flex items-center justify-center overflow-visible shrink-0"
|
|
331
312
|
:style="{
|
|
332
313
|
width: `${props.viewBoxWidth}px`,
|
|
333
314
|
height: `${props.viewBoxHeight}px`,
|
|
@@ -337,13 +318,19 @@ function handleClick(event: MouseEvent): void {
|
|
|
337
318
|
>
|
|
338
319
|
<!-- Base SVG Layer -->
|
|
339
320
|
<svg
|
|
321
|
+
aria-hidden="true"
|
|
340
322
|
class="alpha-arc-orbit__svg absolute inset-0 w-full h-full pointer-events-none overflow-visible"
|
|
341
323
|
:viewBox="`0 0 ${props.viewBoxWidth} ${props.viewBoxHeight}`"
|
|
342
324
|
xmlns="http://www.w3.org/2000/svg"
|
|
343
325
|
>
|
|
344
326
|
<defs>
|
|
345
327
|
<clipPath :id="clipId">
|
|
346
|
-
<rect
|
|
328
|
+
<rect
|
|
329
|
+
x="0"
|
|
330
|
+
y="0"
|
|
331
|
+
:width="props.viewBoxWidth"
|
|
332
|
+
:height="props.viewBoxHeight"
|
|
333
|
+
/>
|
|
347
334
|
</clipPath>
|
|
348
335
|
</defs>
|
|
349
336
|
<!-- Semicircular Hub Background -->
|
|
@@ -357,8 +344,8 @@ function handleClick(event: MouseEvent): void {
|
|
|
357
344
|
>
|
|
358
345
|
<path
|
|
359
346
|
:d="geo.hubPath"
|
|
360
|
-
fill="
|
|
361
|
-
class="transition-colors duration-300
|
|
347
|
+
fill="var(--alpha-arc-orbit-hub-fill)"
|
|
348
|
+
class="transition-colors duration-300"
|
|
362
349
|
/>
|
|
363
350
|
</g>
|
|
364
351
|
</g>
|
|
@@ -373,66 +360,60 @@ function handleClick(event: MouseEvent): void {
|
|
|
373
360
|
<path
|
|
374
361
|
:d="geo.arcPath"
|
|
375
362
|
fill="none"
|
|
376
|
-
stroke="
|
|
363
|
+
stroke="var(--alpha-arc-orbit-guide-stroke)"
|
|
377
364
|
stroke-width="1.5"
|
|
378
|
-
class="transition-colors duration-300
|
|
365
|
+
class="transition-colors duration-300"
|
|
379
366
|
/>
|
|
380
367
|
<circle
|
|
381
368
|
:cx="geo.topDot.x"
|
|
382
369
|
:cy="geo.topDot.y"
|
|
383
370
|
:r="geo.dotRadius"
|
|
384
|
-
fill="
|
|
385
|
-
class="dark:fill-slate-600"
|
|
371
|
+
fill="var(--alpha-arc-orbit-guide-dot)"
|
|
386
372
|
/>
|
|
387
373
|
<circle
|
|
388
374
|
:cx="geo.bottomDot.x"
|
|
389
375
|
:cy="geo.bottomDot.y"
|
|
390
376
|
:r="geo.dotRadius"
|
|
391
|
-
fill="
|
|
392
|
-
class="dark:fill-slate-600"
|
|
377
|
+
fill="var(--alpha-arc-orbit-guide-dot)"
|
|
393
378
|
/>
|
|
394
379
|
</g>
|
|
395
380
|
</svg>
|
|
396
381
|
<!-- Hub Title Display -->
|
|
397
|
-
<
|
|
398
|
-
class="alpha-arc-orbit__hub-title absolute flex items-center justify-center z-10 pointer-events-auto"
|
|
382
|
+
<h3
|
|
383
|
+
class="alpha-arc-orbit__hub-title absolute flex items-center justify-center z-10 pointer-events-auto font-sans font-bold text-center px-2 leading-tight select-none tracking-tight whitespace-pre-line text-(--alpha-arc-orbit-title)"
|
|
399
384
|
:class="`alpha-arc-orbit__hub-title--${props.position}`"
|
|
400
385
|
:style="hubStyle"
|
|
401
386
|
>
|
|
402
|
-
<
|
|
403
|
-
<
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
</
|
|
387
|
+
<slot v-if="$slots.title" name="title" />
|
|
388
|
+
<component :is="props.title" v-else-if="isVNode(props.title)" />
|
|
389
|
+
<span v-else-if="typeof props.title === 'string'">{{
|
|
390
|
+
props.title
|
|
391
|
+
}}</span>
|
|
392
|
+
</h3>
|
|
408
393
|
<!-- Contents & Callouts Layer -->
|
|
409
|
-
<div
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
<ArcOrbitContents v-else>
|
|
414
|
-
<ArcOrbitCallout
|
|
415
|
-
v-for="idx in resolvedCount"
|
|
416
|
-
:key="idx"
|
|
417
|
-
:index="idx - 1"
|
|
418
|
-
/>
|
|
419
|
-
</ArcOrbitContents>
|
|
394
|
+
<div
|
|
395
|
+
class="alpha-arc-orbit__contents-wrapper absolute inset-0 w-full h-full pointer-events-none"
|
|
396
|
+
>
|
|
397
|
+
<component :is="node" v-for="(node, i) in defaultNodes" :key="i" />
|
|
420
398
|
</div>
|
|
421
399
|
</div>
|
|
422
|
-
</
|
|
400
|
+
</fieldset>
|
|
423
401
|
</template>
|
|
424
402
|
|
|
425
403
|
<style scoped>
|
|
426
404
|
.alpha-arc-orbit--animated.alpha-arc-orbit__hub--left {
|
|
427
|
-
animation: arc-orbit-hub-left-in 550ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
405
|
+
animation: arc-orbit-hub-left-in 550ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
406
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 30ms) both;
|
|
428
407
|
}
|
|
429
408
|
|
|
430
409
|
.alpha-arc-orbit--animated.alpha-arc-orbit__hub--right {
|
|
431
|
-
animation: arc-orbit-hub-right-in 550ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
410
|
+
animation: arc-orbit-hub-right-in 550ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
411
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 30ms) both;
|
|
432
412
|
}
|
|
433
413
|
|
|
434
414
|
.alpha-arc-orbit--animated.alpha-arc-orbit__arc {
|
|
435
|
-
animation: arc-orbit-line-fade 500ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
415
|
+
animation: arc-orbit-line-fade 500ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
416
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 100ms) both;
|
|
436
417
|
}
|
|
437
418
|
|
|
438
419
|
@keyframes arc-orbit-hub-left-in {
|
|
@@ -4,7 +4,7 @@ import { computed, inject } from 'vue';
|
|
|
4
4
|
import {
|
|
5
5
|
ARC_ORBIT_CALLOUT_KEY,
|
|
6
6
|
DEFAULT_ARC_ORBIT_COLOR,
|
|
7
|
-
} from '../../../utils/
|
|
7
|
+
} from '../../../utils/core/arc-orbit';
|
|
8
8
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
9
|
|
|
10
10
|
defineOptions({
|
|
@@ -43,24 +43,22 @@ const badgeStyle = computed(() => {
|
|
|
43
43
|
return {
|
|
44
44
|
width: `${props.size}px`,
|
|
45
45
|
height: `${props.size}px`,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
...(badgeColor.value !== DEFAULT_ARC_ORBIT_COLOR
|
|
47
|
+
? { '--alpha-arc-orbit-accent': badgeColor.value }
|
|
48
|
+
: {}),
|
|
49
|
+
...(props.size !== 52
|
|
50
|
+
? { fontSize: `${Math.round(props.size * 0.42)}px` }
|
|
51
|
+
: {}),
|
|
50
52
|
};
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
54
|
-
'alpha-arc-orbit-badge rounded-full flex items-center justify-center font-bold text-
|
|
56
|
+
'alpha-arc-orbit-badge rounded-full flex items-center justify-center font-sans font-bold text-[22px] bg-(--alpha-arc-orbit-accent) text-(--alpha-arc-orbit-badge) shadow-md select-none shrink-0 transition-transform duration-300',
|
|
55
57
|
);
|
|
56
58
|
</script>
|
|
57
59
|
|
|
58
60
|
<template>
|
|
59
|
-
<div
|
|
60
|
-
v-bind="forwardedAttrs()"
|
|
61
|
-
:class="className()"
|
|
62
|
-
:style="badgeStyle"
|
|
63
|
-
>
|
|
61
|
+
<div v-bind="forwardedAttrs()" :class="className()" :style="badgeStyle">
|
|
64
62
|
<slot>{{ badgeId }}</slot>
|
|
65
63
|
</div>
|
|
66
64
|
</template>
|
|
@@ -14,10 +14,9 @@ import {
|
|
|
14
14
|
ARC_ORBIT_ROOT_KEY,
|
|
15
15
|
DEFAULT_ARC_ORBIT_COLOR,
|
|
16
16
|
DEFAULT_ARC_ORBIT_ITEMS,
|
|
17
|
-
type IArcOrbitItem,
|
|
18
17
|
type IResolvedArcOrbitItem,
|
|
19
18
|
type TArcOrbitPosition,
|
|
20
|
-
} from '../../../utils/
|
|
19
|
+
} from '../../../utils/core/arc-orbit';
|
|
21
20
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
22
21
|
import ArcOrbitBadge from './ArcOrbitBadge.vue';
|
|
23
22
|
import ArcOrbitContent from './ArcOrbitContent.vue';
|
|
@@ -32,8 +31,6 @@ export interface IArcOrbitCalloutProps {
|
|
|
32
31
|
readonly position?: TArcOrbitPosition;
|
|
33
32
|
readonly index?: number;
|
|
34
33
|
readonly id?: string | number;
|
|
35
|
-
readonly title?: string;
|
|
36
|
-
readonly description?: string;
|
|
37
34
|
readonly color?: string;
|
|
38
35
|
readonly textColor?: string;
|
|
39
36
|
readonly textGap?: number;
|
|
@@ -43,8 +40,6 @@ const props = withDefaults(defineProps<IArcOrbitCalloutProps>(), {
|
|
|
43
40
|
position: undefined,
|
|
44
41
|
index: undefined,
|
|
45
42
|
id: undefined,
|
|
46
|
-
title: undefined,
|
|
47
|
-
description: undefined,
|
|
48
43
|
color: undefined,
|
|
49
44
|
textColor: undefined,
|
|
50
45
|
textGap: undefined,
|
|
@@ -111,9 +106,8 @@ const activeItem = computed<IResolvedArcOrbitItem>(() => {
|
|
|
111
106
|
const defaultColor = rootContext?.color.value ?? DEFAULT_ARC_ORBIT_COLOR;
|
|
112
107
|
|
|
113
108
|
const id = props.id ?? customItem?.id ?? defaultItem.id;
|
|
114
|
-
const title =
|
|
115
|
-
const description =
|
|
116
|
-
props.description ?? customItem?.description ?? defaultItem.description;
|
|
109
|
+
const title = '';
|
|
110
|
+
const description = '';
|
|
117
111
|
const color =
|
|
118
112
|
props.color ?? customItem?.color ?? defaultColor ?? defaultItem.color;
|
|
119
113
|
const textColor =
|
|
@@ -302,15 +296,12 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
302
296
|
<!-- Left position: [Badge] [Heading + Content] -->
|
|
303
297
|
<template v-if="!isRight">
|
|
304
298
|
<component :is="badgeNode" v-if="badgeNode" />
|
|
305
|
-
<ArcOrbitBadge v-else />
|
|
306
299
|
<div
|
|
307
300
|
class="flex flex-col items-start text-left min-w-0 pt-0.5"
|
|
308
301
|
:style="textStyle"
|
|
309
302
|
>
|
|
310
303
|
<component :is="headingNode" v-if="headingNode" />
|
|
311
|
-
<ArcOrbitHeading v-else />
|
|
312
304
|
<component :is="contentNode" v-if="contentNode" />
|
|
313
|
-
<ArcOrbitContent v-else />
|
|
314
305
|
<component :is="node" v-for="(node, i) in otherNodes" :key="i" />
|
|
315
306
|
</div>
|
|
316
307
|
</template>
|
|
@@ -321,59 +312,66 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
|
321
312
|
:style="textStyle"
|
|
322
313
|
>
|
|
323
314
|
<component :is="headingNode" v-if="headingNode" />
|
|
324
|
-
<ArcOrbitHeading v-else />
|
|
325
315
|
<component :is="contentNode" v-if="contentNode" />
|
|
326
|
-
<ArcOrbitContent v-else />
|
|
327
316
|
<component :is="node" v-for="(node, i) in otherNodes" :key="i" />
|
|
328
317
|
</div>
|
|
329
318
|
<component :is="badgeNode" v-if="badgeNode" />
|
|
330
|
-
<ArcOrbitBadge v-else />
|
|
331
319
|
</template>
|
|
332
320
|
</div>
|
|
333
321
|
</template>
|
|
334
322
|
|
|
335
323
|
<style scoped>
|
|
336
|
-
|
|
337
|
-
.alpha-arc-orbit-callout :deep(
|
|
338
|
-
.alpha-arc-orbit-callout :deep(
|
|
339
|
-
.alpha-arc-orbit-callout :deep(
|
|
340
|
-
.alpha-arc-orbit-callout :deep(
|
|
341
|
-
.alpha-arc-orbit-callout :deep(
|
|
342
|
-
.alpha-arc-orbit-callout :deep(
|
|
343
|
-
|
|
344
|
-
|
|
324
|
+
@layer alpha-theme-tokens {
|
|
325
|
+
.alpha-arc-orbit-callout :deep(p),
|
|
326
|
+
.alpha-arc-orbit-callout :deep(h1),
|
|
327
|
+
.alpha-arc-orbit-callout :deep(h2),
|
|
328
|
+
.alpha-arc-orbit-callout :deep(h3),
|
|
329
|
+
.alpha-arc-orbit-callout :deep(h4),
|
|
330
|
+
.alpha-arc-orbit-callout :deep(h5),
|
|
331
|
+
.alpha-arc-orbit-callout :deep(h6) {
|
|
332
|
+
margin: 0;
|
|
333
|
+
padding: 0;
|
|
334
|
+
}
|
|
345
335
|
}
|
|
346
336
|
|
|
347
337
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-0 {
|
|
348
|
-
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
338
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
339
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 120ms) both;
|
|
349
340
|
}
|
|
350
341
|
|
|
351
342
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-1 {
|
|
352
|
-
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
343
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
344
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 200ms) both;
|
|
353
345
|
}
|
|
354
346
|
|
|
355
347
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-2 {
|
|
356
|
-
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
348
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
349
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 280ms) both;
|
|
357
350
|
}
|
|
358
351
|
|
|
359
352
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-3 {
|
|
360
|
-
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
353
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
354
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 360ms) both;
|
|
361
355
|
}
|
|
362
356
|
|
|
363
357
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-0 {
|
|
364
|
-
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
358
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
359
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 120ms) both;
|
|
365
360
|
}
|
|
366
361
|
|
|
367
362
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-1 {
|
|
368
|
-
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
363
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
364
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 200ms) both;
|
|
369
365
|
}
|
|
370
366
|
|
|
371
367
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-2 {
|
|
372
|
-
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
368
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
369
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 280ms) both;
|
|
373
370
|
}
|
|
374
371
|
|
|
375
372
|
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-3 {
|
|
376
|
-
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
373
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1)
|
|
374
|
+
calc(var(--alpha-arc-orbit-start-delay, 0ms) + 360ms) both;
|
|
377
375
|
}
|
|
378
376
|
|
|
379
377
|
@keyframes arc-orbit-fade-left {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
ARC_ORBIT_CALLOUT_KEY,
|
|
6
|
-
DEFAULT_LOREM_TEXT,
|
|
7
|
-
} from '../../../utils/arcOrbit';
|
|
4
|
+
import { ARC_ORBIT_CALLOUT_KEY } from '../../../utils/core/arc-orbit';
|
|
8
5
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
6
|
|
|
10
7
|
defineOptions({
|
|
@@ -32,21 +29,18 @@ const contentStyle = computed(() => {
|
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
return {
|
|
35
|
-
|
|
32
|
+
'--alpha-arc-orbit-content': contentColor.value,
|
|
33
|
+
'--alpha-arc-comparison-content': contentColor.value,
|
|
36
34
|
};
|
|
37
35
|
});
|
|
38
36
|
|
|
39
37
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
40
|
-
'alpha-arc-orbit-content font-sans
|
|
38
|
+
'alpha-arc-orbit-content font-sans leading-[1.3] text-(--alpha-arc-orbit-content) opacity-90',
|
|
41
39
|
);
|
|
42
40
|
</script>
|
|
43
41
|
|
|
44
42
|
<template>
|
|
45
|
-
<p
|
|
46
|
-
|
|
47
|
-
:class="className()"
|
|
48
|
-
:style="contentStyle"
|
|
49
|
-
>
|
|
50
|
-
<slot>{{ calloutContext?.item.value.description ?? DEFAULT_LOREM_TEXT }}</slot>
|
|
43
|
+
<p v-bind="forwardedAttrs()" :class="className()" :style="contentStyle">
|
|
44
|
+
<slot />
|
|
51
45
|
</p>
|
|
52
46
|
</template>
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
ARC_ORBIT_CALLOUT_KEY,
|
|
6
|
-
DEFAULT_ARC_ORBIT_COLOR,
|
|
7
|
-
} from '../../../utils/arcOrbit';
|
|
4
|
+
import { ARC_ORBIT_CALLOUT_KEY } from '../../../utils/core/arc-orbit';
|
|
8
5
|
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
6
|
|
|
10
7
|
defineOptions({
|
|
@@ -27,29 +24,34 @@ const headingColor = computed(() => {
|
|
|
27
24
|
props.color ??
|
|
28
25
|
calloutContext?.item.value.color ??
|
|
29
26
|
calloutContext?.color.value ??
|
|
30
|
-
|
|
27
|
+
undefined
|
|
31
28
|
);
|
|
32
29
|
});
|
|
33
30
|
|
|
34
31
|
const headingStyle = computed(() => {
|
|
32
|
+
if (!headingColor.value) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
35
36
|
return {
|
|
36
37
|
color: headingColor.value,
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
'--alpha-arc-orbit-heading': headingColor.value,
|
|
39
|
+
'--alpha-arc-comparison-heading': headingColor.value,
|
|
39
40
|
};
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
43
|
-
'alpha-arc-orbit-heading font-
|
|
44
|
+
'alpha-arc-orbit-heading mb-0.5 font-sans font-bold leading-tight tracking-tight text-(--alpha-arc-orbit-heading)',
|
|
44
45
|
);
|
|
45
46
|
</script>
|
|
46
47
|
|
|
47
48
|
<template>
|
|
48
|
-
<
|
|
49
|
+
<h4
|
|
50
|
+
v-if="$slots.default"
|
|
49
51
|
v-bind="forwardedAttrs()"
|
|
50
52
|
:class="className()"
|
|
51
53
|
:style="headingStyle"
|
|
52
54
|
>
|
|
53
|
-
<slot>{{
|
|
54
|
-
</
|
|
55
|
+
<slot>{{ '' }}</slot>
|
|
56
|
+
</h4>
|
|
55
57
|
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Color defaults shared by this component family. */
|
|
2
|
+
@layer alpha-theme-tokens {
|
|
3
|
+
:root {
|
|
4
|
+
--alpha-arc-orbit-heading: var(--alpha-arc-orbit-accent);
|
|
5
|
+
--alpha-arc-orbit-title: var(--alpha-arc-orbit-accent);
|
|
6
|
+
--alpha-arc-orbit-accent: #ea580c;
|
|
7
|
+
--alpha-arc-orbit-badge: #ffffff;
|
|
8
|
+
--alpha-arc-orbit-content: var(--alpha-foreground-primary, #475569);
|
|
9
|
+
--alpha-arc-orbit-guide-dot: #94a3b8;
|
|
10
|
+
--alpha-arc-orbit-guide-stroke: var(--alpha-stroke-primary);
|
|
11
|
+
--alpha-arc-orbit-hub-fill: #f1f3f6;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dark,
|
|
15
|
+
html.dark {
|
|
16
|
+
--alpha-arc-orbit-guide-dot: #475569;
|
|
17
|
+
--alpha-arc-orbit-guide-stroke: #334155;
|
|
18
|
+
--alpha-arc-orbit-hub-fill: #1e293bcc;
|
|
19
|
+
}
|
|
20
|
+
}
|