Skip to content

Commit

Permalink
chore: update semver package to 7.7.0 and enhance TypeScript interfac…
Browse files Browse the repository at this point in the history
…es with detailed JSDoc comments
  • Loading branch information
prabhuignoto committed Jan 31, 2025
1 parent c6ff236 commit dc9d330
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 29 deletions.
Binary file removed cypress/downloads/downloads.html
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 9 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 63 additions & 16 deletions src/models/Theme.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,106 @@
export interface Theme {
// card background color
/**
* Background color for timeline cards.
*/
cardBgColor?: string;

// card details background color
/**
* Background color for card details section.
*/
cardDetailsBackGround?: string;

// card details color
/**
* Text color for card details.
*/
cardDetailsColor?: string;

/**
* Background color for card media section.
*/
cardMediaBgColor?: string;

// card subtitle color
/**
* Text color for card subtitles.
*/
cardSubtitleColor?: string;

// card title color
/**
* Text color for card titles.
*/
cardTitleColor?: string;

// details color
/**
* Color for detailed text content.
*/
detailsColor?: string;

// icon background color
/**
* Background color for timeline point icons.
*/
iconBackgroundColor?: string;

// nested card background color
/**
* Background color for nested timeline cards.
*/
nestedCardBgColor?: string;

/**
* Background color for nested card details section.
*/
nestedCardDetailsBackGround?: string;

// nested card details color
/**
* Text color for nested card details.
*/
nestedCardDetailsColor?: string;

// nested card subtitle color
/**
* Text color for nested card subtitles.
*/
nestedCardSubtitleColor?: string;

// nested card title color
/**
* Text color for nested card titles.
*/
nestedCardTitleColor?: string;

// primary color
/**
* Primary theme color.
*/
primary?: string;

// secondary color
/**
* Secondary theme color.
*/
secondary?: string;

// text color
/**
* Default text color.
*/
textColor?: string;

// title color
/**
* Color for timeline titles.
*/
titleColor?: string;

// title color for active tabs
/**
* Color for active timeline titles.
*/
titleColorActive?: string;

/**
* Background color for the toolbar.
*/
toolbarBgColor?: string;

/**
* Background color for toolbar buttons.
*/
toolbarBtnBgColor?: string;

/**
* Text color for toolbar items.
*/
toolbarTextColor?: string;
}
9 changes: 7 additions & 2 deletions src/models/TimelineItemModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { TimelineProps } from './TimelineModel';
* Represents the model for a timeline item.
*/
export interface TimelineItemModel {
// Internal property for handling date.
/**
* Internal dayjs instance for date handling
* @internal
*/
_dayjs?: any;

// Indicates if the timeline item is active.
Expand Down Expand Up @@ -41,7 +44,9 @@ export interface TimelineItemModel {
// Media associated with the timeline item.
media?: Media;

// Position of the timeline item.
/**
* Position of the timeline item ('left' | 'right' | 'alternate')
*/
position?: string;

// Custom content for the timeline content.
Expand Down
8 changes: 6 additions & 2 deletions src/models/TimelineMediaModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export interface CardMediaModel {
// Indicates if slideshow mode is active.
slideshowActive?: boolean;

// Initial width for the media element.
/**
* Initial width for the media element in pixels
*/
startWidth?: number;

// Theme to be applied to the media card.
Expand All @@ -102,7 +104,9 @@ export interface CardMediaModel {
// Title of the media card.
title?: string;

// Direction of the triangle indicator.
/**
* Direction of the triangle indicator ('left' | 'right')
*/
triangleDir?: string;

// URL associated with the media.
Expand Down
8 changes: 8 additions & 0 deletions src/models/TimelineModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Theme } from './Theme';
import { TimelineItemModel } from './TimelineItemModel';

/**
* Represents the text density options for timeline content
* LOW - Regular spacing between text elements
* HIGH - Compact spacing between text elements
*/
export type TextDensity = 'LOW' | 'HIGH';

/**
Expand Down Expand Up @@ -247,6 +252,9 @@ export type TimelineProps = {

export type SlideShowType = 'reveal' | 'slide_in' | 'slide_from_sides';

/**
* Represents the available timeline display modes
*/
export type TimelineMode =
| 'VERTICAL'
| 'HORIZONTAL'
Expand Down
16 changes: 9 additions & 7 deletions src/models/TimelineVerticalModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { TimelineProps } from './TimelineModel';
export type Props = Pick<
TimelineProps,
// List of properties inherited from TimelineProps:
| 'flipLayout'
| 'theme'
| 'mode'
| 'timelinePointDimension'
| 'lineWidth'
| 'cardHeight'
| 'disableClickOnCircle'
| 'cardLess'
| 'disableClickOnCircle'
| 'flipLayout'
| 'lineWidth'
| 'mode'
| 'nestedCardHeight'
| 'theme'
| 'timelinePointDimension'
> & {
// Indicates whether to show alternate cards.
alternateCards?: boolean;
Expand Down Expand Up @@ -91,7 +91,9 @@ export interface VerticalItemModel extends VerticalModel {
// Icon element associated with the timeline item.
iconChild?: React.ReactNode;

// Index of the timeline item.
/**
* Zero-based index of the timeline item
*/
index: number;

// Nested timeline items.
Expand Down

0 comments on commit dc9d330

Please sign in to comment.