diff --git a/src/components/CodePreview/index.css b/src/components/CodePreview/index.css index d8f3a6e25..ad1436a6e 100644 --- a/src/components/CodePreview/index.css +++ b/src/components/CodePreview/index.css @@ -6,6 +6,10 @@ justify-content: space-between; } +.toggle-button-container { + margin: auto var(--ic-space-xs) auto 0; +} + .comp-preview { position: relative; border: 1px solid var(--ic-architectural-300); @@ -71,12 +75,8 @@ .snippet-container { display: flex; - justify-content: flex-end; background-color: var(--ic-architectural-40) !important; padding: var(--ic-space-xxs); -} - -.snippet-container.pattern { justify-content: space-between; } diff --git a/src/components/CodePreview/index.tsx b/src/components/CodePreview/index.tsx index 69d93ff85..948e1bc9e 100644 --- a/src/components/CodePreview/index.tsx +++ b/src/components/CodePreview/index.tsx @@ -16,19 +16,40 @@ import { } from "@mdi/js"; import Icon from "@mdi/react"; import clsx from "clsx"; -import { SlottedSVG } from "@ukic/react"; +import { + IcButton, + IcTab, + IcTabContext, + IcTabGroup, + IcTabPanel, + IcToggleButton, + IcToggleButtonGroup, + SlottedSVG, +} from "@ukic/react"; import StackblitzButton, { StackblitzProps, } from "../../content/structured/patterns/components/StackblitzButton"; +import { useViewportWidth } from "../../utils/helpers"; import PageMetadataContext from "../../context/PageMetadata"; import "./index.css"; -import { useViewportWidth } from "../../utils/helpers"; +import { + createReactAppTsx, + createWebComponentsIndexHTML, +} from "../../content/structured/patterns/components/StackblitzButton/stackblitz-helpers"; -interface Snippet { - language: string; +interface LongCodeSnippet { + language: "jsx" | "tsx"; snippet: string; } +interface Snippet { + technology: string; + snippets: { + short?: string | undefined; + long: string | LongCodeSnippet[]; + }; +} + interface ComponentPreviewProps extends Partial { snippets?: Snippet[]; left?: boolean; @@ -37,26 +58,35 @@ interface ComponentPreviewProps extends Partial { children: ReactNode; style: CSSProperties; state: "none" | "good" | "bad"; + showStackblitzBtn: boolean; type?: string; } interface CodeSnippetProps extends Partial { code: string; + longCode: string; type?: string; show: boolean; setShow: Dispatch>; + showMore: boolean; + setShowMore: Dispatch>; showStackblitzBtn?: boolean; + selectedLanguage: "Typescript" | "Javascript"; } const CodeSnippet: React.FC = ({ code, + longCode, isWebComponents, type, show, setShow, + showMore, + setShowMore, showStackblitzBtn, projectTitle, projectDescription, + selectedLanguage, }) => { const viewportWidth = useViewportWidth(); const isLargeViewport: boolean = viewportWidth > 992; @@ -85,9 +115,9 @@ const CodeSnippet: React.FC = ({ )} )} -
+
{type === "pattern" && ( - = ({ height="24" path={!show ? mdiMenuDown : mdiMenuUp} /> - + + )} + {type !== "pattern" && ( + setShowMore(!showMore)} + > + Show {showMore ? "less" : "full"} code + + )}
{showStackblitzBtn && projectTitle !== undefined && ( )} - = ({ height="24" /> {isLargeViewport && "Copy code"} - +
@@ -147,11 +195,28 @@ const ComponentPreview: React.FC = ({ centered = true, style, state = "none", + showStackblitzBtn = true, projectTitle, projectDescription, type, }) => { + const viewportWidth = useViewportWidth(); + const isLargeViewport: boolean = viewportWidth > 992; + + // Show/hide functionality for pattern code previews const [show, setShow] = useState(type !== "pattern"); + // Show more/less functionality for component code previews + const [showMore, setShowMore] = useState(false); + const [selectedTab, setSelectedTab] = useState<"Web component" | "React">( + "Web component" + ); + const [selectedLanguage, setSelectedLanguage] = useState< + "Typescript" | "Javascript" + >("Typescript"); + + const tabSelectCallback = (ev: CustomEvent) => { + setSelectedTab(ev.detail.tabIndex === 0 ? "Web component" : "React"); + }; const pageMetadata = React.useContext(PageMetadataContext); @@ -159,12 +224,78 @@ const ComponentPreview: React.FC = ({ if (type === "pattern") { return " pattern"; } - if (snippet.language === "React") { + if (snippet.technology === "React") { return " component"; } return ""; }; + const getCodeSnippet = (snippet: Snippet) => { + const isLongCode = showMore || type === "pattern"; + const longCodeIndex = selectedLanguage === "Typescript" ? 0 : 1; + let shortCodeSnippet: string | undefined = ""; + let longCode = ""; + + if (type !== "pattern") shortCodeSnippet = snippet.snippets.short; + const lines = shortCodeSnippet?.split("\n"); + if (lines && lines.length > 0) { + for (let i = 1; i < lines?.length; i += 1) { + lines[i] = `\t${lines[i]}`; + } + } + shortCodeSnippet = lines?.join("\n"); + + if (selectedTab === "Web component") { + if ( + !Array.isArray(snippet.snippets.long) && + typeof snippet.snippets.long === "string" + ) { + longCode = snippet.snippets.long.replace( + "{shortCode}", + `${shortCodeSnippet}` + ); + } + + let codeSnippet; + if (showMore) { + codeSnippet = createWebComponentsIndexHTML(longCode); + } else if (type === "pattern") { + if (typeof snippet.snippets.long === "string") + codeSnippet = createWebComponentsIndexHTML(snippet.snippets.long); + } else { + codeSnippet = snippet.snippets.short; + } + + return { + longCode: createWebComponentsIndexHTML(longCode), + codeSnippet: codeSnippet || "", + }; + } + if (Array.isArray(snippet.snippets.long)) { + if ( + !Array.isArray(snippet.snippets.long[longCodeIndex].snippet) && + typeof snippet.snippets.long[longCodeIndex].snippet === "string" + ) { + longCode = createReactAppTsx( + snippet.snippets.long[longCodeIndex].snippet.replace( + "{shortCode}", + `${shortCodeSnippet}` + ), + pageMetadata.pageTitle, + longCodeIndex === 0 ? "tsx" : "jsx" + ); + } + return { + longCode, + codeSnippet: isLongCode ? longCode : snippet.snippets.short, + }; + } + return { + longCode: "error", + codeSnippet: "error", + }; + }; + return (

Interactive example

@@ -197,37 +328,92 @@ const ComponentPreview: React.FC = ({ {children}
{snippets && ( - +
- + {snippets.map((snippet, index) => ( - {snippet.language} + {snippet.technology} ))} - + +
+ {selectedTab === "React" && ( + + + setSelectedLanguage( + selectedLanguage === "Typescript" + ? "Javascript" + : "Typescript" + ) + } + > + + + + + + setSelectedLanguage( + selectedLanguage === "Typescript" + ? "Javascript" + : "Typescript" + ) + } + > + + + + + + )} +
{snippets.map((snippet, index) => ( - + - + ))} -
+ )}
); diff --git a/src/content/structured/components/accordion/code.mdx b/src/content/structured/components/accordion/code.mdx index b4420e5a6..3e76b07f6 100644 --- a/src/content/structured/components/accordion/code.mdx +++ b/src/content/structured/components/accordion/code.mdx @@ -30,8 +30,9 @@ import { export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` A blend of different black teas. @@ -40,12 +41,14 @@ export const snippets = [ A tea blend that has been flavoured with oil of bergamot. - -`, +`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` A blend of different black teas. @@ -54,8 +57,22 @@ export const snippets = [ A tea blend that has been flavoured with oil of bergamot. - -`, +`, + long: [ + { + language: "Typescript", + snippet: `<> + {shortCode} + `, + }, + { + language: "Javascript", + snippet: `<> + {shortCode} + `, + }, + ], + }, }, ]; @@ -84,8 +101,9 @@ export const snippets = [ export const withIcon = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -202,8 +234,9 @@ export const withIcon = [ export const groupTitle = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` An espresso-based drink that is traditionally prepared with steamed milk foam. @@ -215,10 +248,13 @@ export const groupTitle = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` An espresso-based drink that is traditionally prepared with steamed milk foam. @@ -230,6 +266,17 @@ export const groupTitle = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -237,8 +284,9 @@ export const groupTitle = [ export const snippetsNested = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` An espresso-based drink that is traditionally prepared with steamed milk foam. @@ -257,10 +305,13 @@ export const snippetsNested = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` An espresso-based drink that is traditionally prepared with steamed milk foam. @@ -279,6 +330,17 @@ export const snippetsNested = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/alerts/code.mdx b/src/content/structured/components/alerts/code.mdx index 8b1e640a4..6d929b2a4 100644 --- a/src/content/structured/components/alerts/code.mdx +++ b/src/content/structured/components/alerts/code.mdx @@ -25,20 +25,35 @@ import { IcAlert, IcButton, IcLink } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -84,12 +99,27 @@ export const snippetsDefault = [ export const snippetsDismissible = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -105,8 +135,9 @@ export const snippetsDismissible = [ export const snippetsWithAction = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` View Drinks `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` console.log(ev)}>View Drinks `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -145,21 +190,36 @@ export const snippetsWithAction = [ export const snippetsTitleAbove = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -176,19 +236,34 @@ export const snippetsTitleAbove = [ export const snippetsResponsiveTitle = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -204,16 +279,31 @@ export const snippetsResponsiveTitle = [ export const snippetsCustomMessage = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Go to our coffee page to learn more. `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Go to our coffee page to learn more. `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/back-to-top/code.mdx b/src/content/structured/components/back-to-top/code.mdx index e15eb5c69..6e3ededd0 100644 --- a/src/content/structured/components/back-to-top/code.mdx +++ b/src/content/structured/components/back-to-top/code.mdx @@ -23,12 +23,27 @@ import { IcButton } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/badge/code.mdx b/src/content/structured/components/badge/code.mdx index d5bccc12b..8842b43db 100644 --- a/src/content/structured/components/badge/code.mdx +++ b/src/content/structured/components/badge/code.mdx @@ -35,8 +35,9 @@ import { useState } from "react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Coffee orders `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Coffee orders `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -78,9 +93,10 @@ export const snippetsDefault = [ export const snippetsSizes = [ { - language: "Web component", - snippet: ` - + technology: "Web component", + snippets: { + short: ` + Coffee orders @@ -91,10 +107,13 @@ export const snippetsSizes = [ Coffee orders `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Coffee orders @@ -106,6 +125,17 @@ export const snippetsSizes = [ Coffee orders `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -128,8 +158,9 @@ export const snippetsSizes = [ export const snippetsStatus = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Coffee orders @@ -145,10 +176,13 @@ export const snippetsStatus = [ Coffee orders `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Coffee orders @@ -164,6 +198,17 @@ export const snippetsStatus = [ Coffee orders `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -190,8 +235,9 @@ export const snippetsStatus = [ export const snippetsInformation = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Coffee orders @@ -217,10 +263,13 @@ export const snippetsInformation = [ Coffee orders `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Coffee orders @@ -246,6 +295,17 @@ export const snippetsInformation = [ Coffee orders `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -285,8 +345,9 @@ export const snippetsInformation = [ export const snippetsMaxNumber = [ { - language: "Web component", - snippet: `
+ technology: "Web component", + snippets: { + short: `
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `
+ technology: "React", + snippets: { + short: `
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -328,8 +403,9 @@ export const snippetsMaxNumber = [ export const snippetsNear = [ { - language: "Web component", - snippet: `
+ technology: "Web component", + snippets: { + short: `
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `
+ technology: "React", + snippets: { + short: `
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -432,8 +522,9 @@ export const snippetsNear = [ export const snippetsInline = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` About @@ -457,10 +548,13 @@ export const snippetsInline = [ Ingredients page Orders page `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` About @@ -484,6 +578,17 @@ export const snippetsInline = [ Ingredients page Orders page `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -516,8 +621,15 @@ Click the button to hide and show the badge. export const snippetsHideBadge = [ { - language: "Web component", - snippet: ` -
- - - Coffee orders - -
`, +`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `export const ToggleBadge = () => { + technology: "React", + snippets: { + short: `export const ToggleBadge = () => { const [showBadge, setShowBadge] = useState(false); const handleShowHideBadge = () => { setShowBadge(!showBadge); @@ -555,6 +664,17 @@ export const snippetsHideBadge = [
); };`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -592,8 +712,9 @@ export const ToggleBadge = () => { export const snippetsAccessibleLabel = [ { - language: "Web component", - snippet: `
+ technology: "Web component", + snippets: { + short: `
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `
+ technology: "React", + snippets: { + short: `
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/breadcrumbs/code.mdx b/src/content/structured/components/breadcrumbs/code.mdx index e95699712..71bed9f97 100644 --- a/src/content/structured/components/breadcrumbs/code.mdx +++ b/src/content/structured/components/breadcrumbs/code.mdx @@ -27,8 +27,9 @@ import { NavLink, MemoryRouter } from "react-router-dom"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -88,8 +103,9 @@ export const snippets = [ export const back = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -139,8 +169,9 @@ export const back = [ export const withIcons = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -311,8 +356,9 @@ export const withIcons = [ export const collapsed = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -362,8 +422,9 @@ export const collapsed = [ export const withReactRouter = [ { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -383,6 +444,17 @@ export const withReactRouter = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/buttons/code.mdx b/src/content/structured/components/buttons/code.mdx index c516f4ec6..25a1cdbb8 100644 --- a/src/content/structured/components/buttons/code.mdx +++ b/src/content/structured/components/buttons/code.mdx @@ -25,8 +25,9 @@ import { IcButton } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: `Add to order + technology: "Web component", + snippets: { + short: `Add to order View coffees Find out more Cancel order @@ -36,13 +37,27 @@ export const snippetsDefault = [ console.log(ev); }) `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev)}>Add to order + technology: "React", + snippets: { + short: ` console.log(ev)}>Add to order View coffees Find out more Cancel order`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -65,16 +80,31 @@ export const snippetsDefault = [ export const snippetsOtherStates = [ { - language: "Web component", - snippet: `Add to order + technology: "Web component", + snippets: { + short: `Add to order Loading button Add to order`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `Add to order + technology: "React", + snippets: { + short: `Add to order Loading button Add to order`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -94,8 +124,9 @@ export const snippetsOtherStates = [ export const snippetsWithIcon = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Refresh order status `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Refresh order status `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -149,8 +194,9 @@ export const snippetsWithIcon = [ export const snippetsIcon = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -199,16 +259,31 @@ export const snippetsIcon = [ export const snippetsSizing = [ { - language: "Web component", - snippet: `Add to order + technology: "Web component", + snippets: { + short: `Add to order Add to order Add to order`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `Add to order + technology: "React", + snippets: { + short: `Add to order Add to order Add to order`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -226,20 +301,35 @@ export const snippetsSizing = [ export const snippetsColour = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Add to order Add to order Add to order`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Add to order Add to order Add to order`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -281,8 +371,9 @@ export const FileUpload = () => { export const snippetsFileUpload = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `export const FileUpload = () => { + technology: "React", + snippets: { + short: `export const FileUpload = () => { function updateFileList(fileArray) { const fileList = []; Array.from(fileArray).forEach((file) => { @@ -329,6 +423,17 @@ export const snippetsFileUpload = [ ); };`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/cards/code.mdx b/src/content/structured/components/cards/code.mdx index 967c78174..b0b744dd3 100644 --- a/src/content/structured/components/cards/code.mdx +++ b/src/content/structured/components/cards/code.mdx @@ -60,8 +60,9 @@ export const InteractionIcon = () => ( export const snippets = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -271,12 +286,27 @@ export const snippets = [ export const headingOnly = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -288,8 +318,9 @@ export const headingOnly = [ export const withIcon = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -339,8 +384,9 @@ export const withIcon = [ export const withMessage = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -392,8 +452,9 @@ export const withMessage = [ export const withSubHeading = [ { - language: "Web component", - snippet: ` @@ -408,10 +469,13 @@ export const withSubHeading = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -426,6 +490,17 @@ export const withSubHeading = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -452,8 +527,9 @@ export const withSubHeading = [ export const interactionButton = [ { - language: "Web component", - snippet: ` @@ -481,10 +557,13 @@ export const interactionButton = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -511,6 +590,17 @@ export const interactionButton = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -540,8 +630,9 @@ export const interactionButton = [ export const adornment = [ { - language: "Web component", - snippet: ` @@ -557,10 +648,13 @@ export const adornment = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -576,6 +670,17 @@ export const adornment = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -608,8 +713,9 @@ export const adornment = [ export const topImage = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -783,8 +903,9 @@ export const topImage = [ export const midImage = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -955,8 +1090,9 @@ export const midImage = [ export const interactionControls = [ { - language: "Web component", - snippet: ` @@ -976,10 +1112,13 @@ export const interactionControls = [ Cancel
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -999,6 +1138,17 @@ export const interactionControls = [ Cancel
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1029,8 +1179,9 @@ export const interactionControls = [ export const expandable = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1113,8 +1278,9 @@ export const expandable = [ export const clickableLink = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1180,8 +1360,9 @@ export const clickableLink = [ export const clickableBtn = [ { - language: "Web component", - snippet: ` +`, + long: `{shortCode} `, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1252,8 +1448,9 @@ export const clickableBtn = [ export const withBadge = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1322,8 +1533,9 @@ export const withBadge = [ export const disabled = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1388,8 +1614,9 @@ export const disabled = [ export const fullWidth = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1454,8 +1695,9 @@ export const fullWidth = [ export const wrapped = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/checkboxes/code.mdx b/src/content/structured/components/checkboxes/code.mdx index c6959d5ea..c8fed3e7b 100644 --- a/src/content/structured/components/checkboxes/code.mdx +++ b/src/content/structured/components/checkboxes/code.mdx @@ -25,8 +25,9 @@ import { IcCheckboxGroup, IcCheckbox, IcTextField } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -42,14 +43,28 @@ export const snippetsDefault = [ }) `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log("onIcChange", ev.detail.value)}> + technology: "React", + snippets: { + short: ` console.log("onIcChange", ev.detail.value)}> console.log("onIcCheck", ev)} /> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -83,18 +98,33 @@ export const snippetsDefault = [ export const snippetsHiddenLabel = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -109,18 +139,33 @@ export const snippetsHiddenLabel = [ export const snippetsHelperText = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -139,8 +184,9 @@ export const snippetsHelperText = [ export const snippetsSizes = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -152,10 +198,13 @@ export const snippetsSizes = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -167,6 +216,17 @@ export const snippetsSizes = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -189,16 +249,31 @@ export const snippetsSizes = [ export const snippetsSettingEachCheckboxSize = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -220,8 +295,9 @@ export const snippetsSettingEachCheckboxSize = [ export const snippetsConditional = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -234,10 +310,13 @@ export const snippetsConditional = [ > `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -250,6 +329,17 @@ export const snippetsConditional = [ /> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -270,8 +360,9 @@ export const snippetsConditional = [ export const snippetsConditionalDynamic = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -284,10 +375,13 @@ export const snippetsConditionalDynamic = [ > `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -300,6 +394,17 @@ export const snippetsConditionalDynamic = [ /> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -325,18 +430,33 @@ export const snippetsConditionalDynamic = [ export const snippetsValidation = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -356,8 +476,9 @@ export const snippetsValidation = [ export const snippetsIndeterminate = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -372,10 +493,13 @@ export const snippetsIndeterminate = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -390,6 +514,17 @@ export const snippetsIndeterminate = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/chips/code.mdx b/src/content/structured/components/chips/code.mdx index 49beaaf31..8d377e366 100644 --- a/src/content/structured/components/chips/code.mdx +++ b/src/content/structured/components/chips/code.mdx @@ -25,8 +25,9 @@ import { IcChip } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev)}> + technology: "React", + snippets: { + short: ` console.log(ev)}> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -119,8 +134,9 @@ export const snippetsDefault = [ export const snippetsOutline = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -174,8 +204,9 @@ export const snippetsOutline = [ export const snippetsDismissible = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` console.log(ev)); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev)}> + technology: "React", + snippets: { + short: ` console.log(ev)}> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -233,8 +278,9 @@ export const snippetsDismissible = [ export const snippetsDisabled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/classification-banner/code.mdx b/src/content/structured/components/classification-banner/code.mdx index afaec6fbd..441c5c5d2 100644 --- a/src/content/structured/components/classification-banner/code.mdx +++ b/src/content/structured/components/classification-banner/code.mdx @@ -26,20 +26,35 @@ import { IcClassificationBanner } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -61,12 +76,27 @@ export const snippets = [ export const snippetsVariants = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/data-entity/code.mdx b/src/content/structured/components/data-entity/code.mdx index 5eb21e012..7a8b48092 100644 --- a/src/content/structured/components/data-entity/code.mdx +++ b/src/content/structured/components/data-entity/code.mdx @@ -33,8 +33,9 @@ import { export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Edit @@ -74,10 +75,13 @@ export const snippets = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Edit @@ -117,6 +121,17 @@ export const snippets = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -177,8 +192,9 @@ export const snippets = [ export const withStatusTags = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` @@ -204,10 +220,13 @@ export const withStatusTags = [ /> `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` @@ -233,6 +252,17 @@ export const withStatusTags = [ /> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -266,8 +296,9 @@ export const withStatusTags = [ export const smallSnippet = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -411,8 +456,9 @@ export const smallSnippet = [ export const editableExample = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Edit `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/dialog/code.mdx b/src/content/structured/components/dialog/code.mdx index cf473e3f6..c7922cb49 100644 --- a/src/content/structured/components/dialog/code.mdx +++ b/src/content/structured/components/dialog/code.mdx @@ -45,35 +45,39 @@ export const buttonProps = [ export const snippetsDefault = [ { - language: "Web component", - snippet: ` -Launch dialog + technology: "Web component", + snippets: { + short: `Launch dialog You are about to add 'Americano' to your basket. Are you sure you want to continue? `, + long: `{shortCode} + `, + }, }, { - language: "React", - snippet: `const [openDialog, setOpenDialog] = useState(false); + technology: "React", + snippets: { + short: `const [openDialog, setOpenDialog] = useState(false); const handleDialogOpen = () => setOpenDialog(true); const handleDialogClose = () => setOpenDialog(false); return ( @@ -96,6 +100,17 @@ return ( ) `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -137,8 +152,21 @@ export const DefaultDialog = () => { export const snippetsSizes = [ { - language: "Web component", - snippet: ` -Launch sizes dialog - - - You are about to add 'Americano' to your basket. Are you sure you want to continue? - -`, +`, + }, }, { - language: "React", - snippet: `const [openDialog, setOpenDialog] = useState(false); + technology: "React", + snippets: { + short: `const [openDialog, setOpenDialog] = useState(false); const handleDialogOpen = () => setOpenDialog(true); const handleDialogClose = () => setOpenDialog(false); return ( @@ -192,6 +212,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -228,26 +259,9 @@ export const SizesDialogs = () => { export const snippetsAlert = [ { - language: "Web component", - snippet: ` -Launch status dialog + technology: "Web component", + snippets: { + short: `Launch status dialog `, + long: `{shortCode} + `, + }, }, { - language: "React", - snippet: `const [openDialog, setOpenDialog] = useState(false); + technology: "React", + snippets: { + short: `const [openDialog, setOpenDialog] = useState(false); const handleDialogOpen = () => setOpenDialog(true); const handleDialogClose = () => setOpenlDialog(false); return ( @@ -303,6 +338,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -358,39 +404,9 @@ export const AlertDialog = () => { export const snippetsCustomButtons = [ { - language: "Web component", - snippet: ` - Launch no button dialog + technology: "Web component", + snippets: { + short: `Launch no button dialog Launch single button dialog Launch three button dialog Launch destructive button dialog @@ -421,10 +437,45 @@ export const snippetsCustomButtons = [ You are about to cancel your order for an Americano. Are you sure you want to continue? `, + long: `{shortCode} + + `, + }, }, { - language: "React", - snippet: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false); + technology: "React", + snippets: { + short: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false); const [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false); const [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false); const [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false); @@ -521,6 +572,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -643,8 +705,9 @@ export const CustomButtonsDialog = () => { export const snippetsSlottedButtons = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev.detail.value)}> + technology: "React", + snippets: { + short: ` console.log(ev.detail.value)}> `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -91,8 +106,9 @@ export const snippets = [ export const conditional = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -136,8 +166,9 @@ export const conditional = [ export const conditionalDynamic = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -190,8 +235,9 @@ export const conditionalDynamic = [ export const withHelperText = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -228,8 +288,9 @@ export const withHelperText = [ export const smallSnippet = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -266,18 +341,33 @@ export const smallSnippet = [ export const withValidation = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/search-bar/code.mdx b/src/content/structured/components/search-bar/code.mdx index 42b05ab6c..55fc401a3 100644 --- a/src/content/structured/components/search-bar/code.mdx +++ b/src/content/structured/components/search-bar/code.mdx @@ -25,8 +25,9 @@ import { IcSearchBar, IcTypography } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev.detail.value)} placeholder="Start typing to search…" />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -88,8 +103,9 @@ export const snippets = [ export const optionsNoFiltering = [ { - language: "Web component", - snippet: ` @@ -108,10 +124,13 @@ export const optionsNoFiltering = [ { label: "Mocha", value: "mocha" }, ]; `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `
All options will be displayed as you type`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -155,8 +185,9 @@ export const optionsNoFiltering = [ export const withHelperText = [ { - language: "Web component", - snippet: ` @@ -171,10 +202,13 @@ export const withHelperText = [ { label: "Mocha", value: "mocha" }, ]; `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -209,8 +254,9 @@ export const withHelperText = [ export const withHiddenLabel = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -262,8 +322,9 @@ export const withHiddenLabel = [ export const disabled = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -314,8 +389,9 @@ export const disabled = [ export const sizeSmall = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -368,8 +458,9 @@ This example shows how to filter data asynchronously when the value in the input export const customFiltering = [ { - language: "Web component", - snippet: ` @@ -401,10 +492,13 @@ export const customFiltering = [ } }); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const mockData = [ + technology: "React", + snippets: { + short: `const mockData = [ { label: "Espresso", value: "espresso" }, { label: "Double Espresso", value: "doubleespresso" }, { label: "Flat White", value: "flatwhite" }, @@ -439,6 +533,17 @@ return( /> );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/section-container/code.mdx b/src/content/structured/components/section-container/code.mdx index 6efc6c4d2..a163c9218 100644 --- a/src/content/structured/components/section-container/code.mdx +++ b/src/content/structured/components/section-container/code.mdx @@ -28,24 +28,39 @@ import { IcChip, IcSectionContainer } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: `
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -76,8 +91,9 @@ export const snippetsDefault = [ export const snippetsCenter = [ { - language: "Web component", - snippet: ` @@ -87,10 +103,13 @@ export const snippetsCenter = [
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -100,6 +119,17 @@ export const snippetsCenter = [
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -124,8 +154,9 @@ export const snippetsCenter = [ export const snippetsFullWidth = [ { - language: "Web component", - snippet: ` @@ -135,10 +166,13 @@ export const snippetsFullWidth = [
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` @@ -148,6 +182,17 @@ export const snippetsFullWidth = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -175,8 +220,9 @@ export const snippetsFullWidth = [ export const snippetsFullHeight = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/select/code.mdx b/src/content/structured/components/select/code.mdx index 041b8c8f7..f1c5fa429 100644 --- a/src/content/structured/components/select/code.mdx +++ b/src/content/structured/components/select/code.mdx @@ -25,8 +25,9 @@ import { IcSelect } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -89,8 +104,9 @@ export const SelectExample = () => ( export const snippetsWithExtras = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -157,8 +187,9 @@ export const SelectExampleWithExtras = () => ( export const snippetsDisabled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -208,8 +253,9 @@ export const SelectExampleDisabled = () => ( export const snippetsOptionDisabled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -257,8 +317,9 @@ export const SelectExampleOptionsDisabled = () => ( export const snippetsSmall = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} size="small" />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -316,8 +391,9 @@ export const SelectExampleSmall = () => ( export const snippetsHideLabel = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -367,8 +457,9 @@ export const SelectExampleHideLabel = () => ( export const snippetsGroups = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -449,8 +554,9 @@ export const SelectExampleGroups = () => ( export const snippetsRecommended = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -511,8 +631,9 @@ export const SelectExampleRecommended = () => ( export const snippetsValidation = [ { - language: "Web component", - snippet: ` @@ -569,10 +690,13 @@ export const snippetsValidation = [ console.log(event.detail.value); }); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -678,8 +813,9 @@ export const SelectExampleValidation = () => ( export const snippetsSearchable = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -751,8 +901,9 @@ export const SearchableSelectExample = () => ( export const snippetsSearchableWithDescriptions = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -862,8 +1027,9 @@ export const SearchableSelectWithDescriptionsExample = () => ( export const snippetsSearchableWithGroups = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -973,8 +1153,9 @@ This example shows how to filter data asynchronously when the value in the selec export const customFiltering = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const mockData = [ + technology: "React", + snippets: { + short: `const mockData = [ { label: "Espresso", value: "Esp" }, { label: "Double Espresso", value: "Dou" }, { label: "Cappuccino", value: "Cap" }, @@ -1072,6 +1256,17 @@ return( /> );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/side-nav/code.mdx b/src/content/structured/components/side-nav/code.mdx index 296edc33d..175e15ff9 100644 --- a/src/content/structured/components/side-nav/code.mdx +++ b/src/content/structured/components/side-nav/code.mdx @@ -47,8 +47,9 @@ import { MemoryRouter, NavLink } from "react-router-dom"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` coffee-outline @@ -85,10 +86,13 @@ export const snippetsDefault = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` coffee-outline @@ -125,6 +129,17 @@ export const snippetsDefault = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -202,8 +217,9 @@ export const snippetsDefault = [ export const snippetsStatic = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` coffee-outline @@ -240,10 +256,13 @@ export const snippetsStatic = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` coffee-outline @@ -280,6 +299,17 @@ export const snippetsStatic = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -344,8 +374,9 @@ export const snippetsStatic = [ export const snippetsExpanded = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -492,8 +537,9 @@ export const snippetsExpanded = [ export const snippetsCollapsed = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` coffee-outline @@ -529,10 +575,13 @@ export const snippetsCollapsed = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` coffee-outline @@ -568,6 +617,17 @@ export const snippetsCollapsed = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -630,8 +690,9 @@ export const snippetsCollapsed = [ export const snippetsBadge = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` coffee-outline @@ -670,10 +731,13 @@ export const snippetsBadge = [ `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` coffee-outline @@ -712,6 +776,17 @@ export const snippetsBadge = [ `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -796,8 +871,9 @@ npm i @mdi/js export const withMDIicons = [ { - language: "React", - snippet: `// importing Material Design icons + technology: "React", + snippets: { + short: `// importing Material Design icons import { mdiCoffeeOutline, mdiHome, @@ -843,6 +919,17 @@ import { `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -905,8 +992,9 @@ The following example also demonstrates using a slotted app title link. export const withReactRouter = [ { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -1066,8 +1165,9 @@ Fixed side navigation places the side navigation to the viewport. export const basicLayoutFixedViewport = [ { - language: "Web component", - snippet: `// Inline styling added for verboseness + technology: "Web component", + snippets: { + short: `// Inline styling added for verboseness
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `// Inline styling added for verboseness + technology: "React", + snippets: { + short: `// Inline styling added for verboseness
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/skeleton/code.mdx b/src/content/structured/components/skeleton/code.mdx index 25046981f..89f500fd4 100644 --- a/src/content/structured/components/skeleton/code.mdx +++ b/src/content/structured/components/skeleton/code.mdx @@ -31,20 +31,35 @@ import { export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -68,17 +83,32 @@ export const snippets = [ export const snippetsInherited = [ { - language: "Web component", - snippet: `
Test text
`, + technology: "Web component", + snippets: { + short: `
Test text
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
Test text
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -99,17 +129,21 @@ export const snippetsInherited = [ export const snippetsSetWidthAndHeight = [ { - language: "Web component", - snippet: `Height and width set with styles + technology: "Web component", + snippets: { + short: `Height and width set with styles Height set with styles Width set with styles `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `Height and width set with styles + technology: "React", + snippets: { + short: `Height and width set with styles `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -153,20 +198,35 @@ width: "200px" export const snippetsLight = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -184,8 +244,9 @@ export const snippetsLight = [ export const snippetsInCard = [ { - language: "Web component", - snippet: `
+ technology: "Web component", + snippets: { + short: `

@@ -281,10 +342,13 @@ const loaded = () => { }, 3000); }); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const loading = () => { + technology: "React", + snippets: { + short: `const loading = () => { return ( {
); };`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/status-tags/code.mdx b/src/content/structured/components/status-tags/code.mdx index 9a6215a5c..18092a9c9 100644 --- a/src/content/structured/components/status-tags/code.mdx +++ b/src/content/structured/components/status-tags/code.mdx @@ -21,22 +21,35 @@ tabs: import { IcStatusTag } from "@ukic/react"; -## Component demo - export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -57,18 +70,33 @@ export const snippetsDefault = [ export const snippetsEmphasis = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -83,18 +111,33 @@ export const snippetsEmphasis = [ export const snippetsSmall = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/stepper/code.mdx b/src/content/structured/components/stepper/code.mdx index bb1a53ce4..4fdf321fe 100644 --- a/src/content/structured/components/stepper/code.mdx +++ b/src/content/structured/components/stepper/code.mdx @@ -25,20 +25,35 @@ import { IcStepper, IcStep } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -64,20 +79,35 @@ export const snippets = [ export const compactStepper = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -93,20 +123,35 @@ export const compactStepper = [ export const leftAligned = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -122,20 +167,35 @@ export const leftAligned = [ export const hiddenStepInfo = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -151,8 +211,9 @@ export const hiddenStepInfo = [ export const withSubtitles = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -209,20 +284,35 @@ export const withSubtitles = [ export const customConnectorWidth = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/switch/code.mdx b/src/content/structured/components/switch/code.mdx index 22e75fe30..e5a3438af 100644 --- a/src/content/structured/components/switch/code.mdx +++ b/src/content/structured/components/switch/code.mdx @@ -25,8 +25,9 @@ import { IcSwitch } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log({ checked: ev.detail.checked, value: ev.detail.value })} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -71,12 +86,27 @@ export const snippetsDefault = [ export const snippetsState = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -88,12 +118,27 @@ export const snippetsState = [ export const snippetsSmall = [ { - language: "Web component", - snippet: ``, + technology: "Web component", + snippets: { + short: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + technology: "React", + snippets: { + short: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -105,14 +150,29 @@ export const snippetsSmall = [ export const snippetsDisabled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -127,8 +187,9 @@ export const snippetsDisabled = [ export const snippetsHelperAndAdornment = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/tabs/code.mdx b/src/content/structured/components/tabs/code.mdx index 113d0b8aa..633b0418f 100644 --- a/src/content/structured/components/tabs/code.mdx +++ b/src/content/structured/components/tabs/code.mdx @@ -25,8 +25,9 @@ import { IcTab, IcTabContext, IcTabGroup, IcTabPanel } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients Method @@ -40,10 +41,13 @@ export const snippets = [ const tabContext = document.querySelector('ic-tab-context'); tabContext.addEventListener('icTabSelect', (ev) => console.log(ev.detail.tabIndex)) `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev.detail.tabIndex)}> + technology: "React", + snippets: { + short: ` console.log(ev.detail.tabIndex)}> Ingredients Method @@ -53,6 +57,17 @@ export const snippets = [ Tab Two - Method Tab Three - History `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -91,8 +106,9 @@ export const snippets = [ export const withIcons = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients @@ -138,10 +154,13 @@ export const withIcons = [ Tab Two - Method Tab Three - History `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Ingredients @@ -187,6 +206,17 @@ export const withIcons = [ Tab Two - Method Tab Three - History `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -243,8 +273,9 @@ export const withIcons = [ export const disabled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients Method @@ -254,10 +285,13 @@ export const disabled = [ Tab Two - Method Tab Three - History `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Ingredients Method @@ -267,6 +301,17 @@ export const disabled = [ Tab Two - Method Tab Three - History `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -287,8 +332,9 @@ export const disabled = [ export const light = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients Method @@ -298,10 +344,13 @@ export const light = [ Tab Two - Method Tab Three - History `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Ingredients Method @@ -311,6 +360,17 @@ export const light = [ Tab Two - Method Tab Three - History `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -331,8 +391,9 @@ export const light = [ export const compact = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients Method @@ -354,10 +415,13 @@ export const compact = [ } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const compactStyle = { + technology: "React", + snippets: { + short: `const compactStyle = { width: "60%", marginLeft: "auto", marginRight: "auto", @@ -380,6 +444,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -404,8 +479,9 @@ return ( export const nested = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Ingredients Method @@ -426,10 +502,13 @@ export const nested = [ Outer Tab Panel Two - Method Outer Tab Panel Three - History `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Ingredients Method @@ -450,6 +529,17 @@ export const nested = [ Outer Tab Panel Two - Method Outer Tab Panel Three - History `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/text-field/code.mdx b/src/content/structured/components/text-field/code.mdx index 72780e2b5..ebe25d97c 100644 --- a/src/content/structured/components/text-field/code.mdx +++ b/src/content/structured/components/text-field/code.mdx @@ -25,8 +25,9 @@ import { IcTextField } from "@ukic/react"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` @@ -35,15 +36,29 @@ export const snippetsDefault = [ const textField = document.querySelector('ic-text-field'); textfield.addEventListenter('icChange', (ev) => console.log(ev.detail.value)); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -66,8 +81,9 @@ export const snippetsDefault = [ export const snippetsIconValueMaxLength = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -137,8 +167,9 @@ export const snippetsIconValueMaxLength = [ export const snippetsDisabled = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -203,8 +248,9 @@ export const snippetsDisabled = [ export const snippetsSmall = [ { - language: "Web component", - snippet: ` @@ -213,15 +259,29 @@ export const snippetsSmall = [ const textField = document.querySelector('ic-text-field'); textfield.addEventListenter('icChange', (ev) => console.log(ev.detail.value)); `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(ev.detail.value)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -238,8 +298,9 @@ export const snippetsSmall = [ export const snippetsValidation = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -372,8 +447,9 @@ In this example, an error message will display when the input is either below th export const snippetsMinMax = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -417,23 +507,38 @@ export const snippetsMinMax = [ export const snippetsTextArea = [ { - language: "Web component", - snippet: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ``, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/toasts/code.mdx b/src/content/structured/components/toasts/code.mdx index 11cc9d57d..3f47eec27 100644 --- a/src/content/structured/components/toasts/code.mdx +++ b/src/content/structured/components/toasts/code.mdx @@ -30,8 +30,9 @@ import { useRef } from "react"; export const defaultSnippet = [ { - language: "Web component", - snippet: `Display toast + technology: "Web component", + snippets: { + short: `Display toast @@ -42,10 +43,13 @@ export const defaultSnippet = [ toastRegion.openToast = toast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const handleClick = () => { toastRegionEl.current.openToast = toastEl.current; @@ -58,6 +62,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -103,8 +118,9 @@ To view the toasts queuing in the following example, click each button to open a export const queuingSnippet = [ { - language: "Web component", - snippet: `Display default toast + technology: "Web component", + snippets: { + short: `Display default toast Display error toast Display auto dismiss toast @@ -127,10 +143,13 @@ export const queuingSnippet = [ toastRegion.openToast = toast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const errorToastEl = useRef(null); const autoDismissToastEl = useRef(null); @@ -157,6 +176,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -209,8 +239,9 @@ export const QueuingToast = () => { export const withVariantSnippet = [ { - language: "Web component", - snippet: `Display success toast + technology: "Web component", + snippets: { + short: `Display success toast @@ -221,10 +252,13 @@ export const withVariantSnippet = [ toastRegion.openToast = successToast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const handleClick = () => { toastRegionEl.current.openToast = toastEl.current; @@ -242,6 +276,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -274,8 +319,9 @@ export const WithVariantToast = () => { export const withMultilineSnippet = [ { - language: "Web component", - snippet: `Display multi-line toast + technology: "Web component", + snippets: { + short: `Display multi-line toast @@ -286,10 +332,13 @@ export const withMultilineSnippet = [ toastRegion.openToast = multilineToast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const handleClick = () => { toastRegionEl.current.openToast = toastEl.current; @@ -306,6 +355,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -337,8 +397,9 @@ export const MultilineToast = () => { export const slottedActionsSnippet = [ { - language: "Web component", - snippet: `Display slotted buttons toast + technology: "Web component", + snippets: { + short: `Display slotted buttons toast Display slotted buttons toast @@ -359,10 +420,13 @@ export const slottedActionsSnippet = [ toastRegion.openToast = slottedLinkToast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const buttonToastEl = useRef(null); const linkToastEl = useRef(null); const handleButtonToastClick = () => { @@ -397,6 +461,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -454,8 +529,9 @@ export const SlottedActionsToast = () => { export const autoDismissSnippet = [ { - language: "Web component", - snippet: `Display auto-dismiss toast + technology: "Web component", + snippets: { + short: `Display auto-dismiss toast @@ -466,10 +542,13 @@ export const autoDismissSnippet = [ toastRegion.openToast = toast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const handleClick = () => { toastRegionEl.current.openToast = toastEl.current; @@ -482,6 +561,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -515,8 +605,9 @@ export const AutoDismissToast = () => { export const customIconAriaLabelsSnippet = [ { - language: "Web component", - snippet: `Display auto-dismiss toast + technology: "Web component", + snippets: { + short: `Display auto-dismiss toast @@ -532,10 +623,13 @@ export const customIconAriaLabelsSnippet = [ toastRegion.openToast = toast; } `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `const toastRegionEl = useRef(null); + technology: "React", + snippets: { + short: `const toastRegionEl = useRef(null); const toastEl = useRef(null); const handleClick = () => { toastRegionEl.current.openToast = toastEl.current; @@ -559,6 +653,17 @@ return ( )`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/toggle-buttons/code.mdx b/src/content/structured/components/toggle-buttons/code.mdx index 9fea328d0..756f8242a 100644 --- a/src/content/structured/components/toggle-buttons/code.mdx +++ b/src/content/structured/components/toggle-buttons/code.mdx @@ -30,21 +30,36 @@ import { export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` console.log(event.detail.checked)} />`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -69,18 +84,33 @@ export const snippetsDefault = [ export const snippetsOtherStates = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -95,14 +125,18 @@ export const snippetsOtherStates = [ export const snippetsWithIcon = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -136,16 +181,31 @@ export const snippetsWithIcon = [ export const snippetsSizing = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -159,16 +219,31 @@ export const snippetsSizing = [ export const snippetsWithBadge = [ { - language: "Web component", - snippet: ` - + technology: "Web component", + snippets: { + short: ` + `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -182,16 +257,31 @@ export const snippetsWithBadge = [ export const snippetsDark = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -210,16 +300,31 @@ export const snippetsDark = [ export const snippetsLight = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -241,22 +346,37 @@ export const snippetsLight = [ export const snippetsFullWidth = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -273,8 +393,9 @@ export const snippetsFullWidth = [ export const snippetsIconOnly = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -392,8 +527,9 @@ export const snippetsIconOnly = [ export const snippetsIconRight = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -485,8 +635,9 @@ export const snippetsIconRight = [ export const snippetsIconTopGroup = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/tooltips/code.mdx b/src/content/structured/components/tooltips/code.mdx index 47f4c5b79..186c401dd 100644 --- a/src/content/structured/components/tooltips/code.mdx +++ b/src/content/structured/components/tooltips/code.mdx @@ -26,22 +26,37 @@ import { useRef } from "react"; export const snippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Add Remove `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Add Remove `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -78,16 +93,31 @@ export const snippets = [ export const snippetsLeft = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Add `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Add `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -113,16 +143,31 @@ export const snippetsLeft = [ export const snippetsRight = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Add `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Add `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -148,24 +193,39 @@ export const snippetsRight = [ export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -198,8 +258,9 @@ export const snippetsDefault = [ export const snippetsProgrammatic = [ { - language: "Web component", - snippet: ``, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `let display = true; + technology: "React", + snippets: { + short: `let display = true; const tooltipEl = useRef(null); const handleDisplay = () => { tooltipEl.current.displayTooltip(display, display); @@ -235,6 +299,17 @@ return ( );`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/top-nav/code.mdx b/src/content/structured/components/top-nav/code.mdx index 4823a76b7..2cdcedb57 100644 --- a/src/content/structured/components/top-nav/code.mdx +++ b/src/content/structured/components/top-nav/code.mdx @@ -38,8 +38,9 @@ import { MemoryRouter, NavLink } from "react-router-dom"; export const snippetsDefault = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Javascript", + snippet: `js import { IcTopNavigation, IcSearchBar, IcNavigationButton, IcNavigationItem, SlottedSVG } from "@ukic/react";`, + }, + { + language: "Typescript", + snippet: `ts import { IcTopNavigation, IcSearchBar, IcNavigationButton, IcNavigationItem, SlottedSVG } from "@ukic/react";`, + }, + ], + }, }, ]; @@ -189,8 +204,9 @@ export const snippetsDefault = [ export const snippetsGroupedLinks = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -292,8 +322,9 @@ export const snippetsGroupedLinks = [ export const snippetsCentreAligned = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -430,8 +475,9 @@ export const snippetsCentreAligned = [ export const snippetsLeftAligned = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -571,8 +631,9 @@ export const snippetsLeftAligned = [ export const snippetsBadge = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -709,8 +784,9 @@ View on a small screen size to display the short title in place of the app title export const snippetsShortTitle = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -812,8 +902,9 @@ To guarantee the correct styling for non-svg content slotted into app-icon, set export const withReactRouter = [ { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` ICDS Title ICDS @@ -858,8 +949,18 @@ export const withReactRouter = [ - - `, +`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; diff --git a/src/content/structured/components/typography/code.mdx b/src/content/structured/components/typography/code.mdx index 1de1a1e01..f97f33a07 100644 --- a/src/content/structured/components/typography/code.mdx +++ b/src/content/structured/components/typography/code.mdx @@ -27,8 +27,9 @@ import { IcTypography } from "@ukic/react"; export const snippets = [ { - language: "Web component", - snippet: `H1 + technology: "Web component", + snippets: { + short: `H1 H2 H3 H4 @@ -42,10 +43,13 @@ export const snippets = [ Code large Code small Code extra small`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `H1 + technology: "React", + snippets: { + short: `H1 H2 H3 H4 @@ -59,6 +63,17 @@ export const snippets = [ Code large Code small Code extra small`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -93,16 +108,31 @@ Add a variant to the typography element to change its style. This does not chang export const snippetsRestyled = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: `
H5 with H2 styling
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
H5 with H2 styling
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -116,16 +146,31 @@ export const snippetsRestyled = [ export const spacingSnippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: `
H5 with margins applied
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
H5 with margins applied
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -139,16 +184,31 @@ export const spacingSnippets = [ export const spacingRestyledSnippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: `
H5 with H2 styling and margins applied
`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: `
H5 with H2 styling and margins applied
`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -164,8 +224,9 @@ Text can be truncated to a maximum number of lines when using `variant="body"`. export const truncationSnippets = [ { - language: "Web component", - snippet: ` + technology: "Web component", + snippets: { + short: ` Body of text that is truncated to three lines. Click the 'See more' link to expand the text, then click 'See less' to truncate the text once more! @@ -178,10 +239,13 @@ export const truncationSnippets = [ dripper organic and foam id saucer, crema, black rich dark, grounds breve coffee steamed caramelization percolator. `, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: ` + technology: "React", + snippets: { + short: ` Body of text that is truncated to three lines. Click the 'See more' link to expand the text, then click 'See less' to truncate the text once more! @@ -194,6 +258,17 @@ export const truncationSnippets = [ dripper organic and foam id saucer, crema, black rich dark, grounds breve coffee steamed caramelization percolator. `, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -216,18 +291,33 @@ export const truncationSnippets = [ export const additionalStylingSnippets = [ { - language: "Web component", - snippet: `Bold + technology: "Web component", + snippets: { + short: `Bold Italic Underline Strikethrough`, + long: `{shortCode}`, + }, }, { - language: "React", - snippet: `Bold + technology: "React", + snippets: { + short: `Bold Italic Underline Strikethrough`, + long: [ + { + language: "Typescript", + snippet: `{shortCode}`, + }, + { + language: "Javascript", + snippet: `{shortCode}`, + }, + ], + }, }, ]; @@ -247,3 +337,4 @@ export const additionalStylingSnippets = [
+import {createWebComponentsIndexHTML} from "../../patterns/components/StackblitzButton/stackblitz-helpers" diff --git a/src/content/structured/patterns/components/StackblitzButton/index.tsx b/src/content/structured/patterns/components/StackblitzButton/index.tsx index 1b4d99338..f0b298baf 100644 --- a/src/content/structured/patterns/components/StackblitzButton/index.tsx +++ b/src/content/structured/patterns/components/StackblitzButton/index.tsx @@ -16,6 +16,7 @@ export type StackblitzProps = { isWebComponents?: boolean; projectTitle: string; projectDescription?: string; + isJSX?: boolean; }; const StackblitzButton: React.FC = ({ @@ -23,6 +24,7 @@ const StackblitzButton: React.FC = ({ isWebComponents, projectTitle, projectDescription, + isJSX = true, }) => { const viewportWidth = useViewportWidth(); const isLargeViewport: boolean = viewportWidth > 992; @@ -31,7 +33,6 @@ const StackblitzButton: React.FC = ({ const files: { [key: string]: string } = {}; const isWebComponentsInternal: boolean = isWebComponents !== undefined ? isWebComponents : true; - const isJSX: boolean = true; // Add functionality to manage whether Stackblitz project should use TypeScript or JavaScript const ext = isJSX ? "jsx" : "tsx"; diff --git a/src/content/structured/patterns/components/StackblitzButton/stackblitz-helpers.ts b/src/content/structured/patterns/components/StackblitzButton/stackblitz-helpers.ts index e51fcb308..a95d6ddb2 100644 --- a/src/content/structured/patterns/components/StackblitzButton/stackblitz-helpers.ts +++ b/src/content/structured/patterns/components/StackblitzButton/stackblitz-helpers.ts @@ -118,7 +118,9 @@ export default defineConfig({ `; export const createWebComponentsIndexHTML = (codeSnippet: string) => { - // write a function that checks the code snippet for instances of class="..." and add the relevant styling to the style tag + if (codeSnippet.includes('')) { + return codeSnippet; + } const addStyling = (snippet: string) => { const styling: string[] = []; @@ -178,11 +180,11 @@ export const createWebComponentsIndexHTML = (codeSnippet: string) => { "}" ); } - - styling[0] = `\t${styling[0]}`; + if (styling.length > 1) styling[0] = `\t${styling[0]}`; if (styling.length === 0) return ""; return `\n${styling.join("\n\t")}`; }; + return ` Home @@ -201,13 +203,12 @@ export const createWebComponentsIndexHTML = (codeSnippet: string) => { import('https://unpkg.com/@ukic/web-components/loader').then((module) => { module.defineCustomElements(); }); - // The ICDS has types available if your JavaScript framework allows for use with Typescript + // The ICDS has types available if your JavaScript framework allows for use with TypeScript // Below is an example of how to import an ICDS type // import type { IcAlignment } from 'https://unpkg.com/@ukic/web-components/'; - - `; +`; }; export const createReactAppTsx = ( @@ -314,27 +315,27 @@ ${ fileExtension === "tsx" && isPattern && getIcTypes.length > 0 ? `import type { ${getIcTypes.join(", ")} } from '@ukic/web-components';` : "" -} -${ - sortedMDIcons.length > 0 - ? `import { ${ - sortedMDIcons.length > 3 - ? `\n${sortedMDIcons.join(",\n ")}\n` - : `${sortedMDIcons.join(", ")} ` - }} from '@mdi/js';` - : "" -} -${ - containsCreateUseStyles - ? `import { createUseStyles } from 'react-jss'; +} ${ + sortedMDIcons.length > 0 + ? `\nimport { ${ + sortedMDIcons.length > 3 + ? `\n${sortedMDIcons.join(",\n ")}\n` + : `${sortedMDIcons.join(", ")} ` + }} from '@mdi/js';` + : "" + }${ + containsCreateUseStyles + ? `\nimport { createUseStyles } from 'react-jss'; ` - : "" -} + : "" + } import "@ukic/fonts/dist/fonts.css"; import "@ukic/react/dist/core/core.css"; import "@ukic/react/dist/core/normalize.css"; const ${component}${fileExtension === "tsx" ? `: FC` : ""} = () => { - ${returnStatement}${codeSnippet}${containsReturn ? "" : `\n)`}}; + ${returnStatement}${containsReturn ? "" : `\n`}${codeSnippet}${ + containsReturn ? "" : `\n)` + }}; export default ${component};`; }; diff --git a/src/content/structured/patterns/side-navigation-layout.mdx b/src/content/structured/patterns/side-navigation-layout.mdx index 94818e43a..a27d8c45c 100644 --- a/src/content/structured/patterns/side-navigation-layout.mdx +++ b/src/content/structured/patterns/side-navigation-layout.mdx @@ -23,8 +23,8 @@ import sideNavigationPatternFig1 from "./images/fig-1-example-of-theming-applied export const snippetsSideNav = [ { - language: "Web component", - snippet: createWebComponentsIndexHTML(`
+ technology: "Web component", + snippets: createWebComponentsIndexHTML(`
`), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const useStyles = createUseStyles({ contentDivContainer: { display: "flex", @@ -583,8 +583,8 @@ For more information, see the [page header component](/components/page-header). export const snippetsSideNavWithPageHeader = [ { - language: "Web component", - snippet: createWebComponentsIndexHTML(`
+ technology: "Web component", + snippets: createWebComponentsIndexHTML(`
`), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const useStyles = createUseStyles({ contentDivContainer: { display: "flex", @@ -1209,8 +1209,8 @@ For more information, see the [back to top component](/components/back-to-top). export const snippetsSideNavBackToTop = [ { - language: "Web component", - snippet: createWebComponentsIndexHTML(`
+ technology: "Web component", + snippets: createWebComponentsIndexHTML(`
`), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const useStyles = createUseStyles({ contentDivContainer: { display: "flex", diff --git a/src/content/structured/patterns/top-navigation-layout.mdx b/src/content/structured/patterns/top-navigation-layout.mdx index 5f36ad8d7..ae2e9138c 100644 --- a/src/content/structured/patterns/top-navigation-layout.mdx +++ b/src/content/structured/patterns/top-navigation-layout.mdx @@ -25,9 +25,9 @@ import topNavigationPatternFig1 from "./images/fig-1-example-of-theming-applied- export const snippetsTopNav = [ { - language: "Web component", - snippet: - createWebComponentsIndexHTML(` + technology: "Web component", + snippets: { + long: createWebComponentsIndexHTML(` `), + }, }, { - language: "React", - snippet: createReactAppTsx( - `const alignment = "center"; + technology: "React", + snippets: { + long: [ + { + language: "Typescript", + snippet: createReactAppTsx( + `const alignment = "center"; const useStyles = createUseStyles({ main: { minHeight: "100vh", display: "flex" }, mainContentDiv: { @@ -297,10 +302,149 @@ export const snippetsTopNav = [ )`, - "TopNavigation", - "jsx", - true - ), + "TopNavigation", + "tsx", + true + ), + }, + { + language: "Javascript", + snippet: createReactAppTsx( + `const alignment = "center"; + const useStyles = createUseStyles({ + main: { minHeight: "100vh", display: "flex" }, + mainContentDiv: { + border: "var(--ic-border-width) dashed var(--ic-architectural-400)", + padding: "var(--ic-space-md)", + flex: 1, + }, + mainSectionContainer: { display: "flex", flex: 1 }, + }); + const classes = useStyles(); + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

Example heading

+
+ +

Example sub-heading

+
+ +

+ Remove this div and add your custom content in IcSectionContainer. +

+
+
+
+
+ + + [footerLink] + + + [footerLink] + + + [footerLink] + + + [footerLink] + + + [footerLink] + + + + + + + + + )`, + "TopNavigation", + "jsx", + true + ), + }, + ], + }, }, ]; @@ -369,8 +513,8 @@ For more information, see the [page header component](/components/page-header). export const snippetsTopNavPageHeader = [ { - language: "Web component", - snippet: + technology: "Web component", + snippets: createWebComponentsIndexHTML(` `), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const alignment = "center"; let pageHeaderAlignment; // pageHeaderAlignment = "center"; @@ -770,8 +914,8 @@ For more information, see the [mega-menu component](/components/top-navigation#m export const snippetsTopNavMegaMenu = [ { - language: "Web component", - snippet: + technology: "Web component", + snippets: createWebComponentsIndexHTML(` `), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const alignment = "center"; const useStyles = createUseStyles({ main: { minHeight: "100vh", display: "flex" }, @@ -1107,8 +1251,8 @@ For more information, see the [back to top component](/components/back-to-top). export const snippetsTopNavBackToTop = [ { - language: "Web component", - snippet: + technology: "Web component", + snippets: createWebComponentsIndexHTML(` `), }, { - language: "React", - snippet: createReactAppTsx( + technology: "React", + snippets: createReactAppTsx( `const alignment = "center"; const useStyles = createUseStyles({ main: { minHeight: "100vh", display: "flex" }, diff --git a/src/icds-pages-data.json b/src/icds-pages-data.json index 78c6523b1..57160064e 100644 --- a/src/icds-pages-data.json +++ b/src/icds-pages-data.json @@ -729,7 +729,7 @@ }, { "id": "components__accordion__codex", - "contents": "\nimport {\n IcAccordion,\n IcAccordionGroup,\n IcTypography,\n SlottedSVG,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n A blend of different black teas.\n \n\n\n \n A tea blend that has been flavoured with oil of bergamot.\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n A blend of different black teas.\n \n\n\n \n A tea blend that has been flavoured with oil of bergamot.\n \n\n`,\n },\n];\n\n\n \n A blend of different black teas.\n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n \n\n\n## Accordion details\n\n\n\n## Accordion group details\n\n\n\n## Variants\n\n### With icon\n\nexport const withIcon = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n `,\n },\n];\n\n\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n \n\n\n### With group title and see all / hide all button\n\n\n \n \n \n An espresso-based drink that is traditionally prepared with steamed milk\n foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n\n\nexport const groupTitle = [\n {\n language: \"Web component\",\n snippet: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n`,\n },\n];\n\n### With nested accordions\n\nexport const snippetsNested = [\n {\n language: \"Web component\",\n snippet: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n`,\n },\n];\n\n\n \n \n \n An espresso-based drink that is traditionally prepared with steamed milk\n foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n \n\n", + "contents": "\nimport {\n IcAccordion,\n IcAccordionGroup,\n IcTypography,\n SlottedSVG,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n A blend of different black teas.\n \n\n\n \n A tea blend that has been flavoured with oil of bergamot.\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n A blend of different black teas.\n \n\n\n \n A tea blend that has been flavoured with oil of bergamot.\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `<>\n {shortCode}\n `,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {shortCode}\n `,\n },\n ],\n },\n },\n];\n\n\n \n A blend of different black teas.\n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n \n\n\n## Accordion details\n\n\n\n## Accordion group details\n\n\n\n## Variants\n\n### With icon\n\nexport const withIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n A blend of different black teas.\n \n \n \n \n \n \n A tea blend that has been flavoured with oil of bergamot.\n \n \n\n\n### With group title and see all / hide all button\n\n\n \n \n \n An espresso-based drink that is traditionally prepared with steamed milk\n foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n\n\nexport const groupTitle = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n### With nested accordions\n\nexport const snippetsNested = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n An espresso-based drink that is traditionally prepared with steamed milk foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n An espresso-based drink that is traditionally prepared with steamed milk\n foam.\n \n \n \n \n \n An espresso-based drink that is diluted with hot water.\n \n \n \n \n A milkier coffee than a cappuccino.\n \n \n \n \n\n", "path": "/components/accordion/code", "date": "2023-10-11", "title": "Accordion", @@ -752,10 +752,10 @@ ], "meta": { "relativePath": "components/accordion/code.mdx", - "createdAt": "2024-04-08T22:24:28.492Z", - "lastModified": "2024-04-08T22:24:28.492Z", - "size": 9273, - "formattedSize": "9.1 KB" + "createdAt": "2024-04-08T22:26:50.748Z", + "lastModified": "2024-04-08T22:26:50.748Z", + "size": 10445, + "formattedSize": "10.2 KB" } }, { @@ -823,7 +823,7 @@ }, { "id": "components__alerts__codex", - "contents": "\n## Component demo\n\nimport { IcAlert, IcButton, IcLink } from \"@ukic/react\";\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n\n`,\n },\n];\n\n\n \n \n \n \n \n\n\n## Alert details\n\n\n\n## Variants\n\n### Dismissible\n\nexport const snippetsDismissible = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### With action\n\nexport const snippetsWithAction = [\n {\n language: \"Web component\",\n snippet: `\n View Drinks\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n console.log(ev)}>View Drinks\n`,\n },\n];\n\n\n \n console.log(ev)}\n >\n View Drinks\n \n \n\n\n### Title above\n\nexport const snippetsTitleAbove = [\n {\n language: \"Web component\",\n snippet: `\n `,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Responsive title\n\nexport const snippetsResponsiveTitle = [\n {\n language: \"Web component\",\n snippet: `\n `,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Custom message\n\nexport const snippetsCustomMessage = [\n {\n language: \"Web component\",\n snippet: `\n Go to our coffee page to learn more.\n`,\n },\n {\n language: \"React\",\n snippet: `\n Go to our coffee page to learn more.\n`,\n },\n];\n\n\n \n \n Got to our{\" \"}\n e.preventDefault()}>\n coffee page\n {\" \"}\n to learn more.\n \n \n\n", + "contents": "\n## Component demo\n\nimport { IcAlert, IcButton, IcLink } from \"@ukic/react\";\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n## Alert details\n\n\n\n## Variants\n\n### Dismissible\n\nexport const snippetsDismissible = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With action\n\nexport const snippetsWithAction = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n View Drinks\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n console.log(ev)}>View Drinks\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n console.log(ev)}\n >\n View Drinks\n \n \n\n\n### Title above\n\nexport const snippetsTitleAbove = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Responsive title\n\nexport const snippetsResponsiveTitle = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Custom message\n\nexport const snippetsCustomMessage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Go to our coffee page to learn more.\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Go to our coffee page to learn more.\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Got to our{\" \"}\n e.preventDefault()}>\n coffee page\n {\" \"}\n to learn more.\n \n \n\n", "path": "/components/alert/code", "date": "2024-02-02", "title": "Alert", @@ -846,10 +846,10 @@ ], "meta": { "relativePath": "components/alerts/code.mdx", - "createdAt": "2024-04-08T22:24:28.492Z", - "lastModified": "2024-04-08T22:24:28.492Z", - "size": 7969, - "formattedSize": "7.8 KB" + "createdAt": "2024-04-08T22:26:50.756Z", + "lastModified": "2024-04-08T22:26:50.756Z", + "size": 9637, + "formattedSize": "9.4 KB" } }, { @@ -917,7 +917,7 @@ }, { "id": "components__back-to-top__codex", - "contents": "\nimport { IcButton } from \"@ukic/react\";\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n## Component demo\n\n\n {\n window.scrollTo(0, document.body.scrollHeight);\n }}\n >\n Show Back to top\n \n\n\n## Back to top details\n\n\n", + "contents": "\nimport { IcButton } from \"@ukic/react\";\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n## Component demo\n\n\n {\n window.scrollTo(0, document.body.scrollHeight);\n }}\n >\n Show Back to top\n \n\n\n## Back to top details\n\n\n", "path": "/components/back-to-top/code", "date": "2023-02-03", "title": "Back to top", @@ -940,10 +940,10 @@ ], "meta": { "relativePath": "components/back-to-top/code.mdx", - "createdAt": "2024-04-08T22:24:28.492Z", - "lastModified": "2024-04-08T22:24:28.492Z", - "size": 1070, - "formattedSize": "1.0 KB" + "createdAt": "2024-04-08T22:26:50.756Z", + "lastModified": "2024-04-08T22:26:50.756Z", + "size": 1348, + "formattedSize": "1.3 KB" } }, { @@ -1011,7 +1011,7 @@ }, { "id": "components__badge__codex", - "contents": "\nimport {\n IcButton,\n IcBadge,\n SlottedSVG,\n IcChip,\n IcTab,\n IcTabPanel,\n IcTabContext,\n IcTabGroup,\n} from \"@ukic/react\";\nimport { useState } from \"react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n \n \n Coffee orders\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Coffee orders\n`,\n },\n];\n\n\n \n \n Coffee orders\n \n\n\n## Badge details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n language: \"Web component\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n },\n];\n\n\n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n\n\n### Status\n\nexport const snippetsStatus = [\n {\n language: \"Web component\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n },\n];\n\n\n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n\n\n### Types\n\nexport const snippetsInformation = [\n {\n language: \"Web component\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n\n \n \n \n \n \n Coffee orders\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n \n \n \n \n \n Coffee orders\n`,\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n \n \n Coffee orders\n \n
\n
\n \n \n \n \n \n \n \n Coffee orders\n \n
\n
\n\n### Max number\n\nexport const snippetsMaxNumber = [\n {\n language: \"Web component\",\n snippet: `
\n \n \n \n Coffee orders\n \n
`,\n },\n {\n language: \"React\",\n snippet: `
\n \n \n Coffee orders\n \n
`,\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n\n### Positioning\n\nexport const snippetsNear = [\n {\n language: \"Web component\",\n snippet: `
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n },\n {\n language: \"React\",\n snippet: `
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n },\n];\n\n\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n\n### Position inline\n\nexport const snippetsInline = [\n {\n language: \"Web component\",\n snippet: `\n \n About\n \n \n Ingredients\n \n \n Orders\n \n \n \n \n About page\n Ingredients page\n Orders page\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n About\n \n \n Ingredients\n \n \n Orders\n \n \n \n About page\n Ingredients page\n Orders page\n`,\n },\n];\n\n\n \n \n About\n Ingredients\n \n Orders\n \n \n \n About page\n Ingredients page\n Orders page\n \n\n\n### Hide and show badge\n\nClick the button to hide and show the badge.\n\nexport const snippetsHideBadge = [\n {\n language: \"Web component\",\n snippet: `\n
\n \n \n Coffee orders\n \n
`,\n },\n {\n language: \"React\",\n snippet: `export const ToggleBadge = () => {\n const [showBadge, setShowBadge] = useState(false);\n const handleShowHideBadge = () => {\n setShowBadge(!showBadge);\n };\n return (\n
\n \n \n Coffee orders\n \n
\n );\n};`,\n },\n];\n\nexport const ToggleBadge = () => {\n const [showBadge, setShowBadge] = useState(false);\n const handleShowHideBadge = () => {\n setShowBadge(!showBadge);\n };\n return (\n
\n \n \n Coffee orders\n \n
\n );\n};\n\n\n \n\n\n### Accessible label\n\nexport const snippetsAccessibleLabel = [\n {\n language: \"Web component\",\n snippet: `
\n \n \n \n Coffee orders\n \n
`,\n },\n {\n language: \"React\",\n snippet: `
\n \n \n Coffee orders\n \n
`,\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n", + "contents": "\nimport {\n IcButton,\n IcBadge,\n SlottedSVG,\n IcChip,\n IcTab,\n IcTabPanel,\n IcTabContext,\n IcTabGroup,\n} from \"@ukic/react\";\nimport { useState } from \"react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Coffee orders\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Coffee orders\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Coffee orders\n \n\n\n## Badge details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n\n\n### Status\n\nexport const snippetsStatus = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n Coffee orders\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n \n \n Coffee orders\n \n\n\n### Types\n\nexport const snippetsInformation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n\n \n \n \n \n \n Coffee orders\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Coffee orders\n\n\n \n Coffee orders\n\n\n \n \n \n \n \n \n Coffee orders\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n \n \n Coffee orders\n \n
\n
\n \n \n \n \n \n \n \n Coffee orders\n \n
\n
\n\n### Max number\n\nexport const snippetsMaxNumber = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
\n \n \n \n Coffee orders\n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `
\n \n \n Coffee orders\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n\n### Positioning\n\nexport const snippetsNear = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n\n### Position inline\n\nexport const snippetsInline = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n About\n \n \n Ingredients\n \n \n Orders\n \n \n \n \n About page\n Ingredients page\n Orders page\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n About\n \n \n Ingredients\n \n \n Orders\n \n \n \n About page\n Ingredients page\n Orders page\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n About\n Ingredients\n \n Orders\n \n \n \n About page\n Ingredients page\n Orders page\n \n\n\n### Hide and show badge\n\nClick the button to hide and show the badge.\n\nexport const snippetsHideBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
\n \n \n Coffee orders\n \n
\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `export const ToggleBadge = () => {\n const [showBadge, setShowBadge] = useState(false);\n const handleShowHideBadge = () => {\n setShowBadge(!showBadge);\n };\n return (\n
\n \n \n Coffee orders\n \n
\n );\n};`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const ToggleBadge = () => {\n const [showBadge, setShowBadge] = useState(false);\n const handleShowHideBadge = () => {\n setShowBadge(!showBadge);\n };\n return (\n
\n \n \n Coffee orders\n \n
\n );\n};\n\n\n \n\n\n### Accessible label\n\nexport const snippetsAccessibleLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
\n \n \n \n Coffee orders\n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `
\n \n \n Coffee orders\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n Coffee orders\n \n
\n
\n", "path": "/components/badge/code", "date": "2024-02-02", "title": "Badge", @@ -1034,10 +1034,10 @@ ], "meta": { "relativePath": "components/badge/code.mdx", - "createdAt": "2024-04-08T22:24:28.504Z", - "lastModified": "2024-04-08T22:24:28.504Z", - "size": 17078, - "formattedSize": "16.7 KB" + "createdAt": "2024-04-08T22:29:54.448Z", + "lastModified": "2024-04-08T22:29:54.448Z", + "size": 19566, + "formattedSize": "19.1 KB" } }, { @@ -1105,7 +1105,7 @@ }, { "id": "components__breadcrumbs__codex", - "contents": "\nimport { IcBreadcrumbGroup, IcBreadcrumb, IcLink } from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n## Breadcrumb details\n\n\n\n## Breadcrumb group details\n\n\n\n## Variants\n\n### Back\n\nexport const back = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n### With icons\n\nexport const withIcons = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n e.preventDefault()}>\n \n \n \n \n e.preventDefault()}\n >\n \n \n \n \n e.preventDefault()}\n >\n \n \n \n \n \n\n\n### Collapsed\n\nexport const collapsed = [\n {\n language: \"Web component\",\n snippet: ` \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n \n \n \n Home\n \n \n \n \n Beverages\n \n \n \n \n Coffee\n \n \n \n\n`,\n },\n];\n\n\n \n \n \n \n \n Home\n \n \n \n \n \n \n Beverages\n \n \n \n \n \n \n Coffee\n \n \n \n \n \n\n", + "contents": "\nimport { IcBreadcrumbGroup, IcBreadcrumb, IcLink } from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n## Breadcrumb details\n\n\n\n## Breadcrumb group details\n\n\n\n## Variants\n\n### Back\n\nexport const back = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n### With icons\n\nexport const withIcons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n e.preventDefault()}>\n \n \n \n \n e.preventDefault()}\n >\n \n \n \n \n e.preventDefault()}\n >\n \n \n \n \n \n\n\n### Collapsed\n\nexport const collapsed = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n Home\n \n \n \n \n Beverages\n \n \n \n \n Coffee\n \n \n \n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n Home\n \n \n \n \n \n \n Beverages\n \n \n \n \n \n \n Coffee\n \n \n \n \n \n\n", "path": "/components/breadcrumb/code", "date": "2024-02-02", "title": "Breadcrumb", @@ -1128,10 +1128,10 @@ ], "meta": { "relativePath": "components/breadcrumbs/code.mdx", - "createdAt": "2024-04-08T22:24:28.512Z", - "lastModified": "2024-04-08T22:24:28.512Z", - "size": 10210, - "formattedSize": "10.0 KB" + "createdAt": "2024-04-08T22:26:50.756Z", + "lastModified": "2024-04-08T22:26:50.756Z", + "size": 11548, + "formattedSize": "11.3 KB" } }, { @@ -1199,7 +1199,7 @@ }, { "id": "components__buttons__codex", - "contents": "\nimport { IcButton } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `Add to order\nView coffees\nFind out more\nCancel order\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev)}>Add to order\n View coffees\n Find out more\n Cancel order`,\n },\n];\n\n\n console.log(ev)}>\n Add to order\n \n View coffees\n Find out more\n Cancel order\n\n\n## Button details\n\n\n\n## Variants\n\n### Other states\n\nexport const snippetsOtherStates = [\n {\n language: \"Web component\",\n snippet: `Add to order\nLoading button\nAdd to order`,\n },\n {\n language: \"React\",\n snippet: `Add to order\nLoading button\nAdd to order`,\n },\n];\n\n\n \n Add to order\n \n \n Loading button\n \n \n Add to order\n \n\n\n### With icon\n\nexport const snippetsWithIcon = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n Refresh order status\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n Refresh order status\n`,\n },\n];\n\n\n \n Refresh order status\n \n \n \n \n \n\n\n### Icon Button\n\nexport const snippetsIcon = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Sizing\n\nexport const snippetsSizing = [\n {\n language: \"Web component\",\n snippet: `Add to order\nAdd to order\nAdd to order`,\n },\n {\n language: \"React\",\n snippet: `Add to order\nAdd to order\nAdd to order`,\n },\n];\n\n\n \n Add to order\n \n Add to order\n \n Add to order\n \n\n\n### Colour variants\n\nexport const snippetsColour = [\n {\n language: \"Web component\",\n snippet: `\n Add to order\n \nAdd to order\nAdd to order`,\n },\n {\n language: \"React\",\n snippet: `\n Add to order\n \nAdd to order\nAdd to order`,\n },\n];\n\n\n Add to order\n \n Add to order\n \n \n Add to order\n \n\n\n### File upload\n\nexport const FileUpload = () => {\n function updateFileList(fileArray) {\n const fileList = [];\n Array.from(fileArray).forEach((file) => {\n fileList.push(file.name);\n });\n return fileList.join(\", \");\n }\n return (\n \n document.addEventListener(\"icFileSelection\", (event) =>\n console.log(updateFileList(event.detail))\n )\n }\n >\n Upload File\n \n );\n};\n\nexport const snippetsFileUpload = [\n {\n language: \"Web component\",\n snippet: `\n Upload File\n\n`,\n },\n {\n language: \"React\",\n snippet: `export const FileUpload = () => {\n function updateFileList(fileArray) {\n const fileList = [];\n Array.from(fileArray).forEach((file) => {\n fileList.push(file.name);\n });\n return fileList.join(\", \");\n }\n return (\n \n document.addEventListener(\"icFileSelection\", (event) =>\n console.log(updateFileList(event.detail))\n )\n }\n >\n Upload File\n \n ); \n};`,\n },\n];\n\n\n \n\n", + "contents": "\nimport { IcButton } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Add to order\nView coffees\nFind out more\nCancel order\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev)}>Add to order\n View coffees\n Find out more\n Cancel order`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev)}>\n Add to order\n \n View coffees\n Find out more\n Cancel order\n\n\n## Button details\n\n\n\n## Variants\n\n### Other states\n\nexport const snippetsOtherStates = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Add to order\nLoading button\nAdd to order`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Add to order\nLoading button\nAdd to order`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Add to order\n \n \n Loading button\n \n \n Add to order\n \n\n\n### With icon\n\nexport const snippetsWithIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n Refresh order status\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n Refresh order status\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Refresh order status\n \n \n \n \n \n\n\n### Icon Button\n\nexport const snippetsIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Sizing\n\nexport const snippetsSizing = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Add to order\nAdd to order\nAdd to order`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Add to order\nAdd to order\nAdd to order`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Add to order\n \n Add to order\n \n Add to order\n \n\n\n### Colour variants\n\nexport const snippetsColour = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Add to order\n \nAdd to order\nAdd to order`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Add to order\n \nAdd to order\nAdd to order`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n Add to order\n \n Add to order\n \n \n Add to order\n \n\n\n### File upload\n\nexport const FileUpload = () => {\n function updateFileList(fileArray) {\n const fileList = [];\n Array.from(fileArray).forEach((file) => {\n fileList.push(file.name);\n });\n return fileList.join(\", \");\n }\n return (\n \n document.addEventListener(\"icFileSelection\", (event) =>\n console.log(updateFileList(event.detail))\n )\n }\n >\n Upload File\n \n );\n};\n\nexport const snippetsFileUpload = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Upload File\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `export const FileUpload = () => {\n function updateFileList(fileArray) {\n const fileList = [];\n Array.from(fileArray).forEach((file) => {\n fileList.push(file.name);\n });\n return fileList.join(\", \");\n }\n return (\n \n document.addEventListener(\"icFileSelection\", (event) =>\n console.log(updateFileList(event.detail))\n )\n }\n >\n Upload File\n \n ); \n};`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n", "path": "/components/button/code", "date": "2024-03-13", "title": "Button", @@ -1222,10 +1222,10 @@ ], "meta": { "relativePath": "components/buttons/code.mdx", - "createdAt": "2024-04-08T22:24:28.516Z", - "lastModified": "2024-04-08T22:24:28.516Z", - "size": 9561, - "formattedSize": "9.3 KB" + "createdAt": "2024-04-08T22:26:50.760Z", + "lastModified": "2024-04-08T22:26:50.760Z", + "size": 11507, + "formattedSize": "11.2 KB" } }, { @@ -1293,7 +1293,7 @@ }, { "id": "components__cards__codex", - "contents": "\nimport {\n IcCard,\n IcStatusTag,\n IcButton,\n IcTypography,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nexport const CardIcon = () => (\n \n \n \n \n);\n\nexport const InteractionIcon = () => (\n \n \n \n);\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n
\n\n## Card details\n\n\n\n## Variants\n\n### Heading only\n\nexport const headingOnly = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### With icon\n\nexport const withIcon = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Message\n\nexport const withMessage = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### With subheading\n\nexport const withSubHeading = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Interaction button\n\nexport const interactionButton = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n\n\n### Adornment\n\nexport const adornment = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Top image\n\nexport const topImage = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Middle image\n\nexport const midImage = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Interaction controls\n\nexport const interactionControls = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n
\n Accept\n Cancel\n
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n
\n Accept\n Cancel\n
\n
`,\n },\n];\n\n\n \n \n \n \n
\n Accept\n Cancel\n
\n \n
\n\n### Expandable\n\nexport const expandable = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n },\n];\n\n\n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n
\n\n### Clickable link\n\nexport const clickableLink = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n e.preventDefault()}\n >\n \n \n \n \n\n\n### Clickable button\n\nexport const clickableBtn = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev)}>\n \n \n \n`,\n },\n];\n\n\n console.log(ev)}\n >\n \n \n \n \n\n\n### With badge\n\nexport const withBadge = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n e.preventDefault()}\n >\n \n \n \n \n \n\n\n### Disabled\n\nexport const disabled = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Full width\n\nexport const fullWidth = [\n {\n language: \"Web component\",\n snippet: ` \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Wrapped by link\n\nexport const wrapped = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n`,\n },\n];\n\n\n e.preventDefault()}\n style={{ textDecoration: \"none\", color: \"var(--ic-architechtural-black)\" }}\n aria-label=\"Americano order card\"\n >\n \n \n \n \n \n \n\n", + "contents": "\nimport {\n IcCard,\n IcStatusTag,\n IcButton,\n IcTypography,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nexport const CardIcon = () => (\n \n \n \n \n);\n\nexport const InteractionIcon = () => (\n \n \n \n);\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n
\n\n## Card details\n\n\n\n## Variants\n\n### Heading only\n\nexport const headingOnly = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With icon\n\nexport const withIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Message\n\nexport const withMessage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### With subheading\n\nexport const withSubHeading = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Interaction button\n\nexport const interactionButton = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n\n\n### Adornment\n\nexport const adornment = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Top image\n\nexport const topImage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Middle image\n\nexport const midImage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Interaction controls\n\nexport const interactionControls = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n
\n Accept\n Cancel\n
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n
\n Accept\n Cancel\n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n
\n Accept\n Cancel\n
\n \n
\n\n### Expandable\n\nexport const expandable = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n
\n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n
\n\n### Clickable link\n\nexport const clickableLink = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n e.preventDefault()}\n >\n \n \n \n \n\n\n### Clickable button\n\nexport const clickableBtn = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev)}>\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev)}\n >\n \n \n \n \n\n\n### With badge\n\nexport const withBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n e.preventDefault()}\n >\n \n \n \n \n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Full width\n\nexport const fullWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Wrapped by link\n\nexport const wrapped = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n e.preventDefault()}\n style={{ textDecoration: \"none\", color: \"var(--ic-architechtural-black)\" }}\n aria-label=\"Americano order card\"\n >\n \n \n \n \n \n \n\n", "path": "/components/card/code", "date": "2024-02-02", "title": "Card", @@ -1316,10 +1316,10 @@ ], "meta": { "relativePath": "components/cards/code.mdx", - "createdAt": "2024-04-08T22:24:28.516Z", - "lastModified": "2024-04-08T22:24:28.516Z", - "size": 48132, - "formattedSize": "47.0 KB" + "createdAt": "2024-04-08T22:26:50.760Z", + "lastModified": "2024-04-08T22:26:50.760Z", + "size": 52859, + "formattedSize": "51.6 KB" } }, { @@ -1387,7 +1387,7 @@ }, { "id": "components__checkboxes__codex", - "contents": "\nimport { IcCheckboxGroup, IcCheckbox, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(\"onIcChange\", ev.detail.value)}>\n console.log(\"onIcCheck\", ev)} />\n \n \n`,\n },\n];\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n >\n console.log(\"onIcCheck\", ev)}\n />\n \n \n \n\n\n## Checkbox group details\n\n\n\n## Checkbox details\n\n\n\n## Variants\n\n### Hidden label\n\nexport const snippetsHiddenLabel = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n\n### Helper text\n\nexport const snippetsHelperText = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n language: \"Web component\",\n snippet: `\n \n \n\n\n \n \n\n\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n\n\n \n \n\n\n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Setting each checkbox size\n\nexport const snippetsSettingEachCheckboxSize = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n`,\n },\n];\n\n\n \n \n \n\n\n### Conditional\n\nexport const snippetsConditional = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const snippetsConditionalDynamic = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n\n### Indeterminate\n\nexport const snippetsIndeterminate = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n", + "contents": "\nimport { IcCheckboxGroup, IcCheckbox, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(\"onIcChange\", ev.detail.value)}>\n console.log(\"onIcCheck\", ev)} />\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n >\n console.log(\"onIcCheck\", ev)}\n />\n \n \n \n\n\n## Checkbox group details\n\n\n\n## Checkbox details\n\n\n\n## Variants\n\n### Hidden label\n\nexport const snippetsHiddenLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Helper text\n\nexport const snippetsHelperText = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n\n\n \n \n\n\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n\n\n \n \n\n\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Setting each checkbox size\n\nexport const snippetsSettingEachCheckboxSize = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Conditional\n\nexport const snippetsConditional = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const snippetsConditionalDynamic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Indeterminate\n\nexport const snippetsIndeterminate = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n\n", "path": "/components/checkbox/code", "date": "2024-01-18", "title": "Checkbox", @@ -1410,10 +1410,10 @@ ], "meta": { "relativePath": "components/checkboxes/code.mdx", - "createdAt": "2024-04-08T22:24:28.516Z", - "lastModified": "2024-04-08T22:24:28.516Z", - "size": 15524, - "formattedSize": "15.2 KB" + "createdAt": "2024-04-08T22:26:50.760Z", + "lastModified": "2024-04-08T22:26:50.760Z", + "size": 18026, + "formattedSize": "17.6 KB" } }, { @@ -1481,7 +1481,7 @@ }, { "id": "components__chips__codex", - "contents": "\nimport { IcChip } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev)}>\n \n \n \n\n\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n## Chip details\n\n\n\n## Variants\n\n### Outline\n\nexport const snippetsOutline = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Dismissible\n\nexport const snippetsDismissible = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev)}>\n \n \n \n`,\n },\n];\n\n\n console.log(ev)}>\n \n \n \n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n\n\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n", + "contents": "\nimport { IcChip } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev)}>\n \n \n \n\n\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n## Chip details\n\n\n\n## Variants\n\n### Outline\n\nexport const snippetsOutline = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Dismissible\n\nexport const snippetsDismissible = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev)}>\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev)}>\n \n \n \n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n\n\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n", "path": "/components/chip/code", "date": "2024-02-28", "title": "Chip", @@ -1504,10 +1504,10 @@ ], "meta": { "relativePath": "components/chips/code.mdx", - "createdAt": "2024-04-08T22:24:28.516Z", - "lastModified": "2024-04-08T22:24:28.516Z", - "size": 8993, - "formattedSize": "8.8 KB" + "createdAt": "2024-04-08T22:26:50.764Z", + "lastModified": "2024-04-08T22:26:50.764Z", + "size": 10105, + "formattedSize": "9.9 KB" } }, { @@ -1575,7 +1575,7 @@ }, { "id": "components__classification-banner__codex", - "contents": "\nimport { IcClassificationBanner } from \"@ukic/react\";\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n\n`,\n },\n];\n\n## Component demo\n\n\n \n \n \n \n \n\n\n## Classification banner details\n\n\n\n## Variants\n\nexport const snippetsVariants = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n### Up to, country and additional selectors\n\n\n \n\n", + "contents": "\nimport { IcClassificationBanner } from \"@ukic/react\";\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n## Component demo\n\n\n \n \n \n \n \n\n\n## Classification banner details\n\n\n\n## Variants\n\nexport const snippetsVariants = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n### Up to, country and additional selectors\n\n\n \n\n", "path": "/components/classification-banner/code", "date": "2023-02-03", "title": "Classification banner", @@ -1598,10 +1598,10 @@ ], "meta": { "relativePath": "components/classification-banner/code.mdx", - "createdAt": "2024-04-08T22:24:28.520Z", - "lastModified": "2024-04-08T22:24:28.520Z", - "size": 2608, - "formattedSize": "2.5 KB" + "createdAt": "2024-04-08T22:26:50.764Z", + "lastModified": "2024-04-08T22:26:50.764Z", + "size": 3164, + "formattedSize": "3.1 KB" } }, { @@ -1669,7 +1669,7 @@ }, { "id": "components__data-entity__codex", - "contents": "\nimport {\n IcDataEntity,\n IcDataRow,\n IcLink,\n IcTypography,\n IcTextField,\n IcButton,\n IcStatusTag,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n \n \n `,\n },\n {\n language: \"React\",\n snippet: ` \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n \n \n `,\n },\n];\n\n\n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n VISA ending 5896\n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n \n \n \n \n \n \n\n\n## Data row details\n\n\n\n## Data entity details\n\n\n\n## Variants\n\n### With status tags\n\nexport const withStatusTags = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n `,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n \n
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n \n
\n
`,\n },\n];\n\n\n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n
\n \n
\n\n### Editable example\n\nexport const editableExample = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n Confirm\n\n\n Edit\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.setAttribute('readonly', '');\n })\n }}\n style={{\n marginRight: \"var(--ic-space-md)\",\n marginTop: \"var(--ic-space-lg)\",\n }}\n>\n Confirm\n\n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.removeAttribute('readonly');\n })\n }}\n variant=\"secondary\"\n style={{ marginTop: \"var(--ic-space-lg)\" }}\n>\n Edit\n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.setAttribute(\"readonly\", \"\");\n });\n }}\n style={{\n marginRight: \"var(--ic-space-md)\",\n marginTop: \"var(--ic-space-lg)\",\n }}\n >\n Confirm\n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.removeAttribute(\"readonly\");\n });\n }}\n variant=\"secondary\"\n style={{ marginTop: \"var(--ic-space-lg)\" }}\n >\n Edit\n \n\n", + "contents": "\nimport {\n IcDataEntity,\n IcDataRow,\n IcLink,\n IcTypography,\n IcTextField,\n IcButton,\n IcStatusTag,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n \n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n VISA ending 5896\n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n \n \n \n \n \n \n\n\n## Data row details\n\n\n\n## Data entity details\n\n\n\n## Variants\n\n### With status tags\n\nexport const withStatusTags = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n \n
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n
\n
\n \n
\n\n### Editable example\n\nexport const editableExample = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n Confirm\n\n\n Edit\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.setAttribute('readonly', '');\n })\n }}\n style={{\n marginRight: \"var(--ic-space-md)\",\n marginTop: \"var(--ic-space-lg)\",\n }}\n>\n Confirm\n\n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.removeAttribute('readonly');\n })\n }}\n variant=\"secondary\"\n style={{ marginTop: \"var(--ic-space-lg)\" }}\n>\n Edit\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.setAttribute(\"readonly\", \"\");\n });\n }}\n style={{\n marginRight: \"var(--ic-space-md)\",\n marginTop: \"var(--ic-space-lg)\",\n }}\n >\n Confirm\n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.removeAttribute(\"readonly\");\n });\n }}\n variant=\"secondary\"\n style={{ marginTop: \"var(--ic-space-lg)\" }}\n >\n Edit\n \n\n", "path": "/components/data-entity/code", "date": "2024-02-02", "title": "Data entity", @@ -1692,10 +1692,10 @@ ], "meta": { "relativePath": "components/data-entity/code.mdx", - "createdAt": "2024-04-08T22:24:28.520Z", - "lastModified": "2024-04-08T22:24:28.520Z", - "size": 16312, - "formattedSize": "15.9 KB" + "createdAt": "2024-04-08T22:26:50.764Z", + "lastModified": "2024-04-08T22:26:50.764Z", + "size": 17424, + "formattedSize": "17.0 KB" } }, { @@ -1763,7 +1763,7 @@ }, { "id": "components__dialog__codex", - "contents": "\nimport {\n IcAlert,\n IcDialog,\n IcButton,\n IcCheckboxGroup,\n IcCheckbox,\n IcTypography,\n IcSelect,\n} from \"@ukic/react\";\nimport { useRef, useState } from \"react\";\n\nexport const buttonProps = [\n {\n label: \"Go back\",\n onclick: \"this.cancelDialog()\",\n },\n {\n label: \"Continue\",\n onclick: \"alert('Added to basket'); this.open = false;\",\n },\n];\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n)\n `,\n },\n];\n\nexport const DefaultDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n## Dialog details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n language: \"Web component\",\n snippet: `\nLaunch sizes dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch sizes dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to\n continue?\n \n \n \n);`,\n },\n];\n\nexport const SizesDialogs = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch sizes dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n### With status alerts\n\nexport const snippetsAlert = [\n {\n language: \"Web component\",\n snippet: `\nLaunch status dialog\n\n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenlDialog(false);\nreturn (\n <>\n \n Launch status dialog\n \n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n);`,\n },\n];\n\nexport const AlertDialog = () => {\n const dialogEl = useRef(null);\n const addTitleAboveAttribute = () => {\n dialogEl.current\n .querySelector(\"ic-alert\")\n .setAttribute(\"title-above\", \"true\");\n };\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => {\n addTitleAboveAttribute();\n setOpenDialog(true);\n };\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch dialog\n \n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n### Button variations\n\nexport const snippetsCustomButtons = [\n {\n language: \"Web component\",\n snippet: `\n Launch no button dialog\n Launch single button dialog\n Launch three button dialog\n Launch destructive button dialog\n \n Sorry, you cannot place orders at the moment. Please try again later.\n \n \n \n Your order for an Americano coffee has been placed.\n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n You are about to cancel your order for an Americano. Are you sure you want to continue?\n \n `,\n },\n {\n language: \"React\",\n snippet: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\nconst handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n}\nreturn (\n <>\n
\n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n);`,\n },\n];\n\nexport const CustomButtonsDialog = () => {\n const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\n const [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\n const [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\n const [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] =\n useState(false);\n const handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\n const handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\n const handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\n const handleDestructiveButtonDialogOpen = () =>\n setOpenDestructiveButtonDialog(true);\n const handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n };\n return (\n <>\n
\n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n );\n};\n\n\n \n\n\n### Slotted buttons\n\nexport const snippetsSlottedButtons = [\n {\n language: \"Web component\",\n snippet: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Go back\n \n \n Add to basket\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n}\nreturn (\n <>\n Launch slotted buttons dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n \n \n);`,\n },\n];\n\nexport const SlottedButtonsDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n \n \n );\n};\n\n\n \n\n\n### Interactive content\n\nexport const interactiveContentSnippet = [\n {\n language: \"Web component\",\n snippet: `\nLaunch dialog\n\n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `const [termsAgreed, setTermsAgreed] = useState(false);\nconst [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n}\nconst termsDialogConfirmed = (ev) => {\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n} \nreturn (\n <>\n Launch dialog\n \n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n \n \n);`,\n },\n];\n\nexport const InteractiveContent = () => {\n const [termsAgreed, setTermsAgreed] = useState(false);\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n };\n const termsDialogConfirmed = () => {\n const message = termsAgreed ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### Background close prevented\n\nexport const noCloseSnippet = [\n {\n language: \"Web component\",\n snippet: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true); \nconst handleDialogClose = () => setOpenDialog(false); \nconst handleConfirmDialog = (ev) => { \n alert(\"Confirmed!\");\n setOpenDialog(false);\n};\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n \n);`,\n },\n];\n\nexport const NoCloseContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleConfirmDialog = () => {\n alert(\"Confirmed!\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n );\n};\n\n\n \n\n\n### Events\n\nexport const eventsSnippet = [\n {\n language: \"Web component\",\n snippet: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleDialogOpened = () => alert(\"Dialog opened\");\nconst handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n}\nconst handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n}\nconst handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n};\nconst handleSlottedCancel = () => {\n alert('Slotted cancel button');\n setOpenDialog(false);\n};\nconst handleSlottedConfirm = () => {\n alert('Slotted confirm button');\n setOpenDialog(false);\n};\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n \n \n);`,\n },\n];\n\nexport const EventsContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleDialogOpened = () => alert(\"Dialog opened\");\n const handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n };\n const handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n };\n const handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n };\n const handleSlottedCancel = () => {\n alert(\"Slotted cancel button\");\n setOpenDialog(false);\n };\n const handleSlottedConfirm = () => {\n alert(\"Slotted confirm button\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Cancel\n \n \n Confirm\n \n \n \n );\n};\n\n\n \n\n\n### Disabled height constraint\n\nexport const popoutElements = [\n {\n language: \"Web component\",\n snippet: `\nLaunch disabled height constraint dialog\n\n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\n \n`,\n },\n {\n language: \"React\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch disabled height constraint dialog\n \n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\n \n \n \n)`,\n },\n];\n\nexport const DialogWithPopout = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch disabled height constraint dialog\n \n \n \n Sure, let's dive into the delightful world of milk, where dairy dreams\n and coffee collide in the harmonious dance of a flat white. Picture\n this: you stroll into your favorite coffee haunt, the aroma of freshly\n ground beans tickling your senses. You approach the counter, ready to\n make a crucial decision – what kind of milk will accompany your flat\n white?\n \n
\n \n In the end, whether you go for the classic, embrace the trendy, or opt\n for the exotic, the flat white remains a canvas waiting to be painted\n with your milk of choice. So, next time you're at the coffee counter,\n let your taste buds embark on a journey – a journey where milk and\n coffee meet, and every sip tells a story, sprinkled with a dash of\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\n \n
\n \n \n \n );\n};\n\n\n \n\n", + "contents": "\nimport {\n IcAlert,\n IcDialog,\n IcButton,\n IcCheckboxGroup,\n IcCheckbox,\n IcTypography,\n IcSelect,\n} from \"@ukic/react\";\nimport { useRef, useState } from \"react\";\n\nexport const buttonProps = [\n {\n label: \"Go back\",\n onclick: \"this.cancelDialog()\",\n },\n {\n label: \"Continue\",\n onclick: \"alert('Added to basket'); this.open = false;\",\n },\n];\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n)\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const DefaultDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n## Dialog details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch sizes dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n \n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch sizes dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to\n continue?\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SizesDialogs = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch sizes dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n### With status alerts\n\nexport const snippetsAlert = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch status dialog\n\n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenlDialog(false);\nreturn (\n <>\n \n Launch status dialog\n \n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const AlertDialog = () => {\n const dialogEl = useRef(null);\n const addTitleAboveAttribute = () => {\n dialogEl.current\n .querySelector(\"ic-alert\")\n .setAttribute(\"title-above\", \"true\");\n };\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => {\n addTitleAboveAttribute();\n setOpenDialog(true);\n };\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch dialog\n \n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n \n );\n};\n\n\n \n\n\n### Button variations\n\nexport const snippetsCustomButtons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch no button dialog\n Launch single button dialog\n Launch three button dialog\n Launch destructive button dialog\n \n Sorry, you cannot place orders at the moment. Please try again later.\n \n \n \n Your order for an Americano coffee has been placed.\n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n You are about to cancel your order for an Americano. Are you sure you want to continue?\n \n `,\n long: `{shortCode}\n \n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\nconst handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n}\nreturn (\n <>\n
\n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const CustomButtonsDialog = () => {\n const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\n const [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\n const [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\n const [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] =\n useState(false);\n const handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\n const handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\n const handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\n const handleDestructiveButtonDialogOpen = () =>\n setOpenDestructiveButtonDialog(true);\n const handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n };\n return (\n <>\n
\n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n );\n};\n\n\n \n\n\n### Slotted buttons\n\nexport const snippetsSlottedButtons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Go back\n \n \n Add to basket\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n}\nreturn (\n <>\n Launch slotted buttons dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SlottedButtonsDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n \n \n );\n};\n\n\n \n\n\n### Interactive content\n\nexport const interactiveContentSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nLaunch dialog\n\n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [termsAgreed, setTermsAgreed] = useState(false);\nconst [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n}\nconst termsDialogConfirmed = (ev) => {\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n} \nreturn (\n <>\n Launch dialog\n \n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const InteractiveContent = () => {\n const [termsAgreed, setTermsAgreed] = useState(false);\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n };\n const termsDialogConfirmed = () => {\n const message = termsAgreed ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### Background close prevented\n\nexport const noCloseSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true); \nconst handleDialogClose = () => setOpenDialog(false); \nconst handleConfirmDialog = (ev) => { \n alert(\"Confirmed!\");\n setOpenDialog(false);\n};\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const NoCloseContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleConfirmDialog = () => {\n alert(\"Confirmed!\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n );\n};\n\n\n \n\n\n### Events\n\nexport const eventsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nLaunch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleDialogOpened = () => alert(\"Dialog opened\");\nconst handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n}\nconst handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n}\nconst handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n};\nconst handleSlottedCancel = () => {\n alert('Slotted cancel button');\n setOpenDialog(false);\n};\nconst handleSlottedConfirm = () => {\n alert('Slotted confirm button');\n setOpenDialog(false);\n};\nreturn (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const EventsContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleDialogOpened = () => alert(\"Dialog opened\");\n const handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n };\n const handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n };\n const handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n };\n const handleSlottedCancel = () => {\n alert(\"Slotted cancel button\");\n setOpenDialog(false);\n };\n const handleSlottedConfirm = () => {\n alert(\"Slotted confirm button\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Cancel\n \n \n Confirm\n \n \n \n );\n};\n\n\n \n\n\n### Disabled height constraint\n\nexport const popoutElements = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nLaunch disabled height constraint dialog\n\n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n Launch disabled height constraint dialog\n \n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const DialogWithPopout = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch disabled height constraint dialog\n \n \n \n Sure, let's dive into the delightful world of milk, where dairy dreams\n and coffee collide in the harmonious dance of a flat white. Picture\n this: you stroll into your favorite coffee haunt, the aroma of freshly\n ground beans tickling your senses. You approach the counter, ready to\n make a crucial decision – what kind of milk will accompany your flat\n white?\n \n
\n \n In the end, whether you go for the classic, embrace the trendy, or opt\n for the exotic, the flat white remains a canvas waiting to be painted\n with your milk of choice. So, next time you're at the coffee counter,\n let your taste buds embark on a journey – a journey where milk and\n coffee meet, and every sip tells a story, sprinkled with a dash of\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\n \n
\n \n \n \n );\n};\n\n\n \n\n", "path": "/components/dialog/code", "date": "2023-10-26", "title": "Dialog", @@ -1786,10 +1786,10 @@ ], "meta": { "relativePath": "components/dialog/code.mdx", - "createdAt": "2024-04-08T22:24:28.520Z", - "lastModified": "2024-04-08T22:24:28.520Z", - "size": 41011, - "formattedSize": "40.0 KB" + "createdAt": "2024-04-08T22:26:50.768Z", + "lastModified": "2024-04-08T22:26:50.768Z", + "size": 43573, + "formattedSize": "42.6 KB" } }, { @@ -1857,7 +1857,7 @@ }, { "id": "components__empty-state__codex", - "contents": "\nimport { IcEmptyState, IcButton, IcLink } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n \n Customer support\n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n \n Customer support\n \n `,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n## Empty state details\n\n\n\n## Variants\n\n### Actions slot\n\nexport const actionsSnippets = [\n {\n language: \"Web component\",\n snippet: `\n Go to favourite coffees\n Customer support\n`,\n },\n {\n language: \"React\",\n snippet: `\n Go to favourite coffees\n Customer support\n`,\n },\n];\n\n\n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n### Image slot\n\nexport const imageSnippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Image size\n\nexport const imageLargeSnippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon in the image slot\n\nexport const iconSnippets = [\n {\n language: \"Web component\",\n snippet: `\n \n Warning\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Warning\n \n \n \n`,\n },\n];\n\n\n \n \n Warning\n \n \n \n \n\n\n### Right aligned\n\nexport const rightSnippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Center aligned\n\nexport const centreSnippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Max lines\n\nexport const maxLinesSnippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n", + "contents": "\nimport { IcEmptyState, IcButton, IcLink } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n \n Customer support\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n \n Customer support\n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n## Empty state details\n\n\n\n## Variants\n\n### Actions slot\n\nexport const actionsSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Go to favourite coffees\n Customer support\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Go to favourite coffees\n Customer support\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n### Image slot\n\nexport const imageSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Image size\n\nexport const imageLargeSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon in the image slot\n\nexport const iconSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Warning\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Warning\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Warning\n \n \n \n \n\n\n### Right aligned\n\nexport const rightSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Center aligned\n\nexport const centreSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Max lines\n\nexport const maxLinesSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n", "path": "/components/empty-state/code", "date": "2023-08-09", "title": "Empty state", @@ -1880,10 +1880,10 @@ ], "meta": { "relativePath": "components/empty-state/code.mdx", - "createdAt": "2024-04-08T22:24:28.532Z", - "lastModified": "2024-04-08T22:24:28.532Z", - "size": 19759, - "formattedSize": "19.3 KB" + "createdAt": "2024-04-08T22:26:50.768Z", + "lastModified": "2024-04-08T22:26:50.768Z", + "size": 21983, + "formattedSize": "21.5 KB" } }, { @@ -1951,7 +1951,7 @@ }, { "id": "components__footer__codex", - "contents": "\nimport { IcFooter, IcLink, IcFooterLink, IcFooterLinkGroup } from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n\n\n## Footer details\n\n\n\n## Footer link details\n\n\n\n## Footer link group details\n\n\n\n## Variants\n\n### Grouped links\n\nexport const snippetsGroupedLinks = [\n {\n language: \"Web component\",\n snippet: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n `,\n },\n {\n language: \"React\",\n snippet: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n `,\n },\n];\n\n\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n\n\n### Logo links\n\nexport const snippetsLogoLinks = [\n {\n language: \"Web component\",\n snippet: `\n Accessibility\n Styles\n Components\n Patterns\n
\n \n \n \n \n \n \n \n \n \n \n
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n Accessibility\n Styles\n Components\n Patterns\n
\n \n \n \n \n \n \n \n \n \n \n
\n
`,\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n \n This is the accessibility page} />\n This page is about styles} />\n \n \n \n Accessibility\n \n \n Styles\n \n
\n Logo\n
\n
\n
\n `,\n },\n];\n\n\n \n \n \n Accessibility\n \n \n Styles\n \n \n Logo\n
\n \n \n\n\n## Layout example\n\nAdding a `minHeight` of `100vh` ensures the footer appears below the page fold.\n\nexport const footerLayoutExample = [\n {\n language: \"Web component\",\n snippet: `\n `,\n },\n {\n language: \"React\",\n snippet: `
\n
\n \n \n \n \n \n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed\n vestibulum venenatis facilisis. Nam tortor felis, auctor vel\n ante quis, tempor interdum libero. In dictum sodales velit, eu\n egestas arcu dignissim ac. Aliquam facilisis eros dolor, id\n laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie,\n lectus magna interdum risus, vel fringilla libero ex eu dui.\n Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit\n nisl, vitae congue ligula rutrum id.\n \n \n
\n
\n \n Accessibility\n Styles\n Components\n Patterns\n \n
`,\n },\n];\n\n\n \n View example in new window\n \n\n", + "contents": "\nimport { IcFooter, IcLink, IcFooterLink, IcFooterLinkGroup } from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n\n\n## Footer details\n\n\n\n## Footer link details\n\n\n\n## Footer link group details\n\n\n\n## Variants\n\n### Grouped links\n\nexport const snippetsGroupedLinks = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n\n\n### Logo links\n\nexport const snippetsLogoLinks = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Accessibility\n Styles\n Components\n Patterns\n
\n \n \n \n \n \n \n \n \n \n \n
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Accessibility\n Styles\n Components\n Patterns\n
\n \n \n \n \n \n \n \n \n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n \n This is the accessibility page} />\n This page is about styles} />\n \n \n \n Accessibility\n \n \n Styles\n \n
\n Logo\n
\n
\n
\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Accessibility\n \n \n Styles\n \n \n Logo\n
\n \n \n\n\n## Layout example\n\nAdding a `minHeight` of `100vh` ensures the footer appears below the page fold.\n\nexport const footerLayoutExample = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `
\n
\n \n \n \n \n \n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed\n vestibulum venenatis facilisis. Nam tortor felis, auctor vel\n ante quis, tempor interdum libero. In dictum sodales velit, eu\n egestas arcu dignissim ac. Aliquam facilisis eros dolor, id\n laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie,\n lectus magna interdum risus, vel fringilla libero ex eu dui.\n Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit\n nisl, vitae congue ligula rutrum id.\n \n \n
\n
\n \n Accessibility\n Styles\n Components\n Patterns\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n View example in new window\n \n\n", "path": "/components/footer/code", "date": "2024-02-02", "title": "Footer", @@ -1974,10 +1974,10 @@ ], "meta": { "relativePath": "components/footer/code.mdx", - "createdAt": "2024-04-08T22:24:28.532Z", - "lastModified": "2024-04-08T22:24:28.532Z", - "size": 17352, - "formattedSize": "16.9 KB" + "createdAt": "2024-04-08T22:26:50.768Z", + "lastModified": "2024-04-08T22:26:50.768Z", + "size": 18690, + "formattedSize": "18.3 KB" } }, { @@ -2045,7 +2045,7 @@ }, { "id": "components__hero__codex", - "contents": "\nimport { IcHero, IcButton, IcSearchBar, IcCard } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n {\n language: \"React\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n## Hero details\n\n\n\n## Variants\n\n### Centre aligned\n\nexport const snippetsCentre = [\n {\n language: \"Web component\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n {\n language: \"React\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n### Content centre aligned\n\nexport const snippetsContentCentre = [\n {\n language: \"Web component\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n {\n language: \"React\",\n snippet: `\n Explore\n Check out our new drinks\n`,\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: `\n Order now\n Submit new flavour\n`,\n },\n {\n language: \"React\",\n snippet: `\n Order now\n Submit new flavour\n`,\n },\n];\n\n\n \n \n Order now\n \n \n Submit new flavour\n \n \n\n\n### Secondary heading and search\n\nexport const snippetsSecondHeadingSearch = [\n {\n language: \"Web component\",\n snippet: `\n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n`,\n },\n];\n\n\n \n \n \n\n\n### Card right content\n\nexport const snippetsCard = [\n {\n language: \"Web component\",\n snippet: `\n Explore\n Check out our new drinks\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n Explore\n Check out our new drinks\n \n`,\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n \n\n\n### Image right content\n\nexport const snippetsImage = [\n {\n language: \"Web component\",\n snippet: `\n Explore\n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n Explore\n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "contents": "\nimport { IcHero, IcButton, IcSearchBar, IcCard } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n## Hero details\n\n\n\n## Variants\n\n### Centre aligned\n\nexport const snippetsCentre = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n### Content centre aligned\n\nexport const snippetsContentCentre = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Order now\n Submit new flavour\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Order now\n Submit new flavour\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Order now\n \n \n Submit new flavour\n \n \n\n\n### Secondary heading and search\n\nexport const snippetsSecondHeadingSearch = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Card right content\n\nexport const snippetsCard = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n \n\n\n### Image right content\n\nexport const snippetsImage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Explore\n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", "path": "/components/hero/code", "date": "2023-10-25", "title": "Hero", @@ -2068,10 +2068,10 @@ ], "meta": { "relativePath": "components/hero/code.mdx", - "createdAt": "2024-04-08T22:24:28.532Z", - "lastModified": "2024-04-08T22:24:28.532Z", - "size": 12993, - "formattedSize": "12.7 KB" + "createdAt": "2024-04-08T22:26:50.768Z", + "lastModified": "2024-04-08T22:26:50.768Z", + "size": 14939, + "formattedSize": "14.6 KB" } }, { @@ -2155,7 +2155,7 @@ }, { "id": "components__links__codex", - "contents": "\nimport { IcLink } from \"@ukic/react\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `About our coffees`,\n },\n {\n language: \"React\",\n snippet: `About our coffees`,\n },\n];\n\n## Component demo\n\n\n e.preventDefault()}>\n About our coffees\n \n\n\n## Link details\n\n\n\n## Variants\n\n### With icon\n\nexport const snippetsIcon = [\n {\n language: \"Web component\",\n snippet: `About our coffees`,\n },\n {\n language: \"React\",\n snippet: `About our coffees`,\n },\n];\n\n\n \n About our coffees\n \n\n\n### Light and dark\n\nexport const snippetsLightDark = [\n {\n language: \"Web component\",\n snippet: `About our coffees\nAbout our coffees`,\n },\n {\n language: \"React\",\n snippet: `About our coffees\nAbout our coffees`,\n },\n];\n\n\n \n \n About our coffees\n \n
\n \n \n About our coffees\n \n
\n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n
\n \n Home\n \n \n Beverages\n \n
\n \n \n This is the home page} />\n This page is about beverages} />\n \n \n
\n `,\n },\n];\n\n\n \n \n \n \n Home\n \n \n \n \n Beverages\n \n \n \n \n\n", + "contents": "\nimport { IcLink } from \"@ukic/react\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `About our coffees`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `About our coffees`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n## Component demo\n\n\n e.preventDefault()}>\n About our coffees\n \n\n\n## Link details\n\n\n\n## Variants\n\n### With icon\n\nexport const snippetsIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `About our coffees`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `About our coffees`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n About our coffees\n \n\n\n### Light and dark\n\nexport const snippetsLightDark = [\n {\n technology: \"Web component\",\n snippets: {\n short: `About our coffees\nAbout our coffees`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `About our coffees\nAbout our coffees`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n About our coffees\n \n \n \n \n About our coffees\n \n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n Home\n \n \n Beverages\n \n
\n \n \n This is the home page} />\n This page is about beverages} />\n \n \n
\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n Home\n \n \n \n \n Beverages\n \n \n \n \n\n", "path": "/components/link/code", "date": "2023-07-27", "title": "Link", @@ -2178,10 +2178,10 @@ ], "meta": { "relativePath": "components/links/code.mdx", - "createdAt": "2024-04-08T22:24:28.536Z", - "lastModified": "2024-04-08T22:24:28.536Z", - "size": 3608, - "formattedSize": "3.5 KB" + "createdAt": "2024-04-08T22:26:50.772Z", + "lastModified": "2024-04-08T22:26:50.772Z", + "size": 4668, + "formattedSize": "4.6 KB" } }, { @@ -2249,7 +2249,7 @@ }, { "id": "components__loading-indicators__codex", - "contents": "\nimport { IcLoadingIndicator } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n \n \n\n\n## Loading indicator details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n language: \"Web component\",\n snippet: `\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n \n \n \n \n\n\n### Icon\n\nexport const snippetsIcon = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Determinate\n\nexport const snippetsDeterminate = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n \n \n\n\n### Light\n\nexport const snippetsLight = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n \n \n\n\n### Changing label\n\nexport const snippetsChangingLabel = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n", + "contents": "\nimport { IcLoadingIndicator } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n\n\n## Loading indicator details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Icon\n\nexport const snippetsIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Determinate\n\nexport const snippetsDeterminate = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n\n\n### Light\n\nexport const snippetsLight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n\n\n### Changing label\n\nexport const snippetsChangingLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n", "path": "/components/loading-indicator/code", "date": "2023-02-03", "title": "Loading indicator", @@ -2272,10 +2272,10 @@ ], "meta": { "relativePath": "components/loading-indicators/code.mdx", - "createdAt": "2024-04-08T22:24:28.536Z", - "lastModified": "2024-04-08T22:24:28.536Z", - "size": 5056, - "formattedSize": "4.9 KB" + "createdAt": "2024-04-08T22:26:50.772Z", + "lastModified": "2024-04-08T22:26:50.772Z", + "size": 6724, + "formattedSize": "6.6 KB" } }, { @@ -2343,7 +2343,7 @@ }, { "id": "components__page-header__codex", - "contents": "\nimport {\n IcPageHeader,\n IcButton,\n IcStepper,\n IcStep,\n SlottedSVG,\n IcTextField,\n IcNavigationItem,\n IcBreadcrumb,\n IcBreadcrumbGroup,\n IcSectionContainer,\n IcChip,\n IcTypography,\n} from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n `,\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n \n\n\n## Page header details\n\n\n\n## Variants\n\n### Size small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### With breadcrumb navigation\n\nexport const withBreadcrumbNavigation = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n\n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n\n `,\n },\n];\n\n\n \n \n \n \n \n \n \n \n\n\n### With actions, input and stepper\n\nexport const withActionsInputStepper = [\n {\n language: \"Web component\",\n snippet: `\n \n Create coffee\n Filter coffee\n \n \n \n \n \n \n\n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n\n `,\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n \n\n\n### With actions, input and tabs\n\nexport const withActionsInputTabs = [\n {\n language: \"Web component\",\n snippet: `\n \n Create coffee\n Filter coffee\n \n \n \n \n \n\n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n\n `,\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n \n \n Create coffee\n \n \n \n \n Filter coffee\n \n Method\n \n \n Ingredients\n \n \n \n \n \n This page is about our Latte making methods}/>\n This page is about the ingredients used in our Latte}/>\n \n \n\n `,\n },\n];\n\n\n \n \n \n \n Create coffee\n \n \n \n \n \n Filter coffee\n \n \n \n Method\n \n \n \n \n Ingredients\n \n \n \n \n \n \n\n\n### With Slots\n\nexport const withSlots = [\n {\n language: \"Web component\",\n snippet: `\n Latte recipe\n A Latte is a popular Italian coffee, made with espresso, steamed milk and a thin layer of foam.\n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Latte recipe\n \n \n A Latte is a popular Italian coffee, made with espresso, steamed milk and\n a thin layer of foam.\n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n Latte recipe\n \n \n A Latte is a popular Italian coffee, made with espresso, steamed milk and\n a thin layer of foam.\n \n \n \n \n \n \n \n \n \n\n", + "contents": "\nimport {\n IcPageHeader,\n IcButton,\n IcStepper,\n IcStep,\n SlottedSVG,\n IcTextField,\n IcNavigationItem,\n IcBreadcrumb,\n IcBreadcrumbGroup,\n IcSectionContainer,\n IcChip,\n IcTypography,\n} from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n \n\n\n## Page header details\n\n\n\n## Variants\n\n### Size small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With breadcrumb navigation\n\nexport const withBreadcrumbNavigation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n\n\n### With actions, input and stepper\n\nexport const withActionsInputStepper = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Create coffee\n Filter coffee\n \n \n \n \n \n \n\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n \n\n\n### With actions, input and tabs\n\nexport const withActionsInputTabs = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Create coffee\n Filter coffee\n \n \n \n \n \n\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n\n\n### With React Router\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Create coffee\n \n \n \n \n Filter coffee\n \n Method\n \n \n Ingredients\n \n \n \n \n \n This page is about our Latte making methods}/>\n This page is about the ingredients used in our Latte}/>\n \n \n\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n Create coffee\n \n \n \n \n \n Filter coffee\n \n \n \n Method\n \n \n \n \n Ingredients\n \n \n \n \n \n \n\n\n### With Slots\n\nexport const withSlots = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Latte recipe\n A Latte is a popular Italian coffee, made with espresso, steamed milk and a thin layer of foam.\n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Latte recipe\n \n \n A Latte is a popular Italian coffee, made with espresso, steamed milk and\n a thin layer of foam.\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Latte recipe\n \n \n A Latte is a popular Italian coffee, made with espresso, steamed milk and\n a thin layer of foam.\n \n \n \n \n \n \n \n \n \n\n", "path": "/components/page-header/code", "date": "2023-10-25", "title": "Page header", @@ -2366,10 +2366,10 @@ ], "meta": { "relativePath": "components/page-header/code.mdx", - "createdAt": "2024-04-08T22:24:28.536Z", - "lastModified": "2024-04-08T22:24:28.536Z", - "size": 16912, - "formattedSize": "16.5 KB" + "createdAt": "2024-04-08T22:26:50.772Z", + "lastModified": "2024-04-08T22:26:50.772Z", + "size": 18806, + "formattedSize": "18.4 KB" } }, { @@ -2437,7 +2437,7 @@ }, { "id": "components__pagination__codex", - "contents": "\nimport { IcPagination } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n
\n \n
\n \n\n\n## Pagination details\n\n\n\n## Variants\n\n### Hide first and last page buttons\n\nexport const hideFirstLast = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Hide current page (only in 'simple' type)\n\nexport const hideCurrent = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Appearance\n\nexport const appearance = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n \n
\n \n
\n\n\n### Boundary and Adjacent items set\n\nexport const boundaryAdjacent = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Label\n\nexport const label = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Default page\n\nexport const defaultPage = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n", + "contents": "\nimport { IcPagination } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n \n\n\n## Pagination details\n\n\n\n## Variants\n\n### Hide first and last page buttons\n\nexport const hideFirstLast = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Hide current page (only in 'simple' type)\n\nexport const hideCurrent = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Appearance\n\nexport const appearance = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
\n \n
\n\n\n### Boundary and Adjacent items set\n\nexport const boundaryAdjacent = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Label\n\nexport const label = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Default page\n\nexport const defaultPage = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n", "path": "/components/pagination/code", "date": "2023-05-05", "title": "Pagination", @@ -2460,10 +2460,10 @@ ], "meta": { "relativePath": "components/pagination/code.mdx", - "createdAt": "2024-04-08T22:24:28.536Z", - "lastModified": "2024-04-08T22:24:28.536Z", - "size": 4638, - "formattedSize": "4.5 KB" + "createdAt": "2024-04-08T22:26:50.776Z", + "lastModified": "2024-04-08T22:26:50.776Z", + "size": 6862, + "formattedSize": "6.7 KB" } }, { @@ -2531,7 +2531,7 @@ }, { "id": "components__popover-menu__codex", - "contents": "\nimport { IcPopoverMenu, IcMenuItem, IcMenuGroup, IcButton } from \"@ukic/react\";\nimport { useRef } from \"react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
`,\n },\n {\n language: \"React\",\n snippet: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n);`,\n },\n];\n\nexport const DemoPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n\n## Popover menu details\n\n\n\n## Menu item details\n\n\n\n## Menu group details\n\n\n\n## Variants\n\n### With button variations\n\nexport const snippetsButtons = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n },\n {\n language: \"React\",\n snippet: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);`,\n },\n];\n\nexport const ButtonsPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### With menu groups\n\nexport const snippetsGroups = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
`,\n },\n {\n language: \"React\",\n snippet: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);`,\n },\n];\n\nexport const GroupsPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n", + "contents": "\nimport { IcPopoverMenu, IcMenuItem, IcMenuGroup, IcButton } from \"@ukic/react\";\nimport { useRef } from \"react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const DemoPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n\n## Popover menu details\n\n\n\n## Menu item details\n\n\n\n## Menu group details\n\n\n\n## Variants\n\n### With button variations\n\nexport const snippetsButtons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const ButtonsPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### With menu groups\n\nexport const snippetsGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const popoverEl = useRef(null);\nconst handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n};\nreturn (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const GroupsPopover = () => {\n const popoverEl = useRef(null);\n const handleClick = () => {\n popoverEl.current.open = !popoverEl.current.open;\n };\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\n\n \n\n", "path": "/components/popover-menu/code", "date": "2023-07-31", "title": "Popover menu", @@ -2554,10 +2554,10 @@ ], "meta": { "relativePath": "components/popover-menu/code.mdx", - "createdAt": "2024-04-08T22:24:28.540Z", - "lastModified": "2024-04-08T22:24:28.540Z", - "size": 13771, - "formattedSize": "13.4 KB" + "createdAt": "2024-04-08T22:26:50.776Z", + "lastModified": "2024-04-08T22:26:50.776Z", + "size": 14605, + "formattedSize": "14.3 KB" } }, { @@ -2625,7 +2625,7 @@ }, { "id": "components__radio__codex", - "contents": "\nimport { IcRadioGroup, IcRadioOption, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev.detail.value)}>\n \n \n \n \n`,\n },\n];\n\n\n console.log(ev.detail.value)}\n >\n \n \n \n \n \n\n\n## Radio group details\n\n\n\n## Radio option details\n\n\n\n## Variants\n\n### Conditional\n\nexport const conditional = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const conditionalDynamic = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n
\n \n \n \n \n \n \n
\n
\n\n### With helper text\n\nexport const withHelperText = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n\n### With validation\n\nexport const withValidation = [\n {\n language: \"Web component\",\n snippet: `\n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n`,\n },\n];\n\n\n \n \n \n \n\n", + "contents": "\nimport { IcRadioGroup, IcRadioOption, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.value)}>\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev.detail.value)}\n >\n \n \n \n \n \n\n\n## Radio group details\n\n\n\n## Radio option details\n\n\n\n## Variants\n\n### Conditional\n\nexport const conditional = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const conditionalDynamic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n \n \n \n
\n
\n\n### With helper text\n\nexport const withHelperText = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### With validation\n\nexport const withValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n", "path": "/components/radio/code", "date": "2024-01-18", "title": "Radio button", @@ -2648,10 +2648,10 @@ ], "meta": { "relativePath": "components/radio/code.mdx", - "createdAt": "2024-04-08T22:24:28.540Z", - "lastModified": "2024-04-08T22:24:28.540Z", - "size": 9346, - "formattedSize": "9.1 KB" + "createdAt": "2024-04-08T22:26:50.776Z", + "lastModified": "2024-04-08T22:26:50.776Z", + "size": 11014, + "formattedSize": "10.8 KB" } }, { @@ -2719,7 +2719,7 @@ }, { "id": "components__search-bar__codex", - "contents": "\nimport { IcSearchBar, IcTypography } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(ev.detail.value)}\n placeholder=\"Start typing to search…\"\n/>`,\n },\n];\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\n placeholder=\"Start typing to search…\"\n />\n\n\n## Search bar details\n\n\n\n## Variants\n\n### With options (no filtering)\n\nexport const optionsNoFiltering = [\n {\n language: \"Web component\",\n snippet: `\n\n
\n\n All options will be displayed as you type\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n
\nAll options will be displayed as you type`,\n },\n];\n\n\n \n
\n \n All options will be displayed as you type\n \n\n\n### With helper text\n\nexport const withHelperText = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### With hidden label\n\nexport const withHiddenLabel = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Size small\n\nexport const sizeSmall = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the input field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: `const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst [results, setResults] = useState([]);\nconst changeHandler = (event) =>{\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n}\nreturn(\n<>\n \n\n);`,\n },\n];\n\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n ];\n const [results, setResults] = React.useState([]);\n const changeHandler = (event) => {\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n };\n return (\n \n );\n};\n\n\n \n\n", + "contents": "\nimport { IcSearchBar, IcTypography } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(ev.detail.value)}\n placeholder=\"Start typing to search…\"\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\n placeholder=\"Start typing to search…\"\n />\n\n\n## Search bar details\n\n\n\n## Variants\n\n### With options (no filtering)\n\nexport const optionsNoFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n
\n\n All options will be displayed as you type\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
\nAll options will be displayed as you type`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
\n \n All options will be displayed as you type\n \n\n\n### With helper text\n\nexport const withHelperText = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With hidden label\n\nexport const withHiddenLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Size small\n\nexport const sizeSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the input field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst [results, setResults] = useState([]);\nconst changeHandler = (event) =>{\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n}\nreturn(\n<>\n \n\n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n ];\n const [results, setResults] = React.useState([]);\n const changeHandler = (event) => {\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n };\n return (\n \n );\n};\n\n\n \n\n", "path": "/components/search-bar/code", "date": "2024-02-02", "title": "Search bar", @@ -2742,10 +2742,10 @@ ], "meta": { "relativePath": "components/search-bar/code.mdx", - "createdAt": "2024-04-08T22:24:28.540Z", - "lastModified": "2024-04-08T22:24:28.540Z", - "size": 14707, - "formattedSize": "14.4 KB" + "createdAt": "2024-04-08T22:26:50.776Z", + "lastModified": "2024-04-08T22:26:50.776Z", + "size": 16653, + "formattedSize": "16.3 KB" } }, { @@ -2813,7 +2813,7 @@ }, { "id": "components__section-container__codex", - "contents": "\nimport { IcChip, IcSectionContainer } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n
\n \n \n \n
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n
\n \n \n \n
\n
`,\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n## Section container details\n\n\n\n## Variants\n\n### Center align\n\nexport const snippetsCenter = [\n {\n language: \"Web component\",\n snippet: `\n
\n \n \n \n
\n`,\n },\n {\n language: \"React\",\n snippet: `\n
\n \n \n \n
\n`,\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Full-width align\n\nexport const snippetsFullWidth = [\n {\n language: \"Web component\",\n snippet: `\n
\n \n \n \n
\n`,\n },\n {\n language: \"React\",\n snippet: `\n
\n \n \n \n
\n
`,\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Full height\n\nexport const snippetsFullHeight = [\n {\n language: \"Web component\",\n snippet: `\n
\n \n \n \n
\n`,\n },\n {\n language: \"React\",\n snippet: `\n
\n \n \n \n
\n
`,\n },\n];\n\n\n \n \n \n \n \n \n \n\n", + "contents": "\nimport { IcChip, IcSectionContainer } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
\n \n \n \n
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n## Section container details\n\n\n\n## Variants\n\n### Center align\n\nexport const snippetsCenter = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
\n \n \n \n
\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n \n \n
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Full-width align\n\nexport const snippetsFullWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
\n \n \n \n
\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Full height\n\nexport const snippetsFullHeight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
\n \n \n \n
\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n\n", "path": "/components/section-container/code", "date": "2024-02-02", "title": "Section container", @@ -2836,10 +2836,10 @@ ], "meta": { "relativePath": "components/section-container/code.mdx", - "createdAt": "2024-04-08T22:24:28.544Z", - "lastModified": "2024-04-08T22:24:28.544Z", - "size": 5598, - "formattedSize": "5.5 KB" + "createdAt": "2024-04-08T22:26:50.780Z", + "lastModified": "2024-04-08T22:26:50.780Z", + "size": 6710, + "formattedSize": "6.6 KB" } }, { @@ -2907,7 +2907,7 @@ }, { "id": "components__select__codex", - "contents": "\nimport { IcSelect } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Select details\n\n\n\n## Variants\n\n### With clear button, descriptions, helper text and custom placeholder\n\nexport const snippetsWithExtras = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleWithExtras = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Options disabled\n\nexport const snippetsOptionDisabled = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleOptionsDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n size=\"small\"\n/>`,\n },\n];\n\nexport const SelectExampleSmall = () => (\n console.log(event.detail.value)}\n size=\"small\"\n />\n);\n\n\n \n\n\n### Hidden label\n\nexport const snippetsHideLabel = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleHideLabel = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Groups\n\nexport const snippetsGroups = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleGroups = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Recommended\n\nexport const snippetsRecommended = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleRecommended = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n language: \"Web component\",\n snippet: `\n\n\n\n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SelectExampleValidation = () => (\n
\n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n
\n);\n\n\n \n\n\n### Searchable\n\nexport const snippetsSearchable = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SearchableSelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable - with descriptions included in search\n\nexport const snippetsSearchableWithDescriptions = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SearchableSelectWithDescriptionsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable - with group titles included in search\n\nexport const snippetsSearchableWithGroups = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.value)}\n/>`,\n },\n];\n\nexport const SearchableSelectWithGroupsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the select field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nconst [results, setResults] = useState([]);\nconst [selectedValue, setSelectedValue] = useState(\"\");\nconst changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) => \n item.label.toLowerCase().includes(query.toLowerCase()));\n return new Promise(resolve => { \n setTimeout(() => resolve(filteredResults), 1000)\n });\n };\n mockAPI(newValue).then((results) => setResults(results));\n } else {\n setResults([]);\n }\n } \n}\nreturn(\n <>\n setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n />\n \n);`,\n },\n];\n\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n ];\n const [results, setResults] = React.useState([]);\n const [selectedValue, setSelectedValue] = React.useState(\"\");\n const changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(newValue).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n }\n };\n return (\n setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n />\n );\n};\n\n\n \n\n", + "contents": "\nimport { IcSelect } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Select details\n\n\n\n## Variants\n\n### With clear button, descriptions, helper text and custom placeholder\n\nexport const snippetsWithExtras = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleWithExtras = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Options disabled\n\nexport const snippetsOptionDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleOptionsDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n size=\"small\"\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleSmall = () => (\n console.log(event.detail.value)}\n size=\"small\"\n />\n);\n\n\n \n\n\n### Hidden label\n\nexport const snippetsHideLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleHideLabel = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Groups\n\nexport const snippetsGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleGroups = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Recommended\n\nexport const snippetsRecommended = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleRecommended = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleValidation = () => (\n
\n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n
\n);\n\n\n \n\n\n### Searchable\n\nexport const snippetsSearchable = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable - with descriptions included in search\n\nexport const snippetsSearchableWithDescriptions = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectWithDescriptionsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable - with group titles included in search\n\nexport const snippetsSearchableWithGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectWithGroupsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the select field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nconst [results, setResults] = useState([]);\nconst [selectedValue, setSelectedValue] = useState(\"\");\nconst changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) => \n item.label.toLowerCase().includes(query.toLowerCase()));\n return new Promise(resolve => { \n setTimeout(() => resolve(filteredResults), 1000)\n });\n };\n mockAPI(newValue).then((results) => setResults(results));\n } else {\n setResults([]);\n }\n } \n}\nreturn(\n <>\n setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n />\n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n ];\n const [results, setResults] = React.useState([]);\n const [selectedValue, setSelectedValue] = React.useState(\"\");\n const changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(newValue).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n }\n };\n return (\n setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n />\n );\n};\n\n\n \n\n", "path": "/components/select/code", "date": "2024-02-02", "title": "Select", @@ -2930,10 +2930,10 @@ ], "meta": { "relativePath": "components/select/code.mdx", - "createdAt": "2024-04-08T22:24:28.544Z", - "lastModified": "2024-04-08T22:24:28.544Z", - "size": 35528, - "formattedSize": "34.7 KB" + "createdAt": "2024-04-08T22:26:50.780Z", + "lastModified": "2024-04-08T22:26:50.780Z", + "size": 39142, + "formattedSize": "38.2 KB" } }, { @@ -3001,7 +3001,7 @@ }, { "id": "components__side-nav__codex", - "contents": "\nimport {\n IcSideNavigation,\n IcNavigationItem,\n IcNavigationGroup,\n IcDivider,\n IcLink,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nimport {\n mdiHome,\n mdiCoffeeOutline,\n mdiMagnify,\n mdiCoffeeMakerOutline,\n mdiCogOutline,\n mdiTeaOutline,\n} from \"@mdi/js\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n## Side navigation details\n\n\n\n## Navigation group details\n\n\n\n## Navigation item details\n\n\n\n## Variants\n\n### Static\n\nexport const snippetsStatic = [\n {\n language: \"Web component\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### Expanded on default\n\nexport const snippetsExpanded = [\n {\n language: \"Web component\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### Collapsed labels\n\nexport const snippetsCollapsed = [\n {\n language: \"Web component\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### With badges on navigation items\n\nexport const snippetsBadge = [\n {\n language: \"Web component\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### With Material Design icons in SlottedSVG\n\n[MDI](https://pictogrammers.com/library/mdi/) can be imported from the `@mdi/js` package and used in ``.\nTo scale the icons, use the ['viewBox' attribute](https://css-tricks.com/scale-svg/#aa-the-viewbox-attribute)\n\n```bash\nnpm i @mdi/js\n```\n\nexport const withMDIicons = [\n {\n language: \"React\",\n snippet: `// importing Material Design icons\nimport { \n mdiCoffeeOutline, \n mdiHome,\n mdiMagnify,\n mdiCoffeeMakerOutline,\n mdiCogOutline,\n mdiTeaOutline\n} from \"@mdi/js\";\n...\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### With React Router and Material Design Icons (using slots)\n\nThe following example also demonstrates using a slotted app title link.\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n
\n \n ACME coffee shop\n \n \n \n \n Home\n \n \n \n \n \n Search\n \n \n \n \n \n Drinks\n \n \n \n \n \n Equipment\n \n \n \n \n \n Settings\n \n \n \n
\n \n \n This is the home page} />\n Search} />\n Drinks} />\n Coffee Maker} />\n Settings} />\n \n \n
\n
\n
`,\n },\n];\n\n\n \n
\n \n \n ACME coffee shop\n \n \n \n \n \n Home\n \n \n \n \n \n Search\n \n \n \n \n \n Drinks\n \n \n \n \n \n Equipment\n \n \n \n \n \n Settings\n \n \n \n
\n
\n\n\n## Layout example\n\nFixed side navigation places the side navigation to the viewport.\n\nexport const basicLayoutFixedViewport = [\n {\n language: \"Web component\",\n snippet: `// Inline styling added for verboseness\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vestibulum venenatis facilisis. Nam tortor felis, auctor vel ante quis, tempor interdum libero. In dictum sodales velit, eu egestas arcu dignissim ac. Aliquam facilisis eros dolor, id laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie, lectus magna interdum risus, vel fringilla libero ex eu dui. Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit nisl, vitae congue ligula rutrum id.

\n
\n \n

Etiam in suscipit metus. Duis semper, sapien a molestie semper, ex nibh porttitor tellus, vel molestie justo odio vel purus. Curabitur porttitor, tortor sed semper sollicitudin, odio odio congue tortor, eget pulvinar tellus nisl ac lacus. In ultricies commodo lorem, a laoreet diam. Ut a mauris at tellus tincidunt ullamcorper sit amet in metus. Aenean facilisis placerat dictum. Phasellus mattis ante sollicitudin luctus iaculis. Nam porttitor lobortis rhoncus. Nam nec malesuada purus, at pulvinar mauris. Nam non lorem ante.

\n
\n
\n
\n \n Get Started\n Accessibility\n Styles\n \n \n
\n
`,\n },\n {\n language: \"React\",\n snippet: `// Inline styling added for verboseness\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vestibulum venenatis facilisis. Nam tortor felis, auctor vel ante quis, tempor interdum libero. In dictum sodales velit, eu egestas arcu dignissim ac. Aliquam facilisis eros dolor, id laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie, lectus magna interdum risus, vel fringilla libero ex eu dui. Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit nisl, vitae congue ligula rutrum id.

\n
\n \n

Etiam in suscipit metus. Duis semper, sapien a molestie semper, ex nibh porttitor tellus, vel molestie justo odio vel purus. Curabitur porttitor, tortor sed semper sollicitudin, odio odio congue tortor, eget pulvinar tellus nisl ac lacus. In ultricies commodo lorem, a laoreet diam. Ut a mauris at tellus tincidunt ullamcorper sit amet in metus. Aenean facilisis placerat dictum. Phasellus mattis ante sollicitudin luctus iaculis. Nam porttitor lobortis rhoncus. Nam nec malesuada purus, at pulvinar mauris. Nam non lorem ante.

\n
\n
\n
\n \n Get Started\n Accessibility\n Styles\n \n \n
\n
`,\n },\n];\n\n\n \n View example in new window\n \n\n", + "contents": "\nimport {\n IcSideNavigation,\n IcNavigationItem,\n IcNavigationGroup,\n IcDivider,\n IcLink,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nimport {\n mdiHome,\n mdiCoffeeOutline,\n mdiMagnify,\n mdiCoffeeMakerOutline,\n mdiCogOutline,\n mdiTeaOutline,\n} from \"@mdi/js\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n## Side navigation details\n\n\n\n## Navigation group details\n\n\n\n## Navigation item details\n\n\n\n## Variants\n\n### Static\n\nexport const snippetsStatic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### Expanded on default\n\nexport const snippetsExpanded = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### Collapsed labels\n\nexport const snippetsCollapsed = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n magnify\n \n \n \n \n \n coffee-outline\n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### With badges on navigation items\n\nexport const snippetsBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n coffee-outline\n \n \n \n \n home\n \n \n \n \n \n \n magnify\n \n \n \n \n \n \n coffee-outline\n \n \n \n \n \n \n coffee-maker-outline\n \n \n \n \n \n cog-outline\n \n \n \n \n\n\n### With Material Design icons in SlottedSVG\n\n[MDI](https://pictogrammers.com/library/mdi/) can be imported from the `@mdi/js` package and used in ``.\nTo scale the icons, use the ['viewBox' attribute](https://css-tricks.com/scale-svg/#aa-the-viewbox-attribute)\n\n```bash\nnpm i @mdi/js\n```\n\nexport const withMDIicons = [\n {\n technology: \"React\",\n snippets: {\n short: `// importing Material Design icons\nimport { \n mdiCoffeeOutline, \n mdiHome,\n mdiMagnify,\n mdiCoffeeMakerOutline,\n mdiCogOutline,\n mdiTeaOutline\n} from \"@mdi/js\";\n...\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### With React Router and Material Design Icons (using slots)\n\nThe following example also demonstrates using a slotted app title link.\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n
\n \n ACME coffee shop\n \n \n \n \n Home\n \n \n \n \n \n Search\n \n \n \n \n \n Drinks\n \n \n \n \n \n Equipment\n \n \n \n \n \n Settings\n \n \n \n
\n \n \n This is the home page} />\n Search} />\n Drinks} />\n Coffee Maker} />\n Settings} />\n \n \n
\n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
\n \n \n ACME coffee shop\n \n \n \n \n \n Home\n \n \n \n \n \n Search\n \n \n \n \n \n Drinks\n \n \n \n \n \n Equipment\n \n \n \n \n \n Settings\n \n \n \n
\n
\n\n\n## Layout example\n\nFixed side navigation places the side navigation to the viewport.\n\nexport const basicLayoutFixedViewport = [\n {\n technology: \"Web component\",\n snippets: {\n short: `// Inline styling added for verboseness\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vestibulum venenatis facilisis. Nam tortor felis, auctor vel ante quis, tempor interdum libero. In dictum sodales velit, eu egestas arcu dignissim ac. Aliquam facilisis eros dolor, id laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie, lectus magna interdum risus, vel fringilla libero ex eu dui. Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit nisl, vitae congue ligula rutrum id.

\n
\n \n

Etiam in suscipit metus. Duis semper, sapien a molestie semper, ex nibh porttitor tellus, vel molestie justo odio vel purus. Curabitur porttitor, tortor sed semper sollicitudin, odio odio congue tortor, eget pulvinar tellus nisl ac lacus. In ultricies commodo lorem, a laoreet diam. Ut a mauris at tellus tincidunt ullamcorper sit amet in metus. Aenean facilisis placerat dictum. Phasellus mattis ante sollicitudin luctus iaculis. Nam porttitor lobortis rhoncus. Nam nec malesuada purus, at pulvinar mauris. Nam non lorem ante.

\n
\n
\n
\n \n Get Started\n Accessibility\n Styles\n \n \n
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `// Inline styling added for verboseness\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vestibulum venenatis facilisis. Nam tortor felis, auctor vel ante quis, tempor interdum libero. In dictum sodales velit, eu egestas arcu dignissim ac. Aliquam facilisis eros dolor, id laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie, lectus magna interdum risus, vel fringilla libero ex eu dui. Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit nisl, vitae congue ligula rutrum id.

\n
\n \n

Etiam in suscipit metus. Duis semper, sapien a molestie semper, ex nibh porttitor tellus, vel molestie justo odio vel purus. Curabitur porttitor, tortor sed semper sollicitudin, odio odio congue tortor, eget pulvinar tellus nisl ac lacus. In ultricies commodo lorem, a laoreet diam. Ut a mauris at tellus tincidunt ullamcorper sit amet in metus. Aenean facilisis placerat dictum. Phasellus mattis ante sollicitudin luctus iaculis. Nam porttitor lobortis rhoncus. Nam nec malesuada purus, at pulvinar mauris. Nam non lorem ante.

\n
\n
\n
\n \n Get Started\n Accessibility\n Styles\n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n View example in new window\n \n\n", "path": "/components/side-navigation/code", "date": "2023-10-11", "title": "Side navigation", @@ -3024,10 +3024,10 @@ ], "meta": { "relativePath": "components/side-nav/code.mdx", - "createdAt": "2024-04-08T22:24:28.548Z", - "lastModified": "2024-04-08T22:24:28.548Z", - "size": 75440, - "formattedSize": "73.7 KB" + "createdAt": "2024-04-08T22:26:50.784Z", + "lastModified": "2024-04-08T22:26:50.784Z", + "size": 77560, + "formattedSize": "75.7 KB" } }, { @@ -3095,7 +3095,7 @@ }, { "id": "components__skeleton__codex", - "contents": "\nimport {\n IcSkeleton,\n IcTypography,\n IcCard,\n IcButton,\n SlottedSVG,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n \n\n`,\n },\n];\n\n\n
\n \n \n \n \n \n
\n
\n\n## Skeleton details\n\n\n\n## Variants\n\n### Inherited size from child\n\nexport const snippetsInherited = [\n {\n language: \"Web component\",\n snippet: `
Test text
`,\n },\n {\n language: \"React\",\n snippet: `\n
Test text
\n
`,\n },\n];\n\n\n \n \n Test text\n \n \n\n\n### Set width and height\n\nexport const snippetsSetWidthAndHeight = [\n {\n language: \"Web component\",\n snippet: `Height and width set with styles\n\nHeight set with styles\n\nWidth set with styles\n`,\n },\n {\n language: \"React\",\n snippet: `Height and width set with styles\n\nHeight set with styles\n\nWidth set with styles\n`,\n },\n];\n\n\n
\n Height and width set with styles\n \n Height set with styles\n \n Width set with styles\n \n
\n
\n\n### Light\n\nexport const snippetsLight = [\n {\n language: \"Web component\",\n snippet: `\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n \n\n`,\n },\n];\n\n\n
\n \n \n \n \n \n
\n
\n\n### Within IcCard component\n\nexport const snippetsInCard = [\n {\n language: \"Web component\",\n snippet: `
\n
\n
\n \n \n \n \n \n Reload\n \n
\n `,\n },\n {\n language: \"React\",\n snippet: `const loading = () => {\n return (\n \n \n \n \n \n \n \n \n );\n};\nconst loaded = () => {\n return (\n \n \n \n \n
\n
\n Learn more\n Hide\n
\n \n );\n};\n const ContentFunction = () => {\n const [content, setContent] = React.useState(loading);\n const loadFunc = () => {\n setContent(loading);\n setTimeout(() => {\n setContent(loaded);\n }, 3000);\n };\n return (\n
\n {content}\n
\n {\n loadFunc();\n }}\n >\n \n \n \n \n Refresh\n \n
\n );\n};`,\n },\n];\n\nexport const loading = () => (\n \n \n \n \n \n \n \n \n);\n\nexport const loaded = () => (\n \n \n \n
\n
\n Accept\n Cancel\n
\n \n);\n\nexport const ContentFunction = () => {\n const [content, setContent] = React.useState(loaded);\n const loadFunc = () => {\n setContent(loading);\n setTimeout(() => {\n setContent(loaded);\n }, 3000);\n };\n return (\n
\n {content}\n
\n {\n loadFunc();\n }}\n >\n \n \n \n \n Refresh\n \n
\n );\n};\n\n\n \n\n", + "contents": "\nimport {\n IcSkeleton,\n IcTypography,\n IcCard,\n IcButton,\n SlottedSVG,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n \n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n \n \n
\n
\n\n## Skeleton details\n\n\n\n## Variants\n\n### Inherited size from child\n\nexport const snippetsInherited = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
Test text
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
Test text
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Test text\n \n \n\n\n### Set width and height\n\nexport const snippetsSetWidthAndHeight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Height and width set with styles\n\nHeight set with styles\n\nWidth set with styles\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Height and width set with styles\n\nHeight set with styles\n\nWidth set with styles\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n Height and width set with styles\n \n Height set with styles\n \n Width set with styles\n \n
\n
\n\n### Light\n\nexport const snippetsLight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n \n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n \n \n
\n
\n\n### Within IcCard component\n\nexport const snippetsInCard = [\n {\n technology: \"Web component\",\n snippets: {\n short: `
\n
\n
\n \n \n \n \n \n Reload\n \n
\n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const loading = () => {\n return (\n \n \n \n \n \n \n \n \n );\n};\nconst loaded = () => {\n return (\n \n \n \n \n
\n
\n Learn more\n Hide\n
\n \n );\n};\n const ContentFunction = () => {\n const [content, setContent] = React.useState(loading);\n const loadFunc = () => {\n setContent(loading);\n setTimeout(() => {\n setContent(loaded);\n }, 3000);\n };\n return (\n
\n {content}\n
\n {\n loadFunc();\n }}\n >\n \n \n \n \n Refresh\n \n
\n );\n};`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const loading = () => (\n \n \n \n \n \n \n \n \n);\n\nexport const loaded = () => (\n \n \n \n
\n
\n Accept\n Cancel\n
\n \n);\n\nexport const ContentFunction = () => {\n const [content, setContent] = React.useState(loaded);\n const loadFunc = () => {\n setContent(loading);\n setTimeout(() => {\n setContent(loaded);\n }, 3000);\n };\n return (\n
\n {content}\n
\n {\n loadFunc();\n }}\n >\n \n \n \n \n Refresh\n \n
\n );\n};\n\n\n \n\n", "path": "/components/skeleton/code", "date": "2023-10-24", "title": "Skeleton", @@ -3118,10 +3118,10 @@ ], "meta": { "relativePath": "components/skeleton/code.mdx", - "createdAt": "2024-04-08T22:24:28.552Z", - "lastModified": "2024-04-08T22:24:28.552Z", - "size": 13492, - "formattedSize": "13.2 KB" + "createdAt": "2024-04-08T22:26:50.784Z", + "lastModified": "2024-04-08T22:26:50.784Z", + "size": 14882, + "formattedSize": "14.5 KB" } }, { @@ -3189,7 +3189,7 @@ }, { "id": "components__status-tags__codex", - "contents": "\nimport { IcStatusTag } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n \n \n \n \n\n\n## Status tag details\n\n\n\n## Variants\n\n### Emphasis\n\nexport const snippetsEmphasis = [\n {\n language: \"Web component\",\n snippet: `\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n \n \n \n \n\n\n### Small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: `\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n \n \n \n \n\n", + "contents": "\nimport { IcStatusTag } from \"@ukic/react\";\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n## Status tag details\n\n\n\n## Variants\n\n### Emphasis\n\nexport const snippetsEmphasis = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n", "path": "/components/status-tag/code", "date": "2023-10-24", "title": "Status tag", @@ -3212,10 +3212,10 @@ ], "meta": { "relativePath": "components/status-tags/code.mdx", - "createdAt": "2024-04-08T22:24:28.552Z", - "lastModified": "2024-04-08T22:24:28.552Z", - "size": 3729, - "formattedSize": "3.6 KB" + "createdAt": "2024-04-08T22:26:50.784Z", + "lastModified": "2024-04-08T22:26:50.784Z", + "size": 4544, + "formattedSize": "4.4 KB" } }, { @@ -3283,7 +3283,7 @@ }, { "id": "components__stepper__codex", - "contents": "\nimport { IcStepper, IcStep } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n## Step details\n\n\n\n## Stepper details\n\n\n\n## Variants\n\n### Compact stepper\n\nexport const compactStepper = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Left-aligned\n\nexport const leftAligned = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### With hidden step information\n\nexport const hiddenStepInfo = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### With subtitles\n\nexport const withSubtitles = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Custom connector width\n\nexport const customConnectorWidth = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n", + "contents": "\nimport { IcStepper, IcStep } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n## Step details\n\n\n\n## Stepper details\n\n\n\n## Variants\n\n### Compact stepper\n\nexport const compactStepper = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Left-aligned\n\nexport const leftAligned = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### With hidden step information\n\nexport const hiddenStepInfo = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### With subtitles\n\nexport const withSubtitles = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Custom connector width\n\nexport const customConnectorWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n", "path": "/components/stepper/code", "date": "2023-02-03", "title": "Stepper", @@ -3306,10 +3306,10 @@ ], "meta": { "relativePath": "components/stepper/code.mdx", - "createdAt": "2024-04-08T22:24:28.552Z", - "lastModified": "2024-04-08T22:24:28.552Z", - "size": 6694, - "formattedSize": "6.5 KB" + "createdAt": "2024-04-08T22:26:50.784Z", + "lastModified": "2024-04-08T22:26:50.784Z", + "size": 8362, + "formattedSize": "8.2 KB" } }, { @@ -3377,7 +3377,7 @@ }, { "id": "components__switch__codex", - "contents": "\nimport { IcSwitch } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log({ \n checked: ev.detail.checked, \n value: ev.detail.value\n })}\n/>`,\n },\n];\n\n\n \n console.log({\n checked: ev.detail.checked,\n value: ev.detail.value,\n })\n }\n />\n\n\n## Switch details\n\n\n\n## Variants\n\n### State\n\nexport const snippetsState = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: ``,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: `\n`,\n },\n];\n\n\n
\n \n \n
\n
\n\n### Helper text and right adornment\n\nexport const snippetsHelperAndAdornment = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n
\n`,\n },\n];\n\n\n \n \n \n \n \n\n", + "contents": "\nimport { IcSwitch } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log({ \n checked: ev.detail.checked, \n value: ev.detail.value\n })}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n console.log({\n checked: ev.detail.checked,\n value: ev.detail.value,\n })\n }\n />\n\n\n## Switch details\n\n\n\n## Variants\n\n### State\n\nexport const snippetsState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n
\n
\n\n### Helper text and right adornment\n\nexport const snippetsHelperAndAdornment = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n", "path": "/components/switch/code", "date": "2023-10-24", "title": "Switch", @@ -3400,10 +3400,10 @@ ], "meta": { "relativePath": "components/switch/code.mdx", - "createdAt": "2024-04-08T22:24:28.552Z", - "lastModified": "2024-04-08T22:24:28.552Z", - "size": 4428, - "formattedSize": "4.3 KB" + "createdAt": "2024-04-08T22:26:50.788Z", + "lastModified": "2024-04-08T22:26:50.788Z", + "size": 5818, + "formattedSize": "5.7 KB" } }, { @@ -3471,7 +3471,7 @@ }, { "id": "components__tabs__codex", - "contents": "\nimport { IcTab, IcTabContext, IcTabGroup, IcTabPanel } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev.detail.tabIndex)}>\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n];\n\n\n console.log(ev.detail.tabIndex)}>\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n## Tab details\n\n\n\n## Tab context details\n\n\n\n## Tab list details\n\n\n\n## Tab panel details\n\n\n\n## Variants\n\n### With icons\n\nexport const withIcons = [\n {\n language: \"Web component\",\n snippet: `\n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n Ingredients\n \n \n
\n \n \n Method\n \n \n
\n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n `,\n },\n];\n\n\n \n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n language: \"Web component\",\n snippet: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Light\n\nexport const light = [\n {\n language: \"Web component\",\n snippet: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Compact\n\nexport const compact = [\n {\n language: \"Web component\",\n snippet: `\n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n`,\n },\n {\n language: \"React\",\n snippet: `const compactStyle = {\n width: \"60%\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n }\nreturn (\n <>\n \n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n \n);`,\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n\n\n### Nested Tabs\n\nexport const nested = [\n {\n language: \"Web component\",\n snippet: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n },\n {\n language: \"React\",\n snippet: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n \n\n", + "contents": "\nimport { IcTab, IcTabContext, IcTabGroup, IcTabPanel } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.tabIndex)}>\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev.detail.tabIndex)}>\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n## Tab details\n\n\n\n## Tab context details\n\n\n\n## Tab list details\n\n\n\n## Tab panel details\n\n\n\n## Variants\n\n### With icons\n\nexport const withIcons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Light\n\nexport const light = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Compact\n\nexport const compact = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const compactStyle = {\n width: \"60%\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n }\nreturn (\n <>\n \n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n\n\n### Nested Tabs\n\nexport const nested = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n \n\n", "path": "/components/tabs/code", "date": "2024-02-02", "title": "Tabs", @@ -3494,10 +3494,10 @@ ], "meta": { "relativePath": "components/tabs/code.mdx", - "createdAt": "2024-04-08T22:24:28.552Z", - "lastModified": "2024-04-08T22:24:28.552Z", - "size": 14285, - "formattedSize": "14.0 KB" + "createdAt": "2024-04-08T22:26:50.788Z", + "lastModified": "2024-04-08T22:26:50.788Z", + "size": 15953, + "formattedSize": "15.6 KB" } }, { @@ -3565,7 +3565,7 @@ }, { "id": "components__text-field__codex", - "contents": "\nimport { IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev.detail.value)}\n/>`,\n },\n];\n\n\n console.log(ev.detail.value)}\n />\n\n\n## Text field details\n\n\n\n## Variants\n\n### With icon, value and max length\n\nexport const snippetsIconValueMaxLength = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(ev.detail.value)}\n/>`,\n },\n];\n\n\n console.log(ev.detail.value)}\n />\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n language: \"Web component\",\n snippet: `\n\n\n\n\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n
\n \n \n \n \n
\n
\n\n### With min and max values\n\nIn this example, an error message will display when the input is either below the min value or above the max value. This only affects numeric input fields.\n\nexport const snippetsMinMax = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n\n### Text area with resize\n\nexport const snippetsTextArea = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ``,\n },\n];\n\n\n \n\n", + "contents": "\nimport { IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev.detail.value)}\n />\n\n\n## Text field details\n\n\n\n## Variants\n\n### With icon, value and max length\n\nexport const snippetsIconValueMaxLength = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev.detail.value)}\n />\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n\n\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n \n
\n
\n\n### With min and max values\n\nIn this example, an error message will display when the input is either below the min value or above the max value. This only affects numeric input fields.\n\nexport const snippetsMinMax = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Text area with resize\n\nexport const snippetsTextArea = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n", "path": "/components/text-field/code", "date": "2023-10-25", "title": "Text field", @@ -3588,10 +3588,10 @@ ], "meta": { "relativePath": "components/text-field/code.mdx", - "createdAt": "2024-04-08T22:24:28.556Z", - "lastModified": "2024-04-08T22:24:28.556Z", - "size": 11660, - "formattedSize": "11.4 KB" + "createdAt": "2024-04-08T22:26:50.788Z", + "lastModified": "2024-04-08T22:26:50.788Z", + "size": 13606, + "formattedSize": "13.3 KB" } }, { @@ -3659,7 +3659,7 @@ }, { "id": "components__toasts__codex", - "contents": "\nimport {\n IcToast,\n IcToastRegion,\n IcButton,\n IcLink,\n SlottedSVG,\n} from \"@ukic/react\";\nimport { useRef } from \"react\";\n\nexport const defaultSnippet = [\n {\n language: \"Web component\",\n snippet: `Display toast\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display toast component\n \n \n \n \n)`,\n },\n];\n\n## Component demo\n\nexport const DefaultToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display toast component\n \n \n \n \n );\n};\n\n\n \n\n\n## Toast region details\n\n\n\n## Toast details\n\n\n\n## Variants\n\n### Displaying toasts\n\nUse the `openToast` prop on the toast region component to display a toast message. Do not use the `setVisible` method on the toast component as this does not work with the toast queuing functionality.\n\n### Queuing toasts\n\nTo view the toasts queuing in the following example, click each button to open a toast and then the dismiss button on the visible toast. Each toast will appear one after the other.\n\nexport const queuingSnippet = [\n {\n language: \"Web component\",\n snippet: `Display default toast\nDisplay error toast\nDisplay auto dismiss toast\n\n \n \n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst errorToastEl = useRef(null);\nconst autoDismissToastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n};\nconst handleErrorClick = () => {\n toastRegionEl.current.openToast = errorToastEl.current;\n};\nconst handleAutoDismissClick = () => {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n};\nreturn (\n <>\n
\n Display default toast\n Display error toast\n Display auto dismiss toast\n
\n \n \n \n \n \n \n);`,\n },\n];\n\nexport const QueuingToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const errorToastEl = useRef(null);\n const autoDismissToastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n const handleErrorClick = () => {\n toastRegionEl.current.openToast = errorToastEl.current;\n };\n const handleAutoDismissClick = () => {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n };\n return (\n <>\n
\n Display default toast\n Display error toast\n \n Display auto dismiss toast\n \n
\n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### Status variant\n\nexport const withVariantSnippet = [\n {\n language: \"Web component\",\n snippet: `Display success toast\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display success toast\n \n \n \n \n)`,\n },\n];\n\nexport const WithVariantToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display success toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Multi-line\n\nexport const withMultilineSnippet = [\n {\n language: \"Web component\",\n snippet: `Display multi-line toast\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display multi-line toast\n \n \n \n \n)`,\n },\n];\n\nexport const MultilineToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display multi-line toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Slotted 'action' toast\n\nexport const slottedActionsSnippet = [\n {\n language: \"Web component\",\n snippet: `Display slotted buttons toast\nDisplay slotted buttons toast\n\n \n Retry\n \n \n Retry\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst buttonToastEl = useRef(null);\nconst linkToastEl = useRef(null);\nconst handleButtonToastClick = () => {\n toastRegionEl.current.openToast = buttonToastEl.current;\n}\nconst handleLinkToastClick = () => {\n toastRegionEl.current.openToast = linkToastEl.current;\n}\nreturn (\n <>\n
\n Display slotted button toast\n Display slotted link toast\n
\n \n \n Retry\n \n \n Retry\n \n \n \n)`,\n },\n];\n\nexport const SlottedActionsToast = () => {\n const toastRegionEl = useRef(null);\n const buttonToastEl = useRef(null);\n const linkToastEl = useRef(null);\n const handleButtonToastClick = () => {\n toastRegionEl.current.openToast = buttonToastEl.current;\n };\n const handleLinkToastClick = () => {\n toastRegionEl.current.openToast = linkToastEl.current;\n };\n return (\n <>\n
\n \n Display slotted button toast\n \n \n Display slotted link toast\n \n
\n \n \n \n Retry\n \n \n \n \n Retry\n \n \n \n \n );\n};\n\n\n \n\n\n### Auto-dismiss\n\nexport const autoDismissSnippet = [\n {\n language: \"Web component\",\n snippet: `Display auto-dismiss toast\n\n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display auto-dismiss toast\n \n \n \n \n)`,\n },\n];\n\nexport const AutoDismissToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display auto-dismiss toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Custom neutral icon and aria-labels\n\nexport const customIconAriaLabelsSnippet = [\n {\n language: \"Web component\",\n snippet: `Display auto-dismiss toast\n\n \n \n coffee-outline\n \n \n \n\n`,\n },\n {\n language: \"React\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display custom icon and aria-label toast\n \n \n \n coffee-outline\n \n \n \n \n \n)`,\n },\n];\n\nexport const CustomIconAriaLabels = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n \n Display custom icon and aria-labels toast\n \n \n \n \n coffee-outline\n \n \n \n \n \n );\n};\n\n\n \n\n", + "contents": "\nimport {\n IcToast,\n IcToastRegion,\n IcButton,\n IcLink,\n SlottedSVG,\n} from \"@ukic/react\";\nimport { useRef } from \"react\";\n\nexport const defaultSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display toast\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display toast component\n \n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n## Component demo\n\nexport const DefaultToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display toast component\n \n \n \n \n );\n};\n\n\n \n\n\n## Toast region details\n\n\n\n## Toast details\n\n\n\n## Variants\n\n### Displaying toasts\n\nUse the `openToast` prop on the toast region component to display a toast message. Do not use the `setVisible` method on the toast component as this does not work with the toast queuing functionality.\n\n### Queuing toasts\n\nTo view the toasts queuing in the following example, click each button to open a toast and then the dismiss button on the visible toast. Each toast will appear one after the other.\n\nexport const queuingSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display default toast\nDisplay error toast\nDisplay auto dismiss toast\n\n \n \n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst errorToastEl = useRef(null);\nconst autoDismissToastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n};\nconst handleErrorClick = () => {\n toastRegionEl.current.openToast = errorToastEl.current;\n};\nconst handleAutoDismissClick = () => {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n};\nreturn (\n <>\n
\n Display default toast\n Display error toast\n Display auto dismiss toast\n
\n \n \n \n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const QueuingToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const errorToastEl = useRef(null);\n const autoDismissToastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n const handleErrorClick = () => {\n toastRegionEl.current.openToast = errorToastEl.current;\n };\n const handleAutoDismissClick = () => {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n };\n return (\n <>\n
\n Display default toast\n Display error toast\n \n Display auto dismiss toast\n \n
\n \n \n \n \n \n \n );\n};\n\n\n \n\n\n### Status variant\n\nexport const withVariantSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display success toast\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display success toast\n \n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const WithVariantToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display success toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Multi-line\n\nexport const withMultilineSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display multi-line toast\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display multi-line toast\n \n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const MultilineToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display multi-line toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Slotted 'action' toast\n\nexport const slottedActionsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display slotted buttons toast\nDisplay slotted buttons toast\n\n \n Retry\n \n \n Retry\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst buttonToastEl = useRef(null);\nconst linkToastEl = useRef(null);\nconst handleButtonToastClick = () => {\n toastRegionEl.current.openToast = buttonToastEl.current;\n}\nconst handleLinkToastClick = () => {\n toastRegionEl.current.openToast = linkToastEl.current;\n}\nreturn (\n <>\n
\n Display slotted button toast\n Display slotted link toast\n
\n \n \n Retry\n \n \n Retry\n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const SlottedActionsToast = () => {\n const toastRegionEl = useRef(null);\n const buttonToastEl = useRef(null);\n const linkToastEl = useRef(null);\n const handleButtonToastClick = () => {\n toastRegionEl.current.openToast = buttonToastEl.current;\n };\n const handleLinkToastClick = () => {\n toastRegionEl.current.openToast = linkToastEl.current;\n };\n return (\n <>\n
\n \n Display slotted button toast\n \n \n Display slotted link toast\n \n
\n \n \n \n Retry\n \n \n \n \n Retry\n \n \n \n \n );\n};\n\n\n \n\n\n### Auto-dismiss\n\nexport const autoDismissSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display auto-dismiss toast\n\n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display auto-dismiss toast\n \n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const AutoDismissToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display auto-dismiss toast\n \n \n \n \n );\n};\n\n\n \n\n\n### Custom neutral icon and aria-labels\n\nexport const customIconAriaLabelsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display auto-dismiss toast\n\n \n \n coffee-outline\n \n \n \n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n}\nreturn (\n <>\n Display custom icon and aria-label toast\n \n \n \n coffee-outline\n \n \n \n \n \n)`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const CustomIconAriaLabels = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n \n Display custom icon and aria-labels toast\n \n \n \n \n coffee-outline\n \n \n \n \n \n );\n};\n\n\n \n\n", "path": "/components/toast/code", "date": "2023-11-09", "title": "Toast", @@ -3682,10 +3682,10 @@ ], "meta": { "relativePath": "components/toasts/code.mdx", - "createdAt": "2024-04-08T22:24:28.556Z", - "lastModified": "2024-04-08T22:24:28.556Z", - "size": 18111, - "formattedSize": "17.7 KB" + "createdAt": "2024-04-08T22:26:50.788Z", + "lastModified": "2024-04-08T22:26:50.788Z", + "size": 20057, + "formattedSize": "19.6 KB" } }, { @@ -3753,7 +3753,7 @@ }, { "id": "components__toggle-buttons__codex", - "contents": "\nimport {\n IcToggleButton,\n IcToggleButtonGroup,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n`,\n },\n {\n language: \"React\",\n snippet: ` console.log(event.detail.checked)}\n/>`,\n },\n];\n\n\n console.log(event.detail.checked)}\n />\n\n\n## Toggle button details\n\n\n\n## Toggle button group details\n\n\n\n## Variants\n\n### Other states\n\nexport const snippetsOtherStates = [\n {\n language: \"Web component\",\n snippet: `\n\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n\n`,\n },\n];\n\n\n \n \n \n \n\n\n### With icon\n\nexport const snippetsWithIcon = [\n {\n language: \"Web component\",\n snippet: `\n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n\n\n### Sizing\n\nexport const snippetsSizing = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n`,\n },\n];\n\n\n \n \n \n\n\n### With badge\n\nexport const snippetsWithBadge = [\n {\n language: \"Web component\",\n snippet: `\n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n`,\n },\n];\n\n\n \n \n \n\n\n### Dark\n\nexport const snippetsDark = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n`,\n },\n];\n\n\n \n \n \n\n\n### Light\n\nexport const snippetsLight = [\n {\n language: \"Web component\",\n snippet: `\n\n`,\n },\n {\n language: \"React\",\n snippet: `\n\n`,\n },\n];\n\n\n \n \n \n\n\n### Full width\n\nexport const snippetsFullWidth = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Icon only\n\nexport const snippetsIconOnly = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon right\n\nexport const snippetsIconRight = [\n {\n language: \"Web component\",\n snippet: ` \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: ` \n \n \n \n \n\n \n \n \n \n \n\n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon top\n\nexport const snippetsIconTopGroup = [\n {\n language: \"Web component\",\n snippet: ` \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: ` \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n", + "contents": "\nimport {\n IcToggleButton,\n IcToggleButtonGroup,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.checked)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(event.detail.checked)}\n />\n\n\n## Toggle button details\n\n\n\n## Toggle button group details\n\n\n\n## Variants\n\n### Other states\n\nexport const snippetsOtherStates = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### With icon\n\nexport const snippetsWithIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Sizing\n\nexport const snippetsSizing = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### With badge\n\nexport const snippetsWithBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Dark\n\nexport const snippetsDark = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Light\n\nexport const snippetsLight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Full width\n\nexport const snippetsFullWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Icon only\n\nexport const snippetsIconOnly = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon right\n\nexport const snippetsIconRight = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` \n \n \n \n \n\n \n \n \n \n \n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n\n### Icon top\n\nexport const snippetsIconTopGroup = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n", "path": "/components/toggle-button/code", "date": "2024-03-08", "title": "Toggle button", @@ -3776,10 +3776,10 @@ ], "meta": { "relativePath": "components/toggle-buttons/code.mdx", - "createdAt": "2024-04-08T22:24:28.556Z", - "lastModified": "2024-04-08T22:24:28.556Z", - "size": 20281, - "formattedSize": "19.8 KB" + "createdAt": "2024-04-08T22:30:28.888Z", + "lastModified": "2024-04-08T22:30:28.888Z", + "size": 23340, + "formattedSize": "22.8 KB" } }, { @@ -3847,7 +3847,7 @@ }, { "id": "components__tooltips__codex", - "contents": "\nimport { IcTooltip, IcButton, IcChip } from \"@ukic/react\";\nimport { useRef } from \"react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `\n Add\n\n\n Remove\n`,\n },\n {\n language: \"React\",\n snippet: `\n Add\n\n\n Remove\n`,\n },\n];\n\n\n
\n \n \n Add\n \n \n \n \n Remove\n \n \n
\n
\n\n## Tooltip details\n\n\n\n## Variants\n\n### Left placement\n\nexport const snippetsLeft = [\n {\n language: \"Web component\",\n snippet: `\n Add\n`,\n },\n {\n language: \"React\",\n snippet: `\n Add\n`,\n },\n];\n\n\n \n \n Add\n \n \n\n\n### Right placement\n\nexport const snippetsRight = [\n {\n language: \"Web component\",\n snippet: ` \n Add\n`,\n },\n {\n language: \"React\",\n snippet: `\n Add\n`,\n },\n];\n\n\n \n \n Add\n \n \n\n\n### Chip\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: ` \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Programmatic trigger\n\nexport const snippetsProgrammatic = [\n {\n language: \"Web component\",\n snippet: `\nShow tooltip\n\n \n Add\n \n`,\n },\n {\n language: \"React\",\n snippet: `let display = true;\nconst tooltipEl = useRef(null);\nconst handleDisplay = () => {\n tooltipEl.current.displayTooltip(display, display);\n display = !display;\n}\nreturn (\n <>\n Show tooltip\n \n \n Add\n \n \n \n);`,\n },\n];\n\nexport const TriggerExample = () => {\n let display = true;\n const tooltipEl = useRef(null);\n const handleDisplay = () => {\n tooltipEl.current.displayTooltip(display, display);\n display = !display;\n };\n return (\n <>\n Show tooltip\n \n \n Add\n \n \n \n );\n};\n\n\n \n\n", + "contents": "\nimport { IcTooltip, IcButton, IcChip } from \"@ukic/react\";\nimport { useRef } from \"react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Add\n\n\n Remove\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Add\n\n\n Remove\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n Add\n \n \n \n \n Remove\n \n \n
\n
\n\n## Tooltip details\n\n\n\n## Variants\n\n### Left placement\n\nexport const snippetsLeft = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Add\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Add\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Add\n \n \n\n\n### Right placement\n\nexport const snippetsRight = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n Add\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Add\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Add\n \n \n\n\n### Chip\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n\n\n### Programmatic trigger\n\nexport const snippetsProgrammatic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\nShow tooltip\n\n \n Add\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `let display = true;\nconst tooltipEl = useRef(null);\nconst handleDisplay = () => {\n tooltipEl.current.displayTooltip(display, display);\n display = !display;\n}\nreturn (\n <>\n Show tooltip\n \n \n Add\n \n \n \n);`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const TriggerExample = () => {\n let display = true;\n const tooltipEl = useRef(null);\n const handleDisplay = () => {\n tooltipEl.current.displayTooltip(display, display);\n display = !display;\n };\n return (\n <>\n Show tooltip\n \n \n Add\n \n \n \n );\n};\n\n\n \n\n", "path": "/components/tooltip/code", "date": "2024-02-02", "title": "Tooltip", @@ -3870,10 +3870,10 @@ ], "meta": { "relativePath": "components/tooltips/code.mdx", - "createdAt": "2024-04-08T22:24:28.556Z", - "lastModified": "2024-04-08T22:24:28.556Z", - "size": 7782, - "formattedSize": "7.6 KB" + "createdAt": "2024-04-08T22:26:50.792Z", + "lastModified": "2024-04-08T22:26:50.792Z", + "size": 9172, + "formattedSize": "9.0 KB" } }, { @@ -3941,7 +3941,7 @@ }, { "id": "components__top-nav__codex", - "contents": "\nimport {\n IcTopNavigation,\n IcSearchBar,\n IcNavigationButton,\n IcNavigationItem,\n IcNavigationGroup,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n## Top navigation details\n\n\n\n## Navigation group details\n\n\n\n## Navigation item details\n\n\n\n## Navigation button details\n\n\n\n## Variants\n\n### Grouped links\n\nexport const snippetsGroupedLinks = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n \n\n\n### Centre aligned\n\nexport const snippetsCentreAligned = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### Left aligned\n\nexport const snippetsLeftAligned = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With badge on navigation button\n\nexport const snippetsBadge = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With short app title\n\nView on a small screen size to display the short title in place of the app title.\n\nexport const snippetsShortTitle = [\n {\n language: \"Web component\",\n snippet: `\n \n \n \n \n \n \n \n \n \n`,\n },\n {\n language: \"React\",\n snippet: `\n \n \n \n \n \n \n \n \n \n`,\n },\n];\n\n\n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With React Router (using slots)\n\nThe following example also demonstrates using a slotted link for app title, short app title, and app icon.\n\nTo guarantee the correct styling for non-svg content slotted into app-icon, set `width`, `height` and `fill` to `inherit`.\n\nexport const withReactRouter = [\n {\n language: \"React\",\n snippet: `\n \n ICDS Title\n ICDS\n \n \n \n \n \n \n \n alert('test')}>\n \n \n \n \n \n \n Get started\n \n \n Accessibility\n \n \n
\n \n \n This is the get started page} />\n This page is about accessibility} />\n \n \n
\n
\n `,\n },\n];\n\n\n \n \n \n ICDS Title\n \n \n ICDS\n \n \n \n \n \n \n \n \n alert(\"test\")}\n >\n \n \n \n \n \n \n \n Get started\n \n \n \n \n Accessibility\n \n \n \n \n\n", + "contents": "\nimport {\n IcTopNavigation,\n IcSearchBar,\n IcNavigationButton,\n IcNavigationItem,\n IcNavigationGroup,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Javascript\",\n snippet: `js import { IcTopNavigation, IcSearchBar, IcNavigationButton, IcNavigationItem, SlottedSVG } from \"@ukic/react\";`,\n },\n {\n language: \"Typescript\",\n snippet: `ts import { IcTopNavigation, IcSearchBar, IcNavigationButton, IcNavigationItem, SlottedSVG } from \"@ukic/react\";`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n## Top navigation details\n\n\n\n## Navigation group details\n\n\n\n## Navigation item details\n\n\n\n## Navigation button details\n\n\n\n## Variants\n\n### Grouped links\n\nexport const snippetsGroupedLinks = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n \n \n\n\n### Centre aligned\n\nexport const snippetsCentreAligned = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### Left aligned\n\nexport const snippetsLeftAligned = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With badge on navigation button\n\nexport const snippetsBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With short app title\n\nView on a small screen size to display the short title in place of the app title.\n\nexport const snippetsShortTitle = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n />\n e.preventDefault()}\n selected\n />\n e.preventDefault()}\n />\n \n\n\n### With React Router (using slots)\n\nThe following example also demonstrates using a slotted link for app title, short app title, and app icon.\n\nTo guarantee the correct styling for non-svg content slotted into app-icon, set `width`, `height` and `fill` to `inherit`.\n\nexport const withReactRouter = [\n {\n technology: \"React\",\n snippets: {\n short: `\n \n ICDS Title\n ICDS\n \n \n \n \n \n \n \n alert('test')}>\n \n \n \n \n \n \n Get started\n \n \n Accessibility\n \n \n
\n \n \n This is the get started page} />\n This page is about accessibility} />\n \n \n
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n ICDS Title\n \n \n ICDS\n \n \n \n \n \n \n \n \n alert(\"test\")}\n >\n \n \n \n \n \n \n \n Get started\n \n \n \n \n Accessibility\n \n \n \n \n\n", "path": "/components/top-navigation/code", "date": "2024-02-02", "title": "Top navigation", @@ -3964,10 +3964,10 @@ ], "meta": { "relativePath": "components/top-nav/code.mdx", - "createdAt": "2024-04-08T22:24:28.560Z", - "lastModified": "2024-04-08T22:24:28.560Z", - "size": 34621, - "formattedSize": "33.8 KB" + "createdAt": "2024-04-08T22:26:50.792Z", + "lastModified": "2024-04-08T22:26:50.792Z", + "size": 36712, + "formattedSize": "35.9 KB" } }, { @@ -4036,7 +4036,7 @@ }, { "id": "components__typography__codex", - "contents": "\nimport { IcTypography } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n language: \"Web component\",\n snippet: `H1\nH2\nH3\nH4\nBody\nSubtitle large\nSubtitle small\nLabel\nLabel uppercase\nCaption\nCaption uppercase\nCode large\nCode small\nCode extra small`,\n },\n {\n language: \"React\",\n snippet: `H1\nH2\nH3\nH4\nBody\nSubtitle large\nSubtitle small\nLabel\nLabel uppercase\nCaption\nCaption uppercase\nCode large\nCode small\nCode extra small`,\n },\n];\n\n\n
\n H1\n H2\n H3\n H4\n Body\n Subtitle large\n Subtitle small\n Label\n Label uppercase\n Caption\n Caption uppercase\n Code large\n Code small\n Code extra small\n
\n
\n\n## Typography details\n\n\n\n## Variants\n\n### Re-styled typography\n\nAdd a variant to the typography element to change its style. This does not change the semantic level of the typography element.\n\nexport const snippetsRestyled = [\n {\n language: \"Web component\",\n snippet: `\n
H5 with H2 styling
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n
H5 with H2 styling
\n
`,\n },\n];\n\n\n \n
H5 with H2 styling
\n
\n
\n\n### Vertical margins applied\n\nexport const spacingSnippets = [\n {\n language: \"Web component\",\n snippet: `\n
H5 with margins applied
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n
H5 with margins applied
\n
`,\n },\n];\n\n\n \n
H5 with margins applied
\n
\n
\n\n### Vertical margins applied on re-styled typography\n\nexport const spacingRestyledSnippets = [\n {\n language: \"Web component\",\n snippet: `\n
H5 with H2 styling and margins applied
\n
`,\n },\n {\n language: \"React\",\n snippet: `\n
H5 with H2 styling and margins applied
\n
`,\n },\n];\n\n\n \n
H5 with H2 styling and margins applied
\n
\n
\n\n### Truncation\n\nText can be truncated to a maximum number of lines when using `variant=\"body\"`.\n\nexport const truncationSnippets = [\n {\n language: \"Web component\",\n snippet: `\n Body of text that is truncated to three lines. Click the 'See more' link\n to expand the text, then click 'See less' to truncate the text once\n more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au\n lait. Con panna, cup, cream, body americano affogato cup espresso, rich\n milk seasonal saucer grinder spoon that cultivar strong redeye\n frappuccino barista extraction redeye mazagran. Grounds, french press\n dripper organic and foam id saucer, crema, black rich dark, grounds\n breve coffee steamed caramelization percolator.\n
`,\n },\n {\n language: \"React\",\n snippet: `\n Body of text that is truncated to three lines. Click the 'See more' link\n to expand the text, then click 'See less' to truncate the text once\n more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au\n lait. Con panna, cup, cream, body americano affogato cup espresso, rich\n milk seasonal saucer grinder spoon that cultivar strong redeye\n frappuccino barista extraction redeye mazagran. Grounds, french press\n dripper organic and foam id saucer, crema, black rich dark, grounds\n breve coffee steamed caramelization percolator.\n
`,\n },\n];\n\n\n \n Body of text that is truncated to three lines. Click the 'See more' link to\n expand the text, then click 'See less' to truncate the text once more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au lait.\n Con panna, cup, cream, body americano affogato cup espresso, rich milk\n seasonal saucer grinder spoon that cultivar strong redeye frappuccino\n barista extraction redeye mazagran. Grounds, french press dripper organic\n and foam id saucer, crema, black rich dark, grounds breve coffee steamed\n caramelization percolator.\n
\n
\n\n### Additional styling\n\nexport const additionalStylingSnippets = [\n {\n language: \"Web component\",\n snippet: `Bold\nItalic\nUnderline\nStrikethrough`,\n },\n {\n language: \"React\",\n snippet: `Bold\nItalic\nUnderline\nStrikethrough`,\n },\n];\n\n\n
\n \n Bold\n \n \n Italic\n \n \n Underline\n \n \n Strikethrough\n \n
\n
\n", + "contents": "\nimport { IcTypography } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `H1\nH2\nH3\nH4\nBody\nSubtitle large\nSubtitle small\nLabel\nLabel uppercase\nCaption\nCaption uppercase\nCode large\nCode small\nCode extra small`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `H1\nH2\nH3\nH4\nBody\nSubtitle large\nSubtitle small\nLabel\nLabel uppercase\nCaption\nCaption uppercase\nCode large\nCode small\nCode extra small`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n H1\n H2\n H3\n H4\n Body\n Subtitle large\n Subtitle small\n Label\n Label uppercase\n Caption\n Caption uppercase\n Code large\n Code small\n Code extra small\n
\n
\n\n## Typography details\n\n\n\n## Variants\n\n### Re-styled typography\n\nAdd a variant to the typography element to change its style. This does not change the semantic level of the typography element.\n\nexport const snippetsRestyled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
H5 with H2 styling
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
H5 with H2 styling
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
H5 with H2 styling
\n
\n
\n\n### Vertical margins applied\n\nexport const spacingSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
H5 with margins applied
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
H5 with margins applied
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
H5 with margins applied
\n
\n
\n\n### Vertical margins applied on re-styled typography\n\nexport const spacingRestyledSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
H5 with H2 styling and margins applied
\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n
H5 with H2 styling and margins applied
\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n
H5 with H2 styling and margins applied
\n
\n
\n\n### Truncation\n\nText can be truncated to a maximum number of lines when using `variant=\"body\"`.\n\nexport const truncationSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Body of text that is truncated to three lines. Click the 'See more' link\n to expand the text, then click 'See less' to truncate the text once\n more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au\n lait. Con panna, cup, cream, body americano affogato cup espresso, rich\n milk seasonal saucer grinder spoon that cultivar strong redeye\n frappuccino barista extraction redeye mazagran. Grounds, french press\n dripper organic and foam id saucer, crema, black rich dark, grounds\n breve coffee steamed caramelization percolator.\n
`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Body of text that is truncated to three lines. Click the 'See more' link\n to expand the text, then click 'See less' to truncate the text once\n more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au\n lait. Con panna, cup, cream, body americano affogato cup espresso, rich\n milk seasonal saucer grinder spoon that cultivar strong redeye\n frappuccino barista extraction redeye mazagran. Grounds, french press\n dripper organic and foam id saucer, crema, black rich dark, grounds\n breve coffee steamed caramelization percolator.\n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Body of text that is truncated to three lines. Click the 'See more' link to\n expand the text, then click 'See less' to truncate the text once more!\n
\n Dripper caramelization java saucer grounds galão, mocha, and robusta\n kopi-luwak, percolator, instant, qui saucer latte in brewed café au lait.\n Con panna, cup, cream, body americano affogato cup espresso, rich milk\n seasonal saucer grinder spoon that cultivar strong redeye frappuccino\n barista extraction redeye mazagran. Grounds, french press dripper organic\n and foam id saucer, crema, black rich dark, grounds breve coffee steamed\n caramelization percolator.\n
\n
\n\n### Additional styling\n\nexport const additionalStylingSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Bold\nItalic\nUnderline\nStrikethrough`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Bold\nItalic\nUnderline\nStrikethrough`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n
\n \n Bold\n \n \n Italic\n \n \n Underline\n \n \n Strikethrough\n \n
\n
\nimport {createWebComponentsIndexHTML} from \"../../patterns/components/StackblitzButton/stackblitz-helpers\"\n", "path": "/components/typography/code", "date": "2023-11-27", "title": "Typography", @@ -4060,10 +4060,10 @@ ], "meta": { "relativePath": "components/typography/code.mdx", - "createdAt": "2024-04-08T22:24:28.560Z", - "lastModified": "2024-04-08T22:24:28.560Z", - "size": 8635, - "formattedSize": "8.4 KB" + "createdAt": "2024-04-08T22:26:50.796Z", + "lastModified": "2024-04-08T22:26:50.796Z", + "size": 10410, + "formattedSize": "10.2 KB" } }, { @@ -4552,7 +4552,7 @@ }, { "id": "patterns__side-navigation-layoutx", - "contents": "\nimport { IcLink } from \"@ukic/react\";\nimport {\n createReactAppTsx,\n createWebComponentsIndexHTML,\n} from \"./components/StackblitzButton/stackblitz-helpers\";\nimport sideNavigationPatternFig1 from \"./images/fig-1-example-of-theming-applied-to-side-navigation-layout.png\";\n\n## Introduction\n\nexport const snippetsSideNav = [\n {\n language: \"Web component\",\n snippet: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n height: \"800px\",\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\" },\n });\n const classes = useStyles();\n const alignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
)`,\n \"SideNavigationPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\nThis pattern includes the components:\n\n- [Side navigation](/components/side-navigation)\n- [Section container](/components/section-container)\n- [Footer](/components/footer)\n- [Classification banner](/components/classification-banner)\n\nWith options for:\n\n- [Page header](/components/page-header)\n- [Back to top](/components/back-to-top)\n\n## When to use\n\nWhen choosing a layout pattern, make sure it works for all pages within your app and avoid switching layout patterns on different pages.\n\nUse the side navigation layout to help provide more screen space for main content. Side navigation is well suited to apps that have mutually exclusive features which need to be switched between easily from any page. For example, email providers often use side navigation to provide maximum screen space to email content whilst allowing constant access to other pages.\n\n## When not to use\n\nFor intranet-style and content heavy apps, use the top navigation layout as it's better suited for providing links to a large number of pages.\n\nUse either the top navigation layout or the side navigation layout. Don't use both at the same time.\n\n## Implementation\n\nMake sure the pattern always fits the entire viewport and is never within another page container. The pattern content will adapt responsively when the viewport changes.\n\nAlways place the footer at the bottom of the page and below the fold meaning users should scroll to see it.\n\n## Variants\n\nUse the side navigation layout with additional components including page header to create other common layouts.\n\n### Page header\n\nUse a page header to display an introduction to the content of the page. Add additional elements to provide actions, navigation or inputs at the page level.\n\nFor more information, see the [page header component](/components/page-header).\n\nexport const snippetsSideNavWithPageHeader = [\n {\n language: \"Web component\",\n snippet: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n Tertiary button\n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n height: \"800px\",\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\" },\n inputArea: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-md)\",\n \"@media screen and (max-width: 320px)\": {\n gap: \"var(--ic-space-xs)\",\n },\n },\n textField: {\n \"--input-width\": \"21.5rem\",\n \"@media screen and (max-width: 768px)\": {\n \"--input-width\": \"100%\",\n flex: \"1 1 0\",\n },\n },\n });\n const classes = useStyles();\n const alignment = \"center\";\n const pageHeaderAlignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n \n Tertiary button\n \n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
\n )`,\n \"SideNavigationWithPageHeaderPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Back to top\n\nUse the back to top component to help people quickly return to the top of a long page.\n\nConsider using it on all apps to improve usability for everyone, including keyboard-only and some assistive technology users.\n\nDon't use back to top when the page is designed to fill the viewport without scrolling.\n\nFor more information, see the [back to top component](/components/back-to-top).\n\nexport const snippetsSideNavBackToTop = [\n {\n language: \"Web component\",\n snippet: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles();\n const alignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n \n
\n \n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
\n )`,\n \"SideNavigationWithBackToTopPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n## Customisation\n\nThis pattern can be themed to change the look and feel of the app. Use the [custom theme](/get-started/install-components/custom-theme) guidance to change your app's theme. Make sure to select your theme in line with the accessibility requirements around colour contrast.\n\n\n\n## Accessibility considerations\n\nWhen configuring a page make sure to follow all [accessibility guidance](/accessibility). Most accessibility requirements are covered by the individual components. For further accessibility information see the individual component pages.\n\nWe’ve tested this pattern against WCAG 2.1 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\n\n## Related patterns\n\n- [Top navigation layout](/patterns/navigation-patterns/top-navigation-layout)\n", + "contents": "\nimport { IcLink } from \"@ukic/react\";\nimport {\n createReactAppTsx,\n createWebComponentsIndexHTML,\n} from \"./components/StackblitzButton/stackblitz-helpers\";\nimport sideNavigationPatternFig1 from \"./images/fig-1-example-of-theming-applied-to-side-navigation-layout.png\";\n\n## Introduction\n\nexport const snippetsSideNav = [\n {\n technology: \"Web component\",\n snippets: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n height: \"800px\",\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\" },\n });\n const classes = useStyles();\n const alignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
)`,\n \"SideNavigationPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\nThis pattern includes the components:\n\n- [Side navigation](/components/side-navigation)\n- [Section container](/components/section-container)\n- [Footer](/components/footer)\n- [Classification banner](/components/classification-banner)\n\nWith options for:\n\n- [Page header](/components/page-header)\n- [Back to top](/components/back-to-top)\n\n## When to use\n\nWhen choosing a layout pattern, make sure it works for all pages within your app and avoid switching layout patterns on different pages.\n\nUse the side navigation layout to help provide more screen space for main content. Side navigation is well suited to apps that have mutually exclusive features which need to be switched between easily from any page. For example, email providers often use side navigation to provide maximum screen space to email content whilst allowing constant access to other pages.\n\n## When not to use\n\nFor intranet-style and content heavy apps, use the top navigation layout as it's better suited for providing links to a large number of pages.\n\nUse either the top navigation layout or the side navigation layout. Don't use both at the same time.\n\n## Implementation\n\nMake sure the pattern always fits the entire viewport and is never within another page container. The pattern content will adapt responsively when the viewport changes.\n\nAlways place the footer at the bottom of the page and below the fold meaning users should scroll to see it.\n\n## Variants\n\nUse the side navigation layout with additional components including page header to create other common layouts.\n\n### Page header\n\nUse a page header to display an introduction to the content of the page. Add additional elements to provide actions, navigation or inputs at the page level.\n\nFor more information, see the [page header component](/components/page-header).\n\nexport const snippetsSideNavWithPageHeader = [\n {\n technology: \"Web component\",\n snippets: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n Tertiary button\n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n height: \"800px\",\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\" },\n inputArea: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-md)\",\n \"@media screen and (max-width: 320px)\": {\n gap: \"var(--ic-space-xs)\",\n },\n },\n textField: {\n \"--input-width\": \"21.5rem\",\n \"@media screen and (max-width: 768px)\": {\n \"--input-width\": \"100%\",\n flex: \"1 1 0\",\n },\n },\n });\n const classes = useStyles();\n const alignment = \"center\";\n const pageHeaderAlignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n \n Tertiary button\n \n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
\n )`,\n \"SideNavigationWithPageHeaderPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Back to top\n\nUse the back to top component to help people quickly return to the top of a long page.\n\nConsider using it on all apps to improve usability for everyone, including keyboard-only and some assistive technology users.\n\nDon't use back to top when the page is designed to fill the viewport without scrolling.\n\nFor more information, see the [back to top component](/components/back-to-top).\n\nexport const snippetsSideNavBackToTop = [\n {\n technology: \"Web component\",\n snippets: createWebComponentsIndexHTML(`
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n \n
\n
`),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const useStyles = createUseStyles({\n contentDivContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n flexGrow: \"1\",\n },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n parentDiv: { display: \"flex\", height: \"100%\" },\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles();\n const alignment = \"center\";\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in\n IcSectionContainer.\n

\n
\n
\n \n
\n \n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n
\n
\n )`,\n \"SideNavigationWithBackToTopPattern\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n## Customisation\n\nThis pattern can be themed to change the look and feel of the app. Use the [custom theme](/get-started/install-components/custom-theme) guidance to change your app's theme. Make sure to select your theme in line with the accessibility requirements around colour contrast.\n\n\n\n## Accessibility considerations\n\nWhen configuring a page make sure to follow all [accessibility guidance](/accessibility). Most accessibility requirements are covered by the individual components. For further accessibility information see the individual component pages.\n\nWe’ve tested this pattern against WCAG 2.1 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\n\n## Related patterns\n\n- [Top navigation layout](/patterns/navigation-patterns/top-navigation-layout)\n", "path": "/patterns/navigation-patterns/side-navigation-layout", "navPriority": 2, "date": "2024-03-25", @@ -4561,9 +4561,9 @@ "contribute": "https://github.com/mi6/ic-design-system/tree/main/src/content/structured/patterns/navigation-patterns/side-navigation-layout.mdx", "meta": { "relativePath": "patterns/side-navigation-layout.mdx", - "createdAt": "2024-04-08T22:26:00.520Z", - "lastModified": "2024-04-08T22:26:00.520Z", - "size": 62900, + "createdAt": "2024-04-08T22:26:50.800Z", + "lastModified": "2024-04-08T22:26:50.800Z", + "size": 62918, "formattedSize": "61.4 KB" } }, @@ -4586,7 +4586,7 @@ }, { "id": "patterns__top-navigation-layoutx", - "contents": "\nimport { IcLink } from \"@ukic/react\";\n\nimport {\n createReactAppTsx,\n createWebComponentsIndexHTML,\n} from \"./components/StackblitzButton/stackblitz-helpers\";\n\nimport topNavigationPatternFig1 from \"./images/fig-1-example-of-theming-applied-to-top-navigation-layout@2x.png\";\n\n## Introduction\n\nexport const snippetsTopNav = [\n {\n language: \"Web component\",\n snippet:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigation\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\nThis pattern includes the components:\n\n- [Top navigation](/components/top-navigation)\n- [Section container](/components/section-container)\n- [Footer](/components/footer)\n- [Classification banner](/components/classification-banner)\n\nWith options for:\n\n- [Page header](/components/page-header)\n- [Mega-menu](/components/top-navigation)\n- [Back to top](/components/back-to-top)\n\n## When to use\n\nWhen choosing a layout pattern, make sure it works for all pages within your app and avoid switching layouts on different pages.\n\nUse the top navigation layout for article pages or content heavy apps with lots of text.\n\nUse the top navigation layout with a mega-menu for access to a large range of navigation items.\n\nUse a mega-menu for apps with complex page structures where every page should be accessible from any other page through the mega-menu. For example, department stores or supermarkets use a top navigation with mega-menu to provide access to their large number of product categories.\n\n## When not to use\n\nFor apps that require constant access to switch between pages, use side navigation as it's better suited for providing quick access and maximising the screen space for page content.\n\nUse either the top navigation layout or the side navigation layout. Don't use both at the same time.\n\n## Implementation\n\nMake sure the pattern always fits the entire viewport and is never within another page container. The pattern content will adapt responsively when the viewport changes.\n\nAlways place the footer at the bottom of the page and below the fold meaning users should\nscroll to see it.\n\n## Variants\n\nUse the top navigation layout with additional components including page header to create other common layouts.\n\n### Page header\n\nUse a page header to display an introduction to the content of the page. Add additional elements to provide actions, navigation or inputs at the page level.\n\nFor more information, see the [page header component](/components/page-header).\n\nexport const snippetsTopNavPageHeader = [\n {\n language: \"Web component\",\n snippet:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n Tertiary button\n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n let pageHeaderAlignment;\n // pageHeaderAlignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n inputArea: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-md)\",\n \"@media screen and (max-width: 320px)\": {\n gap: \"var(--ic-space-xs)\",\n },\n },\n textField: {\n \"--input-width\": \"21.5rem\",\n \"@media screen and (max-width: 768px)\": {\n \"--input-width\": \"100%\",\n flex: \"1 1 0\",\n },\n },\n });\n const classes = useStyles();\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n \n Tertiary button\n \n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithPageHeader\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Mega-menu\n\nUse a top navigation with a mega-menu for apps with more than eight navigation options or options that can be grouped into categories. The main link groups are displayed in the top navigation and open a mega-menu when hovered over or focused.\n\nFor more information, see the [mega-menu component](/components/top-navigation#mega-menu).\n\nexport const snippetsTopNavMegaMenu = [\n {\n language: \"Web component\",\n snippet:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithMegaMenu\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Back to top\n\nUse the back to top component to help people quickly return to the top of a long page.\n\nConsider using it on all apps to improve usability for everyone, including keyboard-only and some assistive technology users.\n\nDon't use back to top when the page is designed to fill the viewport without scrolling.\n\nFor more information, see the [back to top component](/components/back-to-top).\n\nexport const snippetsTopNavBackToTop = [\n {\n language: \"Web component\",\n snippet:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n language: \"React\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithBackToTop\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n## Customisation\n\nThis pattern can be themed to change the look and feel of the app. Use the [custom theme](/get-started/install-components/custom-theme) guidance to change your app's theme. Make sure to select your theme in line with the accessibility requirements around colour contrast.\n\n\n\n## Accessibility considerations\n\nWhen configuring a page make sure to follow all [accessibility guidance](/accessibility). Most accessibility requirements are covered by the individual components. For further accessibility information see the individual component pages.\n\nWe’ve tested this pattern against WCAG 2.1 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\n\n## Related patterns\n\n- [Side navigation layout](/patterns/navigation-patterns/side-navigation-layout)\n", + "contents": "\nimport { IcLink } from \"@ukic/react\";\n\nimport {\n createReactAppTsx,\n createWebComponentsIndexHTML,\n} from \"./components/StackblitzButton/stackblitz-helpers\";\n\nimport topNavigationPatternFig1 from \"./images/fig-1-example-of-theming-applied-to-top-navigation-layout@2x.png\";\n\n## Introduction\n\nexport const snippetsTopNav = [\n {\n technology: \"Web component\",\n snippets: {\n long: createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n },\n {\n technology: \"React\",\n snippets: {\n long: [\n {\n language: \"Typescript\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigation\",\n \"tsx\",\n true\n ),\n },\n {\n language: \"Javascript\",\n snippet: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigation\",\n \"jsx\",\n true\n ),\n },\n ],\n },\n },\n];\n\n\n \n View example in new window\n \n\n\nThis pattern includes the components:\n\n- [Top navigation](/components/top-navigation)\n- [Section container](/components/section-container)\n- [Footer](/components/footer)\n- [Classification banner](/components/classification-banner)\n\nWith options for:\n\n- [Page header](/components/page-header)\n- [Mega-menu](/components/top-navigation)\n- [Back to top](/components/back-to-top)\n\n## When to use\n\nWhen choosing a layout pattern, make sure it works for all pages within your app and avoid switching layouts on different pages.\n\nUse the top navigation layout for article pages or content heavy apps with lots of text.\n\nUse the top navigation layout with a mega-menu for access to a large range of navigation items.\n\nUse a mega-menu for apps with complex page structures where every page should be accessible from any other page through the mega-menu. For example, department stores or supermarkets use a top navigation with mega-menu to provide access to their large number of product categories.\n\n## When not to use\n\nFor apps that require constant access to switch between pages, use side navigation as it's better suited for providing quick access and maximising the screen space for page content.\n\nUse either the top navigation layout or the side navigation layout. Don't use both at the same time.\n\n## Implementation\n\nMake sure the pattern always fits the entire viewport and is never within another page container. The pattern content will adapt responsively when the viewport changes.\n\nAlways place the footer at the bottom of the page and below the fold meaning users should\nscroll to see it.\n\n## Variants\n\nUse the top navigation layout with additional components including page header to create other common layouts.\n\n### Page header\n\nUse a page header to display an introduction to the content of the page. Add additional elements to provide actions, navigation or inputs at the page level.\n\nFor more information, see the [page header component](/components/page-header).\n\nexport const snippetsTopNavPageHeader = [\n {\n technology: \"Web component\",\n snippets:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n Tertiary button\n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const alignment = \"center\";\n let pageHeaderAlignment;\n // pageHeaderAlignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n inputArea: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-md)\",\n \"@media screen and (max-width: 320px)\": {\n gap: \"var(--ic-space-xs)\",\n },\n },\n textField: {\n \"--input-width\": \"21.5rem\",\n \"@media screen and (max-width: 768px)\": {\n \"--input-width\": \"100%\",\n flex: \"1 1 0\",\n },\n },\n });\n const classes = useStyles();\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary button\n \n \n Tertiary button\n \n
\n \n Submit\n
\n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithPageHeader\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Mega-menu\n\nUse a top navigation with a mega-menu for apps with more than eight navigation options or options that can be grouped into categories. The main link groups are displayed in the top navigation and open a mega-menu when hovered over or focused.\n\nFor more information, see the [mega-menu component](/components/top-navigation#mega-menu).\n\nexport const snippetsTopNavMegaMenu = [\n {\n technology: \"Web component\",\n snippets:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithMegaMenu\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n### Back to top\n\nUse the back to top component to help people quickly return to the top of a long page.\n\nConsider using it on all apps to improve usability for everyone, including keyboard-only and some assistive technology users.\n\nDon't use back to top when the page is designed to fill the viewport without scrolling.\n\nFor more information, see the [back to top component](/components/back-to-top).\n\nexport const snippetsTopNavBackToTop = [\n {\n technology: \"Web component\",\n snippets:\n createWebComponentsIndexHTML(`\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in ic-section-container.\n

\n
\n
\n
\n
\n \n \n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n [footerLink]\n \n \n \n \n \n `),\n },\n {\n technology: \"React\",\n snippets: createReactAppTsx(\n `const alignment = \"center\";\n const useStyles = createUseStyles({\n main: { minHeight: \"100vh\", display: \"flex\" },\n mainContentDiv: {\n border: \"var(--ic-border-width) dashed var(--ic-architectural-400)\",\n padding: \"var(--ic-space-md)\",\n flex: 1,\n },\n mainSectionContainer: { display: \"flex\", flex: 1 },\n });\n const classes = useStyles(); \n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n

Example heading

\n
\n \n

Example sub-heading

\n
\n \n

\n Remove this div and add your custom content in IcSectionContainer.\n

\n
\n
\n
\n
\n \n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n [footerLink]\n \n \n \n \n \n \n \n \n )`,\n \"TopNavigationWithBackToTop\",\n \"jsx\",\n true\n ),\n },\n];\n\n\n \n View example in new window\n \n\n\n## Customisation\n\nThis pattern can be themed to change the look and feel of the app. Use the [custom theme](/get-started/install-components/custom-theme) guidance to change your app's theme. Make sure to select your theme in line with the accessibility requirements around colour contrast.\n\n\n\n## Accessibility considerations\n\nWhen configuring a page make sure to follow all [accessibility guidance](/accessibility). Most accessibility requirements are covered by the individual components. For further accessibility information see the individual component pages.\n\nWe’ve tested this pattern against WCAG 2.1 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\n\n## Related patterns\n\n- [Side navigation layout](/patterns/navigation-patterns/side-navigation-layout)\n", "path": "/patterns/navigation-patterns/top-navigation-layout", "navPriority": 1, "date": "2024-03-25", @@ -4595,10 +4595,10 @@ "contribute": "https://github.com/mi6/ic-design-system/tree/main/src/content/structured/patterns/navigation-patterns/top-navigation-layout.mdx", "meta": { "relativePath": "patterns/top-navigation-layout.mdx", - "createdAt": "2024-04-08T22:26:00.520Z", - "lastModified": "2024-04-08T22:26:00.520Z", - "size": 52244, - "formattedSize": "51.0 KB" + "createdAt": "2024-04-08T22:26:50.800Z", + "lastModified": "2024-04-08T22:26:50.800Z", + "size": 57202, + "formattedSize": "55.9 KB" } }, {