diff --git a/apps/website/src/components/menu/menu.tsx b/apps/website/src/components/menu/menu.tsx index 2b438e14f..145f0c4cf 100644 --- a/apps/website/src/components/menu/menu.tsx +++ b/apps/website/src/components/menu/menu.tsx @@ -37,6 +37,10 @@ export const Menu = component$(({ onClose$ }) => { path: `/docs/${appState.theme.toLowerCase()}/button-group`, }, { label: 'Card', path: `/docs/${appState.theme.toLowerCase()}/card` }, + { + label: 'Carousel', + path: `/docs/${appState.theme.toLowerCase()}/carousel`, + }, { label: 'Collapse', path: `/docs/${appState.theme.toLowerCase()}/collapse`, diff --git a/apps/website/src/routes/docs/headless/carousel/index.tsx b/apps/website/src/routes/docs/headless/carousel/index.tsx new file mode 100644 index 000000000..e9af9a6eb --- /dev/null +++ b/apps/website/src/routes/docs/headless/carousel/index.tsx @@ -0,0 +1,137 @@ +import { + component$, + useId, + useSignal, + useStylesScoped$, +} from '@builder.io/qwik'; +import { Carousel } from '@qwik-ui/headless'; + +const { + Controls, + Control, + Item, + Items, + Root, + ButtonNext, + ButtonPrevious, + IconNext, + IconPrevious, +} = Carousel; + +export const ITEMS: { src: string; title: string }[] = Array.from({ + length: 4, +}).map(() => ({ + src: 'https://picsum.photos/1200/550', + title: 'My great image', +})); + +export default component$(() => { + const { scopeId } = useStylesScoped$(` + h1 { margin: 2rem 0; padding-top: 1rem; font-weight: bold; border-top: 1px dotted #222} + h2 { margin-block: 1.15em 0.5em; font-size: xx-large; } + h3 { margin-block: 0.85em 0.35em; font-size: x-large; } + hr { margin-block: 2em; } + + .form-item, hr { width: 35em; } + + .outter { + display: grid; + } + + .inner { + display: flex; + align-items: center; + } + + .controls { + padding: 2em; + margin-inline: auto; + display: flex; + justify-content: center; + gap: 0.5em; + } + + .control { + width: 2em; + aspect-ratio: 1/1; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + transition: all .3s .1s ease-out; + cursor: pointer; + } + + .control[aria-current="true"] { + font-weight: 900; + } + + .item { + height: 500px; + width: 100%; + object-fit: cover; + } + `); + + const items = useSignal(ITEMS); + + return ( + <> +

This is the documentation for the Carousel

+ +

Carousel Example

+ + +
+ + + + + {items.value.map(({ src, title }, i) => ( + + + + ))} + + + + +
+ + {items.value.map((_, i) => ( + + {i + 1} + + ))} + +
+ +
+ +

Inputs

+ + + +

Parts

+ + + +
+ +

Outputs

+ + + + ); +}); diff --git a/packages/headless/src/components/carousel/carousel.axe.json b/packages/headless/src/components/carousel/carousel.axe.json new file mode 100644 index 000000000..d9c49c059 --- /dev/null +++ b/packages/headless/src/components/carousel/carousel.axe.json @@ -0,0 +1,446 @@ +{ + "url": "http://localhost:5173/docs/headless/carousel/", + "extensionVersion": "4.52.0", + "axeVersion": "4.6.3", + "standard": "WCAG 2.1 AA", + "testingStartDate": "2023-03-26T05:51:50.476Z", + "testingEndDate": "2023-03-26T06:11:53.150Z", + "bestPracticesEnabled": true, + "issueSummary": { + "critical": 4, + "moderate": 11, + "minor": 0, + "serious": 0, + "bestPractices": 11, + "needsReview": 0 + }, + "remainingTestingSummary": { + "run": false + }, + "igtSummary": [ + { + "tool": "Table", + "skipped": false, + "name": null, + "run": false + }, + { + "tool": "Keyboard", + "skipped": false, + "name": "3/26/2023 at 5:10 PM", + "run": true, + "issues": { + "critical": 0, + "moderate": 0, + "minor": 0, + "serious": 0 + }, + "duration": 20270 + }, + { + "tool": "Modal Dialog", + "skipped": false, + "name": null, + "run": false + }, + { + "tool": "Interactive Elements", + "skipped": false, + "name": "3/26/2023 at 5:11 PM", + "run": true, + "issues": { + "critical": 0, + "moderate": 0, + "minor": 0, + "serious": 0 + }, + "duration": 34179 + }, + { + "tool": "Structure", + "skipped": false, + "name": null, + "run": false + }, + { + "tool": "Images", + "skipped": false, + "name": null, + "run": false + }, + { + "tool": "Forms", + "skipped": false, + "name": null, + "run": false + } + ], + "failedRules": [ + { + "name": "landmark-one-main", + "count": 1, + "mode": "automated" + }, + { + "name": "region", + "count": 9, + "mode": "automated" + }, + { + "name": "page-has-heading-one", + "count": 1, + "mode": "automated" + }, + { + "name": "image-alt", + "count": 4, + "mode": "automated" + } + ], + "needsReview": [], + "allIssues": [ + { + "ruleId": "landmark-one-main", + "description": "Ensures the document has a main landmark", + "help": "Document should have one main landmark", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/landmark-one-main?application=AxeChrome", + "impact": "moderate", + "needsReview": false, + "isManual": false, + "selector": ["html"], + "summary": "Fix all of the following:\n Document does not have a main landmark", + "source": "", + "tags": ["cat.semantics", "best-practice"], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "region", + "description": "Ensures all page content is contained by landmarks", + "help": "All page content should be contained by landmarks", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/region?application=AxeChrome", + "impact": "moderate", + "needsReview": false, + "isManual": false, + "selector": ["body > p"], + "summary": "Fix any of the following:\n Some page content is not contained by landmarks", + "source": "

This is the documentation for the Carousel

", + "tags": ["cat.keyboard", "best-practice"], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "region", + "description": "Ensures all page content is contained by landmarks", + "help": "All page content should be contained by landmarks", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/region?application=AxeChrome", + "impact": "moderate", + "needsReview": false, + "isManual": false, + "selector": ["h2"], + "summary": "Fix any of the following:\n Some page content is not contained by landmarks", + "source": "

Carousel Example

", + "tags": ["cat.keyboard", "best-practice"], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "page-has-heading-one", + "description": "Ensure that the page, or at least one of its frames contains a level-one heading", + "help": "Page should contain a level-one heading", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/page-has-heading-one?application=AxeChrome", + "impact": "moderate", + "needsReview": false, + "isManual": false, + "selector": ["html"], + "summary": "Fix all of the following:\n Page must have a level-one heading", + "source": "", + "tags": ["cat.semantics", "best-practice"], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "image-alt", + "description": "Ensures elements have alternate text or a role of none or presentation", + "help": "Images must have alternate text", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/image-alt?application=AxeChrome", + "impact": "critical", + "needsReview": false, + "isManual": false, + "selector": [".⭐️we6d37-0:nth-child(1) > img"], + "summary": "Fix any of the following:\n Element does not have an alt attribute\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element's default semantics were not overridden with role=\"none\" or role=\"presentation\"", + "source": "", + "tags": [ + "cat.text-alternatives", + "wcag2a", + "wcag111", + "section508", + "section508.22.a", + "ACT" + ], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "image-alt", + "description": "Ensures elements have alternate text or a role of none or presentation", + "help": "Images must have alternate text", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/image-alt?application=AxeChrome", + "impact": "critical", + "needsReview": false, + "isManual": false, + "selector": [".⭐️we6d37-0:nth-child(2) > img"], + "summary": "Fix any of the following:\n Element does not have an alt attribute\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element's default semantics were not overridden with role=\"none\" or role=\"presentation\"", + "source": "", + "tags": [ + "cat.text-alternatives", + "wcag2a", + "wcag111", + "section508", + "section508.22.a", + "ACT" + ], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "image-alt", + "description": "Ensures elements have alternate text or a role of none or presentation", + "help": "Images must have alternate text", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/image-alt?application=AxeChrome", + "impact": "critical", + "needsReview": false, + "isManual": false, + "selector": [".⭐️we6d37-0:nth-child(3) > img"], + "summary": "Fix any of the following:\n Element does not have an alt attribute\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element's default semantics were not overridden with role=\"none\" or role=\"presentation\"", + "source": "", + "tags": [ + "cat.text-alternatives", + "wcag2a", + "wcag111", + "section508", + "section508.22.a", + "ACT" + ], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "image-alt", + "description": "Ensures elements have alternate text or a role of none or presentation", + "help": "Images must have alternate text", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/image-alt?application=AxeChrome", + "impact": "critical", + "needsReview": false, + "isManual": false, + "selector": [".⭐️we6d37-0:nth-child(4) > img"], + "summary": "Fix any of the following:\n Element does not have an alt attribute\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element's default semantics were not overridden with role=\"none\" or role=\"presentation\"", + "source": "", + "tags": [ + "cat.text-alternatives", + "wcag2a", + "wcag111", + "section508", + "section508.22.a", + "ACT" + ], + "igt": "", + "testName": "QwikUI | Headless | Carousel", + "shareURL": "", + "createdAt": "2023-03-26T06:10:12.758Z", + "testUrl": "http://localhost:5173/docs/headless/carousel/", + "testPageTitle": "", + "foundBy": "thomas.leperou@hayvnglobal.com", + "axeVersion": "4.6.3" + }, + { + "ruleId": "region", + "description": "Ensures all page content is contained by landmarks", + "help": "All page content should be contained by landmarks", + "helpUrl": "https://dequeuniversity.com/rules/axe/4.6/region?application=AxeChrome", + "impact": "moderate", + "needsReview": false, + "isManual": false, + "selector": ["ul:nth-child(3)"], + "summary": "Fix any of the following:\n Some page content is not contained by landmarks", + "source": "