` to provide navigational cues for screen readers.\r\n\r\n## Based on\r\n\r\nThe cards component has been based on the following resources:\r\n\r\n\r\n - \r\n \r\n How to build accessible cards-block links\r\n \r\n , Joel Strohmeier, accessed May 2022.\r\n
\r\n - \r\n \r\n Block Links, Cards, Clickable Regions, Rows, Etc.\r\n \r\n , Adrian Roselli, accessed May 2022.\r\n
\r\n - \r\n \r\n Cards\r\n \r\n , Inclusive components, accessed May 2022.\r\n
\r\n - \r\n \r\n Cards\r\n \r\n , A11y style guide, accessed May 2022.\r\n
\r\n - \r\n \r\n Cards\r\n \r\n , BBC, accessed May 2022.\r\n
\r\n
\r\n\r\n## Testing\r\n\r\nWe've tested this component against WCAG 2.2 Level AA. It's been tested with NVDA and VoiceOver, and several different users with different interaction methods.\r\n",
"path": "/components/card/accessibility",
"date": "2024-04-15",
"title": "Card",
@@ -1369,16 +1369,16 @@
}
],
"meta": {
- "relativePath": "components/cards/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:18:59.968Z",
- "size": 3439,
- "formattedSize": "3.4 KB"
+ "relativePath": "components\\cards\\accessibility.mdx",
+ "createdAt": "2024-12-04T13:23:54.064Z",
+ "lastModified": "2024-12-04T13:23:54.064Z",
+ "size": 3538,
+ "formattedSize": "3.5 KB"
}
},
{
"id": "components\\cards\\codex",
- "contents": "\nimport {\n IcCard,\n IcStatusTag,\n IcButton,\n IcTypography,\n SlottedSVG,\n IcBadge,\n} from \"@ukic/react\";\n\nexport const CardIcon = () => (\n \n);\n\nexport const InteractionIcon = () => (\n \n);\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n`,\n long: `ic-card {\n width: 22.5rem;\n }\n .interaction-area {\n display: flex;\n gap: var(--ic-space-md);\n }\n .card-image {\n height: 100%;\n width: 100%;\n max-height: 20.375rem;\n max-width: 20.375rem;\n }\n\n\n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n card: {\n width: \"22.5rem\",\n },\n cardImage: {\n height: \"100%\",\n width: \"100%\",\n maxHeight: \"20.375rem\",\n maxWidth: \"20.375rem\",\n },\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n card: {\n width: \"22.5rem\",\n },\n cardImage: {\n height: \"100%\",\n width: \"100%\",\n maxHeight: \"20.375rem\",\n maxWidth: \"20.375rem\",\n },\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n\n\n## Card details\n\n\n\n## Variants\n\n### Heading only\n\nexport const headingOnly = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### With icon\n\nexport const withIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Message\n\nexport const withMessage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### With subheading\n\nexport const withSubHeading = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Interaction button\n\nexport const interactionButton = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \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### Adornment\n\nexport const adornment = [\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 \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### Top image\n\nexport const topImage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: `ic-card {\n width: 22.5rem;\n }\n .card-image {\n height: 100%;\n width: 100%;\n maxHeight: 20.375rem;\n maxWidth: 20.375rem;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n card: {\n width: \"22.5rem\",\n },\n cardImage: {\n height: \"100%\",\n width: \"100%\",\n maxHeight: \"20.375rem\",\n maxWidth: \"20.375rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\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### Middle image\n\nexport const midImage = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: `ic-card {\n width: 22.5rem;\n }\n .card-image {\n height: 100%;\n width: 100%;\n maxHeight: 20.375rem;\n maxWidth: 20.375rem;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n card: {\n width: \"22.5rem\",\n },\n cardImage: {\n height: \"100%\",\n width: \"100%\",\n maxHeight: \"20.375rem\",\n maxWidth: \"20.375rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n card: {\n width: \"22.5rem\",\n },\n cardImage: {\n height: \"100%\",\n width: \"100%\",\n maxHeight: \"20.375rem\",\n maxWidth: \"20.375rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n\n\n### Interaction controls\n\nexport const interactionControls = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Accept\n Cancel\n
\n`,\n long: `.interaction-area {\n display: flex;\n gap: var(--ic-space-md);\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n Accept\n Cancel\n
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Accept\n Cancel\n
\n \n\n\n### Expandable\n\nexport const expandable = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n`,\n long: `.interaction-area {\n display: flex;\n gap: var(--ic-space-md);\n }\n\n\n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n interactionArea: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n },\n });\n const classes = useStyles();\n return (\n {shortCode}\n )`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n\n\n### Clickable link\n\nexport const clickableLink = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n 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 \n \n \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();\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 e.preventDefault()}\n >\n \n \n\n\n### Clickable button\n\nexport const clickableBtn = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\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(ev)}\n>\n \n \n \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();\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 console.log(ev)}\n >\n \n \n\n\n### With badge\n\nexport const withBadge = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n 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 \n \n \n \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();\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 e.preventDefault()}\n >\n \n \n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `.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 \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();\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\n\n### Full width\n\nexport const fullWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\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 \n \n \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();\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\n\n### Wrapped by link\n\nexport const wrapped = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\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 \n \n \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();\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 e.preventDefault()}\n style={{ textDecoration: \"none\", color: \"var(--ic-architechtural-black)\" }}\n aria-label=\"Americano order card\"\n >\n \n \n \n \n\n",
+ "contents": "\r\nimport {\r\n IcCard,\r\n IcStatusTag,\r\n IcButton,\r\n IcTypography,\r\n SlottedSVG,\r\n IcBadge,\r\n} from \"@ukic/react\";\r\n\r\nexport const CardIcon = () => (\r\n \r\n);\r\n\r\nexport const InteractionIcon = () => (\r\n \r\n);\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 Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n`,\r\n long: `ic-card {\r\n width: 22.5rem;\r\n }\r\n .interaction-area {\r\n display: flex;\r\n gap: var(--ic-space-md);\r\n }\r\n .card-image {\r\n height: 100%;\r\n width: 100%;\r\n max-height: 20.375rem;\r\n max-width: 20.375rem;\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 \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 Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n card: {\r\n width: \"22.5rem\",\r\n },\r\n cardImage: {\r\n height: \"100%\",\r\n width: \"100%\",\r\n maxHeight: \"20.375rem\",\r\n maxWidth: \"20.375rem\",\r\n },\r\n interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 card: {\r\n width: \"22.5rem\",\r\n },\r\n cardImage: {\r\n height: \"100%\",\r\n width: \"100%\",\r\n maxHeight: \"20.375rem\",\r\n maxWidth: \"20.375rem\",\r\n },\r\n interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 \r\n \r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n \r\n\r\n\r\n## Card details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Heading only\r\n\r\nexport const headingOnly = [\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 icon\r\n\r\nexport const withIcon = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### Message\r\n\r\nexport const withMessage = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### With subheading\r\n\r\nexport const withSubHeading = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### Interaction button\r\n\r\nexport const interactionButton = [\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 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`,\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### Adornment\r\n\r\nexport const adornment = [\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 \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### Top image\r\n\r\nexport const topImage = [\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 long: `ic-card {\r\n width: 22.5rem;\r\n }\r\n .card-image {\r\n height: 100%;\r\n width: 100%;\r\n maxHeight: 20.375rem;\r\n maxWidth: 20.375rem;\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 \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 long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n card: {\r\n width: \"22.5rem\",\r\n },\r\n cardImage: {\r\n height: \"100%\",\r\n width: \"100%\",\r\n maxHeight: \"20.375rem\",\r\n maxWidth: \"20.375rem\",\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: `{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### Middle image\r\n\r\nexport const midImage = [\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 long: `ic-card {\r\n width: 22.5rem;\r\n }\r\n .card-image {\r\n height: 100%;\r\n width: 100%;\r\n maxHeight: 20.375rem;\r\n maxWidth: 20.375rem;\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 \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 long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n card: {\r\n width: \"22.5rem\",\r\n },\r\n cardImage: {\r\n height: \"100%\",\r\n width: \"100%\",\r\n maxHeight: \"20.375rem\",\r\n maxWidth: \"20.375rem\",\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 card: {\r\n width: \"22.5rem\",\r\n },\r\n cardImage: {\r\n height: \"100%\",\r\n width: \"100%\",\r\n maxHeight: \"20.375rem\",\r\n maxWidth: \"20.375rem\",\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 \r\n \r\n \r\n \r\n\r\n\r\n### Interaction controls\r\n\r\nexport const interactionControls = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n`,\r\n long: `.interaction-area {\r\n display: flex;\r\n gap: var(--ic-space-md);\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 \r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 Accept\r\n Cancel\r\n
\r\n \r\n\r\n\r\n### Expandable\r\n\r\nexport const expandable = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n`,\r\n long: `.interaction-area {\r\n display: flex;\r\n gap: var(--ic-space-md);\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 \r\n \r\n Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 interactionArea: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\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 Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n \r\n\r\n\r\n### Clickable link\r\n\r\nexport const clickableLink = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\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 \r\n \r\n \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\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 e.preventDefault()}\r\n >\r\n \r\n \r\n\r\n\r\n### Clickable button\r\n\r\nexport const clickableBtn = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\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(ev)}\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 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 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 console.log(ev)}\r\n >\r\n \r\n \r\n\r\n\r\n### With badge\r\n\r\nexport const withBadge = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n`,\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 \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 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 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 e.preventDefault()}\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 \r\n`,\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 \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\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\r\n\r\n### Full width\r\n\r\nexport const fullWidth = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\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 \r\n \r\n \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\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\r\n\r\n### Wrapped by link\r\n\r\nexport const wrapped = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n \r\n`,\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 \r\n \r\n \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\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 e.preventDefault()}\r\n style={{ textDecoration: \"none\", color: \"var(--ic-architechtural-black)\" }}\r\n aria-label=\"Americano order card\"\r\n >\r\n \r\n \r\n \r\n \r\n\r\n",
"path": "/components/card/code",
"date": "2024-05-31",
"title": "Card",
@@ -1400,16 +1400,16 @@
}
],
"meta": {
- "relativePath": "components/cards/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:18:59.968Z",
- "size": 56785,
- "formattedSize": "55.5 KB"
+ "relativePath": "components\\cards\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.064Z",
+ "lastModified": "2024-12-04T13:23:54.064Z",
+ "size": 58872,
+ "formattedSize": "57.5 KB"
}
},
{
"id": "components\\cards\\guidancex",
- "contents": "\nimport { IcCard, IcButton, IcTypography, IcStatusTag } from \"@ukic/react\";\nimport cardsFig1 from \"./images/fig-1-card-anatomy.png\";\nimport cardsFig2 from \"./images/fig-2-heading-area-anatomy.png\";\nimport cardsFig3 from \"./images/fig-3-place-images-either-at-the-top-or-in-the-middle-of-cards-if-content-is-present.png\";\nimport cardsFig4 from \"./images/fig-4-dont-place-images-below-content.png\";\nimport cardsFig5 from \"./images/fig-5-interaction-area-anatomy.png\";\nimport cardsFig6 from \"./images/fig-6-dont-mix-card-variants-when-arranged-in-a-group.png\";\nimport cardsFig7 from \"./images/fig-7-dont-vertically-align-cards-with-different-widths.png\";\nimport cardsFig10 from \"./images/fig-10-use-the-show-less-show-more-pattern-when-adding-long-portions-of-text-to-the-content-area.png\";\nimport cardsFig11 from \"./images/fig-11-avoid-displaying-lengthy-descriptions-in-the-content-area.png\";\n\n## Component variants\n\nThere are three variants of cards:\n\n- Interactive cards\n- Static cards\n- Clickable cards\n\n\n \n \n \n \n \n \n \n \n Accept\n Cancel\n
\n \n To cancel your order click cancel.\n \n \n\n\n### Interactive cards\n\nInteractive cards contain different types of content and actions. The container itself is not interactive but can have interactive components.\n\n### Clickable cards\n\nClickable cards provide a single action that is triggered by clicking anywhere on the card.\n\n### Static cards\n\nStatic cards are non-interactive and contain static content only.\n\n## Anatomy\n\nThe following section describes the different areas of content on a card.\n\n\n\n### 1. Heading area\n\n\n\nThe heading area can contain:\n\n- A: Icon/Avatar\n- B: Heading\n- C: Subtitle\n- D: Adornment, for example [status tags](/components/status-tag)\n- E: More options icon button (only for interactive cards)\n\n### 2. Image\n\nInclude an image either at the top or in the middle of the card. Don't place images below content if this is included in the card.\n\n\n \n \n\n\n### 3. Content area\n\nAdd a descriptive message within the card content section. Interactive and static cards can include a 'see more' link to expand hidden content.\n\nSince clickable cards can only contain one interaction, text can't be hidden.\n\n### 4. Interaction area (interactive cards only)\n\n\n\nAdd interactive components to the interaction area at the bottom of the card (A). Avoid using too many interactions. The interaction area is only found in interactive cards.\n\nUse any type of button in the interaction area to provide actions.\n\nInclude an expand button (E) if you include content in the [expandable area](/components/card#5-expandable-area-interactive-cards-only).\n\n### 5. Expandable area (interactive cards only)\n\nUse an expandable area to hold content that either doesn't fit in the collapsed card or doesn't align to the above areas.\n\nThis area can be expanded by clicking the “expand” button found on the interaction bar.\n\n## Layout and placement\n\n### Grouping\n\nWhen arranging multiple cards together, try to use the same card variant for each.\n\n\n\n### Sizing\n\nWhen cards are shown in columns, make sure cards are vertically aligned and maintain the same width for all cards.\n\nWhen arranging cards in rows, try to match the vertical height of the cards by including similar amounts of content so that they automatically align horizontally.\n\n\n\n## Content\n\nKeep headings, subheadings and adornments clear and concise.\n\n### Image\n\nUse the pre-defined aspect ratios for images in cards. These are:\n\n- 16:9\n- 1:1\n- 9:16\n- 4:1\n- 4:3\n- 3:4\n\nSet an image to fit within the image container to show the whole image, but this may introduce empty areas in the image container if the image does not match the container aspect ratio. Alternatively, set the image to fill the image container, but be aware this may crop some of the image’s content.\n\nUse a custom image aspect ratio if your image doesn't fit into one of the pre-defined options.\n\nImages should always feature an `alt` attribute. Set the `alt` equal to a descriptive alternative when an image is informational.\n\n### Content area\n\nIf placing several lines of text in the content area, use a 'see more' link to make the content expandable.\n\n\n \n \n\n\n## Custom cards\n\nCards can also be used as custom containers if the pre-defined options don't meet your needs. When designing a custom card, make sure to respect the general anatomy and structure of cards as defined in this document.\n\nAny interactive components must be placed either within the interaction bar, or the expandable area. Make sure the interactive area is always placed at the bottom of a collapsed card.\n\nCards support one single image. If you need to place two or more images, place the additional images in the expandable area.\n\nDon't include any interactive components within a clickable card as these will interfere with the clickable card’s own action.\n",
+ "contents": "\r\nimport { IcCard, IcButton, IcTypography, IcStatusTag } from \"@ukic/react\";\r\nimport cardsFig1 from \"./images/fig-1-card-anatomy.png\";\r\nimport cardsFig2 from \"./images/fig-2-heading-area-anatomy.png\";\r\nimport cardsFig3 from \"./images/fig-3-place-images-either-at-the-top-or-in-the-middle-of-cards-if-content-is-present.png\";\r\nimport cardsFig4 from \"./images/fig-4-dont-place-images-below-content.png\";\r\nimport cardsFig5 from \"./images/fig-5-interaction-area-anatomy.png\";\r\nimport cardsFig6 from \"./images/fig-6-dont-mix-card-variants-when-arranged-in-a-group.png\";\r\nimport cardsFig7 from \"./images/fig-7-dont-vertically-align-cards-with-different-widths.png\";\r\nimport cardsFig10 from \"./images/fig-10-use-the-show-less-show-more-pattern-when-adding-long-portions-of-text-to-the-content-area.png\";\r\nimport cardsFig11 from \"./images/fig-11-avoid-displaying-lengthy-descriptions-in-the-content-area.png\";\r\n\r\n## Component variants\r\n\r\nThere are three variants of cards:\r\n\r\n- Interactive cards\r\n- Static cards\r\n- Clickable cards\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n \r\n To cancel your order click cancel.\r\n \r\n \r\n\r\n\r\n### Interactive cards\r\n\r\nInteractive cards contain different types of content and actions. The container itself is not interactive but can have interactive components.\r\n\r\n### Clickable cards\r\n\r\nClickable cards provide a single action that is triggered by clicking anywhere on the card.\r\n\r\n### Static cards\r\n\r\nStatic cards are non-interactive and contain static content only.\r\n\r\n## Anatomy\r\n\r\nThe following section describes the different areas of content on a card.\r\n\r\n\r\n\r\n### 1. Heading area\r\n\r\n\r\n\r\nThe heading area can contain:\r\n\r\n- A: Icon/Avatar\r\n- B: Heading\r\n- C: Subtitle\r\n- D: Adornment, for example [status tags](/components/status-tag)\r\n- E: More options icon button (only for interactive cards)\r\n\r\n### 2. Image\r\n\r\nInclude an image either at the top or in the middle of the card. Don't place images below content if this is included in the card.\r\n\r\n\r\n \r\n \r\n\r\n\r\n### 3. Content area\r\n\r\nAdd a descriptive message within the card content section. Interactive and static cards can include a 'see more' link to expand hidden content.\r\n\r\nSince clickable cards can only contain one interaction, text can't be hidden.\r\n\r\n### 4. Interaction area (interactive cards only)\r\n\r\n\r\n\r\nAdd interactive components to the interaction area at the bottom of the card (A). Avoid using too many interactions. The interaction area is only found in interactive cards.\r\n\r\nUse any type of button in the interaction area to provide actions.\r\n\r\nInclude an expand button (E) if you include content in the [expandable area](/components/card#5-expandable-area-interactive-cards-only).\r\n\r\n### 5. Expandable area (interactive cards only)\r\n\r\nUse an expandable area to hold content that either doesn't fit in the collapsed card or doesn't align to the above areas.\r\n\r\nThis area can be expanded by clicking the “expand” button found on the interaction bar.\r\n\r\n## Layout and placement\r\n\r\n### Grouping\r\n\r\nWhen arranging multiple cards together, try to use the same card variant for each.\r\n\r\n\r\n\r\n### Sizing\r\n\r\nWhen cards are shown in columns, make sure cards are vertically aligned and maintain the same width for all cards.\r\n\r\nWhen arranging cards in rows, try to match the vertical height of the cards by including similar amounts of content so that they automatically align horizontally.\r\n\r\n\r\n\r\n## Content\r\n\r\nKeep headings, subheadings and adornments clear and concise.\r\n\r\n### Image\r\n\r\nUse the pre-defined aspect ratios for images in cards. These are:\r\n\r\n- 16:9\r\n- 1:1\r\n- 9:16\r\n- 4:1\r\n- 4:3\r\n- 3:4\r\n\r\nSet an image to fit within the image container to show the whole image, but this may introduce empty areas in the image container if the image does not match the container aspect ratio. Alternatively, set the image to fill the image container, but be aware this may crop some of the image’s content.\r\n\r\nUse a custom image aspect ratio if your image doesn't fit into one of the pre-defined options.\r\n\r\nImages should always feature an `alt` attribute. Set the `alt` equal to a descriptive alternative when an image is informational.\r\n\r\n### Content area\r\n\r\nIf placing several lines of text in the content area, use a 'see more' link to make the content expandable.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Custom cards\r\n\r\nCards can also be used as custom containers if the pre-defined options don't meet your needs. When designing a custom card, make sure to respect the general anatomy and structure of cards as defined in this document.\r\n\r\nAny interactive components must be placed either within the interaction bar, or the expandable area. Make sure the interactive area is always placed at the bottom of a collapsed card.\r\n\r\nCards support one single image. If you need to place two or more images, place the additional images in the expandable area.\r\n\r\nDon't include any interactive components within a clickable card as these will interfere with the clickable card’s own action.\r\n",
"path": "/components/card",
"navPriority": 8,
"date": "2023-02-03",
@@ -1432,11 +1432,11 @@
}
],
"meta": {
- "relativePath": "components/cards/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:18:59.968Z",
- "size": 10600,
- "formattedSize": "10.4 KB"
+ "relativePath": "components\\cards\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.064Z",
+ "lastModified": "2024-12-04T13:23:54.064Z",
+ "size": 10869,
+ "formattedSize": "10.6 KB"
}
},
{
@@ -1463,16 +1463,16 @@
}
],
"meta": {
- "relativePath": "components/checkboxes/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.976Z",
+ "relativePath": "components\\checkboxes\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:50.907Z",
+ "lastModified": "2024-11-05T11:57:50.907Z",
"size": 2745,
"formattedSize": "2.7 KB"
}
},
{
"id": "components\\checkboxes\\codex",
- "contents": "\nimport { IcCheckboxGroup, IcCheckbox, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(\"onIcChange\", ev.detail.value)}>\n console.log(\"onIcCheck\", ev)} />\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n >\n console.log(\"onIcCheck\", ev)}\n />\n \n \n \n\n\n## Checkbox group details\n\n\n\n## Checkbox details\n\n\n\n## Variants\n\n### Hidden label\n\nexport const snippetsHiddenLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Helper text\n\nexport const snippetsHelperText = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n\n\n \n \n\n\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n\n\n \n \n\n\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `<>\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 \n \n \n \n \n \n\n\n### Setting each checkbox size\n\nexport const snippetsSettingEachCheckboxSize = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `<>\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### Conditional\n\nexport const snippetsConditional = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const snippetsConditionalDynamic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n
\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Indeterminate\n\nexport const snippetsIndeterminate = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n",
+ "contents": "\r\nimport { IcCheckboxGroup, IcCheckbox, IcTextField } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippetsDefault = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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: ` console.log(\"onIcChange\", ev.detail.value)}>\r\n console.log(\"onIcCheck\", ev)} />\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 console.log(\"onIcChange\", ev.detail.value)}\r\n >\r\n console.log(\"onIcCheck\", ev)}\r\n />\r\n \r\n \r\n \r\n\r\n\r\n## Checkbox group details\r\n\r\n\r\n\r\n## Checkbox details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Hidden label\r\n\r\nexport const snippetsHiddenLabel = [\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: `{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### Helper text\r\n\r\nexport const snippetsHelperText = [\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: `{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### 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\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 \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 \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n### Setting each checkbox size\r\n\r\nexport const snippetsSettingEachCheckboxSize = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### Conditional\r\n\r\nexport const snippetsConditional = [\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`,\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\r\n\r\n### Conditional dynamic\r\n\r\nexport const snippetsConditionalDynamic = [\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`,\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 \r\n
\r\n\r\n\r\n### Validation\r\n\r\nexport const snippetsValidation = [\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: `{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### Indeterminate\r\n\r\nexport const snippetsIndeterminate = [\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 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 \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 \r\n \r\n \r\n \r\n \r\n\r\n",
"path": "/components/checkbox/code",
"date": "2024-05-31",
"title": "Checkbox",
@@ -1494,11 +1494,11 @@
}
],
"meta": {
- "relativePath": "components/checkboxes/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.976Z",
- "size": 18091,
- "formattedSize": "17.7 KB"
+ "relativePath": "components\\checkboxes\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.083Z",
+ "lastModified": "2024-12-04T13:23:54.083Z",
+ "size": 18664,
+ "formattedSize": "18.2 KB"
}
},
{
@@ -1526,9 +1526,9 @@
}
],
"meta": {
- "relativePath": "components/checkboxes/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.980Z",
+ "relativePath": "components\\checkboxes\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:50.995Z",
+ "lastModified": "2024-11-05T11:57:50.995Z",
"size": 8556,
"formattedSize": "8.4 KB"
}
@@ -1557,16 +1557,16 @@
}
],
"meta": {
- "relativePath": "components/chips/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.980Z",
+ "relativePath": "components\\chips\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.015Z",
+ "lastModified": "2024-11-05T11:57:51.015Z",
"size": 2777,
"formattedSize": "2.7 KB"
}
},
{
"id": "components\\chips\\codex",
- "contents": "\nimport { IcChip } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n\n\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev)}>\n \n \n \n\n\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `<>\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\n\n## Chip details\n\n\n\n## Variants\n\n### Outline\n\nexport const snippetsOutline = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Dismissible\n\nexport const snippetsDismissible = [\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: ` console.log(ev)}>\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev)}>\n \n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n\n\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n\n\n \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\n",
+ "contents": "\r\nimport { IcChip } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippetsDefault = [\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 long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(ev)}>\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: `<>\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\r\n\r\n## Chip details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Outline\r\n\r\nexport const snippetsOutline = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### Dismissible\r\n\r\nexport const snippetsDismissible = [\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: ` console.log(ev)}>\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 console.log(ev)}>\r\n \r\n \r\n\r\n\r\n### Disabled\r\n\r\nexport const snippetsDisabled = [\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 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`,\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\r\n",
"path": "/components/chip/code",
"date": "2024-05-31",
"title": "Chip",
@@ -1588,11 +1588,11 @@
}
],
"meta": {
- "relativePath": "components/chips/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.980Z",
- "size": 10153,
- "formattedSize": "9.9 KB"
+ "relativePath": "components\\chips\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.083Z",
+ "lastModified": "2024-12-04T13:23:54.083Z",
+ "size": 10539,
+ "formattedSize": "10.3 KB"
}
},
{
@@ -1621,9 +1621,9 @@
],
"tags": ["Tags"],
"meta": {
- "relativePath": "components/chips/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:18:59.980Z",
+ "relativePath": "components\\chips\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:51.086Z",
+ "lastModified": "2024-11-05T11:57:51.086Z",
"size": 6649,
"formattedSize": "6.5 KB"
}
@@ -1652,9 +1652,9 @@
}
],
"meta": {
- "relativePath": "components/classification-banner/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
+ "relativePath": "components\\classification-banner\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.101Z",
+ "lastModified": "2024-11-05T11:57:51.101Z",
"size": 1188,
"formattedSize": "1.2 KB"
}
@@ -1683,9 +1683,9 @@
}
],
"meta": {
- "relativePath": "components/classification-banner/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
+ "relativePath": "components\\classification-banner\\code.mdx",
+ "createdAt": "2024-11-05T11:57:51.118Z",
+ "lastModified": "2024-11-05T11:57:51.118Z",
"size": 3208,
"formattedSize": "3.1 KB"
}
@@ -1715,16 +1715,16 @@
}
],
"meta": {
- "relativePath": "components/classification-banner/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
+ "relativePath": "components\\classification-banner\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:51.139Z",
+ "lastModified": "2024-11-05T11:57:51.139Z",
"size": 2020,
"formattedSize": "2.0 KB"
}
},
{
"id": "components\\data-entity\\accessibilityx",
- "contents": "\n## Easy to use for everyone\n\nThe data entity component is descriptive and designed to inform the user in a comprehensive format about their inputs before making a submission. By including an interaction area, it provides users with a direct link or action to interact with an individual row.\n\n## For Assistive Technology\n\nThe data entity can either be interactive or non-interactive. It is therefore included in the tab-indexing for keyboard navigation as individual entity items, allowing it to be read out by screen readers using the aria-current attribute.\n\n## Based on\n\nThe data entity component has been based on the following resources:\n\n\n - \n \n Check answers\n \n , GOV.UK Design System, accessed September 2022.\n
\n - \n \n A live service is not the end of the story\n \n , DWP Digital, accessed September 2022.\n
\n - \n \n Help users to check answers\n \n , ONS, accessed September 2022.\n
\n
\n\n## Testing\n\nWe’ve tested this component against WCAG 2.2 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\n",
+ "contents": "\r\n## Easy to use for everyone\r\n\r\nThe data entity component is descriptive and designed to inform the user in a comprehensive format about their inputs before making a submission. By including an interaction area, it provides users with a direct link or action to interact with an individual row.\r\n\r\n## For Assistive Technology\r\n\r\nThe data entity can either be interactive or non-interactive. It is therefore included in the tab-indexing for keyboard navigation as individual entity items, allowing it to be read out by screen readers using the aria-current attribute.\r\n\r\n## Based on\r\n\r\nThe data entity component has been based on the following resources:\r\n\r\n\r\n - \r\n \r\n Check answers\r\n \r\n , GOV.UK Design System, accessed September 2022.\r\n
\r\n - \r\n \r\n A live service is not the end of the story\r\n \r\n , DWP Digital, accessed September 2022.\r\n
\r\n - \r\n \r\n Help users to check answers\r\n \r\n , ONS, accessed September 2022.\r\n
\r\n
\r\n\r\n## Testing\r\n\r\nWe’ve tested this component against WCAG 2.2 Level AA. It’s been tested with NVDA and VoiceOver, and several different users with different interaction methods.\r\n",
"path": "/components/data-entity/accessibility",
"date": "2024-04-15",
"title": "Data entity",
@@ -1746,16 +1746,16 @@
}
],
"meta": {
- "relativePath": "components/data-entity/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
- "size": 2202,
+ "relativePath": "components\\data-entity\\accessibility.mdx",
+ "createdAt": "2024-12-04T13:23:54.084Z",
+ "lastModified": "2024-12-04T13:23:54.084Z",
+ "size": 2271,
"formattedSize": "2.2 KB"
}
},
{
"id": "components\\data-entity\\codex",
- "contents": "\nimport {\n IcDataEntity,\n IcDataRow,\n IcLink,\n IcTypography,\n IcTextField,\n IcButton,\n IcStatusTag,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n Edit\n \n \n \n \n VISA ending 5896\n \n \n Edit\n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n VISA ending 5896\n \n e.preventDefault()} slot=\"end-component\">\n Edit\n \n \n \n \n \n \n \n \n\n\n## Data row details\n\n\n\n## Data entity details\n\n\n\n## Variants\n\n### With status tags\n\nexport const withStatusTags = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n \n \n VISA ending 5896\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n 383 Coffee Drive\n
\n London\n
\n SW7 988\n
\n United Kingdom\n \n \n \n\n\n### Editable example\n\nexport const editableExample = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n Confirm\n \n \n Edit\n \n
`,\n long: `.btn-container {\n display: flex;\n gap: var(--ic-space-md);\n padding-top: var(--ic-space-md);\n }\n .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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.setAttribute('readonly', '');\n });\n }}\n >\n Confirm\n \n {\n const textFields = document.querySelectorAll('ic-text-field');\n textFields.forEach((textField) => {\n textField.removeAttribute('readonly');\n });\n }}\n variant=\"secondary\"\n >\n Edit\n \n
`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n paddingTop: \"var(--ic-space-md)\",\n },\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn ( \n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n gap: \"var(--ic-space-md)\",\n paddingTop: \"var(--ic-space-md)\",\n },\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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.setAttribute(\"readonly\", \"\");\n });\n }}\n style={{\n marginRight: \"var(--ic-space-md)\",\n marginTop: \"var(--ic-space-lg)\",\n }}\n >\n Confirm\n \n {\n const textFields = document.querySelectorAll(\"ic-text-field\");\n textFields.forEach((textField) => {\n textField.removeAttribute(\"readonly\");\n });\n }}\n variant=\"secondary\"\n style={{ marginTop: \"var(--ic-space-lg)\" }}\n >\n Edit\n \n\n",
+ "contents": "\r\nimport {\r\n IcDataEntity,\r\n IcDataRow,\r\n IcLink,\r\n IcTypography,\r\n IcTextField,\r\n IcButton,\r\n IcStatusTag,\r\n} 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 \r\n Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n VISA ending 5896\r\n \r\n \r\n Edit\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 Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n \r\n \r\n \r\n VISA ending 5896\r\n \r\n \r\n Edit\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 e.preventDefault()} slot=\"end-component\">\r\n Edit\r\n \r\n \r\n \r\n e.preventDefault()} slot=\"end-component\">\r\n Edit\r\n \r\n \r\n \r\n e.preventDefault()} slot=\"end-component\">\r\n Edit\r\n \r\n \r\n \r\n e.preventDefault()} slot=\"end-component\">\r\n Edit\r\n \r\n \r\n \r\n \r\n VISA ending 5896\r\n \r\n e.preventDefault()} slot=\"end-component\">\r\n Edit\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Data row details\r\n\r\n\r\n\r\n## Data entity details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With status tags\r\n\r\nexport const withStatusTags = [\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 VISA ending 5896\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 VISA ending 5896\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 VISA ending 5896\r\n \r\n \r\n \r\n \r\n\r\n\r\n### Size small\r\n\r\nexport const smallSnippet = [\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 383 Coffee Drive\r\n
\r\n London\r\n
\r\n SW7 988\r\n
\r\n United Kingdom\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 \r\n \r\n \r\n \r\n \r\n \r\n 383 Coffee Drive\r\n
\r\n London\r\n
\r\n SW7 988\r\n
\r\n United Kingdom\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 383 Coffee Drive\r\n
\r\n London\r\n
\r\n SW7 988\r\n
\r\n United Kingdom\r\n \r\n \r\n \r\n\r\n\r\n### Editable example\r\n\r\nexport const editableExample = [\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 Confirm\r\n \r\n \r\n Edit\r\n \r\n
`,\r\n long: `.btn-container {\r\n display: flex;\r\n gap: var(--ic-space-md);\r\n padding-top: var(--ic-space-md);\r\n }\r\n .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 \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 const textFields = document.querySelectorAll('ic-text-field');\r\n textFields.forEach((textField) => {\r\n textField.setAttribute('readonly', '');\r\n });\r\n }}\r\n >\r\n Confirm\r\n \r\n {\r\n const textFields = document.querySelectorAll('ic-text-field');\r\n textFields.forEach((textField) => {\r\n textField.removeAttribute('readonly');\r\n });\r\n }}\r\n variant=\"secondary\"\r\n >\r\n Edit\r\n \r\n
`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n btnContainer: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\r\n paddingTop: \"var(--ic-space-md)\",\r\n },\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 language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n btnContainer: {\r\n display: \"flex\",\r\n gap: \"var(--ic-space-md)\",\r\n paddingTop: \"var(--ic-space-md)\",\r\n },\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 \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 const textFields = document.querySelectorAll(\"ic-text-field\");\r\n textFields.forEach((textField) => {\r\n textField.setAttribute(\"readonly\", \"\");\r\n });\r\n }}\r\n style={{\r\n marginRight: \"var(--ic-space-md)\",\r\n marginTop: \"var(--ic-space-lg)\",\r\n }}\r\n >\r\n Confirm\r\n \r\n {\r\n const textFields = document.querySelectorAll(\"ic-text-field\");\r\n textFields.forEach((textField) => {\r\n textField.removeAttribute(\"readonly\");\r\n });\r\n }}\r\n variant=\"secondary\"\r\n style={{ marginTop: \"var(--ic-space-lg)\" }}\r\n >\r\n Edit\r\n \r\n\r\n",
"path": "/components/data-entity/code",
"date": "2024-05-31",
"title": "Data entity",
@@ -1777,16 +1777,16 @@
}
],
"meta": {
- "relativePath": "components/data-entity/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
- "size": 17951,
- "formattedSize": "17.5 KB"
+ "relativePath": "components\\data-entity\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.087Z",
+ "lastModified": "2024-12-04T13:23:54.087Z",
+ "size": 18700,
+ "formattedSize": "18.3 KB"
}
},
{
"id": "components\\data-entity\\guidancex",
- "contents": "\nimport { IcDataEntity, IcDataRow } from \"@ukic/react\";\nimport dataEntityFig1 from \"./images/fig-1-assign-interactions-to-individual-rows-within-the-interaction-area,-or-the-full-data-entity-table-by-using-buttons-at-the-end-of-the-table.png\";\nimport dataEntityFig2 from \"./images/fig-2-make-sure-the-data-in-the-cell-displays-in-its-correct-format.png\";\nimport dataEntityFig3 from \"./images/fig-3-do-not-pass-non-text-data-in-a-text-format.png\";\nimport dataEntityFig4 from \"./images/fig-4-set-the-width-of-all-data-entity-tables-on-a-page-to-the-same-size.png\";\nimport dataEntityFig5 from \"./images/fig-5-do-not-set-different-widths-for-different-data-entity-tables.png\";\nimport dataEntityFig6 from \"./images/fig-6-make-sure-that-a-data-entity-table-always-has-a-section-header.png\";\nimport dataEntityFig7 from \"./images/fig-7-do-not-omit-section-headers-from-data-entity-tables.png\";\n\n## Introduction\n\nAn example of the data entity component.\n\n\n \n \n \n \n \n\n\n## Interaction behaviour\n\nUse the interaction area in a data entity row to provide an action to that row's data. For example, providing an edit link could display an edit screen so that the value can be changed.\n\nTo include interactions that affect the whole data entity, design a pattern using buttons with clear labels.\n\n\n\n## Content\n\nCells display the following types of data in a specific format:\n\n- Text\n- Numbers\n- Date\n- Telephone\n\n\n \n \n\n\n## Sizing\n\nWhen multiple data entities are present on a page, make sure to size them all equally.\n\n\n \n \n\n\n## Layout and placement\n\nAlways include a section header, even when using a single row.\n\n\n \n \n\n",
+ "contents": "\r\nimport { IcDataEntity, IcDataRow } from \"@ukic/react\";\r\nimport dataEntityFig1 from \"./images/fig-1-assign-interactions-to-individual-rows-within-the-interaction-area,-or-the-full-data-entity-table-by-using-buttons-at-the-end-of-the-table.png\";\r\nimport dataEntityFig2 from \"./images/fig-2-make-sure-the-data-in-the-cell-displays-in-its-correct-format.png\";\r\nimport dataEntityFig3 from \"./images/fig-3-do-not-pass-non-text-data-in-a-text-format.png\";\r\nimport dataEntityFig4 from \"./images/fig-4-set-the-width-of-all-data-entity-tables-on-a-page-to-the-same-size.png\";\r\nimport dataEntityFig5 from \"./images/fig-5-do-not-set-different-widths-for-different-data-entity-tables.png\";\r\nimport dataEntityFig6 from \"./images/fig-6-make-sure-that-a-data-entity-table-always-has-a-section-header.png\";\r\nimport dataEntityFig7 from \"./images/fig-7-do-not-omit-section-headers-from-data-entity-tables.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the data entity component.\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Interaction behaviour\r\n\r\nUse the interaction area in a data entity row to provide an action to that row's data. For example, providing an edit link could display an edit screen so that the value can be changed.\r\n\r\nTo include interactions that affect the whole data entity, design a pattern using buttons with clear labels.\r\n\r\n\r\n\r\n## Content\r\n\r\nCells display the following types of data in a specific format:\r\n\r\n- Text\r\n- Numbers\r\n- Date\r\n- Telephone\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Sizing\r\n\r\nWhen multiple data entities are present on a page, make sure to size them all equally.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Layout and placement\r\n\r\nAlways include a section header, even when using a single row.\r\n\r\n\r\n \r\n \r\n\r\n",
"path": "/components/data-entity",
"navPriority": 12,
"date": "2023-02-03",
@@ -1809,16 +1809,16 @@
}
],
"meta": {
- "relativePath": "components/data-entity/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.000Z",
- "size": 4762,
- "formattedSize": "4.7 KB"
+ "relativePath": "components\\data-entity\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.087Z",
+ "lastModified": "2024-12-04T13:23:54.087Z",
+ "size": 4880,
+ "formattedSize": "4.8 KB"
}
},
{
"id": "components\\data-table\\codex",
- "contents": "\nimport { IcDataTable, IcDataTableTitleBar } from \"@ukic/canary-react\";\nimport {\n IcEmptyState,\n IcButton,\n IcLink,\n SlottedSVG,\n IcTypography,\n} from \"@ukic/react\";\nimport { useRef } from \"react\";\nimport { mdiImage, mdiCakeVariantOutline } from \"@mdi/js\";\nimport {\n COLUMNS,\n DATA,\n LONG_COLUMNS,\n LONG_DATA,\n ROW_HEADER_COLUMNS,\n ROW_HEADER_DATA,\n COLUMN_OVERRIDES,\n ROW_OVERRIDES_DATA,\n CELL_OVERRIDES_DATA,\n COLUMNS_ELEMENTS,\n DATA_ELEMENTS,\n ICON_COLUMNS,\n ICON_DATA,\n LOADING_DATA,\n TRUNCATION_COLUMNS,\n TRUNCATION_DATA,\n} from \"./story-data\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n## Data table details\n\n\n\n## Variants\n\n### Embedded\n\nexport const snippetsEmbedded = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Dense\n\nexport const snippetsDense = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Spacious\n\nexport const snippetsSpacious = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sticky column headers\n\nexport const snippetsStickyColumnHeaders = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `ic-data-table {\n height: 9.375rem;\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 dataTableEl = useRef(null);\nconst stickHeader = (sticky: boolean) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n};\nconst long_columns: IcDataTableColumnObject[] = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nconst useStyles = createUseStyles({\n dataTable: {\n height: \"18.75rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const dataTableEl = useRef(null);\nconst stickHeader = (sticky) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n};\nconst long_columns = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nconst useStyles = createUseStyles({\n dataTable: {\n height: \"18.75rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const StickyColumnHeaders = () => {\n const dataTableEl = useRef(null);\n const stickHeader = (sticky) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n };\n return (\n <>\n \n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n );\n};\n\n\n \n\n\n### Row headers\n\nexport const snippetsRowHeaders = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sortable\n\nexport const snippetsSortable = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sort options\n\nexport const snippetsSortOptions = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Pagination\n\nexport const snippetsPagination = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const long_columns: IcDataTableColumnObject[] = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const long_columns = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Column overrides\n\nexport const snippetsColumnOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n columnAlignment: { horizontal: 'center', vertical: 'middle'},\n emphasis: 'high',\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n columnAlignment: { horizontal: 'center', vertical: 'middle'},\n emphasis: 'high',\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Row overrides\n\nexport const snippetsRowOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"header\",\n title: \"Job Title\",\n dataType: \"string\",\n },\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n header: { title: \"Employee\" },\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n header: { title: \"Employee\" },\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n header: { title: \"Manager\" },\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"header\",\n title: \"Job Title\",\n dataType: \"string\",\n },\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n header: { title: \"Employee\" },\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n header: { title: \"Employee\" },\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n header: { title: \"Manager\" },\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Cell overrides\n\nexport const snippetsCellOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n cellAlignment: { horizontal: \"center\", vertical: \"middle\" },\n emphasis: \"high\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n cellAlignment: { horizontal: \"center\", vertical: \"middle\" },\n emphasis: \"high\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Default Empty State\n\nexport const snippetsDefaultEmptyState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Slotted Empty State\n\nexport const snippetsSlottedEmptyState = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Retry\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Retry\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Retry\n \n \n\n\n### Loading state\n\nexport const snippetsLoadingState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n {\n firstName: \"Naomi\",\n lastName: \"Thomas\",\n age: 32,\n },\n {\n firstName: \"Luke\",\n lastName: \"Ashford\",\n age: 18,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n{\n firstName: \"Naomi\",\n lastName: \"Thomas\",\n age: 32,\n },\n {\n firstName: \"Luke\",\n lastName: \"Ashford\",\n age: 18,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Updating state\n\nexport const snippetsUpdatingState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Links and Elements in data\n\nexport const snippetsElements = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n {data.map((_, index) => (\n _.closest('Delete')}\n >\n Delete\n \n ))}\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n {\n key: \"actions\",\n title: \"Actions\",\n dataType: \"element\",\n columnAlignment: { horizontal: \"center\" },\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n href: \"#\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: 'Sarah',\n lastName: 'Smith',\n age: 28,\n },\n {\n firstName: 'Mark',\n lastName: 'Owens',\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n {\n key: \"actions\",\n title: \"Actions\",\n dataType: \"element\",\n columnAlignment: { horizontal: \"center\" },\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n href: \"#\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: 'Sarah',\n lastName: 'Smith',\n age: 28,\n },\n {\n firstName: 'Mark',\n lastName: 'Owens',\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n {DATA_ELEMENTS.map((_, index) => (\n console.log(\"Delete\")}\n >\n Delete\n \n ))}\n \n\n\n### Custom icons\n\nexport const snippetsCustomIcons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const accountSVG = \\`\\`;\nconst columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n cellAlignment: \"right\",\n columnAlignment: { horizontal: \"right\", vertical: \"middle\" },\n icon: {\n icon: \\`\\`,\n onAllCells: true,\n hideOnHeader: true,\n },\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n cellAlignment: \"center\",\n columnAlignment: { horizontal: \"center\", vertical: \"bottom\" },\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n icon: accountSVG,\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: {\n data: \"Mark\",\n icon: accountSVG,\n },\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const accountSVG = \\`\\`;\nconst columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n cellAlignment: \"right\",\n columnAlignment: { horizontal: \"right\", vertical: \"middle\" },\n icon: {\n icon: \\`\\`,\n onAllCells: true,\n hideOnHeader: true,\n },\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n cellAlignment: \"center\",\n columnAlignment: { horizontal: \"center\", vertical: \"bottom\" },\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n icon: accountSVG,\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: {\n data: \"Mark\",\n icon: accountSVG,\n },\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Custom row heights\n\nexport const snippetsRowHeights = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nconst rowHeightFunc = ({ firstName, lastName }) => firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nconst rowHeightFunc = ({ firstName, lastName }) => firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const rowHeightFunc = ({ firstName, lastName }) =>\n firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\n\n\n \n\n\n### Custom title bar\n\nexport const snippetsTitleBar = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and{' '}\n this is an inline link within the text.\n
\n \n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and{' '}\n this is an inline link within the text.\n
\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and this is an inline link{\" \"}\n within the text.\n
\n \n \n \n\n\n### Truncation - tooltip\n\nexport const snippetsTooltip = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Truncation - show/hide\n\nexport const snippetsShowHide = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Text wrap\n\nexport const snippetsTextWrap = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n textWrap: true,\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n textWrap: true,\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n",
+ "contents": "\nimport { IcDataTable, IcDataTableTitleBar } from \"@ukic/canary-react\";\nimport {\n IcEmptyState,\n IcButton,\n IcLink,\n SlottedSVG,\n IcTypography,\n} from \"@ukic/react\";\nimport { useRef } from \"react\";\nimport { mdiImage, mdiCakeVariantOutline } from \"@mdi/js\";\nimport {\n COLUMNS,\n DATA,\n LONG_COLUMNS,\n LONG_DATA,\n ROW_HEADER_COLUMNS,\n ROW_HEADER_DATA,\n COLUMN_OVERRIDES,\n ROW_OVERRIDES_DATA,\n CELL_OVERRIDES_DATA,\n COLUMNS_ELEMENTS,\n DATA_ELEMENTS,\n ICON_COLUMNS,\n ICON_DATA,\n LOADING_DATA,\n TRUNCATION_COLUMNS,\n TRUNCATION_DATA,\n} from \"./story-data\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n## Data table details\n\n\n\n## Variants\n\n### Embedded\n\nexport const snippetsEmbedded = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Dense\n\nexport const snippetsDense = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Spacious\n\nexport const snippetsSpacious = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sticky column headers\n\nexport const snippetsStickyColumnHeaders = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `ic-data-table {\n height: 9.375rem;\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 dataTableEl = useRef(null);\nconst stickHeader = (sticky: boolean) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n};\nconst long_columns: IcDataTableColumnObject[] = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nconst useStyles = createUseStyles({\n dataTable: {\n height: \"18.75rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const dataTableEl = useRef(null);\nconst stickHeader = (sticky) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n};\nconst long_columns = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nconst useStyles = createUseStyles({\n dataTable: {\n height: \"18.75rem\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const StickyColumnHeaders = () => {\n const dataTableEl = useRef(null);\n const stickHeader = (sticky) => {\n dataTableEl.current.stickyColumnHeaders = sticky;\n };\n return (\n <>\n \n stickHeader(true)}>Stick Header\n stickHeader(false)}>Unstick Header\n >\n );\n};\n\n\n \n\n\n### Row headers\n\nexport const snippetsRowHeaders = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Sortable\n\nexport const snippetsSortable = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(\"Sort changed\", e.detail)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n console.log(\"Sort changed\", e.detail)}\n />\n\n\n### Sort options\n\nexport const snippetsSortOptions = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Pagination\n\nexport const snippetsPagination = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const long_columns: IcDataTableColumnObject[] = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const long_columns = [\n {\n key: \"employeeNumber\",\n title: \"Employee number\",\n dataType: \"number\",\n columnAlignment: { horizontal: \"left\" },\n },\n {\n key: \"name\",\n title: \"Name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst long_data = [\n {\n employeeNumber: 1,\n name: \"Joe Bloggs\",\n age: 30,\n },\n {\n employeeNumber: 2,\n name: \"Sarah Jones\",\n age: 28,\n },\n {\n employeeNumber: 3,\n name: \"Mark Owens\",\n age: 45,\n },\n {\n employeeNumber: 4,\n name: \"Naomi Thomas\",\n age: 32,\n },\n {\n employeeNumber: 5,\n name: \"Luke Ashford\",\n age: 18,\n },\n {\n employeeNumber: 6,\n name: \"Dave Smith\",\n age: 33,\n },\n {\n employeeNumber: 7,\n name: \"Amy Fox\",\n age: 27,\n },\n {\n employeeNumber: 8,\n name: \"Mary Cooper\",\n age: 31,\n },\n {\n employeeNumber: 9,\n name: \"Alice Cole\",\n age: 38,\n },\n {\n employeeNumber: 10,\n name: \"Ben Fields\",\n age: 40,\n },\n {\n employeeNumber: 11,\n name: \"Pete Norton\",\n age: 32,\n },\n {\n employeeNumber: 12,\n name: \"Ashley Langford\",\n age: 29,\n },\n {\n employeeNumber: 13,\n name: \"Michael Hall\",\n age: 35,\n },\n {\n employeeNumber: 14,\n name: \"David Frank\",\n age: 28,\n },\n {\n employeeNumber: 15,\n name: \"Mary Lincoln\",\n age: 23,\n },\n {\n employeeNumber: 16,\n name: \"Will Barns\",\n age: 36,\n },\n {\n employeeNumber: 17,\n name: \"Elizabeth Long\",\n age: 43,\n },\n {\n employeeNumber: 18,\n name: \"Keith Jones\",\n age: 37,\n },\n {\n employeeNumber: 19,\n name: \"Olivia Brown\",\n age: 19,\n },\n {\n employeeNumber: 20,\n name: \"Tim Green\",\n age: 50,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Column overrides\n\nexport const snippetsColumnOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n columnAlignment: { horizontal: 'center', vertical: 'middle'},\n emphasis: 'high',\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n columnAlignment: { horizontal: 'center', vertical: 'middle'},\n emphasis: 'high',\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Row overrides\n\nexport const snippetsRowOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"header\",\n title: \"Job Title\",\n dataType: \"string\",\n },\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n header: { title: \"Employee\" },\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n header: { title: \"Employee\" },\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n header: { title: \"Manager\" },\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"header\",\n title: \"Job Title\",\n dataType: \"string\",\n },\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n header: { title: \"Employee\" },\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n header: { title: \"Employee\" },\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n header: { title: \"Manager\" },\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Cell overrides\n\nexport const snippetsCellOverrides = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n cellAlignment: { horizontal: \"center\", vertical: \"middle\" },\n emphasis: \"high\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n cellAlignment: { horizontal: \"center\", vertical: \"middle\" },\n emphasis: \"high\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Default Empty State\n\nexport const snippetsDefaultEmptyState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Slotted Empty State\n\nexport const snippetsSlottedEmptyState = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Retry\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Retry\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Retry\n \n \n\n\n### Loading state\n\nexport const snippetsLoadingState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n {\n firstName: \"Naomi\",\n lastName: \"Thomas\",\n age: 32,\n },\n {\n firstName: \"Luke\",\n lastName: \"Ashford\",\n age: 18,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n{\n firstName: \"Naomi\",\n lastName: \"Thomas\",\n age: 32,\n },\n {\n firstName: \"Luke\",\n lastName: \"Ashford\",\n age: 18,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Updating state\n\nexport const snippetsUpdatingState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n // dataType types: \"string\" | \"number\" | \"address\" | \"element\" | \"date\";\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Links and Elements in data\n\nexport const snippetsElements = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n {data.map((_, index) => (\n _.closest('Delete')}\n >\n Delete\n \n ))}\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n {\n key: \"actions\",\n title: \"Actions\",\n dataType: \"element\",\n columnAlignment: { horizontal: \"center\" },\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n href: \"#\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: 'Sarah',\n lastName: 'Smith',\n age: 28,\n },\n {\n firstName: 'Mark',\n lastName: 'Owens',\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n {\n key: \"actions\",\n title: \"Actions\",\n dataType: \"element\",\n columnAlignment: { horizontal: \"center\" },\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n href: \"#\",\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: 'Sarah',\n lastName: 'Smith',\n age: 28,\n },\n {\n firstName: 'Mark',\n lastName: 'Owens',\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n {DATA_ELEMENTS.map((_, index) => (\n console.log(\"Delete\")}\n >\n Delete\n \n ))}\n \n\n\n### Custom icons\n\nexport const snippetsCustomIcons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const accountSVG = \\`\\`;\nconst columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n cellAlignment: \"right\",\n columnAlignment: { horizontal: \"right\", vertical: \"middle\" },\n icon: {\n icon: \\`\\`,\n onAllCells: true,\n hideOnHeader: true,\n },\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n cellAlignment: \"center\",\n columnAlignment: { horizontal: \"center\", vertical: \"bottom\" },\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n icon: accountSVG,\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: {\n data: \"Mark\",\n icon: accountSVG,\n },\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const accountSVG = \\`\\`;\nconst columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n cellAlignment: \"right\",\n columnAlignment: { horizontal: \"right\", vertical: \"middle\" },\n icon: {\n icon: \\`\\`,\n onAllCells: true,\n hideOnHeader: true,\n },\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n cellAlignment: \"center\",\n columnAlignment: { horizontal: \"center\", vertical: \"bottom\" },\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: {\n data: \"Joe\",\n icon: accountSVG,\n },\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: {\n data: \"Mark\",\n icon: accountSVG,\n },\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Custom row heights\n\nexport const snippetsRowHeights = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nconst rowHeightFunc = ({ firstName, lastName }) => firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nconst rowHeightFunc = ({ firstName, lastName }) => firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const rowHeightFunc = ({ firstName, lastName }) =>\n firstName === \"Joe\" || lastName === \"Owens\" ? 200 : null;\n\n\n \n\n\n### Custom title bar\n\nexport const snippetsTitleBar = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and{' '}\n this is an inline link within the text.\n
\n \n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and{' '}\n this is an inline link within the text.\n
\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"age\",\n title: \"Age\",\n dataType: \"number\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n age: 30,\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n age: 28,\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n age: 45,\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Primary\n \n \n \n \n \n \n \n \n \n \n \n This is some text and this is an inline link{\" \"}\n within the text.\n
\n \n \n \n\n\n### Truncation - tooltip\n\nexport const snippetsTooltip = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Truncation - show/hide\n\nexport const snippetsShowHide = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Text wrap\n\nexport const snippetsTextWrap = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const columns: IcDataTableColumnObject[] = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n textWrap: true,\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const columns = [\n {\n key: \"firstName\",\n title: \"First name\",\n dataType: \"string\",\n },\n {\n key: \"lastName\",\n title: \"Last name\",\n dataType: \"string\",\n },\n {\n key: \"jobTitle\",\n title: \"Job title\",\n dataType: \"string\",\n textWrap: true,\n },\n];\nconst data = [\n {\n firstName: \"Joe\",\n lastName: \"Bloggs\",\n jobTitle: \"Senior Software Developer, Site Reliability Engineering\",\n },\n {\n firstName: \"Sarah\",\n lastName: \"Smith\",\n jobTitle: \"Junior developer\",\n },\n {\n firstName: \"Mark\",\n lastName: \"Owens\",\n jobTitle: \"Team lead\",\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n\n",
"path": "/components/data-table/code",
"date": "2024-08-21",
"title": "Data table",
@@ -1835,11 +1835,11 @@
}
],
"meta": {
- "relativePath": "components/data-table/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.004Z",
- "size": 81274,
- "formattedSize": "79.4 KB"
+ "relativePath": "components\\data-table\\code.mdx",
+ "createdAt": "2024-12-04T12:10:34.567Z",
+ "lastModified": "2024-12-04T12:10:34.567Z",
+ "size": 81546,
+ "formattedSize": "79.6 KB"
}
},
{
@@ -1863,9 +1863,9 @@
],
"tags": ["Table"],
"meta": {
- "relativePath": "components/data-table/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.004Z",
+ "relativePath": "components\\data-table\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:51.375Z",
+ "lastModified": "2024-11-05T11:57:51.375Z",
"size": 1735,
"formattedSize": "1.7 KB"
}
@@ -1893,9 +1893,9 @@
}
],
"meta": {
- "relativePath": "components/date-input/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.004Z",
+ "relativePath": "components\\date-input\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.446Z",
+ "lastModified": "2024-11-05T11:57:51.446Z",
"size": 3605,
"formattedSize": "3.5 KB"
}
@@ -1923,9 +1923,9 @@
}
],
"meta": {
- "relativePath": "components/date-input/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.004Z",
+ "relativePath": "components\\date-input\\code.mdx",
+ "createdAt": "2024-11-05T11:57:51.516Z",
+ "lastModified": "2024-11-05T11:57:51.516Z",
"size": 17301,
"formattedSize": "16.9 KB"
}
@@ -1954,9 +1954,9 @@
}
],
"meta": {
- "relativePath": "components/date-input/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.004Z",
+ "relativePath": "components\\date-input\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:51.562Z",
+ "lastModified": "2024-11-05T11:57:51.562Z",
"size": 8270,
"formattedSize": "8.1 KB"
}
@@ -1984,16 +1984,16 @@
}
],
"meta": {
- "relativePath": "components/date-picker/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
+ "relativePath": "components\\date-picker\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.584Z",
+ "lastModified": "2024-11-05T11:57:51.584Z",
"size": 3243,
"formattedSize": "3.2 KB"
}
},
{
"id": "components\\date-picker\\codex",
- "contents": "\nimport { IcDatePicker } from \"@ukic/canary-react\";\nimport { useState } from \"react\";\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 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();\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## Date picker details\n\n\n\n## Variants\n\n### Sizes\n\nSet the size of the date picker by using the `size` prop. This prop takes the values `small`, `default` or `large`. Depending on the chosen size, the prop will apply styling to increase or decrease the amount of spacing within the component.\n\nexport const sizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\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: `IcDatePicker\n label=\"When would you like to collect your coffee?\"\n size=\"small\"\n/>\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();\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 gap: \"var(--ic-space-md)\",\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 \n
\n\n\n### Max width\n\nSet the size of the input field by using the `--input-width` CSS custom property. The picker will grow, but not exceed its maximum supported width.\n\nexport const maxWidth = [\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 ic-date-picker {\n --input-width: 31.25rem;\n }\n\n\n \n {shortCode}\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 datePicker: {\n \"--input-width\": \"31.25rem\",\n },\n});\nconst classes = useStyles();\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 gap: \"var(--ic-space-md)\",\n padding: \"var(--ic-space-md)\",\n },\n datePicker: {\n \"--input-width\": \"31.25rem\",\n },\n});\nconst classes = useStyles();\nreturn ( \n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\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: `.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();\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### Date formats\n\nThe `dateFormat` prop determines how dates are displayed. The supported formats are `DD/MM/YYYY`, `MM/DD/YYYY` or `YYYY/MM/DD`.\nThe default format is `DD/MM/YYYY`.\n\nexport const dateFormats = [\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 ic-date-picker {\n --input-width: 31.25rem;\n }\n\n\n \n {shortCode}\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();\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 gap: \"var(--ic-space-md)\",\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 \n
\n\n\n### Value\n\nThe `value` prop sets the date in the input field. The value can be in any format supported by the `dateFormat` prop, in ISO 8601 date string format (yyyy-mm-dd) or as a JavaScript Date object.\n\nexport const valueSnippet = [\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();\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### Open at date\n\nIf no `value` is set, the `openAtDate` prop can be used to specify the date in view when the calendar view is opened. If not set to a value, the calendar will default to showing the current date.\n\nThe supported formats are the same as for the `value` prop.\n\nexport const openDate = [\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();\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### Start of week\n\nThe first day of the week can be changed by setting the `startOfWeek` prop. This is a numeric value where 0 = Sunday, 1 = Monday, etc. up to 6 = Saturday.\n\nexport const startWeek = [\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();\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### Disable days of week\n\nSpecific days of the week can be disabled from selection by setting the `disableDays` prop. The value can be set as an array of numeric values where 0 = Sunday, 1 = Monday, etc. up to 6 = Saturday.\n\nexport const disabledDaysOfWeek = [0, 6];\n\nexport const disableDays = [\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 disabledDaysOfWeek = [0, 6]\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const disabledDaysOfWeek = [0, 6];\nconst 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### Max and min\n\nThe `max` and `min` props can be used to limit the range of dates available for selection. Values can be in any format supported by the `dateFormat` prop, in ISO 8601 date string format (yyyy-mm-dd) or as a JavaScript Date object.\n\nexport const maxMin = [\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();\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### Disable dates in past\n\nDates before today can be disabled with the `disablePast` prop.\n\nexport const disablePast = [\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();\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### Disable dates in future\n\nDates after today can be disabled with the `disableFuture` prop.\n\nexport const disableFuture = [\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();\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### Days outside month hidden\n\nDays outside of the current month in view can be hidden by setting the `showDaysOutsideMonth` prop to `false`.\n\nexport const dayHidden = [\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();\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### Today and clear buttons hidden\n\nThe 'Go to today' and 'Clear' buttons can be hidden from the calendar view by setting the `showPickerTodayButton` and `showPickerClearButton` props to `false`.\n\nexport const btnHidden = [\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();\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### Javascript dates\n\nAny prop that accepts a date value can be set to a Javascript Date object. The following example sets the `value`, `max` and `min` props.\n\nexport const jsDates = [\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();\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### IcChange Event\n\nThe `IcChange` event is emitted by the date picker when the selected date changes.\n\nexport const change = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n Selected date:\n`,\n long: `.parent-container {\n display: flex;\n flex-direction: column;\n gap: 3.125rem;\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 {selectedDate}\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\nconst [value, setValue] = useState();\nconst dateChangedHandler = (event: { detail: { value: Date; }; }) => {\n setValue(event.detail.value);\n setSelectedDate(\"Selected date: \" + event.detail.value);\n};\nconst useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3.125rem\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\nconst [value, setValue] = useState();\nconst dateChangedHandler = (event) => {\n setValue(event.detail.value);\n setSelectedDate(\"Selected date: \" + event.detail.value);\n};\nconst useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3.125rem\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\nexport const DatePickerWithIcChange = () => {\n const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\n const [value, setValue] = useState();\n const dateChangedHandler = (event) => {\n setValue(event.detail.value);\n setSelectedDate(`Selected date: ${event.detail.value}`);\n };\n return (\n \n \n {selectedDate}\n
\n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport { IcDatePicker } from \"@ukic/canary-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 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\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## Date picker details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Sizes\r\n\r\nSet the size of the date picker by using the `size` prop. This prop takes the values `small`, `default` or `large`. Depending on the chosen size, the prop will apply styling to increase or decrease the amount of spacing within the component.\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 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: `IcDatePicker\r\n label=\"When would you like to collect your coffee?\"\r\n size=\"small\"\r\n/>\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\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 gap: \"var(--ic-space-md)\",\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 \r\n
\r\n\r\n\r\n### Max width\r\n\r\nSet the size of the input field by using the `--input-width` CSS custom property. The picker will grow, but not exceed its maximum supported width.\r\n\r\nexport const maxWidth = [\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 ic-date-picker {\r\n --input-width: 31.25rem;\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 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 datePicker: {\r\n \"--input-width\": \"31.25rem\",\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 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 datePicker: {\r\n \"--input-width\": \"31.25rem\",\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
\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: `.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\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### Date formats\r\n\r\nThe `dateFormat` prop determines how dates are displayed. The supported formats are `DD/MM/YYYY`, `MM/DD/YYYY` or `YYYY/MM/DD`.\r\nThe default format is `DD/MM/YYYY`.\r\n\r\nexport const dateFormats = [\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 ic-date-picker {\r\n --input-width: 31.25rem;\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 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\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 gap: \"var(--ic-space-md)\",\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 \r\n
\r\n\r\n\r\n### Value\r\n\r\nThe `value` prop sets the date in the input field. The value can be in any format supported by the `dateFormat` prop, in ISO 8601 date string format (yyyy-mm-dd) or as a JavaScript Date object.\r\n\r\nexport const valueSnippet = [\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\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### Open at date\r\n\r\nIf no `value` is set, the `openAtDate` prop can be used to specify the date in view when the calendar view is opened. If not set to a value, the calendar will default to showing the current date.\r\n\r\nThe supported formats are the same as for the `value` prop.\r\n\r\nexport const openDate = [\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\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### Start of week\r\n\r\nThe first day of the week can be changed by setting the `startOfWeek` prop. This is a numeric value where 0 = Sunday, 1 = Monday, etc. up to 6 = Saturday.\r\n\r\nexport const startWeek = [\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\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### Disable days of week\r\n\r\nSpecific days of the week can be disabled from selection by setting the `disableDays` prop. The value can be set as an array of numeric values where 0 = Sunday, 1 = Monday, etc. up to 6 = Saturday.\r\n\r\nexport const disabledDaysOfWeek = [0, 6];\r\n\r\nexport const disableDays = [\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 disabledDaysOfWeek = [0, 6]\r\nconst 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 language: \"Javascript\",\r\n snippet: `const disabledDaysOfWeek = [0, 6];\r\nconst 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### Max and min\r\n\r\nThe `max` and `min` props can be used to limit the range of dates available for selection. Values can be in any format supported by the `dateFormat` prop, in ISO 8601 date string format (yyyy-mm-dd) or as a JavaScript Date object.\r\n\r\nexport const maxMin = [\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\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### Disable dates in past\r\n\r\nDates before today can be disabled with the `disablePast` prop.\r\n\r\nexport const disablePast = [\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\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### Disable dates in future\r\n\r\nDates after today can be disabled with the `disableFuture` prop.\r\n\r\nexport const disableFuture = [\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\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### Days outside month hidden\r\n\r\nDays outside of the current month in view can be hidden by setting the `showDaysOutsideMonth` prop to `false`.\r\n\r\nexport const dayHidden = [\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\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### Today and clear buttons hidden\r\n\r\nThe 'Go to today' and 'Clear' buttons can be hidden from the calendar view by setting the `showPickerTodayButton` and `showPickerClearButton` props to `false`.\r\n\r\nexport const btnHidden = [\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\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### Javascript dates\r\n\r\nAny prop that accepts a date value can be set to a Javascript Date object. The following example sets the `value`, `max` and `min` props.\r\n\r\nexport const jsDates = [\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\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### IcChange Event\r\n\r\nThe `IcChange` event is emitted by the date picker when the selected date changes.\r\n\r\nexport const change = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n Selected date:\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 3.125rem;\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 {selectedDate}\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\r\nconst [value, setValue] = useState();\r\nconst dateChangedHandler = (event: { detail: { value: Date; }; }) => {\r\n setValue(event.detail.value);\r\n setSelectedDate(\"Selected date: \" + event.detail.value);\r\n};\r\nconst useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: \"3.125rem\",\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 language: \"Javascript\",\r\n snippet: `const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\r\nconst [value, setValue] = useState();\r\nconst dateChangedHandler = (event) => {\r\n setValue(event.detail.value);\r\n setSelectedDate(\"Selected date: \" + event.detail.value);\r\n};\r\nconst useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: \"3.125rem\",\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\nexport const DatePickerWithIcChange = () => {\r\n const [selectedDate, setSelectedDate] = useState(\"Selected date:\");\r\n const [value, setValue] = useState();\r\n const dateChangedHandler = (event) => {\r\n setValue(event.detail.value);\r\n setSelectedDate(`Selected date: ${event.detail.value}`);\r\n };\r\n return (\r\n \r\n \r\n {selectedDate}\r\n
\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n",
"path": "/components/date-picker/code",
"date": "2024-05-31",
"title": "Date picker",
@@ -2014,11 +2014,11 @@
}
],
"meta": {
- "relativePath": "components/date-picker/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
- "size": 30548,
- "formattedSize": "29.8 KB"
+ "relativePath": "components\\date-picker\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.096Z",
+ "lastModified": "2024-12-04T13:23:54.096Z",
+ "size": 31813,
+ "formattedSize": "31.1 KB"
}
},
{
@@ -2046,9 +2046,9 @@
],
"tags": ["Calendar", "Datetime picker"],
"meta": {
- "relativePath": "components/date-picker/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
+ "relativePath": "components\\date-picker\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:51.706Z",
+ "lastModified": "2024-11-05T11:57:51.706Z",
"size": 5256,
"formattedSize": "5.1 KB"
}
@@ -2077,16 +2077,16 @@
}
],
"meta": {
- "relativePath": "components/dialog/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
+ "relativePath": "components\\dialog\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.730Z",
+ "lastModified": "2024-11-05T11:57:51.730Z",
"size": 4110,
"formattedSize": "4.0 KB"
}
},
{
"id": "components\\dialog\\codex",
- "contents": "\nimport {\n IcAlert,\n IcDialog,\n IcButton,\n IcCheckboxGroup,\n IcCheckbox,\n IcTypography,\n IcSelect,\n} from \"@ukic/react\";\nimport { useRef, useState } from \"react\";\n\nexport const buttonProps = [\n {\n label: \"Go back\",\n onclick: \"this.cancelDialog()\",\n },\n {\n label: \"Continue\",\n onclick: \"alert('Added to basket'); this.open = false;\",\n },\n];\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const DefaultDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n >\n );\n};\n\n\n \n\n\n## Dialog details\n\n\n\n## Variants\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch sizes dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to\n continue?\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n ],\n },\n },\n];\n\nexport const SizesDialogs = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n Launch sizes dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n >\n );\n};\n\n\n \n\n\n### With status alerts\n\nexport const snippetsAlert = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch status dialog\n\n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Launch status dialog\n\n\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenlDialog(false);\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenlDialog(false);\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n ],\n },\n },\n];\n\nexport const AlertDialog = () => {\n const dialogEl = useRef(null);\n const addTitleAboveAttribute = () => {\n dialogEl.current\n .querySelector(\"ic-alert\")\n .setAttribute(\"title-above\", \"true\");\n };\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => {\n addTitleAboveAttribute();\n setOpenDialog(true);\n };\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch dialog\n \n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n >\n );\n};\n\n\n \n\n\n### Button variations\n\nexport const snippetsCustomButtons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch no button dialog\nLaunch single button dialog\nLaunch three button dialog\nLaunch destructive button dialog\n\n Sorry, you cannot place orders at the moment. Please try again later.\n\n\n \n Your order for an Americano coffee has been placed.\n \n\n\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua.\n\n\n \n You are about to cancel your order for an Americano. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\nconst handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n}\nconst useStyles = createUseStyles({\n btnContainer: { \n display: \"flex\",\n gap: \"var(--ic-space-xs)\",\n flexWrap: \"wrap\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\nconst handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n}\nconst useStyles = createUseStyles({\n btnContainer: { \n display: \"flex\",\n gap: \"var(--ic-space-xs)\",\n flexWrap: \"wrap\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const CustomButtonsDialog = () => {\n const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\n const [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\n const [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\n const [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] =\n useState(false);\n const handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\n const handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\n const handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\n const handleDestructiveButtonDialogOpen = () =>\n setOpenDestructiveButtonDialog(true);\n const handleDialogClose = () => {\n setOpenNoButtonDialog(false);\n setOpenSingleButtonDialog(false);\n setOpenThreeButtonsDialog(false);\n setOpenDestructiveButtonDialog(false);\n };\n return (\n <>\n \n \n Launch no button dialog\n \n \n Launch single button dialog\n \n \n Launch three button dialog\n \n \n Launch destructive button dialog\n \n
\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n >\n );\n};\n\n\n \n\n\n### Slotted buttons\n\nexport const snippetsSlottedButtons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Go back\n \n \n Add to basket\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch slotted buttons dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n}\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n}\nreturn (\n <>\n {shortCode}\n >\n);`,\n },\n ],\n },\n },\n];\n\nexport const SlottedButtonsDialog = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleAddToBasket = () => {\n alert(\"Added to basket\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Go back\n \n \n Add to basket\n \n \n >\n );\n};\n\n\n \n\n\n### Interactive content\n\nexport const interactiveContentSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n`,\n long: `.parent-container {\n padding: var(--ic-space-md);\n }\n ic-checkbox-group {\n margin-top: var(--ic-space-xs)\n }\n\n\n \n {shortCode}\n
\n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch dialog\n\n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [termsAgreed, setTermsAgreed] = useState(false);\nconst [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n};\nconst termsDialogConfirmed = (ev) => {\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n};\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n checkboxGroup: {\n marginTop: \"var(--ic-space-xs)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [termsAgreed, setTermsAgreed] = useState(false);\nconst [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n};\nconst termsDialogConfirmed = (ev) => {\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n};\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n checkboxGroup: {\n marginTop: \"var(--ic-space-xs)\",\n },\n});\nreturn (\n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\nexport const InteractiveContent = () => {\n const [termsAgreed, setTermsAgreed] = useState(false);\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const toggleTermsAgreed = () => {\n setTermsAgreed(!termsAgreed);\n };\n const termsDialogConfirmed = () => {\n const message = termsAgreed ? \"Terms agreed\" : \"Terms not agreed\";\n alert(message);\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Before continuing, please agree to our terms and conditions.\n \n \n \n \n \n >\n );\n};\n\n\n \n\n\n### Background close prevented\n\nexport const noCloseSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true); \nconst handleDialogClose = () => setOpenDialog(false); \nconst handleConfirmDialog = (ev) => { \n alert(\"Confirmed!\");\n setOpenDialog(false);\n};\nreturn (\n <>\n {shortCode} \n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true); \nconst handleDialogClose = () => setOpenDialog(false); \nconst handleConfirmDialog = (ev) => { \n alert(\"Confirmed!\");\n setOpenDialog(false);\n};\nreturn (\n <>\n {shortCode} \n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const NoCloseContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleConfirmDialog = () => {\n alert(\"Confirmed!\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n \n \n >\n );\n};\n\n\n \n\n\n### Events\n\nexport const eventsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch dialog\n\n \n You are about to add 'Americano' to your basket. Are you sure you want to continue?\n \n \n Cancel\n \n \n Confirm\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleDialogOpened = () => alert(\"Dialog opened\");\nconst handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n}\nconst handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n}\nconst handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n};\nconst handleSlottedCancel = () => {\n alert('Slotted cancel button');\n setOpenDialog(false);\n};\nconst handleSlottedConfirm = () => {\n alert('Slotted confirm button');\n setOpenDialog(false);\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nconst handleDialogOpened = () => alert(\"Dialog opened\");\nconst handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n}\nconst handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n}\nconst handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n};\nconst handleSlottedCancel = () => {\n alert('Slotted cancel button');\n setOpenDialog(false);\n};\nconst handleSlottedConfirm = () => {\n alert('Slotted confirm button');\n setOpenDialog(false);\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const EventsContent = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n const handleDialogOpened = () => alert(\"Dialog opened\");\n const handleDialogClosed = () => {\n alert(\"Dialog closed\");\n if (openDialog) {\n handleDialogClose();\n }\n };\n const handleDialogCancelled = () => {\n alert(\"Dialog cancelled\");\n setOpenDialog(false);\n };\n const handleDialogConfirmed = () => {\n alert(\"Dialog confirmed\");\n setOpenDialog(false);\n };\n const handleSlottedCancel = () => {\n alert(\"Slotted cancel button\");\n setOpenDialog(false);\n };\n const handleSlottedConfirm = () => {\n alert(\"Slotted confirm button\");\n setOpenDialog(false);\n };\n return (\n <>\n Launch dialog\n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n Cancel\n \n \n Confirm\n \n \n >\n );\n};\n\n\n \n\n\n### Disabled height constraint\n\nexport const popoutElements = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Launch disabled height constraint dialog\n\n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Launch disabled height constraint dialog\n\n \n Sure, let's dive into the delightful world of milk, where dairy dreams\n and coffee collide in the harmonious dance of a flat white. Picture\n this: you stroll into your favorite coffee haunt, the aroma of freshly\n ground beans tickling your senses. You approach the counter, ready to\n make a crucial decision – what kind of milk will accompany your flat\n white?\n \n
\n \n In the end, whether you go for the classic, embrace the trendy, or opt\n for the exotic, the flat white remains a canvas waiting to be painted\n with your milk of choice. So, next time you're at the coffee counter,\n let your taste buds embark on a journey – a journey where milk and\n coffee meet, and every sip tells a story, sprinkled with a dash of\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\n \n
\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const [openDialog, setOpenDialog] = useState(false);\nconst handleDialogOpen = () => setOpenDialog(true);\nconst handleDialogClose = () => setOpenDialog(false);\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const DialogWithPopout = () => {\n const [openDialog, setOpenDialog] = useState(false);\n const handleDialogOpen = () => setOpenDialog(true);\n const handleDialogClose = () => setOpenDialog(false);\n return (\n <>\n \n Launch disabled height constraint dialog\n \n \n \n Sure, let's dive into the delightful world of milk, where dairy dreams\n and coffee collide in the harmonious dance of a flat white. Picture\n this: you stroll into your favorite coffee haunt, the aroma of freshly\n ground beans tickling your senses. You approach the counter, ready to\n make a crucial decision – what kind of milk will accompany your flat\n white?\n \n
\n \n In the end, whether you go for the classic, embrace the trendy, or opt\n for the exotic, the flat white remains a canvas waiting to be painted\n with your milk of choice. So, next time you're at the coffee counter,\n let your taste buds embark on a journey – a journey where milk and\n coffee meet, and every sip tells a story, sprinkled with a dash of\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\n \n
\n \n \n >\n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport {\r\n IcAlert,\r\n IcDialog,\r\n IcButton,\r\n IcCheckboxGroup,\r\n IcCheckbox,\r\n IcTypography,\r\n IcSelect,\r\n} from \"@ukic/react\";\r\nimport { useRef, useState } from \"react\";\r\n\r\nexport const buttonProps = [\r\n {\r\n label: \"Go back\",\r\n onclick: \"this.cancelDialog()\",\r\n },\r\n {\r\n label: \"Continue\",\r\n onclick: \"alert('Added to basket'); this.open = false;\",\r\n },\r\n];\r\n\r\n## Component demo\r\n\r\nexport const snippetsDefault = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\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: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n >\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(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 DefaultDialog = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n return (\r\n <>\r\n Launch dialog\r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n## Dialog 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: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\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: `Launch sizes dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to\r\n continue?\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n >\r\n);`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(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 SizesDialogs = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n return (\r\n <>\r\n Launch sizes dialog\r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### With status alerts\r\n\r\nexport const snippetsAlert = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch status dialog\r\n\r\n \r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\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 Launch status dialog\r\n\r\n\r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenlDialog(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n >\r\n);`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenlDialog(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 AlertDialog = () => {\r\n const dialogEl = useRef(null);\r\n const addTitleAboveAttribute = () => {\r\n dialogEl.current\r\n .querySelector(\"ic-alert\")\r\n .setAttribute(\"title-above\", \"true\");\r\n };\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => {\r\n addTitleAboveAttribute();\r\n setOpenDialog(true);\r\n };\r\n const handleDialogClose = () => setOpenDialog(false);\r\n return (\r\n <>\r\n \r\n Launch dialog\r\n \r\n \r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Button variations\r\n\r\nexport const snippetsCustomButtons = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch no button dialog\r\nLaunch single button dialog\r\nLaunch three button dialog\r\nLaunch destructive button dialog\r\n\r\n Sorry, you cannot place orders at the moment. Please try again later.\r\n\r\n\r\n \r\n Your order for an Americano coffee has been placed.\r\n \r\n\r\n\r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\r\n tempor incididunt ut labore et dolore magna aliqua.\r\n\r\n\r\n \r\n You are about to cancel your order for an Americano. Are you sure you want to continue?\r\n \r\n`,\r\n long: `{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 Launch no button dialog\r\n \r\n \r\n Launch single button dialog\r\n \r\n \r\n Launch three button dialog\r\n \r\n \r\n Launch destructive button dialog\r\n \r\n
\r\n\r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n\r\n\r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n\r\n\r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n\r\n\r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\r\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\r\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\r\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\r\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\r\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\r\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\r\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\r\nconst handleDialogClose = () => {\r\n setOpenNoButtonDialog(false);\r\n setOpenSingleButtonDialog(false);\r\n setOpenThreeButtonsDialog(false);\r\n setOpenDestructiveButtonDialog(false);\r\n}\r\nconst useStyles = createUseStyles({\r\n btnContainer: { \r\n display: \"flex\",\r\n gap: \"var(--ic-space-xs)\",\r\n flexWrap: \"wrap\",\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 [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\r\nconst [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\r\nconst [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\r\nconst [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] = useState(false);\r\nconst handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\r\nconst handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\r\nconst handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\r\nconst handleDestructiveButtonDialogOpen = () => setOpenDestructiveButtonDialog(true);\r\nconst handleDialogClose = () => {\r\n setOpenNoButtonDialog(false);\r\n setOpenSingleButtonDialog(false);\r\n setOpenThreeButtonsDialog(false);\r\n setOpenDestructiveButtonDialog(false);\r\n}\r\nconst useStyles = createUseStyles({\r\n btnContainer: { \r\n display: \"flex\",\r\n gap: \"var(--ic-space-xs)\",\r\n flexWrap: \"wrap\",\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\nexport const CustomButtonsDialog = () => {\r\n const [openNoButtonDialog, setOpenNoButtonDialog] = useState(false);\r\n const [openSingleButtonDialog, setOpenSingleButtonDialog] = useState(false);\r\n const [openThreeButtonsDialog, setOpenThreeButtonsDialog] = useState(false);\r\n const [openDestructiveButtonDialog, setOpenDestructiveButtonDialog] =\r\n useState(false);\r\n const handleNoButtonDialogOpen = () => setOpenNoButtonDialog(true);\r\n const handleSingleButtonDialogOpen = () => setOpenSingleButtonDialog(true);\r\n const handleThreeButtonsDialogOpen = () => setOpenThreeButtonsDialog(true);\r\n const handleDestructiveButtonDialogOpen = () =>\r\n setOpenDestructiveButtonDialog(true);\r\n const handleDialogClose = () => {\r\n setOpenNoButtonDialog(false);\r\n setOpenSingleButtonDialog(false);\r\n setOpenThreeButtonsDialog(false);\r\n setOpenDestructiveButtonDialog(false);\r\n };\r\n return (\r\n <>\r\n \r\n \r\n Launch no button dialog\r\n \r\n \r\n Launch single button dialog\r\n \r\n \r\n Launch three button dialog\r\n \r\n \r\n Launch destructive button dialog\r\n \r\n
\r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n \r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n \r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n \r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Slotted buttons\r\n\r\nexport const snippetsSlottedButtons = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\r\n \r\n \r\n Go back\r\n \r\n \r\n Add to basket\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: `Launch slotted buttons dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n Go back\r\n \r\n \r\n Add to basket\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst handleAddToBasket = () => {\r\n alert(\"Added to basket\");\r\n setOpenDialog(false);\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 [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst handleAddToBasket = () => {\r\n alert(\"Added to basket\");\r\n setOpenDialog(false);\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\nexport const SlottedButtonsDialog = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n const handleAddToBasket = () => {\r\n alert(\"Added to basket\");\r\n setOpenDialog(false);\r\n };\r\n return (\r\n <>\r\n Launch dialog\r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n Go back\r\n \r\n \r\n Add to basket\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Interactive content\r\n\r\nexport const interactiveContentSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch dialog\r\n\r\n \r\n Before continuing, please agree to our terms and conditions.\r\n \r\n \r\n \r\n \r\n`,\r\n long: `.parent-container {\r\n padding: var(--ic-space-md);\r\n }\r\n ic-checkbox-group {\r\n margin-top: var(--ic-space-xs)\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: `Launch dialog\r\n\r\n \r\n Before continuing, please agree to our terms and conditions.\r\n \r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [termsAgreed, setTermsAgreed] = useState(false);\r\nconst [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst toggleTermsAgreed = () => {\r\n setTermsAgreed(!termsAgreed);\r\n};\r\nconst termsDialogConfirmed = (ev) => {\r\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\r\n alert(message);\r\n setOpenDialog(false);\r\n};\r\nconst useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n checkboxGroup: {\r\n marginTop: \"var(--ic-space-xs)\",\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 [termsAgreed, setTermsAgreed] = useState(false);\r\nconst [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst toggleTermsAgreed = () => {\r\n setTermsAgreed(!termsAgreed);\r\n};\r\nconst termsDialogConfirmed = (ev) => {\r\n const message = (termsAgreed) ? \"Terms agreed\" : \"Terms not agreed\";\r\n alert(message);\r\n setOpenDialog(false);\r\n};\r\nconst useStyles = createUseStyles({\r\n parentContainer: {\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n checkboxGroup: {\r\n marginTop: \"var(--ic-space-xs)\",\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\nexport const InteractiveContent = () => {\r\n const [termsAgreed, setTermsAgreed] = useState(false);\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n const toggleTermsAgreed = () => {\r\n setTermsAgreed(!termsAgreed);\r\n };\r\n const termsDialogConfirmed = () => {\r\n const message = termsAgreed ? \"Terms agreed\" : \"Terms not agreed\";\r\n alert(message);\r\n setOpenDialog(false);\r\n };\r\n return (\r\n <>\r\n Launch dialog\r\n \r\n \r\n Before continuing, please agree to our terms and conditions.\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### Background close prevented\r\n\r\nexport const noCloseSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\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: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true); \r\nconst handleDialogClose = () => setOpenDialog(false); \r\nconst handleConfirmDialog = (ev) => { \r\n alert(\"Confirmed!\");\r\n setOpenDialog(false);\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 [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true); \r\nconst handleDialogClose = () => setOpenDialog(false); \r\nconst handleConfirmDialog = (ev) => { \r\n alert(\"Confirmed!\");\r\n setOpenDialog(false);\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\nexport const NoCloseContent = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n const handleConfirmDialog = () => {\r\n alert(\"Confirmed!\");\r\n setOpenDialog(false);\r\n };\r\n return (\r\n <>\r\n Launch dialog\r\n \r\n \r\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\r\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Events\r\n\r\nexport const eventsSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\r\n \r\n \r\n Cancel\r\n \r\n \r\n Confirm\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: `Launch dialog\r\n\r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want to continue?\r\n \r\n \r\n Cancel\r\n \r\n \r\n Confirm\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst handleDialogOpened = () => alert(\"Dialog opened\");\r\nconst handleDialogClosed = () => {\r\n alert(\"Dialog closed\");\r\n if (openDialog) {\r\n handleDialogClose();\r\n }\r\n}\r\nconst handleDialogCancelled = () => {\r\n alert(\"Dialog cancelled\");\r\n setOpenDialog(false);\r\n}\r\nconst handleDialogConfirmed = () => {\r\n alert(\"Dialog confirmed\");\r\n setOpenDialog(false);\r\n};\r\nconst handleSlottedCancel = () => {\r\n alert('Slotted cancel button');\r\n setOpenDialog(false);\r\n};\r\nconst handleSlottedConfirm = () => {\r\n alert('Slotted confirm button');\r\n setOpenDialog(false);\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 [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nconst handleDialogOpened = () => alert(\"Dialog opened\");\r\nconst handleDialogClosed = () => {\r\n alert(\"Dialog closed\");\r\n if (openDialog) {\r\n handleDialogClose();\r\n }\r\n}\r\nconst handleDialogCancelled = () => {\r\n alert(\"Dialog cancelled\");\r\n setOpenDialog(false);\r\n}\r\nconst handleDialogConfirmed = () => {\r\n alert(\"Dialog confirmed\");\r\n setOpenDialog(false);\r\n};\r\nconst handleSlottedCancel = () => {\r\n alert('Slotted cancel button');\r\n setOpenDialog(false);\r\n};\r\nconst handleSlottedConfirm = () => {\r\n alert('Slotted confirm button');\r\n setOpenDialog(false);\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\nexport const EventsContent = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n const handleDialogOpened = () => alert(\"Dialog opened\");\r\n const handleDialogClosed = () => {\r\n alert(\"Dialog closed\");\r\n if (openDialog) {\r\n handleDialogClose();\r\n }\r\n };\r\n const handleDialogCancelled = () => {\r\n alert(\"Dialog cancelled\");\r\n setOpenDialog(false);\r\n };\r\n const handleDialogConfirmed = () => {\r\n alert(\"Dialog confirmed\");\r\n setOpenDialog(false);\r\n };\r\n const handleSlottedCancel = () => {\r\n alert(\"Slotted cancel button\");\r\n setOpenDialog(false);\r\n };\r\n const handleSlottedConfirm = () => {\r\n alert(\"Slotted confirm button\");\r\n setOpenDialog(false);\r\n };\r\n return (\r\n <>\r\n Launch dialog\r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\r\n \r\n \r\n Cancel\r\n \r\n \r\n Confirm\r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Disabled height constraint\r\n\r\nexport const popoutElements = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Launch disabled height constraint dialog\r\n\r\n Sure, let's dive into the delightful world of milk, where dairy dreams and coffee collide in the harmonious dance of a flat white. Picture this: you stroll into your favorite coffee haunt, the aroma of freshly ground beans tickling your senses. You approach the counter, ready to make a crucial decision – what kind of milk will accompany your flat white?
\r\n In the end, whether you go for the classic, embrace the trendy, or opt for the exotic, the flat white remains a canvas waiting to be painted with your milk of choice. So, next time you're at the coffee counter, let your taste buds embark on a journey – a journey where milk and coffee meet, and every sip tells a story, sprinkled with a dash of humor and a whole lot of flavor. Cheers to the caffeinated adventure!
\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: `Launch disabled height constraint dialog\r\n\r\n \r\n Sure, let's dive into the delightful world of milk, where dairy dreams\r\n and coffee collide in the harmonious dance of a flat white. Picture\r\n this: you stroll into your favorite coffee haunt, the aroma of freshly\r\n ground beans tickling your senses. You approach the counter, ready to\r\n make a crucial decision – what kind of milk will accompany your flat\r\n white?\r\n \r\n
\r\n \r\n In the end, whether you go for the classic, embrace the trendy, or opt\r\n for the exotic, the flat white remains a canvas waiting to be painted\r\n with your milk of choice. So, next time you're at the coffee counter,\r\n let your taste buds embark on a journey – a journey where milk and\r\n coffee meet, and every sip tells a story, sprinkled with a dash of\r\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\r\n \r\n
\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(false);\r\nreturn (\r\n <>\r\n {shortCode}\r\n >\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const [openDialog, setOpenDialog] = useState(false);\r\nconst handleDialogOpen = () => setOpenDialog(true);\r\nconst handleDialogClose = () => setOpenDialog(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 DialogWithPopout = () => {\r\n const [openDialog, setOpenDialog] = useState(false);\r\n const handleDialogOpen = () => setOpenDialog(true);\r\n const handleDialogClose = () => setOpenDialog(false);\r\n return (\r\n <>\r\n \r\n Launch disabled height constraint dialog\r\n \r\n \r\n \r\n Sure, let's dive into the delightful world of milk, where dairy dreams\r\n and coffee collide in the harmonious dance of a flat white. Picture\r\n this: you stroll into your favorite coffee haunt, the aroma of freshly\r\n ground beans tickling your senses. You approach the counter, ready to\r\n make a crucial decision – what kind of milk will accompany your flat\r\n white?\r\n \r\n
\r\n \r\n In the end, whether you go for the classic, embrace the trendy, or opt\r\n for the exotic, the flat white remains a canvas waiting to be painted\r\n with your milk of choice. So, next time you're at the coffee counter,\r\n let your taste buds embark on a journey – a journey where milk and\r\n coffee meet, and every sip tells a story, sprinkled with a dash of\r\n humor and a whole lot of flavor. Cheers to the caffeinated adventure!\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/dialog/code",
"date": "2024-05-31",
"title": "Dialog",
@@ -2108,16 +2108,16 @@
}
],
"meta": {
- "relativePath": "components/dialog/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
- "size": 46750,
- "formattedSize": "45.7 KB"
+ "relativePath": "components\\dialog\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.097Z",
+ "lastModified": "2024-12-04T13:23:54.097Z",
+ "size": 48334,
+ "formattedSize": "47.2 KB"
}
},
{
"id": "components\\dialog\\guidancex",
- "contents": "\nimport { IcDialog, IcButton, IcTypography } from \"@ukic/react\";\nimport { useRef } from \"react\";\nimport dialogFig1 from \"./images/fig-1-use-action-buttons-to-provide-user-with-choice.png\";\nimport dialogFig2 from \"./images/fig-2-use-inputs-to-get-important-information-from-users.png\";\nimport dialogFig3 from \"./images/fig-3-use-dialogs-to-show-additional-info.png\";\nimport dialogFig4 from \"./images/fig-4-use-status-alert-to-provide-status-information.png\";\nimport dialogFig5 from \"./images/fig-5-use-destructive-actions.png\";\nimport dialogFig6 from \"./images/fig-6-avoid-including-complex-content.png\";\nimport dialogFig7 from \"./images/fig-7-dialog-anatomy.png\";\n\n## Introduction\n\nDialogs prompt users for additional information to proceed with their task. Dialogs appear modally, meaning that the user must take action to acknowledge the dialog before continuing.\n\nDialogs work best when used for short tasks or to alert the user to information relevant for their current task. A dialog appears on top of the main page content and is persistent until dismissed.\n\n## Component demo\n\nexport const DialogExample = () => {\n const dialogEl = useRef(null);\n const showDialog = () => {\n dialogEl.current.open = true;\n };\n return (\n <>\n \n Launch dialog\n \n \n \n You are about to add 'Americano' to your basket. Are you sure you want\n to continue?\n \n \n >\n );\n};\n\n\n \n\n\n## When to use\n\nUse dialogs to interrupt the user flow to display, collect or confirm information that is important to enable the user to continue their task.\n\nAdd action buttons to a dialog to present the user with a set of actions to choose from to continue.\n\n\n\nAdd interactive content inside a dialog's content area to capture key input, such as providing confirmation of understanding by checking a checkbox.\n\n\n\nUse dialogs to show additional information that can be opened from the underlying page. These dialogs can be passive and contain no actions other than a dismiss button to close the dialog.\n\n\n\nAdd a status [alert](/components/alert) to a dialog to provide additional meaning in relation to a specific status. These can include any alert status variant.\n\n\n\nUse dialogs when a destructive action is about to take place. Ask the user to confirm if they want to continue to conduct the action and provide a way of cancelling the action.\n\n\n\n## When not to use\n\nAvoid using dialogs to contain complicated tasks or processes. Instead consider if such complex tasks could be placed on a page themselves.\n\n\n\nDon't place important information inside a dialog if it is not part of the main flow of task. Such information can be missed so consider placing it on the page itself. Avoid repeating information in a dialog that is displayed on the page itself.\n\nDon't use dialogs when information from the main page content is required to complete a task within a dialog. Keep all information required to complete the task in a dialog within the dialog. If more information is required, consider if dialogs may not be suitable for the task.\n\nAvoid overusing dialogs to bring every decision in a task to the user's attention. Use dialogs for the key actions in a task instead. Dialogs may be ignored if used too frequently.\n\nOnly show dialogs after a user action has triggered it, and make sure its content is contextual to the user action. Don't show dialogs if a user has not performed a specific action on the page.\n\n## Interaction behaviour\n\nDisplay dialogs after users complete a specific action on a page such as clicking a 'submit' button.\n\nAlways make sure the dismiss button is included within a dialog, and select whether to allow the dialog to close by clicking on the background scrim.\n\nWhen a dialog is displayed, the page content in the background cannot be interacted with.\n\nContent can scroll within the body of a dialog, whilst the header section and interaction section are sticky at the top and bottom of the dialog window.\n\n## Sizing\n\nSet the dialog's size dependent on the amount of content that is being displayed in it. Large dialogs take up most of the screen so are good to use when there is a lot of content to display such as a table. Small dialogs only use a small amount of the screen so are best used for short additional information.\n\nOn extra small breakpoints all dialogs automatically change to their full-screen setting to provide maximum space for their content.\n\n## Content\n\nAlways give dialogs a meaningful heading and describe the task that the dialog contains.\n\nAdd an optional label to a dialog to add categorisation or other secondary information.\n\nSpecify any content within the dialog's body section, but take care not to place too much information in a dialog if it is best placed as a page itself. Also, consider using a full page instead of a dialog when lots of interactive elements are required.\n\nAlways follow the [content style](/styles/content-style) when writing textual content.\n\n\n\nWhen adding interactive content to a dialog and it has popover elements, to avoid the elements being cut off within the content area, use the prop `disableHeightConstraint` to allow the dialog to stretch to contain its content.\n",
+ "contents": "\r\nimport { IcDialog, IcButton, IcTypography } from \"@ukic/react\";\r\nimport { useRef } from \"react\";\r\nimport dialogFig1 from \"./images/fig-1-use-action-buttons-to-provide-user-with-choice.png\";\r\nimport dialogFig2 from \"./images/fig-2-use-inputs-to-get-important-information-from-users.png\";\r\nimport dialogFig3 from \"./images/fig-3-use-dialogs-to-show-additional-info.png\";\r\nimport dialogFig4 from \"./images/fig-4-use-status-alert-to-provide-status-information.png\";\r\nimport dialogFig5 from \"./images/fig-5-use-destructive-actions.png\";\r\nimport dialogFig6 from \"./images/fig-6-avoid-including-complex-content.png\";\r\nimport dialogFig7 from \"./images/fig-7-dialog-anatomy.png\";\r\n\r\n## Introduction\r\n\r\nDialogs prompt users for additional information to proceed with their task. Dialogs appear modally, meaning that the user must take action to acknowledge the dialog before continuing.\r\n\r\nDialogs work best when used for short tasks or to alert the user to information relevant for their current task. A dialog appears on top of the main page content and is persistent until dismissed.\r\n\r\n## Component demo\r\n\r\nexport const DialogExample = () => {\r\n const dialogEl = useRef(null);\r\n const showDialog = () => {\r\n dialogEl.current.open = true;\r\n };\r\n return (\r\n <>\r\n \r\n Launch dialog\r\n \r\n \r\n \r\n You are about to add 'Americano' to your basket. Are you sure you want\r\n to continue?\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 dialogs to interrupt the user flow to display, collect or confirm information that is important to enable the user to continue their task.\r\n\r\nAdd action buttons to a dialog to present the user with a set of actions to choose from to continue.\r\n\r\n\r\n\r\nAdd interactive content inside a dialog's content area to capture key input, such as providing confirmation of understanding by checking a checkbox.\r\n\r\n\r\n\r\nUse dialogs to show additional information that can be opened from the underlying page. These dialogs can be passive and contain no actions other than a dismiss button to close the dialog.\r\n\r\n\r\n\r\nAdd a status [alert](/components/alert) to a dialog to provide additional meaning in relation to a specific status. These can include any alert status variant.\r\n\r\n\r\n\r\nUse dialogs when a destructive action is about to take place. Ask the user to confirm if they want to continue to conduct the action and provide a way of cancelling the action.\r\n\r\n\r\n\r\n## When not to use\r\n\r\nAvoid using dialogs to contain complicated tasks or processes. Instead consider if such complex tasks could be placed on a page themselves.\r\n\r\n\r\n\r\nDon't place important information inside a dialog if it is not part of the main flow of task. Such information can be missed so consider placing it on the page itself. Avoid repeating information in a dialog that is displayed on the page itself.\r\n\r\nDon't use dialogs when information from the main page content is required to complete a task within a dialog. Keep all information required to complete the task in a dialog within the dialog. If more information is required, consider if dialogs may not be suitable for the task.\r\n\r\nAvoid overusing dialogs to bring every decision in a task to the user's attention. Use dialogs for the key actions in a task instead. Dialogs may be ignored if used too frequently.\r\n\r\nOnly show dialogs after a user action has triggered it, and make sure its content is contextual to the user action. Don't show dialogs if a user has not performed a specific action on the page.\r\n\r\n## Interaction behaviour\r\n\r\nDisplay dialogs after users complete a specific action on a page such as clicking a 'submit' button.\r\n\r\nAlways make sure the dismiss button is included within a dialog, and select whether to allow the dialog to close by clicking on the background scrim.\r\n\r\nWhen a dialog is displayed, the page content in the background cannot be interacted with.\r\n\r\nContent can scroll within the body of a dialog, whilst the header section and interaction section are sticky at the top and bottom of the dialog window.\r\n\r\n## Sizing\r\n\r\nSet the dialog's size dependent on the amount of content that is being displayed in it. Large dialogs take up most of the screen so are good to use when there is a lot of content to display such as a table. Small dialogs only use a small amount of the screen so are best used for short additional information.\r\n\r\nOn extra small breakpoints all dialogs automatically change to their full-screen setting to provide maximum space for their content.\r\n\r\n## Content\r\n\r\nAlways give dialogs a meaningful heading and describe the task that the dialog contains.\r\n\r\nAdd an optional label to a dialog to add categorisation or other secondary information.\r\n\r\nSpecify any content within the dialog's body section, but take care not to place too much information in a dialog if it is best placed as a page itself. Also, consider using a full page instead of a dialog when lots of interactive elements are required.\r\n\r\nAlways follow the [content style](/styles/content-style) when writing textual content.\r\n\r\n\r\n\r\nWhen adding interactive content to a dialog and it has popover elements, to avoid the elements being cut off within the content area, use the prop `disableHeightConstraint` to allow the dialog to stretch to contain its content.\r\n",
"path": "/components/dialog",
"navPriority": 16,
"date": "2023-10-24",
@@ -2141,11 +2141,11 @@
],
"tags": ["Popup", "Modal window"],
"meta": {
- "relativePath": "components/dialog/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.008Z",
- "size": 8641,
- "formattedSize": "8.4 KB"
+ "relativePath": "components\\dialog\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.098Z",
+ "lastModified": "2024-12-04T13:23:54.098Z",
+ "size": 8826,
+ "formattedSize": "8.6 KB"
}
},
{
@@ -2172,16 +2172,16 @@
}
],
"meta": {
- "relativePath": "components/empty-state/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.012Z",
+ "relativePath": "components\\empty-state\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.867Z",
+ "lastModified": "2024-11-05T11:57:51.867Z",
"size": 1536,
"formattedSize": "1.5 KB"
}
},
{
"id": "components\\empty-state\\codex",
- "contents": "\nimport { IcEmptyState, IcButton, IcLink } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Go to favourite coffees\n \n Customer support\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Go to favourite coffees\n \n Customer support\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n## Empty state details\n\n\n\n## Variants\n\n### Actions slot\n\nexport const actionsSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Go to favourite coffees\n Customer support\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Go to favourite coffees\n Customer support\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n### Image slot\n\nexport const imageSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Image size\n\nexport const imageLargeSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Icon in the image slot\n\nexport const iconSnippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Warning\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n\n### Right aligned\n\nexport const rightSnippets = [\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### Center aligned\n\nexport const centreSnippets = [\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### Max lines\n\nexport const maxLinesSnippets = [\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 { IcEmptyState, IcButton, IcLink } 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 Go to favourite coffees\r\n \r\n Customer support\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 \r\n \r\n \r\n \r\n \r\n \r\n \r\n Go to favourite coffees\r\n \r\n Customer support\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 Go to favourite coffees\r\n e.preventDefault()}>\r\n Customer support\r\n \r\n \r\n\r\n\r\n## Empty state details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Actions slot\r\n\r\nexport const actionsSnippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Go to favourite coffees\r\n Customer support\r\n`,\r\n long: `{shortCode}`,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `\r\n Go to favourite coffees\r\n Customer support\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 Go to favourite coffees\r\n e.preventDefault()}>\r\n Customer support\r\n \r\n \r\n\r\n\r\n### Image slot\r\n\r\nexport const imageSnippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 \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### Image size\r\n\r\nexport const imageLargeSnippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 \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### Icon in the image slot\r\n\r\nexport const iconSnippets = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 Warning\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### Right aligned\r\n\r\nexport const rightSnippets = [\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### Center aligned\r\n\r\nexport const centreSnippets = [\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### Max lines\r\n\r\nexport const maxLinesSnippets = [\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/empty-state/code",
"date": "2024-05-31",
"title": "Empty state",
@@ -2203,16 +2203,16 @@
}
],
"meta": {
- "relativePath": "components/empty-state/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.012Z",
- "size": 21654,
- "formattedSize": "21.1 KB"
+ "relativePath": "components\\empty-state\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.099Z",
+ "lastModified": "2024-12-04T13:23:54.099Z",
+ "size": 22258,
+ "formattedSize": "21.7 KB"
}
},
{
"id": "components\\empty-state\\guidancex",
- "contents": "\nimport { IcEmptyState, IcButton, IcLink } from \"@ukic/react\";\nimport emptyStateFig1 from \"./images/fig-1-data-table-with-empty-state.png\";\nimport emptyStateFig2 from \"./images/fig-2-use-empty-state-for-access-rights.png\";\nimport emptyStateFig3 from \"./images/fig-3-use-empty-state-with-positive-messaging.png\";\nimport emptyStateFig4 from \"./images/fig-4-use-empty-states-as-starting-points-for-flows.png\";\nimport emptyStateFig5 from \"./images/fig-5-dont-use-empty-states-for-messages-unrelated-to-empty-state.png\";\nimport emptyStateFig6 from \"./images/fig-6-dont-use-empty-state-for-loading-messages.png\";\nimport emptyStateFig7 from \"./images/fig-7-use-empty-states-on-a-full-screen.png\";\nimport emptyStateFig8 from \"./images/fig-8-use-empty-states-on-a-side-panel.png\";\nimport emptyStateFig9 from \"./images/fig-9-use-empty-states-on-other-containers.png\";\nimport emptyStateFig10 from \"./images/fig-10-empty-state-anatomy.png\";\nimport emptyStateFig11 from \"./images/fig-11-avoid-using-too-many-actions.png\";\nimport emptyStateFig12 from \"./images/fig-12-dont-use-other-component-in-interaction-area.png\";\n\n## Component demo\n\n\n \n \n Go to favourite coffees\n e.preventDefault()}>\n Customer support\n \n \n\n\n## When to use\n\nUse an empty state component to communicate to people that no content is available to display. Use them to engage people and guide them on what is best to do next by including a button or a link to the next best action.\n\nEmpty states are used for many different reasons such as:\n\n- No content yet exists due to the first-time use of the functionality.\n- Data was not successfully loaded.\n- A query or search term yielded no results.\n- Data was removed resulting in nothing remaining to display.\n\nUse empty states when no data can be displayed in a component’s contents. For example, show an empty state when no data is available to display in a data table, or if a search term didn’t find any results.\n\n\n\nUse empty states to highlight access issues. If a user does not have access to some content, use an empty state to provide this messaging as well as a means of continuing.\n\n\n\nEmpty states are not always due to errors, so use positive messaging as well. For example, in a to-do list app, all items might have been cleared and so the empty state message may be celebratory.\n\n\n\nUse empty states as starting points for processes that require people to add input into an app. For example, a calendar entry may have no events yet, so use an empty state to prompt for an event to be added.\n\n\n \n\n\n## When not to use\n\nAvoid using custom components instead of empty states. The empty state component creates an easily understandable, consistent method of indicating that no data is available and therefore what to do next.\n\nDon’t use empty states to communicate other messages to people that are not related to something being empty, use [alerts](/components/alert) or [toasts](/components/toasts) instead. Only use empty states in situations where no data is present to display.\n\n\n\nDon’t use empty states to show error messages that could otherwise be displayed using other [form validation](/patterns/form-validation) patterns. Only use empty states to show errors relating to data not being loaded successfully.\n\nDon’t use empty states to indicate something is loading, instead use a [loading indicator](/components/loading-indicator).\n\n\n \n\n\n## Sizing\n\nEmbed empty states in components that would otherwise show data. For example, use them in containers, cards, dialogs or data tables.\n\nUse an empty state on a full screen in case something couldn’t be loaded, or there is no content available yet. For example, use an empty state to show a 404 message.\n\n\n\n\n\n\n\n## Layout and placement\n\nSet the alignment of the empty state to match the component or container it sits in.\n\nPlace empty states at the top and don’t resize the container, keep it sized the same as if the primary content was displayed instead.\n\n## Content\n\nUse the empty state to clearly communicate to someone what has happened, why they are seeing the empty state and what to do next.\n\n\n\nAdd an illustration, image or icon to an empty state to provide additional recognition or reinforce the written message.\n\nUse the empty state heading to clearly indicate the state of the empty content.\n\nUse the subheading to add more detail and explain why this may have happened.\n\nUse the body to explain how to rectify the issue, or to explain what is best to do next.\n\nUse the interaction area to include actions and links that will help people to continue through the app. Always include either a primary button or a navigation link, and occasionally include a secondary button or link if other routes are possible.\n\nHowever, avoid placing too many actions in the interaction area as this will cause confusion about what to do next.\n\n\n\nDon’t place other interactive components, such as inputs, in an empty state’s interaction area. If input needs to be collected, then do this on a full page or on a dialog.\n\n\n\n## Accessibility considerations\n\nIf an empty state is displayed as a result of a change on a page, make sure it is announced by a screen reader using a live region.\n\n## Related components\n\n- [Alert](/components/alert).\n- [Loading indicator](/components/loading-indicator).\n",
+ "contents": "\r\nimport { IcEmptyState, IcButton, IcLink } from \"@ukic/react\";\r\nimport emptyStateFig1 from \"./images/fig-1-data-table-with-empty-state.png\";\r\nimport emptyStateFig2 from \"./images/fig-2-use-empty-state-for-access-rights.png\";\r\nimport emptyStateFig3 from \"./images/fig-3-use-empty-state-with-positive-messaging.png\";\r\nimport emptyStateFig4 from \"./images/fig-4-use-empty-states-as-starting-points-for-flows.png\";\r\nimport emptyStateFig5 from \"./images/fig-5-dont-use-empty-states-for-messages-unrelated-to-empty-state.png\";\r\nimport emptyStateFig6 from \"./images/fig-6-dont-use-empty-state-for-loading-messages.png\";\r\nimport emptyStateFig7 from \"./images/fig-7-use-empty-states-on-a-full-screen.png\";\r\nimport emptyStateFig8 from \"./images/fig-8-use-empty-states-on-a-side-panel.png\";\r\nimport emptyStateFig9 from \"./images/fig-9-use-empty-states-on-other-containers.png\";\r\nimport emptyStateFig10 from \"./images/fig-10-empty-state-anatomy.png\";\r\nimport emptyStateFig11 from \"./images/fig-11-avoid-using-too-many-actions.png\";\r\nimport emptyStateFig12 from \"./images/fig-12-dont-use-other-component-in-interaction-area.png\";\r\n\r\n## Component demo\r\n\r\n\r\n \r\n \r\n Go to favourite coffees\r\n e.preventDefault()}>\r\n Customer support\r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\nUse an empty state component to communicate to people that no content is available to display. Use them to engage people and guide them on what is best to do next by including a button or a link to the next best action.\r\n\r\nEmpty states are used for many different reasons such as:\r\n\r\n- No content yet exists due to the first-time use of the functionality.\r\n- Data was not successfully loaded.\r\n- A query or search term yielded no results.\r\n- Data was removed resulting in nothing remaining to display.\r\n\r\nUse empty states when no data can be displayed in a component’s contents. For example, show an empty state when no data is available to display in a data table, or if a search term didn’t find any results.\r\n\r\n\r\n\r\nUse empty states to highlight access issues. If a user does not have access to some content, use an empty state to provide this messaging as well as a means of continuing.\r\n\r\n\r\n\r\nEmpty states are not always due to errors, so use positive messaging as well. For example, in a to-do list app, all items might have been cleared and so the empty state message may be celebratory.\r\n\r\n\r\n\r\nUse empty states as starting points for processes that require people to add input into an app. For example, a calendar entry may have no events yet, so use an empty state to prompt for an event to be added.\r\n\r\n\r\n \r\n\r\n\r\n## When not to use\r\n\r\nAvoid using custom components instead of empty states. The empty state component creates an easily understandable, consistent method of indicating that no data is available and therefore what to do next.\r\n\r\nDon’t use empty states to communicate other messages to people that are not related to something being empty, use [alerts](/components/alert) or [toasts](/components/toasts) instead. Only use empty states in situations where no data is present to display.\r\n\r\n\r\n\r\nDon’t use empty states to show error messages that could otherwise be displayed using other [form validation](/patterns/form-validation) patterns. Only use empty states to show errors relating to data not being loaded successfully.\r\n\r\nDon’t use empty states to indicate something is loading, instead use a [loading indicator](/components/loading-indicator).\r\n\r\n\r\n \r\n\r\n\r\n## Sizing\r\n\r\nEmbed empty states in components that would otherwise show data. For example, use them in containers, cards, dialogs or data tables.\r\n\r\nUse an empty state on a full screen in case something couldn’t be loaded, or there is no content available yet. For example, use an empty state to show a 404 message.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n## Layout and placement\r\n\r\nSet the alignment of the empty state to match the component or container it sits in.\r\n\r\nPlace empty states at the top and don’t resize the container, keep it sized the same as if the primary content was displayed instead.\r\n\r\n## Content\r\n\r\nUse the empty state to clearly communicate to someone what has happened, why they are seeing the empty state and what to do next.\r\n\r\n\r\n\r\nAdd an illustration, image or icon to an empty state to provide additional recognition or reinforce the written message.\r\n\r\nUse the empty state heading to clearly indicate the state of the empty content.\r\n\r\nUse the subheading to add more detail and explain why this may have happened.\r\n\r\nUse the body to explain how to rectify the issue, or to explain what is best to do next.\r\n\r\nUse the interaction area to include actions and links that will help people to continue through the app. Always include either a primary button or a navigation link, and occasionally include a secondary button or link if other routes are possible.\r\n\r\nHowever, avoid placing too many actions in the interaction area as this will cause confusion about what to do next.\r\n\r\n\r\n\r\nDon’t place other interactive components, such as inputs, in an empty state’s interaction area. If input needs to be collected, then do this on a full page or on a dialog.\r\n\r\n\r\n\r\n## Accessibility considerations\r\n\r\nIf an empty state is displayed as a result of a change on a page, make sure it is announced by a screen reader using a live region.\r\n\r\n## Related components\r\n\r\n- [Alert](/components/alert).\r\n- [Loading indicator](/components/loading-indicator).\r\n",
"path": "/components/empty-state",
"navPriority": 17,
"date": "2023-08-31",
@@ -2235,11 +2235,11 @@
}
],
"meta": {
- "relativePath": "components/empty-state/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.012Z",
- "size": 10935,
- "formattedSize": "10.7 KB"
+ "relativePath": "components\\empty-state\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.100Z",
+ "lastModified": "2024-12-04T13:23:54.100Z",
+ "size": 11152,
+ "formattedSize": "10.9 KB"
}
},
{
@@ -2266,16 +2266,16 @@
}
],
"meta": {
- "relativePath": "components/footer/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.028Z",
+ "relativePath": "components\\footer\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:51.983Z",
+ "lastModified": "2024-11-05T11:57:51.983Z",
"size": 2011,
"formattedSize": "2.0 KB"
}
},
{
"id": "components\\footer\\codex",
- "contents": "\nimport { IcFooter, IcLink, IcFooterLink, IcFooterLinkGroup } from \"@ukic/react\";\n\nimport { NavLink, MemoryRouter } from \"react-router-dom\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n\n\n## Footer details\n\n\n\n## Footer link details\n\n\n\n## Footer link group details\n\n\n\n## Variants\n\n### Grouped links\n\nexport const snippetsGroupedLinks = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n Accessibility\n Styles\n Components\n Patterns\n \n \n\n\n### Logo links\n\nexport const snippetsLogoLinks = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Accessibility\n Styles\n Components\n Patterns\n \n
\n \n \n
\n \n \n
\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Accessibility\n Styles\n Components\n Patterns\n \n
\n \n \n \n \n
\n \n \n \n \n
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Accessibility\n \n \n Styles\n \n \n Components\n \n \n Patterns\n \n \n
\n \n \n
\n \n \n
\n \n\n\n### 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 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### 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 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",
+ "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 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",
"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 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## 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 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### With menu groups\n\nexport const snippetsGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n\n\n \n
`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\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",
+ "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 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## 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 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### 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 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",
"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## 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### 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\n\n### Layout and placement\n\nPopover menus appear adjacent to their triggering element. By default, they appear below and aligned to the left of the trigger element. However, if no space is available, the popover menu will appear above or aligned to the right of the trigger element.\n\n\n\n## Content\n\nPopover menus contain menu items, menu toggle items, menu groups and menu sections.\n\n### Labels\n\nFollow the [content style](/styles/content-style) guidelines when writing labels and keep them concise but specific.\n\nAlways specify an accessible label for the menu items. The accessible label can include more detail than is described in the visible label.\n\nFor example, a menu item may have a visible label that reads ‘Edit’. The accessible label may read ‘Edit record’. This includes more information to aid assistive technology users.\n\n### Icons\n\nUse an icon on a menu item to provide additional meaning or to aid in recognition. Menu items, menu toggle items and parent menu items can display an icon.\n\nMake sure that the icon is understandable and relevant to the action.\n\nAlways provide alternative descriptions for icons if they aren't decorative. Only use icons if they are necessary.\n\n### Menu items\n\nUse the 'default' variant of menu items for single actions that do not have a selection status.\n\nAdd an additional description to a menu item to provide additional context. Keep the description concise and consider if the action is too complicated if too much information is required to describe the action.\n\nIf a keyboard shortcut is available for a menu item’s action, then display it using the keyboard shortcut label.\n\nUse the 'destructive' variant of a menu item to highlight a destructive action. Position destructive actions at the bottom of a popover menu.\n\nSpecify a menu item as a parent if it has children that appear in a sub-menu. When clicked, the sub-menu will slide into view.\n\n\n \n\n\n### Menu toggle items\n\nUse the 'toggle' variant of menu items for actions that provide an ability to toggle something on or off. Menu toggle items will display a checkmark when toggled on and hide it when toggled off.\n\nLike default menu items, provide an icon or a description to add additional context if required.\n\n\n \n\n\n### Menu groups\n\nUse menu groups to organise menu items into sections within the popover menu. Provide a label for the menu group to describe its contents. Alternatively, leave the menu group label blank if a description is unnecessary.\n\n\n \n\n\n### Parent menu items\n\nUse a parent menu item to open sub-menus that include more menu items. Use this to contain similar actions or options relating to the menu group name.\n\n\n\n### Sub-menus\n\nUse a sub-menu to contain a parent menu item’s children items. Use sub-menus for multiple related actions that are opened from the main menu.\n\nThe sub-menu displays the same label as the parent menu item. Clicking the back button in a sub-menu will return the user to the parent menu item in the main menu.\n\nUse menu items, toggle menu items, menu groups or parent menu items in a sub-menu but avoid nesting too many levels of sub-menus as this can be confusing to navigate.\n\n\n\n## Accessibility considerations\n\nWhen specifying the trigger element for a popover menu, make use of ‘aria-expanded’ and ‘aria-collapsed’ so that a screen reader announces the appearance of the popover menu.\n",
+ "contents": "\nimport { IcPopoverMenu, IcMenuItem, IcButton } from \"@ukic/react\";\nimport { useState } 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 [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## 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### 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\n\n### Layout and placement\n\nPopover menus appear adjacent to their triggering element. By default, they appear below and aligned to the left of the trigger element. However, if no space is available, the popover menu will appear above or aligned to the right of the trigger element.\n\n\n\n## Content\n\nPopover menus contain menu items, menu toggle items, menu groups and menu sections.\n\n### Labels\n\nFollow the [content style](/styles/content-style) guidelines when writing labels and keep them concise but specific.\n\nAlways specify an accessible label for the menu items. The accessible label can include more detail than is described in the visible label.\n\nFor example, a menu item may have a visible label that reads ‘Edit’. The accessible label may read ‘Edit record’. This includes more information to aid assistive technology users.\n\n### Icons\n\nUse an icon on a menu item to provide additional meaning or to aid in recognition. Menu items, menu toggle items and parent menu items can display an icon.\n\nMake sure that the icon is understandable and relevant to the action.\n\nAlways provide alternative descriptions for icons if they aren't decorative. Only use icons if they are necessary.\n\n### Menu items\n\nUse the 'default' variant of menu items for single actions that do not have a selection status.\n\nAdd an additional description to a menu item to provide additional context. Keep the description concise and consider if the action is too complicated if too much information is required to describe the action.\n\nIf a keyboard shortcut is available for a menu item’s action, then display it using the keyboard shortcut label.\n\nUse the 'destructive' variant of a menu item to highlight a destructive action. Position destructive actions at the bottom of a popover menu.\n\nSpecify a menu item as a parent if it has children that appear in a sub-menu. When clicked, the sub-menu will slide into view.\n\n\n \n\n\n### Menu toggle items\n\nUse the 'toggle' variant of menu items for actions that provide an ability to toggle something on or off. Menu toggle items will display a checkmark when toggled on and hide it when toggled off.\n\nLike default menu items, provide an icon or a description to add additional context if required.\n\n\n \n\n\n### Menu groups\n\nUse menu groups to organise menu items into sections within the popover menu. Provide a label for the menu group to describe its contents. Alternatively, leave the menu group label blank if a description is unnecessary.\n\n\n \n\n\n### Parent menu items\n\nUse a parent menu item to open sub-menus that include more menu items. Use this to contain similar actions or options relating to the menu group name.\n\n\n\n### Sub-menus\n\nUse a sub-menu to contain a parent menu item’s children items. Use sub-menus for multiple related actions that are opened from the main menu.\n\nThe sub-menu displays the same label as the parent menu item. Clicking the back button in a sub-menu will return the user to the parent menu item in the main menu.\n\nUse menu items, toggle menu items, menu groups or parent menu items in a sub-menu but avoid nesting too many levels of sub-menus as this can be confusing to navigate.\n\n\n\n## Accessibility considerations\n\nWhen specifying the trigger element for a popover menu, make use of ‘aria-expanded’ and ‘aria-collapsed’ so that a screen reader announces the appearance of the popover menu.\n",
"path": "/components/popover-menu",
"navPriority": 25,
"date": "2023-07-31",
@@ -2966,11 +2966,11 @@
}
],
"meta": {
- "relativePath": "components/popover-menu/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.400Z",
- "lastModified": "2024-11-06T10:19:00.092Z",
- "size": 11283,
- "formattedSize": "11.0 KB"
+ "relativePath": "components\\popover-menu\\guidance.mdx",
+ "createdAt": "2024-12-04T12:10:36.046Z",
+ "lastModified": "2024-12-04T12:10:36.046Z",
+ "size": 11477,
+ "formattedSize": "11.2 KB"
}
},
{
@@ -2997,16 +2997,16 @@
}
],
"meta": {
- "relativePath": "components/radio/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
+ "relativePath": "components\\radio\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:52.852Z",
+ "lastModified": "2024-11-05T11:57:52.852Z",
"size": 3539,
"formattedSize": "3.5 KB"
}
},
{
- "id": "components__radio__codex",
- "contents": "\nimport { IcRadioGroup, IcRadioOption, IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode} \n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(ev.detail.value)}>\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n console.log(ev.detail.value)}\n >\n \n \n \n \n \n\n\n## Radio group details\n\n\n\n## Radio option details\n\n\n\n## Variants\n\n### Conditional\n\nexport const conditional = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Conditional dynamic\n\nexport const conditionalDynamic = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n \n
\n\n\n### With helper text\n\nexport const withHelperText = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### Size small\n\nexport const smallSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n\n### With validation\n\nexport const withValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n\n",
+ "id": "components\\radio\\codex",
+ "contents": "\r\nimport { IcRadioGroup, IcRadioOption, IcTextField } 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 \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: ` console.log(ev.detail.value)}>\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 console.log(ev.detail.value)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Radio group details\r\n\r\n\r\n\r\n## Radio option details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Conditional\r\n\r\nexport const conditional = [\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 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 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### Conditional dynamic\r\n\r\nexport const conditionalDynamic = [\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 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 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 helper text\r\n\r\nexport const withHelperText = [\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: `{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### Size small\r\n\r\nexport const smallSnippet = [\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: `{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### With validation\r\n\r\nexport const withValidation = [\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: `{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",
"path": "/components/radio/code",
"date": "2024-05-31",
"title": "Radio button",
@@ -3028,11 +3028,11 @@
}
],
"meta": {
- "relativePath": "components/radio/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
- "size": 11155,
- "formattedSize": "10.9 KB"
+ "relativePath": "components\\radio\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.111Z",
+ "lastModified": "2024-12-04T13:23:54.111Z",
+ "size": 11602,
+ "formattedSize": "11.3 KB"
}
},
{
@@ -3060,9 +3060,9 @@
}
],
"meta": {
- "relativePath": "components/radio/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
+ "relativePath": "components\\radio\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:52.933Z",
+ "lastModified": "2024-11-05T11:57:52.933Z",
"size": 8267,
"formattedSize": "8.1 KB"
}
@@ -3091,16 +3091,16 @@
}
],
"meta": {
- "relativePath": "components/search-bar/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
+ "relativePath": "components\\search-bar\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:52.963Z",
+ "lastModified": "2024-11-05T11:57:52.963Z",
"size": 3997,
"formattedSize": "3.9 KB"
}
},
{
"id": "components\\search-bar\\codex",
- "contents": "\nimport { IcSearchBar, IcTypography } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n 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(ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(ev.detail.value)}\n placeholder=\"Start typing to search…\"\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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 console.log(\"onIcChange\", ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\n placeholder=\"Start typing to search…\"\n />\n\n\n## Search bar details\n\n\n\n## Variants\n\n### With options (no filtering)\n\nexport const optionsNoFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n
\n\n All options will be displayed as you type
\n`,\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
\n\n All options will be displayed as you type
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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 All options will be displayed as you type\n\n\n### With helper text\n\nexport const withHelperText = [\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 options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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### With hidden label\n\nexport const withHiddenLabel = [\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 options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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### Disabled\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 {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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### Size small\n\nexport const sizeSmall = [\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 options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst 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## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the input field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n 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 mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst [results, setResults] = useState([]);\nconst changeHandler = (event: { detail: { value: string; }; }) => {\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query: string) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase()),\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults: IcMenuOption[]) => setResults(newResults));\n } else {\n setResults([]);\n }\n};\nconst useStyles = createUseStyles({\n parentContainer: {\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nconst [results, setResults] = useState([]);\nconst changeHandler = (event) =>{\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n}\nconst 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\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappucino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n ];\n const [results, setResults] = React.useState([]);\n const changeHandler = (event) => {\n const searchFor = event.detail.value;\n if (searchFor.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(searchFor).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n };\n return (\n \n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport { IcSearchBar, IcTypography } 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 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(ev.detail.value)}\r\n onIcSubmitSearch={(ev) => console.log(ev.detail.value)}\r\n placeholder=\"Start typing to search…\"\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 console.log(\"onIcChange\", ev.detail.value)}\r\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\r\n placeholder=\"Start typing to search…\"\r\n />\r\n\r\n\r\n## Search bar details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With options (no filtering)\r\n\r\nexport const optionsNoFiltering = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n
\r\n\r\n All options will be displayed as you type
\r\n`,\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
\r\n\r\n All options will be displayed as you type
\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 All options will be displayed as you type\r\n\r\n\r\n### With helper text\r\n\r\nexport const withHelperText = [\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 options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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### With hidden label\r\n\r\nexport const withHiddenLabel = [\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 options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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### Disabled\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ``,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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### Size small\r\n\r\nexport const sizeSmall = [\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 options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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 language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst 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## Custom filtering example\r\n\r\nThis example shows how to filter data asynchronously when the value in the input field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\r\n\r\nexport const customFiltering = [\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 mockData = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappucino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst [results, setResults] = useState([]);\r\nconst changeHandler = (event: { detail: { value: string; }; }) => {\r\n const searchFor = event.detail.value;\r\n if (searchFor.length > 1) {\r\n const mockAPI = (query: string) => {\r\n const filteredResults = mockData.filter((item) =>\r\n item.label.toLowerCase().includes(query.toLowerCase()),\r\n );\r\n return new Promise((resolve) => {\r\n setTimeout(() => resolve(filteredResults), 1000);\r\n });\r\n };\r\n mockAPI(searchFor).then((newResults: IcMenuOption[]) => setResults(newResults));\r\n } else {\r\n setResults([]);\r\n }\r\n};\r\nconst 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 language: \"Javascript\",\r\n snippet: `const mockData = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappucino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nconst [results, setResults] = useState([]);\r\nconst changeHandler = (event) =>{\r\n const searchFor = event.detail.value;\r\n if (searchFor.length > 1) {\r\n const mockAPI = (query) => {\r\n const filteredResults = mockData.filter((item) =>\r\n item.label.toLowerCase().includes(query.toLowerCase())\r\n );\r\n return new Promise((resolve) => {\r\n setTimeout(() => resolve(filteredResults), 1000);\r\n });\r\n };\r\n mockAPI(searchFor).then((newResults) => setResults(newResults));\r\n } else {\r\n setResults([]);\r\n }\r\n}\r\nconst 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\nexport const CustomFilterExample = () => {\r\n const mockData = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappucino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n ];\r\n const [results, setResults] = React.useState([]);\r\n const changeHandler = (event) => {\r\n const searchFor = event.detail.value;\r\n if (searchFor.length > 1) {\r\n const mockAPI = (query) => {\r\n const filteredResults = mockData.filter((item) =>\r\n item.label.toLowerCase().includes(query.toLowerCase())\r\n );\r\n return new Promise((resolve) => {\r\n setTimeout(() => resolve(filteredResults), 1000);\r\n });\r\n };\r\n mockAPI(searchFor).then((newResults) => setResults(newResults));\r\n } else {\r\n setResults([]);\r\n }\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\n\r\n \r\n\r\n",
"path": "/components/search-bar/code",
"date": "2024-05-31",
"title": "Search bar",
@@ -3122,16 +3122,16 @@
}
],
"meta": {
- "relativePath": "components/search-bar/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
- "size": 23254,
- "formattedSize": "22.7 KB"
+ "relativePath": "components\\search-bar\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.112Z",
+ "lastModified": "2024-12-04T13:23:54.112Z",
+ "size": 24118,
+ "formattedSize": "23.6 KB"
}
},
{
"id": "components\\search-bar\\guidancex",
- "contents": "\nimport { IcSearchBar } from \"@ukic/react\";\nimport searchBarFig1 from \"./images/fig-1-dont-display-large-numbers-of-search-results-in-droplist.png\";\nimport searchBarFig3 from \"./images/fig-3-search-field-with-helpful-placeholder.png\";\nimport searchBarFig4 from \"./images/fig-4-search-field-with-unhelpful-placeholder.png\";\nimport searchBarFig5 from \"./images/fig-5-suggested-options-loading-state.png\";\nimport searchBarFig6 from \"./images/fig-6-suggested-options-empty-state.png\";\n\n## Introduction\n\nAn example of the search bar component.\n\n\n console.log(\"onIcChange\", ev.detail.value)}\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\n placeholder=\"Start typing to search…\"\n />\n\n\n## When to use\n\n### Search bar with results\n\nUse the search bar with search results for automatically displaying search results relating to the input query in the input field. Use this for searching through a known data set, such as a site search displaying individual pages as the search results (like the search on this website).\n\nSearch for an ‘espresso’ below in the search bar example.\n\n\n \n\n\n### Search bar with suggested options\n\nUse the search bar with suggested options to provide search term suggestions in the drop-list. Use this type of search when you don't want to show actual search results, but instead possible or common search terms that will form the search query when submitted.\n\nUsers may select a suggested option or they may continue with searching on the term they have entered.\n\nWhen displaying suggested options, order them in the most helpful way and use the same formatting for each option presented.\n\n### Search bar only\n\nUse a search bar without a drop-list when you want to handle the search operation yourself. Use this to capture a search term and then direct a user to a custom search results page for the input query.\n\n\n \n\n\n## When not to use\n\nDon't use a search bar with search results if you are likely to need additional filters and advanced search settings. It's better to use a search bar with a custom search results page in this case.\n\nTake care when using a search bar with search results when you have large, complex data sets that take time to load. This can cause excessive loading times and it's best to use a custom search results page to handle and display large numbers of results.\n\n\n \n\n\nDon't use a search bar on its own, or a search bar with suggested options, if you don't have a method of displaying the results. Always include a search results page if you aren't using the search bar with search results.\n\n## Sizing\n\nUse the default and small size options for search bars to match their size to other components in your app.\n\n## Content\n\nUse clear and specific placeholder text that informs the user on the context and scope of the search.\n\n\n \n \n\n\nFor searches that take time to load results or suggestions, display the loading state whilst the search is loading. Use the empty state for searches that have no results or suggested options.\n\n\n \n \n\n",
+ "contents": "\r\nimport { IcSearchBar } from \"@ukic/react\";\r\nimport searchBarFig1 from \"./images/fig-1-dont-display-large-numbers-of-search-results-in-droplist.png\";\r\nimport searchBarFig3 from \"./images/fig-3-search-field-with-helpful-placeholder.png\";\r\nimport searchBarFig4 from \"./images/fig-4-search-field-with-unhelpful-placeholder.png\";\r\nimport searchBarFig5 from \"./images/fig-5-suggested-options-loading-state.png\";\r\nimport searchBarFig6 from \"./images/fig-6-suggested-options-empty-state.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the search bar component.\r\n\r\n\r\n console.log(\"onIcChange\", ev.detail.value)}\r\n onIcSubmitSearch={(ev) => console.log(\"onIcSubmitSearch\", ev.detail.value)}\r\n placeholder=\"Start typing to search…\"\r\n />\r\n\r\n\r\n## When to use\r\n\r\n### Search bar with results\r\n\r\nUse the search bar with search results for automatically displaying search results relating to the input query in the input field. Use this for searching through a known data set, such as a site search displaying individual pages as the search results (like the search on this website).\r\n\r\nSearch for an ‘espresso’ below in the search bar example.\r\n\r\n\r\n \r\n\r\n\r\n### Search bar with suggested options\r\n\r\nUse the search bar with suggested options to provide search term suggestions in the drop-list. Use this type of search when you don't want to show actual search results, but instead possible or common search terms that will form the search query when submitted.\r\n\r\nUsers may select a suggested option or they may continue with searching on the term they have entered.\r\n\r\nWhen displaying suggested options, order them in the most helpful way and use the same formatting for each option presented.\r\n\r\n### Search bar only\r\n\r\nUse a search bar without a drop-list when you want to handle the search operation yourself. Use this to capture a search term and then direct a user to a custom search results page for the input query.\r\n\r\n\r\n \r\n\r\n\r\n## When not to use\r\n\r\nDon't use a search bar with search results if you are likely to need additional filters and advanced search settings. It's better to use a search bar with a custom search results page in this case.\r\n\r\nTake care when using a search bar with search results when you have large, complex data sets that take time to load. This can cause excessive loading times and it's best to use a custom search results page to handle and display large numbers of results.\r\n\r\n\r\n \r\n\r\n\r\nDon't use a search bar on its own, or a search bar with suggested options, if you don't have a method of displaying the results. Always include a search results page if you aren't using the search bar with search results.\r\n\r\n## Sizing\r\n\r\nUse the default and small size options for search bars to match their size to other components in your app.\r\n\r\n## Content\r\n\r\nUse clear and specific placeholder text that informs the user on the context and scope of the search.\r\n\r\n\r\n \r\n \r\n\r\n\r\nFor searches that take time to load results or suggestions, display the loading state whilst the search is loading. Use the empty state for searches that have no results or suggested options.\r\n\r\n\r\n \r\n \r\n\r\n",
"path": "/components/search-bar",
"navPriority": 27,
"date": "2023-02-03",
@@ -3155,11 +3155,11 @@
],
"tags": ["Search input"],
"meta": {
- "relativePath": "components/search-bar/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.112Z",
- "size": 5859,
- "formattedSize": "5.7 KB"
+ "relativePath": "components\\search-bar\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.112Z",
+ "lastModified": "2024-12-04T13:23:54.112Z",
+ "size": 6006,
+ "formattedSize": "5.9 KB"
}
},
{
@@ -3186,9 +3186,9 @@
}
],
"meta": {
- "relativePath": "components/section-container/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
+ "relativePath": "components\\section-container\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.068Z",
+ "lastModified": "2024-11-05T11:57:53.068Z",
"size": 1920,
"formattedSize": "1.9 KB"
}
@@ -3217,9 +3217,9 @@
}
],
"meta": {
- "relativePath": "components/section-container/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
+ "relativePath": "components\\section-container\\code.mdx",
+ "createdAt": "2024-11-05T11:57:53.097Z",
+ "lastModified": "2024-11-05T11:57:53.097Z",
"size": 9524,
"formattedSize": "9.3 KB"
}
@@ -3249,9 +3249,9 @@
}
],
"meta": {
- "relativePath": "components/section-container/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
+ "relativePath": "components\\section-container\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:53.131Z",
+ "lastModified": "2024-11-05T11:57:53.131Z",
"size": 5577,
"formattedSize": "5.4 KB"
}
@@ -3280,16 +3280,16 @@
}
],
"meta": {
- "relativePath": "components/select/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
+ "relativePath": "components\\select\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.151Z",
+ "lastModified": "2024-11-05T11:57:53.151Z",
"size": 2736,
"formattedSize": "2.7 KB"
}
},
{
"id": "components\\select\\codex",
- "contents": "\nimport { IcSelect } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Select details\n\n\n\n## Variants\n\n### With clear button, descriptions, helper text and custom placeholder\n\nexport const snippetsWithExtras = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleWithExtras = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Options disabled\n\nexport const snippetsOptionDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\", disabled: true },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\", disabled: true },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleOptionsDisabled = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### With icon\n\nexport const snippetsWithIcon = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n>\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleWithIcon = () => (\n console.log(event.detail.value)}\n >\n \n \n);\n\n\n \n\n\n### Size small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n size=\"small\"\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleSmall = () => (\n console.log(event.detail.value)}\n size=\"small\"\n />\n);\n\n\n \n\n\n### Hidden label\n\nexport const snippetsHideLabel = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleHideLabel = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Groups\n\nexport const snippetsGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const 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 {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const 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 {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleGroups = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Recommended\n\nexport const snippetsRecommended = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\", recommended: true },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\", recommended: true },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\", recommended: true },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\", recommended: true },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleRecommended = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>\n console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Espresso\", value: \"espresso\" },\n { label: \"Double Espresso\", value: \"doubleespresso\" },\n { label: \"Flat White\", value: \"flatwhite\" },\n { label: \"Cappuccino\", value: \"cappuccino\" },\n { label: \"Americano\", value: \"americano\" },\n { label: \"Mocha\", value: \"mocha\" },\n];\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const SelectExampleValidation = () => (\n \n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n console.log(event.detail.value)}\n />\n
\n);\n\n\n \n\n\n### Custom elements in options\n\nexport const snippetsCustomElements = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { \n label: \"Cappuccino\", \n value: \"Cap\", \n },\n { \n label: \"Latte\", \n value: \"Lat\",\n element: {\n component: '',\n ariaLabel: \"Neutral status tag\",\n }\n },\n { \n label: \"Americano\", \n value: \"Ame\",\n icon: ''\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { \n label: \"Cappuccino\", \n value: \"Cap\", \n },\n { \n label: \"Latte\", \n value: \"Lat\",\n element: {\n component: '',\n ariaLabel: \"Neutral status tag\",\n }\n },\n { \n label: \"Americano\", \n value: \"Ame\",\n icon: ''\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const optionsWithCustomElements = [\n {\n label: \"Cappuccino\",\n value: \"Cap\",\n },\n {\n label: \"Latte\",\n value: \"Lat\",\n element: {\n component: ``,\n ariaLabel: \"Neutral status tag\",\n },\n },\n {\n label: \"Americano\",\n value: \"Ame\",\n icon: ``,\n },\n];\n\n\n console.log(event.detail.value)}\n />\n\n\n### Searchable\n\nexport const snippetsSearchable = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n { label: \"Café au lait\", value: \"Caf\" },\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Cortado\", value: \"Cor\" },\n { label: \"Latte macchiato\", value: \"Lam\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n { label: \"Café au lait\", value: \"Caf\" },\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Cortado\", value: \"Cor\" },\n { label: \"Latte macchiato\", value: \"Lam\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable – with descriptions included in search\n\nexport const snippetsSearchableWithDescriptions = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"Cap\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"Ame\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"Moc\", description: \"Coffee with chocolate\" },\n { label: \"Latte\", value: \"Lat\", description: \"Milky coffee with one or two shots of espresso\" },\n { label: \"Flat white\", value: \"Fla\", description: \"Coffee with frothed milk poured over espresso\" },\n { label: \"Macchiato\", value: \"Mac\", description: \"Espresso coffee topped with steamed milk\" },\n { label: \"Café au lait\", value: \"Caf\", description: \"Brewed coffee with steamed milk\" },\n { label: \"Espresso\", value: \"Esp\", description: \"Concentrated form of coffee\" },\n { label: \"Cortado\", value: \"Cor\", description: \"Coffee cut with milk\" },\n { label: \"Latte macchiato\", value: \"Lam\", description: \"Espresso coffee with milk and a spoonful of foamed milk\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n { label: \"Cappuccino\", value: \"Cap\", description: \"Coffee frothed up with pressurised steam\" },\n { label: \"Americano\", value: \"Ame\", description: \"Espresso coffee diluted with hot water\" },\n { label: \"Mocha\", value: \"Moc\", description: \"Coffee with chocolate\" },\n { label: \"Latte\", value: \"Lat\", description: \"Milky coffee with one or two shots of espresso\" },\n { label: \"Flat white\", value: \"Fla\", description: \"Coffee with frothed milk poured over espresso\" },\n { label: \"Macchiato\", value: \"Mac\", description: \"Espresso coffee topped with steamed milk\" },\n { label: \"Café au lait\", value: \"Caf\", description: \"Brewed coffee with steamed milk\" },\n { label: \"Espresso\", value: \"Esp\", description: \"Concentrated form of coffee\" },\n { label: \"Cortado\", value: \"Cor\", description: \"Coffee cut with milk\" },\n { label: \"Latte macchiato\", value: \"Lam\", description: \"Espresso coffee with milk and a spoonful of foamed milk\" },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectWithDescriptionsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n### Searchable – with group titles included in search\n\nexport const snippetsSearchableWithGroups = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log(event.detail.value)}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const options = [\n {\n label: \"Fancy\",\n children: [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Flat white\", value: \"Flat\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n { label: \"Cortado\", value: \"Cor\" },\n { label: \"Latte macchiato\", value: \"Lam\" },\n ],\n },\n {\n label: \"Boring\",\n children: [\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Espresso\", value: \"Esp\" },\n ],\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const options = [\n {\n label: \"Fancy\",\n children: [\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Flat white\", value: \"Flat\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n { label: \"Cortado\", value: \"Cor\" },\n { label: \"Latte macchiato\", value: \"Lam\" },\n ],\n },\n {\n label: \"Boring\",\n children: [\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Espresso\", value: \"Esp\" },\n ],\n },\n];\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\nexport const SearchableSelectWithGroupsExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\n## Custom filtering example\n\nThis example shows how to filter data asynchronously when the value in the select field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\n\nexport const customFiltering = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nconst [results, setResults] = useState([]);\nconst [selectedValue, setSelectedValue] = useState(\"\");\nconst changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) => \n item.label.toLowerCase().includes(query.toLowerCase()));\n return new Promise(resolve => { \n setTimeout(() => resolve(filteredResults), 1000)\n });\n };\n mockAPI(newValue).then((results) => setResults(results));\n } else {\n setResults([]);\n }\n } \n}\nreturn(\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n];\nconst [results, setResults] = useState([]);\nconst [selectedValue, setSelectedValue] = useState(\"\");\nconst changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) => \n item.label.toLowerCase().includes(query.toLowerCase()));\n return new Promise(resolve => { \n setTimeout(() => resolve(filteredResults), 1000)\n });\n };\n mockAPI(newValue).then((results) => setResults(results));\n } else {\n setResults([]);\n }\n } \n}\nreturn(\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const CustomFilterExample = () => {\n const mockData = [\n { label: \"Espresso\", value: \"Esp\" },\n { label: \"Double Espresso\", value: \"Dou\" },\n { label: \"Cappuccino\", value: \"Cap\" },\n { label: \"Latte\", value: \"Lat\" },\n { label: \"Americano\", value: \"Ame\" },\n { label: \"Filter\", value: \"Fil\" },\n { label: \"Flat white\", value: \"Fla\" },\n { label: \"Mocha\", value: \"Moc\" },\n { label: \"Macchiato\", value: \"Mac\" },\n ];\n const [results, setResults] = React.useState([]);\n const [selectedValue, setSelectedValue] = React.useState(\"\");\n const changeHandler = (event) => {\n const newValue = event.detail.value;\n console.log(newValue);\n if (newValue !== selectedValue) {\n if (newValue && newValue.length > 1) {\n const mockAPI = (query) => {\n const filteredResults = mockData.filter((item) =>\n item.label.toLowerCase().includes(query.toLowerCase())\n );\n return new Promise((resolve) => {\n setTimeout(() => resolve(filteredResults), 1000);\n });\n };\n mockAPI(newValue).then((newResults) => setResults(newResults));\n } else {\n setResults([]);\n }\n }\n };\n return (\n setSelectedValue(event.detail.value)}\n onIcClear={() => setResults([])}\n onIcChange={changeHandler}\n />\n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport { IcSelect } 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 long: `{shortCode}\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/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExample = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n## Select details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With clear button, descriptions, helper text and custom placeholder\r\n\r\nexport const snippetsWithExtras = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleWithExtras = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Disabled\r\n\r\nexport const snippetsDisabled = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleDisabled = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Options disabled\r\n\r\nexport const snippetsOptionDisabled = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\", disabled: true },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\", disabled: true },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleOptionsDisabled = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### With icon\r\n\r\nexport const snippetsWithIcon = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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: ` console.log(event.detail.value)}\r\n>\r\n \r\n \r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"cappuccino\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"americano\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"mocha\", description: \"Coffee with chocolate\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleWithIcon = () => (\r\n console.log(event.detail.value)}\r\n >\r\n \r\n \r\n);\r\n\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 long: `{shortCode}\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 size=\"small\"\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleSmall = () => (\r\n console.log(event.detail.value)}\r\n size=\"small\"\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Hidden label\r\n\r\nexport const snippetsHideLabel = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleHideLabel = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Groups\r\n\r\nexport const snippetsGroups = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const 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 {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const 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 {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleGroups = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Recommended\r\n\r\nexport const snippetsRecommended = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\", recommended: true },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\", recommended: true },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\", recommended: true },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\", recommended: true },\r\n { label: \"Mocha\", value: \"mocha\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SelectExampleRecommended = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Validation\r\n\r\nexport const snippetsValidation = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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: ` console.log(event.detail.value)}\r\n/>\r\n console.log(event.detail.value)}\r\n/>\r\n console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\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 options = [\r\n { label: \"Espresso\", value: \"espresso\" },\r\n { label: \"Double Espresso\", value: \"doubleespresso\" },\r\n { label: \"Flat White\", value: \"flatwhite\" },\r\n { label: \"Cappuccino\", value: \"cappuccino\" },\r\n { label: \"Americano\", value: \"americano\" },\r\n { label: \"Mocha\", value: \"mocha\" },\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\nexport const SelectExampleValidation = () => (\r\n \r\n console.log(event.detail.value)}\r\n />\r\n console.log(event.detail.value)}\r\n />\r\n console.log(event.detail.value)}\r\n />\r\n
\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Custom elements in options\r\n\r\nexport const snippetsCustomElements = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { \r\n label: \"Cappuccino\", \r\n value: \"Cap\", \r\n },\r\n { \r\n label: \"Latte\", \r\n value: \"Lat\",\r\n element: {\r\n component: '',\r\n ariaLabel: \"Neutral status tag\",\r\n }\r\n },\r\n { \r\n label: \"Americano\", \r\n value: \"Ame\",\r\n icon: ''\r\n },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { \r\n label: \"Cappuccino\", \r\n value: \"Cap\", \r\n },\r\n { \r\n label: \"Latte\", \r\n value: \"Lat\",\r\n element: {\r\n component: '',\r\n ariaLabel: \"Neutral status tag\",\r\n }\r\n },\r\n { \r\n label: \"Americano\", \r\n value: \"Ame\",\r\n icon: ''\r\n },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const optionsWithCustomElements = [\r\n {\r\n label: \"Cappuccino\",\r\n value: \"Cap\",\r\n },\r\n {\r\n label: \"Latte\",\r\n value: \"Lat\",\r\n element: {\r\n component: ``,\r\n ariaLabel: \"Neutral status tag\",\r\n },\r\n },\r\n {\r\n label: \"Americano\",\r\n value: \"Ame\",\r\n icon: ``,\r\n },\r\n];\r\n\r\n\r\n console.log(event.detail.value)}\r\n />\r\n\r\n\r\n### Searchable\r\n\r\nexport const snippetsSearchable = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n { label: \"Café au lait\", value: \"Caf\" },\r\n { label: \"Espresso\", value: \"Esp\" },\r\n { label: \"Cortado\", value: \"Cor\" },\r\n { label: \"Latte macchiato\", value: \"Lam\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"Cap\" },\r\n { label: \"Latte\", value: \"Lat\" },\r\n { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Flat white\", value: \"Fla\" },\r\n { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n { label: \"Café au lait\", value: \"Caf\" },\r\n { label: \"Espresso\", value: \"Esp\" },\r\n { label: \"Cortado\", value: \"Cor\" },\r\n { label: \"Latte macchiato\", value: \"Lam\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SearchableSelectExample = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Searchable – with descriptions included in search\r\n\r\nexport const snippetsSearchableWithDescriptions = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"Cap\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"Ame\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"Moc\", description: \"Coffee with chocolate\" },\r\n { label: \"Latte\", value: \"Lat\", description: \"Milky coffee with one or two shots of espresso\" },\r\n { label: \"Flat white\", value: \"Fla\", description: \"Coffee with frothed milk poured over espresso\" },\r\n { label: \"Macchiato\", value: \"Mac\", description: \"Espresso coffee topped with steamed milk\" },\r\n { label: \"Café au lait\", value: \"Caf\", description: \"Brewed coffee with steamed milk\" },\r\n { label: \"Espresso\", value: \"Esp\", description: \"Concentrated form of coffee\" },\r\n { label: \"Cortado\", value: \"Cor\", description: \"Coffee cut with milk\" },\r\n { label: \"Latte macchiato\", value: \"Lam\", description: \"Espresso coffee with milk and a spoonful of foamed milk\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const options = [\r\n { label: \"Cappuccino\", value: \"Cap\", description: \"Coffee frothed up with pressurised steam\" },\r\n { label: \"Americano\", value: \"Ame\", description: \"Espresso coffee diluted with hot water\" },\r\n { label: \"Mocha\", value: \"Moc\", description: \"Coffee with chocolate\" },\r\n { label: \"Latte\", value: \"Lat\", description: \"Milky coffee with one or two shots of espresso\" },\r\n { label: \"Flat white\", value: \"Fla\", description: \"Coffee with frothed milk poured over espresso\" },\r\n { label: \"Macchiato\", value: \"Mac\", description: \"Espresso coffee topped with steamed milk\" },\r\n { label: \"Café au lait\", value: \"Caf\", description: \"Brewed coffee with steamed milk\" },\r\n { label: \"Espresso\", value: \"Esp\", description: \"Concentrated form of coffee\" },\r\n { label: \"Cortado\", value: \"Cor\", description: \"Coffee cut with milk\" },\r\n { label: \"Latte macchiato\", value: \"Lam\", description: \"Espresso coffee with milk and a spoonful of foamed milk\" },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SearchableSelectWithDescriptionsExample = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Searchable – with group titles included in search\r\n\r\nexport const snippetsSearchableWithGroups = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` console.log(event.detail.value)}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const 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 { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n { label: \"Cortado\", value: \"Cor\" },\r\n { label: \"Latte macchiato\", value: \"Lam\" },\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 { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Espresso\", value: \"Esp\" },\r\n ],\r\n },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const 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 { label: \"Mocha\", value: \"Moc\" },\r\n { label: \"Macchiato\", value: \"Mac\" },\r\n { label: \"Cortado\", value: \"Cor\" },\r\n { label: \"Latte macchiato\", value: \"Lam\" },\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 { label: \"Americano\", value: \"Ame\" },\r\n { label: \"Espresso\", value: \"Esp\" },\r\n ],\r\n },\r\n];\r\nreturn (\r\n {shortCode}\r\n)`,\r\n },\r\n ],\r\n },\r\n },\r\n];\r\n\r\nexport const SearchableSelectWithGroupsExample = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\n## Custom filtering example\r\n\r\nThis example shows how to filter data asynchronously when the value in the select field changes. The data is mocked and displayed after a one second delay, but could be replaced with a call to an API or database.\r\n\r\nexport const customFiltering = [\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 {\r\n technology: \"React\",\r\n snippets: {\r\n short: ` setSelectedValue(event.detail.value)}\r\n onIcClear={() => setResults([])}\r\n onIcChange={changeHandler}\r\n/>`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const mockData = [\r\n { label: \"Espresso\", value: \"Esp\" },\r\n { label: \"Double Espresso\", value: \"Dou\" },\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\nconst [results, setResults] = useState([]);\r\nconst [selectedValue, setSelectedValue] = useState(\"\");\r\nconst changeHandler = (event) => {\r\n const newValue = event.detail.value;\r\n console.log(newValue);\r\n if (newValue !== selectedValue) {\r\n if (newValue && newValue.length > 1) {\r\n const mockAPI = (query) => {\r\n const filteredResults = mockData.filter((item) => \r\n item.label.toLowerCase().includes(query.toLowerCase()));\r\n return new Promise(resolve => { \r\n setTimeout(() => resolve(filteredResults), 1000)\r\n });\r\n };\r\n mockAPI(newValue).then((results) => setResults(results));\r\n } else {\r\n setResults([]);\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 mockData = [\r\n { label: \"Espresso\", value: \"Esp\" },\r\n { label: \"Double Espresso\", value: \"Dou\" },\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\nconst [results, setResults] = useState([]);\r\nconst [selectedValue, setSelectedValue] = useState(\"\");\r\nconst changeHandler = (event) => {\r\n const newValue = event.detail.value;\r\n console.log(newValue);\r\n if (newValue !== selectedValue) {\r\n if (newValue && newValue.length > 1) {\r\n const mockAPI = (query) => {\r\n const filteredResults = mockData.filter((item) => \r\n item.label.toLowerCase().includes(query.toLowerCase()));\r\n return new Promise(resolve => { \r\n setTimeout(() => resolve(filteredResults), 1000)\r\n });\r\n };\r\n mockAPI(newValue).then((results) => setResults(results));\r\n } else {\r\n setResults([]);\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\nexport const CustomFilterExample = () => {\r\n const mockData = [\r\n { label: \"Espresso\", value: \"Esp\" },\r\n { label: \"Double Espresso\", value: \"Dou\" },\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\n const [results, setResults] = React.useState([]);\r\n const [selectedValue, setSelectedValue] = React.useState(\"\");\r\n const changeHandler = (event) => {\r\n const newValue = event.detail.value;\r\n console.log(newValue);\r\n if (newValue !== selectedValue) {\r\n if (newValue && newValue.length > 1) {\r\n const mockAPI = (query) => {\r\n const filteredResults = mockData.filter((item) =>\r\n item.label.toLowerCase().includes(query.toLowerCase())\r\n );\r\n return new Promise((resolve) => {\r\n setTimeout(() => resolve(filteredResults), 1000);\r\n });\r\n };\r\n mockAPI(newValue).then((newResults) => setResults(newResults));\r\n } else {\r\n setResults([]);\r\n }\r\n }\r\n };\r\n return (\r\n setSelectedValue(event.detail.value)}\r\n onIcClear={() => setResults([])}\r\n onIcChange={changeHandler}\r\n />\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n",
"path": "/components/select/code",
"date": "2024-07-02",
"title": "Select",
@@ -3311,16 +3311,16 @@
}
],
"meta": {
- "relativePath": "components/select/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
- "size": 51973,
- "formattedSize": "50.8 KB"
+ "relativePath": "components\\select\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.113Z",
+ "lastModified": "2024-12-04T13:23:54.113Z",
+ "size": 53805,
+ "formattedSize": "52.5 KB"
}
},
{
"id": "components\\select\\guidancex",
- "contents": "\nimport { IcSelect } from \"@ukic/react\";\nimport selectFig1 from \"./images/fig-1-use-radio-or-checkbox-groups-when-less-than-four-options-are-available2x.png\";\nimport selectFig2 from \"./images/fig-2-dont-use-dropdowns-when-displaying-a-limited-number-of-options2x.png\";\nimport selectFig3 from \"./images/fig-3-use-labels-to-indicate-the-title-of-the-field.png\";\nimport selectFig4 from \"./images/fig-4-dont-replace-labels-with-placeholder-text.png\";\nimport selectFig5 from \"./images/fig-5-use-a-standard-select-when-providing-less-than-ten-options.png\";\nimport selectFig6 from \"./images/fig-6-do-not-use-the-searchable-variant-when-providing-less-than-ten-options.png\";\n\n## Component variants\n\nThere are two types of select component:\n\n- Single-select\n- Multi-select\n\n### Single-select\n\nAn example of the single-select component.\n\nexport const SelectExample = () => (\n \n);\n\n\n \n\n\n### Multi-select\n\nThe multi-select is currently released in our canary packages, which means it is likely to change in future releases. Guidance and documentation can be found on the [multi-select page](/components/multi-select).\n\n## When to use\n\nUse the select component to allow the user to choose one or more options from four or more items. For less than four, use a [radio group](/components/radio) or a [checkbox group](/components/checkbox).\nWhen more than ten options are available, consider using the [searchable variant](/components/select#searchable-single-select) of select to allow users to search the options, rather than scroll through the dropdown list.\n\n\n \n \n\n\n## Validation\n\nReal-time validation helps the user streamline their process and efficiently complete a form. All error validation should be accompanied by an error label.\n\n## Content\n\n### Option list\n\nThe options display a label by default for the option list, which can also include a description or custom elements. Any custom elements used should be non-interactive, such as status tags or icons.\n\nUse a default option list to display all options without any grouping or recommendations.\n\n#### Recommended\n\nUse an option list with recommendations to display specific options at the top of the list for quick access.\n\n#### Groups\n\nUse an option list with groups to combine the options into groups with descriptive headings.\n\n### Labels\n\nClear labels help users understand what information they should provide.\n\nLabels should always be visible regardless of the state of the field and should be announced by a screen reader on focus.\n\n\n \n \n\n\n### Helper text\n\nHelper text should be included when additional information can help the user to either provide the right information or understand why or how the information will be used.\n\nMake sure any helper text that appears under an input is read when an assistive technology user stops at an input using ARIA.\n\n### Dismissible inputs\n\nAlways allow the user to clear their selection by including a clear button inside the input field.\n\n## Searchable (single-select)\n\nexport const SearchableSelectExample = () => (\n console.log(event.detail.value)}\n />\n);\n\n\n \n\n\nThe single-select component can be set to be searchable to filter options in the option list. A user can open the option list to view the available options, but can also type into the input field to filter the option list to more easily find the desired option.\n\nUse the searchable variant when including several options in the option list, so that the user can quickly filter their desired selection.\n\nDon’t use the searchable variant when providing less than ten options. The added functionality for short lists may confuse users while providing no benefit to their experience.\n\n\n \n \n\n\n### Content\n\nThe component can be configured to show values that either match the search term, or show values that contain the search term. For example, United Kingdom matches the search term ‘Un’, and Tunisia contains the search term ‘Un’.\n\nFor searches that take time to load results or suggestions, display the loading state whilst the search is loading. Use the empty state for searches that have no results or suggested options.\n\n## Related components\n\n- [Search bar](/components/search-bar)\n",
+ "contents": "\r\nimport { IcSelect } from \"@ukic/react\";\r\nimport selectFig1 from \"./images/fig-1-use-radio-or-checkbox-groups-when-less-than-four-options-are-available2x.png\";\r\nimport selectFig2 from \"./images/fig-2-dont-use-dropdowns-when-displaying-a-limited-number-of-options2x.png\";\r\nimport selectFig3 from \"./images/fig-3-use-labels-to-indicate-the-title-of-the-field.png\";\r\nimport selectFig4 from \"./images/fig-4-dont-replace-labels-with-placeholder-text.png\";\r\nimport selectFig5 from \"./images/fig-5-use-a-standard-select-when-providing-less-than-ten-options.png\";\r\nimport selectFig6 from \"./images/fig-6-do-not-use-the-searchable-variant-when-providing-less-than-ten-options.png\";\r\n\r\n## Component variants\r\n\r\nThere are two types of select component:\r\n\r\n- Single-select\r\n- Multi-select\r\n\r\n### Single-select\r\n\r\nAn example of the single-select component.\r\n\r\nexport const SelectExample = () => (\r\n \r\n);\r\n\r\n\r\n \r\n\r\n\r\n### Multi-select\r\n\r\nThe multi-select is currently released in our canary packages, which means it is likely to change in future releases. Guidance and documentation can be found on the [multi-select page](/components/multi-select).\r\n\r\n## When to use\r\n\r\nUse the select component to allow the user to choose one or more options from four or more items. For less than four, use a [radio group](/components/radio) or a [checkbox group](/components/checkbox).\r\nWhen more than ten options are available, consider using the [searchable variant](/components/select#searchable-single-select) of select to allow users to search the options, rather than scroll through the dropdown list.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Validation\r\n\r\nReal-time validation helps the user streamline their process and efficiently complete a form. All error validation should be accompanied by an error label.\r\n\r\n## Content\r\n\r\n### Option list\r\n\r\nThe options display a label by default for the option list, which can also include a description or custom elements. Any custom elements used should be non-interactive, such as status tags or icons.\r\n\r\nUse a default option list to display all options without any grouping or recommendations.\r\n\r\n#### Recommended\r\n\r\nUse an option list with recommendations to display specific options at the top of the list for quick access.\r\n\r\n#### Groups\r\n\r\nUse an option list with groups to combine the options into groups with descriptive headings.\r\n\r\n### Labels\r\n\r\nClear labels help users understand what information they should provide.\r\n\r\nLabels should always be visible regardless of the state of the field and should be announced by a screen reader on focus.\r\n\r\n\r\n \r\n \r\n\r\n\r\n### Helper text\r\n\r\nHelper text should be included when additional information can help the user to either provide the right information or understand why or how the information will be used.\r\n\r\nMake sure any helper text that appears under an input is read when an assistive technology user stops at an input using ARIA.\r\n\r\n### Dismissible inputs\r\n\r\nAlways allow the user to clear their selection by including a clear button inside the input field.\r\n\r\n## Searchable (single-select)\r\n\r\nexport const SearchableSelectExample = () => (\r\n console.log(event.detail.value)}\r\n />\r\n);\r\n\r\n\r\n \r\n\r\n\r\nThe single-select component can be set to be searchable to filter options in the option list. A user can open the option list to view the available options, but can also type into the input field to filter the option list to more easily find the desired option.\r\n\r\nUse the searchable variant when including several options in the option list, so that the user can quickly filter their desired selection.\r\n\r\nDon’t use the searchable variant when providing less than ten options. The added functionality for short lists may confuse users while providing no benefit to their experience.\r\n\r\n\r\n \r\n \r\n\r\n\r\n### Content\r\n\r\nThe component can be configured to show values that either match the search term, or show values that contain the search term. For example, United Kingdom matches the search term ‘Un’, and Tunisia contains the search term ‘Un’.\r\n\r\nFor searches that take time to load results or suggestions, display the loading state whilst the search is loading. Use the empty state for searches that have no results or suggested options.\r\n\r\n## Related components\r\n\r\n- [Search bar](/components/search-bar)\r\n",
"path": "/components/select",
"navPriority": 30,
"date": "2024-05-02",
@@ -3350,11 +3350,11 @@
"Autosuggest"
],
"meta": {
- "relativePath": "components/select/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.116Z",
- "size": 7642,
- "formattedSize": "7.5 KB"
+ "relativePath": "components\\select\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.114Z",
+ "lastModified": "2024-12-04T13:23:54.114Z",
+ "size": 7836,
+ "formattedSize": "7.7 KB"
}
},
{
@@ -3381,9 +3381,9 @@
}
],
"meta": {
- "relativePath": "components/side-nav/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.120Z",
+ "relativePath": "components\\side-nav\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.309Z",
+ "lastModified": "2024-11-05T11:57:53.309Z",
"size": 2967,
"formattedSize": "2.9 KB"
}
@@ -3412,16 +3412,16 @@
}
],
"meta": {
- "relativePath": "components/side-nav/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.120Z",
+ "relativePath": "components\\side-nav\\code.mdx",
+ "createdAt": "2024-11-05T11:57:53.372Z",
+ "lastModified": "2024-11-05T11:57:53.372Z",
"size": 68691,
"formattedSize": "67.1 KB"
}
},
{
"id": "components\\side-nav\\guidancex",
- "contents": "\nimport { IcSideNavigation, IcNavigationItem, IcAlert } from \"@ukic/react\";\n\nimport sideNavigationFig1 from \"./images/fig-1-dont-use-both-side-and-top-navigation.png\";\nimport sideNavigationFig2 from \"./images/fig-2-avoid-side-navigation-for-complex-app-structures.png\";\nimport sideNavigationFig3 from \"./images/fig-3-set-side-navigation-default-display.png\";\nimport sideNavigationFig4 from \"./images/fig-4-static-side-navigation.png\";\nimport sideNavigationFig5 from \"./images/fig-5-side-navigation-sub-menu.png\";\nimport sideNavigationFig6 from \"./images/fig-6-personality-colourisation.png\";\nimport sideNavigationFig7 from \"./images/fig-7-dont-position-side-nav-above-footer.png\";\nimport sideNavigationFig8 from \"./images/fig-8-keep-menu-option-labels-concise-to-avoid-truncation.png\";\nimport sideNavigationFig9 from \"./images/fig-9-tooltips-show-labels-on-hover-or-focus.png\";\nimport sideNavigationFig10 from \"./images/fig-10-set-menu-options-to-display-labels.png\";\nimport sideNavigationFig11 from \"./images/fig-11-use-menu-groups-and-drilldowns.png\";\n\n## Introduction\n\nAn example of the side navigation component.\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 side navigation to help provide more screen space for the main content. Side navigation is well suited to apps that have mutually exclusive features that need to be switched between easily on any page.\n\nUse side navigation alongside additional components like [page headers](/components/page-header) to create a variety of different [layouts](/styles/layout-spacing) and navigation styles.\n\n## When not to use\n\nFor intranet-style and content-heavy apps, use [top navigation](/components/top-navigation) as it's better suited for providing links to a large number of pages.\n\nUse either side navigation or top navigation. Don't use both at the same time.\n\n\n\nAvoid using side navigation if the app has many destinations grouped into a multi-level hierarchy. Instead use a [top navigation](/components/top-navigation) with grouped links.\n\n\n\n## Interaction behaviour\n\nSide navigation is expandable and displays the navigation labels and app info when expanded. Choose whether to display the side navigation as expanded or collapsed by default when the page loads.\n\n\n\nSet the side navigation to static if you want it to be either permanently expanded or permanently collapsed. This removes the expansion toggle button from the bottom of the side navigation.\n\n\n\nUse a drill-down menu option to provide access to child links in a sub-menu. The sub-menu can be closed by using the back button in the sub-menu's top section.\n\nSub-menus can be nested, but avoid creating overly deep page hierarchies and consider using top navigation with grouped links instead.\n\n\n\n## Colour\n\nThe side navigation uses the app's [theme colour](/styles/colour/#theme) as the background and automatically sets the foreground colour to ensure accessible contrast ratios. Change the app's theme colour to change the background colour of the side navigation and help distinguish your app from others your users may use.\n\n\n\n## Layout and placement\n\nAlways position the side navigation on the left hand of the screen and make sure that it vertically fills the browser window.\n\n\n\n## Content\n\n### App information\n\nUse your app's name, icon, status and version information in the side navigation's app info fields.\n\n### Labels and icons\n\nFollow the [content style guidelines](/styles/content-style) for all menu option labels as well as each option group labels.\n\nFollow the [icon style guidelines](/styles/icons) when selecting icons for menu options.\n\nKeep labels concise as they will truncate if they are too long to display in the side navigation.\n\n\n\n### Menu items\n\nSet the side navigation menu items to reflect your app's main navigation links.\n\nBy default, menu items will only display their icon when the side navigation is collapsed. The item label will be displayed via a tooltip when hovering or focusing on the menu item.\n\n\n\nSet the menu items to display their labels in the collapsed state by default if this will aid the recognition of the feature. However, take care when doing this as long menu item labels will be truncated.\n\n\n\nGroup related menu items into expandable menu item groups.\n\nUse a drill-down menu item if the menu item has a large number of child links to display. This will display the child links in the side navigation's sub-menu.\n\n\n\n\n\n### Bottom menu items\n\nUse the sticky bottom menu section to provide quick links to global app features or external links.\n\n## Accessibility considerations\n\nMake sure to include alt-text when specifying icons for menu items.\n\n## Related Components\n\n- [Top navigation](/components/top-navigation)\n",
+ "contents": "\r\nimport { IcSideNavigation, IcNavigationItem, IcAlert } from \"@ukic/react\";\r\n\r\nimport sideNavigationFig1 from \"./images/fig-1-dont-use-both-side-and-top-navigation.png\";\r\nimport sideNavigationFig2 from \"./images/fig-2-avoid-side-navigation-for-complex-app-structures.png\";\r\nimport sideNavigationFig3 from \"./images/fig-3-set-side-navigation-default-display.png\";\r\nimport sideNavigationFig4 from \"./images/fig-4-static-side-navigation.png\";\r\nimport sideNavigationFig5 from \"./images/fig-5-side-navigation-sub-menu.png\";\r\nimport sideNavigationFig6 from \"./images/fig-6-personality-colourisation.png\";\r\nimport sideNavigationFig7 from \"./images/fig-7-dont-position-side-nav-above-footer.png\";\r\nimport sideNavigationFig8 from \"./images/fig-8-keep-menu-option-labels-concise-to-avoid-truncation.png\";\r\nimport sideNavigationFig9 from \"./images/fig-9-tooltips-show-labels-on-hover-or-focus.png\";\r\nimport sideNavigationFig10 from \"./images/fig-10-set-menu-options-to-display-labels.png\";\r\nimport sideNavigationFig11 from \"./images/fig-11-use-menu-groups-and-drilldowns.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the side navigation component.\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## When to use\r\n\r\nUse side navigation to help provide more screen space for the main content. Side navigation is well suited to apps that have mutually exclusive features that need to be switched between easily on any page.\r\n\r\nUse side navigation alongside additional components like [page headers](/components/page-header) to create a variety of different [layouts](/styles/layout-spacing) and navigation styles.\r\n\r\n## When not to use\r\n\r\nFor intranet-style and content-heavy apps, use [top navigation](/components/top-navigation) as it's better suited for providing links to a large number of pages.\r\n\r\nUse either side navigation or top navigation. Don't use both at the same time.\r\n\r\n\r\n\r\nAvoid using side navigation if the app has many destinations grouped into a multi-level hierarchy. Instead use a [top navigation](/components/top-navigation) with grouped links.\r\n\r\n\r\n\r\n## Interaction behaviour\r\n\r\nSide navigation is expandable and displays the navigation labels and app info when expanded. Choose whether to display the side navigation as expanded or collapsed by default when the page loads.\r\n\r\n\r\n\r\nSet the side navigation to static if you want it to be either permanently expanded or permanently collapsed. This removes the expansion toggle button from the bottom of the side navigation.\r\n\r\n\r\n\r\nUse a drill-down menu option to provide access to child links in a sub-menu. The sub-menu can be closed by using the back button in the sub-menu's top section.\r\n\r\nSub-menus can be nested, but avoid creating overly deep page hierarchies and consider using top navigation with grouped links instead.\r\n\r\n\r\n\r\n## Colour\r\n\r\nThe side navigation uses the app's [theme colour](/styles/colour/#theme) as the background and automatically sets the foreground colour to ensure accessible contrast ratios. Change the app's theme colour to change the background colour of the side navigation and help distinguish your app from others your users may use.\r\n\r\n\r\n\r\n## Layout and placement\r\n\r\nAlways position the side navigation on the left hand of the screen and make sure that it vertically fills the browser window.\r\n\r\n\r\n\r\n## Content\r\n\r\n### App information\r\n\r\nUse your app's name, icon, status and version information in the side navigation's app info fields.\r\n\r\n### Labels and icons\r\n\r\nFollow the [content style guidelines](/styles/content-style) for all menu option labels as well as each option group labels.\r\n\r\nFollow the [icon style guidelines](/styles/icons) when selecting icons for menu options.\r\n\r\nKeep labels concise as they will truncate if they are too long to display in the side navigation.\r\n\r\n\r\n\r\n### Menu items\r\n\r\nSet the side navigation menu items to reflect your app's main navigation links.\r\n\r\nBy default, menu items will only display their icon when the side navigation is collapsed. The item label will be displayed via a tooltip when hovering or focusing on the menu item.\r\n\r\n\r\n\r\nSet the menu items to display their labels in the collapsed state by default if this will aid the recognition of the feature. However, take care when doing this as long menu item labels will be truncated.\r\n\r\n\r\n\r\nGroup related menu items into expandable menu item groups.\r\n\r\nUse a drill-down menu item if the menu item has a large number of child links to display. This will display the child links in the side navigation's sub-menu.\r\n\r\n\r\n\r\n\r\n\r\n### Bottom menu items\r\n\r\nUse the sticky bottom menu section to provide quick links to global app features or external links.\r\n\r\n## Accessibility considerations\r\n\r\nMake sure to include alt-text when specifying icons for menu items.\r\n\r\n## Related Components\r\n\r\n- [Top navigation](/components/top-navigation)\r\n",
"path": "/components/side-navigation",
"navPriority": 29,
"date": "2023-03-01",
@@ -3445,11 +3445,11 @@
],
"tags": ["Navigation bar"],
"meta": {
- "relativePath": "components/side-nav/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.120Z",
- "size": 12206,
- "formattedSize": "11.9 KB"
+ "relativePath": "components\\side-nav\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.115Z",
+ "lastModified": "2024-12-04T13:23:54.115Z",
+ "size": 12458,
+ "formattedSize": "12.2 KB"
}
},
{
@@ -3476,16 +3476,16 @@
}
],
"meta": {
- "relativePath": "components/skeleton/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.128Z",
+ "relativePath": "components\\skeleton\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.435Z",
+ "lastModified": "2024-11-05T11:57:53.435Z",
"size": 2797,
"formattedSize": "2.7 KB"
}
},
{
"id": "components\\skeleton\\codex",
- "contents": "\nimport {\n IcSkeleton,\n IcTypography,\n IcCard,\n IcButton,\n SlottedSVG,\n} from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n \n\n`,\n long: `.parent-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-xs);\n }\n\n\n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n \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-xs)\",\n },\n});\nconst classes = useStyles();\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 gap: \"var(--ic-space-xs)\",\n },\n});\nconst classes = useStyles();\nreturn ( \n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n
\n\n\n## Skeleton details\n\n\n\n## Variants\n\n### Inherited size from child\n\nexport const snippetsInherited = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Test text
`,\n long: `.child {\n height: 12.5rem;\n width: 28.125rem;\n }\n\n\n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Test text
\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n child: {\n height: \"12.5rem\",\n width: \"28.125rem\"\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n child: {\n height: \"12.5rem\",\n width: \"28.125rem\"\n },\n});\nconst classes = useStyles();\nreturn (\n {shortCode}\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Test text\n
\n \n\n\n### Set width and height\n\nCSS changes directly to `Skeleton` must be applied with inline styling.\n\nexport const snippetsSetWidthAndHeight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n Height and width set with styles
\n\n\n\n Height set with styles
\n\n\n\n Width set with styles
\n\n`,\n long: `.parent-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-xs);\n }\n\n\n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Height and width set with styles
\n\n\n\n Height set with styles
\n\n\n\n Width set with styles
\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 Height and width set with styles
\n \n \n \n Height set with styles
\n \n \n \n Width set with styles
\n \n \n
\n\n\n### Light\n\nexport const snippetsLight = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n \n\n`,\n long: `.parent-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-xs);\n }\n\n\n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n \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-xs)\",\n },\n});\nconst classes = useStyles();\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 gap: \"var(--ic-space-xs)\",\n },\n});\nconst classes = useStyles();\nreturn ( \n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n
\n\n\n### Within IcCard component\n\nexport const snippetsInCard = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\nexport const loading = () => (\n \n \n \n \n \n \n \n \n);\n\nexport const loaded = () => (\n \n \n \n \n \n Accept\n Cancel\n
\n \n);\n\nexport const ContentFunction = () => {\n const [content, setContent] = React.useState(loaded);\n const loadFunc = () => {\n setContent(loading);\n setTimeout(() => {\n setContent(loaded);\n }, 3000);\n };\n return (\n \n {content}\n
\n
{\n loadFunc();\n }}\n >\n \n \n \n \n Refresh\n \n
\n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport {\r\n IcSkeleton,\r\n IcTypography,\r\n IcCard,\r\n IcButton,\r\n SlottedSVG,\r\n} 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 \r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--ic-space-xs);\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 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-xs)\",\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 parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: \"var(--ic-space-xs)\",\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 \r\n \r\n
\r\n\r\n\r\n## Skeleton details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Inherited size from child\r\n\r\nexport const snippetsInherited = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Test text
`,\r\n long: `.child {\r\n height: 12.5rem;\r\n width: 28.125rem;\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 Test text
\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n child: {\r\n height: \"12.5rem\",\r\n width: \"28.125rem\"\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 child: {\r\n height: \"12.5rem\",\r\n width: \"28.125rem\"\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 Test text\r\n
\r\n \r\n\r\n\r\n### Set width and height\r\n\r\nCSS changes directly to `Skeleton` must be applied with inline styling.\r\n\r\nexport const snippetsSetWidthAndHeight = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n Height and width set with styles
\r\n\r\n\r\n\r\n Height set with styles
\r\n\r\n\r\n\r\n Width set with styles
\r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--ic-space-xs);\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 Height and width set with styles
\r\n\r\n\r\n\r\n Height set with styles
\r\n\r\n\r\n\r\n Width set with styles
\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 Height and width set with styles
\r\n \r\n \r\n \r\n Height set with styles
\r\n \r\n \r\n \r\n Width set with styles
\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 \r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--ic-space-xs);\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 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-xs)\",\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 parentContainer: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n gap: \"var(--ic-space-xs)\",\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 \r\n \r\n
\r\n\r\n\r\n### Within IcCard component\r\n\r\nexport const snippetsInCard = [\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 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 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\nexport const loading = () => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const loaded = () => (\r\n \r\n \r\n \r\n \r\n \r\n Accept\r\n Cancel\r\n
\r\n \r\n);\r\n\r\nexport const ContentFunction = () => {\r\n const [content, setContent] = React.useState(loaded);\r\n const loadFunc = () => {\r\n setContent(loading);\r\n setTimeout(() => {\r\n setContent(loaded);\r\n }, 3000);\r\n };\r\n return (\r\n \r\n {content}\r\n
\r\n
{\r\n loadFunc();\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n Refresh\r\n \r\n
\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n",
"path": "/components/skeleton/code",
"date": "2024-05-31",
"title": "Skeleton",
@@ -3507,11 +3507,11 @@
}
],
"meta": {
- "relativePath": "components/skeleton/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.128Z",
- "size": 12649,
- "formattedSize": "12.4 KB"
+ "relativePath": "components\\skeleton\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.116Z",
+ "lastModified": "2024-12-04T13:23:54.116Z",
+ "size": 13239,
+ "formattedSize": "12.9 KB"
}
},
{
@@ -3539,9 +3539,9 @@
}
],
"meta": {
- "relativePath": "components/skeleton/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.128Z",
+ "relativePath": "components\\skeleton\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:53.507Z",
+ "lastModified": "2024-11-05T11:57:53.507Z",
"size": 4677,
"formattedSize": "4.6 KB"
}
@@ -3570,16 +3570,16 @@
}
],
"meta": {
- "relativePath": "components/status-tags/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
+ "relativePath": "components\\status-tags\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.525Z",
+ "lastModified": "2024-11-05T11:57:53.525Z",
"size": 1948,
"formattedSize": "1.9 KB"
}
},
{
"id": "components\\status-tags\\codex",
- "contents": "\nimport { IcStatusTag } from \"@ukic/react\";\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `.parent-container {\n display: flex;\n gap: var(--ic-space-xs);\n flex-wrap: wrap;\n padding: var(--ic-space-md);\n }\n \n \n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\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 \n\n\n## Status tag details\n\n\n\n## Variants\n\n### Emphasis\n\nexport const snippetsEmphasis = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n long: `.parent-container {\n display: flex;\n gap: var(--ic-space-xs);\n flex-wrap: wrap;\n padding: var(--ic-space-md);\n }\n \n \n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n\n\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\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 \n\n\n### Sizes\n\nexport const snippetsSizes = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n`,\n long: `.parent-container {\n display: flex;\n gap: var(--ic-space-xs);\n flex-wrap: wrap;\n padding: var(--ic-space-md);\n }\n \n \n \n {shortCode}\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 flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\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\n",
+ "contents": "\r\nimport { IcStatusTag } from \"@ukic/react\";\r\n\r\nexport const snippetsDefault = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n gap: var(--ic-space-xs);\r\n flex-wrap: wrap;\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\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 flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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 language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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 \r\n\r\n\r\n## Status tag details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Emphasis\r\n\r\nexport const snippetsEmphasis = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n\r\n`,\r\n long: `.parent-container {\r\n display: flex;\r\n gap: var(--ic-space-xs);\r\n flex-wrap: wrap;\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\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 flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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 language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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 \r\n\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 long: `.parent-container {\r\n display: flex;\r\n gap: var(--ic-space-xs);\r\n flex-wrap: wrap;\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\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 flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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 language: \"Javascript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\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\r\n",
"path": "/components/status-tag/code",
"date": "2024-05-31",
"title": "Status tag",
@@ -3601,16 +3601,16 @@
}
],
"meta": {
- "relativePath": "components/status-tags/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
- "size": 6654,
- "formattedSize": "6.5 KB"
+ "relativePath": "components\\status-tags\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.116Z",
+ "lastModified": "2024-12-04T13:23:54.116Z",
+ "size": 6936,
+ "formattedSize": "6.8 KB"
}
},
{
"id": "components\\status-tags\\guidancex",
- "contents": "\nimport { IcStatusTag } from \"@ukic/react\";\nimport statusTagFig1 from \"./images/fig-1-do-use-status-tags-exclusively-to-denote-status.png\";\nimport statusTagFig2 from \"./images/fig-2-do-not-use-status-tags-for-anything-other-than-denoting-status.png\";\nimport statusTagFig3 from \"./images/fig-3-do-not-use-a-mix-of-primary-and-secondary-status-tags-to-show-the same-statuses-message-within-a-group-of-items.png\";\nimport statusTagFig4 from \"./images/fig-4-do-use-the-correct-status-tag-size-to-match-other-ui-component-sizes.png\";\nimport statusTagFig5 from \"./images/fig-5-do-not-mix-sizes-when-using-multiple-ui-components.png\";\nimport statusTagFig6 from \"./images/fig-6-do-use-adjectives-to-describe-status.png\";\nimport statusTagFig7 from \"./images/fig-7-do-not-use-verbs-in-status-tags.png\";\nimport statusTagFig8 from \"./images/fig-8-do-use-relevant-wording-that-supports-the-status-tag-colour.png\";\nimport statusTagFig9 from \"./images/fig-9-do-not-use-wording-which-directly-contrasts-and-or does-not-support-the-status-of-the-tag.png\";\nimport statusTagFig10 from \"./images/fig-10-avoid-using-long-labels-as-it-will-force-the-text-to-wrap.png\";\n\n## Introduction\n\nThe status tag has four types:\n\n- Neutral\n- Success\n- Warning\n- Danger\n\nEach status tag has a filled and outlined appearance option and is available in three sizes.\n\n\n \n \n \n \n\n\n## When to use\n\nDisplay a status tag to show the status of an item in an application. For example, status tags could be used to show if a system is online or offline, if a document has been actioned or approved, or if a displayed train network is currently active or not.\n\n### Filled\n\nFilled status tags use the status colours to denote the type of status tag.\n\nUse filled status tags to convey emphasis and importance.\n\n### Outlined\n\nOutlined status tags use a lighter colour variation of the relevant status colour.\n\nUse outlined status tags to provide emphasis to less important items.\n\n\n \n\n\n## When not to use\n\nDon't use status tags to display anything other than status, use [static chips](/components/chip/#static-chips).\n\n\n \n\n\nDon't use a mix of filled and outlined status tags when using them together.\n\n\n \n\n\n## Layout and placement\n\nWhen components are used together the size of the components should match. For example, a default sized status tag should be used with a default sized input component.\n\n\n \n \n\n\n## Content\n\n### Labels\n\nUse adjectives in the status tag label over verbs. Verbs may indicate to a user that by clicking on them the tag will be interactive.\n\nText in tags should be all capitals to increase readability.\n\n\n \n \n\n\nUse the right status tag type that is relevant to the label. Don't use labels that convey different information to what the status colour conveys.\n\n\n \n \n\n\nUse concise labels for better readability. Longer labels will force the text to wrap.\n\n\n \n\n\n## Related components\n\n- [Chips](/components/chip)\n",
+ "contents": "\r\nimport { IcStatusTag } from \"@ukic/react\";\r\nimport statusTagFig1 from \"./images/fig-1-do-use-status-tags-exclusively-to-denote-status.png\";\r\nimport statusTagFig2 from \"./images/fig-2-do-not-use-status-tags-for-anything-other-than-denoting-status.png\";\r\nimport statusTagFig3 from \"./images/fig-3-do-not-use-a-mix-of-primary-and-secondary-status-tags-to-show-the same-statuses-message-within-a-group-of-items.png\";\r\nimport statusTagFig4 from \"./images/fig-4-do-use-the-correct-status-tag-size-to-match-other-ui-component-sizes.png\";\r\nimport statusTagFig5 from \"./images/fig-5-do-not-mix-sizes-when-using-multiple-ui-components.png\";\r\nimport statusTagFig6 from \"./images/fig-6-do-use-adjectives-to-describe-status.png\";\r\nimport statusTagFig7 from \"./images/fig-7-do-not-use-verbs-in-status-tags.png\";\r\nimport statusTagFig8 from \"./images/fig-8-do-use-relevant-wording-that-supports-the-status-tag-colour.png\";\r\nimport statusTagFig9 from \"./images/fig-9-do-not-use-wording-which-directly-contrasts-and-or does-not-support-the-status-of-the-tag.png\";\r\nimport statusTagFig10 from \"./images/fig-10-avoid-using-long-labels-as-it-will-force-the-text-to-wrap.png\";\r\n\r\n## Introduction\r\n\r\nThe status tag has four types:\r\n\r\n- Neutral\r\n- Success\r\n- Warning\r\n- Danger\r\n\r\nEach status tag has a filled and outlined appearance option and is available in three sizes.\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n## When to use\r\n\r\nDisplay a status tag to show the status of an item in an application. For example, status tags could be used to show if a system is online or offline, if a document has been actioned or approved, or if a displayed train network is currently active or not.\r\n\r\n### Filled\r\n\r\nFilled status tags use the status colours to denote the type of status tag.\r\n\r\nUse filled status tags to convey emphasis and importance.\r\n\r\n### Outlined\r\n\r\nOutlined status tags use a lighter colour variation of the relevant status colour.\r\n\r\nUse outlined status tags to provide emphasis to less important items.\r\n\r\n\r\n \r\n\r\n\r\n## When not to use\r\n\r\nDon't use status tags to display anything other than status, use [static chips](/components/chip/#static-chips).\r\n\r\n\r\n \r\n\r\n\r\nDon't use a mix of filled and outlined status tags when using them together.\r\n\r\n\r\n \r\n\r\n\r\n## Layout and placement\r\n\r\nWhen components are used together the size of the components should match. For example, a default sized status tag should be used with a default sized input component.\r\n\r\n\r\n \r\n \r\n\r\n\r\n## Content\r\n\r\n### Labels\r\n\r\nUse adjectives in the status tag label over verbs. Verbs may indicate to a user that by clicking on them the tag will be interactive.\r\n\r\nText in tags should be all capitals to increase readability.\r\n\r\n\r\n \r\n \r\n\r\n\r\nUse the right status tag type that is relevant to the label. Don't use labels that convey different information to what the status colour conveys.\r\n\r\n\r\n \r\n \r\n\r\n\r\nUse concise labels for better readability. Longer labels will force the text to wrap.\r\n\r\n\r\n \r\n\r\n\r\n## Related components\r\n\r\n- [Chips](/components/chip)\r\n",
"path": "/components/status-tag",
"navPriority": 32,
"date": "2023-04-17",
@@ -3634,11 +3634,11 @@
],
"tags": ["Tags"],
"meta": {
- "relativePath": "components/status-tags/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
- "size": 6882,
- "formattedSize": "6.7 KB"
+ "relativePath": "components\\status-tags\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.117Z",
+ "lastModified": "2024-12-04T13:23:54.117Z",
+ "size": 7059,
+ "formattedSize": "6.9 KB"
}
},
{
@@ -3665,16 +3665,16 @@
}
],
"meta": {
- "relativePath": "components/stepper/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
+ "relativePath": "components\\stepper\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.595Z",
+ "lastModified": "2024-11-05T11:57:53.595Z",
"size": 1730,
"formattedSize": "1.7 KB"
}
},
{
"id": "components\\stepper\\codex",
- "contents": "\nimport { IcStepper, IcStep } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n## Step details\n\n\n\n## Stepper details\n\n\n\n## Variants\n\n### Compact stepper\n\nexport const compactStepper = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### Left-aligned\n\nexport const leftAligned = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### With hidden step information\n\nexport const hiddenStepInfo = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n\n### With subtitles\n\nexport const withSubtitles = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n \n\n\n### Custom connector width\n\nexport const customConnectorWidth = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n \n \n\n",
+ "contents": "\r\nimport { IcStepper, IcStep } 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 \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 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## Step details\r\n\r\n\r\n\r\n## Stepper details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Compact stepper\r\n\r\nexport const compactStepper = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### Left-aligned\r\n\r\nexport const leftAligned = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### With hidden step information\r\n\r\nexport const hiddenStepInfo = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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### With subtitles\r\n\r\nexport const withSubtitles = [\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 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 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### Custom connector width\r\n\r\nexport const customConnectorWidth = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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",
"path": "/components/stepper/code",
"date": "2024-05-31",
"title": "Stepper",
@@ -3696,16 +3696,16 @@
}
],
"meta": {
- "relativePath": "components/stepper/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
- "size": 8348,
- "formattedSize": "8.2 KB"
+ "relativePath": "components\\stepper\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.118Z",
+ "lastModified": "2024-12-04T13:23:54.118Z",
+ "size": 8673,
+ "formattedSize": "8.5 KB"
}
},
{
"id": "components\\stepper\\guidancex",
- "contents": "\nimport { IcStepper, IcStep } from \"@ukic/react\";\nimport stepperFig1 from \"./images/fig-1-stepper-component-being-used-to-describe-the-steps-of-a-multistep-form.png\";\nimport stepperFig2 from \"./images/fig-2-use-concise-labels-within-a-stepper.png\";\nimport stepperFig3 from \"./images/fig-3-dont-use-long-labels-within-a-stepper.png\";\nimport stepperFig4 from \"./images/fig-4-a-stepper-accompanied-by-a-page-title-showing-how-the-stepper-should-be-implemented.png\";\nimport stepperFig5 from \"./images/fig-5-dont-use-a-compact-stepper-if-the-page-content-does-not-include-the-step-name-in-a-heading.png\";\nimport stepperFig6 from \"./images/fig-6-a-stepper-that-is-leftaligned-at-the-top-of-the-page-showing-how-the-stepper-should-be-implemented.png\";\nimport stepperFig7 from \"./images/fig-7-a-stepper-that-is-centrealigned-at-the-top-of-the-page-showing-how-the-stepper-should-not-be-implemented.png\";\nimport stepperFig8 from \"./images/fig-8-use-compact-stepper-when-there-is-not-much-room.png\";\n\n## Introduction\n\nAn example of the stepper component.\n\n\n \n \n \n \n \n\n\n## Component variants\n\n### Default\n\nUse the default stepper when you have the available space.\n\n### Compact\n\nUse the compact variant for compact layouts or processes with many steps.\n\n## When to use\n\nUse steppers when a multi-step linear process is required. Steps are displayed from left to right and show the direction of movement through the process.\n\n\n\nAlways indicate which step the user is currently on. This gives a sense of control and describes their position in the process in relation to where they have been, as well as how much they have left to do.\n\n## When not to use\n\nDon't use the stepper to indicate a non-linear process where steps can be completed in any order. Linear processes require each step to be completed in order.\n\n## Interaction behaviour\n\n### Steps\n\nSteps are single elements that together form the stepper. Steps have four different states:\n\n- Active: Indicates that the step is available but not yet completed by the user. This step type is rendered as current if displayed in the compact stepper.\n\n- Current: Shows the step the user is currently on.\n\n- Completed: Shows a previous step that has been completed by the user.\n\n- Disabled: Shows a step that is unavailable. This could be because it's conditional on another step. If a step is always unavailable, then it should not be included in the stepper when it's loaded.\n\n\n \n \n \n \n \n \n\n\n## Layout and placement\n\nAlways align steppers to the left and place them above the main body content of the page.\n\n\n\n\n\nWhen a stepper is too large to fit comfortably within its container, it will switch to use the compact stepper. This shows the current step along with its status, as well as the next step in the process.\n\n\n \n\n\n## Content\n\n### Labels\n\nUse the step title to describe each step concisely in one or two words. Avoid using lengthy step titles.\n\n\n\n\n\nWhen a stepper is used, always use page titles and section headings on the page content itself.\n\n\n\nHide step information only if the step content is clearly labelled itself. Do not omit step labels if no headings are provided in the step content.\n\n\n\nSet a step status to show whether the step is required or optional in the step's subtitle. Override the step subtitle text to provide a custom message.\n\n### Validation\n\nValidate each step as the user moves through the process. Use the standard error handling approach to display inline [alert](/components/alert) and error messages if the user attempts to proceed to the next step without first completing the current step correctly.\n",
+ "contents": "\r\nimport { IcStepper, IcStep } from \"@ukic/react\";\r\nimport stepperFig1 from \"./images/fig-1-stepper-component-being-used-to-describe-the-steps-of-a-multistep-form.png\";\r\nimport stepperFig2 from \"./images/fig-2-use-concise-labels-within-a-stepper.png\";\r\nimport stepperFig3 from \"./images/fig-3-dont-use-long-labels-within-a-stepper.png\";\r\nimport stepperFig4 from \"./images/fig-4-a-stepper-accompanied-by-a-page-title-showing-how-the-stepper-should-be-implemented.png\";\r\nimport stepperFig5 from \"./images/fig-5-dont-use-a-compact-stepper-if-the-page-content-does-not-include-the-step-name-in-a-heading.png\";\r\nimport stepperFig6 from \"./images/fig-6-a-stepper-that-is-leftaligned-at-the-top-of-the-page-showing-how-the-stepper-should-be-implemented.png\";\r\nimport stepperFig7 from \"./images/fig-7-a-stepper-that-is-centrealigned-at-the-top-of-the-page-showing-how-the-stepper-should-not-be-implemented.png\";\r\nimport stepperFig8 from \"./images/fig-8-use-compact-stepper-when-there-is-not-much-room.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the stepper component.\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Component variants\r\n\r\n### Default\r\n\r\nUse the default stepper when you have the available space.\r\n\r\n### Compact\r\n\r\nUse the compact variant for compact layouts or processes with many steps.\r\n\r\n## When to use\r\n\r\nUse steppers when a multi-step linear process is required. Steps are displayed from left to right and show the direction of movement through the process.\r\n\r\n\r\n\r\nAlways indicate which step the user is currently on. This gives a sense of control and describes their position in the process in relation to where they have been, as well as how much they have left to do.\r\n\r\n## When not to use\r\n\r\nDon't use the stepper to indicate a non-linear process where steps can be completed in any order. Linear processes require each step to be completed in order.\r\n\r\n## Interaction behaviour\r\n\r\n### Steps\r\n\r\nSteps are single elements that together form the stepper. Steps have four different states:\r\n\r\n- Active: Indicates that the step is available but not yet completed by the user. This step type is rendered as current if displayed in the compact stepper.\r\n\r\n- Current: Shows the step the user is currently on.\r\n\r\n- Completed: Shows a previous step that has been completed by the user.\r\n\r\n- Disabled: Shows a step that is unavailable. This could be because it's conditional on another step. If a step is always unavailable, then it should not be included in the stepper when it's loaded.\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n## Layout and placement\r\n\r\nAlways align steppers to the left and place them above the main body content of the page.\r\n\r\n\r\n\r\n\r\n\r\nWhen a stepper is too large to fit comfortably within its container, it will switch to use the compact stepper. This shows the current step along with its status, as well as the next step in the process.\r\n\r\n\r\n \r\n\r\n\r\n## Content\r\n\r\n### Labels\r\n\r\nUse the step title to describe each step concisely in one or two words. Avoid using lengthy step titles.\r\n\r\n\r\n\r\n\r\n\r\nWhen a stepper is used, always use page titles and section headings on the page content itself.\r\n\r\n\r\n\r\nHide step information only if the step content is clearly labelled itself. Do not omit step labels if no headings are provided in the step content.\r\n\r\n\r\n\r\nSet a step status to show whether the step is required or optional in the step's subtitle. Override the step subtitle text to provide a custom message.\r\n\r\n### Validation\r\n\r\nValidate each step as the user moves through the process. Use the standard error handling approach to display inline [alert](/components/alert) and error messages if the user attempts to proceed to the next step without first completing the current step correctly.\r\n",
"path": "/components/stepper",
"navPriority": 33,
"date": "2023-02-03",
@@ -3729,11 +3729,11 @@
],
"tags": ["Progress indicator", "Steps", "Progress tracker"],
"meta": {
- "relativePath": "components/stepper/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.132Z",
- "size": 7538,
- "formattedSize": "7.4 KB"
+ "relativePath": "components\\stepper\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.118Z",
+ "lastModified": "2024-12-04T13:23:54.118Z",
+ "size": 7707,
+ "formattedSize": "7.5 KB"
}
},
{
@@ -3760,16 +3760,16 @@
}
],
"meta": {
- "relativePath": "components/switch/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.136Z",
+ "relativePath": "components\\switch\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.691Z",
+ "lastModified": "2024-11-05T11:57:53.691Z",
"size": 3160,
"formattedSize": "3.1 KB"
}
},
{
"id": "components\\switch\\codex",
- "contents": "\nimport { IcSwitch } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ` console.log({ \n checked: ev.detail.checked, \n value: ev.detail.value\n })}\n/>`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n console.log({\n checked: ev.detail.checked,\n value: ev.detail.value,\n })\n }\n />\n\n\n## Switch details\n\n\n\n## Variants\n\n### State\n\nexport const snippetsState = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Small\n\nexport const snippetsSmall = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: ``,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n `,\n long: [\n {\n language: \"Typescript\",\n snippet: `<>\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### Helper text and right adornment\n\nexport const snippetsHelperAndAdornment = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n\n",
+ "contents": "\r\nimport { IcSwitch } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippetsDefault = [\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: ` console.log({ \r\n checked: ev.detail.checked, \r\n value: ev.detail.value\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 console.log({\r\n checked: ev.detail.checked,\r\n value: ev.detail.value,\r\n })\r\n }\r\n />\r\n\r\n\r\n## Switch details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### State\r\n\r\nexport const snippetsState = [\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### 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### Disabled\r\n\r\nexport const snippetsDisabled = [\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### Helper text and right adornment\r\n\r\nexport const snippetsHelperAndAdornment = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\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 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",
"path": "/components/switch/code",
"date": "2024-05-31",
"title": "Switch",
@@ -3791,16 +3791,16 @@
}
],
"meta": {
- "relativePath": "components/switch/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.136Z",
- "size": 5870,
- "formattedSize": "5.7 KB"
+ "relativePath": "components\\switch\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.119Z",
+ "lastModified": "2024-12-04T13:23:54.119Z",
+ "size": 6139,
+ "formattedSize": "6.0 KB"
}
},
{
"id": "components\\switch\\guidancex",
- "contents": "\nimport { IcSwitch, IcTypography } from \"@ukic/react\";\nimport switchVid1 from \"./images/anim-1-avoid-change-a-switch-state-from-a-different-trigger.mp4\";\nimport switchVid2 from \"./images/anim-2-dont-change-switch-label-at-same-time-as-switch-state.mp4\";\nimport switchFig1 from \"./images/fig-1-make-sure-switch-changes-take-effect-immediately.png\";\nimport switchFig2 from \"./images/fig-2-dont-use-a-separate-trigger-to-make-switch-changes-take-effect.png\";\nimport switchFig3 from \"./images/fig-3-dont-use-a-switch-for-yes-no-answers.png\";\nimport switchFig4 from \"./images/fig-4-give-switches-clear-labels.png\";\nimport switchFig5 from \"./images/fig-5-dont-give-switches-ambiguous-labels.png\";\nimport switchFig6 from \"./images/fig-6-dont-mix-switches-with-icons-with-switches-without-icons.png\";\n\n## Introduction\n\nAn example of the switch component.\n\n\n \n\n\n## When to use\n\nUse switches to turn a single option 'on' or 'off' and when you want the selection to take immediate effect.\n\nUse switches when there is an obvious default value: either 'on' or 'off'.\n\n## When not to use\n\nDon't use a switch when the selection of the option should take effect after a separate trigger such as a submit button. Instead, use a single [checkbox](/components/checkbox).\n\n\n \n \n\n\nSwitches always have a default state: either 'on' or 'off'. Don't use a switch if there is no default setting. Instead, use checkboxes or two [radio buttons](/components/radio).\n\nDon't use a switch as an input in a form. Use them to instantaneously control a single option.\n\nDon't use a switch for 'yes' or 'no' answers. Use two [radio buttons](/components/radio) instead.\n\n\n \n\n\n## Interaction behaviour\n\nAvoid automatically altering a switch's state based on another trigger. A change in a switch's state should always be the user's decision.\n\n\n\n\n Avoid changing a switch's state without the user’s specific instruction.\n\n\n## Sizing\n\nUse a default sized switch in most scenarios where other default sized components are used.\n\nUse a small sized switch with other small sized components for compact layouts.\n\n## Content\n\nUse clear labels so that it's obvious what the switch will do when in the 'on' or 'off' position. Don't make them neutral or ambiguous. The switch should read 'Label: on' or 'Label: off'.\n\nFor example, a switch to turn notifications 'on' or 'off', with a label that says 'Notifications', is understandable when read as 'Notifications: on' and 'Notifications: off'. If the label said 'Turn notifications off', it's ambiguous and more difficult to understand what the 'on' and 'off' position will do.\n\n\n \n \n\n\nAvoid using additional labels that say 'on' or 'off' in the switch label. The position of the switch describes this itself. Changing the label between state changes makes it difficult to understand the current state.\n\n\n\n\n Don’t change the switch’s label at the same time as the state changes.\n\n\nUse an icon with a switch label only if it aids the recognition of the option.\n\nDon't group switches with icons with other switches without icons.\n\n\n \n\n",
+ "contents": "\r\nimport { IcSwitch, IcTypography } from \"@ukic/react\";\r\nimport switchVid1 from \"./images/anim-1-avoid-change-a-switch-state-from-a-different-trigger.mp4\";\r\nimport switchVid2 from \"./images/anim-2-dont-change-switch-label-at-same-time-as-switch-state.mp4\";\r\nimport switchFig1 from \"./images/fig-1-make-sure-switch-changes-take-effect-immediately.png\";\r\nimport switchFig2 from \"./images/fig-2-dont-use-a-separate-trigger-to-make-switch-changes-take-effect.png\";\r\nimport switchFig3 from \"./images/fig-3-dont-use-a-switch-for-yes-no-answers.png\";\r\nimport switchFig4 from \"./images/fig-4-give-switches-clear-labels.png\";\r\nimport switchFig5 from \"./images/fig-5-dont-give-switches-ambiguous-labels.png\";\r\nimport switchFig6 from \"./images/fig-6-dont-mix-switches-with-icons-with-switches-without-icons.png\";\r\n\r\n## Introduction\r\n\r\nAn example of the switch component.\r\n\r\n\r\n \r\n\r\n\r\n## When to use\r\n\r\nUse switches to turn a single option 'on' or 'off' and when you want the selection to take immediate effect.\r\n\r\nUse switches when there is an obvious default value: either 'on' or 'off'.\r\n\r\n## When not to use\r\n\r\nDon't use a switch when the selection of the option should take effect after a separate trigger such as a submit button. Instead, use a single [checkbox](/components/checkbox).\r\n\r\n\r\n \r\n \r\n\r\n\r\nSwitches always have a default state: either 'on' or 'off'. Don't use a switch if there is no default setting. Instead, use checkboxes or two [radio buttons](/components/radio).\r\n\r\nDon't use a switch as an input in a form. Use them to instantaneously control a single option.\r\n\r\nDon't use a switch for 'yes' or 'no' answers. Use two [radio buttons](/components/radio) instead.\r\n\r\n\r\n \r\n\r\n\r\n## Interaction behaviour\r\n\r\nAvoid automatically altering a switch's state based on another trigger. A change in a switch's state should always be the user's decision.\r\n\r\n\r\n\r\n\r\n Avoid changing a switch's state without the user’s specific instruction.\r\n\r\n\r\n## Sizing\r\n\r\nUse a default sized switch in most scenarios where other default sized components are used.\r\n\r\nUse a small sized switch with other small sized components for compact layouts.\r\n\r\n## Content\r\n\r\nUse clear labels so that it's obvious what the switch will do when in the 'on' or 'off' position. Don't make them neutral or ambiguous. The switch should read 'Label: on' or 'Label: off'.\r\n\r\nFor example, a switch to turn notifications 'on' or 'off', with a label that says 'Notifications', is understandable when read as 'Notifications: on' and 'Notifications: off'. If the label said 'Turn notifications off', it's ambiguous and more difficult to understand what the 'on' and 'off' position will do.\r\n\r\n\r\n \r\n \r\n\r\n\r\nAvoid using additional labels that say 'on' or 'off' in the switch label. The position of the switch describes this itself. Changing the label between state changes makes it difficult to understand the current state.\r\n\r\n\r\n\r\n\r\n Don’t change the switch’s label at the same time as the state changes.\r\n\r\n\r\nUse an icon with a switch label only if it aids the recognition of the option.\r\n\r\nDon't group switches with icons with other switches without icons.\r\n\r\n\r\n \r\n\r\n",
"path": "/components/switch",
"navPriority": 34,
"date": "2023-02-03",
@@ -3824,11 +3824,11 @@
],
"tags": ["Toggle", "Lightswitch"],
"meta": {
- "relativePath": "components/switch/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.136Z",
- "size": 6251,
- "formattedSize": "6.1 KB"
+ "relativePath": "components\\switch\\guidance.mdx",
+ "createdAt": "2024-12-04T13:23:54.120Z",
+ "lastModified": "2024-12-04T13:23:54.120Z",
+ "size": 6401,
+ "formattedSize": "6.3 KB"
}
},
{
@@ -3855,16 +3855,16 @@
}
],
"meta": {
- "relativePath": "components/tabs/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.144Z",
+ "relativePath": "components\\tabs\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.771Z",
+ "lastModified": "2024-11-05T11:57:53.771Z",
"size": 3352,
"formattedSize": "3.3 KB"
}
},
{
"id": "components\\tabs\\codex",
- "contents": "\nimport { IcTab, IcTabContext, IcTabGroup, IcTabPanel } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippets = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n console.log({\n tabIndex: ev.detail.tabIndex,\n tabLabel: ev.detail.tabLabel,\n })\n }\n>\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n console.log({\n tabIndex: ev.detail.tabIndex,\n tabLabel: ev.detail.tabLabel,\n })\n }\n >\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n## Tab details\n\n\n\n## Tab context details\n\n\n\n## Tab list details\n\n\n\n## Tab panel details\n\n\n\n## Variants\n\n### With icons\n\nexport const withIcons = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n \n Ingredients\n \n \n \n Method\n \n \n \n History\n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n \n Ingredients\n \n \n \n \n \n Method\n \n \n \n \n \n History\n \n \n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n \n Ingredients\n \n \n \n Method\n \n \n \n History\n \n \n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Disabled\n\nexport const disabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Light\n\nexport const light = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: `.dark-background {\n background-color: #2c2f34;\n }\n \n \n \n {shortCode}\n
`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: ` const useStyles = createUseStyles({\n darkBackground: {\n backgroundColor: \"#2c2f34\",\n },\n });\n const classes = useStyles();\n return (\n \n {shortCode}\n
\n )`,\n },\n {\n language: \"Javascript\",\n snippet: ` const useStyles = createUseStyles({\n darkBackground: {\n backgroundColor: \"#2c2f34\",\n },\n });\n const classes = useStyles();\n return (\n \n {shortCode}\n
\n )`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n \n\n\n### Compact\n\nexport const compact = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n`,\n long: `.tabs ic-tab-group,\n .tabs ic-tab-panel {\n width: 60%;\n margin-left: auto;\n margin-right: auto;\n }\n \n \n {shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n width: \"60%\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const useStyles = createUseStyles({\n parentContainer: {\n width: \"60%\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n },\n});\nconst classes = useStyles();\nreturn (\n \n {shortCode}\n
\n)`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n Drinks\n Recipes\n \n Tab One - Ingredients\n Tab Two - Method\n Tab Three - History\n Tab Four - Drinks\n Tab Five - Recipes\n \n\n\n### Nested Tabs\n\nexport const nested = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n long: `{shortCode}`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `{shortCode}`,\n },\n {\n language: \"Javascript\",\n snippet: `{shortCode}`,\n },\n ],\n },\n },\n];\n\n\n \n \n Ingredients\n Method\n History\n \n \n \n \n Espresso\n Water\n Milk\n \n Nested Tab Panel One - Espresso\n Nested Tab Panel Two - Water\n Nested Tab Panel Three - Milk\n \n \n Outer Tab Panel Two - Method\n Outer Tab Panel Three - History\n \n\n",
+ "contents": "\r\nimport { IcTab, IcTabContext, IcTabGroup, IcTabPanel } 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 Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 console.log({\r\n tabIndex: ev.detail.tabIndex,\r\n tabLabel: ev.detail.tabLabel,\r\n })\r\n }\r\n>\r\n \r\n Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 console.log({\r\n tabIndex: ev.detail.tabIndex,\r\n tabLabel: ev.detail.tabLabel,\r\n })\r\n }\r\n >\r\n \r\n Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n \r\n\r\n\r\n## Tab details\r\n\r\n\r\n\r\n## Tab context details\r\n\r\n\r\n\r\n## Tab list details\r\n\r\n\r\n\r\n## Tab panel details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With icons\r\n\r\nexport const withIcons = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n \r\n Ingredients\r\n \r\n \r\n \r\n Method\r\n \r\n \r\n \r\n History\r\n \r\n \r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 Ingredients\r\n \r\n \r\n \r\n \r\n \r\n Method\r\n \r\n \r\n \r\n \r\n \r\n History\r\n \r\n \r\n \r\n \r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 Ingredients\r\n \r\n \r\n \r\n Method\r\n \r\n \r\n \r\n History\r\n \r\n \r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 \r\n Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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 Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n \r\n\r\n\r\n### Light\r\n\r\nexport const light = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n`,\r\n long: `.dark-background {\r\n background-color: #2c2f34;\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 Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\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\n const classes = useStyles();\r\n return (\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 backgroundColor: \"#2c2f34\",\r\n },\r\n });\r\n const classes = useStyles();\r\n return (\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 Ingredients\r\n Method\r\n History\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n \r\n\r\n\r\n### Compact\r\n\r\nexport const compact = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Ingredients\r\n Method\r\n History\r\n Drinks\r\n Recipes\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n Tab Four - Drinks\r\n Tab Five - Recipes\r\n`,\r\n long: `.tabs ic-tab-group,\r\n .tabs ic-tab-panel {\r\n width: 60%;\r\n margin-left: auto;\r\n margin-right: auto;\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 Ingredients\r\n Method\r\n History\r\n Drinks\r\n Recipes\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n Tab Four - Drinks\r\n Tab Five - Recipes\r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const useStyles = createUseStyles({\r\n parentContainer: {\r\n width: \"60%\",\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\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 parentContainer: {\r\n width: \"60%\",\r\n marginLeft: \"auto\",\r\n marginRight: \"auto\",\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 Ingredients\r\n Method\r\n History\r\n Drinks\r\n Recipes\r\n \r\n Tab One - Ingredients\r\n Tab Two - Method\r\n Tab Three - History\r\n Tab Four - Drinks\r\n Tab Five - Recipes\r\n \r\n\r\n\r\n### Nested Tabs\r\n\r\nexport const nested = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n Ingredients\r\n Method\r\n History\r\n \r\n \r\n \r\n \r\n Espresso\r\n Water\r\n Milk\r\n \r\n Nested Tab Panel One - Espresso\r\n Nested Tab Panel Two - Water\r\n Nested Tab Panel Three - Milk\r\n \r\n \r\n Outer Tab Panel Two - Method\r\n Outer Tab Panel Three - History\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 Ingredients\r\n Method\r\n History\r\n \r\n \r\n \r\n \r\n Espresso\r\n Water\r\n Milk\r\n \r\n Nested Tab Panel One - Espresso\r\n Nested Tab Panel Two - Water\r\n Nested Tab Panel Three - Milk\r\n \r\n \r\n Outer Tab Panel Two - Method\r\n Outer Tab Panel Three - History\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 Ingredients\r\n Method\r\n History\r\n \r\n \r\n \r\n \r\n Espresso\r\n Water\r\n Milk\r\n \r\n Nested Tab Panel One - Espresso\r\n Nested Tab Panel Two - Water\r\n Nested Tab Panel Three - Milk\r\n \r\n \r\n Outer Tab Panel Two - Method\r\n Outer Tab Panel Three - History\r\n \r\n\r\n",
"path": "/components/tabs/code",
"date": "2024-05-31",
"title": "Tabs",
@@ -3886,11 +3886,11 @@
}
],
"meta": {
- "relativePath": "components/tabs/code.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.144Z",
- "size": 16816,
- "formattedSize": "16.4 KB"
+ "relativePath": "components\\tabs\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.121Z",
+ "lastModified": "2024-12-04T13:23:54.121Z",
+ "size": 17445,
+ "formattedSize": "17.0 KB"
}
},
{
@@ -3918,9 +3918,9 @@
}
],
"meta": {
- "relativePath": "components/tabs/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.144Z",
+ "relativePath": "components\\tabs\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:53.850Z",
+ "lastModified": "2024-11-05T11:57:53.850Z",
"size": 7075,
"formattedSize": "6.9 KB"
}
@@ -3949,16 +3949,16 @@
}
],
"meta": {
- "relativePath": "components/text-field/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.144Z",
+ "relativePath": "components\\text-field\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.869Z",
+ "lastModified": "2024-11-05T11:57:53.869Z",
"size": 2300,
"formattedSize": "2.2 KB"
}
},
{
"id": "components\\text-field\\codex",
- "contents": "\nimport { IcTextField } from \"@ukic/react\";\n\n## Component demo\n\nexport const snippetsDefault = [\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(ev.detail.value)}\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();\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 console.log(ev.detail.value)}\n />\n\n\n## Text field details\n\n\n\n## Variants\n\n### With icon, value and max length\n\nexport const snippetsIconValueMaxLength = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\n 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 \n \n \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();\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\n\n### Disabled\n\nexport const snippetsDisabled = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n \n`,\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 \n \n \n \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();\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\n\n### Size small\n\nexport const snippetsSmall = [\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(ev.detail.value)}\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();\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 console.log(ev.detail.value)}\n />\n\n\n### Validation\n\nexport const snippetsValidation = [\n {\n technology: \"Web component\",\n snippets: {\n short: `\n\n\n`,\n 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\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\n\n### With min and max values\n\nIn this example, an error message will display when the input is either below the min value or above the max value. This only affects numeric input fields.\n\nexport const snippetsMinMax = [\n {\n technology: \"Web component\",\n snippets: {\n short: ``,\n 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();\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### Text area with resize\n\nexport const snippetsTextArea = [\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();\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",
+ "contents": "\r\nimport { IcTextField } from \"@ukic/react\";\r\n\r\n## Component demo\r\n\r\nexport const snippetsDefault = [\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(ev.detail.value)}\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\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 console.log(ev.detail.value)}\r\n />\r\n\r\n\r\n## Text field details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### With icon, value and max length\r\n\r\nexport const snippetsIconValueMaxLength = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\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 \r\n \r\n \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\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\r\n\r\n### Disabled\r\n\r\nexport const snippetsDisabled = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n \r\n`,\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 \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 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 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\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: `.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(ev.detail.value)}\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\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 console.log(ev.detail.value)}\r\n />\r\n\r\n\r\n### Validation\r\n\r\nexport const snippetsValidation = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `\r\n\r\n\r\n`,\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\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\r\n\r\n### With min and max values\r\n\r\nIn this example, an error message will display when the input is either below the min value or above the max value. This only affects numeric input fields.\r\n\r\nexport const snippetsMinMax = [\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\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### Text area with resize\r\n\r\nexport const snippetsTextArea = [\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\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",
"path": "/components/text-field/code",
"date": "2024-05-31",
"title": "Text field",
@@ -3980,11 +3980,11 @@
}
],
"meta": {
- "relativePath": "components/text-field/code.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.148Z",
- "size": 16709,
- "formattedSize": "16.3 KB"
+ "relativePath": "components\\text-field\\code.mdx",
+ "createdAt": "2024-12-04T13:23:54.121Z",
+ "lastModified": "2024-12-04T13:23:54.121Z",
+ "size": 17441,
+ "formattedSize": "17.0 KB"
}
},
{
@@ -4013,9 +4013,9 @@
],
"tags": ["Text input", "Text area"],
"meta": {
- "relativePath": "components/text-field/guidance.mdx",
- "createdAt": "2024-11-06T10:27:49.404Z",
- "lastModified": "2024-11-06T10:19:00.148Z",
+ "relativePath": "components\\text-field\\guidance.mdx",
+ "createdAt": "2024-11-05T11:57:53.949Z",
+ "lastModified": "2024-11-05T11:57:53.949Z",
"size": 6792,
"formattedSize": "6.6 KB"
}
@@ -4044,16 +4044,16 @@
}
],
"meta": {
- "relativePath": "components/toasts/accessibility.mdx",
- "createdAt": "2024-11-06T10:27:49.408Z",
- "lastModified": "2024-11-06T10:19:00.148Z",
+ "relativePath": "components\\toasts\\accessibility.mdx",
+ "createdAt": "2024-11-05T11:57:53.972Z",
+ "lastModified": "2024-11-05T11:57:53.972Z",
"size": 3405,
"formattedSize": "3.3 KB"
}
},
{
"id": "components\\toasts\\codex",
- "contents": "\nimport {\n IcToast,\n IcToastRegion,\n IcButton,\n IcLink,\n SlottedSVG,\n} from \"@ukic/react\";\nimport { useRef } from \"react\";\n\nexport const defaultSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display toast\n\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display toast component\n\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\n## Component demo\n\nexport const DefaultToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display toast component\n \n \n \n >\n );\n};\n\n\n \n\n\n## Toast region details\n\n\n\n## Toast details\n\n\n\n## Variants\n\n### Displaying toasts\n\nUse the `openToast` prop on the toast region component to display a toast message. Do not use the `setVisible` method on the toast component as this does not work with the toast queuing functionality.\n\n### Queuing toasts\n\nTo view the toasts queuing in the following example, click each button to open a toast and then the dismiss button on the visible toast. Each toast will appear one after the other.\n\nexport const queuingSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display default toast\nDisplay error toast\nDisplay auto dismiss toast\n\n \n \n \n`,\n long: `.btn-container {\n display: flex;\n gap: var(--ic-space-xs);\n flex-wrap: wrap;\n padding: var(--ic-space-md);\n }\n\n\n \n Display default toast\n Display error toast\n Display auto dismiss toast\n
\n \n \n \n \n \n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display default toast\nDisplay error toast\n\n Display auto dismiss toast\n\n\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst errorToastEl = useRef(null);\nconst autoDismissToastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nconst handleErrorClick = () => {\n if (toastRegionEl.current && errorToastEl.current) {\n toastRegionEl.current.openToast = errorToastEl.current;\n }\n};\nconst handleAutoDismissClick = () => {\n if (toastRegionEl.current && autoDismissToastEl.current) {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n }\n};\nconst useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n \n Display default toast\n Display error toast\n \n Display auto dismiss toast\n \n
\n \n \n \n \n \n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst errorToastEl = useRef(null);\nconst autoDismissToastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nconst handleErrorClick = () => {\n if (toastRegionEl.current && errorToastEl.current) {\n toastRegionEl.current.openToast = errorToastEl.current;\n }\n};\nconst handleAutoDismissClick = () => {\n if (toastRegionEl.current && autoDismissToastEl.current) {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n }\n};\nconst useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n \n Display default toast\n Display error toast\n \n Display auto dismiss toast\n \n
\n \n \n \n \n \n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const QueuingToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const errorToastEl = useRef(null);\n const autoDismissToastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n const handleErrorClick = () => {\n toastRegionEl.current.openToast = errorToastEl.current;\n };\n const handleAutoDismissClick = () => {\n toastRegionEl.current.openToast = autoDismissToastEl.current;\n };\n return (\n <>\n \n Display default toast\n Display error toast\n \n Display auto dismiss toast\n \n
\n \n \n \n \n \n >\n );\n};\n\n\n \n\n\n### Status variant\n\nexport const withVariantSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display success toast\n\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display success toast\n\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const WithVariantToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display success toast\n \n \n \n >\n );\n};\n\n\n \n\n\n### Multi-line\n\nexport const withMultilineSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display multi-line toast\n\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display multi-line toast\n\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const MultilineToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display multi-line toast\n \n \n \n >\n );\n};\n\n\n \n\n\n### Slotted 'action' toast\n\nexport const slottedActionsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display slotted buttons toast\nDisplay slotted buttons toast\n\n \n Retry\n \n \n Retry\n \n`,\n long: `.btn-container {\n display: flex;\n gap: var(--ic-space-xs);\n flex-wrap: wrap;\n padding: var(--ic-space-md);\n }\n\n\n \n Display slotted buttons toast\n Display slotted buttons toast\n
\n \n \n Retry\n \n \n Retry\n \n \n `,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display slotted button toast\nDisplay slotted link toast\n\n \n Retry\n \n \n Retry\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst buttonToastEl = useRef(null);\nconst linkToastEl = useRef(null);\nconst handleButtonToastClick = () => {\n if (toastRegionEl.current && buttonToastEl.current) {\n toastRegionEl.current.openToast = buttonToastEl.current;\n }\n};\nconst handleLinkToastClick = () => {\n if (toastRegionEl.current && linkToastEl.current) {\n toastRegionEl.current.openToast = linkToastEl.current;\n }\n};\nconst useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n \n \n Display slotted button toast\n \n \n Display slotted link toast\n \n
\n \n \n \n Retry\n \n \n \n \n Retry\n \n \n \n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst buttonToastEl = useRef(null);\nconst linkToastEl = useRef(null);\nconst handleButtonToastClick = () => {\n if (toastRegionEl.current && buttonToastEl.current) {\n toastRegionEl.current.openToast = buttonToastEl.current;\n }\n};\nconst handleLinkToastClick = () => {\n if (toastRegionEl.current && linkToastEl.current) {\n toastRegionEl.current.openToast = linkToastEl.current;\n }\n};\nconst useStyles = createUseStyles({\n btnContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"var(--ic-space-xs)\",\n padding: \"var(--ic-space-md)\",\n },\n});\nconst classes = useStyles();\nreturn (\n <>\n \n \n Display slotted button toast\n \n \n Display slotted link toast\n \n
\n \n \n \n Retry\n \n \n \n \n Retry\n \n \n \n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const SlottedActionsToast = () => {\n const toastRegionEl = useRef(null);\n const buttonToastEl = useRef(null);\n const linkToastEl = useRef(null);\n const handleButtonToastClick = () => {\n toastRegionEl.current.openToast = buttonToastEl.current;\n };\n const handleLinkToastClick = () => {\n toastRegionEl.current.openToast = linkToastEl.current;\n };\n return (\n <>\n \n \n Display slotted button toast\n \n \n Display slotted link toast\n \n
\n \n \n \n Retry\n \n \n \n \n Retry\n \n \n \n >\n );\n};\n\n\n \n\n\n### Auto-dismiss\n\nexport const autoDismissSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display auto-dismiss toast\n\n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `Display auto-dismiss toast\n\n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const AutoDismissToast = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n Display auto-dismiss toast\n \n \n \n >\n );\n};\n\n\n \n\n\n### Custom neutral icon and aria-labels\n\nexport const customIconAriaLabelsSnippet = [\n {\n technology: \"Web component\",\n snippets: {\n short: `Display auto-dismiss toast\n\n \n \n \n`,\n long: `{shortCode}\n`,\n },\n },\n {\n technology: \"React\",\n snippets: {\n short: `\n Display custom icon and aria-label toast\n\n\n \n \n coffee-outline\n \n \n \n`,\n long: [\n {\n language: \"Typescript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n {\n language: \"Javascript\",\n snippet: `const toastRegionEl = useRef(null);\nconst toastEl = useRef(null);\nconst handleClick = () => {\n if (toastRegionEl.current && toastEl.current) {\n toastRegionEl.current.openToast = toastEl.current;\n }\n};\nreturn (\n <>\n {shortCode}\n >\n)`,\n },\n ],\n },\n },\n];\n\nexport const CustomIconAriaLabels = () => {\n const toastRegionEl = useRef(null);\n const toastEl = useRef(null);\n const handleClick = () => {\n toastRegionEl.current.openToast = toastEl.current;\n };\n return (\n <>\n \n Display custom icon and aria-labels toast\n \n \n \n \n coffee-outline\n \n \n \n \n >\n );\n};\n\n\n \n\n",
+ "contents": "\r\nimport {\r\n IcToast,\r\n IcToastRegion,\r\n IcButton,\r\n IcLink,\r\n SlottedSVG,\r\n} from \"@ukic/react\";\r\nimport { useRef } from \"react\";\r\n\r\nexport const defaultSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Display toast\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: `Display toast component\r\n\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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 toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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## Component demo\r\n\r\nexport const DefaultToast = () => {\r\n const toastRegionEl = useRef(null);\r\n const toastEl = useRef(null);\r\n const handleClick = () => {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n };\r\n return (\r\n <>\r\n Display toast component\r\n \r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n## Toast region details\r\n\r\n\r\n\r\n## Toast details\r\n\r\n\r\n\r\n## Variants\r\n\r\n### Displaying toasts\r\n\r\nUse the `openToast` prop on the toast region component to display a toast message. Do not use the `setVisible` method on the toast component as this does not work with the toast queuing functionality.\r\n\r\n### Queuing toasts\r\n\r\nTo view the toasts queuing in the following example, click each button to open a toast and then the dismiss button on the visible toast. Each toast will appear one after the other.\r\n\r\nexport const queuingSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Display default toast\r\nDisplay error toast\r\nDisplay auto dismiss toast\r\n\r\n \r\n \r\n \r\n`,\r\n long: `.btn-container {\r\n display: flex;\r\n gap: var(--ic-space-xs);\r\n flex-wrap: wrap;\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n \r\n Display default toast\r\n Display error toast\r\n Display auto dismiss toast\r\n
\r\n \r\n \r\n \r\n \r\n \r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `Display default toast\r\nDisplay error toast\r\n\r\n Display auto dismiss toast\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 toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst errorToastEl = useRef(null);\r\nconst autoDismissToastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n }\r\n};\r\nconst handleErrorClick = () => {\r\n if (toastRegionEl.current && errorToastEl.current) {\r\n toastRegionEl.current.openToast = errorToastEl.current;\r\n }\r\n};\r\nconst handleAutoDismissClick = () => {\r\n if (toastRegionEl.current && autoDismissToastEl.current) {\r\n toastRegionEl.current.openToast = autoDismissToastEl.current;\r\n }\r\n};\r\nconst useStyles = createUseStyles({\r\n btnContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n <>\r\n \r\n Display default toast\r\n Display error toast\r\n \r\n Display auto dismiss toast\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n >\r\n)`,\r\n },\r\n {\r\n language: \"Javascript\",\r\n snippet: `const toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst errorToastEl = useRef(null);\r\nconst autoDismissToastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n }\r\n};\r\nconst handleErrorClick = () => {\r\n if (toastRegionEl.current && errorToastEl.current) {\r\n toastRegionEl.current.openToast = errorToastEl.current;\r\n }\r\n};\r\nconst handleAutoDismissClick = () => {\r\n if (toastRegionEl.current && autoDismissToastEl.current) {\r\n toastRegionEl.current.openToast = autoDismissToastEl.current;\r\n }\r\n};\r\nconst useStyles = createUseStyles({\r\n btnContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n <>\r\n \r\n Display default toast\r\n Display error toast\r\n \r\n Display auto dismiss toast\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\nexport const QueuingToast = () => {\r\n const toastRegionEl = useRef(null);\r\n const toastEl = useRef(null);\r\n const errorToastEl = useRef(null);\r\n const autoDismissToastEl = useRef(null);\r\n const handleClick = () => {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n };\r\n const handleErrorClick = () => {\r\n toastRegionEl.current.openToast = errorToastEl.current;\r\n };\r\n const handleAutoDismissClick = () => {\r\n toastRegionEl.current.openToast = autoDismissToastEl.current;\r\n };\r\n return (\r\n <>\r\n \r\n Display default toast\r\n Display error toast\r\n \r\n Display auto dismiss toast\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### Status variant\r\n\r\nexport const withVariantSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Display success toast\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: `Display success toast\r\n\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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 toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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\nexport const WithVariantToast = () => {\r\n const toastRegionEl = useRef(null);\r\n const toastEl = useRef(null);\r\n const handleClick = () => {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n };\r\n return (\r\n <>\r\n Display success toast\r\n \r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Multi-line\r\n\r\nexport const withMultilineSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Display multi-line toast\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: `Display multi-line toast\r\n\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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 toastRegionEl = useRef(null);\r\nconst toastEl = useRef(null);\r\nconst handleClick = () => {\r\n if (toastRegionEl.current && toastEl.current) {\r\n toastRegionEl.current.openToast = toastEl.current;\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\nexport const MultilineToast = () => {\r\n const toastRegionEl = useRef(null);\r\n const toastEl = useRef(null);\r\n const handleClick = () => {\r\n toastRegionEl.current.openToast = toastEl.current;\r\n };\r\n return (\r\n <>\r\n Display multi-line toast\r\n \r\n \r\n \r\n >\r\n );\r\n};\r\n\r\n\r\n \r\n\r\n\r\n### Slotted 'action' toast\r\n\r\nexport const slottedActionsSnippet = [\r\n {\r\n technology: \"Web component\",\r\n snippets: {\r\n short: `Display slotted buttons toast\r\nDisplay slotted buttons toast\r\n\r\n \r\n Retry\r\n \r\n \r\n Retry\r\n \r\n`,\r\n long: `.btn-container {\r\n display: flex;\r\n gap: var(--ic-space-xs);\r\n flex-wrap: wrap;\r\n padding: var(--ic-space-md);\r\n }\r\n\r\n\r\n \r\n Display slotted buttons toast\r\n Display slotted buttons toast\r\n
\r\n \r\n \r\n Retry\r\n \r\n \r\n Retry\r\n \r\n \r\n `,\r\n },\r\n },\r\n {\r\n technology: \"React\",\r\n snippets: {\r\n short: `Display slotted button toast\r\nDisplay slotted link toast\r\n\r\n \r\n Retry\r\n \r\n \r\n Retry\r\n \r\n`,\r\n long: [\r\n {\r\n language: \"Typescript\",\r\n snippet: `const toastRegionEl = useRef(null);\r\nconst buttonToastEl = useRef(null);\r\nconst linkToastEl = useRef(null);\r\nconst handleButtonToastClick = () => {\r\n if (toastRegionEl.current && buttonToastEl.current) {\r\n toastRegionEl.current.openToast = buttonToastEl.current;\r\n }\r\n};\r\nconst handleLinkToastClick = () => {\r\n if (toastRegionEl.current && linkToastEl.current) {\r\n toastRegionEl.current.openToast = linkToastEl.current;\r\n }\r\n};\r\nconst useStyles = createUseStyles({\r\n btnContainer: {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n gap: \"var(--ic-space-xs)\",\r\n padding: \"var(--ic-space-md)\",\r\n },\r\n});\r\nconst classes = useStyles();\r\nreturn (\r\n <>\r\n \r\n