@alphacifer/slidev-addon-theme 0.0.10 → 0.0.12

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 (227) hide show
  1. package/README.md +134 -76
  2. package/components/card/chevron-card/ChevronCard.vue +44 -32
  3. package/components/card/chevron-card/ChevronCardBadge.vue +14 -8
  4. package/components/card/chevron-card/ChevronCardContent.vue +15 -13
  5. package/components/card/chevron-card/style.css +12 -0
  6. package/components/card/{horiz-card/HorizCard.vue → horizontal-card/HorizontalCard.vue} +78 -85
  7. package/components/card/{horiz-card/HorizCardBadge.vue → horizontal-card/HorizontalCardBadge.vue} +15 -10
  8. package/components/card/{horiz-card/HorizCardContent.vue → horizontal-card/HorizontalCardContent.vue} +11 -11
  9. package/components/card/{horiz-card/HorizCardIcon.vue → horizontal-card/HorizontalCardIcon.vue} +24 -38
  10. package/components/card/horizontal-card/style.css +17 -0
  11. package/components/card/{vert-card/VertCard.vue → vertical-card/VerticalCard.vue} +80 -103
  12. package/components/card/{vert-card/VertCardBadge.vue → vertical-card/VerticalCardBadge.vue} +15 -10
  13. package/components/card/{vert-card/VertCardContent.vue → vertical-card/VerticalCardContent.vue} +13 -12
  14. package/components/card/{vert-card/VertCardIcon.vue → vertical-card/VerticalCardIcon.vue} +15 -33
  15. package/components/card/vertical-card/style.css +19 -0
  16. package/components/comparisons/arc-comparison/ArcComparison.vue +376 -80
  17. package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +9 -4
  18. package/components/comparisons/arc-comparison/ArcComparisonContent.vue +9 -4
  19. package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +9 -4
  20. package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +39 -63
  21. package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +9 -8
  22. package/components/comparisons/arc-comparison/ArcComparisonRight.vue +39 -63
  23. package/components/comparisons/arc-comparison/style.css +27 -0
  24. package/components/comparisons/table-comparison/TableComparison.vue +8 -90
  25. package/components/comparisons/table-comparison/TableComparisonCell.vue +22 -20
  26. package/components/comparisons/table-comparison/{TableComparisonCol.vue → TableComparisonColumn.vue} +16 -14
  27. package/components/comparisons/table-comparison/{TableComparisonCols.vue → TableComparisonColumns.vue} +5 -8
  28. package/components/comparisons/table-comparison/TableComparisonRow.vue +10 -14
  29. package/components/comparisons/table-comparison/TableComparisonRows.vue +1 -4
  30. package/components/comparisons/table-comparison/style.css +15 -0
  31. package/components/core/Date.vue +2 -5
  32. package/components/core/MetaList.vue +50 -0
  33. package/components/core/QnA.vue +1 -1
  34. package/components/core/Quote.vue +3 -6
  35. package/components/core/ReflectedTitle.vue +2 -6
  36. package/components/core/Speaker.vue +6 -11
  37. package/components/core/TransitionHeading.vue +2 -5
  38. package/components/core/arc-orbit/ArcOrbit.vue +65 -84
  39. package/components/core/arc-orbit/ArcOrbitBadge.vue +9 -11
  40. package/components/core/arc-orbit/ArcOrbitCallout.vue +19 -23
  41. package/components/core/arc-orbit/ArcOrbitContent.vue +6 -12
  42. package/components/core/arc-orbit/ArcOrbitHeading.vue +13 -11
  43. package/components/core/arc-orbit/style.css +20 -0
  44. package/components/core/style.css +9 -0
  45. package/components/core/thanks/{ThanksContent.vue → SquareThanks.vue} +36 -31
  46. package/components/core/thanks/SquareThanksContent.vue +87 -0
  47. package/components/core/thanks/ThanksOutlineSquare.vue +2 -5
  48. package/components/core/thanks/ThanksSquare.vue +2 -5
  49. package/components/core/thanks/style.css +30 -0
  50. package/components/defense-in-depth/{arc-did/ArcDiD.vue → arc-defense-in-depth/ArcDefenseInDepth.vue} +167 -97
  51. package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayer.vue +240 -0
  52. package/components/defense-in-depth/{arc-did/ArcDiDLayerTitle.vue → arc-defense-in-depth/ArcDefenseInDepthLayerHeading.vue} +27 -29
  53. package/components/defense-in-depth/{arc-did/ArcDiDLayerPart.vue → arc-defense-in-depth/ArcDefenseInDepthLayerPart.vue} +91 -39
  54. package/components/defense-in-depth/{arc-did/ArcDiDLayerSector.vue → arc-defense-in-depth/ArcDefenseInDepthLayerSector.vue} +37 -23
  55. package/components/defense-in-depth/arc-defense-in-depth/style.css +38 -0
  56. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetrad.vue → rectangle-orbit-tetrad/RectangleOrbitTetrad.vue} +66 -63
  57. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradCallout.vue → rectangle-orbit-tetrad/RectangleOrbitTetradCallout.vue} +58 -46
  58. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradCenter.vue +54 -0
  59. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradContent.vue +44 -0
  60. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradHeading.vue +27 -0
  61. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradIcon.vue → rectangle-orbit-tetrad/RectangleOrbitTetradIcon.vue} +23 -13
  62. package/components/facets/tetrad/rectangle-orbit-tetrad/style.css +22 -0
  63. package/components/facets/triad/arrow-triad/ArrowTriad.vue +99 -109
  64. package/components/facets/triad/arrow-triad/ArrowTriadCallout.vue +31 -59
  65. package/components/facets/triad/arrow-triad/ArrowTriadContent.vue +18 -13
  66. package/components/facets/triad/arrow-triad/ArrowTriadHeading.vue +20 -13
  67. package/components/facets/triad/arrow-triad/ArrowTriadIcon.vue +14 -9
  68. package/components/facets/triad/arrow-triad/style.css +15 -0
  69. package/components/facets/triad/gear-triad/GearTriad.vue +73 -64
  70. package/components/facets/triad/gear-triad/GearTriadCallout.vue +58 -53
  71. package/components/facets/triad/gear-triad/GearTriadCenter.vue +9 -4
  72. package/components/facets/triad/gear-triad/GearTriadContent.vue +21 -36
  73. package/components/facets/triad/gear-triad/GearTriadDetail.vue +92 -0
  74. package/components/facets/triad/gear-triad/GearTriadDetails.vue +169 -0
  75. package/components/facets/triad/gear-triad/GearTriadDetailsContent.vue +18 -0
  76. package/components/facets/triad/gear-triad/GearTriadDetailsHeading.vue +60 -0
  77. package/components/facets/triad/gear-triad/GearTriadHeading.vue +19 -13
  78. package/components/facets/triad/gear-triad/GearTriadIcon.vue +22 -9
  79. package/components/facets/triad/gear-triad/style.css +26 -0
  80. package/components/facets/triad/{hex-triad/HexTriad.vue → hexagon-triad/HexagonTriad.vue} +81 -63
  81. package/components/facets/triad/{hex-triad/HexTriadBadge.vue → hexagon-triad/HexagonTriadBadge.vue} +38 -12
  82. package/components/facets/triad/{hex-triad/HexTriadCallout.vue → hexagon-triad/HexagonTriadCallout.vue} +35 -31
  83. package/components/facets/triad/hexagon-triad/HexagonTriadCenterBadge.vue +74 -0
  84. package/components/facets/triad/hexagon-triad/HexagonTriadContent.vue +34 -0
  85. package/components/facets/triad/hexagon-triad/HexagonTriadHeading.vue +44 -0
  86. package/components/facets/triad/{hex-triad/HexTriadLayer.vue → hexagon-triad/HexagonTriadLayer.vue} +12 -4
  87. package/components/facets/triad/hexagon-triad/style.css +22 -0
  88. package/components/process/arc-arrow-process/ArcArrowProcess.vue +13 -35
  89. package/components/process/arc-arrow-process/ArcArrowProcessArrow.vue +20 -21
  90. package/components/process/arc-arrow-process/ArcArrowProcessCallout.vue +30 -71
  91. package/components/process/arc-arrow-process/ArcArrowProcessContent.vue +18 -13
  92. package/components/process/arc-arrow-process/ArcArrowProcessHeading.vue +18 -18
  93. package/components/process/arc-arrow-process/ArcArrowProcessIcon.vue +23 -11
  94. package/components/process/arc-arrow-process/style.css +20 -0
  95. package/components/pyramid/circular-pyramid/CircularPyramid.vue +269 -170
  96. package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +70 -52
  97. package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +47 -37
  98. package/components/pyramid/circular-pyramid/{CircularPyramidStackTitle.vue → CircularPyramidStackHeading.vue} +49 -45
  99. package/components/pyramid/circular-pyramid/style.css +26 -0
  100. package/components/pyramid/square-pyramid/SquarePyramid.vue +191 -62
  101. package/components/pyramid/square-pyramid/SquarePyramidStack.vue +74 -49
  102. package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +47 -33
  103. package/components/pyramid/square-pyramid/{SquarePyramidStackTitle.vue → SquarePyramidStackHeading.vue} +49 -41
  104. package/components/pyramid/square-pyramid/style.css +48 -0
  105. package/components/style.css +35 -0
  106. package/layouts/core/arc-toc.vue +40 -45
  107. package/layouts/core/bg-center.vue +7 -6
  108. package/layouts/core/references.vue +84 -0
  109. package/layouts/core/style.css +47 -0
  110. package/layouts/shifting-heading/shifting-intro.vue +4 -13
  111. package/layouts/thanks/thanks.vue +5 -5
  112. package/package.json +7 -5
  113. package/style.css +17 -0
  114. package/uno.config.ts +1 -0
  115. package/utils/activateOnKeyboard.ts +14 -0
  116. package/utils/{chevronCard → card/chevron-card}/context.ts +1 -1
  117. package/utils/card/chevron-card/index.ts +1 -0
  118. package/utils/card/horizontal-card/context.ts +12 -0
  119. package/utils/{horizCard/createHorizCardGeometry.ts → card/horizontal-card/createHorizontalCardGeometry.ts} +10 -45
  120. package/utils/card/horizontal-card/index.ts +2 -0
  121. package/utils/card/vertical-card/context.ts +19 -0
  122. package/utils/{vertCard/createVertCardGeometry.ts → card/vertical-card/createVerticalCardGeometry.ts} +9 -130
  123. package/utils/card/vertical-card/index.ts +2 -0
  124. package/utils/colors.ts +93 -0
  125. package/utils/{arcComparison → comparisons/arc-comparison}/context.ts +0 -11
  126. package/utils/{arcComparison → comparisons/arc-comparison}/createArcComparisonGeometry.ts +1 -1
  127. package/utils/comparisons/arc-comparison/resolveArcComparisonItems.ts +33 -0
  128. package/utils/comparisons/table-comparison/constants.ts +47 -0
  129. package/utils/{tableComparison → comparisons/table-comparison}/context.ts +2 -2
  130. package/utils/{arcOrbit → core/arc-orbit}/resolveArcOrbitItems.ts +11 -15
  131. package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/context.ts +34 -31
  132. package/utils/{defenseInDepth/arcDid/createArcDiDGeometry.ts → defense-in-depth/arc-defense-in-depth/createArcDefenseInDepthGeometry.ts} +69 -39
  133. package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/types.ts +39 -35
  134. package/utils/defense-in-depth/shared/colors.ts +51 -0
  135. package/utils/defense-in-depth/shared/constants.ts +22 -0
  136. package/utils/{defenseInDepth → defense-in-depth}/shared/types.ts +0 -5
  137. package/utils/facets/tetrad/rectangle-orbit-tetrad/context.ts +31 -0
  138. package/utils/{rectOrbitTetrad/createRectOrbitTetradGeometry.ts → facets/tetrad/rectangle-orbit-tetrad/createRectangleOrbitTetradGeometry.ts} +5 -104
  139. package/utils/facets/tetrad/rectangle-orbit-tetrad/index.ts +3 -0
  140. package/utils/{rectOrbitTetrad/resolveRectOrbitTetradItems.ts → facets/tetrad/rectangle-orbit-tetrad/resolveRectangleOrbitTetradItems.ts} +41 -49
  141. package/utils/{arrowTriad → facets/triad/arrow-triad}/resolveArrowTriadItems.ts +27 -28
  142. package/utils/{gearTriad → facets/triad/gear-triad}/context.ts +5 -5
  143. package/utils/{gearTriad → facets/triad/gear-triad}/createGearTriadGeometry.ts +2 -0
  144. package/utils/{gearTriad → facets/triad/gear-triad}/resolveGearTriadItems.ts +23 -24
  145. package/utils/facets/triad/hexagon-triad/context.ts +25 -0
  146. package/utils/{hexTriad/createHexTriadGeometry.ts → facets/triad/hexagon-triad/createHexagonTriadGeometry.ts} +11 -27
  147. package/utils/facets/triad/hexagon-triad/index.ts +3 -0
  148. package/utils/facets/triad/hexagon-triad/resolveHexagonTriadItems.ts +60 -0
  149. package/utils/{shiftingHeading → layouts/shifting-heading}/collectShiftingIntroNodes.ts +1 -0
  150. package/utils/layouts/table-of-contents/calculateTocCenterAlignmentOffset.ts +17 -0
  151. package/utils/{tableOfContents → layouts/table-of-contents}/calculateTocMarkerPositions.ts +0 -12
  152. package/utils/{tableOfContents → layouts/table-of-contents}/createTocConnectorPath.ts +11 -5
  153. package/utils/{mergeUno → merge-uno}/classifyVisual.ts +1 -1
  154. package/utils/{mergeUno → merge-uno}/collectClassNames.ts +9 -3
  155. package/utils/process/arc-arrow-process/resolveArcArrowProcessItems.ts +180 -0
  156. package/utils/pyramid/circular-pyramid/context.ts +1 -4
  157. package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +6 -10
  158. package/utils/pyramid/shared/colors.ts +33 -83
  159. package/utils/pyramid/shared/constants.ts +2 -2
  160. package/utils/pyramid/shared/types.ts +0 -5
  161. package/utils/pyramid/square-pyramid/context.ts +1 -4
  162. package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +6 -10
  163. package/utils/useDiagramAutoScale.ts +8 -6
  164. package/utils/useMergedUnoAttrs.ts +9 -5
  165. package/components/card/chevron-card/ChevronCardHeading.vue +0 -39
  166. package/components/card/horiz-card/HorizCardHeading.vue +0 -47
  167. package/components/card/vert-card/VertCardHeading.vue +0 -68
  168. package/components/card/vert-card/VertCardTitle.vue +0 -76
  169. package/components/comparisons/arc-comparison/ArcComparisonContents.vue +0 -17
  170. package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +0 -29
  171. package/components/core/arc-orbit/ArcOrbitContents.vue +0 -18
  172. package/components/core/arc-orbit/ArcOrbitTitle.vue +0 -50
  173. package/components/defense-in-depth/arc-did/ArcDiDLayer.vue +0 -321
  174. package/components/defense-in-depth/arc-did/ArcDiDLayerParts.vue +0 -11
  175. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue +0 -53
  176. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue +0 -39
  177. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue +0 -44
  178. package/components/facets/triad/gear-triad/GearTriadContents.vue +0 -111
  179. package/components/facets/triad/gear-triad/GearTriadDescription.vue +0 -38
  180. package/components/facets/triad/hex-triad/HexTriadCenterBadge.vue +0 -51
  181. package/components/facets/triad/hex-triad/HexTriadContent.vue +0 -20
  182. package/components/facets/triad/hex-triad/HexTriadHeading.vue +0 -28
  183. package/layouts/core/table-of-contents.vue +0 -30
  184. package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +0 -189
  185. package/utils/arcComparison/resolveArcComparisonItems.ts +0 -102
  186. package/utils/chevronCard/createChevronCardGeometry.ts +0 -48
  187. package/utils/chevronCard/index.ts +0 -2
  188. package/utils/defenseInDepth/arcDid/index.ts +0 -3
  189. package/utils/defenseInDepth/index.ts +0 -2
  190. package/utils/defenseInDepth/shared/colors.ts +0 -121
  191. package/utils/defenseInDepth/shared/constants.ts +0 -14
  192. package/utils/defenseInDepth/shared/index.ts +0 -3
  193. package/utils/hexTriad/context.ts +0 -25
  194. package/utils/hexTriad/index.ts +0 -3
  195. package/utils/hexTriad/resolveHexTriadItems.ts +0 -63
  196. package/utils/horizCard/context.ts +0 -13
  197. package/utils/horizCard/index.ts +0 -2
  198. package/utils/pyramid/index.ts +0 -3
  199. package/utils/rectOrbitTetrad/context.ts +0 -31
  200. package/utils/rectOrbitTetrad/index.ts +0 -3
  201. package/utils/tableComparison/constants.ts +0 -72
  202. package/utils/tableOfContents/calculateTocCenterAlignmentOffset.ts +0 -11
  203. package/utils/vertCard/context.ts +0 -18
  204. package/utils/vertCard/index.ts +0 -2
  205. package/utils/{arcComparison → comparisons/arc-comparison}/index.ts +0 -0
  206. package/utils/{tableComparison → comparisons/table-comparison}/index.ts +0 -0
  207. package/utils/{arcOrbit → core/arc-orbit}/context.ts +0 -0
  208. package/utils/{arcOrbit → core/arc-orbit}/createArcOrbitGeometry.ts +0 -0
  209. package/utils/{arcOrbit → core/arc-orbit}/index.ts +0 -0
  210. package/utils/{arrowTriad → facets/triad/arrow-triad}/context.ts +0 -0
  211. package/utils/{arrowTriad → facets/triad/arrow-triad}/createArrowTriadGeometry.ts +0 -0
  212. package/utils/{arrowTriad → facets/triad/arrow-triad}/index.ts +0 -0
  213. package/utils/{gearTriad → facets/triad/gear-triad}/index.ts +0 -0
  214. package/utils/{tableOfContents → layouts/table-of-contents}/calculateUniformTocArticleWidth.ts +0 -0
  215. package/utils/{tableOfContents → layouts/table-of-contents}/createTocArcPath.ts +0 -0
  216. package/utils/{tableOfContents → layouts/table-of-contents}/index.ts +0 -0
  217. package/utils/{mergeUno → merge-uno}/classifyLayout.ts +0 -0
  218. package/utils/{mergeUno → merge-uno}/classifySimple.ts +0 -0
  219. package/utils/{mergeUno → merge-uno}/classifyTypography.ts +0 -0
  220. package/utils/{mergeUno → merge-uno}/classifyUtility.ts +0 -0
  221. package/utils/{mergeUno → merge-uno}/index.ts +0 -0
  222. package/utils/{mergeUno → merge-uno}/mergeClassValues.ts +0 -0
  223. package/utils/{mergeUno → merge-uno}/splitVariantScope.ts +1 -1
  224. package/utils/{mergeUno → merge-uno}/types.ts +0 -0
  225. package/utils/{arcArrowProcess → process/arc-arrow-process}/context.ts +1 -1
  226. /package/utils/{arcArrowProcess → process/arc-arrow-process}/createArcArrowProcessGeometry.ts +0 -0
  227. /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,
@@ -13,20 +14,22 @@ import {
13
14
  watch,
14
15
  } from 'vue';
15
16
 
16
- import { resolvePyramidCardPositions } from '../../../utils/pyramid/shared';
17
+ import {
18
+ PYRAMID_CONTENT_WIDTH_PX,
19
+ PYRAMID_TITLE_WIDTH_PX,
20
+ resolvePyramidCardPositions,
21
+ } from '../../../utils/pyramid/shared';
17
22
  import {
18
23
  clampSquareCount,
19
24
  createSquarePyramidGeometry,
20
25
  DEFAULT_SQUARE_PYRAMID_COLOR,
21
26
  DEFAULT_SQUARE_PYRAMID_STACK_COLORS,
22
- darkenColor,
23
- lightenColor,
24
27
  resolveSquarePyramidPalette,
25
28
  SQUARE_PYRAMID_ROOT_KEY,
26
29
  } from '../../../utils/pyramid/square-pyramid';
30
+ import { darkenColor, lightenColor } from '../../../utils/colors';
27
31
  import { useDiagramAutoScale } from '../../../utils/useDiagramAutoScale';
28
32
  import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
29
- import SquarePyramidStack from './SquarePyramidStack.vue';
30
33
 
31
34
  defineOptions({
32
35
  inheritAttrs: false,
@@ -103,7 +106,7 @@ export interface ISquarePyramidProps {
103
106
  const props = withDefaults(defineProps<ISquarePyramidProps>(), {
104
107
  count: undefined,
105
108
  activeIndex: -1,
106
- color: DEFAULT_SQUARE_PYRAMID_COLOR,
109
+ color: `var(--alpha-square-pyramid-accent, ${DEFAULT_SQUARE_PYRAMID_COLOR})`,
107
110
  colors: undefined,
108
111
  width: undefined,
109
112
  height: undefined,
@@ -177,45 +180,62 @@ interface INamedComponent {
177
180
  }
178
181
 
179
182
  function countSlottedStacks(slotNodes: VNode[] | undefined): number {
180
- if (!slotNodes) return 0;
183
+ if (!slotNodes) {
184
+ return 0;
185
+ }
186
+
181
187
  let count = 0;
188
+
182
189
  for (const node of slotNodes) {
183
190
  if (typeof node.type === 'object' && node.type !== null) {
184
191
  const comp = node.type as INamedComponent['type'];
192
+
185
193
  if (
186
194
  comp?.name === 'SquarePyramidStack' ||
187
195
  comp?.displayName === 'SquarePyramidStack'
188
196
  ) {
189
197
  count++;
198
+
190
199
  continue;
191
200
  }
192
201
  }
202
+
193
203
  if (node.type === Fragment && Array.isArray(node.children)) {
194
204
  count += countSlottedStacks(node.children as VNode[]);
195
205
  }
196
206
  }
207
+
197
208
  return count;
198
209
  }
199
210
 
200
211
  const slottedStackCount = computed(() => {
201
212
  const defaultSlotNodes = slots.default?.();
202
- if (!defaultSlotNodes) return 0;
213
+
214
+ if (!defaultSlotNodes) {
215
+ return 0;
216
+ }
217
+
203
218
  let count = 0;
219
+
204
220
  for (const node of defaultSlotNodes) {
205
221
  if (typeof node.type === 'object' && node.type !== null) {
206
222
  const comp = node.type as INamedComponent['type'];
223
+
207
224
  if (
208
225
  comp?.name === 'SquarePyramidStack' ||
209
226
  comp?.displayName === 'SquarePyramidStack'
210
227
  ) {
211
228
  count++;
229
+
212
230
  continue;
213
231
  }
214
232
  }
233
+
215
234
  if (node.type === Fragment && Array.isArray(node.children)) {
216
235
  count += countSlottedStacks(node.children as VNode[]);
217
236
  }
218
237
  }
238
+
219
239
  return count;
220
240
  });
221
241
 
@@ -227,10 +247,13 @@ function registerStack(
227
247
  colorRef?: ComputedRef<string | undefined>,
228
248
  ) {
229
249
  const token = id ?? Symbol();
250
+
230
251
  if (!registeredStackTokens.value.includes(token)) {
231
252
  registeredStackTokens.value.push(token);
232
253
  }
254
+
233
255
  let stopWatch: (() => void) | undefined;
256
+
234
257
  if (colorRef) {
235
258
  stopWatch = watch(
236
259
  colorRef,
@@ -241,10 +264,14 @@ function registerStack(
241
264
  registeredStackColors.value.delete(token);
242
265
  }
243
266
  },
244
- { immediate: true },
267
+ {
268
+ immediate: true,
269
+ },
245
270
  );
246
271
  }
272
+
247
273
  const index = computed(() => registeredStackTokens.value.indexOf(token));
274
+
248
275
  return {
249
276
  index,
250
277
  unregister: () => {
@@ -260,8 +287,10 @@ function registerStack(
260
287
  function getLayerColor(index: number): string {
261
288
  if (index >= 0 && index < registeredStackTokens.value.length) {
262
289
  const token = registeredStackTokens.value[index];
290
+
263
291
  if (token) {
264
292
  const custom = registeredStackColors.value.get(token);
293
+
265
294
  if (custom) {
266
295
  return custom;
267
296
  }
@@ -269,16 +298,18 @@ function getLayerColor(index: number): string {
269
298
  }
270
299
 
271
300
  const customPaletteColor = props.colors?.[index];
301
+
272
302
  if (customPaletteColor) {
273
303
  return customPaletteColor;
274
304
  }
275
305
 
276
- const stackColor =
277
- DEFAULT_SQUARE_PYRAMID_STACK_COLORS[
278
- Math.abs(index) % DEFAULT_SQUARE_PYRAMID_STACK_COLORS.length
279
- ];
306
+ const stackIndex =
307
+ Math.abs(index) % DEFAULT_SQUARE_PYRAMID_STACK_COLORS.length;
308
+ const stackColor = DEFAULT_SQUARE_PYRAMID_STACK_COLORS[stackIndex];
280
309
 
281
- return stackColor ?? props.color ?? DEFAULT_SQUARE_PYRAMID_COLOR;
310
+ return (
311
+ stackColor ?? `var(--alpha-square-pyramid-stack-${stackIndex + 1}-color)`
312
+ );
282
313
  }
283
314
 
284
315
  const activeLayerColor = computed<string>(() => {
@@ -293,12 +324,15 @@ const resolvedCount = computed(() => {
293
324
  if (props.count !== undefined) {
294
325
  return clampSquareCount(props.count);
295
326
  }
327
+
296
328
  if (slottedStackCount.value > 0) {
297
329
  return clampSquareCount(slottedStackCount.value);
298
330
  }
331
+
299
332
  if (registeredStackTokens.value.length > 0) {
300
333
  return clampSquareCount(registeredStackTokens.value.length);
301
334
  }
335
+
302
336
  return 4;
303
337
  });
304
338
 
@@ -337,13 +371,8 @@ function setActiveIndex(index: number): void {
337
371
  emit('select', index);
338
372
  }
339
373
 
340
- const TITLE_WIDTH_PX = 150;
341
- const CONTENT_WIDTH_PX = 240;
342
- const CONTENT_RIGHT_OFFSET_PX = 0;
343
-
344
- const titleWidthPx = computed(() => TITLE_WIDTH_PX);
345
- const contentWidthPx = computed(() => CONTENT_WIDTH_PX);
346
- const contentRightOffsetPx = computed(() => CONTENT_RIGHT_OFFSET_PX);
374
+ const titleWidthPx = computed(() => PYRAMID_TITLE_WIDTH_PX);
375
+ const contentWidthPx = computed(() => PYRAMID_CONTENT_WIDTH_PX);
347
376
 
348
377
  const cardHeights = ref<number[]>([]);
349
378
  const cardDeltaYList = ref<number[]>([]);
@@ -358,6 +387,7 @@ const initialDeltaYList = computed(() => {
358
387
  minY: 16,
359
388
  maxY: geo.value.viewBoxHeight - 16,
360
389
  });
390
+
361
391
  return resolvedY.map((y, i) => y - (targetY[i] ?? y));
362
392
  });
363
393
 
@@ -365,6 +395,7 @@ function getCardDeltaY(index: number): number {
365
395
  if (cardDeltaYList.value[index] !== undefined) {
366
396
  return cardDeltaYList.value[index] ?? 0;
367
397
  }
398
+
368
399
  return initialDeltaYList.value[index] ?? 0;
369
400
  }
370
401
 
@@ -374,9 +405,11 @@ function updateCardPositions(): void {
374
405
  if (typeof window === 'undefined' || !rootRef.value) {
375
406
  return;
376
407
  }
408
+
377
409
  const cardEls = rootRef.value.querySelectorAll<HTMLElement>(
378
410
  '.alpha-square-pyramid-stack-content',
379
411
  );
412
+
380
413
  if (cardEls.length === 0) {
381
414
  return;
382
415
  }
@@ -403,9 +436,11 @@ function scheduleCardUpdate(): void {
403
436
  if (typeof window === 'undefined') {
404
437
  return;
405
438
  }
439
+
406
440
  if (cardAnimationFrame !== undefined) {
407
441
  cancelAnimationFrame(cardAnimationFrame);
408
442
  }
443
+
409
444
  cardAnimationFrame = requestAnimationFrame(() => {
410
445
  cardAnimationFrame = undefined;
411
446
  updateCardPositions();
@@ -417,10 +452,12 @@ let cardMutationObserver: MutationObserver | null = null;
417
452
 
418
453
  onMounted(() => {
419
454
  scheduleCardUpdate();
455
+
420
456
  if (typeof ResizeObserver !== 'undefined' && rootRef.value) {
421
457
  cardResizeObserver = new ResizeObserver(scheduleCardUpdate);
422
458
  cardResizeObserver.observe(rootRef.value);
423
459
  }
460
+
424
461
  if (typeof MutationObserver !== 'undefined' && rootRef.value) {
425
462
  cardMutationObserver = new MutationObserver(scheduleCardUpdate);
426
463
  cardMutationObserver.observe(rootRef.value, {
@@ -435,6 +472,7 @@ onUnmounted(() => {
435
472
  if (cardAnimationFrame !== undefined) {
436
473
  cancelAnimationFrame(cardAnimationFrame);
437
474
  }
475
+
438
476
  cardResizeObserver?.disconnect();
439
477
  cardMutationObserver?.disconnect();
440
478
  });
@@ -449,7 +487,6 @@ provide(SQUARE_PYRAMID_ROOT_KEY, {
449
487
  interactive: computed(() => props.interactive),
450
488
  titleWidthPx,
451
489
  contentWidthPx,
452
- contentRightOffsetPx,
453
490
  registerStack,
454
491
  getLayerColor,
455
492
  setActiveIndex,
@@ -463,6 +500,7 @@ const stackedLayers = computed(() => {
463
500
 
464
501
  const lowestLayer = computed(() => {
465
502
  const layers = geo.value.layers;
503
+
466
504
  return layers.length > 0 ? layers[layers.length - 1] : undefined;
467
505
  });
468
506
 
@@ -531,6 +569,7 @@ const resolvedHeightStyle = computed(() => {
531
569
  if (resolvedCount.value >= 6) {
532
570
  return '480px';
533
571
  }
572
+
534
573
  if (resolvedCount.value >= 5) {
535
574
  return '450px';
536
575
  }
@@ -553,13 +592,14 @@ function handleContainerClick(event: MouseEvent): void {
553
592
  }
554
593
 
555
594
  const { className, forwardedAttrs } = useMergedUnoAttrs(
556
- 'alpha-square-pyramid w-full flex items-center justify-center select-none relative',
595
+ 'alpha-square-pyramid w-full flex items-center justify-center select-none relative border-0 p-0 m-0 min-w-0 bg-transparent',
557
596
  );
558
597
  </script>
559
598
 
560
599
  <template>
561
- <div
600
+ <fieldset
562
601
  ref="rootRef"
602
+ aria-label="Square pyramid diagram"
563
603
  v-bind="forwardedAttrs()"
564
604
  :class="className()"
565
605
  :data-count="resolvedCount"
@@ -567,14 +607,15 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
567
607
  :style="{
568
608
  width: resolvedWidthStyle,
569
609
  height: resolvedHeightStyle,
570
- '--square-pyramid-start-delay': `${resolvedStartDelay}ms`,
571
- '--square-pyramid-title-width': `${titleWidthPx}px`,
572
- '--square-pyramid-content-width': `${contentWidthPx}px`,
610
+ '--alpha-square-pyramid-start-delay': `${resolvedStartDelay}ms`,
611
+ '--alpha-square-pyramid-stack-heading-width': `${titleWidthPx}px`,
612
+ '--alpha-square-pyramid-stack-content-width': `${contentWidthPx}px`,
573
613
  }"
574
614
  @click="handleContainerClick"
615
+ @keydown="activateOnKeyboard"
575
616
  >
576
617
  <div
577
- class="alpha-square-pyramid__stage relative flex items-center justify-center overflow-visible flex-shrink-0"
618
+ class="alpha-square-pyramid__stage relative flex items-center justify-center overflow-visible shrink-0"
578
619
  :style="{
579
620
  width: `${props.viewBoxWidth ?? 960}px`,
580
621
  height: `${geo.viewBoxHeight}px`,
@@ -593,6 +634,7 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
593
634
  preserveAspectRatio="xMidYMid meet"
594
635
  xmlns="http://www.w3.org/2000/svg"
595
636
  >
637
+ <title>Square pyramid diagram</title>
596
638
  <defs>
597
639
  <!-- Per-layer Gradients: Inactive Frosted Glass & Active Luminous -->
598
640
  <template v-for="layer in geo.layers" :key="layer.index">
@@ -604,8 +646,16 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
604
646
  x2="10%"
605
647
  y2="90%"
606
648
  >
607
- <stop offset="0%" stop-color="#ffffff" stop-opacity="0.9" />
608
- <stop offset="45%" stop-color="#ffffff" stop-opacity="0.7" />
649
+ <stop
650
+ offset="0%"
651
+ stop-color="var(--alpha-square-pyramid-highlight)"
652
+ stop-opacity="0.9"
653
+ />
654
+ <stop
655
+ offset="45%"
656
+ stop-color="var(--alpha-square-pyramid-highlight)"
657
+ stop-opacity="0.7"
658
+ />
609
659
  <stop
610
660
  offset="80%"
611
661
  :stop-color="lightenColor({ hex: getLayerColor(layer.index), ratio: 0.88 })"
@@ -709,24 +759,90 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
709
759
  </filter>
710
760
  </template>
711
761
  <!-- Fallback Global Gradients for Test Spec Compatibility -->
712
- <linearGradient :id="activeTopGradId" x1="90%" y1="10%" x2="15%" y2="90%">
713
- <stop offset="0%" :stop-color="lightenColor({ hex: activeLayerColor, ratio: 0.92 })" stop-opacity="1" />
714
- <stop offset="100%" :stop-color="darkenColor({ hex: activeLayerColor, ratio: 0.18 })" stop-opacity="1" />
762
+ <linearGradient
763
+ :id="activeTopGradId"
764
+ x1="90%"
765
+ y1="10%"
766
+ x2="15%"
767
+ y2="90%"
768
+ >
769
+ <stop
770
+ offset="0%"
771
+ :stop-color="lightenColor({ hex: activeLayerColor, ratio: 0.92 })"
772
+ stop-opacity="1"
773
+ />
774
+ <stop
775
+ offset="100%"
776
+ :stop-color="darkenColor({ hex: activeLayerColor, ratio: 0.18 })"
777
+ stop-opacity="1"
778
+ />
715
779
  </linearGradient>
716
- <linearGradient :id="activeSideGradId" x1="0%" y1="0%" x2="100%" y2="0%">
717
- <stop offset="0%" :stop-color="darkenColor({ hex: activeLayerColor, ratio: 0.25 })" />
718
- <stop offset="100%" :stop-color="lightenColor({ hex: activeLayerColor, ratio: 0.45 })" />
780
+ <linearGradient
781
+ :id="activeSideGradId"
782
+ x1="0%"
783
+ y1="0%"
784
+ x2="100%"
785
+ y2="0%"
786
+ >
787
+ <stop
788
+ offset="0%"
789
+ :stop-color="darkenColor({ hex: activeLayerColor, ratio: 0.25 })"
790
+ />
791
+ <stop
792
+ offset="100%"
793
+ :stop-color="lightenColor({ hex: activeLayerColor, ratio: 0.45 })"
794
+ />
719
795
  </linearGradient>
720
- <linearGradient :id="defaultTopGradId" x1="90%" y1="10%" x2="10%" y2="90%">
721
- <stop offset="0%" stop-color="#ffffff" stop-opacity="0.9" />
722
- <stop offset="100%" :stop-color="lightenColor({ hex: props.color, ratio: 0.78 })" stop-opacity="0.35" />
796
+ <linearGradient
797
+ :id="defaultTopGradId"
798
+ x1="90%"
799
+ y1="10%"
800
+ x2="10%"
801
+ y2="90%"
802
+ >
803
+ <stop
804
+ offset="0%"
805
+ stop-color="var(--alpha-square-pyramid-highlight)"
806
+ stop-opacity="0.9"
807
+ />
808
+ <stop
809
+ offset="100%"
810
+ :stop-color="lightenColor({ hex: props.color, ratio: 0.78 })"
811
+ stop-opacity="0.35"
812
+ />
723
813
  </linearGradient>
724
- <linearGradient :id="defaultSideGradId" x1="0%" y1="0%" x2="100%" y2="0%">
725
- <stop offset="0%" :stop-color="lightenColor({ hex: props.color, ratio: 0.65 })" stop-opacity="0.65" />
726
- <stop offset="100%" :stop-color="lightenColor({ hex: props.color, ratio: 0.88 })" stop-opacity="0.75" />
814
+ <linearGradient
815
+ :id="defaultSideGradId"
816
+ x1="0%"
817
+ y1="0%"
818
+ x2="100%"
819
+ y2="0%"
820
+ >
821
+ <stop
822
+ offset="0%"
823
+ :stop-color="lightenColor({ hex: props.color, ratio: 0.65 })"
824
+ stop-opacity="0.65"
825
+ />
826
+ <stop
827
+ offset="100%"
828
+ :stop-color="lightenColor({ hex: props.color, ratio: 0.88 })"
829
+ stop-opacity="0.75"
830
+ />
727
831
  </linearGradient>
728
- <filter :id="filterActiveShadowId" x="-40%" y="-40%" width="180%" height="200%">
729
- <feDropShadow dx="0" dy="8" stdDeviation="10" :flood-color="activeLayerColor" flood-opacity="0.35" />
832
+ <filter
833
+ :id="filterActiveShadowId"
834
+ x="-40%"
835
+ y="-40%"
836
+ width="180%"
837
+ height="200%"
838
+ >
839
+ <feDropShadow
840
+ dx="0"
841
+ dy="8"
842
+ stdDeviation="10"
843
+ :flood-color="activeLayerColor"
844
+ flood-opacity="0.35"
845
+ />
730
846
  </filter>
731
847
  <!-- Ambient Bottom Surface Shadow -->
732
848
  <filter
@@ -746,7 +862,7 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
746
862
  :cy="lowestLayer.cy + lowestLayer.slabHeight + 14"
747
863
  :rx="lowestLayer.rx * 0.92"
748
864
  :ry="lowestLayer.ry * 0.3"
749
- fill="#0f172a"
865
+ fill="var(--alpha-square-pyramid-center)"
750
866
  opacity="0.1"
751
867
  :filter="`url(#${filterAmbientShadowId})`"
752
868
  />
@@ -758,14 +874,13 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
758
874
  <g
759
875
  v-for="layer in stackedLayers"
760
876
  :key="layer.index"
761
- class="alpha-square-pyramid__layer transition-all duration-300 ease-out pointer-events-auto"
877
+ class="alpha-square-pyramid__layer transition-all duration-300 ease-out pointer-events-none"
762
878
  :class="[
763
879
  layer.index === currentActiveIndex
764
880
  ? 'alpha-square-pyramid__layer--active'
765
881
  : 'alpha-square-pyramid__layer--default',
766
882
  `alpha-square-pyramid__layer--${layer.index}`,
767
- { 'cursor-pointer': props.interactive },
768
- ]"
883
+ ]"
769
884
  :data-layer-index="layer.index"
770
885
  :data-is-active="layer.index === currentActiveIndex"
771
886
  :filter="
@@ -775,9 +890,8 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
775
890
  "
776
891
  :style="{
777
892
  '--layer-order': layer.index,
778
- '--layer-delay': `calc(var(--square-pyramid-start-delay, 0ms) + ${layer.index * 260 + 10}ms)`,
893
+ '--layer-delay': `calc(var(--alpha-square-pyramid-start-delay, 0ms) + ${layer.index * 260 + 10}ms)`,
779
894
  }"
780
- @click.stop="handleLayerClick(layer.index, $event)"
781
895
  >
782
896
  <!-- 1. 3D Square Slab Thickness Rim (Mantle) -->
783
897
  <path
@@ -801,7 +915,7 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
801
915
  :stroke="
802
916
  layer.index === currentActiveIndex
803
917
  ? 'none'
804
- : 'rgba(255, 255, 255, 0.5)'
918
+ : 'var(--alpha-square-pyramid-connector-highlight)'
805
919
  "
806
920
  stroke-width="0.5"
807
921
  />
@@ -809,24 +923,34 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
809
923
  <path
810
924
  class="alpha-square-pyramid__inner transition-all duration-300 pointer-events-none"
811
925
  :d="layer.innerFacePath"
812
- fill="#ffffff"
926
+ fill="var(--alpha-square-pyramid-connector-fill)"
813
927
  :fill-opacity="layer.index === currentActiveIndex ? 0.35 : 0.2"
814
928
  />
815
929
  </g>
816
930
  </g>
817
931
  </svg>
932
+ <template v-if="props.interactive">
933
+ <template v-for="layer in stackedLayers" :key="layer.index">
934
+ <button
935
+ type="button"
936
+ class="alpha-interaction-control"
937
+ :aria-label="`Select layer ${layer.index + 1}`"
938
+ :style="{ clipPath: `path('${layer.sidePath}')` }"
939
+ @click.stop="handleLayerClick(layer.index, $event)"
940
+ />
941
+ <button
942
+ type="button"
943
+ class="alpha-interaction-control"
944
+ :aria-label="`Select layer ${layer.index + 1}`"
945
+ :style="{ clipPath: `path('${layer.topFacePath}')` }"
946
+ @click.stop="handleLayerClick(layer.index, $event)"
947
+ />
948
+ </template>
949
+ </template>
818
950
  </div>
819
- <!-- Slotted or Default Stack Items -->
820
- <slot v-if="slots.default" />
821
- <template v-else>
822
- <SquarePyramidStack
823
- v-for="idx in resolvedCount"
824
- :key="idx - 1"
825
- :index="idx - 1"
826
- />
827
- </template>
951
+ <slot />
828
952
  </div>
829
- </div>
953
+ </fieldset>
830
954
  </template>
831
955
 
832
956
  <style scoped>
@@ -844,7 +968,12 @@ const { className, forwardedAttrs } = useMergedUnoAttrs(
844
968
  }
845
969
 
846
970
  .alpha-square-pyramid--animated .alpha-square-pyramid__layer {
847
- animation: alpha-pyramid-layer-enter 450ms cubic-bezier(0.16, 1, 0.3, 1) var(--layer-delay, calc(var(--square-pyramid-start-delay, 0ms) + 10ms)) both;
971
+ animation: alpha-pyramid-layer-enter 450ms cubic-bezier(0.16, 1, 0.3, 1)
972
+ var(
973
+ --layer-delay,
974
+ calc(var(--alpha-square-pyramid-start-delay, 0ms) + 10ms)
975
+ )
976
+ both;
848
977
  }
849
978
 
850
979
  @keyframes alpha-pyramid-layer-enter {