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

[TEST] hds-tooltip aria-controls changes #2649

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/dry-frogs-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@hashicorp/design-system-components": patch
---

`hds-tooltip` - Changed DOM structure of tooltip content and set `aria-controls` on trigger elements for a11y improvements with toggled content
`TooltipButton` - Changed DOM structure of tooltip content and set `aria-controls` on button for a11y improvements with toggled content
4 changes: 2 additions & 2 deletions packages/components/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/declarations/
# /dist/
# /declarations/

# dependencies
/bower_components/
Expand Down
205 changes: 205 additions & 0 deletions packages/components/declarations/components.d.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/components/declarations/components.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import type { ComponentLike } from '@glint/template';
import type { HdsAccordionItemSignature } from './item/index.ts';
import type { HdsAccordionForceStates, HdsAccordionSizes, HdsAccordionTypes, HdsAccordionItemTitleTags } from './types.ts';
export interface HdsAccordionSignature {
Args: {
size?: HdsAccordionSizes;
type?: HdsAccordionTypes;
forceState?: HdsAccordionForceStates;
titleTag?: HdsAccordionItemTitleTags;
};
Blocks: {
default: [
{
Item?: ComponentLike<HdsAccordionItemSignature>;
}
];
};
Element: HTMLDivElement;
}
export default class HdsAccordion extends Component<HdsAccordionSignature> {
/**
* Sets the size for the component
*
* @param size
* @type {HdsAccordionSizes}
* @default 'medium'
*/
get size(): HdsAccordionSizes;
get titleTag(): HdsAccordionItemTitleTags;
/**
* Sets the type of the component
*
* @param type
* @type {HdsAccordionTypes}
* @default 'card'
*/
get type(): HdsAccordionTypes;
/**
* Get the class names to apply to the component.
* @method classNames
* @return {string} The "class" attribute to apply to the component.
*/
get classNames(): string;
}
//# sourceMappingURL=index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import type { HdsAccordionSizes } from '../types.ts';
export interface HdsAccordionItemButtonSignature {
Args: {
ariaLabel?: string;
ariaLabelledBy?: string;
contentId?: string;
isOpen?: boolean;
onClickToggle?: (event: MouseEvent, ...args: any[]) => void;
parentContainsInteractive?: boolean;
size?: HdsAccordionSizes;
id?: string;
};
Element: HTMLButtonElement;
}
export default class HdsAccordionItemButton extends Component<HdsAccordionItemButtonSignature> {
onClick(event: MouseEvent): void;
/**
* Get the class names to apply to the component.
* @method ItemButton#classNames
* @return {string} The "class" attribute to apply to the component.
*/
get classNames(): string;
}
//# sourceMappingURL=button.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import { HdsAccordionSizeValues, HdsAccordionTypeValues } from '../types.ts';
import type { HdsAccordionForceStates, HdsAccordionSizes, HdsAccordionTypes, HdsAccordionItemTitleTags } from '../types.ts';
export declare const SIZES: string[];
export declare const DEFAULT_SIZE = HdsAccordionSizeValues.Medium;
export declare const TYPES: string[];
export declare const DEFAULT_TYPE = HdsAccordionTypeValues.Card;
export interface HdsAccordionItemSignature {
Args: {
ariaLabel?: string;
containsInteractive?: boolean;
forceState?: HdsAccordionForceStates;
isOpen?: boolean;
isStatic?: boolean;
onClickToggle?: (event: MouseEvent, ...args: any[]) => void;
size?: HdsAccordionSizes;
titleTag?: HdsAccordionItemTitleTags;
type?: HdsAccordionTypes;
};
Blocks: {
toggle?: [];
content: [
{
close: (...args: any[]) => void;
}
];
};
Element: HTMLElement;
}
export default class HdsAccordionItem extends Component<HdsAccordionItemSignature> {
/**
* Generates a unique ID for the Content
*
* @param _contentId
*/
private _contentId;
private _titleId;
get ariaLabelledBy(): string | undefined;
/**
* @param containsInteractive
* @type {boolean}
* @default false
*/
get containsInteractive(): boolean;
/**
* @param toggleTextSize
* @type {HdsTextSizes}
* @default 'medium'
*/
get toggleTextSize(): number;
/**
* Sets the size for the component
*
* @param size
* @type {HdsAccordionSizes}
* @default 'medium'
*/
get size(): HdsAccordionSizes;
/**
* Sets the type of the component
*
* @param type
* @type {HdsAccordionTypes}
* @default 'card'
*/
get type(): HdsAccordionTypes;
get titleTag(): HdsAccordionItemTitleTags;
/**
* Get the class names to apply to the component.
* @method classNames
* @return {string} The "class" attribute to apply to the component.
*/
get classNames(): string;
}
//# sourceMappingURL=index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
export declare enum HdsAccordionTypeValues {
Card = "card",
Flush = "flush"
}
export type HdsAccordionTypes = `${HdsAccordionTypeValues}`;
export declare enum HdsAccordionSizeValues {
Small = "small",
Medium = "medium",
Large = "large"
}
export type HdsAccordionSizes = `${HdsAccordionSizeValues}`;
export declare enum HdsAccordionForceStateValues {
Open = "open",
Close = "close"
}
export type HdsAccordionForceStates = `${HdsAccordionForceStateValues}`;
export declare enum HdsAccordionItemTitleTagValues {
Div = "div",
H1 = "h1",
H2 = "h2",
H3 = "h3",
H4 = "h4",
H5 = "h5",
H6 = "h6"
}
export type HdsAccordionItemTitleTags = `${HdsAccordionItemTitleTagValues}`;
//# sourceMappingURL=types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading