@jsonresume/core 0.1.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.
- package/README.md +689 -0
- package/dist/resume-print.css +425 -0
- package/dist/tokens.css +139 -0
- package/package.json +66 -0
- package/src/badges/BadgeRowOutline.jsx +118 -0
- package/src/badges/BadgeRowOutline.stories.tsx +160 -0
- package/src/badges/index.jsx +5 -0
- package/src/callouts/Callout.jsx +80 -0
- package/src/callouts/Callout.stories.tsx +27 -0
- package/src/callouts/HighlightCard.jsx +114 -0
- package/src/callouts/HighlightCard.stories.tsx +27 -0
- package/src/callouts/InfoBox.jsx +82 -0
- package/src/callouts/InfoBox.stories.tsx +26 -0
- package/src/callouts/index.jsx +4 -0
- package/src/certifications/AwardCard.jsx +83 -0
- package/src/certifications/AwardCard.stories.tsx +32 -0
- package/src/certifications/CertificationBadge.jsx +85 -0
- package/src/certifications/CertificationBadge.stories.tsx +29 -0
- package/src/certifications/CertificationRow.jsx +150 -0
- package/src/certifications/CertificationRow.stories.tsx +64 -0
- package/src/certifications/HonorsList.jsx +87 -0
- package/src/certifications/HonorsList.stories.tsx +36 -0
- package/src/certifications/index.jsx +5 -0
- package/src/containers/AccentCalloutPanel.jsx +176 -0
- package/src/containers/AccentCalloutPanel.stories.tsx +105 -0
- package/src/containers/MutedPanel.jsx +125 -0
- package/src/containers/MutedPanel.stories.tsx +113 -0
- package/src/containers/RoleBlockFramed.jsx +191 -0
- package/src/containers/RoleBlockFramed.stories.tsx +230 -0
- package/src/containers/SoftCardOutline.jsx +161 -0
- package/src/containers/SoftCardOutline.stories.tsx +174 -0
- package/src/containers/index.jsx +9 -0
- package/src/data/KPIChipLine.jsx +158 -0
- package/src/data/KPIChipLine.stories.tsx +99 -0
- package/src/data/KeyValueInline.jsx +150 -0
- package/src/data/KeyValueInline.stories.tsx +136 -0
- package/src/data/MetricBar.jsx +93 -0
- package/src/data/MetricBar.stories.tsx +31 -0
- package/src/data/MetricBullet.jsx +129 -0
- package/src/data/MetricBullet.stories.tsx +99 -0
- package/src/data/MetricInline.jsx +60 -0
- package/src/data/MetricInline.stories.tsx +53 -0
- package/src/data/ProgressCircle.jsx +81 -0
- package/src/data/ProgressCircle.stories.tsx +102 -0
- package/src/data/StatCard.jsx +65 -0
- package/src/data/StatCard.stories.tsx +29 -0
- package/src/data/index.jsx +12 -0
- package/src/dates/DateBadge.jsx +73 -0
- package/src/dates/DateBadge.stories.tsx +30 -0
- package/src/dates/RelativeDate.jsx +121 -0
- package/src/dates/RelativeDate.stories.tsx +29 -0
- package/src/dates/index.jsx +3 -0
- package/src/experience/ExperienceCard.jsx +82 -0
- package/src/experience/ExperienceCard.stories.tsx +36 -0
- package/src/experience/ExperienceCompact.jsx +72 -0
- package/src/experience/ExperienceCompact.stories.tsx +53 -0
- package/src/experience/ExperienceGrid.jsx +65 -0
- package/src/experience/ExperienceGrid.stories.tsx +63 -0
- package/src/experience/ExperienceTimeline.jsx +24 -0
- package/src/experience/ExperienceTimeline.stories.tsx +63 -0
- package/src/experience/RoleHeaderCompact.jsx +99 -0
- package/src/experience/index.jsx +9 -0
- package/src/header/ContactRowLine.jsx +125 -0
- package/src/header/ContactRowLine.stories.tsx +65 -0
- package/src/header/CornerInitials.jsx +178 -0
- package/src/header/CornerInitials.stories.tsx +129 -0
- package/src/header/Footer.jsx +50 -0
- package/src/header/Footer.stories.tsx +25 -0
- package/src/header/HeaderCentered.jsx +51 -0
- package/src/header/HeaderCentered.stories.tsx +30 -0
- package/src/header/HeaderMinimal.jsx +50 -0
- package/src/header/HeaderMinimal.stories.tsx +29 -0
- package/src/header/HeaderSplit.jsx +65 -0
- package/src/header/HeaderSplit.stories.tsx +29 -0
- package/src/header/HeroNameBlock.jsx +71 -0
- package/src/header/HeroNameBlock.stories.tsx +37 -0
- package/src/header/NameStackElegant.jsx +104 -0
- package/src/header/NameStackElegant.stories.tsx +60 -0
- package/src/header/PageBreak.jsx +25 -0
- package/src/header/PageBreak.stories.tsx +22 -0
- package/src/header/SectionFlagTitle.jsx +87 -0
- package/src/header/SectionFlagTitle.stories.tsx +53 -0
- package/src/header/SectionRuleTitle.jsx +84 -0
- package/src/header/SectionRuleTitle.stories.tsx +52 -0
- package/src/header/index.jsx +18 -0
- package/src/helpers/calculations.js +428 -0
- package/src/index.js +253 -0
- package/src/languages/LanguageBar.jsx +90 -0
- package/src/languages/LanguageBar.stories.tsx +28 -0
- package/src/languages/LanguageGrid.jsx +118 -0
- package/src/languages/LanguageGrid.stories.tsx +33 -0
- package/src/languages/LanguageLevelBarLite.jsx +147 -0
- package/src/languages/LanguageLevelBarLite.stories.tsx +74 -0
- package/src/languages/ProficiencyScale.jsx +107 -0
- package/src/languages/ProficiencyScale.stories.tsx +30 -0
- package/src/languages/index.jsx +5 -0
- package/src/layouts/CardLayout.jsx +46 -0
- package/src/layouts/CardLayout.stories.tsx +272 -0
- package/src/layouts/FlexLayout.jsx +53 -0
- package/src/layouts/FlexLayout.stories.tsx +270 -0
- package/src/layouts/GridLayout.jsx +38 -0
- package/src/layouts/GridLayout.stories.tsx +183 -0
- package/src/layouts/SidebarLayout.jsx +63 -0
- package/src/layouts/SidebarLayout.stories.tsx +162 -0
- package/src/layouts/StackLayout.jsx +26 -0
- package/src/layouts/StackLayout.stories.tsx +192 -0
- package/src/layouts/TwoColumnMicroGrid.jsx +87 -0
- package/src/layouts/TwoColumnMicroGrid.stories.tsx +96 -0
- package/src/layouts/index.jsx +11 -0
- package/src/lists/AchievementListSpacious.jsx +81 -0
- package/src/lists/AchievementListSpacious.stories.tsx +49 -0
- package/src/lists/AchievementListTight.jsx +80 -0
- package/src/lists/AchievementListTight.stories.tsx +49 -0
- package/src/lists/BulletList.jsx +66 -0
- package/src/lists/BulletList.stories.tsx +38 -0
- package/src/lists/CheckList.jsx +94 -0
- package/src/lists/CheckList.stories.tsx +38 -0
- package/src/lists/CompactList.jsx +90 -0
- package/src/lists/CompactList.stories.tsx +34 -0
- package/src/lists/DefinitionKeyline.jsx +114 -0
- package/src/lists/DefinitionKeyline.stories.tsx +90 -0
- package/src/lists/HangingBulletList.jsx +82 -0
- package/src/lists/HangingBulletList.stories.tsx +50 -0
- package/src/lists/IconList.jsx +89 -0
- package/src/lists/IconList.stories.tsx +36 -0
- package/src/lists/ListDashCompact.jsx +69 -0
- package/src/lists/ListDashCompact.stories.tsx +60 -0
- package/src/lists/MiniDotLeaderList.jsx +69 -0
- package/src/lists/MiniDotLeaderList.stories.tsx +73 -0
- package/src/lists/NumberedList.jsx +74 -0
- package/src/lists/NumberedList.stories.tsx +39 -0
- package/src/lists/index.jsx +12 -0
- package/src/metadata/GreyLabelCaps.jsx +66 -0
- package/src/metadata/GreyLabelCaps.stories.tsx +40 -0
- package/src/metadata/InlineKicker.jsx +61 -0
- package/src/metadata/InlineKicker.stories.tsx +35 -0
- package/src/metadata/MetaRow.jsx +96 -0
- package/src/metadata/MetaRow.stories.tsx +38 -0
- package/src/metadata/SmallCapsHeading.jsx +75 -0
- package/src/metadata/SmallCapsHeading.stories.tsx +54 -0
- package/src/metadata/SubsectionLabel.jsx +92 -0
- package/src/metadata/SubsectionLabel.stories.tsx +40 -0
- package/src/metadata/index.jsx +10 -0
- package/src/primitives/AccentSidebarStripe.stories.tsx +65 -0
- package/src/primitives/AccentSidebarStripe.tsx +95 -0
- package/src/primitives/AccentTopRule.stories.tsx +102 -0
- package/src/primitives/AccentTopRule.tsx +103 -0
- package/src/primitives/Badge.jsx +125 -0
- package/src/primitives/Badge.stories.tsx +27 -0
- package/src/primitives/ContactInfo.jsx +133 -0
- package/src/primitives/ContactInfo.stories.tsx +30 -0
- package/src/primitives/DIVIDERS.md +333 -0
- package/src/primitives/DateRange.jsx +178 -0
- package/src/primitives/DateRange.stories.tsx +28 -0
- package/src/primitives/DottedDivider.stories.tsx +54 -0
- package/src/primitives/DottedDivider.tsx +102 -0
- package/src/primitives/InlineSeparatorPipe.jsx +64 -0
- package/src/primitives/InlineSeparatorPipe.stories.tsx +96 -0
- package/src/primitives/KeylineDivider.stories.tsx +48 -0
- package/src/primitives/KeylineDivider.tsx +80 -0
- package/src/primitives/Link.jsx +59 -0
- package/src/primitives/Link.stories.tsx +29 -0
- package/src/primitives/ListItem.jsx +127 -0
- package/src/primitives/ListItem.stories.tsx +27 -0
- package/src/primitives/RulesetStack.stories.tsx +85 -0
- package/src/primitives/RulesetStack.tsx +117 -0
- package/src/primitives/Section.jsx +37 -0
- package/src/primitives/Section.stories.tsx +28 -0
- package/src/primitives/SectionTitle.jsx +62 -0
- package/src/primitives/SectionTitle.stories.tsx +27 -0
- package/src/primitives/index.jsx +36 -0
- package/src/print/ColumnBreak.jsx +44 -0
- package/src/print/ColumnBreak.stories.tsx +22 -0
- package/src/print/KeepTogether.jsx +24 -0
- package/src/print/KeepTogether.stories.tsx +26 -0
- package/src/print/LetterheadBar.jsx +100 -0
- package/src/print/LetterheadBar.stories.tsx +141 -0
- package/src/print/PageFooterLine.jsx +93 -0
- package/src/print/PageFooterLine.stories.tsx +121 -0
- package/src/print/PageHeaderLine.jsx +59 -0
- package/src/print/PageHeaderLine.stories.tsx +108 -0
- package/src/print/PrintOnly.jsx +49 -0
- package/src/print/PrintOnly.stories.tsx +26 -0
- package/src/print/SoftShadowEmulation.jsx +88 -0
- package/src/print/SoftShadowEmulation.stories.tsx +214 -0
- package/src/print/index.jsx +8 -0
- package/src/profile/Avatar.jsx +66 -0
- package/src/profile/Avatar.stories.tsx +84 -0
- package/src/profile/ContactGrid.jsx +63 -0
- package/src/profile/ContactGrid.stories.tsx +33 -0
- package/src/profile/ProfileCard.jsx +73 -0
- package/src/profile/ProfileCard.stories.tsx +35 -0
- package/src/profile/SocialLinks.jsx +61 -0
- package/src/profile/SocialLinks.stories.tsx +33 -0
- package/src/profile/index.jsx +9 -0
- package/src/providers/ThemeProvider.jsx +56 -0
- package/src/providers/ThemeProvider.stories.tsx +149 -0
- package/src/publications/PortfolioGrid.jsx +122 -0
- package/src/publications/PortfolioGrid.stories.tsx +62 -0
- package/src/publications/ProjectCard.jsx +151 -0
- package/src/publications/ProjectCard.stories.tsx +36 -0
- package/src/publications/PublicationEntryPlain.jsx +127 -0
- package/src/publications/PublicationEntryPlain.stories.tsx +58 -0
- package/src/publications/PublicationItem.jsx +120 -0
- package/src/publications/PublicationItem.stories.tsx +32 -0
- package/src/publications/index.jsx +5 -0
- package/src/quotes/BlockQuote.jsx +55 -0
- package/src/quotes/BlockQuote.stories.tsx +33 -0
- package/src/quotes/PullQuote.jsx +70 -0
- package/src/quotes/PullQuote.stories.tsx +32 -0
- package/src/quotes/Testimonial.jsx +99 -0
- package/src/quotes/Testimonial.stories.tsx +36 -0
- package/src/quotes/index.jsx +4 -0
- package/src/skills/SkillBar.jsx +66 -0
- package/src/skills/SkillBar.stories.tsx +112 -0
- package/src/skills/SkillCategory.jsx +71 -0
- package/src/skills/SkillCategory.stories.tsx +197 -0
- package/src/skills/SkillCloud.jsx +53 -0
- package/src/skills/SkillCloud.stories.tsx +132 -0
- package/src/skills/SkillGroup.jsx +56 -0
- package/src/skills/SkillGroup.stories.tsx +162 -0
- package/src/skills/SkillPill.jsx +56 -0
- package/src/skills/SkillPill.stories.tsx +157 -0
- package/src/skills/SkillRating.jsx +60 -0
- package/src/skills/SkillRating.stories.tsx +115 -0
- package/src/skills/index.jsx +11 -0
- package/src/styles/tokens.css +139 -0
- package/src/tables/ComparisonTable.jsx +128 -0
- package/src/tables/ComparisonTable.stories.tsx +41 -0
- package/src/tables/DataTable.jsx +149 -0
- package/src/tables/DataTable.stories.tsx +64 -0
- package/src/tables/SkillMatrix.jsx +139 -0
- package/src/tables/SkillMatrix.stories.tsx +90 -0
- package/src/tables/index.jsx +4 -0
- package/src/tags/ToolTagRibbon.jsx +106 -0
- package/src/tags/ToolTagRibbon.stories.tsx +121 -0
- package/src/tags/index.jsx +5 -0
- package/src/timeline/TimelineInline.stories.tsx +83 -0
- package/src/timeline/TimelineInline.tsx +202 -0
- package/src/timeline/TimelineItem.jsx +106 -0
- package/src/timeline/TimelineItem.stories.tsx +64 -0
- package/src/timeline/TimelineRuleMinimal.stories.tsx +68 -0
- package/src/timeline/TimelineRuleMinimal.tsx +165 -0
- package/src/timeline/TimelineSection.jsx +21 -0
- package/src/timeline/TimelineSection.stories.tsx +44 -0
- package/src/timeline/index.jsx +9 -0
- package/src/tokens/index.js +164 -0
- package/src/typography/Heading.jsx +48 -0
- package/src/typography/Heading.stories.tsx +46 -0
- package/src/typography/HyphenationSafeParagraph.jsx +98 -0
- package/src/typography/HyphenationSafeParagraph.stories.tsx +151 -0
- package/src/typography/Label.jsx +38 -0
- package/src/typography/Label.stories.tsx +27 -0
- package/src/typography/QuoteStripe.jsx +78 -0
- package/src/typography/QuoteStripe.stories.tsx +63 -0
- package/src/typography/SectionIntroParagraph.jsx +62 -0
- package/src/typography/SectionIntroParagraph.stories.tsx +57 -0
- package/src/typography/Text.jsx +42 -0
- package/src/typography/Text.stories.tsx +35 -0
- package/src/typography/index.jsx +11 -0
- package/src/utils/Divider.jsx +32 -0
- package/src/utils/Divider.stories.tsx +24 -0
- package/src/utils/Flex.jsx +6 -0
- package/src/utils/Flex.stories.tsx +28 -0
- package/src/utils/Grid.jsx +6 -0
- package/src/utils/Grid.stories.tsx +28 -0
- package/src/utils/Spacer.jsx +18 -0
- package/src/utils/Spacer.stories.tsx +26 -0
- package/src/utils/index.jsx +9 -0
- package/src/utils/security.js +155 -0
- package/src/visuals/BackgroundPattern.jsx +65 -0
- package/src/visuals/BackgroundPattern.stories.tsx +27 -0
- package/src/visuals/BorderAccent.jsx +147 -0
- package/src/visuals/BorderAccent.stories.tsx +27 -0
- package/src/visuals/ColorBlock.jsx +60 -0
- package/src/visuals/ColorBlock.stories.tsx +27 -0
- package/src/visuals/DividerVariants.jsx +120 -0
- package/src/visuals/DividerVariants.stories.tsx +27 -0
- package/src/visuals/index.jsx +5 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* DateBadge
|
|
4
|
+
* Badge-style date display with icon support
|
|
5
|
+
*/
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const Badge = styled.time`
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
padding: 4px 12px;
|
|
13
|
+
background-color: ${(props) =>
|
|
14
|
+
props.$variant === 'filled'
|
|
15
|
+
? 'var(--resume-color-accent)'
|
|
16
|
+
: 'var(--resume-color-background)'};
|
|
17
|
+
color: ${(props) =>
|
|
18
|
+
props.$variant === 'filled' ? 'white' : 'var(--resume-color-secondary)'};
|
|
19
|
+
border: 1px solid
|
|
20
|
+
${(props) =>
|
|
21
|
+
props.$variant === 'filled'
|
|
22
|
+
? 'var(--resume-color-accent)'
|
|
23
|
+
: 'var(--resume-color-border)'};
|
|
24
|
+
border-radius: var(--resume-radius-full);
|
|
25
|
+
font-size: var(--resume-size-small);
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
|
|
28
|
+
@media print {
|
|
29
|
+
-webkit-print-color-adjust: exact;
|
|
30
|
+
print-color-adjust: exact;
|
|
31
|
+
border: 1px solid var(--resume-color-border);
|
|
32
|
+
background-color: ${(props) =>
|
|
33
|
+
props.$variant === 'filled'
|
|
34
|
+
? 'var(--resume-color-accent)'
|
|
35
|
+
: 'transparent'};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (max-width: 768px) {
|
|
39
|
+
font-size: var(--resume-size-tiny);
|
|
40
|
+
padding: 3px 10px;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const Icon = styled.span`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {Object} props
|
|
52
|
+
* @param {string} props.date - Date string to display
|
|
53
|
+
* @param {string} [props.dateTime] - ISO datetime for semantic markup
|
|
54
|
+
* @param {string|React.ReactNode} [props.icon] - Optional icon or emoji
|
|
55
|
+
* @param {string} [props.variant='outlined'] - Style variant (outlined, filled)
|
|
56
|
+
* @param {string} [props.className] - Additional CSS classes
|
|
57
|
+
*/
|
|
58
|
+
export function DateBadge({
|
|
59
|
+
date,
|
|
60
|
+
dateTime,
|
|
61
|
+
icon,
|
|
62
|
+
variant = 'outlined',
|
|
63
|
+
className,
|
|
64
|
+
}) {
|
|
65
|
+
return (
|
|
66
|
+
<Badge dateTime={dateTime} $variant={variant} className={className}>
|
|
67
|
+
{icon && <Icon>{icon}</Icon>}
|
|
68
|
+
{date}
|
|
69
|
+
</Badge>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default DateBadge;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* DateBadge Stories
|
|
4
|
+
*/
|
|
5
|
+
import { DateBadge } from './DateBadge';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Resume Core/Dates/DateBadge',
|
|
9
|
+
component: DateBadge,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
date: '2020 - 2023',
|
|
19
|
+
variant: 'outlined',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Example = {
|
|
24
|
+
args: {
|
|
25
|
+
date: 'Jan 2022 - Present',
|
|
26
|
+
icon: '📅',
|
|
27
|
+
variant: 'filled',
|
|
28
|
+
dateTime: '2022-01-01',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* RelativeDate
|
|
4
|
+
* Display relative date (e.g., "2 years ago", "3 months")
|
|
5
|
+
*/
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const Container = styled.time`
|
|
9
|
+
font-size: ${(props) => props.$size || 'var(--resume-size-small)'};
|
|
10
|
+
color: ${(props) => props.$color || 'var(--resume-color-tertiary)'};
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Calculate relative time from a date
|
|
16
|
+
* @param {string|Date} date - Date to calculate from
|
|
17
|
+
* @param {boolean} ago - Include "ago" suffix
|
|
18
|
+
* @returns {string} Relative time string
|
|
19
|
+
*/
|
|
20
|
+
function getRelativeTime(date, ago = true) {
|
|
21
|
+
const now = new Date();
|
|
22
|
+
const past = new Date(date);
|
|
23
|
+
const diffMs = now - past;
|
|
24
|
+
const diffSec = Math.floor(diffMs / 1000);
|
|
25
|
+
const diffMin = Math.floor(diffSec / 60);
|
|
26
|
+
const diffHour = Math.floor(diffMin / 60);
|
|
27
|
+
const diffDay = Math.floor(diffHour / 24);
|
|
28
|
+
const diffWeek = Math.floor(diffDay / 7);
|
|
29
|
+
const diffMonth = Math.floor(diffDay / 30);
|
|
30
|
+
const diffYear = Math.floor(diffDay / 365);
|
|
31
|
+
|
|
32
|
+
const suffix = ago ? ' ago' : '';
|
|
33
|
+
|
|
34
|
+
if (diffYear > 0) {
|
|
35
|
+
return `${diffYear} year${diffYear !== 1 ? 's' : ''}${suffix}`;
|
|
36
|
+
}
|
|
37
|
+
if (diffMonth > 0) {
|
|
38
|
+
return `${diffMonth} month${diffMonth !== 1 ? 's' : ''}${suffix}`;
|
|
39
|
+
}
|
|
40
|
+
if (diffWeek > 0) {
|
|
41
|
+
return `${diffWeek} week${diffWeek !== 1 ? 's' : ''}${suffix}`;
|
|
42
|
+
}
|
|
43
|
+
if (diffDay > 0) {
|
|
44
|
+
return `${diffDay} day${diffDay !== 1 ? 's' : ''}${suffix}`;
|
|
45
|
+
}
|
|
46
|
+
if (diffHour > 0) {
|
|
47
|
+
return `${diffHour} hour${diffHour !== 1 ? 's' : ''}${suffix}`;
|
|
48
|
+
}
|
|
49
|
+
if (diffMin > 0) {
|
|
50
|
+
return `${diffMin} minute${diffMin !== 1 ? 's' : ''}${suffix}`;
|
|
51
|
+
}
|
|
52
|
+
return 'just now';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Calculate duration between two dates
|
|
57
|
+
* @param {string|Date} startDate - Start date
|
|
58
|
+
* @param {string|Date} endDate - End date (defaults to now)
|
|
59
|
+
* @returns {string} Duration string
|
|
60
|
+
*/
|
|
61
|
+
function getDuration(startDate, endDate = new Date()) {
|
|
62
|
+
const start = new Date(startDate);
|
|
63
|
+
const end = new Date(endDate);
|
|
64
|
+
const diffMs = end - start;
|
|
65
|
+
const diffDay = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
66
|
+
const diffMonth = Math.floor(diffDay / 30);
|
|
67
|
+
const diffYear = Math.floor(diffDay / 365);
|
|
68
|
+
|
|
69
|
+
const years = diffYear;
|
|
70
|
+
const months = diffMonth % 12;
|
|
71
|
+
|
|
72
|
+
if (years > 0 && months > 0) {
|
|
73
|
+
return `${years} year${years !== 1 ? 's' : ''}, ${months} month${
|
|
74
|
+
months !== 1 ? 's' : ''
|
|
75
|
+
}`;
|
|
76
|
+
}
|
|
77
|
+
if (years > 0) {
|
|
78
|
+
return `${years} year${years !== 1 ? 's' : ''}`;
|
|
79
|
+
}
|
|
80
|
+
if (months > 0) {
|
|
81
|
+
return `${months} month${months !== 1 ? 's' : ''}`;
|
|
82
|
+
}
|
|
83
|
+
return `${diffDay} day${diffDay !== 1 ? 's' : ''}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {Object} props
|
|
88
|
+
* @param {string|Date} props.date - Date to display relatively
|
|
89
|
+
* @param {string|Date} [props.startDate] - For duration calculation
|
|
90
|
+
* @param {string|Date} [props.endDate] - For duration calculation
|
|
91
|
+
* @param {boolean} [props.ago=true] - Include "ago" suffix
|
|
92
|
+
* @param {string} [props.size] - Font size
|
|
93
|
+
* @param {string} [props.color] - Text color
|
|
94
|
+
* @param {string} [props.className] - Additional CSS classes
|
|
95
|
+
*/
|
|
96
|
+
export function RelativeDate({
|
|
97
|
+
date,
|
|
98
|
+
startDate,
|
|
99
|
+
endDate,
|
|
100
|
+
ago = true,
|
|
101
|
+
size,
|
|
102
|
+
color,
|
|
103
|
+
className,
|
|
104
|
+
}) {
|
|
105
|
+
const displayText = startDate
|
|
106
|
+
? getDuration(startDate, endDate || new Date())
|
|
107
|
+
: getRelativeTime(date, ago);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<Container
|
|
111
|
+
dateTime={typeof date === 'string' ? date : date?.toISOString()}
|
|
112
|
+
$size={size}
|
|
113
|
+
$color={color}
|
|
114
|
+
className={className}
|
|
115
|
+
>
|
|
116
|
+
{displayText}
|
|
117
|
+
</Container>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default RelativeDate;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* RelativeDate Stories
|
|
4
|
+
*/
|
|
5
|
+
import { RelativeDate } from './RelativeDate';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Resume Core/Dates/RelativeDate',
|
|
9
|
+
component: RelativeDate,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
date: new Date(Date.now() - 365 * 24 * 60 * 60 * 1000), // 1 year ago
|
|
19
|
+
ago: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Example = {
|
|
24
|
+
args: {
|
|
25
|
+
startDate: '2020-01-01',
|
|
26
|
+
endDate: '2023-06-30',
|
|
27
|
+
ago: false,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceCard
|
|
4
|
+
* Card-style work experience display
|
|
5
|
+
*/
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const Card = styled.div`
|
|
9
|
+
padding: var(--resume-space-item);
|
|
10
|
+
background-color: var(--resume-color-background);
|
|
11
|
+
border: 1px solid var(--resume-color-border);
|
|
12
|
+
border-radius: var(--resume-radius-md);
|
|
13
|
+
margin-bottom: var(--resume-space-item);
|
|
14
|
+
|
|
15
|
+
@media print {
|
|
16
|
+
border: 1px solid var(--resume-color-border);
|
|
17
|
+
break-inside: avoid;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const Header = styled.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: baseline;
|
|
25
|
+
margin-bottom: var(--resume-space-tight);
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const Title = styled.h3`
|
|
31
|
+
font-size: var(--resume-size-subheading);
|
|
32
|
+
font-weight: var(--resume-weight-semibold);
|
|
33
|
+
color: var(--resume-color-primary);
|
|
34
|
+
margin: 0;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const Company = styled.div`
|
|
38
|
+
font-size: var(--resume-size-body);
|
|
39
|
+
color: var(--resume-color-accent);
|
|
40
|
+
font-weight: var(--resume-weight-medium);
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const Meta = styled.div`
|
|
44
|
+
font-size: var(--resume-size-small);
|
|
45
|
+
color: var(--resume-color-secondary);
|
|
46
|
+
margin-bottom: var(--resume-space-tight);
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const Summary = styled.p`
|
|
50
|
+
font-size: var(--resume-size-body);
|
|
51
|
+
color: var(--resume-color-secondary);
|
|
52
|
+
line-height: var(--resume-line-height-normal);
|
|
53
|
+
margin: 0;
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export function ExperienceCard({
|
|
57
|
+
title,
|
|
58
|
+
company,
|
|
59
|
+
location,
|
|
60
|
+
date,
|
|
61
|
+
summary,
|
|
62
|
+
children,
|
|
63
|
+
className,
|
|
64
|
+
}) {
|
|
65
|
+
return (
|
|
66
|
+
<Card className={className}>
|
|
67
|
+
<Header>
|
|
68
|
+
<Title>{title}</Title>
|
|
69
|
+
</Header>
|
|
70
|
+
{company && <Company>{company}</Company>}
|
|
71
|
+
<Meta>
|
|
72
|
+
{location && <span>{location}</span>}
|
|
73
|
+
{location && date && <span> • </span>}
|
|
74
|
+
{date && <span>{date}</span>}
|
|
75
|
+
</Meta>
|
|
76
|
+
{summary && <Summary>{summary}</Summary>}
|
|
77
|
+
{children}
|
|
78
|
+
</Card>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default ExperienceCard;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceCard Stories
|
|
4
|
+
*/
|
|
5
|
+
import { ExperienceCard } from './ExperienceCard';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Resume Core/Experience/ExperienceCard',
|
|
9
|
+
component: ExperienceCard,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
title: 'Senior Software Engineer',
|
|
19
|
+
company: 'Tech Corp',
|
|
20
|
+
location: 'San Francisco, CA',
|
|
21
|
+
date: '2020 - Present',
|
|
22
|
+
summary:
|
|
23
|
+
'Led development of cloud-native microservices architecture, improving system scalability by 300%. Mentored junior developers and established best practices for code review and testing.',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Example = {
|
|
28
|
+
args: {
|
|
29
|
+
title: 'Product Manager',
|
|
30
|
+
company: 'StartupXYZ',
|
|
31
|
+
location: 'Remote',
|
|
32
|
+
date: 'Jan 2022 - Dec 2023',
|
|
33
|
+
summary:
|
|
34
|
+
'Defined product roadmap for B2B SaaS platform serving 10,000+ users. Collaborated with engineering and design teams to ship 15+ major features.',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceCompact
|
|
4
|
+
* Compact list-style experience display
|
|
5
|
+
*/
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const List = styled.ul`
|
|
9
|
+
list-style: none;
|
|
10
|
+
padding: 0;
|
|
11
|
+
margin: 0;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const Item = styled.li`
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: baseline;
|
|
18
|
+
padding: 8px 0;
|
|
19
|
+
border-bottom: 1px solid var(--resume-color-border);
|
|
20
|
+
gap: var(--resume-space-tight);
|
|
21
|
+
|
|
22
|
+
&:last-child {
|
|
23
|
+
border-bottom: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media print {
|
|
27
|
+
break-inside: avoid;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const Main = styled.div`
|
|
32
|
+
flex: 1;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const Title = styled.span`
|
|
36
|
+
font-size: var(--resume-size-body);
|
|
37
|
+
font-weight: var(--resume-weight-medium);
|
|
38
|
+
color: var(--resume-color-primary);
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
const Company = styled.span`
|
|
42
|
+
font-size: var(--resume-size-body);
|
|
43
|
+
color: var(--resume-color-secondary);
|
|
44
|
+
|
|
45
|
+
&::before {
|
|
46
|
+
content: ' at ';
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const Date = styled.div`
|
|
51
|
+
font-size: var(--resume-size-small);
|
|
52
|
+
color: var(--resume-color-secondary);
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export function ExperienceCompact({ experiences = [], className }) {
|
|
57
|
+
return (
|
|
58
|
+
<List className={className}>
|
|
59
|
+
{experiences.map((exp, index) => (
|
|
60
|
+
<Item key={index}>
|
|
61
|
+
<Main>
|
|
62
|
+
<Title>{exp.position}</Title>
|
|
63
|
+
{exp.company && <Company>{exp.company}</Company>}
|
|
64
|
+
</Main>
|
|
65
|
+
{exp.date && <Date>{exp.date}</Date>}
|
|
66
|
+
</Item>
|
|
67
|
+
))}
|
|
68
|
+
</List>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default ExperienceCompact;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceCompact Stories
|
|
4
|
+
*/
|
|
5
|
+
import { ExperienceCompact } from './ExperienceCompact';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Resume Core/Experience/ExperienceCompact',
|
|
9
|
+
component: ExperienceCompact,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
experiences: [
|
|
19
|
+
{
|
|
20
|
+
position: 'Senior Software Engineer',
|
|
21
|
+
company: 'Tech Corp',
|
|
22
|
+
date: '2020 - Present',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
position: 'Software Engineer',
|
|
26
|
+
company: 'Innovation Labs',
|
|
27
|
+
date: '2018 - 2020',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
position: 'Junior Developer',
|
|
31
|
+
company: 'WebDev Agency',
|
|
32
|
+
date: '2016 - 2018',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Example = {
|
|
39
|
+
args: {
|
|
40
|
+
experiences: [
|
|
41
|
+
{
|
|
42
|
+
position: 'Product Manager',
|
|
43
|
+
company: 'StartupXYZ',
|
|
44
|
+
date: 'Jan 2022 - Present',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
position: 'Product Owner',
|
|
48
|
+
company: 'Enterprise Corp',
|
|
49
|
+
date: '2019 - 2021',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceGrid
|
|
4
|
+
* Grid layout for experiences
|
|
5
|
+
*/
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const Grid = styled.div`
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
11
|
+
gap: var(--resume-space-item);
|
|
12
|
+
margin-bottom: var(--resume-space-section);
|
|
13
|
+
|
|
14
|
+
@media print {
|
|
15
|
+
grid-template-columns: 1fr;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (max-width: 768px) {
|
|
19
|
+
grid-template-columns: 1fr;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
const Item = styled.div`
|
|
24
|
+
padding: var(--resume-space-item);
|
|
25
|
+
border: 1px solid var(--resume-color-border);
|
|
26
|
+
border-radius: var(--resume-radius-md);
|
|
27
|
+
|
|
28
|
+
@media print {
|
|
29
|
+
break-inside: avoid;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const Title = styled.h4`
|
|
34
|
+
font-size: var(--resume-size-subheading);
|
|
35
|
+
font-weight: var(--resume-weight-semibold);
|
|
36
|
+
color: var(--resume-color-primary);
|
|
37
|
+
margin: 0 0 4px 0;
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const Company = styled.div`
|
|
41
|
+
font-size: var(--resume-size-body);
|
|
42
|
+
color: var(--resume-color-accent);
|
|
43
|
+
margin-bottom: 4px;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const Date = styled.div`
|
|
47
|
+
font-size: var(--resume-size-small);
|
|
48
|
+
color: var(--resume-color-secondary);
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export function ExperienceGrid({ experiences = [], className }) {
|
|
52
|
+
return (
|
|
53
|
+
<Grid className={className}>
|
|
54
|
+
{experiences.map((exp, index) => (
|
|
55
|
+
<Item key={index}>
|
|
56
|
+
<Title>{exp.position}</Title>
|
|
57
|
+
{exp.company && <Company>{exp.company}</Company>}
|
|
58
|
+
{exp.date && <Date>{exp.date}</Date>}
|
|
59
|
+
</Item>
|
|
60
|
+
))}
|
|
61
|
+
</Grid>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default ExperienceGrid;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceGrid Stories
|
|
4
|
+
*/
|
|
5
|
+
import { ExperienceGrid } from './ExperienceGrid';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Resume Core/Experience/ExperienceGrid',
|
|
9
|
+
component: ExperienceGrid,
|
|
10
|
+
parameters: { layout: 'padded' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
args: {
|
|
18
|
+
experiences: [
|
|
19
|
+
{
|
|
20
|
+
position: 'Senior Software Engineer',
|
|
21
|
+
company: 'Tech Corp',
|
|
22
|
+
date: '2020 - Present',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
position: 'Software Engineer',
|
|
26
|
+
company: 'Innovation Labs',
|
|
27
|
+
date: '2018 - 2020',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
position: 'Junior Developer',
|
|
31
|
+
company: 'WebDev Agency',
|
|
32
|
+
date: '2016 - 2018',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
position: 'Intern Developer',
|
|
36
|
+
company: 'Code Academy',
|
|
37
|
+
date: '2015 - 2016',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Example = {
|
|
44
|
+
args: {
|
|
45
|
+
experiences: [
|
|
46
|
+
{
|
|
47
|
+
position: 'Product Manager',
|
|
48
|
+
company: 'StartupXYZ',
|
|
49
|
+
date: 'Jan 2022 - Present',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
position: 'Product Owner',
|
|
53
|
+
company: 'Enterprise Corp',
|
|
54
|
+
date: '2019 - 2021',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
position: 'Business Analyst',
|
|
58
|
+
company: 'Consulting Firm',
|
|
59
|
+
date: '2017 - 2019',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ExperienceTimeline
|
|
4
|
+
* Timeline-style work experience (wrapper for TimelineItem)
|
|
5
|
+
*/
|
|
6
|
+
import { TimelineSection, TimelineItem } from '../timeline/index.jsx';
|
|
7
|
+
|
|
8
|
+
export function ExperienceTimeline({ experiences = [], className }) {
|
|
9
|
+
return (
|
|
10
|
+
<TimelineSection className={className}>
|
|
11
|
+
{experiences.map((exp, index) => (
|
|
12
|
+
<TimelineItem
|
|
13
|
+
key={index}
|
|
14
|
+
title={`${exp.position}${exp.company ? ` at ${exp.company}` : ''}`}
|
|
15
|
+
meta={exp.date}
|
|
16
|
+
>
|
|
17
|
+
{exp.summary}
|
|
18
|
+
</TimelineItem>
|
|
19
|
+
))}
|
|
20
|
+
</TimelineSection>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default ExperienceTimeline;
|