@alphacifer/slidev-addon-theme 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +80 -0
  2. package/components/pyramid/circular-pyramid/CircularPyramid.vue +871 -0
  3. package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +375 -0
  4. package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +208 -0
  5. package/components/pyramid/circular-pyramid/CircularPyramidStackTitle.vue +138 -0
  6. package/components/pyramid/square-pyramid/SquarePyramid.vue +876 -0
  7. package/components/pyramid/square-pyramid/SquarePyramidStack.vue +366 -0
  8. package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +204 -0
  9. package/components/pyramid/square-pyramid/SquarePyramidStackTitle.vue +134 -0
  10. package/package.json +2 -1
  11. package/utils/pyramid/circular-pyramid/context.ts +46 -0
  12. package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +143 -0
  13. package/utils/pyramid/circular-pyramid/index.ts +3 -0
  14. package/utils/pyramid/circular-pyramid/types.ts +34 -0
  15. package/utils/pyramid/index.ts +3 -0
  16. package/utils/pyramid/shared/colors.ts +92 -0
  17. package/utils/pyramid/shared/connector.ts +111 -0
  18. package/utils/pyramid/shared/constants.ts +8 -0
  19. package/utils/pyramid/shared/index.ts +5 -0
  20. package/utils/pyramid/shared/stacking.ts +76 -0
  21. package/utils/pyramid/shared/types.ts +36 -0
  22. package/utils/pyramid/square-pyramid/context.ts +46 -0
  23. package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +265 -0
  24. package/utils/pyramid/square-pyramid/index.ts +3 -0
  25. package/utils/pyramid/square-pyramid/types.ts +39 -0
  26. package/utils/useDiagramAutoScale.ts +6 -8
@@ -0,0 +1,138 @@
1
+ <script setup lang="ts">
2
+ import { computed, inject } from 'vue';
3
+
4
+ import {
5
+ CIRCULAR_PYRAMID_ROOT_KEY,
6
+ CIRCULAR_PYRAMID_STACK_KEY,
7
+ } from '../../../utils/pyramid/circular-pyramid';
8
+
9
+ defineOptions({
10
+ name: 'CircularPyramidStackTitle',
11
+ });
12
+
13
+ export interface ICircularPyramidStackTitleProps {
14
+ readonly step?: string | number;
15
+ readonly title?: string;
16
+ readonly color?: string;
17
+ readonly minWidth?: number;
18
+ }
19
+
20
+ const props = withDefaults(defineProps<ICircularPyramidStackTitleProps>(), {
21
+ step: undefined,
22
+ title: undefined,
23
+ color: undefined,
24
+ minWidth: 150,
25
+ });
26
+
27
+ const rootContext = inject(CIRCULAR_PYRAMID_ROOT_KEY, undefined);
28
+ const stackContext = inject(CIRCULAR_PYRAMID_STACK_KEY, undefined);
29
+
30
+ const isActive = computed(() => {
31
+ return stackContext?.isActive.value ?? false;
32
+ });
33
+
34
+ const resolvedStep = computed(() => {
35
+ if (props.step !== undefined) {
36
+ return props.step;
37
+ }
38
+ if (stackContext?.step.value !== undefined) {
39
+ return stackContext.step.value;
40
+ }
41
+ return '01';
42
+ });
43
+
44
+ const palette = computed(() => {
45
+ return rootContext?.palette.value;
46
+ });
47
+
48
+ const minPillWidth = computed(() => props.minWidth ?? 150);
49
+
50
+ const stackColor = computed(() => {
51
+ return (
52
+ props.color ??
53
+ stackContext?.color?.value ??
54
+ rootContext?.color.value ??
55
+ '#3b82f6'
56
+ );
57
+ });
58
+ </script>
59
+
60
+ <template>
61
+ <div
62
+ class="alpha-circular-pyramid-stack-title relative w-full flex items-center select-none"
63
+ :class="[
64
+ isActive
65
+ ? 'alpha-circular-pyramid-stack-title--active'
66
+ : 'alpha-circular-pyramid-stack-title--default',
67
+ ]"
68
+ >
69
+ <!-- Pill Badge Container (min-width: 150px, max-width: whole spacing left leaving at least 30px before dot) -->
70
+ <div
71
+ class="alpha-circular-pyramid-stack-title__pill flex items-center gap-2 px-2.5 py-1 rounded-full transition-all duration-300 border flex-shrink-0"
72
+ :style="{
73
+ minWidth: `${minPillWidth}px`,
74
+ maxWidth: 'calc(100% - 30px)',
75
+ width: 'fit-content',
76
+ boxSizing: 'border-box',
77
+ borderColor: stackColor,
78
+ backgroundColor: isActive
79
+ ? 'rgba(255, 255, 255, 0.95)'
80
+ : 'rgba(255, 255, 255, 0.85)',
81
+ boxShadow: isActive
82
+ ? `0 4px 14px ${stackColor}26`
83
+ : 'none',
84
+ }"
85
+ >
86
+ <!-- Circular Step Indicator (Badge using stack color) -->
87
+ <div
88
+ class="w-5.5 h-5.5 rounded-full flex items-center justify-center text-[10px] font-bold tracking-tight transition-all duration-300 flex-shrink-0"
89
+ :style="{
90
+ backgroundColor: stackColor,
91
+ color: '#ffffff',
92
+ }"
93
+ >
94
+ <slot name="step">{{ resolvedStep }}</slot>
95
+ </div>
96
+ <!-- Title Text -->
97
+ <span
98
+ class="text-xs font-semibold tracking-tight transition-colors duration-300 pr-1 truncate flex-1 leading-tight"
99
+ :style="{
100
+ color: isActive ? '#0f172a' : '#334155',
101
+ }"
102
+ >
103
+ <slot>{{ props.title }}</slot>
104
+ </span>
105
+ </div>
106
+ <!-- Scalable Line between Title and Dot (always at least 30px) -->
107
+ <div
108
+ class="alpha-circular-pyramid-stack-title__connector flex-1 flex items-center min-w-[30px] pointer-events-none"
109
+ >
110
+ <div
111
+ class="alpha-circular-pyramid-stack-title__line flex-1 h-[1px] transition-colors duration-300"
112
+ :style="{
113
+ backgroundColor: stackColor,
114
+ opacity: isActive ? 1 : 0.65,
115
+ }"
116
+ />
117
+ <div
118
+ class="alpha-circular-pyramid-stack-title__dot w-1.5 h-1.5 rounded-full flex-shrink-0 -ml-1 transition-all duration-300"
119
+ :style="{
120
+ backgroundColor: stackColor,
121
+ boxShadow: isActive
122
+ ? `0 0 6px ${stackColor}`
123
+ : `0 0 2px ${stackColor}80`,
124
+ }"
125
+ />
126
+ </div>
127
+ </div>
128
+ </template>
129
+
130
+ <style scoped>
131
+ .alpha-circular-pyramid-stack-title {
132
+ box-sizing: border-box;
133
+ }
134
+
135
+ .alpha-circular-pyramid-stack-title--active .alpha-circular-pyramid-stack-title__pill {
136
+ backdrop-filter: blur(8px);
137
+ }
138
+ </style>