Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apidoc a11y #127

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions app/documentation/api/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,40 @@ import Text from '@/components/Text'
export default function ApiMainPage() {
return <>
<DefaultLayout heroSmall heroTitle='Oskari API'>
<div>
<Text>
Oskari API is defined as bundles. Bundle is a definition of functionality that may provide external API to control the functionality.
</Text>
<HighlightBox>
<div style={{ display: 'flex', flexDirection: 'column'}}>
<HighlightBox style= {{ backgroundColor: '#FAFAFA'}}>
<div style={{ display: 'flex', flexDirection: 'column', maxWidth: '85vw'}}>
<h2 style={{fontSize: '1.625rem'}}>Building a custom Oskari application</h2>
<div>
<p>Choose the functionalities from bundle documentation</p>
<p className="mt-2 mb-2">Choose the functionalities from bundle documentation</p>
<Button
variant='primary'
title='Bundle documentation'
href={'/documentation/api/bundles'}/>
</div>
<div style={{ marginTop: '2em'}}>
<h2 style={{fontSize: '1.625rem'}}>Working with an existing Oskari application</h2>
<div style={{ gridColumn: '2' }} className='flex justify-center'>
<div className='flex w-full justify-center gap-4 items-center'>
<div>
<p>Controlling existing functionality</p>
<Button
variant='primary'
title='Requests documentation'
href={'/documentation/api/requests'}/>
</div>
<div>
<p>Reacting to events</p>
<Button
variant='primary'
title='Events documentation'
href={'/documentation/api/events'}/>
</div>
<div className='flex flex-col'>
<div className="mt-3 mb-3">
<p className="mt-2 mb-2">Controlling existing functionality</p>
<Button
variant='primary'
title='Requests documentation'
href={'/documentation/api/requests'}/>
</div>
<div>
<p className="mt-2 mb-2">Reacting to events</p>
<Button
variant='primary'
title='Events documentation'
href={'/documentation/api/events'}/>
</div>

</div>
</div>
</div>
</HighlightBox>
</div>
</DefaultLayout>
</>;
}
11 changes: 8 additions & 3 deletions components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
'use client'
import styles from '@/styles/checkbox.module.scss'
import { ReactNode } from 'react';
import { KeyboardEvent } from 'react';

export function CheckboxGroup({children}: {children: Array<ReactNode>}) {
return <div className={`${styles.checkbox_group}`}>{children}</div>
}

function shouldToggle(event: KeyboardEvent) {
return event?.key === 'Enter';
}

export default function Checkbox({isChecked, title, onChange}: {isChecked: boolean, title: string, onChange: (checked: boolean) => void}) {
return <div className={`${styles.checkbox}`} onClick={() => onChange(!isChecked)}>
<div className={`${styles.checkbox__header}`}>{title}</div>
<input type='checkbox' defaultChecked={isChecked}/>
return <div className={`${styles.checkbox} pr-2`} onClick={() => onChange(!isChecked)}>
<label htmlFor={'checkbox_' + title} className={`${styles.checkbox__header}`}>{title}</label>
<input id={'checkbox_' + title} type='checkbox' defaultChecked={isChecked} onKeyUp={(event) => { if (shouldToggle(event)) { onChange(!isChecked); }}}/>
</div>;
}
2 changes: 1 addition & 1 deletion styles/accordion.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

/*uncover the top border of active link of the first list element*/
li:first-child {
margin-top: 0.2rem;
margin-top: 0.3rem;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions styles/checkbox.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
display: flex;
flex-direction: row;

&:has(input:active), &:has(input:focus) {
outline: auto;
}

&__header {
background-color: var(--color-light);
font-weight: 700;
Expand Down
2 changes: 1 addition & 1 deletion styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ h3 {

.content-wrapper {
/*bring this further up so it's closer to balloons.*/
margin-top: -20rem;
margin-top: -30vh;
/*make sure this appears on top of balloons*/
z-index: 2;
/*make sure we can use z-index and thus sure this stays on top of the balloons*/
Expand Down
Loading