courthive-components 1.5.0 → 1.7.0

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 (70) hide show
  1. package/dist/components/competitivenessBar/aggregateCompetitiveness.d.ts +3 -0
  2. package/dist/components/competitivenessBar/buildCompetitivenessBar.d.ts +6 -0
  3. package/dist/components/competitivenessBar/buildCompetitivenessDonut.d.ts +6 -0
  4. package/dist/components/competitivenessBar/index.d.ts +7 -0
  5. package/dist/components/competitivenessBar/types.d.ts +6 -0
  6. package/dist/components/composition-editor/compositionEditorStore.d.ts +5 -3
  7. package/dist/components/composition-editor/compositionEditorTypes.d.ts +4 -2
  8. package/dist/components/composition-editor/sections/colorsSection.d.ts +3 -0
  9. package/dist/components/court-card/buildCourtCard.d.ts +2 -0
  10. package/dist/components/court-card/buildSkeletonCard.d.ts +2 -0
  11. package/dist/components/court-card/defaultConfig.d.ts +3 -0
  12. package/dist/components/court-card/index.d.ts +6 -0
  13. package/dist/components/court-card/mapCourt.d.ts +7 -0
  14. package/dist/components/court-card/styles.d.ts +18 -0
  15. package/dist/components/court-card/types.d.ts +31 -0
  16. package/dist/components/draw-card/buildDrawCard.d.ts +2 -0
  17. package/dist/components/draw-card/buildSkeletonCard.d.ts +2 -0
  18. package/dist/components/draw-card/defaultConfig.d.ts +3 -0
  19. package/dist/components/draw-card/index.d.ts +6 -0
  20. package/dist/components/draw-card/mapDraw.d.ts +18 -0
  21. package/dist/components/draw-card/styles.d.ts +18 -0
  22. package/dist/components/draw-card/types.d.ts +59 -0
  23. package/dist/components/event-card/buildEventCard.d.ts +2 -0
  24. package/dist/components/event-card/buildSkeletonCard.d.ts +2 -0
  25. package/dist/components/event-card/defaultConfig.d.ts +6 -0
  26. package/dist/components/event-card/index.d.ts +8 -0
  27. package/dist/components/event-card/mapEvent.d.ts +14 -0
  28. package/dist/components/event-card/statusResolver.d.ts +14 -0
  29. package/dist/components/event-card/styles.d.ts +22 -0
  30. package/dist/components/event-card/types.d.ts +49 -0
  31. package/dist/components/schedule-page/index.d.ts +1 -1
  32. package/dist/components/schedule-page/types.d.ts +24 -0
  33. package/dist/components/schedule-page/ui/courtGridSlot.d.ts +9 -0
  34. package/dist/components/schedule-page/ui/styles.d.ts +1 -0
  35. package/dist/components/scheduling-profile/types.d.ts +4 -0
  36. package/dist/components/scheduling-profile/ui/styles.d.ts +1 -0
  37. package/dist/components/scheduling-profile/ui/venueBoard.d.ts +4 -0
  38. package/dist/components/tournament-card/buildSkeletonCard.d.ts +2 -0
  39. package/dist/components/tournament-card/buildTournamentCard.d.ts +2 -0
  40. package/dist/components/tournament-card/defaultConfig.d.ts +7 -0
  41. package/dist/components/tournament-card/feeFormatter.d.ts +2 -0
  42. package/dist/components/tournament-card/index.d.ts +9 -0
  43. package/dist/components/tournament-card/mapTournament.d.ts +7 -0
  44. package/dist/components/tournament-card/statusResolver.d.ts +9 -0
  45. package/dist/components/tournament-card/styles.d.ts +23 -0
  46. package/dist/components/tournament-card/types.d.ts +57 -0
  47. package/dist/components/venue-card/buildSkeletonCard.d.ts +2 -0
  48. package/dist/components/venue-card/buildVenueCard.d.ts +2 -0
  49. package/dist/components/venue-card/defaultConfig.d.ts +3 -0
  50. package/dist/components/venue-card/index.d.ts +6 -0
  51. package/dist/components/venue-card/mapVenue.d.ts +7 -0
  52. package/dist/components/venue-card/styles.d.ts +19 -0
  53. package/dist/components/venue-card/types.d.ts +44 -0
  54. package/dist/compositions/resolvePublishedComposition.d.ts +12 -1
  55. package/dist/courthive-components.css +1 -1
  56. package/dist/courthive-components.es.js +6732 -5129
  57. package/dist/courthive-components.umd.js +42 -42
  58. package/dist/helpers/cards/buildCardSkeleton.d.ts +28 -0
  59. package/dist/helpers/cards/formatAddress.d.ts +3 -0
  60. package/dist/helpers/cards/formatDateRange.d.ts +10 -0
  61. package/dist/helpers/cards/index.d.ts +12 -0
  62. package/dist/helpers/cards/resourceExtraction.d.ts +4 -0
  63. package/dist/helpers/cards/types.d.ts +24 -0
  64. package/dist/helpers/searchClearButton.d.ts +16 -0
  65. package/dist/index.d.ts +16 -1
  66. package/dist/styles/applyCompositionColors.d.ts +9 -0
  67. package/dist/styles/themes/index.d.ts +1 -0
  68. package/dist/styles/themes/typtiTheme.d.ts +1 -0
  69. package/dist/types.d.ts +25 -0
  70. package/package.json +9 -9
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Generic skeleton card builder shared by tournament-card, event-card, venue-card.
3
+ *
4
+ * Each card's own skeleton wrapper calls this with its zone counts + the CSS
5
+ * class names it owns, so the visual placeholder always matches the card's
6
+ * outer shape (no grid reflow when real data lands).
7
+ */
8
+ export interface CardSkeletonConfig {
9
+ /** Whether to render the image zone */
10
+ showImage: boolean;
11
+ /** Number of body skeleton lines (0 = body zone omitted) */
12
+ bodyLines: number;
13
+ /** Whether to render a footer skeleton line (false = footer zone omitted) */
14
+ showFooter: boolean;
15
+ /** CSS class for the card outer element. */
16
+ cardClass: string;
17
+ /** CSS class for the image zone. */
18
+ imageClass: string;
19
+ /** CSS class for the body zone. */
20
+ bodyClass: string;
21
+ /** CSS class for the footer zone. */
22
+ footerClass: string;
23
+ /** CSS class for shimmer fill (block). */
24
+ blockClass: string;
25
+ /** CSS class for a single shimmer line. */
26
+ lineClass: string;
27
+ }
28
+ export declare function buildCardSkeleton(cfg: CardSkeletonConfig): HTMLElement;
@@ -0,0 +1,3 @@
1
+ import { CardAddress, CardVenueLike } from './types';
2
+ export declare function formatAddress(address?: CardAddress | null): string | undefined;
3
+ export declare function formatVenueLocation(venues?: CardVenueLike[] | null): string | undefined;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Pure ISO-date range formatter shared by card primitives.
3
+ *
4
+ * "May 22, 2026" (single date)
5
+ * "May 22 – May 24, 2026" (same-year range)
6
+ * "Dec 30, 2025 – Jan 2, 2026" (cross-year range)
7
+ *
8
+ * Returns undefined when neither bound is present or both parse as NaN.
9
+ */
10
+ export declare function formatDateRange(startISO?: string, endISO?: string): string | undefined;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Shared utilities for card primitives (tournament-card, event-card, venue-card).
3
+ *
4
+ * Exported through `courthive-components` so consumers can build their own
5
+ * card variants without re-implementing extraction + formatting.
6
+ */
7
+ export { formatAddress, formatVenueLocation } from './formatAddress';
8
+ export { formatDateRange } from './formatDateRange';
9
+ export { extractImageURL, extractCourtSvgSport } from './resourceExtraction';
10
+ export { buildCardSkeleton } from './buildCardSkeleton';
11
+ export type { CardSkeletonConfig } from './buildCardSkeleton';
12
+ export type { CardAddress, CardOnlineResource, CardVenueLike } from './types';
@@ -0,0 +1,4 @@
1
+ import { CourtSport } from '../../components/courts/courtSvgUtil';
2
+ import { CardOnlineResource } from './types';
3
+ export declare function extractImageURL(resources: CardOnlineResource[] | undefined, name: string): string | undefined;
4
+ export declare function extractCourtSvgSport(resources: CardOnlineResource[] | undefined, name?: string): CourtSport | undefined;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Shared types used by card primitives (tournament-card, event-card, venue-card).
3
+ */
4
+ export interface CardOnlineResource {
5
+ name?: string;
6
+ resourceType?: string;
7
+ resourceSubType?: string;
8
+ url?: string;
9
+ identifier?: string;
10
+ }
11
+ export interface CardAddress {
12
+ city?: string;
13
+ state?: string;
14
+ region?: string;
15
+ countryCode?: string;
16
+ country?: string;
17
+ latitude?: number;
18
+ longitude?: number;
19
+ }
20
+ export interface CardVenueLike {
21
+ venueName?: string;
22
+ venueAbbreviation?: string;
23
+ addresses?: CardAddress[];
24
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Wraps an `<input>` in a relative-positioned container with an absolutely
3
+ * positioned (×) clear button that shows whenever the input has a value
4
+ * and clears it on click.
5
+ *
6
+ * Visual is matched to the controlBar's built-in clear icon so search
7
+ * fields look consistent across the platform.
8
+ *
9
+ * Returns the wrapping element. Callers append the wrapper (not the raw
10
+ * input) into the toolbar. When the input value is set programmatically
11
+ * (state sync, etc.) call `syncClearVisibility(wrap)` so the button
12
+ * toggles correctly — the `input` event fires for user typing but not
13
+ * for direct `.value =` assignments.
14
+ */
15
+ export declare function wrapSearchWithClear(input: HTMLInputElement, onClear: () => void): HTMLElement;
16
+ export declare function syncClearVisibility(wrap: HTMLElement): void;
package/dist/index.d.ts CHANGED
@@ -38,6 +38,20 @@ export type { NotesToolbarOptions } from './components/notes-toolbar/notesToolba
38
38
  export { tipster, destroyTipster } from './components/popover/tipster';
39
39
  export { tennisCourt, basketballCourt, baseballDiamond, hockeyRink, pickleballCourt, badmintonCourt, padelCourt, createCourtSvg, resolveCourtSport, sportFromMatchUpFormat, COURT_SVG_RESOURCE_SUB_TYPE } from './components/courts';
40
40
  export type { CourtSport } from './components/courts';
41
+ export { formatAddress, formatVenueLocation, formatDateRange, extractImageURL, extractCourtSvgSport, buildCardSkeleton } from './helpers/cards';
42
+ export type { CardAddress, CardOnlineResource, CardVenueLike, CardSkeletonConfig } from './helpers/cards';
43
+ export { buildTournamentCard, buildSkeletonCard, mapTournamentToCardData, resolveTournamentStatus, formatFeeRange, DEFAULT_TOURNAMENT_CARD_CONFIG, mergeTournamentCardConfig } from './components/tournament-card';
44
+ export type { MapTournamentOptions, StatusResolverInput, TournamentCardCallbacks, TournamentCardConfig, TournamentCardCornerField, TournamentCardData, TournamentCardField, TournamentEntryFee, TournamentStatusKind, TournamentStatusPill } from './components/tournament-card';
45
+ export { buildVenueCard, buildVenueSkeletonCard, mapVenueToCardData, DEFAULT_VENUE_CARD_CONFIG, mergeVenueCardConfig } from './components/venue-card';
46
+ export type { MapVenueOptions, VenueCardCallbacks, VenueCardConfig, VenueCardCornerField, VenueCardData, VenueCardField } from './components/venue-card';
47
+ export { buildCourtCard, buildCourtSkeletonCard, mapCourtToCardData, DEFAULT_COURT_CARD_CONFIG, mergeCourtCardConfig } from './components/court-card';
48
+ export type { CourtCardCallbacks, CourtCardConfig, CourtCardCornerField, CourtCardData, CourtCardField, MapCourtOptions } from './components/court-card';
49
+ export { buildCompetitivenessBar, buildCompetitivenessDonut, aggregateCompetitiveness, totalBuckets, COMPETITIVENESS_BUCKETS } from './components/competitivenessBar';
50
+ export type { BuildCompetitivenessBarResult, BuildCompetitivenessDonutResult, CompetitivenessBucket, CompetitivenessBuckets } from './components/competitivenessBar';
51
+ export { buildDrawCard, buildDrawSkeletonCard, mapDrawDefinitionToCardData, DEFAULT_DRAW_CARD_CONFIG, mergeDrawCardConfig } from './components/draw-card';
52
+ export type { DrawCardCallbacks, DrawCardConfig, DrawCardCornerField, DrawCardData, DrawCardField, DrawMatchUpCounts, DrawStatusKind, DrawStatusPill, MapDrawOptions } from './components/draw-card';
53
+ export { buildEventCard, buildEventSkeletonCard, mapEventToCardData, resolveEventStatus, DEFAULT_EVENT_CARD_CONFIG, EVENT_CARD_LIGHT_MODE_THRESHOLD, mergeEventCardConfig } from './components/event-card';
54
+ export type { EventCardCallbacks, EventCardConfig, EventCardCornerField, EventCardData, EventCardField, EventGenderKind, EventMatchUpCounts, EventStatusKind, EventStatusPill, EventStatusResolverInput, EventTypeKind, MapEventOptions } from './components/event-card';
41
55
  export { courthiveComponentsVersion } from './version';
42
56
  export { MATCH_FORMATS } from './constants/matchUpFormats';
43
57
  export type { MatchUpFormatCode } from './constants/matchUpFormats';
@@ -49,6 +63,7 @@ export { validator } from './components/forms/renderValidator';
49
63
  export * as validators from './validators';
50
64
  export { DrawStateManager } from './helpers/drawStateManager';
51
65
  export type { RenderCallback } from './helpers/drawStateManager';
66
+ export { wrapSearchWithClear, syncClearVisibility } from './helpers/searchClearButton';
52
67
  export { burstChart } from './components/burstChart/burstChart';
53
68
  export type { SunburstDrawData, SunburstMatchUp, SunburstSide, SegmentData, BurstChartEventHandlers, BurstChartOptions, BurstChartInstance } from './components/burstChart/burstChart';
54
69
  export { fromFactoryDrawData, fromLegacyDraw } from './components/burstChart/matchUpTransform';
@@ -67,7 +82,7 @@ export { TopologyBuilderControl, TopologyStore, topologyToDrawOptions, validateT
67
82
  export type { TopologyNode, TopologyEdge, TopologyState, TopologyChangeListener, TopologyBuilderConfig, TopologyTemplate, DrawOptionsResult, ValidationError } from './components/topology-builder';
68
83
  export type { SchedulingProfile, ScheduleDay, VenueSchedule, RoundProfile, RoundSegment, VenueInfo, CatalogRoundItem, CatalogGroupBy, RoundKey, RoundLocator, DragPayload, DropTarget, DropResult, Severity, ValidationCode, FixAction, ValidationResult, IssueIndex, ProfileStoreState, SchedulingProfileConfig, TemporalAdapter, DemandAdapter, DependencyAdapter, UIPanel } from './components/scheduling-profile';
69
84
  export { SchedulePageControl, SchedulePageStore, createSchedulePage, filterMatchUpCatalog, groupMatchUpCatalog, isCompletedStatus, buildScheduleIssueIndex, matchUpLabel, participantLabel, matchUpSearchKey, buildScheduleDateStrip, buildScheduleIssuesPanel, buildMatchUpCatalog, buildMatchUpCard, buildScheduleInspectorPanel, buildCourtGridSlot, buildSchedulePageLayout, buildScheduleGridCell, mapMatchUpToCellData, DEFAULT_SCHEDULE_CELL_CONFIG, activateScheduleCellTypeAhead, buildActiveStripPanel } from './components/schedule-page';
70
- export type { CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageState, SchedulePageChangeListener, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide, ScheduleCellTypeAheadOptions, ActiveStripPanel, ActiveStripPanelCallbacks, ActiveStripPanelData, ActiveStripPanelOptions, ActiveStripCourtMeta } from './components/schedule-page';
85
+ export type { CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageCatalogState, SchedulePageState, SchedulePageChangeListener, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide, ScheduleCellTypeAheadOptions, ActiveStripPanel, ActiveStripPanelCallbacks, ActiveStripPanelData, ActiveStripPanelOptions, ActiveStripCourtMeta } from './components/schedule-page';
71
86
  export { createCompositionEditor } from './components/composition-editor/compositionEditor';
72
87
  export { CompositionEditorStore } from './components/composition-editor/compositionEditorStore';
73
88
  export type { CompositionEditorConfig, SavedComposition, CompositionEditorState, CompositionEditorListener, SectionId as CompositionEditorSectionId, EditorPanel as CompositionEditorPanel } from './components/composition-editor/compositionEditorTypes';
@@ -0,0 +1,9 @@
1
+ import { CompositionColors } from '../types';
2
+ /**
3
+ * Apply per-composition color overrides as inline CSS custom properties on a container.
4
+ * Values cascade to `.chc-matchup` borders and `.chc-link` connector pseudo-elements without
5
+ * touching their style rules. Unspecified fields are left to the theme class default.
6
+ */
7
+ export declare function applyCompositionColors(element: HTMLElement, colors?: CompositionColors): void;
8
+ /** Remove every CSS custom property managed by `applyCompositionColors` from a container. */
9
+ export declare function clearCompositionColors(element: HTMLElement): void;
@@ -4,4 +4,5 @@ export { wimbledonTheme } from './wimbledonTheme';
4
4
  export { frenchTheme } from './frenchTheme';
5
5
  export { usOpenTheme } from './usOpenTheme';
6
6
  export { basicTheme } from './basicTheme';
7
+ export { typtiTheme } from './typtiTheme';
7
8
  export { itfTheme } from './itfTheme';
@@ -0,0 +1 @@
1
+ export declare const typtiTheme: string;
package/dist/types.d.ts CHANGED
@@ -220,9 +220,34 @@ export interface Configuration {
220
220
  close?: string;
221
221
  };
222
222
  }
223
+ export interface CompositionColors {
224
+ /** matchUp border color — sets `--chc-color-border` on the draw container */
225
+ border?: string;
226
+ /** matchUp border color on hover — sets `--chc-color-border-hover` */
227
+ borderHover?: string;
228
+ /** inline-start (left) border color — sets `--chc-color-border-inline-start`. Falls back to `border` when unset. */
229
+ borderInlineStart?: string;
230
+ /** inline-start (left) border width, e.g. '10px' — sets `--chc-border-width-inline-start` */
231
+ borderInlineStartWidth?: string;
232
+ /** connector line color between matchUps — sets `--chc-color-connector` */
233
+ connector?: string;
234
+ /** matchUp background color — sets `--chc-color-matchup` */
235
+ matchUpBackground?: string;
236
+ /** divider color between participants within a matchUp — sets `--chc-color-internal-dividers` */
237
+ internalDividers?: string;
238
+ /** placeholder "[Score]" text color — sets `--chc-color-score`. Falls back to `--chc-status-info`. */
239
+ score?: string;
240
+ /** round header text + underline color — sets `--chc-color-round-header`.
241
+ * Underline falls back to `--chc-text-primary`; text falls back to inherit. */
242
+ roundHeader?: string;
243
+ }
223
244
  export interface Composition {
224
245
  theme: string;
225
246
  configuration?: Configuration;
247
+ /** Per-composition color overrides. Applied as inline CSS custom properties on the draw root,
248
+ * cascading to `.chc-matchup` borders and `.chc-link` connector pseudo-elements. Unspecified
249
+ * fields fall back to the theme's defaults. */
250
+ colors?: CompositionColors;
226
251
  }
227
252
  export interface EventHandlers {
228
253
  matchUpClick?: (params: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "courthive-components",
3
- "packageManager": "pnpm@11.1.2",
4
- "version": "1.5.0",
3
+ "packageManager": "pnpm@11.1.3",
4
+ "version": "1.7.0",
5
5
  "engines": {
6
6
  "node": ">=22"
7
7
  },
@@ -69,8 +69,8 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@chromatic-com/storybook": "^5.0.0",
72
- "@commitlint/cli": "21.0.0",
73
- "@commitlint/config-conventional": "21.0.0",
72
+ "@commitlint/cli": "21.0.1",
73
+ "@commitlint/config-conventional": "21.0.1",
74
74
  "@eslint/js": "^10.0.1",
75
75
  "@fortawesome/fontawesome-free": "^7.2.0",
76
76
  "@storybook/addon-docs": "^10.2.17",
@@ -83,21 +83,21 @@
83
83
  "@vitest/browser-playwright": "^4.0.16",
84
84
  "@vitest/coverage-v8": "^4.0.16",
85
85
  "@vitest/ui": "^4.0.16",
86
- "eslint": "10.3.0",
86
+ "eslint": "10.4.0",
87
87
  "eslint-plugin-sonarjs": "4.0.3",
88
88
  "eslint-plugin-storybook": "^10.2.17",
89
89
  "gh-pages": "6.3.0",
90
90
  "globals": "^17.3.0",
91
91
  "happy-dom": "^20.8.3",
92
92
  "husky": "9.1.7",
93
- "lint-staged": "17.0.4",
93
+ "lint-staged": "17.0.5",
94
94
  "playwright": "^1.57.0",
95
95
  "prettier": "^3.8.1",
96
- "semver": "7.7.4",
96
+ "semver": "7.8.0",
97
97
  "storybook": "^10.2.17",
98
98
  "tabulator-tables": "6.4.0",
99
99
  "typescript": "^6.0.2",
100
- "vite": "8.0.12",
100
+ "vite": "8.0.13",
101
101
  "vite-plugin-dts": "^5.0.0",
102
102
  "vitest": "^4.0.16"
103
103
  },
@@ -110,7 +110,7 @@
110
110
  "focus-trap": "^8.0.0",
111
111
  "timepicker-ui": "^4.1.2",
112
112
  "tippy.js": "6.3.7",
113
- "tods-competition-factory": ">=3.6.0",
113
+ "tods-competition-factory": "3.9.0",
114
114
  "vanillajs-datepicker": "1.3.4"
115
115
  }
116
116
  }