diff --git a/package-lock.json b/package-lock.json index f0f60f8fc..02abeb47f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19858,7 +19858,8 @@ "version": "1.14.1", "license": "MIT", "dependencies": { - "@umbraco-ui/uui-base": "1.14.1" + "@umbraco-ui/uui-base": "1.14.1", + "@umbraco-ui/uui-checkbox": "1.14.1" } }, "packages/uui-card-block-type": { diff --git a/packages/uui-card-block-type/lib/uui-card-block-type.element.ts b/packages/uui-card-block-type/lib/uui-card-block-type.element.ts index 3ef68439f..9edb3c03a 100644 --- a/packages/uui-card-block-type/lib/uui-card-block-type.element.ts +++ b/packages/uui-card-block-type/lib/uui-card-block-type.element.ts @@ -49,18 +49,19 @@ export class UUICardBlockTypeElement extends UUICardElement { ${this.href ? this.#renderLink() : this.#renderButton()}
- + ${this.selectable ? this.renderCheckbox() : nothing} `; } #renderButton() { + const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined; return html` `; + const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined; + return html` + + `; } #renderLink() { - return html` - ${this.#renderContent()} - `; + const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined; + const rel = this.target === '_blank' ? 'noopener noreferrer' : undefined; + return html` + + ${this.#renderContent()} + + `; } public render() { @@ -116,7 +118,7 @@ export class UUICardContentNodeElement extends UUICardElement { ${this.href ? this.#renderLink() : this.#renderButton()}
- + ${this.selectable ? this.renderCheckbox() : nothing} `; @@ -226,6 +228,11 @@ export class UUICardContentNodeElement extends UUICardElement { :host(:not([disabled])) #open-part:hover #default { color: var(--uui-color-interactive-emphasis); } + + #select-checkbox { + top: var(--uui-size-5); + left: var(--uui-size-6); + } `, ]; } diff --git a/packages/uui-card-content-node/lib/uui-card-content-node.story.ts b/packages/uui-card-content-node/lib/uui-card-content-node.story.ts index 096c72430..6e89af8e8 100644 --- a/packages/uui-card-content-node/lib/uui-card-content-node.story.ts +++ b/packages/uui-card-content-node/lib/uui-card-content-node.story.ts @@ -76,3 +76,16 @@ export const CustomIcon: Story = { 'icon slot': html``, }, }; + +export const Selectable: Story = { + args: { + selectable: true, + }, +}; + +export const OnlySelectable: Story = { + args: { + selectable: true, + selectOnly: true, + }, +}; diff --git a/packages/uui-card-media/lib/uui-card-media.element.ts b/packages/uui-card-media/lib/uui-card-media.element.ts index 504a6e058..7e130ad41 100644 --- a/packages/uui-card-media/lib/uui-card-media.element.ts +++ b/packages/uui-card-media/lib/uui-card-media.element.ts @@ -71,10 +71,11 @@ export class UUICardMediaElement extends UUICardElement { } #renderButton() { + const tabIndex = !this.disabled ? (this.selectOnly ? -1 : 0) : undefined; return html`