Skip to content

Commit 7c422a0

Browse files
Merge branch 'main' into element/ak-spinner
* main: Accepted suggestion from @GirlBossRush Update vitest.config.js Update src/ak-button/ak-button.component.ts Update src/ak-button/ak-button.template.ts
2 parents ee5af7a + eccd2eb commit 7c422a0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/ak-button/ak-button.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class Button extends LitElement implements IButton {
150150
#internals = InternalsController.of(this, { role: "button" });
151151

152152
@property({ reflect: true, type: Boolean })
153-
disabled = false;
153+
public disabled = false;
154154

155155
get #disabled() {
156156
return this.matches(":disabled") || this.disabled;

src/ak-button/ak-button.template.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ type ButtonLinkProps = Pick<ButtonProps, "disabled" | "onClick" | "onKeydown"> &
1717
download?: string;
1818
};
1919

20+
/**
21+
* @remarks
22+
* The ARIA rules for disabled links specifies that "to communicate a link as ‘disabled,’ remove
23+
* the `href` attribute and style accordingly." Hence the `href=${ifDefined(...)}`.
24+
*
25+
* @see {@link https://www.w3.org/TR/html-aria/#example-communicate-a-disabled-link-with-aria | ARIA Disabled Link Rules}
26+
*/
27+
2028
export function linkTemplate(props: ButtonLinkProps) {
2129
const { href, target, disabled, download, rel, onClick, onKeydown } = props;
22-
23-
// The ARIA rules for disabled links specifies that "to communicate a link as ‘disabled,’ remove
24-
// the `href` attribute and style accordingly." Hence the `href=${ifDefined(...)}`. See:
25-
// https://www.w3.org/TR/html-aria/#example-communicate-a-disabled-link-with-aria
2630
return html`<a
2731
id="main"
2832
href=${ifDefined(disabled ? null : href)}

vitest.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path, { dirname } from "node:path";
1+
import { dirname, resolve } from "node:path";
22
import { fileURLToPath } from "node:url";
33

44
import { playwright } from "@vitest/browser-playwright";
@@ -8,7 +8,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
88

99
const $ = ({ page, provider }, selector) => {
1010
if (provider.name !== "playwright") {
11-
throw new Error(`provider ${provider.name} is not supported`);
11+
throw new Error(`Provider "${provider.name}" is not supported`);
1212
}
1313
return page.locator(selector);
1414
};
@@ -29,7 +29,7 @@ export default defineConfig(({ mode }) => ({
2929
},
3030
test: {
3131
alias: {
32-
"@goauthentik/elements": path.resolve(__dirname, "./dist"),
32+
"@goauthentik/elements": resolve(__dirname, "./dist"),
3333
},
3434
dir: "./dist",
3535
include: ["**/*.test.js"],

0 commit comments

Comments
 (0)