origam 2.38.1 → 2.38.2

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 (228) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/src/assets/locales/en.json +1 -1
  3. package/dist/src/assets/locales/fr.json +2 -2
  4. package/dist/src/components/Alert/OrigamAlert.vue +739 -165
  5. package/dist/src/components/App/OrigamApp.vue +95 -19
  6. package/dist/src/components/App/OrigamAppBar.vue +751 -158
  7. package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
  8. package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
  9. package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
  10. package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
  11. package/dist/src/components/Badge/OrigamBadge.vue +548 -135
  12. package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
  13. package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
  14. package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
  15. package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
  16. package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
  17. package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
  18. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
  19. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
  20. package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
  21. package/dist/src/components/Btn/OrigamBtn.vue +928 -249
  22. package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
  23. package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
  24. package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
  25. package/dist/src/components/Card/OrigamCard.vue +938 -194
  26. package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
  27. package/dist/src/components/Card/OrigamCardText.vue +536 -84
  28. package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
  29. package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
  30. package/dist/src/components/Chart/OrigamChart.vue +942 -452
  31. package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
  32. package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
  33. package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
  34. package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
  35. package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
  36. package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
  37. package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
  38. package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
  39. package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
  40. package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
  41. package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
  42. package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
  43. package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
  44. package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
  45. package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
  46. package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
  47. package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
  48. package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
  49. package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
  50. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
  51. package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
  52. package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
  53. package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
  54. package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
  55. package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
  56. package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
  57. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
  58. package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
  59. package/dist/src/components/Chip/OrigamChip.vue +867 -202
  60. package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
  61. package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
  62. package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
  63. package/dist/src/components/Code/OrigamCode.vue +844 -206
  64. package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
  65. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
  66. package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
  67. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
  68. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
  69. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
  70. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
  71. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
  72. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
  73. package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
  74. package/dist/src/components/Counter/OrigamCounter.vue +588 -96
  75. package/dist/src/components/DataList/OrigamDataList.vue +619 -113
  76. package/dist/src/components/DataList/OrigamDataText.vue +295 -65
  77. package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
  78. package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
  79. package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
  80. package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
  81. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
  82. package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
  83. package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
  84. package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
  85. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
  86. package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
  87. package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
  88. package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
  89. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
  90. package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
  91. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
  92. package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
  93. package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
  94. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
  95. package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
  96. package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
  97. package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
  98. package/dist/src/components/Divider/OrigamDivider.vue +210 -50
  99. package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
  100. package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
  101. package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
  102. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
  103. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
  104. package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
  105. package/dist/src/components/Field/OrigamField.vue +1118 -306
  106. package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
  107. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
  108. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
  109. package/dist/src/components/Form/OrigamForm.vue +197 -74
  110. package/dist/src/components/Grid/OrigamGrid.vue +707 -147
  111. package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
  112. package/dist/src/components/Grids/OrigamCol.vue +593 -110
  113. package/dist/src/components/Grids/OrigamContainer.vue +461 -80
  114. package/dist/src/components/Grids/OrigamRow.vue +573 -112
  115. package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
  116. package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
  117. package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
  118. package/dist/src/components/Icon/OrigamIcon.vue +561 -98
  119. package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
  120. package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
  121. package/dist/src/components/Img/OrigamImg.vue +869 -228
  122. package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
  123. package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
  124. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
  125. package/dist/src/components/Input/OrigamInput.vue +747 -180
  126. package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
  127. package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
  128. package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
  129. package/dist/src/components/Label/OrigamLabel.vue +584 -95
  130. package/dist/src/components/Layout/OrigamLayout.vue +563 -94
  131. package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
  132. package/dist/src/components/List/OrigamList.vue +755 -170
  133. package/dist/src/components/List/OrigamListChildren.vue +59 -19
  134. package/dist/src/components/List/OrigamListGroup.vue +631 -134
  135. package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
  136. package/dist/src/components/List/OrigamListItem.vue +890 -224
  137. package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
  138. package/dist/src/components/List/OrigamListSubheader.vue +542 -93
  139. package/dist/src/components/Loader/OrigamLoader.vue +110 -25
  140. package/dist/src/components/Main/OrigamMain.vue +565 -96
  141. package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
  142. package/dist/src/components/Media/OrigamMediaController.vue +465 -182
  143. package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
  144. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
  145. package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
  146. package/dist/src/components/Messages/OrigamMessages.vue +606 -97
  147. package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
  148. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
  149. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
  150. package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
  151. package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
  152. package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
  153. package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
  154. package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
  155. package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
  156. package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
  157. package/dist/src/components/Picker/OrigamPicker.vue +655 -108
  158. package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
  159. package/dist/src/components/Progress/OrigamProgress.vue +436 -70
  160. package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
  161. package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
  162. package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
  163. package/dist/src/components/Radio/OrigamRadio.vue +772 -132
  164. package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
  165. package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
  166. package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
  167. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
  168. package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
  169. package/dist/src/components/Select/OrigamSelect.vue +1639 -567
  170. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
  171. package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
  172. package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
  173. package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
  174. package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
  175. package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
  176. package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
  177. package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
  178. package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
  179. package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
  180. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
  181. package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
  182. package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
  183. package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
  184. package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
  185. package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
  186. package/dist/src/components/Table/OrigamTable.vue +585 -124
  187. package/dist/src/components/Tabs/OrigamTab.vue +239 -73
  188. package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
  189. package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
  190. package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
  191. package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
  192. package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
  193. package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
  194. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
  195. package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
  196. package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
  197. package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
  198. package/dist/src/components/Title/OrigamTitle.vue +505 -82
  199. package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
  200. package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
  201. package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
  202. package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
  203. package/dist/src/components/Transition/OrigamFade.vue +47 -9
  204. package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
  205. package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
  206. package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
  207. package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
  208. package/dist/src/components/Transition/OrigamSnack.vue +52 -10
  209. package/dist/src/components/Transition/OrigamTransition.vue +40 -12
  210. package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
  211. package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
  212. package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
  213. package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
  214. package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
  215. package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
  216. package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
  217. package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
  218. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
  219. package/dist/src/components/Video/OrigamVideo.vue +1178 -331
  220. package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
  221. package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
  222. package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
  223. package/dist/src/components/Window/OrigamWindow.vue +745 -175
  224. package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
  225. package/dist/src/composables/Commons/display.composable.cjs +2 -0
  226. package/dist/src/composables/Commons/display.composable.js +1 -1
  227. package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
  228. package/package.json +6 -6
@@ -256,480 +256,1113 @@ import { BRACKET_DEFAULT_MATCH_GAP, BRACKET_DEFAULT_MATCH_HEIGHT, BRACKET_DEFAUL
256
256
  import { BRACKET_ROUND_SIDE } from "../../enums/Bracket/bracket-round.enum";
257
257
  import { BRACKET_VARIANT } from "../../enums/Bracket/bracket.enum";
258
258
  import { DIRECTION } from "../../enums/Commons/direction.enum";
259
- import {
260
- bracketDashArray,
261
- bracketSurfaceVars,
262
- resolveBracketBorderColor,
263
- resolveBracketBorderWidth,
264
- resolveBracketForeground
265
- } from "../../utils/Bracket/bracket-surface.util";
259
+ import { bracketDashArray, bracketSurfaceVars, resolveBracketBorderColor, resolveBracketBorderWidth, resolveBracketForeground } from "../../utils/Bracket/bracket-surface.util";
260
+ /*********************************************************
261
+ * Global
262
+ ********************************************************/
266
263
  const props = defineProps({
267
- rounds: { type: Array, required: true },
268
- variant: { type: null, required: false, default: BRACKET_VARIANT.SINGLE_ELIMINATION },
269
- direction: { type: String, required: false, default: DIRECTION.HORIZONTAL },
270
- showRoundTitles: { type: Boolean, required: false, default: true },
271
- showScores: { type: Boolean, required: false, default: true },
272
- showSeed: { type: Boolean, required: false, default: false },
273
- interactive: { type: Boolean, required: false, default: true },
274
- winnersLabel: { type: String, required: false, default: void 0 },
275
- losersLabel: { type: String, required: false, default: void 0 },
276
- id: { type: String, required: false },
277
- class: { type: [String, Array, Object], required: false },
278
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
279
- tag: { type: String, required: false, default: "div" },
280
- density: { type: null, required: false },
281
- rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
282
- roundedTopRight: { type: [Boolean, Number, String], required: false },
283
- roundedTopLeft: { type: [Boolean, Number, String], required: false },
284
- roundedBottomLeft: { type: [Boolean, Number, String], required: false },
285
- roundedBottomRight: { type: [Boolean, Number, String], required: false },
286
- color: { type: [String, Object, Boolean, null], required: false, skipCheck: true, default: "primary" },
287
- bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
288
- border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
289
- borderTop: { type: [Boolean, Number, String], required: false },
290
- borderLeft: { type: [Boolean, Number, String], required: false },
291
- borderBottom: { type: [Boolean, Number, String], required: false },
292
- borderRight: { type: [Boolean, Number, String], required: false },
293
- borderBlock: { type: [Boolean, Number, String], required: false },
294
- borderInline: { type: [Boolean, Number, String], required: false },
295
- borderBlockStart: { type: [Boolean, Number, String], required: false },
296
- borderBlockEnd: { type: [Boolean, Number, String], required: false },
297
- borderColor: { type: String, required: false },
298
- borderStyle: { type: String, required: false },
299
- borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
300
- borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
301
- borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
302
- borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
303
- borderBlockStartColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
304
- borderBlockEndColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
305
- height: { type: [Number, String], required: false },
306
- maxHeight: { type: [Number, String], required: false },
307
- maxWidth: { type: [Number, String], required: false },
308
- minHeight: { type: [Number, String], required: false },
309
- minWidth: { type: [Number, String], required: false },
310
- width: { type: [Number, String], required: false },
311
- elevation: { type: [Number, String], required: false },
312
- margin: { type: [Boolean, Number, String], required: false },
313
- marginTop: { type: [Boolean, Number, String], required: false },
314
- marginLeft: { type: [Boolean, Number, String], required: false },
315
- marginBottom: { type: [Boolean, Number, String], required: false },
316
- marginRight: { type: [Boolean, Number, String], required: false },
317
- marginBlock: { type: [Boolean, Number, String], required: false },
318
- marginInline: { type: [Boolean, Number, String], required: false },
319
- marginInlineStart: { type: [Boolean, Number, String], required: false },
320
- marginInlineEnd: { type: [Boolean, Number, String], required: false },
321
- marginBlockStart: { type: [Boolean, Number, String], required: false },
322
- marginBlockEnd: { type: [Boolean, Number, String], required: false },
323
- padding: { type: [Boolean, Number, String], required: false },
324
- paddingTop: { type: [Boolean, Number, String], required: false },
325
- paddingLeft: { type: [Boolean, Number, String], required: false },
326
- paddingBottom: { type: [Boolean, Number, String], required: false },
327
- paddingRight: { type: [Boolean, Number, String], required: false },
328
- paddingBlock: { type: [Boolean, Number, String], required: false },
329
- paddingInline: { type: [Boolean, Number, String], required: false },
330
- paddingInlineStart: { type: [Boolean, Number, String], required: false },
331
- paddingInlineEnd: { type: [Boolean, Number, String], required: false },
332
- paddingBlockStart: { type: [Boolean, Number, String], required: false },
333
- paddingBlockEnd: { type: [Boolean, Number, String], required: false },
334
- fontSize: { type: null, required: false },
335
- fontWeight: { type: null, required: false },
336
- letterSpacing: { type: null, required: false }
264
+ rounds: {
265
+ type: Array,
266
+ required: true
267
+ },
268
+ variant: {
269
+ type: null,
270
+ required: false,
271
+ default: BRACKET_VARIANT.SINGLE_ELIMINATION
272
+ },
273
+ direction: {
274
+ type: String,
275
+ required: false,
276
+ default: DIRECTION.HORIZONTAL
277
+ },
278
+ showRoundTitles: {
279
+ type: Boolean,
280
+ required: false,
281
+ default: true
282
+ },
283
+ showScores: {
284
+ type: Boolean,
285
+ required: false,
286
+ default: true
287
+ },
288
+ showSeed: {
289
+ type: Boolean,
290
+ required: false,
291
+ default: false
292
+ },
293
+ interactive: {
294
+ type: Boolean,
295
+ required: false,
296
+ default: true
297
+ },
298
+ winnersLabel: {
299
+ type: String,
300
+ required: false,
301
+ default: undefined
302
+ },
303
+ losersLabel: {
304
+ type: String,
305
+ required: false,
306
+ default: undefined
307
+ },
308
+ id: {
309
+ type: String,
310
+ required: false
311
+ },
312
+ class: {
313
+ type: [
314
+ String,
315
+ Array,
316
+ Object
317
+ ],
318
+ required: false
319
+ },
320
+ style: {
321
+ type: [
322
+ String,
323
+ Array,
324
+ Object,
325
+ Boolean,
326
+ null
327
+ ],
328
+ required: false,
329
+ skipCheck: true
330
+ },
331
+ tag: {
332
+ type: String,
333
+ required: false,
334
+ default: "div"
335
+ },
336
+ density: {
337
+ type: null,
338
+ required: false
339
+ },
340
+ rounded: {
341
+ type: [
342
+ Boolean,
343
+ Number,
344
+ String,
345
+ null
346
+ ],
347
+ required: false,
348
+ skipCheck: true
349
+ },
350
+ roundedTopRight: {
351
+ type: [
352
+ Boolean,
353
+ Number,
354
+ String
355
+ ],
356
+ required: false
357
+ },
358
+ roundedTopLeft: {
359
+ type: [
360
+ Boolean,
361
+ Number,
362
+ String
363
+ ],
364
+ required: false
365
+ },
366
+ roundedBottomLeft: {
367
+ type: [
368
+ Boolean,
369
+ Number,
370
+ String
371
+ ],
372
+ required: false
373
+ },
374
+ roundedBottomRight: {
375
+ type: [
376
+ Boolean,
377
+ Number,
378
+ String
379
+ ],
380
+ required: false
381
+ },
382
+ color: {
383
+ type: [
384
+ String,
385
+ Object,
386
+ Boolean,
387
+ null
388
+ ],
389
+ required: false,
390
+ skipCheck: true,
391
+ default: "primary"
392
+ },
393
+ bgColor: {
394
+ type: [
395
+ String,
396
+ Object,
397
+ Boolean,
398
+ null
399
+ ],
400
+ required: false,
401
+ skipCheck: true
402
+ },
403
+ border: {
404
+ type: [
405
+ Boolean,
406
+ Number,
407
+ String,
408
+ Array
409
+ ],
410
+ required: false,
411
+ skipCheck: true
412
+ },
413
+ borderTop: {
414
+ type: [
415
+ Boolean,
416
+ Number,
417
+ String
418
+ ],
419
+ required: false
420
+ },
421
+ borderLeft: {
422
+ type: [
423
+ Boolean,
424
+ Number,
425
+ String
426
+ ],
427
+ required: false
428
+ },
429
+ borderBottom: {
430
+ type: [
431
+ Boolean,
432
+ Number,
433
+ String
434
+ ],
435
+ required: false
436
+ },
437
+ borderRight: {
438
+ type: [
439
+ Boolean,
440
+ Number,
441
+ String
442
+ ],
443
+ required: false
444
+ },
445
+ borderBlock: {
446
+ type: [
447
+ Boolean,
448
+ Number,
449
+ String
450
+ ],
451
+ required: false
452
+ },
453
+ borderInline: {
454
+ type: [
455
+ Boolean,
456
+ Number,
457
+ String
458
+ ],
459
+ required: false
460
+ },
461
+ borderBlockStart: {
462
+ type: [
463
+ Boolean,
464
+ Number,
465
+ String
466
+ ],
467
+ required: false
468
+ },
469
+ borderBlockEnd: {
470
+ type: [
471
+ Boolean,
472
+ Number,
473
+ String
474
+ ],
475
+ required: false
476
+ },
477
+ borderColor: {
478
+ type: String,
479
+ required: false
480
+ },
481
+ borderStyle: {
482
+ type: String,
483
+ required: false
484
+ },
485
+ borderTopColor: {
486
+ type: [
487
+ String,
488
+ Object,
489
+ Boolean,
490
+ null
491
+ ],
492
+ required: false,
493
+ skipCheck: true
494
+ },
495
+ borderRightColor: {
496
+ type: [
497
+ String,
498
+ Object,
499
+ Boolean,
500
+ null
501
+ ],
502
+ required: false,
503
+ skipCheck: true
504
+ },
505
+ borderBottomColor: {
506
+ type: [
507
+ String,
508
+ Object,
509
+ Boolean,
510
+ null
511
+ ],
512
+ required: false,
513
+ skipCheck: true
514
+ },
515
+ borderLeftColor: {
516
+ type: [
517
+ String,
518
+ Object,
519
+ Boolean,
520
+ null
521
+ ],
522
+ required: false,
523
+ skipCheck: true
524
+ },
525
+ borderBlockStartColor: {
526
+ type: [
527
+ String,
528
+ Object,
529
+ Boolean,
530
+ null
531
+ ],
532
+ required: false,
533
+ skipCheck: true
534
+ },
535
+ borderBlockEndColor: {
536
+ type: [
537
+ String,
538
+ Object,
539
+ Boolean,
540
+ null
541
+ ],
542
+ required: false,
543
+ skipCheck: true
544
+ },
545
+ height: {
546
+ type: [Number, String],
547
+ required: false
548
+ },
549
+ maxHeight: {
550
+ type: [Number, String],
551
+ required: false
552
+ },
553
+ maxWidth: {
554
+ type: [Number, String],
555
+ required: false
556
+ },
557
+ minHeight: {
558
+ type: [Number, String],
559
+ required: false
560
+ },
561
+ minWidth: {
562
+ type: [Number, String],
563
+ required: false
564
+ },
565
+ width: {
566
+ type: [Number, String],
567
+ required: false
568
+ },
569
+ elevation: {
570
+ type: [Number, String],
571
+ required: false
572
+ },
573
+ margin: {
574
+ type: [
575
+ Boolean,
576
+ Number,
577
+ String
578
+ ],
579
+ required: false
580
+ },
581
+ marginTop: {
582
+ type: [
583
+ Boolean,
584
+ Number,
585
+ String
586
+ ],
587
+ required: false
588
+ },
589
+ marginLeft: {
590
+ type: [
591
+ Boolean,
592
+ Number,
593
+ String
594
+ ],
595
+ required: false
596
+ },
597
+ marginBottom: {
598
+ type: [
599
+ Boolean,
600
+ Number,
601
+ String
602
+ ],
603
+ required: false
604
+ },
605
+ marginRight: {
606
+ type: [
607
+ Boolean,
608
+ Number,
609
+ String
610
+ ],
611
+ required: false
612
+ },
613
+ marginBlock: {
614
+ type: [
615
+ Boolean,
616
+ Number,
617
+ String
618
+ ],
619
+ required: false
620
+ },
621
+ marginInline: {
622
+ type: [
623
+ Boolean,
624
+ Number,
625
+ String
626
+ ],
627
+ required: false
628
+ },
629
+ marginInlineStart: {
630
+ type: [
631
+ Boolean,
632
+ Number,
633
+ String
634
+ ],
635
+ required: false
636
+ },
637
+ marginInlineEnd: {
638
+ type: [
639
+ Boolean,
640
+ Number,
641
+ String
642
+ ],
643
+ required: false
644
+ },
645
+ marginBlockStart: {
646
+ type: [
647
+ Boolean,
648
+ Number,
649
+ String
650
+ ],
651
+ required: false
652
+ },
653
+ marginBlockEnd: {
654
+ type: [
655
+ Boolean,
656
+ Number,
657
+ String
658
+ ],
659
+ required: false
660
+ },
661
+ padding: {
662
+ type: [
663
+ Boolean,
664
+ Number,
665
+ String
666
+ ],
667
+ required: false
668
+ },
669
+ paddingTop: {
670
+ type: [
671
+ Boolean,
672
+ Number,
673
+ String
674
+ ],
675
+ required: false
676
+ },
677
+ paddingLeft: {
678
+ type: [
679
+ Boolean,
680
+ Number,
681
+ String
682
+ ],
683
+ required: false
684
+ },
685
+ paddingBottom: {
686
+ type: [
687
+ Boolean,
688
+ Number,
689
+ String
690
+ ],
691
+ required: false
692
+ },
693
+ paddingRight: {
694
+ type: [
695
+ Boolean,
696
+ Number,
697
+ String
698
+ ],
699
+ required: false
700
+ },
701
+ paddingBlock: {
702
+ type: [
703
+ Boolean,
704
+ Number,
705
+ String
706
+ ],
707
+ required: false
708
+ },
709
+ paddingInline: {
710
+ type: [
711
+ Boolean,
712
+ Number,
713
+ String
714
+ ],
715
+ required: false
716
+ },
717
+ paddingInlineStart: {
718
+ type: [
719
+ Boolean,
720
+ Number,
721
+ String
722
+ ],
723
+ required: false
724
+ },
725
+ paddingInlineEnd: {
726
+ type: [
727
+ Boolean,
728
+ Number,
729
+ String
730
+ ],
731
+ required: false
732
+ },
733
+ paddingBlockStart: {
734
+ type: [
735
+ Boolean,
736
+ Number,
737
+ String
738
+ ],
739
+ required: false
740
+ },
741
+ paddingBlockEnd: {
742
+ type: [
743
+ Boolean,
744
+ Number,
745
+ String
746
+ ],
747
+ required: false
748
+ },
749
+ fontSize: {
750
+ type: null,
751
+ required: false
752
+ },
753
+ fontWeight: {
754
+ type: null,
755
+ required: false
756
+ },
757
+ letterSpacing: {
758
+ type: null,
759
+ required: false
760
+ }
337
761
  });
338
- const emit = defineEmits(["match-click", "winner-click", "competitor-click"]);
762
+ const emit = defineEmits([
763
+ "match-click",
764
+ "winner-click",
765
+ "competitor-click"
766
+ ]);
339
767
  defineSlots();
340
768
  const { filterProps } = useProps(props);
341
769
  const resolvedId = computed(() => props.id ?? "origam-bracket");
770
+ /*********************************************************
771
+ * Libelles — critere C8
772
+ *
773
+ * @description
774
+ * `ariaLabel` etait une chaine anglaise en dur, et `winnersLabel` /
775
+ * `losersLabel` portaient leur traduction anglaise comme VALEUR PAR
776
+ * DEFAUT de prop — un cas que les conventions du depot couvrent
777
+ * explicitement. Toute la famille Bracket etait intraduisible : aucun
778
+ * de ses quatre composants n'appelait `useLocale`.
779
+ * @description
780
+ * Le defaut passe a `undefined` et la traduction est resolue dans un
781
+ * `computed` : c'est NON CASSANT — un consommateur qui passait deja sa
782
+ * propre chaine continue de gagner, exactement comme avant. Faire
783
+ * porter une CLE i18n a la prop aurait, lui, casse ces consommateurs.
784
+ * @description
785
+ * La resolution est differee dans un `computed` et non figee au corps
786
+ * de `setup()` : le resolveur de theme (ADR-005) ecrit dans
787
+ * `beforeCreate`, donc APRES `setup()`. Une lecture eager de
788
+ * `props.winnersLabel` ne verrait jamais la valeur d'un theme.
789
+ ********************************************************/
342
790
  const { t } = useLocale();
343
791
  const ariaLabel = computed(() => t("origam.bracket.aria_label"));
344
792
  const resolvedWinnersLabel = computed(() => props.winnersLabel ?? t("origam.bracket.winners_label"));
345
793
  const resolvedLosersLabel = computed(() => props.losersLabel ?? t("origam.bracket.losers_label"));
794
+ /*********************************************************
795
+ * roundColor (#428)
796
+ *
797
+ * @description
798
+ * `withDefaults` gives `props.color` a hard default (`'primary'`), so
799
+ * reading it directly here ALWAYS produced a concrete value — never
800
+ * `undefined` — even when THIS component's own consumer never set
801
+ * `color` at all. Forwarded unconditionally onto every
802
+ * `<origam-bracket-round>` below, that concrete value permanently
803
+ * outranked any `theme.components['origam-bracket-round'].color`
804
+ * (the resolver's own precedence: an explicit passed value always
805
+ * wins — see ADR-005 / #411). Measured: mounting a Round standalone
806
+ * under a theme naming `origam-bracket-round: { color: 'danger' }`
807
+ * resolved `'danger'`; the SAME Round nested inside `<origam-bracket>`
808
+ * resolved `'primary'` instead — forced by this binding.
809
+ * `usePassedProps` distinguishes "the consumer of THIS Bracket wrote
810
+ * `color=…`" from "Bracket's own default resolved it" — only the
811
+ * former forwards down, letting Round's own theme/default apply
812
+ * otherwise. Same guard already used by `OrigamBottomNav` /
813
+ * `OrigamRadioGroup` / `OrigamChipGroup` / `OrigamBtnGroup` for the
814
+ * identical class of problem.
815
+ * @description
816
+ * `IBracketRoundProps.color` expects `TIntent | undefined` but
817
+ * `IBracketProps` inherits `color` from `IColorProps` (`TColor`).
818
+ * Cast to the narrower type expected by child round components —
819
+ * type-only, no runtime change.
820
+ ********************************************************/
346
821
  const wasPropPassed = usePassedProps(props);
347
822
  const roundColor = computed(() => {
348
- return wasPropPassed("color") ? props.color : void 0;
823
+ return wasPropPassed("color") ? props.color : undefined;
349
824
  });
825
+ /*********************************************************
826
+ * Display rounds
827
+ *
828
+ * @description
829
+ * Single-elimination and round-robin pass straight through.
830
+ * Double-elimination sorts rounds into Winner Bracket, then
831
+ * Loser Bracket, then Grand Final — preserving the input
832
+ * order within each group.
833
+ ********************************************************/
350
834
  const displayRounds = computed(() => {
351
- if (props.variant !== BRACKET_VARIANT.DOUBLE_ELIMINATION) return props.rounds;
352
- const winners = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.WINNER || r.side === void 0);
353
- const losers = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.LOSER);
354
- const grandFinals = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.GRAND_FINAL);
355
- return [...winners, ...losers, ...grandFinals];
835
+ if (props.variant !== BRACKET_VARIANT.DOUBLE_ELIMINATION) return props.rounds;
836
+ const winners = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.WINNER || r.side === undefined);
837
+ const losers = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.LOSER);
838
+ const grandFinals = props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.GRAND_FINAL);
839
+ return [
840
+ ...winners,
841
+ ...losers,
842
+ ...grandFinals
843
+ ];
356
844
  });
357
- const winnerRounds = computed(() => props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.WINNER || r.side === void 0));
845
+ /*********************************************************
846
+ * Double-elimination sections
847
+ *
848
+ * @description
849
+ * A real double-elimination is two independent trees — the
850
+ * Winner Bracket and the Loser Bracket — that converge on a
851
+ * single Grand Final. The Winner Bracket champion carries a
852
+ * one-round head start into that match (set via the match's
853
+ * `advantage`, rendered as a `+N` badge on its competitor row).
854
+ * Each section is rendered as its own tree; empty sections are
855
+ * dropped.
856
+ ********************************************************/
857
+ const winnerRounds = computed(() => props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.WINNER || r.side === undefined));
358
858
  const loserRounds = computed(() => props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.LOSER));
359
859
  const grandFinalRounds = computed(() => props.rounds.filter((r) => r.side === BRACKET_ROUND_SIDE.GRAND_FINAL));
360
860
  const doubleSections = computed(() => {
361
- const all = [
362
- { key: "winners", label: resolvedWinnersLabel.value, rounds: winnerRounds.value },
363
- { key: "losers", label: resolvedLosersLabel.value, rounds: loserRounds.value },
364
- { key: "grand-final", label: "", rounds: grandFinalRounds.value }
365
- ];
366
- return all.filter((section) => section.rounds.length > 0);
861
+ const all = [
862
+ {
863
+ key: "winners",
864
+ label: resolvedWinnersLabel.value,
865
+ rounds: winnerRounds.value
866
+ },
867
+ {
868
+ key: "losers",
869
+ label: resolvedLosersLabel.value,
870
+ rounds: loserRounds.value
871
+ },
872
+ {
873
+ key: "grand-final",
874
+ label: "",
875
+ rounds: grandFinalRounds.value
876
+ }
877
+ ];
878
+ return all.filter((section) => section.rounds.length > 0);
367
879
  });
880
+ /*********************************************************
881
+ * Round-robin computed
882
+ *
883
+ * @description
884
+ * For round-robin we ignore the round axis and collapse
885
+ * every match into a competitor x competitor lookup.
886
+ ********************************************************/
368
887
  const roundRobinCompetitors = computed(() => {
369
- const seen = /* @__PURE__ */ new Map();
370
- for (const round of props.rounds) {
371
- for (const match of round.matches) {
372
- if (match.competitorA && !seen.has(match.competitorA.id)) {
373
- seen.set(match.competitorA.id, match.competitorA);
374
- }
375
- if (match.competitorB && !seen.has(match.competitorB.id)) {
376
- seen.set(match.competitorB.id, match.competitorB);
377
- }
378
- }
379
- }
380
- return Array.from(seen.values());
888
+ const seen = new Map();
889
+ for (const round of props.rounds) {
890
+ for (const match of round.matches) {
891
+ if (match.competitorA && !seen.has(match.competitorA.id)) {
892
+ seen.set(match.competitorA.id, match.competitorA);
893
+ }
894
+ if (match.competitorB && !seen.has(match.competitorB.id)) {
895
+ seen.set(match.competitorB.id, match.competitorB);
896
+ }
897
+ }
898
+ }
899
+ return Array.from(seen.values());
381
900
  });
382
901
  const roundRobinMap = computed(() => {
383
- const out = /* @__PURE__ */ new Map();
384
- for (const round of props.rounds) {
385
- for (const match of round.matches) {
386
- if (!match.competitorA || !match.competitorB) continue;
387
- const aId = match.competitorA.id;
388
- const bId = match.competitorB.id;
389
- out.set(`${aId}|${bId}`, match);
390
- }
391
- }
392
- return out;
902
+ const out = new Map();
903
+ for (const round of props.rounds) {
904
+ for (const match of round.matches) {
905
+ if (!match.competitorA || !match.competitorB) continue;
906
+ const aId = match.competitorA.id;
907
+ const bId = match.competitorB.id;
908
+ out.set(`${aId}|${bId}`, match);
909
+ }
910
+ }
911
+ return out;
393
912
  });
394
913
  const findRoundRobinMatch = (rowId, colId) => {
395
- return roundRobinMap.value.get(`${rowId}|${colId}`) ?? roundRobinMap.value.get(`${colId}|${rowId}`);
914
+ return roundRobinMap.value.get(`${rowId}|${colId}`) ?? roundRobinMap.value.get(`${colId}|${rowId}`);
396
915
  };
397
916
  const roundRobinScore = (row, col) => {
398
- const match = findRoundRobinMatch(row.id, col.id);
399
- if (!match) return "";
400
- const isOrderedNormal = match.competitorA?.id === row.id;
401
- const rowScore = isOrderedNormal ? match.scoreA : match.scoreB;
402
- const colScore = isOrderedNormal ? match.scoreB : match.scoreA;
403
- if (rowScore == null && colScore == null) return "";
404
- return `${rowScore ?? "\u2014"} \u2013 ${colScore ?? "\u2014"}`;
917
+ const match = findRoundRobinMatch(row.id, col.id);
918
+ if (!match) return "";
919
+ const isOrderedNormal = match.competitorA?.id === row.id;
920
+ const rowScore = isOrderedNormal ? match.scoreA : match.scoreB;
921
+ const colScore = isOrderedNormal ? match.scoreB : match.scoreA;
922
+ if (rowScore == null && colScore == null) return "";
923
+ return `${rowScore ?? "—"} – ${colScore ?? "—"}`;
405
924
  };
406
925
  const roundRobinCellClasses = (row, col) => {
407
- const isDiag = row.id === col.id;
408
- const match = findRoundRobinMatch(row.id, col.id);
409
- const isWinner = match?.winnerId === row.id;
410
- return [
411
- "origam-bracket__rr-cell",
412
- {
413
- "origam-bracket__rr-cell--diag": isDiag,
414
- "origam-bracket__rr-cell--winner": isWinner,
415
- "origam-bracket__rr-cell--clickable": !isDiag && match && props.interactive
416
- }
417
- ];
926
+ const isDiag = row.id === col.id;
927
+ const match = findRoundRobinMatch(row.id, col.id);
928
+ const isWinner = match?.winnerId === row.id;
929
+ return ["origam-bracket__rr-cell", {
930
+ "origam-bracket__rr-cell--diag": isDiag,
931
+ "origam-bracket__rr-cell--winner": isWinner,
932
+ "origam-bracket__rr-cell--clickable": !isDiag && match && props.interactive
933
+ }];
418
934
  };
935
+ /*********************************************************
936
+ * describeRoundRobinCell — critere C8
937
+ *
938
+ * @description
939
+ * Trois libelles d'aria-label ecrits en dur en anglais, non couverts
940
+ * par le correctif #388 (portait uniquement sur l'aria-label racine,
941
+ * `winnersLabel` / `losersLabel`, `OrigamBracketMatch` et
942
+ * `OrigamBracketCompetitor`). Trouve en reparant, absent du classeur.
943
+ * @description
944
+ * Le suffixe de score reutilise `origam.bracket.score_aria_suffix`,
945
+ * deja declare pour le meme usage sur `OrigamBracketCompetitor` — pas
946
+ * de cle dupliquee pour un concept identique.
947
+ ********************************************************/
419
948
  const describeRoundRobinCell = (row, col) => {
420
- if (row.id === col.id) return t("origam.bracket.round_robin.cell_self", row.name);
421
- const match = findRoundRobinMatch(row.id, col.id);
422
- if (!match) return t("origam.bracket.round_robin.cell_no_match", row.name, col.name);
423
- const score = roundRobinScore(row, col);
424
- const base = t("origam.bracket.round_robin.cell_match", row.name, col.name);
425
- return score ? `${base}${t("origam.bracket.score_aria_suffix", score)}` : base;
949
+ if (row.id === col.id) return t("origam.bracket.round_robin.cell_self", row.name);
950
+ const match = findRoundRobinMatch(row.id, col.id);
951
+ if (!match) return t("origam.bracket.round_robin.cell_no_match", row.name, col.name);
952
+ const score = roundRobinScore(row, col);
953
+ const base = t("origam.bracket.round_robin.cell_match", row.name, col.name);
954
+ return score ? `${base}${t("origam.bracket.score_aria_suffix", score)}` : base;
426
955
  };
427
956
  const onRoundRobinCellClick = (row, col, event) => {
428
- if (row.id === col.id) return;
429
- const match = findRoundRobinMatch(row.id, col.id);
430
- if (!match) return;
431
- const round = props.rounds.find((r) => r.matches.some((m) => m.id === match.id));
432
- if (!round) return;
433
- emit("match-click", match, round, event);
957
+ if (row.id === col.id) return;
958
+ const match = findRoundRobinMatch(row.id, col.id);
959
+ if (!match) return;
960
+ const round = props.rounds.find((r) => r.matches.some((m) => m.id === match.id));
961
+ if (!round) return;
962
+ emit("match-click", match, round, event);
434
963
  };
964
+ /*********************************************************
965
+ * Connector layout
966
+ *
967
+ * @description
968
+ * Pure-function path computation. Each round occupies one
969
+ * column of width `matchWidth`. Matches inside a round are
970
+ * evenly spaced — the spacing doubles at each round so the
971
+ * tree branches classically.
972
+ *
973
+ * Connector path = horizontal exit (16px) + vertical
974
+ * traversal to the centre of the target match + horizontal
975
+ * entry (16px).
976
+ ********************************************************/
435
977
  const matchWidth = BRACKET_DEFAULT_MATCH_WIDTH;
436
978
  const matchHeight = BRACKET_DEFAULT_MATCH_HEIGHT;
437
979
  const baseGap = BRACKET_DEFAULT_MATCH_GAP;
438
980
  const roundGap = BRACKET_DEFAULT_ROUND_GAP;
439
981
  const isHorizontal = computed(() => props.direction === DIRECTION.HORIZONTAL);
982
+ /*********************************************************
983
+ * Round thickness — direction-aware
984
+ *
985
+ * @description
986
+ * In horizontal mode each round is a column of width `matchWidth`
987
+ * (~240 px). In vertical mode each round is a row whose thickness
988
+ * controls how compact the bracket is vertically AND where the SVG
989
+ * connectors anchor. Using `matchWidth` (240) leaves a lot of empty
990
+ * space below every match card; using a tighter value keeps the
991
+ * connectors aligned with the cards while shrinking the layout.
992
+ ********************************************************/
440
993
  const verticalRoundThickness = 120;
441
994
  const showConnectors = computed(() => {
442
- if (props.variant === BRACKET_VARIANT.ROUND_ROBIN) return false;
443
- return displayRounds.value.length > 1;
995
+ if (props.variant === BRACKET_VARIANT.ROUND_ROBIN) return false;
996
+ return displayRounds.value.length > 1;
444
997
  });
445
998
  const maxMatchesInRound = computed(() => {
446
- let max = 1;
447
- for (const r of displayRounds.value) {
448
- if (r.matches.length > max) max = r.matches.length;
449
- }
450
- return max;
999
+ let max = 1;
1000
+ for (const r of displayRounds.value) {
1001
+ if (r.matches.length > max) max = r.matches.length;
1002
+ }
1003
+ return max;
451
1004
  });
452
1005
  const totalHeight = computed(() => {
453
- return maxMatchesInRound.value * (matchHeight + baseGap);
1006
+ return maxMatchesInRound.value * (matchHeight + baseGap);
454
1007
  });
455
1008
  const treeRef = ref(null);
456
1009
  const doubleRef = ref(null);
457
1010
  const connectorViewBox = ref("0 0 0 0");
1011
+ /*********************************************************
1012
+ * Connector measurement (real DOM positions)
1013
+ *
1014
+ * @description
1015
+ * Connectors are drawn from the *measured* centre of each
1016
+ * match card rather than a computed grid. The flex layout
1017
+ * (space-around + gap) and the per-round title offset move
1018
+ * cards away from any formula-predicted position, so a
1019
+ * formula produced visibly off-centre, unbalanced links.
1020
+ * Measuring the live rects keeps every link anchored to the
1021
+ * exact middle of the card it leaves / enters, whatever the
1022
+ * title, density, scores or gap.
1023
+ ********************************************************/
458
1024
  const connectorPaths = ref([]);
1025
+ /*********************************************************
1026
+ * Double-elimination connectors (id-driven)
1027
+ *
1028
+ * @description
1029
+ * The two trees + grand final converge in arbitrary positions,
1030
+ * so connectors are driven purely by `nextMatchId`: every match
1031
+ * that declares a downstream id draws a link to it, wherever that
1032
+ * card lands. Measured against the whole double-elim container so
1033
+ * WB-final → GF and LB-final → GF both resolve across the trees.
1034
+ ********************************************************/
459
1035
  const measureDoubleConnectors = () => {
460
- const rootEl = doubleRef.value;
461
- if (!rootEl || !showConnectors.value) {
462
- connectorPaths.value = [];
463
- return;
464
- }
465
- const rootRect = rootEl.getBoundingClientRect();
466
- connectorViewBox.value = `0 0 ${rootRect.width} ${rootRect.height}`;
467
- const rectById = /* @__PURE__ */ new Map();
468
- rootEl.querySelectorAll("[data-match-id]").forEach((card) => {
469
- rectById.set(String(card.dataset.matchId), card.getBoundingClientRect());
470
- });
471
- const paths = [];
472
- for (const round of props.rounds) {
473
- for (const match of round.matches) {
474
- if (match.nextMatchId == null) continue;
475
- const fromRect = rectById.get(String(match.id));
476
- const toRect = rectById.get(String(match.nextMatchId));
477
- if (!fromRect || !toRect) continue;
478
- const fromCenterY = fromRect.top - rootRect.top + fromRect.height / 2;
479
- const toCenterY = toRect.top - rootRect.top + toRect.height / 2;
480
- const startX = fromRect.right - rootRect.left;
481
- const endX = toRect.left - rootRect.left;
482
- const midX = (startX + endX) / 2;
483
- paths.push({
484
- key: `${match.id}-${match.nextMatchId}`,
485
- d: `M ${startX},${fromCenterY} L ${midX},${fromCenterY} L ${midX},${toCenterY} L ${endX},${toCenterY}`,
486
- from: { matchId: match.id, x: startX, y: fromCenterY },
487
- to: { matchId: match.nextMatchId, x: endX, y: toCenterY },
488
- winner: match.winnerId != null
489
- });
490
- }
491
- }
492
- connectorPaths.value = paths;
1036
+ const rootEl = doubleRef.value;
1037
+ if (!rootEl || !showConnectors.value) {
1038
+ connectorPaths.value = [];
1039
+ return;
1040
+ }
1041
+ const rootRect = rootEl.getBoundingClientRect();
1042
+ connectorViewBox.value = `0 0 ${rootRect.width} ${rootRect.height}`;
1043
+ const rectById = new Map();
1044
+ rootEl.querySelectorAll("[data-match-id]").forEach((card) => {
1045
+ rectById.set(String(card.dataset.matchId), card.getBoundingClientRect());
1046
+ });
1047
+ const paths = [];
1048
+ for (const round of props.rounds) {
1049
+ for (const match of round.matches) {
1050
+ if (match.nextMatchId == null) continue;
1051
+ const fromRect = rectById.get(String(match.id));
1052
+ const toRect = rectById.get(String(match.nextMatchId));
1053
+ if (!fromRect || !toRect) continue;
1054
+ const fromCenterY = fromRect.top - rootRect.top + fromRect.height / 2;
1055
+ const toCenterY = toRect.top - rootRect.top + toRect.height / 2;
1056
+ const startX = fromRect.right - rootRect.left;
1057
+ const endX = toRect.left - rootRect.left;
1058
+ const midX = (startX + endX) / 2;
1059
+ paths.push({
1060
+ key: `${match.id}-${match.nextMatchId}`,
1061
+ d: `M ${startX},${fromCenterY} L ${midX},${fromCenterY} L ${midX},${toCenterY} L ${endX},${toCenterY}`,
1062
+ from: {
1063
+ matchId: match.id,
1064
+ x: startX,
1065
+ y: fromCenterY
1066
+ },
1067
+ to: {
1068
+ matchId: match.nextMatchId,
1069
+ x: endX,
1070
+ y: toCenterY
1071
+ },
1072
+ winner: match.winnerId != null
1073
+ });
1074
+ }
1075
+ }
1076
+ connectorPaths.value = paths;
493
1077
  };
494
1078
  const measureSingleConnectors = () => {
495
- const treeEl = treeRef.value;
496
- if (!treeEl || !showConnectors.value) {
497
- connectorPaths.value = [];
498
- return;
499
- }
500
- const treeRect = treeEl.getBoundingClientRect();
501
- connectorViewBox.value = `0 0 ${treeRect.width} ${treeRect.height}`;
502
- const roundEls = Array.from(treeEl.querySelectorAll(".origam-bracket__round"));
503
- const cardsPerRound = roundEls.map((roundEl) => {
504
- const matchesEl = roundEl.querySelector(".origam-bracket-round__matches");
505
- return matchesEl ? Array.from(matchesEl.children).map((card) => card.getBoundingClientRect()) : [];
506
- });
507
- const horiz = isHorizontal.value;
508
- const paths = [];
509
- for (let r = 0; r < displayRounds.value.length - 1; r += 1) {
510
- const round = displayRounds.value[r];
511
- const nextRound = displayRounds.value[r + 1];
512
- const fromCards = cardsPerRound[r] ?? [];
513
- const toCards = cardsPerRound[r + 1] ?? [];
514
- for (let i = 0; i < round.matches.length; i += 1) {
515
- const match = round.matches[i];
516
- let nextIndex = -1;
517
- if (match.nextMatchId != null) {
518
- nextIndex = nextRound.matches.findIndex((m) => m.id === match.nextMatchId);
519
- }
520
- if (nextIndex === -1) nextIndex = Math.floor(i / 2);
521
- const nextMatch = nextRound.matches[nextIndex];
522
- const fromRect = fromCards[i];
523
- const toRect = toCards[nextIndex];
524
- if (!nextMatch || !fromRect || !toRect) continue;
525
- const fromCenterX = fromRect.left - treeRect.left + fromRect.width / 2;
526
- const fromCenterY = fromRect.top - treeRect.top + fromRect.height / 2;
527
- const toCenterX = toRect.left - treeRect.left + toRect.width / 2;
528
- const toCenterY = toRect.top - treeRect.top + toRect.height / 2;
529
- let d;
530
- let from;
531
- let to;
532
- if (horiz) {
533
- const startX = fromRect.right - treeRect.left;
534
- const endX = toRect.left - treeRect.left;
535
- const midX = (startX + endX) / 2;
536
- d = `M ${startX},${fromCenterY} L ${midX},${fromCenterY} L ${midX},${toCenterY} L ${endX},${toCenterY}`;
537
- from = { matchId: match.id, x: startX, y: fromCenterY };
538
- to = { matchId: nextMatch.id, x: endX, y: toCenterY };
539
- } else {
540
- const startY = fromRect.bottom - treeRect.top;
541
- const endY = toRect.top - treeRect.top;
542
- const midY = (startY + endY) / 2;
543
- d = `M ${fromCenterX},${startY} L ${fromCenterX},${midY} L ${toCenterX},${midY} L ${toCenterX},${endY}`;
544
- from = { matchId: match.id, x: fromCenterX, y: startY };
545
- to = { matchId: nextMatch.id, x: toCenterX, y: endY };
546
- }
547
- paths.push({
548
- key: `${match.id}-${nextMatch.id}`,
549
- d,
550
- from,
551
- to,
552
- winner: match.winnerId != null
553
- });
554
- }
555
- }
556
- connectorPaths.value = paths;
1079
+ const treeEl = treeRef.value;
1080
+ if (!treeEl || !showConnectors.value) {
1081
+ connectorPaths.value = [];
1082
+ return;
1083
+ }
1084
+ const treeRect = treeEl.getBoundingClientRect();
1085
+ connectorViewBox.value = `0 0 ${treeRect.width} ${treeRect.height}`;
1086
+ const roundEls = Array.from(treeEl.querySelectorAll(".origam-bracket__round"));
1087
+ const cardsPerRound = roundEls.map((roundEl) => {
1088
+ const matchesEl = roundEl.querySelector(".origam-bracket-round__matches");
1089
+ return matchesEl ? Array.from(matchesEl.children).map((card) => card.getBoundingClientRect()) : [];
1090
+ });
1091
+ const horiz = isHorizontal.value;
1092
+ const paths = [];
1093
+ for (let r = 0; r < displayRounds.value.length - 1; r += 1) {
1094
+ const round = displayRounds.value[r];
1095
+ const nextRound = displayRounds.value[r + 1];
1096
+ const fromCards = cardsPerRound[r] ?? [];
1097
+ const toCards = cardsPerRound[r + 1] ?? [];
1098
+ for (let i = 0; i < round.matches.length; i += 1) {
1099
+ const match = round.matches[i];
1100
+ let nextIndex = -1;
1101
+ if (match.nextMatchId != null) {
1102
+ nextIndex = nextRound.matches.findIndex((m) => m.id === match.nextMatchId);
1103
+ }
1104
+ if (nextIndex === -1) nextIndex = Math.floor(i / 2);
1105
+ const nextMatch = nextRound.matches[nextIndex];
1106
+ const fromRect = fromCards[i];
1107
+ const toRect = toCards[nextIndex];
1108
+ if (!nextMatch || !fromRect || !toRect) continue;
1109
+ const fromCenterX = fromRect.left - treeRect.left + fromRect.width / 2;
1110
+ const fromCenterY = fromRect.top - treeRect.top + fromRect.height / 2;
1111
+ const toCenterX = toRect.left - treeRect.left + toRect.width / 2;
1112
+ const toCenterY = toRect.top - treeRect.top + toRect.height / 2;
1113
+ let d;
1114
+ let from;
1115
+ let to;
1116
+ if (horiz) {
1117
+ const startX = fromRect.right - treeRect.left;
1118
+ const endX = toRect.left - treeRect.left;
1119
+ const midX = (startX + endX) / 2;
1120
+ d = `M ${startX},${fromCenterY} L ${midX},${fromCenterY} L ${midX},${toCenterY} L ${endX},${toCenterY}`;
1121
+ from = {
1122
+ matchId: match.id,
1123
+ x: startX,
1124
+ y: fromCenterY
1125
+ };
1126
+ to = {
1127
+ matchId: nextMatch.id,
1128
+ x: endX,
1129
+ y: toCenterY
1130
+ };
1131
+ } else {
1132
+ const startY = fromRect.bottom - treeRect.top;
1133
+ const endY = toRect.top - treeRect.top;
1134
+ const midY = (startY + endY) / 2;
1135
+ d = `M ${fromCenterX},${startY} L ${fromCenterX},${midY} L ${toCenterX},${midY} L ${toCenterX},${endY}`;
1136
+ from = {
1137
+ matchId: match.id,
1138
+ x: fromCenterX,
1139
+ y: startY
1140
+ };
1141
+ to = {
1142
+ matchId: nextMatch.id,
1143
+ x: toCenterX,
1144
+ y: endY
1145
+ };
1146
+ }
1147
+ paths.push({
1148
+ key: `${match.id}-${nextMatch.id}`,
1149
+ d,
1150
+ from,
1151
+ to,
1152
+ winner: match.winnerId != null
1153
+ });
1154
+ }
1155
+ }
1156
+ connectorPaths.value = paths;
557
1157
  };
