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

fix: checkbox accessibility #195

Merged
merged 3 commits into from
Dec 23, 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
4 changes: 2 additions & 2 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export namespace Components {
"size": Size;
}
interface DHorizontalStack {
"gap": 2 | 4 | 8;
"gap": Gap;
}
interface DIcon {
"icon": string;
Expand Down Expand Up @@ -710,7 +710,7 @@ declare namespace LocalJSX {
"size"?: Size;
}
interface DHorizontalStack {
"gap"?: 2 | 4 | 8;
"gap"?: Gap;
}
interface DIcon {
"icon"?: string;
Expand Down
1 change: 1 addition & 0 deletions src/components/activity-card/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| ------------- | ------------- | ----------- | --------- | ----------- |
| `date` | `date` | | `string` | `undefined` |
| `description` | `description` | | `string` | `undefined` |
| `href` | `href` | | `string` | `undefined` |
| `logo` | `logo` | | `string` | `undefined` |
| `message` | `message` | | `string` | `undefined` |
| `read` | `read` | | `boolean` | `false` |
Expand Down
17 changes: 17 additions & 0 deletions src/components/checkbox/d-checkbox.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
:host {
display: block;
}
ion-checkbox {
--checkbox-background: var(--highlight);
--checkbox-background-checked: var(--accent);
width: 48px;
height: 48px;
justify-items: center;
margin-left: -12px;

}
ion-checkbox::part(container) {
border-radius: 1px;
border: 2px solid;
border-color: var(--on-alt);
--checkmark-color: var(--stroke);
--checkmark-width:3px;
--size: 22px;
}
2 changes: 1 addition & 1 deletion src/components/checkbox/d-checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DCheckbox {
return (
<Host>
<d-vertical-stack>
<d-horizontal-stack>
<d-horizontal-stack class="items-center" gap={0}>
<ion-checkbox onIonChange={e => this.updateValue(e.detail.checked)} checked={this.checked}></ion-checkbox>
<div>
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/components/checkbox/test/d-checkbox.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('d-checkbox', () => {
<d-checkbox>
<mock:shadow-root>
<d-vertical-stack>
<d-horizontal-stack>
<d-horizontal-stack class="items-center" gap="0">
<ion-checkbox></ion-checkbox>
<div>
<slot></slot>
Expand Down
3 changes: 2 additions & 1 deletion src/components/horizontal-stack/d-horizontal-stack.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Component, Host, Prop, h } from '@stencil/core';
import { Gap } from '../types';

@Component({
tag: 'd-horizontal-stack',
styleUrl: 'd-horizontal-stack.css',
shadow: true,
})
export class DHorizontalStack {
@Prop() gap: 2 | 4 | 8 = 2;
@Prop() gap: Gap = 2;

render() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/horizontal-stack/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

## Properties

| Property | Attribute | Description | Type | Default |
| -------- | --------- | ----------- | ------------- | ------- |
| `gap` | `gap` | | `2 \| 4 \| 8` | `2` |
| Property | Attribute | Description | Type | Default |
| -------- | --------- | ----------- | ------------------ | ------- |
| `gap` | `gap` | | `0 \| 2 \| 4 \| 8` | `2` |


## Dependencies
Expand Down
Loading
Loading