diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/Grid/Grid.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/Grid/Grid.tsx index 362c80fb..99e9ca2c 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/Grid/Grid.tsx +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/Grid/Grid.tsx @@ -21,8 +21,8 @@ export type GridProps = React.ComponentProps & { export const Grid: { Item: typeof GridItem } & React.FC = ({ actions, - leftLabel, - rightLabel, + leftLabel = '', + rightLabel = '', spacingButtons = false, children, ...props @@ -54,19 +54,33 @@ export const Grid: { Item: typeof GridItem } & React.FC = ({ > - {leftLabel?.length && leftLabel} + {leftLabel.length ? ( + + {leftLabel} + + ) : null} - {rightLabel?.length && rightLabel} + {rightLabel.length ? ( + + {rightLabel} + + ) : null} @@ -101,14 +115,7 @@ const GridRoot = styled.div<{ display: flex; flex-direction: row; gap: 0 1rem; - - button:first-of-type { - justify-content: flex-start; - } - - button:last-of-type { - justify-content: flex-end; - } + margin-left: auto; } .mdx-grid__scroll--spacing-buttons { @@ -118,16 +125,14 @@ const GridRoot = styled.div<{ justify-content: space-between; width: 100%; } + + > div > button:not(:last-child) { + border-right: 1px solid rgb(var(--lsd-border-primary)) !important; + } } .mdx-grid__scroll-button { - width: 83px; - gap: 0.75rem; display: flex; - align-items: center; - align-self: stretch; - border: 1px solid rgb(var(--lsd-border-primary)) !important; - padding: 6px 10px; } .mdx-grid__content { @@ -197,9 +202,38 @@ const GridRoot = styled.div<{ scroll-snap-type: x mandatory; } `} + + ${bp.scrollButtons === false && + css` + .mdx-grid__scroll { + display: none; + } + `} `) })} + ${(props) => + lsdUtils.responsive( + props.theme as any, + 'md', + 'up', + )(css` + .mdx-grid__scroll-button--with-label { + width: auto; + min-width: 83px; + padding: 5px 11px 5px 9px; + gap: 12px; + + &:first-of-type { + justify-content: flex-start; + } + + &:last-of-type { + justify-content: flex-start; + } + } + `)} + ${(props) => lsdUtils.responsive( props.theme as any, @@ -207,8 +241,6 @@ const GridRoot = styled.div<{ 'down', )(css` .mdx-grid__scroll { - display: ${props.xs?.scrollButtons ? 'flex' : 'none'}; - & > div { justify-content: flex-end; @@ -218,15 +250,7 @@ const GridRoot = styled.div<{ } } - .mdx-grid__scroll-button { - width: 28px; - } - - .mdx-grid__scroll-button--left { - display: none; - } - - .mdx-grid__scroll-button--right { + .mdx-grid__scroll-button-label { display: none; } `)} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/Roadmap/Roadmap.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/Roadmap/Roadmap.tsx index 4b9fdccb..95921f7c 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/Roadmap/Roadmap.tsx +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/Roadmap/Roadmap.tsx @@ -11,14 +11,12 @@ export type RoadmapProps = Omit< > & { title: React.ReactNode description?: React.ReactNode - alignment?: 'top' | 'bottom' timeline?: Partial[] } export const Roadmap: React.FC = ({ title, description, - alignment = 'bottom', timeline = [], className, children, @@ -26,14 +24,20 @@ export const Roadmap: React.FC = ({ }) => { const currentYear = new Date().getFullYear() - const handleBorderStyle = (year: number, isLast: boolean) => { - if (year === currentYear) { - return 'solid' - } else if (isLast) { + const handleBorderStyle = (item, index, array) => { + if (index === array.length - 1) { return 'none' - } else return 'dashed' - } + } + const currentYear = item.period[0] + const nextYear = array[index + 1].period[0] + + if (currentYear === nextYear) { + return 'solid' + } + + return 'dashed' + } const getCurrentQuarter = () => { const month = new Date().getMonth() return 'Q' + Math.ceil((month + 1) / 3) @@ -67,14 +71,7 @@ export const Roadmap: React.FC = ({ } return ( -
+
{title} @@ -90,7 +87,7 @@ export const Roadmap: React.FC = ({ @@ -98,14 +95,10 @@ export const Roadmap: React.FC = ({ diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.scss b/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.scss index c7072a6e..1dbc631e 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.scss +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.scss @@ -3,6 +3,8 @@ .mdx-timeline-item { width: 236px; + min-height: 306px; + justify-content: space-between; gap: 1rem; flex: 0 0 auto; display: flex; @@ -64,14 +66,6 @@ } } -.mdx-timeline-item--top-aligned { -} - -.mdx-timeline-item--bottom-aligned { - min-height: 308px; - justify-content: space-between; -} - .mdx-timeline-item__description { margin-top: auto; } diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.tsx index e50421b1..c19f8af7 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.tsx +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/TimelineItem/TimelineItem.tsx @@ -9,8 +9,6 @@ export type TimelineItemProps = Omit< > & { /** The index or label of the timeline item. */ index: React.ReactNode - /** The alignment of the timeline item, either 'top' or 'bottom'. (Optional, default: 'top') */ - alignment?: 'top' | 'bottom' /** The period or time frame associated with the timeline item. e.g., `2023 Q3` */ period: [number, 'Q1' | 'Q2' | 'Q3' | 'Q4' | '+'] | number /** The description or content of the timeline item. */ @@ -90,7 +88,6 @@ export const TimelineItem: React.FC = ({ index, period, description, - alignment = 'top', borderStyle, periodStyle, className, @@ -102,7 +99,6 @@ export const TimelineItem: React.FC = ({ className={clsx( className, 'mdx-timeline-item', - `mdx-timeline-item--${alignment}-aligned`, borderStyle === 'dashed' && 'mdx-timeline-item--border-dashed', )} {...props}