courthive-components 1.2.0 → 1.5.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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Maps sport identifiers to court SVG factories and resolves a sport from
3
+ * factory event / matchUpFormat shapes. Shared by TMX, courthive-public, and
4
+ * any other consumer that wants to render a court SVG image.
5
+ */
6
+ export type CourtSport = 'tennis' | 'basketball' | 'baseball' | 'hockey' | 'pickleball' | 'badminton' | 'padel';
7
+ export declare const COURT_SVG_RESOURCE_SUB_TYPE = "COURT_SVG";
8
+ export declare function sportFromMatchUpFormat(matchUpFormat?: string): CourtSport | undefined;
9
+ export declare function resolveCourtSport(event?: any): CourtSport | undefined;
10
+ export declare function createCourtSvg(sport: string | undefined, className?: string): SVGSVGElement | undefined;
@@ -1 +1,3 @@
1
1
  export { tennisCourt, basketballCourt, baseballDiamond, hockeyRink, pickleballCourt, badmintonCourt, padelCourt } from './courts';
2
+ export { createCourtSvg, resolveCourtSport, sportFromMatchUpFormat, COURT_SVG_RESOURCE_SUB_TYPE } from './courtSvgUtil';
3
+ export type { CourtSport } from './courtSvgUtil';
@@ -8,10 +8,14 @@ import { InteractiveScoringShell, InteractiveScoringShellConfig } from './types'
8
8
  * consumers subscribe to `stateChanged` events and handle
