diff --git a/src/components/ComponentDetails/AttributeName/index.tsx b/src/components/ComponentDetails/AttributeName/index.tsx index fd37c070f..6a5d60fc1 100644 --- a/src/components/ComponentDetails/AttributeName/index.tsx +++ b/src/components/ComponentDetails/AttributeName/index.tsx @@ -6,12 +6,17 @@ const AttributeName: React.FC<{ value: (string | undefined)[]; }> = ({ name, value }) => (
- {name.map((attributeName, i) => ( -
- {attributeName} - {value[i]} -
- ))} + {name.map( + (attributeName, i) => + value[i] && ( +
+ + {attributeName} + + {value[i]} +
+ ) + )}
); diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 64c3700a9..d88bd27ab 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -273,7 +273,7 @@ const Layout: React.FC = ({ {footerLink.text} ))} -
+
\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 long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n logoContainer: {\n width: \"6.25rem\",\n height: \"6.25rem\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"var(--ic-theme-primary)\",\n color: \"var(--ic-theme-text)\"\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n logoContainer: {\n width: \"6.25rem\",\n height: \"6.25rem\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"var(--ic-theme-primary)\",\n color: \"var(--ic-theme-text)\"\n },\n});\nreturn (\n {shortCode}\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 technology: \"Web component\",\n snippets: {\n short: `\n `,\n long: `.div-container {\n min-height: 100vh;\n }\n\n\n
\n {shortCode}\n
`,\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: `const useStyles = createUseStyles({\n divContainer: {\n minHeight: \"100vh\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n divContainer: {\n minHeight: \"100vh\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n View example in new window\n \n\n", + "contents": "\r\nimport { IcFooter, IcLink, IcFooterLink, IcFooterLinkGroup } from \"@ukic/react\";\r\n\r\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Components\r\n \r\n \r\n Patterns\r\n \r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Components\r\n \r\n \r\n Patterns\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Components\r\n \r\n \r\n Patterns\r\n \r\n \r\n\r\n\r\n## Footer details\r\n\r\n\r\n\r\n## Footer link details\r\n\r\n\r\n\r\n## Footer link group details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Grouped links\r\n\r\nexport const snippetsGroupedLinks = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n \r\n\r\n\r\n### Logo links\r\n\r\nexport const snippetsLogoLinks = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Components\r\n \r\n \r\n Patterns\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### With React Router\r\n\r\nexport const withReactRouter = [\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n This is the accessibility page} />\r\n This page is about styles} />\r\n \r\n \r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n
\r\n Logo\r\n
\r\n
\r\n
`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n logoContainer: {\r\n width: \"6.25rem\",\r\n height: \"6.25rem\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n backgroundColor: \"var(--ic-theme-primary)\",\r\n color: \"var(--ic-theme-text)\"\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n logoContainer: {\r\n width: \"6.25rem\",\r\n height: \"6.25rem\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n backgroundColor: \"var(--ic-theme-primary)\",\r\n color: \"var(--ic-theme-text)\"\r\n },\r\n});\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Logo\r\n \r\n \r\n \r\n\r\n\r\n## Layout example\r\n\r\nAdding a `minHeight` of `100vh` ensures the footer appears below the page fold.\r\n\r\nexport const footerLayoutExample = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n `,\r\n long: `.div-container {\r\n min-height: 100vh;\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed\r\n vestibulum venenatis facilisis. Nam tortor felis, auctor vel\r\n ante quis, tempor interdum libero. In dictum sodales velit, eu\r\n egestas arcu dignissim ac. Aliquam facilisis eros dolor, id\r\n laoreet orci sagittis ut. Sed tempus, lacus in pretium molestie,\r\n lectus magna interdum risus, vel fringilla libero ex eu dui.\r\n Suspendisse ullamcorper vehicula lacinia. Phasellus congue velit\r\n nisl, vitae congue ligula rutrum id.\r\n \r\n \r\n
\r\n
\r\n \r\n Accessibility\r\n Styles\r\n Components\r\n Patterns\r\n \r\n
`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n divContainer: {\r\n minHeight: \"100vh\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n divContainer: {\r\n minHeight: \"100vh\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n View example in new window\r\n \r\n\r\n", "path": "/components/footer/code", "date": "2024-05-31", "title": "Footer", @@ -2297,16 +2297,16 @@ } ], "meta": { - "relativePath": "components/footer/code.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.032Z", - "size": 18992, - "formattedSize": "18.5 KB" + "relativePath": "components\\footer\\code.mdx", + "createdAt": "2024-12-04T13:24:18.023Z", + "lastModified": "2024-12-04T13:24:18.023Z", + "size": 19635, + "formattedSize": "19.2 KB" } }, { "id": "components\\footer\\guidancex", - "contents": "\nimport { IcFooter, IcFooterLink } from \"@ukic/react\";\nimport footerFig1 from \"./images/fig-1-colours.png\";\nimport footerFig2 from \"./images/fig-2-not-full-width.png\";\nimport footerFig3 from \"./images/fig-3-below-the-fold.png\";\nimport footerFig4 from \"./images/fig-4-above-the-fold.png\";\nimport footerFig5 from \"./images/fig-5-app-drawer-layouts.png\";\nimport footerFig6 from \"./images/fig-6-left-aligned.png\";\nimport footerFig7 from \"./images/fig-7-centred.png\";\nimport footerFig8 from \"./images/fig-8-full-width.png\";\nimport footerFig9 from \"./images/fig-9-single-line-links.png\";\nimport footerFig10 from \"./images/fig-10-grouped-links.png\";\nimport footerFig11 from \"./images/fig-11-desktop-logos.png\";\nimport footerFig12 from \"./images/fig-12-correct-copy.png\";\nimport footerFig13 from \"./images/fig-13-incorrect-copy.png\";\n\n## Introduction\n\nAn example of the footer component.\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n\n\n## When to use\n\nThere are two types of footer that display links in different ways. These are single line footers and grouped footers.\n\nUse a footer on every page so that the required legal information is displayed.\n\n### Single line\n\nUse single line footers when eight or fewer links are required and there is no need to split those links into groups.\n\n### Grouped\n\nUse grouped footers when more than eight links are required or the links can be grouped meaningfully.\n\n## Colour\n\nThe background colour of the footer reflects the chosen theme colour for the application. Set the global theme colour token to change the footer’s appearance.\n\n\n\n## Sizing\n\nThe footer always extends to the full width of the viewport.\n\nDon’t embed the footer within another container that is not full width.\n\n\n\n## Layout and placement\n\n### Placement\n\nAlways place the footer at the bottom of the page and below the fold, meaning users should scroll to see it.\n\n\n\n\n\nPosition the footer adjacent to the [side navigation](/components/side-navigation) if your app uses one.\n\n\n\n### Alignment\n\nThe footer can be set to left-aligned, centred or full width.\n\nUse left-aligned to align footer content to the left of the main body of the page. This works well with apps that use the side navigation.\n\n\n\nUse centred alignment to centre footer content to the main body of the page.\n\n\n\nUse full-width to position footer content so that it spans the full width of the viewport.\n\n\n\n## Content\n\n### Links\n\nFooters provide a set of links that can be accessed from every page within an app. Specify either single links or grouped links when using a footer.\n\nGive link groups clear labels when using grouped links.\n\nOrder the links so that the most important links appear at the top left of the links section.\n\n\n\n\n\n### Logos\n\nFooters can include a number of different logos. The logos appear at the bottom of the footer. Choose the correct variant (i.e., light or dark) of your logo to match the selected theme colour background.\n\n\n\n### Additional information\n\nProvide additional information in either the top section above the links or in the bottom section below the logos. Any additional information provided should be concise and easy to understand.\n\n\n \n \n\n", + "contents": "\r\nimport { IcFooter, IcFooterLink } from \"@ukic/react\";\r\nimport footerFig1 from \"./images/fig-1-colours.png\";\r\nimport footerFig2 from \"./images/fig-2-not-full-width.png\";\r\nimport footerFig3 from \"./images/fig-3-below-the-fold.png\";\r\nimport footerFig4 from \"./images/fig-4-above-the-fold.png\";\r\nimport footerFig5 from \"./images/fig-5-app-drawer-layouts.png\";\r\nimport footerFig6 from \"./images/fig-6-left-aligned.png\";\r\nimport footerFig7 from \"./images/fig-7-centred.png\";\r\nimport footerFig8 from \"./images/fig-8-full-width.png\";\r\nimport footerFig9 from \"./images/fig-9-single-line-links.png\";\r\nimport footerFig10 from \"./images/fig-10-grouped-links.png\";\r\nimport footerFig11 from \"./images/fig-11-desktop-logos.png\";\r\nimport footerFig12 from \"./images/fig-12-correct-copy.png\";\r\nimport footerFig13 from \"./images/fig-13-incorrect-copy.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the footer component.\r\n\r\n\r\n \r\n \r\n Accessibility\r\n \r\n \r\n Styles\r\n \r\n \r\n Components\r\n \r\n \r\n Patterns\r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\nThere are two types of footer that display links in different ways. These are single line footers and grouped footers.\r\n\r\nUse a footer on every page so that the required legal information is displayed.\r\n\r\n### Single line\r\n\r\nUse single line footers when eight or fewer links are required and there is no need to split those links into groups.\r\n\r\n### Grouped\r\n\r\nUse grouped footers when more than eight links are required or the links can be grouped meaningfully.\r\n\r\n## Colour\r\n\r\nThe background colour of the footer reflects the chosen theme colour for the application. Set the global theme colour token to change the footer’s appearance.\r\n\r\n\r\n\r\n## Sizing\r\n\r\nThe footer always extends to the full width of the viewport.\r\n\r\nDon’t embed the footer within another container that is not full width.\r\n\r\n\r\n\r\n## Layout and placement\r\n\r\n### Placement\r\n\r\nAlways place the footer at the bottom of the page and below the fold, meaning users should scroll to see it.\r\n\r\n\r\n\r\n\r\n\r\nPosition the footer adjacent to the [side navigation](/components/side-navigation) if your app uses one.\r\n\r\n\r\n\r\n### Alignment\r\n\r\nThe footer can be set to left-aligned, centred or full width.\r\n\r\nUse left-aligned to align footer content to the left of the main body of the page. This works well with apps that use the side navigation.\r\n\r\n\r\n\r\nUse centred alignment to centre footer content to the main body of the page.\r\n\r\n\r\n\r\nUse full-width to position footer content so that it spans the full width of the viewport.\r\n\r\n\r\n\r\n## Content\r\n\r\n### Links\r\n\r\nFooters provide a set of links that can be accessed from every page within an app. Specify either single links or grouped links when using a footer.\r\n\r\nGive link groups clear labels when using grouped links.\r\n\r\nOrder the links so that the most important links appear at the top left of the links section.\r\n\r\n\r\n\r\n\r\n\r\n### Logos\r\n\r\nFooters can include a number of different logos. The logos appear at the bottom of the footer. Choose the correct variant (i.e., light or dark) of your logo to match the selected theme colour background.\r\n\r\n\r\n\r\n### Additional information\r\n\r\nProvide additional information in either the top section above the links or in the bottom section below the logos. Any additional information provided should be concise and easy to understand.\r\n\r\n\r\n \r\n \r\n\r\n", "path": "/components/footer", "navPriority": 18, "date": "2023-02-03", @@ -2329,11 +2329,11 @@ } ], "meta": { - "relativePath": "components/footer/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.032Z", - "size": 7787, - "formattedSize": "7.6 KB" + "relativePath": "components\\footer\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.101Z", + "lastModified": "2024-12-04T13:23:54.101Z", + "size": 8000, + "formattedSize": "7.8 KB" } }, { @@ -2360,16 +2360,16 @@ } ], "meta": { - "relativePath": "components/hero/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.048Z", + "relativePath": "components\\hero\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.082Z", + "lastModified": "2024-11-05T11:57:52.082Z", "size": 2014, "formattedSize": "2.0 KB" } }, { "id": "components\\hero\\codex", - "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 \n Check out our new drinks\n \n`,\n long: `ic-hero {\n height: fit-content;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Explore\n \n \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## 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 \n Check out our new drinks\n \n`,\n long: `ic-hero {\n height: fit-content;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Explore\n \n \n Check out our new drinks\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\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### Content centre aligned\n\nexport const snippetsContentCentre = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Explore\n \n Check out our new drinks\n \n`,\n long: `ic-hero {\n height: fit-content;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Explore\n \n \n Check out our new drinks\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\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### 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: `ic-hero {\n height: fit-content;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Order now\n \n \n Submit new flavour\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\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: `ic-hero {\n height: fit-content;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n hero: {\n height: \"fit-content\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\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: `.hero-card {\n color: var(--ic-theme-text);\n width: 18.75rem;\n }\n ic-hero {\n height: fit-content;\n }\n \n \n {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: `const useStyles = createUseStyles({\n heroCard: {\n color: \"var(--ic-theme-text)\",\n width: \"18.75rem\",\n },\n hero: {\n height: \"fit-content\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n heroCard: {\n color: \"var(--ic-theme-text)\",\n width: \"18.75rem\",\n },\n hero: {\n height: \"fit-content\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\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### 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: `.card-image {\n width: 18.75rem;\n }\n ic-hero {\n height: fit-content;\n }\n\n\n {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: `const useStyles = createUseStyles({\n cardImage: {\n width: \"18.75rem\",\n },\n hero: {\n height: \"fit-content\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n cardImage: {\n width: \"18.75rem\",\n },\n hero: {\n height: \"fit-content\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\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": "\r\nimport { IcHero, IcButton, IcSearchBar, IcCard } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Explore\r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: `ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n\r\n\r\n## Hero details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Centre aligned\r\n\r\nexport const snippetsCentre = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Explore\r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: `ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n\r\n\r\n### Content centre aligned\r\n\r\nexport const snippetsContentCentre = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Explore\r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: `ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n\r\n\r\n### Size small\r\n\r\nexport const snippetsSmall = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Order now\r\n Submit new flavour\r\n`,\r\n long: `ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Order now\r\n \r\n \r\n Submit new flavour\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Order now\r\n \r\n \r\n Submit new flavour\r\n \r\n \r\n\r\n\r\n### Secondary heading and search\r\n\r\nexport const snippetsSecondHeadingSearch = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\r\n long: `ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\r\n {shortCode}\r\n )`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n### Card right content\r\n\r\nexport const snippetsCard = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Explore\r\n Check out our new drinks\r\n \r\n\r\n `,\r\n long: `.hero-card {\r\n color: var(--ic-theme-text);\r\n width: 18.75rem;\r\n }\r\n ic-hero {\r\n height: fit-content;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n Explore\r\n Check out our new drinks\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n heroCard: {\r\n color: \"var(--ic-theme-text)\",\r\n width: \"18.75rem\",\r\n },\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n heroCard: {\r\n color: \"var(--ic-theme-text)\",\r\n width: \"18.75rem\",\r\n },\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n \r\n\r\n\r\n### Image right content\r\n\r\nexport const snippetsImage = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Explore\r\n Check out our new drinks\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: `.card-image {\r\n width: 18.75rem;\r\n }\r\n ic-hero {\r\n height: fit-content;\r\n }\r\n\r\n\r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n Explore\r\n Check out our new drinks\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n cardImage: {\r\n width: \"18.75rem\",\r\n },\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n cardImage: {\r\n width: \"18.75rem\",\r\n },\r\n hero: {\r\n height: \"fit-content\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n", "path": "/components/hero/code", "date": "2024-05-31", "title": "Hero", @@ -2391,16 +2391,16 @@ } ], "meta": { - "relativePath": "components/hero/code.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.048Z", - "size": 17442, - "formattedSize": "17.0 KB" + "relativePath": "components\\hero\\code.mdx", + "createdAt": "2024-12-04T13:23:54.101Z", + "lastModified": "2024-12-04T13:23:54.101Z", + "size": 18140, + "formattedSize": "17.7 KB" } }, { "id": "components\\hero\\guidancex", - "contents": "\nimport { IcHero, IcButton } from \"@ukic/react\";\nimport heroFig1 from \"./images/fig-1-dont-place-hero-banners-in-middle-of-page.png\";\nimport heroFig2 from \"./images/fig-2-hero-banners-automatically-use-personality-colour.png\";\nimport heroFig3 from \"./images/fig-3-use-grey-background-when-colour-is-not-appropriate.png\";\nimport heroFig4 from \"./images/fig-4-dont-place-hero-banners-not-full-width.png\";\nimport heroFig5 from \"./images/fig-5-hero-alignment-options.png\";\nimport heroFig6 from \"./images/fig-6-use-buttons-in-the-interaction-area.png\";\nimport heroFig7 from \"./images/fig-7-use-links-in-the-interaction-area.png\";\nimport heroFig8 from \"./images/fig-8-use-simple-inputs-in-the-interaction-area.png\";\nimport heroFig9 from \"./images/fig-9-don't-use-complex-forms-in-the-interaction-area.png\";\nimport heroFig10 from \"./images/fig-10-use-clickable-cards-for-latest-announcements.png\";\nimport heroFig11 from \"./images/fig-11-use-secondary-headings-for-more-info.png\";\nimport heroFig12 from \"./images/fig-12-use-empty-space-on-right-hand-side-to-emphasise-title.png\";\nimport heroFig13 from \"./images/fig-13-use-embedded-images.png\";\nimport heroFig14 from \"./images/fig-14-use-full-height-images.png\";\nimport heroFig15 from \"./images/fig-15-use-background imagery.png\";\nimport heroFig16 from \"./images/fig-16-use-safe-areas-when-using-background-imagery.png\";\n\n## Introduction\n\nAn example of the hero component.\n\n\n \n \n Explore\n \n \n Check out our new drinks\n \n \n\n\n## When to use\n\nUse the hero on a homepage to introduce your app or service and provide navigation to its main functions. Use the hero to catch a user's attention as it's often the first thing that they see.\n\n## When not to use\n\nDon't use hero banners part way through page content to introduce sections. They should always appear at the top of the page to act as an introduction to the full page.\n\n\n\n## Colour\n\nHero banners use an automatic secondary variant of an app's chosen theme colour.\n\n\n\n\n\n## Sizing\n\nUse default sized hero for most applications. Use small sized hero banners for apps with compact layouts.\n\n## Layout and placement\n\nAlways position the hero banner at the top of the page and make it span the width of the container.\n\n\n\nUse the alignment options to align the hero content to either full-width, left or centre of its container.\n\n\n\n## Content\n\n### Interaction area\n\nUse the hero's interaction slot to add interactive elements such as buttons, links or search bars.\n\nDon't add too much to the slot as it may become too busy. A hero should introduce the page, but not contain all of the page's content.\n\n\n \n \n\n\n\n \n \n\n\n### Secondary area\n\nUse the hero's secondary area to add additional information or navigation options. For example, use a [clickable card](/components/card) to provide a link to recent posts, use a secondary heading to give more info about the app, or keep it empty to help the main heading stand out.\n\n\n\n\n\n\n\n### Imagery\n\nUse imagery on a hero to add personality to your app. Either embed the image in the secondary area, specify a full-size image to fill the secondary area, or add an image to the hero background itself.\n\n\n\n\n\n\n\nWhen using an image background, ensure that you include 'safe areas' in your image to avoid the image's content interfering with the hero's text content.\n\nAlways specify alt-text with any image that you use so that its content can be understood equally by everyone.\n\n\n", + "contents": "\r\nimport { IcHero, IcButton } from \"@ukic/react\";\r\nimport heroFig1 from \"./images/fig-1-dont-place-hero-banners-in-middle-of-page.png\";\r\nimport heroFig2 from \"./images/fig-2-hero-banners-automatically-use-personality-colour.png\";\r\nimport heroFig3 from \"./images/fig-3-use-grey-background-when-colour-is-not-appropriate.png\";\r\nimport heroFig4 from \"./images/fig-4-dont-place-hero-banners-not-full-width.png\";\r\nimport heroFig5 from \"./images/fig-5-hero-alignment-options.png\";\r\nimport heroFig6 from \"./images/fig-6-use-buttons-in-the-interaction-area.png\";\r\nimport heroFig7 from \"./images/fig-7-use-links-in-the-interaction-area.png\";\r\nimport heroFig8 from \"./images/fig-8-use-simple-inputs-in-the-interaction-area.png\";\r\nimport heroFig9 from \"./images/fig-9-don't-use-complex-forms-in-the-interaction-area.png\";\r\nimport heroFig10 from \"./images/fig-10-use-clickable-cards-for-latest-announcements.png\";\r\nimport heroFig11 from \"./images/fig-11-use-secondary-headings-for-more-info.png\";\r\nimport heroFig12 from \"./images/fig-12-use-empty-space-on-right-hand-side-to-emphasise-title.png\";\r\nimport heroFig13 from \"./images/fig-13-use-embedded-images.png\";\r\nimport heroFig14 from \"./images/fig-14-use-full-height-images.png\";\r\nimport heroFig15 from \"./images/fig-15-use-background imagery.png\";\r\nimport heroFig16 from \"./images/fig-16-use-safe-areas-when-using-background-imagery.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the hero component.\r\n\r\n\r\n \r\n \r\n Explore\r\n \r\n \r\n Check out our new drinks\r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\nUse the hero on a homepage to introduce your app or service and provide navigation to its main functions. Use the hero to catch a user's attention as it's often the first thing that they see.\r\n\r\n## When not to use\r\n\r\nDon't use hero banners part way through page content to introduce sections. They should always appear at the top of the page to act as an introduction to the full page.\r\n\r\n\r\n\r\n## Colour\r\n\r\nHero banners use an automatic secondary variant of an app's chosen theme colour.\r\n\r\n\r\n\r\n\r\n\r\n## Sizing\r\n\r\nUse default sized hero for most applications. Use small sized hero banners for apps with compact layouts.\r\n\r\n## Layout and placement\r\n\r\nAlways position the hero banner at the top of the page and make it span the width of the container.\r\n\r\n\r\n\r\nUse the alignment options to align the hero content to either full-width, left or centre of its container.\r\n\r\n\r\n\r\n## Content\r\n\r\n### Interaction area\r\n\r\nUse the hero's interaction slot to add interactive elements such as buttons, links or search bars.\r\n\r\nDon't add too much to the slot as it may become too busy. A hero should introduce the page, but not contain all of the page's content.\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n### Secondary area\r\n\r\nUse the hero's secondary area to add additional information or navigation options. For example, use a [clickable card](/components/card) to provide a link to recent posts, use a secondary heading to give more info about the app, or keep it empty to help the main heading stand out.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Imagery\r\n\r\nUse imagery on a hero to add personality to your app. Either embed the image in the secondary area, specify a full-size image to fill the secondary area, or add an image to the hero background itself.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nWhen using an image background, ensure that you include 'safe areas' in your image to avoid the image's content interfering with the hero's text content.\r\n\r\nAlways specify alt-text with any image that you use so that its content can be understood equally by everyone.\r\n\r\n\r\n", "path": "/components/hero", "navPriority": 19, "date": "2023-02-03", @@ -2424,11 +2424,11 @@ ], "tags": ["Banner"], "meta": { - "relativePath": "components/hero/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.048Z", - "size": 8391, - "formattedSize": "8.2 KB" + "relativePath": "components\\hero\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.102Z", + "lastModified": "2024-12-04T13:23:54.102Z", + "size": 8607, + "formattedSize": "8.4 KB" } }, { @@ -2440,9 +2440,9 @@ "subTitle": "Components are reusable user interface elements that help create consistent, accessible and usable experiences.", "contribute": "https://github.com/mi6/ic-design-system/tree/main/src/content/structured/components/index.mdx", "meta": { - "relativePath": "components/index.mdx", - "createdAt": "2024-11-06T10:27:49.400Z", - "lastModified": "2024-11-06T10:19:00.064Z", + "relativePath": "components\\index.mdx", + "createdAt": "2024-11-05T11:57:52.187Z", + "lastModified": "2024-11-05T11:57:52.187Z", "size": 597, "formattedSize": "597 Bytes" } @@ -2471,16 +2471,16 @@ } ], "meta": { - "relativePath": "components/links/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.064Z", + "relativePath": "components\\links\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.204Z", + "lastModified": "2024-11-05T11:57:52.204Z", "size": 1852, "formattedSize": "1.8 KB" } }, { "id": "components\\links\\codex", - "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### Appearance\n\nexport const snippetsLightDark = [\n {\n technology: \"Web component\",\n snippets: {\n short: `About our coffees\nAbout our coffees`,\n long: `.parent-container {\n display: flex;\n flex-wrap: wrap;\n }\n .light-background {\n padding: var(--ic-space-xs);\n }\n .dark-background {\n background: #333333;\n padding: var(--ic-space-xs);\n }\n\n\n
\n
\n \n About our coffees\n \n
\n
\n \n About our coffees\n \n
\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `About our coffees\nAbout our coffees`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n lightBackground: {\n padding: 'var(--ic-space-xs)',\n },\n darkBackground: {\n background: '#333333',\n padding: 'var(--ic-space-xs)',\n },\n});\nconst classes = useStyles();\nreturn (\n
\n
\n \n About our coffees\n \n
\n
\n \n About our coffees\n \n
\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n lightBackground: {\n padding: 'var(--ic-space-xs)',\n },\n darkBackground: {\n background: '#333333',\n padding: 'var(--ic-space-xs)',\n },\n});\nconst classes = useStyles();\nreturn (\n
\n
\n \n About our coffees\n \n
\n
\n \n About our coffees\n \n
\n
\n)`,\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 long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n linkContainer: {\n display: \"flex\",\n gap: \"var(--ic-space-xs)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n linkContainer: {\n display: \"flex\",\n gap: \"var(--ic-space-xs)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\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": "\r\nimport { IcLink } from \"@ukic/react\";\r\n\r\nimport { MemoryRouter, NavLink } from \"react-router-dom\";\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `About our coffees`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `About our coffees`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n## Component demo\r\n\r\n\r\n e.preventDefault()}>\r\n About our coffees\r\n \r\n\r\n\r\n## Link details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With icon\r\n\r\nexport const snippetsIcon = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `About our coffees`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `About our coffees`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n About our coffees\r\n \r\n\r\n\r\n### Appearance\r\n\r\nexport const snippetsLightDark = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `About our coffees\r\nAbout our coffees`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n }\r\n .light-background {\r\n padding: var(--ic-space-xs);\r\n }\r\n .dark-background {\r\n background: #333333;\r\n padding: var(--ic-space-xs);\r\n }\r\n\r\n\r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `About our coffees\r\nAbout our coffees`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n },\r\n lightBackground: {\r\n padding: 'var(--ic-space-xs)',\r\n },\r\n darkBackground: {\r\n background: '#333333',\r\n padding: 'var(--ic-space-xs)',\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n },\r\n lightBackground: {\r\n padding: 'var(--ic-space-xs)',\r\n },\r\n darkBackground: {\r\n background: '#333333',\r\n padding: 'var(--ic-space-xs)',\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
\r\n \r\n About our coffees\r\n \r\n
\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n About our coffees\r\n \r\n \r\n \r\n \r\n About our coffees\r\n \r\n \r\n\r\n\r\n### With React Router\r\n\r\nexport const withReactRouter = [\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n
\r\n \r\n Home\r\n \r\n \r\n Beverages\r\n \r\n
\r\n \r\n \r\n This is the home page} />\r\n This page is about beverages} />\r\n \r\n \r\n
`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n linkContainer: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-xs)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n linkContainer: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-xs)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n \r\n Home\r\n \r\n \r\n \r\n \r\n Beverages\r\n \r\n \r\n \r\n \r\n\r\n", "path": "/components/link/code", "date": "2024-09-03", "title": "Link", @@ -2502,16 +2502,16 @@ } ], "meta": { - "relativePath": "components/links/code.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.064Z", - "size": 6799, - "formattedSize": "6.6 KB" + "relativePath": "components\\links\\code.mdx", + "createdAt": "2024-12-04T13:23:54.102Z", + "lastModified": "2024-12-04T13:23:54.102Z", + "size": 7107, + "formattedSize": "6.9 KB" } }, { "id": "components\\links\\guidancex", - "contents": "\nimport { IcLink, IcTypography } from \"@ukic/react\";\nimport linksFig1 from \"./images/always-include-a-launch-icon-when-directing-users-to-an-external-address.png\";\nimport linksFig2 from \"./images/dont-use-a-default-link-for-links-which-open-a-new-tab-or-website.png\";\nimport linksFig3 from \"./images/use-a-button-when-displaying-a-clickable-action.png\";\nimport linksFig4 from \"./images/dont-use-a-link-to-initiate-an-action.png\";\nimport linksFig5 from \"./images/when-using-inline-links-always-use-a-different-colour-to-the-adjacent-text.png\";\nimport linksFig6 from \"./images/avoid-using-the-same-colour-style-as-the-adjacent-text.png\";\nimport linksFig7 from \"./images/use-the-monochromatic-variant-when-listing-links.png\";\nimport linksFig8 from \"./images/do-not-use-bad-link-text.png\";\n\n## Component demo\n\nLinks can include a launch icon to the right of the link for clarity.\n\n\n \n Return to the{\" \"}\n \n café homepage\n \n \n\n\n## When to use\n\nUse links to navigate to a new page.\n\nLinks can be applied to any text element but will use the link styling.\n\nAlways show a launch icon when a link is set up to open a page in a new tab or window, or when directing to an external app.\n\n\n\n\n\n## When not to use\n\nDon’t use a link to display an action on a page, use a [button](/components/button) instead.\n\n\n \n \n\n\n## Colour\n\nOnce a link has been visited, the browser will remember this and the link will change to use the visited styling.\n\nYour browser is set to remember what links have been visited. Visited links feature a different colour style.\n\nAll other states will use specific [hyperlink styling](/styles/colour#links).\n\nUse default appearance links when used inline with other text. If the text appears on a different coloured background, use the light or dark appearance links to achieve good colour contrast.\n\n\n \n \n\n\nUse the light or dark appearance links when listing a series of links on different coloured backgrounds.\n\n\n\n## Content\n\n### Link text\n\nAlways use a concise string of text in a link rather than displaying the full URL. Make sure the link text is descriptive enough to be relevant to the page the link points to.\n\nDon’t omit important descriptive information from the link text. Avoid using unnecessarily lengthy descriptions, but strike a balance between relevance and conciseness.\n\n\n About our coffees\n\n\n\n Use concise but relevant links.\n\n\n\n\n### Email addresses\n\nWhen linking to email addresses use the full email address in the link text. Don’t describe the contact without showing the email address.\n\n\n info@icds.co.uk\n\n\n\n Show the full email address.\n\n\n\n ICDS team\n\n\n\n Don’t embed labels when linking email addresses.\n\n\n## Accessibility considerations\n\nWhen reading a page, screen reader users might navigate to links independently of the adjacent content. Make sure links are descriptive enough that they make sense out of context.\n\nConsider that some screen readers allow users to view a full list of all links present on a page. This may be ordered either alphabetically, or in order of appearance. Make sure to label links with relevant information at the beginning of the string of text. For example, don’t embed “How to contact us”, but rather “Contact us”.\n", + "contents": "\r\nimport { IcLink, IcTypography } from \"@ukic/react\";\r\nimport linksFig1 from \"./images/always-include-a-launch-icon-when-directing-users-to-an-external-address.png\";\r\nimport linksFig2 from \"./images/dont-use-a-default-link-for-links-which-open-a-new-tab-or-website.png\";\r\nimport linksFig3 from \"./images/use-a-button-when-displaying-a-clickable-action.png\";\r\nimport linksFig4 from \"./images/dont-use-a-link-to-initiate-an-action.png\";\r\nimport linksFig5 from \"./images/when-using-inline-links-always-use-a-different-colour-to-the-adjacent-text.png\";\r\nimport linksFig6 from \"./images/avoid-using-the-same-colour-style-as-the-adjacent-text.png\";\r\nimport linksFig7 from \"./images/use-the-monochromatic-variant-when-listing-links.png\";\r\nimport linksFig8 from \"./images/do-not-use-bad-link-text.png\";\r\n\r\n## Component demo\r\n\r\nLinks can include a launch icon to the right of the link for clarity.\r\n\r\n\r\n \r\n Return to the{\" \"}\r\n \r\n café homepage\r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\nUse links to navigate to a new page.\r\n\r\nLinks can be applied to any text element but will use the link styling.\r\n\r\nAlways show a launch icon when a link is set up to open a page in a new tab or window, or when directing to an external app.\r\n\r\n\r\n\r\n\r\n\r\n## When not to use\r\n\r\nDon’t use a link to display an action on a page, use a [button](/components/button) instead.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Colour\r\n\r\nOnce a link has been visited, the browser will remember this and the link will change to use the visited styling.\r\n\r\nYour browser is set to remember what links have been visited. Visited links feature a different colour style.\r\n\r\nAll other states will use specific [hyperlink styling](/styles/colour#links).\r\n\r\nUse default appearance links when used inline with other text. If the text appears on a different coloured background, use the light or dark appearance links to achieve good colour contrast.\r\n\r\n\r\n \r\n \r\n\r\n\r\nUse the light or dark appearance links when listing a series of links on different coloured backgrounds.\r\n\r\n\r\n\r\n## Content\r\n\r\n### Link text\r\n\r\nAlways use a concise string of text in a link rather than displaying the full URL. Make sure the link text is descriptive enough to be relevant to the page the link points to.\r\n\r\nDon’t omit important descriptive information from the link text. Avoid using unnecessarily lengthy descriptions, but strike a balance between relevance and conciseness.\r\n\r\n\r\n About our coffees\r\n\r\n\r\n\r\n Use concise but relevant links.\r\n\r\n\r\n\r\n\r\n### Email addresses\r\n\r\nWhen linking to email addresses use the full email address in the link text. Don’t describe the contact without showing the email address.\r\n\r\n\r\n info@icds.co.uk\r\n\r\n\r\n\r\n Show the full email address.\r\n\r\n\r\n\r\n ICDS team\r\n\r\n\r\n\r\n Don’t embed labels when linking email addresses.\r\n\r\n\r\n## Accessibility considerations\r\n\r\nWhen reading a page, screen reader users might navigate to links independently of the adjacent content. Make sure links are descriptive enough that they make sense out of context.\r\n\r\nConsider that some screen readers allow users to view a full list of all links present on a page. This may be ordered either alphabetically, or in order of appearance. Make sure to label links with relevant information at the beginning of the string of text. For example, don’t embed “How to contact us”, but rather “Contact us”.\r\n", "path": "/components/link", "navPriority": 20, "date": "2023-09-03", @@ -2535,11 +2535,11 @@ ], "tags": ["Anchor", "Hyperlink"], "meta": { - "relativePath": "components/links/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.064Z", - "size": 6871, - "formattedSize": "6.7 KB" + "relativePath": "components\\links\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.103Z", + "lastModified": "2024-12-04T13:23:54.103Z", + "size": 7051, + "formattedSize": "6.9 KB" } }, { @@ -2566,16 +2566,16 @@ } ], "meta": { - "relativePath": "components/loading-indicators/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.072Z", + "relativePath": "components\\loading-indicators\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.293Z", + "lastModified": "2024-11-05T11:57:52.293Z", "size": 2469, "formattedSize": "2.4 KB" } }, { "id": "components\\loading-indicators\\codex", - "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: `<>\n {shortCode}\n`,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {shortCode}\n`,\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: `<>\n {shortCode}\n`,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {shortCode}\n`,\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: `<>\n {shortCode}\n`,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {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 long: `.dark-background {\n flex-direction: column; \n gap: var(--ic-space-xs); \n background: #333333;\n }\n \n \n
\n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n darkBackground: {\n display: \"flex\",\n flexDirection: \"column\", \n gap: \"var(--ic-space-xs)\", \n background: \"#333333\",\n },\n});\nconst classes = useStyles();\nreturn (\n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n darkBackground: {\n display: \"flex\",\n flexDirection: \"column\", \n gap: \"var(--ic-space-xs)\", \n background: \"#333333\",\n },\n});\nconst classes = useStyles();\nreturn (\n
\n {shortCode}\n
\n)`,\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", + "contents": "\r\nimport { IcLoadingIndicator } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Loading indicator details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Sizes\r\n\r\nexport const snippetsSizes = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n\r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n\r\n\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n### Icon\r\n\r\nexport const snippetsIcon = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Determinate\r\n\r\nexport const snippetsDeterminate = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n\r\n\r\n### Light\r\n\r\nexport const snippetsLight = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n `,\r\n long: `.dark-background {\r\n flex-direction: column; \r\n gap: var(--ic-space-xs); \r\n background: #333333;\r\n }\r\n \r\n \r\n
\r\n {shortCode}\r\n
`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n darkBackground: {\r\n display: \"flex\",\r\n flexDirection: \"column\", \r\n gap: \"var(--ic-space-xs)\", \r\n background: \"#333333\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n darkBackground: {\r\n display: \"flex\",\r\n flexDirection: \"column\", \r\n gap: \"var(--ic-space-xs)\", \r\n background: \"#333333\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n\r\n\r\n### Changing label\r\n\r\nexport const snippetsChangingLabel = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n", "path": "/components/loading-indicator/code", "date": "2024-05-31", "title": "Loading indicator", @@ -2597,16 +2597,16 @@ } ], "meta": { - "relativePath": "components/loading-indicators/code.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.072Z", - "size": 7783, - "formattedSize": "7.6 KB" + "relativePath": "components\\loading-indicators\\code.mdx", + "createdAt": "2024-12-04T13:23:54.104Z", + "lastModified": "2024-12-04T13:23:54.104Z", + "size": 8111, + "formattedSize": "7.9 KB" } }, { "id": "components\\loading-indicators\\guidancex", - "contents": "\nimport { IcLoadingIndicator, IcTypography } from \"@ukic/react\";\nimport loadingIndicatorFig1 from \"./images/fig-1-use-clear-concise-and-specific-labels.png\";\nimport loadingIndicatorFig2 from \"./images/fig-2-do-not-make-labels-unnecessarily-long.png\";\nimport loadingIndicatorFig3 from \"./images/fig-3-always-centre-the-component.png\";\nimport loadingIndicatorFig4 from \"./images/fig-4-do-not-position-the-loading-indicators-on-other-parts-of-the-page-or-container.png\";\nimport loadingIndicatorFig5 from \"./images/fig-5-place-the-full-width-indicator-at-the-top-of-the-container.png\";\nimport loadingIndicatorFig6 from \"./images/fig-6-do-not-position-full-width-loading-indicators-on-other-parts-of-the-container.png\";\nimport loadingIndicatorFig7 from \"./images/fig-7-place-loading-indicators-in-modals-when-overlayed-on-other-content.png\";\nimport loadingIndicatorFig8 from \"./images/fig-8-do-not-place-loading-indicators-over-other-content.png\";\n\n## Component variants\n\nLoading indicators have two variants: radial and linear.\n\nLoading indicators can either be determinate or indeterminate:\n\n- Use determinate loading indicators when the percentage of completion can be determined.\n- Use indeterminate loading indicators when the process completion rate can't be determined.\n\n## Radial\n\nRadial loading indicators have four sizes:\n\n- Small\n- Default\n- Large\n- Icon\n\nThe icon size is available for use within other components.\n\n\n \n\n\n\n Radial determinate.\n\n\n\n \n\n\n\n Radial indeterminate.\n\n\n## Linear\n\nLinear loading indicators have three sizes:\n\n- Small\n- Default\n- Large\n\nLinear loading indicators have two variants:\n\n- Default\n- Full-width\n\nLinear loading indicators can be set to full-width to span its container.\n\n\n \n\n\n\n Linear determinate.\n\n\n\n \n\n\n\n Linear indeterminate.\n\n\n## When to use\n\nUse loading indicators when loading full pages or containers where the structure is unknown.\n\nUse determinate loading indicators wherever the percentage of completion can be calculated.\n\n## When not to use\n\nAvoid using loading indicators when loading full pages if the structure of the page loading is known. Instead, use the [skeleton](/components/skeleton) component.\n\n## Content\n\n### Labels\n\nDeterminate loading indicators feature the percentage completion rate in percentage points, 0 to 100%.\n\nIndeterminate loading indicators have a customisable label. The label can be set to change after a specified amount of time. Make sure to display each label for at least five seconds. Keep labels clear and concise. Where possible, provide specific labels to the process being performed.\n\n\n \n \n\n\n## Layout and placement\n\nLoading indicators always appear centred within their container. If the whole page is loading, position the loading indicator at the centre of the page. If the loading indicator is used inside another component, like a card, position the loading indicator at the centre of the component.\n\n\n \n \n\n\nWhen using the full-width variant of linear loading indicators, make sure to place this at the top of the component or page. Also, make sure that the loading indicator takes up the full width of the component or page.\n\n\n \n \n\n\nIf loading indicators are overlaid on other content, place them in a dialog.\n\n\n\n\n", + "contents": "\r\nimport { IcLoadingIndicator, IcTypography } from \"@ukic/react\";\r\nimport loadingIndicatorFig1 from \"./images/fig-1-use-clear-concise-and-specific-labels.png\";\r\nimport loadingIndicatorFig2 from \"./images/fig-2-do-not-make-labels-unnecessarily-long.png\";\r\nimport loadingIndicatorFig3 from \"./images/fig-3-always-centre-the-component.png\";\r\nimport loadingIndicatorFig4 from \"./images/fig-4-do-not-position-the-loading-indicators-on-other-parts-of-the-page-or-container.png\";\r\nimport loadingIndicatorFig5 from \"./images/fig-5-place-the-full-width-indicator-at-the-top-of-the-container.png\";\r\nimport loadingIndicatorFig6 from \"./images/fig-6-do-not-position-full-width-loading-indicators-on-other-parts-of-the-container.png\";\r\nimport loadingIndicatorFig7 from \"./images/fig-7-place-loading-indicators-in-modals-when-overlayed-on-other-content.png\";\r\nimport loadingIndicatorFig8 from \"./images/fig-8-do-not-place-loading-indicators-over-other-content.png\";\r\n\r\n## Component variants\r\n\r\nLoading indicators have two variants: radial and linear.\r\n\r\nLoading indicators can either be determinate or indeterminate:\r\n\r\n- Use determinate loading indicators when the percentage of completion can be determined.\r\n- Use indeterminate loading indicators when the process completion rate can't be determined.\r\n\r\n## Radial\r\n\r\nRadial loading indicators have four sizes:\r\n\r\n- Small\r\n- Default\r\n- Large\r\n- Icon\r\n\r\nThe icon size is available for use within other components.\r\n\r\n\r\n \r\n\r\n\r\n\r\n Radial determinate.\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n Radial indeterminate.\r\n\r\n\r\n## Linear\r\n\r\nLinear loading indicators have three sizes:\r\n\r\n- Small\r\n- Default\r\n- Large\r\n\r\nLinear loading indicators have two variants:\r\n\r\n- Default\r\n- Full-width\r\n\r\nLinear loading indicators can be set to full-width to span its container.\r\n\r\n\r\n \r\n\r\n\r\n\r\n Linear determinate.\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n Linear indeterminate.\r\n\r\n\r\n## When to use\r\n\r\nUse loading indicators when loading full pages or containers where the structure is unknown.\r\n\r\nUse determinate loading indicators wherever the percentage of completion can be calculated.\r\n\r\n## When not to use\r\n\r\nAvoid using loading indicators when loading full pages if the structure of the page loading is known. Instead, use the [skeleton](/components/skeleton) component.\r\n\r\n## Content\r\n\r\n### Labels\r\n\r\nDeterminate loading indicators feature the percentage completion rate in percentage points, 0 to 100%.\r\n\r\nIndeterminate loading indicators have a customisable label. The label can be set to change after a specified amount of time. Make sure to display each label for at least five seconds. Keep labels clear and concise. Where possible, provide specific labels to the process being performed.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Layout and placement\r\n\r\nLoading indicators always appear centred within their container. If the whole page is loading, position the loading indicator at the centre of the page. If the loading indicator is used inside another component, like a card, position the loading indicator at the centre of the component.\r\n\r\n\r\n \r\n \r\n\r\n\r\nWhen using the full-width variant of linear loading indicators, make sure to place this at the top of the component or page. Also, make sure that the loading indicator takes up the full width of the component or page.\r\n\r\n\r\n \r\n \r\n\r\n\r\nIf loading indicators are overlaid on other content, place them in a dialog.\r\n\r\n\r\n\r\n\r\n", "path": "/components/loading-indicator", "navPriority": 21, "date": "2023-02-03", @@ -2630,16 +2630,16 @@ ], "tags": ["Progress bar", "Progress indicator", "Spinner"], "meta": { - "relativePath": "components/loading-indicators/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.072Z", - "size": 7001, - "formattedSize": "6.8 KB" + "relativePath": "components\\loading-indicators\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.105Z", + "lastModified": "2024-12-04T13:23:54.105Z", + "size": 7213, + "formattedSize": "7.0 KB" } }, { "id": "components\\multi-select\\codex", - "contents": "\nimport { IcSelectWithMulti } from \"@ukic/canary-react\";\n\nimport {\n OPTIONS,\n OPTIONS_WITH_DESCRIPTIONS,\n OPTIONS_WITH_DISABLED,\n GROUPED_OPTIONS,\n OPTIONS_WITH_RECOMMENDED,\n} from \"./story-data\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n## Select with multi details\n\n\n\n## Variants\n\n### Default value\n\nShow options as pre-selected by setting the `value` prop to an array containing the values of these options.\n\nexport const defaultValue = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With clear button\n\nDisplay a clear button by using the `showClearButton` prop.\n\nThis will appear when the user has selected some options and allow them to easily clear their selection.\n\nexport const clear = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n showClearButton\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With descriptions\n\nDisplay extra information about the options by providing a description using the `description` property for each option.\n\nexport const desc = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n {\n label: \"Cappuccino\",\n value: \"Cap\",\n description: \"Coffee frothed up with pressurised steam\",\n },\n {\n label: \"Latte\",\n value: \"Lat\",\n description: \"A milkier coffee than a cappuccino\",\n },\n {\n label: \"Americano\",\n value: \"Ame\",\n description: \"Espresso coffee diluted with hot water\",\n },\n {\n label: \"Filter\",\n value: \"Fil\",\n description: \"Coffee filtered using paper or a mesh\",\n },\n {\n label: \"Flat white\",\n value: \"Fla\",\n description:\n \"Coffee without froth made with espresso and hot steamed milk\",\n },\n {\n label: \"Mocha\",\n value: \"Moc\",\n description: \"A mixture of coffee and chocolate\",\n },\n {\n label: \"Macchiato\",\n value: \"Mac\",\n description: \"Espresso coffee with a dash of frothy steamed milk\",\n },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n {\n label: \"Cappuccino\",\n value: \"Cap\",\n description: \"Coffee frothed up with pressurised steam\",\n },\n {\n label: \"Latte\",\n value: \"Lat\",\n description: \"A milkier coffee than a cappuccino\",\n },\n {\n label: \"Americano\",\n value: \"Ame\",\n description: \"Espresso coffee diluted with hot water\",\n },\n {\n label: \"Filter\",\n value: \"Fil\",\n description: \"Coffee filtered using paper or a mesh\",\n },\n {\n label: \"Flat white\",\n value: \"Fla\",\n description:\n \"Coffee without froth made with espresso and hot steamed milk\",\n },\n {\n label: \"Mocha\",\n value: \"Moc\",\n description: \"A mixture of coffee and chocolate\",\n },\n {\n label: \"Macchiato\",\n value: \"Mac\",\n description: \"Espresso coffee with a dash of frothy steamed milk\",\n },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Helper text\n\nDisplay helper text to provide additional information by using the `helperText` prop.\n\nexport const helper = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sizes\n\nSet the size of the multi-select by using the `size` prop. This prop takes the values `small`, `default` or `large`.\nDepending on the chosen size, the prop will apply styling to increase or decrease the amount of spacing within the component.\nThe `default` variant is seen in the first [default](#default) example.\n\nexport const sizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `.parent-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-md);\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"var(--ic-space-md)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n \n \n
\n
\n\n### Disabled\n\nDisable the multi-select and prevent user interaction by using the `disabled` prop.\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Disabled options\n\nDisable certain options by setting the `disabled` property to `true` for each option.\n\nexport const disabledOptions = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n onIcOptionSelect={(event) => console.log(event.detail.value)}\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\n multiple\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\", disabled: true },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\", disabled: true },\n { label: \"Flat white\", value: \"Fla\", disabled: true },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\", disabled: true },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\", disabled: true },\n { label: \"Flat white\", value: \"Fla\", disabled: true },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Hide label\n\nHide the visible label for the multi-select by using the `hideLabel` prop.\n\nexport const hideLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn (\n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Required\n\nInform the user that the multi-select is a required field by using the `required` prop.\nThis will display an asterisk next to the label and apply the `aria-required` attribute.\n\nexport const required = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Read-only\n\nMake the multi-select read-only by using the `readonly` prop.\nUse the `value` prop to set which options are selected and will be displayed when it is read-only.\n\nexport const read = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Groups\n\nDisplay options in groups by passing an array of child options to the `children` property of a parent option.\nThe parent option will be rendered as the title of the group.\n\nexport const group = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n {\n label: \"Fancy\",\n children: [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Flat white\", value: \"Flat\" },\n ],\n },\n {\n label: \"Boring\",\n children: [\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Latte\", value: \"Lat\" },\n ],\n },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n {\n label: \"Fancy\",\n children: [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Flat white\", value: \"Flat\" },\n ],\n },\n {\n label: \"Boring\",\n children: [\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Latte\", value: \"Lat\" },\n ],\n },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Recommended\n\nDisplay certain options at the top of the option list by setting the `recommended` property to `true` on each option.\nThis will allow for quick access to these options.\n\nexport const recc = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\", recommended: true },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\", recommended: true },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\", recommended: true },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\", recommended: true },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Validation\n\nDisplay a validation status and message by using the `validation-status` and `validation-message` props.\nThe `validation-status` prop takes the values `success`, `warning` or `error`.\n\nexport const validation = [\n {\n technology: \"Web component\",\n snippets: {\n short: ` `,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n\n### Loading with error\n\nDisplay the loading state by using the `loading` prop.\nThe multi-select will show a loading error after the amount of time specified using the `timeout` prop has elapsed.\n\nexport const loading = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n\n\n
\n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nconst options = [\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];\nreturn ( \n
\n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n
\n \n
\n
\n", + "contents": "\r\nimport { IcSelectWithMulti } from \"@ukic/canary-react\";\r\n\r\nimport {\r\n OPTIONS,\r\n OPTIONS_WITH_DESCRIPTIONS,\r\n OPTIONS_WITH_DISABLED,\r\n GROUPED_OPTIONS,\r\n OPTIONS_WITH_RECOMMENDED,\r\n} from \"./story-data\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n## Select with multi details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Default value\r\n\r\nShow options as pre-selected by setting the `value` prop to an array containing the values of these options.\r\n\r\nexport const defaultValue = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### With clear button\r\n\r\nDisplay a clear button by using the `showClearButton` prop.\r\n\r\nThis will appear when the user has selected some options and allow them to easily clear their selection.\r\n\r\nexport const clear = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n showClearButton\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### With descriptions\r\n\r\nDisplay extra information about the options by providing a description using the `description` property for each option.\r\n\r\nexport const desc = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n {\r\n label: \"Cappuccino\",\r\n value: \"Cap\",\r\n description: \"Coffee frothed up with pressurised steam\",\r\n },\r\n {\r\n label: \"Latte\",\r\n value: \"Lat\",\r\n description: \"A milkier coffee than a cappuccino\",\r\n },\r\n {\r\n label: \"Americano\",\r\n value: \"Ame\",\r\n description: \"Espresso coffee diluted with hot water\",\r\n },\r\n {\r\n label: \"Filter\",\r\n value: \"Fil\",\r\n description: \"Coffee filtered using paper or a mesh\",\r\n },\r\n {\r\n label: \"Flat white\",\r\n value: \"Fla\",\r\n description:\r\n \"Coffee without froth made with espresso and hot steamed milk\",\r\n },\r\n {\r\n label: \"Mocha\",\r\n value: \"Moc\",\r\n description: \"A mixture of coffee and chocolate\",\r\n },\r\n {\r\n label: \"Macchiato\",\r\n value: \"Mac\",\r\n description: \"Espresso coffee with a dash of frothy steamed milk\",\r\n },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n {\r\n label: \"Cappuccino\",\r\n value: \"Cap\",\r\n description: \"Coffee frothed up with pressurised steam\",\r\n },\r\n {\r\n label: \"Latte\",\r\n value: \"Lat\",\r\n description: \"A milkier coffee than a cappuccino\",\r\n },\r\n {\r\n label: \"Americano\",\r\n value: \"Ame\",\r\n description: \"Espresso coffee diluted with hot water\",\r\n },\r\n {\r\n label: \"Filter\",\r\n value: \"Fil\",\r\n description: \"Coffee filtered using paper or a mesh\",\r\n },\r\n {\r\n label: \"Flat white\",\r\n value: \"Fla\",\r\n description:\r\n \"Coffee without froth made with espresso and hot steamed milk\",\r\n },\r\n {\r\n label: \"Mocha\",\r\n value: \"Moc\",\r\n description: \"A mixture of coffee and chocolate\",\r\n },\r\n {\r\n label: \"Macchiato\",\r\n value: \"Mac\",\r\n description: \"Espresso coffee with a dash of frothy steamed milk\",\r\n },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Helper text\r\n\r\nDisplay helper text to provide additional information by using the `helperText` prop.\r\n\r\nexport const helper = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Sizes\r\n\r\nSet the size of the multi-select by using the `size` prop. This prop takes the values `small`, `default` or `large`.\r\nDepending on the chosen size, the prop will apply styling to increase or decrease the amount of spacing within the component.\r\nThe `default` variant is seen in the first [default](#default) example.\r\n\r\nexport const sizes = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--ic-space-md);\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: \"var(--ic-space-md)\",\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n### Disabled\r\n\r\nDisable the multi-select and prevent user interaction by using the `disabled` prop.\r\n\r\nexport const disabled = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Disabled options\r\n\r\nDisable certain options by setting the `disabled` property to `true` for each option.\r\n\r\nexport const disabledOptions = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n onIcOptionSelect={(event) => console.log(event.detail.value)}\r\n onIcOptionDeselect={(event) => console.log(event.detail.value)}\r\n multiple\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\", disabled: true },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\", disabled: true },\r\n { label: \"Flat white\", value: \"Fla\", disabled: true },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\", disabled: true },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\", disabled: true },\r\n { label: \"Flat white\", value: \"Fla\", disabled: true },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Hide label\r\n\r\nHide the visible label for the multi-select by using the `hideLabel` prop.\r\n\r\nexport const hideLabel = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn (\r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Required\r\n\r\nInform the user that the multi-select is a required field by using the `required` prop.\r\nThis will display an asterisk next to the label and apply the `aria-required` attribute.\r\n\r\nexport const required = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Read-only\r\n\r\nMake the multi-select read-only by using the `readonly` prop.\r\nUse the `value` prop to set which options are selected and will be displayed when it is read-only.\r\n\r\nexport const read = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Groups\r\n\r\nDisplay options in groups by passing an array of child options to the `children` property of a parent option.\r\nThe parent option will be rendered as the title of the group.\r\n\r\nexport const group = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n {\r\n label: \"Fancy\",\r\n children: [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Flat white\", value: \"Flat\" },\r\n ],\r\n },\r\n {\r\n label: \"Boring\",\r\n children: [\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n ],\r\n },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n {\r\n label: \"Fancy\",\r\n children: [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Flat white\", value: \"Flat\" },\r\n ],\r\n },\r\n {\r\n label: \"Boring\",\r\n children: [\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n ],\r\n },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Recommended\r\n\r\nDisplay certain options at the top of the option list by setting the `recommended` property to `true` on each option.\r\nThis will allow for quick access to these options.\r\n\r\nexport const recc = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\", recommended: true },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\", recommended: true },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\", recommended: true },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\", recommended: true },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Validation\r\n\r\nDisplay a validation status and message by using the `validation-status` and `validation-message` props.\r\nThe `validation-status` prop takes the values `success`, `warning` or `error`.\r\n\r\nexport const validation = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ` `,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n### Loading with error\r\n\r\nDisplay the loading state by using the `loading` prop.\r\nThe multi-select will show a loading error after the amount of time specified using the `timeout` prop has elapsed.\r\n\r\nexport const loading = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n
\r\n {shortCode}\r\n
\r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nconst options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Filter\", value: \"Fil\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n];\r\nreturn ( \r\n
\r\n {shortCode}\r\n
\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n
\r\n", "path": "/components/multi-select/code", "date": "2024-06-05", "title": "Multi-select", @@ -2656,16 +2656,16 @@ } ], "meta": { - "relativePath": "components/multi-select/code.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.072Z", - "size": 44849, - "formattedSize": "43.8 KB" + "relativePath": "components\\multi-select\\code.mdx", + "createdAt": "2024-12-04T13:23:54.106Z", + "lastModified": "2024-12-04T13:23:54.106Z", + "size": 46676, + "formattedSize": "45.6 KB" } }, { "id": "components\\multi-select\\guidancex", - "contents": "\nimport { IcAlert, IcLink } from \"@ukic/react\";\nimport { IcSelectWithMulti } from \"@ukic/canary-react\";\n\nimport { OPTIONS } from \"./story-data\";\n\n\n\n## Canary components\n\nCanary components are unstable components that are released for testing purposes.\n\nWe value any feedback from users willing to try them in their applications.\n\nThese components should not be used in production apps without understanding the risk that changes may occur in order to fix bugs or improve functionality.\n\nFor more information on Canary components, read our approach to [releases and versions](/get-started/releases-versions).\n\n

\n Additional details on the props and events for this component can be found in\n the{\" \"}\n \n Canary web components\n {\" \"}\n and{\" \"}\n \n Canary React\n {\" \"}\n storybooks.\n

\n\n## Single select\n\nTo view guidance and documentation relating to the single select component, check the [select page](/components/select).\n\n## Component demo\n\n\n \n\n", + "contents": "\r\nimport { IcAlert, IcLink } from \"@ukic/react\";\r\nimport { IcSelectWithMulti } from \"@ukic/canary-react\";\r\n\r\nimport { OPTIONS } from \"./story-data\";\r\n\r\n\r\n\r\n## Canary components\r\n\r\nCanary components are unstable components that are released for testing purposes.\r\n\r\nWe value any feedback from users willing to try them in their applications.\r\n\r\nThese components should not be used in production apps without understanding the risk that changes may occur in order to fix bugs or improve functionality.\r\n\r\nFor more information on Canary components, read our approach to [releases and versions](/get-started/releases-versions).\r\n\r\n

\r\n Additional details on the props and events for this component can be found in\r\n the{\" \"}\r\n \r\n Canary web components\r\n {\" \"}\r\n and{\" \"}\r\n \r\n Canary React\r\n {\" \"}\r\n storybooks.\r\n

\r\n\r\n## Single select\r\n\r\nTo view guidance and documentation relating to the single select component, check the [select page](/components/select).\r\n\r\n## Component demo\r\n\r\n\r\n \r\n\r\n", "path": "/components/multi-select", "navPriority": 22, "date": "2024-06-05", @@ -2684,11 +2684,11 @@ ], "tags": ["Combobox", "Dropdown menu"], "meta": { - "relativePath": "components/multi-select/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.076Z", - "size": 1982, - "formattedSize": "1.9 KB" + "relativePath": "components\\multi-select\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.106Z", + "lastModified": "2024-12-04T13:23:54.106Z", + "size": 2057, + "formattedSize": "2.0 KB" } }, { @@ -2715,16 +2715,16 @@ } ], "meta": { - "relativePath": "components/page-header/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.076Z", + "relativePath": "components\\page-header\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.511Z", + "lastModified": "2024-11-05T11:57:52.511Z", "size": 2399, "formattedSize": "2.3 KB" } }, { "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 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 long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n textField: {\n '@media (max-width: 576px)': {\n width: '17.5rem'\n }\n }\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n textField: {\n '@media (max-width: 576px)': {\n width: '17.5rem'\n }\n }\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\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 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", + "contents": "\r\nimport {\r\n IcPageHeader,\r\n IcButton,\r\n IcStepper,\r\n IcStep,\r\n SlottedSVG,\r\n IcTextField,\r\n IcNavigationItem,\r\n IcBreadcrumb,\r\n IcBreadcrumbGroup,\r\n IcSectionContainer,\r\n IcChip,\r\n IcTypography,\r\n} from \"@ukic/react\";\r\n\r\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Page header details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Size small\r\n\r\nexport const snippetsSmall = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### With breadcrumb navigation\r\n\r\nexport const withBreadcrumbNavigation = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### With actions, input and stepper\r\n\r\nexport const withActionsInputStepper = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Create coffee\r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### With actions, input and tabs\r\n\r\nexport const withActionsInputTabs = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Create coffee\r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n\r\n `,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### With React Router\r\n\r\nexport const withReactRouter = [\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Create coffee\r\n \r\n \r\n \r\n \r\n Filter coffee\r\n \r\n Method\r\n \r\n \r\n Ingredients\r\n \r\n \r\n \r\n \r\n \r\n This page is about our Latte making methods}/>\r\n This page is about the ingredients used in our Latte}/>\r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n textField: {\r\n '@media (max-width: 576px)': {\r\n width: '17.5rem'\r\n }\r\n }\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n textField: {\r\n '@media (max-width: 576px)': {\r\n width: '17.5rem'\r\n }\r\n }\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n \r\n \r\n Create coffee\r\n \r\n \r\n \r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n Method\r\n \r\n \r\n \r\n \r\n Ingredients\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### With Slots\r\n\r\nexport const withSlots = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Latte recipe\r\n A Latte is a popular Italian coffee, made with espresso, steamed milk and a thin layer of foam.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n Latte recipe\r\n \r\n \r\n A Latte is a popular Italian coffee, made with espresso, steamed milk and\r\n a thin layer of foam.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n \r\n Latte recipe\r\n \r\n \r\n A Latte is a popular Italian coffee, made with espresso, steamed milk and\r\n a thin layer of foam.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n", "path": "/components/page-header/code", "date": "2024-05-31", "title": "Page header", @@ -2746,16 +2746,16 @@ } ], "meta": { - "relativePath": "components/page-header/code.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.076Z", - "size": 19079, - "formattedSize": "18.6 KB" + "relativePath": "components\\page-header\\code.mdx", + "createdAt": "2024-12-04T13:23:54.107Z", + "lastModified": "2024-12-04T13:23:54.107Z", + "size": 19765, + "formattedSize": "19.3 KB" } }, { "id": "components\\page-header\\guidancex", - "contents": "\nimport {\n IcPageHeader,\n IcButton,\n IcTextField,\n IcStepper,\n IcStep,\n IcChip,\n} from \"@ukic/react\";\nimport pageHeaderFig1 from \"./images/fig-1-page-header-anatomy.png\";\nimport pageHeaderFig2 from \"./images/fig-2-dont-use-global-actions-in-a-page-header.png\";\nimport pageHeaderFig3 from \"./images/fig-3-use-default-and-dense-sizing.png\";\nimport pageHeaderFig4 from \"./images/fig-4-set-width-of-page-header-to-match-width-of-main-content.png\";\nimport pageHeaderFig5 from \"./images/fig-5-dont-set-width-of-page-header-to-align-to-content.png\";\nimport pageHeaderFig6 from \"./images/fig-6-page-header-displayed-whilst-scroll-position-is-at-top-of-page.png\";\nimport pageHeaderFig7 from \"./images/fig-7-sticky-page-header-displayed-whilst-scrolled.png\";\nimport pageHeaderFig8 from \"./images/fig-8-centre-alignment.png\";\nimport pageHeaderFig9 from \"./images/fig-9-left-alignment.png\";\nimport pageHeaderFig10 from \"./images/fig-10-full-width.png\";\nimport pageHeaderFig11 from \"./images/fig-11-dont-mix-alignment.png\";\n\n## Introduction\n\nAn example of the page header component.\n\n\n \n \n \n Create coffee\n \n \n Filter coffee\n \n \n \n \n \n \n \n \n\n\n## When to use\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\n\n\n### With action\n\nUse [buttons](/components/button) when you need to provide actions that affect all content on the page, for example to filter or to add a new record. Only use one primary button per page header. Use any type of button within the page header’s interaction area.\n\n### With input\n\nInclude an [input field](/components/search-bar) to search or filter data displayed on the page. Don’t overload the input area with components, consider placing them in the page content instead.\n\n### With breadcrumb navigation\n\nUse a [breadcrumb](/components/breadcrumb) to show the current page’s position in the app’s hierarchy or show a link to the parent page.\n\n### With tab navigation\n\nUse [tabs](/components/tabs) if the content grouped by the header can be split into distinct categories.\n\n### With stepper\n\nUse a [stepper](/components/stepper) to show progress through a multi-step process.\n\n## When not to use\n\nDon’t use the page header to include global actions or global navigation, instead use the [top navigation](/components/top-navigation) or [side navigation](/components/side-navigation).\n\n\n\n## Sizing\n\n\n\nSet the width of the page header to match the width of the page’s main content.\n\n\n\n\n\n## Layout and placement\n\n### Sticky scroll\n\nSet the page header to stick to the top of the screen if you need it to be visible when scrolling. Otherwise, set it to scroll with content to maximise available space for content.\n\n\n\n\n\n### Alignment\n\nAlign the page header either to the left, centre or full-width to match the rest of the content on the page.\n\n\n\n\n\n\n\nDon’t align a page header’s content differently to how the rest of the page content is aligned.\n\n\n\n## Content\n\nUse short titles that clearly describe the page's content.\n\nKeep page subtitles concise within the page header. If more content is required, consider placing it within the page itself.\n\nInclude a title adornment to convey information such as a status or versioning.\n\n## Related components\n\n- [Hero](/components/hero)\n- [Top navigation](/components/top-navigation)\n- [Side navigation](/components/side-navigation)\n", + "contents": "\r\nimport {\r\n IcPageHeader,\r\n IcButton,\r\n IcTextField,\r\n IcStepper,\r\n IcStep,\r\n IcChip,\r\n} from \"@ukic/react\";\r\nimport pageHeaderFig1 from \"./images/fig-1-page-header-anatomy.png\";\r\nimport pageHeaderFig2 from \"./images/fig-2-dont-use-global-actions-in-a-page-header.png\";\r\nimport pageHeaderFig3 from \"./images/fig-3-use-default-and-dense-sizing.png\";\r\nimport pageHeaderFig4 from \"./images/fig-4-set-width-of-page-header-to-match-width-of-main-content.png\";\r\nimport pageHeaderFig5 from \"./images/fig-5-dont-set-width-of-page-header-to-align-to-content.png\";\r\nimport pageHeaderFig6 from \"./images/fig-6-page-header-displayed-whilst-scroll-position-is-at-top-of-page.png\";\r\nimport pageHeaderFig7 from \"./images/fig-7-sticky-page-header-displayed-whilst-scrolled.png\";\r\nimport pageHeaderFig8 from \"./images/fig-8-centre-alignment.png\";\r\nimport pageHeaderFig9 from \"./images/fig-9-left-alignment.png\";\r\nimport pageHeaderFig10 from \"./images/fig-10-full-width.png\";\r\nimport pageHeaderFig11 from \"./images/fig-11-dont-mix-alignment.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the page header component.\r\n\r\n\r\n \r\n \r\n \r\n Create coffee\r\n \r\n \r\n Filter coffee\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\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.\r\n\r\n\r\n\r\n### With action\r\n\r\nUse [buttons](/components/button) when you need to provide actions that affect all content on the page, for example to filter or to add a new record. Only use one primary button per page header. Use any type of button within the page header’s interaction area.\r\n\r\n### With input\r\n\r\nInclude an [input field](/components/search-bar) to search or filter data displayed on the page. Don’t overload the input area with components, consider placing them in the page content instead.\r\n\r\n### With breadcrumb navigation\r\n\r\nUse a [breadcrumb](/components/breadcrumb) to show the current page’s position in the app’s hierarchy or show a link to the parent page.\r\n\r\n### With tab navigation\r\n\r\nUse [tabs](/components/tabs) if the content grouped by the header can be split into distinct categories.\r\n\r\n### With stepper\r\n\r\nUse a [stepper](/components/stepper) to show progress through a multi-step process.\r\n\r\n## When not to use\r\n\r\nDon’t use the page header to include global actions or global navigation, instead use the [top navigation](/components/top-navigation) or [side navigation](/components/side-navigation).\r\n\r\n\r\n\r\n## Sizing\r\n\r\n\r\n\r\nSet the width of the page header to match the width of the page’s main content.\r\n\r\n\r\n\r\n\r\n\r\n## Layout and placement\r\n\r\n### Sticky scroll\r\n\r\nSet the page header to stick to the top of the screen if you need it to be visible when scrolling. Otherwise, set it to scroll with content to maximise available space for content.\r\n\r\n\r\n\r\n\r\n\r\n### Alignment\r\n\r\nAlign the page header either to the left, centre or full-width to match the rest of the content on the page.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nDon’t align a page header’s content differently to how the rest of the page content is aligned.\r\n\r\n\r\n\r\n## Content\r\n\r\nUse short titles that clearly describe the page's content.\r\n\r\nKeep page subtitles concise within the page header. If more content is required, consider placing it within the page itself.\r\n\r\nInclude a title adornment to convey information such as a status or versioning.\r\n\r\n## Related components\r\n\r\n- [Hero](/components/hero)\r\n- [Top navigation](/components/top-navigation)\r\n- [Side navigation](/components/side-navigation)\r\n", "path": "/components/page-header", "navPriority": 23, "date": "2024-05-10", @@ -2778,11 +2778,11 @@ } ], "meta": { - "relativePath": "components/page-header/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.404Z", - "lastModified": "2024-11-06T10:19:00.076Z", - "size": 9062, - "formattedSize": "8.8 KB" + "relativePath": "components\\page-header\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.108Z", + "lastModified": "2024-12-04T13:23:54.108Z", + "size": 9274, + "formattedSize": "9.1 KB" } }, { @@ -2809,16 +2809,16 @@ } ], "meta": { - "relativePath": "components/pagination/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.088Z", + "relativePath": "components\\pagination\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.618Z", + "lastModified": "2024-11-05T11:57:52.618Z", "size": 3216, "formattedSize": "3.1 KB" } }, { "id": "components\\pagination\\codex", - "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: `<>\n {shortCode}\n`,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {shortCode}\n`,\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: `.dark-background {\n background-color: #2c2f34;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n darkBackground: {\n backgroundColor: \"#2c2f34\",\n }\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n \n)`,\n },\n {\n language: \"Javascript\",\n snippet: `<>\n {shortCode}\n`,\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", + "contents": "\r\nimport { IcPagination } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n
\r\n \r\n
\r\n \r\n\r\n\r\n## Pagination details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Hide first and last page buttons\r\n\r\nexport const hideFirstLast = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Hide current page (only in 'simple' type)\r\n\r\nexport const hideCurrent = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Appearance\r\n\r\nexport const appearance = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: `.dark-background {\r\n background-color: #2c2f34;\r\n }\r\n \r\n \r\n {shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n darkBackground: {\r\n backgroundColor: \"#2c2f34\",\r\n }\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `<>\r\n {shortCode}\r\n`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n
\r\n \r\n
\r\n\r\n\r\n### Boundary and Adjacent items set\r\n\r\nexport const boundaryAdjacent = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Disabled\r\n\r\nexport const disabled = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Label\r\n\r\nexport const label = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n\r\n### Default page\r\n\r\nexport const defaultPage = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: ``,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `{shortCode}`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `{shortCode}`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\n\r\n \r\n\r\n", "path": "/components/pagination/code", "date": "2024-05-31", "title": "Pagination", @@ -2840,16 +2840,16 @@ } ], "meta": { - "relativePath": "components/pagination/code.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.088Z", - "size": 7202, - "formattedSize": "7.0 KB" + "relativePath": "components\\pagination\\code.mdx", + "createdAt": "2024-12-04T13:23:54.108Z", + "lastModified": "2024-12-04T13:23:54.108Z", + "size": 7551, + "formattedSize": "7.4 KB" } }, { "id": "components\\pagination\\guidancex", - "contents": "\nimport { IcPagination } from \"@ukic/react\";\nimport paginationFig1 from \"./images/fig-1-use-pagination-to-split-content-across-pages.png\";\nimport paginationFig2 from \"./images/fig-2-complex-simple-pagination.png\";\nimport paginationFig3 from \"./images/fig-3-data-table-with-pagination-bar.png\";\nimport paginationFig4 from \"./images/fig-4-use-colour-variants.png\";\nimport paginationFig5 from \"./images/fig-5-place-pagination-at-bottom.png\";\nimport paginationFig6 from \"./images/fig-6-place-pagination-at-top-and-bottom.png\";\nimport paginationFig7 from \"./images/fig-7-setting-adjacent-and-boundary-items.png\";\nimport paginationFig8 from \"./images/fig-8-pagination-bars-with-different-elements.png\";\n\n## Introduction\n\nPagination enables large amounts of content to be split across multiple pages so that it is more manageable and doesn’t require overly long page lengths.\n\n\n \n\n\n## Component variants\n\nThere are two types of pagination that can be used to control pages of content:\n\n- Complex pagination: Contains buttons for navigating to next, previous, first and last pages as well as individual page buttons for adjacent and boundary pages.\n- Simple pagination: Contains only buttons for navigating to next, previous, first and last pages. Displays the current page as a label.\n\nUse the pagination components within a pagination bar to provide other navigation controls including:\n\n- Items per page selector: Switch the number of content items visible per page.\n- Item count: Display the range of currently visible items as well as the total number of items.\n- Go to page shortcut: Allow quick access to any page number by typing the page number and hitting ‘go’.\n\n## When to use\n\nUse pagination when you have a large, known amount of content that can be split across pages. Order the content so the most relevant appears on the first page. Pagination works best for lists of content such as search results and data items.\n\nTry to create an understandable order to the content split across pages. This way it is easier to understand what content might appear on a later page.\n\nFor example, if content is ordered alphabetically, then it becomes obvious that entries beginning with a ‘Z’ would appear on the last few pages.\n\n\n\nUse pagination for content when there are other elements on the page that can be scrolled to. This means all elements on the page can easily be navigated to without scrolling through a large amount of content.\n\nPagination provides full control over the content; it allows navigation to any page of content quickly and gives an indication of the total amount of content available.\n\nUse complex pagination to allow people to easily navigate between pages without having to move sequentially through content. This allows people to quickly skip around between pages to search for specific content.\n\nUse simple pagination to navigate sequentially between pages using the ‘next’ and ‘previous’ buttons.\n\n\n \n\n\nUse a pagination bar to provide more navigation functionality through particularly complex data sets. For example, use pagination bars with data tables to navigate large data sets easily.\n\n\n\n## When not to use\n\nAvoid using pagination to split up linear content such as articles or blogs. Scrolling down the page makes it easier to consume this content.\n\nAvoid using pagination when the size of the content is unknown or if it frequently changes. This causes the number of pages to change frequently and means it is hard to create a ‘last page’ option.\n\nUse an infinite scrolling pattern when navigating content should be explorative, or when there is a near infinite amount of content. For example, newsfeeds and comments threads can be near endless and infinite scrolling allows exploration by simply continuing to scroll.\n\nAvoid using simple pagination when it is important to be able to move between specific pages; complex pagination is better for this as it shows more adjacent pages, allowing one click navigation.\n\n## Interaction behaviour\n\nPagination components fire an event when a new page is selected. Use this to trigger the switch of pages in the app.\n\nIn a pagination bar, when the number of items per page is changed, then the pagination component and the item count updates to show the new number of pages. Make sure to update the pagination component if anything else on the page changes the number of pages. For example, setting a filter may reduce the number of pages required to display the filtered results.\n\n## Colour\n\nUse the default, dark and light appearance pagination components when placing them on different coloured backgrounds to ensure the correct contrast ratios are met.\n\n\n\n## Layout and placement\n\nPlace the pagination component so that it is obvious what it controls. Match the width of a pagination bar to the width of the page.\n\nTry to place pagination at the bottom of the page it controls, as this encourages the user to read through the page before moving to the next. However, placing pagination at the top of the page is still a valid option.\n\n\n\nFor large page containers that require scrolling, use two pagination components at the top and bottom of the page container to provide easy access to navigation when at either the top or bottom of the page.\n\n\n\n## Content\n\nWhen using complex pagination, specify the number of adjacent pages to display next to the current page. Also specify the number of boundary pages to display at the start and end of the page range.\n\n\n\nSelect which elements within a pagination bar you want to display. Each element in the pagination bar can be toggled on or off except for the pagination component itself, which can be switched to use complex or simple pagination.\n\n\n\nBy default, pages are referred to as pages in the pagination component. Override the pagination label to change this. For example, change the term pages to ‘sheets’ if it makes more sense for a data table implementation.\n", + "contents": "\r\nimport { IcPagination } from \"@ukic/react\";\r\nimport paginationFig1 from \"./images/fig-1-use-pagination-to-split-content-across-pages.png\";\r\nimport paginationFig2 from \"./images/fig-2-complex-simple-pagination.png\";\r\nimport paginationFig3 from \"./images/fig-3-data-table-with-pagination-bar.png\";\r\nimport paginationFig4 from \"./images/fig-4-use-colour-variants.png\";\r\nimport paginationFig5 from \"./images/fig-5-place-pagination-at-bottom.png\";\r\nimport paginationFig6 from \"./images/fig-6-place-pagination-at-top-and-bottom.png\";\r\nimport paginationFig7 from \"./images/fig-7-setting-adjacent-and-boundary-items.png\";\r\nimport paginationFig8 from \"./images/fig-8-pagination-bars-with-different-elements.png\";\r\n\r\n## Introduction\r\n\r\nPagination enables large amounts of content to be split across multiple pages so that it is more manageable and doesn’t require overly long page lengths.\r\n\r\n\r\n \r\n\r\n\r\n## Component variants\r\n\r\nThere are two types of pagination that can be used to control pages of content:\r\n\r\n- Complex pagination: Contains buttons for navigating to next, previous, first and last pages as well as individual page buttons for adjacent and boundary pages.\r\n- Simple pagination: Contains only buttons for navigating to next, previous, first and last pages. Displays the current page as a label.\r\n\r\nUse the pagination components within a pagination bar to provide other navigation controls including:\r\n\r\n- Items per page selector: Switch the number of content items visible per page.\r\n- Item count: Display the range of currently visible items as well as the total number of items.\r\n- Go to page shortcut: Allow quick access to any page number by typing the page number and hitting ‘go’.\r\n\r\n## When to use\r\n\r\nUse pagination when you have a large, known amount of content that can be split across pages. Order the content so the most relevant appears on the first page. Pagination works best for lists of content such as search results and data items.\r\n\r\nTry to create an understandable order to the content split across pages. This way it is easier to understand what content might appear on a later page.\r\n\r\nFor example, if content is ordered alphabetically, then it becomes obvious that entries beginning with a ‘Z’ would appear on the last few pages.\r\n\r\n\r\n\r\nUse pagination for content when there are other elements on the page that can be scrolled to. This means all elements on the page can easily be navigated to without scrolling through a large amount of content.\r\n\r\nPagination provides full control over the content; it allows navigation to any page of content quickly and gives an indication of the total amount of content available.\r\n\r\nUse complex pagination to allow people to easily navigate between pages without having to move sequentially through content. This allows people to quickly skip around between pages to search for specific content.\r\n\r\nUse simple pagination to navigate sequentially between pages using the ‘next’ and ‘previous’ buttons.\r\n\r\n\r\n \r\n\r\n\r\nUse a pagination bar to provide more navigation functionality through particularly complex data sets. For example, use pagination bars with data tables to navigate large data sets easily.\r\n\r\n\r\n\r\n## When not to use\r\n\r\nAvoid using pagination to split up linear content such as articles or blogs. Scrolling down the page makes it easier to consume this content.\r\n\r\nAvoid using pagination when the size of the content is unknown or if it frequently changes. This causes the number of pages to change frequently and means it is hard to create a ‘last page’ option.\r\n\r\nUse an infinite scrolling pattern when navigating content should be explorative, or when there is a near infinite amount of content. For example, newsfeeds and comments threads can be near endless and infinite scrolling allows exploration by simply continuing to scroll.\r\n\r\nAvoid using simple pagination when it is important to be able to move between specific pages; complex pagination is better for this as it shows more adjacent pages, allowing one click navigation.\r\n\r\n## Interaction behaviour\r\n\r\nPagination components fire an event when a new page is selected. Use this to trigger the switch of pages in the app.\r\n\r\nIn a pagination bar, when the number of items per page is changed, then the pagination component and the item count updates to show the new number of pages. Make sure to update the pagination component if anything else on the page changes the number of pages. For example, setting a filter may reduce the number of pages required to display the filtered results.\r\n\r\n## Colour\r\n\r\nUse the default, dark and light appearance pagination components when placing them on different coloured backgrounds to ensure the correct contrast ratios are met.\r\n\r\n\r\n\r\n## Layout and placement\r\n\r\nPlace the pagination component so that it is obvious what it controls. Match the width of a pagination bar to the width of the page.\r\n\r\nTry to place pagination at the bottom of the page it controls, as this encourages the user to read through the page before moving to the next. However, placing pagination at the top of the page is still a valid option.\r\n\r\n\r\n\r\nFor large page containers that require scrolling, use two pagination components at the top and bottom of the page container to provide easy access to navigation when at either the top or bottom of the page.\r\n\r\n\r\n\r\n## Content\r\n\r\nWhen using complex pagination, specify the number of adjacent pages to display next to the current page. Also specify the number of boundary pages to display at the start and end of the page range.\r\n\r\n\r\n\r\nSelect which elements within a pagination bar you want to display. Each element in the pagination bar can be toggled on or off except for the pagination component itself, which can be switched to use complex or simple pagination.\r\n\r\n\r\n\r\nBy default, pages are referred to as pages in the pagination component. Override the pagination label to change this. For example, change the term pages to ‘sheets’ if it makes more sense for a data table implementation.\r\n", "path": "/components/pagination", "navPriority": 24, "date": "2023-05-05", @@ -2872,11 +2872,11 @@ } ], "meta": { - "relativePath": "components/pagination/guidance.mdx", - "createdAt": "2024-11-06T10:27:49.408Z", - "lastModified": "2024-11-06T10:19:00.088Z", - "size": 9583, - "formattedSize": "9.4 KB" + "relativePath": "components\\pagination\\guidance.mdx", + "createdAt": "2024-12-04T13:23:54.109Z", + "lastModified": "2024-12-04T13:23:54.109Z", + "size": 9748, + "formattedSize": "9.5 KB" } }, { @@ -2903,16 +2903,16 @@ } ], "meta": { - "relativePath": "components/popover-menu/accessibility.mdx", - "createdAt": "2024-11-06T10:27:49.400Z", - "lastModified": "2024-11-06T10:19:00.092Z", + "relativePath": "components\\popover-menu\\accessibility.mdx", + "createdAt": "2024-11-05T11:57:52.734Z", + "lastModified": "2024-11-05T11:57:52.734Z", "size": 3359, "formattedSize": "3.3 KB" } }, { - "id": "components__popover-menu__codex", - "contents": "\nimport { IcPopoverMenu, IcMenuItem, IcMenuGroup, IcButton } from \"@ukic/react\";\nimport { useState } 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 long: `{shortCode}\n`,\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: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n);`,\n },\n {\n language: \"Javascript\",\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n);`,\n },\n ],\n },\n },\n];\n\nexport const DemoPopover = () => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\n const handlePopoverClosed = () => setPopoverOpen(false);\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 long: `{shortCode}\n`,\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 long: [\n {\n language: \"Typescript\",\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n)`,\n },\n ],\n },\n },\n];\n\nexport const ButtonsPopover = () => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\n const handlePopoverClosed = () => setPopoverOpen(false);\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 long: `{shortCode}\n`,\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: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n);`,\n },\n {\n language: \"Javascript\",\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\nconst handlePopoverClosed = () => setPopoverOpen(false);\nreturn (\n <>\n {shortCode}\n \n);`,\n },\n ],\n },\n },\n];\n\nexport const GroupsPopover = () => {\n const [popoverOpen, setPopoverOpen] = useState(false);\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\n const handlePopoverClosed = () => setPopoverOpen(false);\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", + "id": "components\\popover-menu\\codex", + "contents": "\r\nimport { IcPopoverMenu, IcMenuItem, IcMenuGroup, IcButton } from \"@ukic/react\";\r\nimport { useState } from \"react\";\r\n\r\n## Component demo\r\n\r\nexport const snippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
`,\r\n long: `{shortCode}\r\n`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n);`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n);`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const DemoPopover = () => {\r\n const [popoverOpen, setPopoverOpen] = useState(false);\r\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\r\n const handlePopoverClosed = () => setPopoverOpen(false);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n## Popover menu details\r\n\r\n\r\n\r\n## Menu item details\r\n\r\n\r\n\r\n## Menu group details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With button variations\r\n\r\nexport const snippetsButtons = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
`,\r\n long: `{shortCode}\r\n`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const ButtonsPopover = () => {\r\n const [popoverOpen, setPopoverOpen] = useState(false);\r\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\r\n const handlePopoverClosed = () => setPopoverOpen(false);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### With menu groups\r\n\r\nexport const snippetsGroups = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
`,\r\n long: `{shortCode}\r\n`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n);`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [popoverOpen, setPopoverOpen] = useState(false);\r\nconst handlePopoverToggled = () => setPopoverOpen(value => !value);\r\nconst handlePopoverClosed = () => setPopoverOpen(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n \r\n);`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const GroupsPopover = () => {\r\n const [popoverOpen, setPopoverOpen] = useState(false);\r\n const handlePopoverToggled = () => setPopoverOpen((value) => !value);\r\n const handlePopoverClosed = () => setPopoverOpen(false);\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\n\r\n \r\n\r\n", "path": "/components/popover-menu/code", "date": "2024-05-31", "title": "Popover menu", @@ -2934,16 +2934,16 @@ } ], "meta": { - "relativePath": "components/popover-menu/code.mdx", - "createdAt": "2024-11-06T10:36:50.788Z", - "lastModified": "2024-11-06T10:36:50.788Z", - "size": 15648, - "formattedSize": "15.3 KB" + "relativePath": "components\\popover-menu\\code.mdx", + "createdAt": "2024-12-04T13:23:54.110Z", + "lastModified": "2024-12-04T13:23:54.110Z", + "size": 17310, + "formattedSize": "16.9 KB" } }, { "id": "components\\popover-menu\\guidancex", - "contents": "\nimport { IcPopoverMenu, IcMenuItem, IcButton } from \"@ukic/react\";\nimport { useRef } from \"react\";\nimport popoverFig1 from \"./images/fig-1-use-popover-menu-to-house-secondary-actions.png\";\nimport popoverFig2 from \"./images/fig-2-dont-use-popover-menu-for-few-actions.png\";\nimport popoverFig3 from \"./images/fig-3-set-maxheight-to-force-scroll.png\";\nimport popoverFig4 from \"./images/fig-4-position-menus-in-available-space.png\";\nimport popoverFig5 from \"./images/fig-5-menu-buttons-with-different-elements.png\";\nimport popoverFig6 from \"./images/fig-6-menu-toggle-buttons.png\";\nimport popoverFig7 from \"./images/fig-7-menu-groups.png\";\nimport popoverVid1 from \"./images/anim-1-popover-menu-interaction.mp4\";\nimport popoverVid2 from \"./images/anim-2-sub-menu-interaction.mp4\";\nimport popoverVid3 from \"./images/anim-3-avoid-nested-sub-menus.mp4\";\n\n## Introduction\n\nClick on the 'More Information' button below to view an example of the popover menu component.\n\nexport const IntroPopover = () => {\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## When to use\n\nUse a popover menu to place multiple actions behind a single trigger. This is especially useful when there is not enough space to include all actions on the base page. Popover menus are commonly used for ‘More actions’ and often triggered using an icon button.\n\n\n \n\n\n## When not to use\n\nDon’t use a popover menu if there are only a small number of actions. Consider if the actions can be better placed on the page itself.\n\nAvoid placing important actions in popover menus as these may be missed. Instead, use popover menus to house secondary or less important actions and place your most important actions on the page itself.\n\n\n \n\n\nDon’t include any other content within a popover menu other than the elements described in this page. If additional information is required about an action, consider using a [dialog](/components/dialog) instead.\n\n## Interaction behaviour\n\nWhen you click a trigger element, a popover menu appears. Make sure to associate the popover menu with a trigger and ensure that the trigger can be actioned via any input mode.\n\nWhen you click a menu item within a popover menu, the popover menu will hide and the menu item’s associated action will be triggered.\n\n\n \n\n\n### Sizing\n\nBy default, popover menus expand vertically to hug their contents. Set a max-height on the popover menu to constrain the height and allow the menu to scroll. Avoid setting the width of the popover menu to be greater than the available viewport.\n\n