558
1158
  const measureConnectors = () => {
559
- if (props.variant === BRACKET_VARIANT.DOUBLE_ELIMINATION) {
560
- measureDoubleConnectors();
561
- return;
562
- }
563
- if (props.variant === BRACKET_VARIANT.ROUND_ROBIN) {
564
- connectorPaths.value = [];
565
- return;
566
- }
567
- measureSingleConnectors();
1159
+ if (props.variant === BRACKET_VARIANT.DOUBLE_ELIMINATION) {
1160
+ measureDoubleConnectors();
1161
+ return;
1162
+ }
1163
+ if (props.variant === BRACKET_VARIANT.ROUND_ROBIN) {
1164
+ connectorPaths.value = [];
1165
+ return;
1166
+ }
1167
+ measureSingleConnectors();
568
1168
  };
569
1169
  const connectorContainer = () => {
570
- return props.variant === BRACKET_VARIANT.DOUBLE_ELIMINATION ? doubleRef.value : treeRef.value;
1170
+ return props.variant === BRACKET_VARIANT.DOUBLE_ELIMINATION ? doubleRef.value : treeRef.value;
571
1171
  };
572
1172
  let connectorResizeObserver = null;
573
1173
  const attachConnectorObserver = () => {
574
- connectorResizeObserver?.disconnect();
575
- const el = connectorContainer();
576
- if (typeof ResizeObserver !== "undefined" && el) {
577
- connectorResizeObserver = new ResizeObserver(() => measureConnectors());
578
- connectorResizeObserver.observe(el);
579
- }
1174
+ connectorResizeObserver?.disconnect();
1175
+ const el = connectorContainer();
1176
+ if (typeof ResizeObserver !== "undefined" && el) {
1177
+ connectorResizeObserver = new ResizeObserver(() => measureConnectors());
1178
+ connectorResizeObserver.observe(el);
1179
+ }
580
1180
  };
581
1181
  onMounted(() => {
582
- nextTick(() => {
583
- attachConnectorObserver();
584
- measureConnectors();
585
- });
1182
+ nextTick(() => {
1183
+ attachConnectorObserver();
1184
+ measureConnectors();
1185
+ });
586
1186
  });
587
1187
  onBeforeUnmount(() => {
588
- connectorResizeObserver?.disconnect();
589
- connectorResizeObserver = null;
1188
+ connectorResizeObserver?.disconnect();
1189
+ connectorResizeObserver = null;
590
1190
  });
591
- watch(
592
- () => props.variant,
593
- () => nextTick(() => {
594
- attachConnectorObserver();
595
- measureConnectors();
596
- }),
597
- { flush: "post" }
598
- );
599
- watch(
600
- [
601
- displayRounds,
602
- isHorizontal,
603
- () => props.showScores,
604
- () => props.showSeed,
605
- () => props.density,
606
- () => props.showRoundTitles
607
- ],
608
- () => nextTick(measureConnectors),
609
- { flush: "post" }
610
- );
1191
+ watch(() => props.variant, () => nextTick(() => {
1192
+ attachConnectorObserver();
1193
+ measureConnectors();
1194
+ }), { flush: "post" });
1195
+ watch([
1196
+ displayRounds,
1197
+ isHorizontal,
1198
+ () => props.showScores,
1199
+ () => props.showSeed,
1200
+ () => props.density,
1201
+ () => props.showRoundTitles
1202
+ ], () => nextTick(measureConnectors), { flush: "post" });
611
1203
  const roundStyleFor = (_index) => {
612
- const minHeight = `${totalHeight.value}px`;
613
- if (isHorizontal.value) {
614
- return {
615
- minHeight,
616
- width: `${matchWidth}px`,
617
- flex: "0 0 auto"
618
- };
619
- }
620
- return {
621
- minWidth: `${totalHeight.value}px`,
622
- height: `${verticalRoundThickness}px`,
623
- flex: "0 0 auto"
624
- };
1204
+ const minHeight = `${totalHeight.value}px`;
1205
+ if (isHorizontal.value) {
1206
+ return {
1207
+ minHeight,
1208
+ width: `${matchWidth}px`,
1209
+ flex: "0 0 auto"
1210
+ };
1211
+ }
1212
+ return {
1213
+ minWidth: `${totalHeight.value}px`,
1214
+ height: `${verticalRoundThickness}px`,
1215
+ flex: "0 0 auto"
1216
+ };
625
1217
  };
1218
+ /*********************************************************
1219
+ * Event proxies
1220
+ ********************************************************/
626
1221
  const onMatchClick = (match, event) => {
627
- const round = displayRounds.value.find((r) => r.matches.some((m) => m.id === match.id));
628
- if (!round) return;
629
- emit("match-click", match, round, event);
1222
+ const round = displayRounds.value.find((r) => r.matches.some((m) => m.id === match.id));
1223
+ if (!round) return;
1224
+ emit("match-click", match, round, event);
630
1225
  };
631
1226
  const onWinnerClick = (competitor, match, event) => {
632
- emit("winner-click", competitor, match, event);
1227
+ emit("winner-click", competitor, match, event);
633
1228
  };
634
1229
  const onCompetitorClick = (competitor, match, _side, event) => {
635
- emit("competitor-click", competitor, match, event);
1230
+ emit("competitor-click", competitor, match, event);
636
1231
  };
1232
+ // Legible text for a painted surface. The intent → foreground tokens
1233
+ // always pair white, which only contrasts a *dark* fill; on a light
1234
+ // intent (warning, success, …) white is unreadable. Since the surface
1235
+ // resolves to a theme var we cannot WCAG-test it in JS — so we measure
1236
+ // the painted match card at runtime and pick the better of black /
1237
+ // white. Reactive: re-measured on mount, on bgColor / variant change.
637
1238
  const autoTextColor = ref(null);
638
1239
  const measureContrast = () => {
639
- if (!props.bgColor) {
640
- autoTextColor.value = null;
641
- return;
642
- }
643
- const card = connectorContainer()?.querySelector(".origam-bracket-match");
644
- if (!card) {
645
- autoTextColor.value = null;
646
- return;
647
- }
648
- const channels = getComputedStyle(card).backgroundColor.match(/\d+(?:\.\d+)?/g);
649
- if (!channels || channels.length < 3) {
650
- autoTextColor.value = null;
651
- return;
652
- }
653
- const linear = (channel) => {
654
- const c = channel / 255;
655
- return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
656
- };
657
- const luminance = 0.2126 * linear(+channels[0]) + 0.7152 * linear(+channels[1]) + 0.0722 * linear(+channels[2]);
658
- autoTextColor.value = luminance < 0.179 ? "#ffffff" : "#000000";
1240
+ if (!props.bgColor) {
1241
+ autoTextColor.value = null;
1242
+ return;
1243
+ }
1244
+ const card = connectorContainer()?.querySelector(".origam-bracket-match");
1245
+ if (!card) {
1246
+ autoTextColor.value = null;
1247
+ return;
1248
+ }
1249
+ const channels = getComputedStyle(card).backgroundColor.match(/\d+(?:\.\d+)?/g);
1250
+ if (!channels || channels.length < 3) {
1251
+ autoTextColor.value = null;
1252
+ return;
1253
+ }
1254
+ // Pick the black / white that maximises the WCAG ratio against the
1255
+ // rendered surface. Crossover is at a gamma-corrected relative
1256
+ // luminance of ~0.179: darker fills (primary) take white, lighter
1257
+ // ones (warning, success, info) take black.
1258
+ const linear = (channel) => {
1259
+ const c = channel / 255;
1260
+ return c <= .03928 ? c / 12.92 : ((c + .055) / 1.055) ** 2.4;
1261
+ };
1262
+ const luminance = .2126 * linear(+channels[0]) + .7152 * linear(+channels[1]) + .0722 * linear(+channels[2]);
1263
+ autoTextColor.value = luminance < .179 ? "#ffffff" : "#000000";
659
1264
  };
1265
+ /*********************************************************
1266
+ * Color / shape / border → CSS custom properties
1267
+ *
1268
+ * @description
1269
+ * `bgColor` / `rounded` / `elevation` / `border*` paint EACH match via
1270
+ * the shared `bracketSurfaceVars` resolver (single source of truth with
1271
+ * OrigamBracketMatch). `color` drives the match text (auto-contrast wins
1272
+ * when a surface is painted). The connector links follow the match
1273
+ * border (width + style + colour) so trees and links read as one.
1274
+ ********************************************************/
660
1275
  const colorVars = computed(() => {
661
- const vars = bracketSurfaceVars(props);
662
- const foreground = autoTextColor.value ?? resolveBracketForeground(props.color);
663
- if (foreground) vars["--origam-bracket---color"] = foreground;
664
- const borderColor = resolveBracketBorderColor(props.borderColor);
665
- if (borderColor) {
666
- vars["--origam-bracket-connector---stroke-color"] = borderColor;
667
- vars["--origam-bracket-connector---stroke-color-winner"] = borderColor;
668
- }
669
- const borderWidth = resolveBracketBorderWidth(props.border);
670
- if (borderWidth) vars["--origam-bracket-connector---stroke-width"] = borderWidth;
671
- const dash = bracketDashArray(props.borderStyle);
672
- if (dash.dasharray) vars["--origam-bracket-connector---stroke-dasharray"] = dash.dasharray;
673
- if (dash.linecap) vars["--origam-bracket-connector---stroke-linecap"] = dash.linecap;
674
- return vars;
1276
+ const vars = bracketSurfaceVars(props);
1277
+ // Text foreground: a painted surface (`bgColor`) takes the measured
1278
+ // black / white that actually passes WCAG against it; with no
1279
+ // surface, `color` drives the text on the neutral background.
1280
+ const foreground = autoTextColor.value ?? resolveBracketForeground(props.color);
1281
+ if (foreground) vars["--origam-bracket---color"] = foreground;
1282
+ // Connector links mirror the match border. stroke-width is set
1283
+ // explicitly (not just via the SCSS fallback) because a global
1284
+ // `:root` default for it would otherwise always win.
1285
+ const borderColor = resolveBracketBorderColor(props.borderColor);
1286
+ if (borderColor) {
1287
+ vars["--origam-bracket-connector---stroke-color"] = borderColor;
1288
+ vars["--origam-bracket-connector---stroke-color-winner"] = borderColor;
1289
+ }
1290
+ const borderWidth = resolveBracketBorderWidth(props.border);
1291
+ if (borderWidth) vars["--origam-bracket-connector---stroke-width"] = borderWidth;
1292
+ const dash = bracketDashArray(props.borderStyle);
1293
+ if (dash.dasharray) vars["--origam-bracket-connector---stroke-dasharray"] = dash.dasharray;
1294
+ if (dash.linecap) vars["--origam-bracket-connector---stroke-linecap"] = dash.linecap;
1295
+ return vars;
675
1296
  });
1297
+ // Read the SETTLED surface: the match card animates its background
1298
+ // (`transition: background-color 120ms`), so an immediate read sees the
1299
+ // mid-transition colour and locks the wrong black / white. Wait past
1300
+ // the transition before measuring.
676
1301
  const CONTRAST_SETTLE_MS = 200;
677
1302
  let contrastTimer = null;
678
1303
  const scheduleContrast = () => {
679
- if (typeof window === "undefined") return;
680
- if (contrastTimer) clearTimeout(contrastTimer);
681
- contrastTimer = setTimeout(measureContrast, CONTRAST_SETTLE_MS);
1304
+ if (typeof window === "undefined") return;
1305
+ if (contrastTimer) clearTimeout(contrastTimer);
1306
+ contrastTimer = setTimeout(measureContrast, CONTRAST_SETTLE_MS);
682
1307
  };
683
- watch(
684
- [() => props.bgColor, () => props.variant, displayRounds],
685
- scheduleContrast,
686
- { flush: "post" }
687
- );
1308
+ watch([
1309
+ () => props.bgColor,
1310
+ () => props.variant,
1311
+ displayRounds
1312
+ ], scheduleContrast, { flush: "post" });
688
1313
  onMounted(scheduleContrast);
689
1314
  onBeforeUnmount(() => {
690
- if (contrastTimer) clearTimeout(contrastTimer);
691
- contrastTimer = null;
1315
+ if (contrastTimer) clearTimeout(contrastTimer);
1316
+ contrastTimer = null;
692
1317
  });
1318
+ /*********************************************************
1319
+ * Class & Style
1320
+ *
1321
+ * @description
1322
+ * `rounded`, `elevation` and `border*` are applied PER-MATCH via
1323
+ * `colorVars` (CSS custom properties the match cards consume), not on
1324
+ * the bracket root — so each card is shaped / elevated / bordered.
1325
+ ********************************************************/
693
1326
  const { dimensionStyles } = useDimension(props);
694
1327
  const { marginClasses, marginStyles } = useMargin(props);
695
1328
  const { paddingClasses, paddingStyles } = usePadding(props);
696
1329
  const { typographyStyles } = useTypography(props, "bracket-double-label");
697
1330
  const rootStyles = computed(() => {
698
- return [
699
- dimensionStyles.value,
700
- marginStyles.value,
701
- paddingStyles.value,
702
- {
703
- "--origam-bracket---round-gap": `${roundGap}px`,
704
- "--origam-bracket---match-gap": `${baseGap}px`,
705
- ...colorVars.value
706
- },
707
- props.style
708
- ];
1331
+ return [
1332
+ dimensionStyles.value,
1333
+ marginStyles.value,
1334
+ paddingStyles.value,
1335
+ {
1336
+ "--origam-bracket---round-gap": `${roundGap}px`,
1337
+ "--origam-bracket---match-gap": `${baseGap}px`,
1338
+ ...colorVars.value
1339
+ },
1340
+ props.style
1341
+ ];
709
1342
  });
710
1343
  const rootClasses = computed(() => {
711
- return [
712
- "origam-bracket",
713
- `origam-bracket--variant-${props.variant}`,
714
- `origam-bracket--direction-${props.direction}`,
715
- `origam-bracket--density-${props.density ?? "default"}`,
716
- `origam-bracket--color-${props.color}`,
717
- marginClasses.value,
718
- paddingClasses.value,
719
- props.class
720
- ];
1344
+ return [
1345
+ "origam-bracket",
1346
+ `origam-bracket--variant-${props.variant}`,
1347
+ `origam-bracket--direction-${props.direction}`,
1348
+ `origam-bracket--density-${props.density ?? "default"}`,
1349
+ `origam-bracket--color-${props.color}`,
1350
+ marginClasses.value,
1351
+ paddingClasses.value,
1352
+ props.class
1353
+ ];
721
1354
  });
722
1355
  const treeClasses = computed(() => {
723
- return [
724
- "origam-bracket__tree",
725
- `origam-bracket__tree--direction-${props.direction}`
726
- ];
1356
+ return ["origam-bracket__tree", `origam-bracket__tree--direction-${props.direction}`];
727
1357
  });
1358
+ /*********************************************************
1359
+ * Expose
1360
+ ********************************************************/
728
1361
  defineExpose({
729
- filterProps,
730
- displayRounds,
731
- connectorPaths,
732
- roundRobinCompetitors
1362
+ filterProps,
1363
+ displayRounds,
1364
+ connectorPaths,
1365
+ roundRobinCompetitors
733
1366
  });
734
1367
  </script>
735
1368