-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] some Preview detail bugs
- Loading branch information
Showing
11 changed files
with
1,660 additions
and
1,481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "idea-react", | ||
"version": "2.0.0-rc.7", | ||
"version": "2.0.0-rc.8", | ||
"license": "LGPL-3.0-or-later", | ||
"author": "[email protected]", | ||
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.", | ||
|
@@ -45,8 +45,8 @@ | |
"react-dom": ">=16" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-decorators": "^7.25.7", | ||
"@babel/preset-typescript": "^7.25.7", | ||
"@babel/plugin-proposal-decorators": "^7.25.9", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@eslint/compat": "^1.2.1", | ||
"@eslint/js": "^9.13.0", | ||
"@microsoft/api-extractor": "^7.47.11", | ||
|
@@ -66,22 +66,22 @@ | |
"@storybook/react-vite": "^7.6.20", | ||
"@storybook/testing-library": "^0.2.2", | ||
"@types/lodash": "^4.17.12", | ||
"@types/node": "^20.16.13", | ||
"@types/prismjs": "^1.26.4", | ||
"@types/react": "^18.3.11", | ||
"@types/node": "^20.17.1", | ||
"@types/prismjs": "^1.26.5", | ||
"@types/react": "^18.3.12", | ||
"@types/react-dom": "^18.3.1", | ||
"@vitejs/plugin-react": "^4.3.2", | ||
"@vitejs/plugin-react": "^4.3.3", | ||
"eslint": "^9.13.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-react": "^7.37.1", | ||
"eslint-plugin-react": "^7.37.2", | ||
"eslint-plugin-simple-import-sort": "^12.1.1", | ||
"globals": "^15.11.0", | ||
"husky": "^9.1.6", | ||
"koapache": "^2.2.2", | ||
"less": "^4.2.0", | ||
"lint-staged": "^15.2.10", | ||
"parcel": "~2.12.0", | ||
"postcss-preset-env": "^10.0.7", | ||
"postcss-preset-env": "^10.0.8", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-css-order": "^2.1.2", | ||
"process": "^0.11.10", | ||
|
@@ -91,10 +91,10 @@ | |
"rimraf": "^6.0.1", | ||
"storybook": "^7.6.20", | ||
"typedoc": "^0.26.10", | ||
"typedoc-plugin-mdn-links": "^3.3.3", | ||
"typedoc-plugin-mdn-links": "^3.3.4", | ||
"typescript": "~5.6.3", | ||
"typescript-eslint": "^8.10.0", | ||
"vite": "^5.4.9" | ||
"typescript-eslint": "^8.11.0", | ||
"vite": "^5.4.10" | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { FC, TimeHTMLAttributes } from 'react'; | ||
import { formatDate, TimeData } from 'web-utility'; | ||
|
||
export interface TimeProps | ||
extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> { | ||
dateTime: TimeData; | ||
format?: string; | ||
} | ||
|
||
export const Time: FC<TimeProps> = ({ dateTime, format, ...props }) => ( | ||
<time dateTime={new Date(dateTime).toJSON()} {...props}> | ||
{formatDate(dateTime, format)} | ||
</time> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.timeline { | ||
position: relative; | ||
margin: 0 auto; | ||
max-width: 50%; | ||
@media (max-width: 991px) { | ||
max-width: 100%; | ||
} | ||
&::after { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 10px; | ||
margin-left: -3px; | ||
background-color: #fff; | ||
width: 3px; | ||
content: ''; | ||
} | ||
} | ||
.timelineItem { | ||
position: relative; | ||
background-color: inherit; | ||
width: 100%; | ||
|
||
&::after { | ||
position: absolute; | ||
top: 18px; | ||
right: 1px; | ||
z-index: 1; | ||
border-radius: 50%; | ||
background-color: #fff; | ||
width: 17px; | ||
height: 17px; | ||
content: ''; | ||
} | ||
} | ||
.right { | ||
left: auto; | ||
padding: 0px 0px 20px 40px; | ||
|
||
&::before { | ||
position: absolute; | ||
top: 18px; | ||
left: 30px; | ||
z-index: 1; | ||
border: medium solid #fff; | ||
border-width: 10px 10px 10px 0; | ||
border-color: transparent #fff transparent transparent; | ||
content: ' '; | ||
} | ||
&::after { | ||
left: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { FC, HTMLAttributes } from 'react'; | ||
import { Card } from 'react-bootstrap'; | ||
import { TimeData } from 'web-utility'; | ||
|
||
import { Nameplate, NameplateProps } from '../Nameplate'; | ||
import { Time } from '../Time'; | ||
import styles from './index.module.less'; | ||
|
||
export interface TimelineEvent { | ||
title: string; | ||
summary?: string; | ||
time: [TimeData, TimeData?]; | ||
|
||
link?: string; | ||
people?: NameplateProps[]; | ||
} | ||
|
||
export interface TimelineProps extends HTMLAttributes<HTMLOListElement> { | ||
events: TimelineEvent[]; | ||
timeFormat?: string; | ||
} | ||
|
||
/** | ||
* @see {@link https://mdbootstrap.com/docs/standard/extended/timeline/#section-timeline-gradient-bg} | ||
*/ | ||
export const Timeline: FC<TimelineProps> = ({ | ||
className, | ||
events, | ||
timeFormat, | ||
...props | ||
}) => ( | ||
<ol className={`list-unstyled ${styles.timeline} ${className}`} {...props}> | ||
{events.map(({ title, summary, time, link, people }) => ( | ||
<li | ||
key={title as string} | ||
className={`position-relative ${styles.timelineItem} ${styles.right}`} | ||
> | ||
<Card> | ||
<Card.Body className="p-4 d-flex flex-column gap-3"> | ||
<h3 className="h5 m-0"> | ||
<a | ||
className="text-decoration-none stretched-link" | ||
href={link} | ||
> | ||
{title as string} | ||
</a> | ||
</h3> | ||
<div className="small text-muted d-flex gap-2"> | ||
⏲️ | ||
<Time dateTime={time[0]} format={timeFormat} /> | ||
{time[1] && '~'} | ||
{time[1] && ( | ||
<Time dateTime={time[1]} format={timeFormat} /> | ||
)} | ||
</div> | ||
<ul className="list-unstyled m-0"> | ||
{people?.map(person => ( | ||
<li key={person.name}> | ||
<Nameplate {...person} /> | ||
</li> | ||
))} | ||
</ul> | ||
<p className="m-0">{summary as string}</p> | ||
</Card.Body> | ||
</Card> | ||
</li> | ||
))} | ||
</ol> | ||
); | ||
Timeline.displayName = 'Timeline'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0965198
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for idea-react ready!
✅ Preview
https://idea-react-ona0gro9r-stevending1sts-projects.vercel.app
Built with commit 0965198.
This pull request is being automatically deployed with vercel-action