9
9
  * persistence (IndexedDB in courthive-public's case).
10
10
  *
11
- * Phase 2 targets standard tennis matchUpFormats (`SET3-S:6/TB7`,
12
- * `SET5-S:6/TB7`, etc.). INTENNSE bolt scoring, pickleball score
13
- * caps, doubles lineup changes, and other format-specific behaviors
14
- * are deferred to Phase 2.5+.
11
+ * Any format the factory ScoringEngine accepts is supported here —
12
+ * tennis (`SET3-S:6/TB7`, `SET5-S:6/TB7`), pickleball (`SET3-S:TB11`),
13
+ * badminton (`SET3-S:TB21`), squash (`SET5-S:TB11`), no-ad and short-set
14
+ * variants. Engine state is passed through unchanged by the UI layer;
15
+ * format-specific score caps, win-by-2, and side-out scoring are handled
16
+ * by the engine. See `src/stories/inlineScoringFormats.stories.ts` for
17
+ * the verified format matrix. INTENNSE bolt scoring lives in epixodic's
18
+ * separate `BoltScoringPage` — not adopted into this shell.
15
19
  *
16
20
  * The DOM structure:
17
21
  * ```
@@ -0,0 +1,2 @@
1
+ export { buildRatingDistributionChart } from './ratingDistributionChart';
2
+ export type { RatingDistributionChartOptions, RatingDistributionChartMode, } from './ratingDistributionChart';
@@ -0,0 +1,19 @@
1
+ import { DistributionBin, RatingDistributionStats } from 'tods-competition-factory';
2
+ export type RatingDistributionChartMode = 'HISTOGRAM' | 'DONUT';
3
+ export interface RatingDistributionChartOptions {
4
+ mode?: RatingDistributionChartMode;
5
+ width?: number;
6
+ height?: number;
7
+ showAxis?: boolean;
8
+ showCounts?: boolean;
9
+ showMean?: boolean;
10
+ margin?: {
11
+ top: number;
12
+ right: number;
13
+ bottom: number;
14
+ left: number;
15
+ };
16
+ binColor?: (bin: DistributionBin, index: number) => string;
17
+ ariaLabel?: string;
18
+ }
19
+ export declare function buildRatingDistributionChart(stats: RatingDistributionStats, options?: RatingDistributionChartOptions): SVGSVGElement;
@@ -97,6 +97,9 @@ export interface SchedulePageConfig {
97
97
  schedulingMode?: SchedulingMode;
98
98
  /** Initial visibility of the active strip (one-row court summary above the grid). Defaults to true. */
99
99
  activeStripVisible?: boolean;
100
+ /** Consumer-owned buttons rendered right-aligned in the court grid header.
101
+ * Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
102
+ headerActions?: HTMLElement | HTMLElement[];
100
103
  onDateSelected?: (date: string) => void;
101
104
  onMatchUpDrop?: (payload: SchedulePageDragPayload, event: DragEvent) => void;
102
105
  onMatchUpRemove?: (matchUpId: string) => void;
@@ -1,8 +1,11 @@
1
- import { SchedulePageState, UIPanel, SchedulePageDragPayload } from '../types';
1
+ import { SchedulePageDragPayload, SchedulePageState, UIPanel } from '../types';
2
2
  export interface CourtGridSlotCallbacks {
3
3
  onMatchUpDrop?: (payload: SchedulePageDragPayload, event: DragEvent) => void;
4
4
  }
5
5
  export interface CourtGridSlotOptions {
6
6
  gridMaxHeight?: string;
7
+ /** Consumer-owned buttons rendered right-aligned in the header.
8
+ * Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
9
+ headerActions?: HTMLElement | HTMLElement[];
7
10
  }
8
11
  export declare function buildCourtGridSlot(courtGridElement: HTMLElement | undefined, callbacks: CourtGridSlotCallbacks, options?: CourtGridSlotOptions): UIPanel<SchedulePageState>;
@@ -4,7 +4,7 @@ export declare const splToggleStyle: () => string;
4
4
  export declare const splCenterStyle: () => string;
5
5
  export declare const splCenterHeaderStyle: () => string;
6
6
  export declare const splCenterTitleStyle: () => string;
7
- export declare const splCenterMetaStyle: () => string;
7
+ export declare const splCenterActionsStyle: () => string;
8
8
  export declare const splGridSlotStyle: () => string;
9
9
  export declare const splRightStyle: () => string;
10
10
  export declare const splMatchUpCardStyle: () => string;
@@ -183,6 +183,9 @@ export interface SchedulingProfileConfig {
183
183
  dependencyAdapter?: DependencyAdapter;
184
184
  venueOrder?: string[];
185
185
  plannedRoundBehavior?: PlannedRoundBehavior;
186
+ /** Consumer-owned buttons rendered right-aligned in the Day Plan header.
187
+ * Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
188
+ headerActions?: HTMLElement | HTMLElement[];
186
189
  onProfileChanged?: (profile: SchedulingProfile) => void;
187
190
  onFixAction?: (action: FixAction) => void;
188
191
  }
@@ -4,6 +4,7 @@ export declare const spPanelStyle: () => string;
4
4
  export declare const spPanelHeaderStyle: () => string;
5
5
  export declare const spPanelTitleStyle: () => string;
6
6
  export declare const spPanelMetaStyle: () => string;
7
+ export declare const spPanelActionsStyle: () => string;
7
8
  export declare const spPanelBodyStyle: () => string;
8
9
  export declare const spDateStripStyle: () => string;
9
10
  export declare const spDateChipStyle: () => string;
@@ -4,4 +4,9 @@ export interface VenueBoardCallbacks {
4
4
  onCardClick: (locator: RoundLocator) => void;
5
5
  onCardContextMenu?: (locator: RoundLocator, target: HTMLElement) => void;
6
6
  }
7
- export declare function buildVenueBoard(callbacks: VenueBoardCallbacks): UIPanel<ProfileStoreState>;
7
+ export interface VenueBoardOptions {
8
+ /** Consumer-owned buttons rendered right-aligned in the Day Plan header.
9
+ * Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
10
+ headerActions?: HTMLElement | HTMLElement[];
11
+ }
12
+ export declare function buildVenueBoard(callbacks: VenueBoardCallbacks, options?: VenueBoardOptions): UIPanel<ProfileStoreState>;