@umbraco-ui/uui-card 1.14.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -4,10 +4,13 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
4
4
  import { LitElement, html, css } from 'lit';
5
5
  import { property } from 'lit/decorators.js';
6
6
  import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
7
+ import '@umbraco-ui/uui-checkbox/lib';
7
8
 
8
9
  class UUICardEvent extends UUIEvent {
10
+ static {
11
+ this.OPEN = "open";
12
+ }
9
13
  }
10
- UUICardEvent.OPEN = "open";
11
14
 
12
15
  var __defProp = Object.defineProperty;
13
16
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41,6 +44,19 @@ let UUICardElement = class extends SelectOnlyMixin(
41
44
  e.stopPropagation();
42
45
  this.dispatchEvent(new UUICardEvent(UUICardEvent.OPEN));
43
46
  }
47
+ renderCheckbox() {
48
+ if (!this.selectable) return;
49
+ return html`
50
+ <uui-checkbox
51
+ id="select-checkbox"
52
+ label="select"
53
+ tabindex="-1"
54
+ ?checked=${this.selected}
55
+ @click=${(e) => e.stopPropagation()}
56
+ @change=${() => this.click()}>
57
+ </uui-checkbox>
58
+ `;
59
+ }
44
60
  render() {
45
61
  return html`<slot id="open-part"></slot>
46
62
  <div id="select-border"></div>`;
@@ -194,6 +210,21 @@ UUICardElement.styles = [
194
210
  background: var(--uui-color-disabled,#f3f3f5);
195
211
  color: var(--uui-color-disabled-contrast,#c4c4c4);
196
212
  }
213
+
214
+ #select-checkbox {
215
+ position: absolute;
216
+ top: var(--uui-size-4,12px);
217
+ left: var(--uui-size-4,12px);
218
+ opacity: 0;
219
+ transition: opacity 120ms;
220
+ z-index: 3;
221
+ }
222
+ :host(:focus) #select-checkbox,
223
+ :host(:focus-within) #select-checkbox,
224
+ :host(:hover) #select-checkbox,
225
+ #select-checkbox[checked] {
226
+ opacity: 1;
227
+ }
197
228
  `
198
229
  ];
199
230
  __decorateClass([
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import '@umbraco-ui/uui-checkbox/lib';
2
3
  declare const UUICardElement_base: (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").SelectOnlyMixinInterface) & (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").SelectableMixinInterface) & typeof LitElement;
3
4
  /**
4
5
  * Card is a Component that provides the basics for a Card component. This can be extended in code to match a certain need.
@@ -46,6 +47,7 @@ export declare class UUICardElement extends UUICardElement_base {
46
47
  rel?: string;
47
48
  protected handleOpenClick(e: Event): void;
48
49
  protected handleOpenKeydown(e: KeyboardEvent): void;
50
+ protected renderCheckbox(): import("lit-html").TemplateResult<1> | undefined;
49
51
  protected render(): import("lit-html").TemplateResult<1>;
50
52
  static styles: import("lit").CSSResult[];
51
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-card",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,7 +30,8 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.14.1"
33
+ "@umbraco-ui/uui-base": "1.15.0",
34
+ "@umbraco-ui/uui-checkbox": "1.15.0"
34
35
  },
35
36
  "scripts": {
36
37
  "build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
@@ -41,5 +42,5 @@
41
42
  "access": "public"
42
43
  },
43
44
  "homepage": "https://uui.umbraco.com/?path=/story/uui-card",
44
- "gitHead": "1dc16cf95e7f45ee85c8000c4932e827466e5229"
45
+ "gitHead": "b84216deaff3a3be8f7bd8cdbf2758e7955c70e9"
45
46
  }