+
+
Breadcrumb item 1
Breadcrumb item 2
diff --git a/docs/001_develop/03_client-capabilities/009_presentation/examples/horizontal-scroll.js b/docs/001_develop/03_client-capabilities/009_presentation/examples/horizontal-scroll.js
index bc43650233..43e6a9c9d6 100644
--- a/docs/001_develop/03_client-capabilities/009_presentation/examples/horizontal-scroll.js
+++ b/docs/001_develop/03_client-capabilities/009_presentation/examples/horizontal-scroll.js
@@ -11,7 +11,7 @@ function setup() {
}
}
-export default function HorizontalScrollDemo({ children, color }) {
+export default function HorizontalScrollDemo({ inIndex = false }) {
setup();
return (
@@ -30,7 +30,8 @@ export default function HorizontalScrollDemo({ children, color }) {
Card number 3
A button
-
+ {!inIndex ?
+ (<>
Card number 4
A button
@@ -65,7 +66,7 @@ export default function HorizontalScrollDemo({ children, color }) {
Card number 12
A button
-
+ >) : null}
diff --git a/docs/001_develop/03_client-capabilities/009_presentation/index.mdx b/docs/001_develop/03_client-capabilities/009_presentation/index.mdx
index 53b0ad1bb5..99c1bb3c8c 100644
--- a/docs/001_develop/03_client-capabilities/009_presentation/index.mdx
+++ b/docs/001_develop/03_client-capabilities/009_presentation/index.mdx
@@ -10,34 +10,7 @@ tags:
sidebar_position: 9
---
-Coming soon...
+import PresentationDemo from './presentation-index.js';
-Avatar
+
-Badge
-
-Banner
-
-Breadcrumb
-
-Basic Data Grid
-
-Card
-
-Chart
-
-Connection Indicator
-
-Disclosure
-
-Divider
-
-Horizontal Scroll
-
-Icon
-
-Progress Ring
-
-Progress
-
-Skeleton
\ No newline at end of file
diff --git a/docs/001_develop/03_client-capabilities/009_presentation/presentation-index.js b/docs/001_develop/03_client-capabilities/009_presentation/presentation-index.js
new file mode 100644
index 0000000000..e798985520
--- /dev/null
+++ b/docs/001_develop/03_client-capabilities/009_presentation/presentation-index.js
@@ -0,0 +1,104 @@
+import LiveExampleBuilder from '@site/src/components/LiveExampleBuilder';
+import {useUpdateCSSVariable} from '@site/src/components/Hooks';
+
+import AvatarDemo from './examples/avatar.js';
+import BadgeDemo from './examples/badge.js';
+import BannerDemo from './examples/banner.js';
+import BreadcrumbDemo from './examples/breadcrumb.js';
+import CardDemo from './examples/card.js';
+import ConnectionIndicatorDemo from './examples/connection-indicator.js';
+import DisclosureDemo from './examples/disclosure.js';
+import DividerDemo from './examples/divider.js';
+import HorizontalScrollDemo from './examples/horizontal-scroll.js';
+import IconDemo from './examples/icon.js';
+import ProgressRingDemo from './examples/progress-ring.js';
+import ProgressDemo from './examples/progress.js';
+import SkeletonDemo from './examples/skeleton.js';
+
+const cardData = [
+ {
+ "heading": "Avatar",
+ "link": "/develop/client-capabilities/presentation/client-presentation-avatar/",
+ "text": "Display image or text representing a person",
+ children:
,
+ },
+ {
+ "heading": "Badge",
+ "link": "/develop/client-capabilities/presentation/client-presentation-badge/",
+ "text": "Display a small count or status indicator",
+ children:
,
+ },
+ {
+ "heading": "Banner",
+ "link": "/develop/client-capabilities/presentation/client-presentation-banner/",
+ "text": "Display important messages or announcements",
+ children:
,
+ },
+ {
+ "heading": "Breadcrumb",
+ "link": "/develop/client-capabilities/presentation/client-presentation-breadcrumb/",
+ "text": "Show navigation hierarchy",
+ children:
,
+ },
+ {
+ "heading": "Card",
+ "link": "/develop/client-capabilities/presentation/client-presentation-card/",
+ "text": "Container for related content and actions",
+ children:
,
+ },
+ {
+ "heading": "Connection Indicator",
+ "link": "/develop/client-capabilities/presentation/client-presentation-connection-indicator/",
+ "text": "Display network connection status",
+ children:
,
+ },
+ {
+ "heading": "Disclosure",
+ "link": "/develop/client-capabilities/presentation/client-presentation-disclosure/",
+ "text": "Toggle visibility of content",
+ children:
,
+ },
+ {
+ "heading": "Divider",
+ "link": "/develop/client-capabilities/presentation/client-presentation-divider/",
+ "text": "Separate content visually",
+ children:
,
+ },
+ {
+ "heading": "Horizontal Scroll",
+ "link": "/develop/client-capabilities/presentation/client-presentation-horizontal-scroll/",
+ "text": "Horizontally scrollable container",
+ children:
,
+ },
+ {
+ "heading": "Icon",
+ "link": "/develop/client-capabilities/presentation/client-presentation-icon/",
+ "text": "Display symbolic visual elements",
+ children:
,
+ },
+ {
+ "heading": "Progress Ring",
+ "link": "/develop/client-capabilities/presentation/client-presentation-progress-ring/",
+ "text": "Show circular progress indicator",
+ children:
,
+ },
+ {
+ "heading": "Progress",
+ "link": "/develop/client-capabilities/presentation/client-presentation-progress/",
+ "text": "Display linear progress indicator",
+ children:
,
+ },
+ {
+ "heading": "Skeleton",
+ "link": "/develop/client-capabilities/presentation/client-presentation-skeleton/",
+ "text": "Show loading state placeholder",
+ children:
,
+ },
+];
+
+export default function PresentationIndex() {
+ useUpdateCSSVariable('--toc-sidebar-width', '0px')
+ return (
+
+ );
+}
diff --git a/examples/ui/client-capabilities/interaction/anchor.js b/examples/ui/client-capabilities/interaction/anchor.js
index 48100cf367..a56aee585b 100644
--- a/examples/ui/client-capabilities/interaction/anchor.js
+++ b/examples/ui/client-capabilities/interaction/anchor.js
@@ -1,7 +1,7 @@
import { CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
-export default function AnchorDemo({ children, color }) {
+export default function AnchorDemo({ inIndex = false }) {
const isBrowser = useIsBrowser();
@@ -18,7 +18,7 @@ export default function AnchorDemo({ children, color }) {
return (
External link
- Internal link
+ {!inIndex ? (Internal link) : null}
Mail link
)
}
diff --git a/examples/ui/client-capabilities/interaction/anchored-region.js b/examples/ui/client-capabilities/interaction/anchored-region.js
index 891615d800..604b6ff834 100644
--- a/examples/ui/client-capabilities/interaction/anchored-region.js
+++ b/examples/ui/client-capabilities/interaction/anchored-region.js
@@ -1,9 +1,11 @@
import { CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
+import {useWindowSize} from '@site/src/components/Hooks';
-export default function AnchoredRegionDemo({ children, color }) {
-
+export default function AnchoredRegionDemo({}) {
const isBrowser = useIsBrowser();
+ const windowSize = useWindowSize();
+ const isSmall = windowSize.width < 1400;
if (isBrowser) {
const RapidImports = require('../../rapidImports');
@@ -13,14 +15,15 @@ export default function AnchoredRegionDemo({ children, color }) {
return (
-
)
diff --git a/examples/ui/client-capabilities/interaction/combobox.js b/examples/ui/client-capabilities/interaction/combobox.js
index b5a8a4e161..de72950a0e 100644
--- a/examples/ui/client-capabilities/interaction/combobox.js
+++ b/examples/ui/client-capabilities/interaction/combobox.js
@@ -1,7 +1,7 @@
-import { CodeLabel, CodeSection } from '../../documentationBase';
+import { CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
-export default function ComboboxDemo({ children, color }) {
+export default function ComboboxDemo({ inIndex = false }) {
const isBrowser = useIsBrowser();
if (isBrowser) {
@@ -9,9 +9,11 @@ export default function ComboboxDemo({ children, color }) {
RapidImports.registerComponents();
}
+ const styles = inIndex ? {minWidth: '0px', marginBottom: '120px', width: '100%'} : {}
+
return (
-
+
Small
Medium
Large
diff --git a/examples/ui/client-capabilities/interaction/modal.js b/examples/ui/client-capabilities/interaction/modal.js
index 6ea5337b2b..20214de06c 100644
--- a/examples/ui/client-capabilities/interaction/modal.js
+++ b/examples/ui/client-capabilities/interaction/modal.js
@@ -2,7 +2,7 @@ import { CodeLabel, CodeSection } from '../../documentationBase';
import React, { useEffect, useRef, useState } from 'react';
import useIsBrowser from '@docusaurus/useIsBrowser';
-export default function ModalDemo({ children, color }) {
+export default function ModalDemo({ inIndex = false }) {
const isBrowser = useIsBrowser();
@@ -61,6 +61,25 @@ export default function ModalDemo({ children, color }) {
}, []);
+ if (inIndex) {
+ return (
+
+
+
+ handleClick(modalRef)}>
+ Open modal
+
+
+ Modal example
+
+
+
+ )
+ }
+
return (Modal:
diff --git a/examples/ui/client-capabilities/interaction/select.js b/examples/ui/client-capabilities/interaction/select.js
index ecc92da3a4..f5aa588c99 100644
--- a/examples/ui/client-capabilities/interaction/select.js
+++ b/examples/ui/client-capabilities/interaction/select.js
@@ -1,7 +1,7 @@
import { CodeLabel, CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
-export default function SelectDemo({ children, color }) {
+export default function SelectDemo({inIndex = false}) {
const isBrowser = useIsBrowser();
if (isBrowser) {
@@ -9,5 +9,7 @@ export default function SelectDemo({ children, color }) {
RapidImports.registerComponents();
}
- return (
SmallLarge)
+ const styles = inIndex ? {minWidth: '0px', width: '100%', marginBottom: '100px'} : {}
+
+ return (
SmallLarge)
}
diff --git a/examples/ui/client-capabilities/interaction/tabs.js b/examples/ui/client-capabilities/interaction/tabs.js
index 28d6f48c4a..642d828d04 100644
--- a/examples/ui/client-capabilities/interaction/tabs.js
+++ b/examples/ui/client-capabilities/interaction/tabs.js
@@ -1,12 +1,11 @@
import { CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
-import { MenuItem } from '@genesislcap/rapid-design-system';
function ListItem({children}) {
return (
{children})
}
-export default function MenuDemo({ children, color }) {
+export default function MenuDemo({ inIndex = false }) {
const isBrowser = useIsBrowser();
@@ -20,7 +19,7 @@ export default function MenuDemo({ children, color }) {
Appetizers
Entrees
- Desserts
+ {!inIndex ? (Desserts) : null}
Stuffed artichokes
@@ -33,12 +32,13 @@ export default function MenuDemo({ children, color }) {
Grilled Fish with Artichoke Caponata
-
+ {!inIndex ?
+ (
Tiramisu
limoncello and Ice Cream with Biscotti
-
+ ) : null}
)
diff --git a/examples/ui/client-capabilities/interaction/toolbar.js b/examples/ui/client-capabilities/interaction/toolbar.js
index a5de07e1ed..9f840b94ce 100644
--- a/examples/ui/client-capabilities/interaction/toolbar.js
+++ b/examples/ui/client-capabilities/interaction/toolbar.js
@@ -1,7 +1,7 @@
import { CodeSection } from '../../documentationBase';
import useIsBrowser from '@docusaurus/useIsBrowser';
-export default function ToolbarDemo({ children, color }) {
+export default function ToolbarDemo({ inIndex = false }) {
const isBrowser = useIsBrowser();
@@ -10,19 +10,21 @@ export default function ToolbarDemo({ children, color }) {
RapidImports.registerComponents();
}
+ const styles = inIndex ? {minWidth: '0px', marginBottom: '50px', width: '100%'} : {}
+
return (
Button
-
+
Option 1
Second option
- Option 3
+ {!inIndex ? Option 3 : null}
One
Two
- Three
+ {!inIndex ? Three : null}
diff --git a/src/components/Card/Card.js b/src/components/Card/Card.js
index 3fac1e1714..41b8620630 100644
--- a/src/components/Card/Card.js
+++ b/src/components/Card/Card.js
@@ -1,26 +1,44 @@
import React from "react";
import './Card.css'
-export default function Card({ heading, text, link, imageUrl = '/svg/categories-icons/document-svgrepo-com.svg' }) {
+export default function Card({ heading, text, link, imageUrl = '/svg/categories-icons/document-svgrepo-com.svg', children }) {
+ const wrapperStyle = !children ? {} : {
+ display: 'contents',
+ };
+
+ // Stops the link working when interacting with the live examples
+ const handleChildClick = (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ };
+
return (
-
-
-
- { imageUrl && (
-
![{heading}]({imageUrl})
- )}
-
-
-
{ heading }
-
- { text }
-
-
+
+
+
+ {children ? (
+
+ {children}
+
+ ) : (
+ imageUrl && (
+
![{heading}]({imageUrl})
+ )
+ )}
+
+
-
+
+
)
-}
\ No newline at end of file
+}
diff --git a/src/components/Card/CardList.js b/src/components/Card/CardList.js
index a8b3d0ce2e..984d05dcd2 100644
--- a/src/components/Card/CardList.js
+++ b/src/components/Card/CardList.js
@@ -4,18 +4,18 @@ import './CardList.css';
import Card from './Card';
const generateClassNameFromHref = (href) => {
- return href?.replace(/^\/+|\/+$/g, '').toLowerCase().replace(/\//g, '-').replace(/[^a-z0-9-]/g, '');
+ return href?.replace(/^\/+|\/+$/g, '').toLowerCase().replace(/\//g, '-').replace(/[^a-z0-9-]/g, '');
};
export default function CardList({ inRow = 1, xs = 12, sm = 6, md = 4, items }) {
return (
{items.map((item, index) => item.link && (
-
))}
);
-}
\ No newline at end of file
+}
diff --git a/src/components/Card/LoadingRing.js b/src/components/Card/LoadingRing.js
new file mode 100644
index 0000000000..5c079cca9b
--- /dev/null
+++ b/src/components/Card/LoadingRing.js
@@ -0,0 +1,64 @@
+// Used to show loading ring when bootstraping
+// our live examples because the design system provider
+// takes a second to load. This also means we can't use
+// our own progress ring
+const LoadingRing = () => {
+ const ringStyles = {
+ display: 'flex',
+ position: 'relative',
+ width: '80px',
+ height: '80px',
+ margin: '0 auto',
+ };
+
+ const ringChildStyles = {
+ boxSizing: 'border-box',
+ display: 'block',
+ position: 'absolute',
+ width: '64px',
+ height: '64px',
+ margin: '8px',
+ border: '8px solid #fff',
+ borderRadius: '50%',
+ animation: 'ring-animation 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite',
+ borderColor: '#3498db transparent transparent transparent',
+ };
+
+ const child2Styles = {
+ ...ringChildStyles,
+ animationDelay: '-0.45s',
+ };
+
+ const child3Styles = {
+ ...ringChildStyles,
+ animationDelay: '-0.3s',
+ };
+
+ const child4Styles = {
+ ...ringChildStyles,
+ animationDelay: '-0.15s',
+ };
+
+ return (
+
+ );
+};
+
+export default LoadingRing;
diff --git a/src/components/Hooks.jsx b/src/components/Hooks.jsx
new file mode 100644
index 0000000000..5f29b43ba2
--- /dev/null
+++ b/src/components/Hooks.jsx
@@ -0,0 +1,34 @@
+import {useState, useEffect} from 'react';
+
+export function useUpdateCSSVariable(variable, value) {
+ useEffect(() => {
+ document.documentElement.style.setProperty(variable, value);
+
+ return () => {
+ document.documentElement.style.removeProperty(variable);
+ };
+ }, [variable, value]);
+}
+
+export function useWindowSize() {
+ const [windowSize, setWindowSize] = useState({
+ width: typeof window !== 'undefined' ? window.innerWidth : undefined,
+ height: typeof window !== 'undefined' ? window.innerHeight : undefined,
+ });
+
+ useEffect(() => {
+ function handleResize() {
+ setWindowSize({
+ width: window.innerWidth,
+ height: window.innerHeight,
+ });
+ }
+
+ window.addEventListener('resize', handleResize);
+ // Initial size is now set in useState, so we don't need to call handleResize here
+
+ return () => window.removeEventListener('resize', handleResize);
+ }, []);
+
+ return windowSize;
+}
diff --git a/src/components/LiveExampleBuilder.js b/src/components/LiveExampleBuilder.js
new file mode 100644
index 0000000000..2cf251ad4e
--- /dev/null
+++ b/src/components/LiveExampleBuilder.js
@@ -0,0 +1,45 @@
+import useIsBrowser from '@docusaurus/useIsBrowser';
+import CardList from '@site/src/components/Card/CardList';
+import LoadingRing from '@site/src/components/Card/LoadingRing';
+import {useState, useEffect} from 'react';
+
+export default function LiveExampleBuilder({ itemData }) {
+ const isBrowser = useIsBrowser();
+ const [isLoading, setIsLoading] = useState(true);
+
+ const processedItems = itemData.map((item) => ({
+ ...item,
+ ...(item.children ? {children: {...item.children, props: {inIndex: true}}} : {}),
+ }))
+
+ useEffect(() => {
+ const timer = setTimeout(() => {
+ setIsLoading(false);
+ }, 1000);
+
+ return () => clearTimeout(timer);
+ }, []);
+
+ if (isBrowser) {
+ const RapidImports = require('../../examples/ui/rapidImports');
+ RapidImports.registerComponents();
+ }
+
+ return (
+ <>
+ {isLoading ? (
+
+ ) : (
+
+
+
+ )}
+ >
+ );
+}
+
diff --git a/src/css/custom.css b/src/css/custom.css
index 22e2a743ab..eb6b97db27 100644
--- a/src/css/custom.css
+++ b/src/css/custom.css
@@ -68,7 +68,7 @@
--doc-sidebar-width: 325px !important;
- --toc-sidebar-width: 325px;
+ --toc-sidebar-width: 140px;
}
body {
@@ -216,7 +216,7 @@ h5 {
}
.main-wrapper main article {
- max-width: 100rem;
+ max-width: 120rem;
}
@media (min-aspect-ratio: 1/1) and (min-width: 1512px) {
@@ -224,6 +224,15 @@ h5 {
margin-left: auto;
margin-right: auto;
}
+ :root {
+ --toc-sidebar-width: 220px;
+ }
+}
+
+@media (min-aspect-ratio: 1/1) and (min-width: 2250px) {
+ :root {
+ --toc-sidebar-width: 335px;
+ }
}
@media (min-aspect-ratio: 1/1) and (max-width: 996px) {
diff --git a/src/theme/DocCardList.tsx b/src/theme/DocCardList.tsx
index 6ef007c31d..1c59bb5cec 100644
--- a/src/theme/DocCardList.tsx
+++ b/src/theme/DocCardList.tsx
@@ -21,7 +21,7 @@ export default function DocCardList(props: Props): JSX.Element {
const category = useCurrentSidebarCategory();
const extraCategoryData = sidebarItemsData[category.href];
let enrichedItems = filterDocCardListItems(items);
-
+
if (extraCategoryData?.items) {
enrichedItems = enrichedItems.map((item) => {
const extraData = extraCategoryData.items.find(extraItemData => extraItemData.href === item.href) || {};
@@ -30,7 +30,7 @@ export default function DocCardList(props: Props): JSX.Element {
...extraData,
};
});
- }
+ }
const filteredItems = enrichedItems.map((
{ label: heading, href: link, description: text, imageUrl },
@@ -46,4 +46,4 @@ export default function DocCardList(props: Props): JSX.Element {
/>
);
-}
\ No newline at end of file
+}