@coras-io/embed 0.6.9 → 0.6.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @coras-io/embed
2
2
 
3
+ ## 0.6.10
4
+
5
+ ### Patch Changes
6
+
7
+ - d3cb2f2: Keep the page visible behind drawers and dialogs opened after scrolling, on hosts that set the body height to 100%
8
+ - 70b7ecc: Give dropdown lists such as language and currency more room, with smaller text and flags, a clearer check mark and a stronger selected row to match the design
9
+
3
10
  ## 0.6.9
4
11
 
5
12
  ### Patch Changes
@@ -8,17 +8,17 @@ export default css `
8
8
  --select-list-caption-font-weight: var(--coras-font-weight-semibold);
9
9
  --select-list-caption-icon-color: var(--coras-color-text);
10
10
 
11
- --select-option-padding-y: 6px;
12
- --select-option-padding-x: 12px;
11
+ --select-option-padding-y: 10px;
12
+ --select-option-padding-x: 24px;
13
13
 
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  min-width: 264px;
17
- padding: 8px 0;
17
+ padding: 16px 0;
18
18
  list-style-type: none;
19
19
 
20
20
  & > .caption {
21
- padding: 0.6rem 1rem 0.9rem 1rem;
21
+ padding: 0.6rem 1.5rem 0.9rem;
22
22
  font-family: var(--coras-font-family-heading);
23
23
  font-weight: var(--select-list-caption-font-weight);
24
24
  font-size: var(--select-list-caption-font-size);
@@ -33,11 +33,6 @@ export default css `
33
33
 
34
34
  :host([spacious]) {
35
35
  --select-option-padding-y: 12px;
36
- --select-option-padding-x: 24px;
37
-
38
- & > .caption {
39
- padding: 0.6rem 1.5rem 0.9rem;
40
- }
41
36
  }
42
37
 
43
38
  :host([spacious][height="short"]) {
@@ -4,9 +4,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { LitElement, html, } from "lit";
7
+ import { LitElement, html, nothing, svg, } from "lit";
8
8
  import { property } from "lit/decorators.js";
9
9
  import styles from "./select-option.styles.js";
10
+ const checkMark = svg `<path d="M9.45005 17.55C9.35005 17.55 9.25838 17.5334 9.17505 17.5C9.09172 17.4667 9.00838 17.4084 8.92505 17.325L4.40005 12.8C4.25005 12.65 4.17505 12.4667 4.17505 12.25C4.17505 12.0334 4.25005 11.85 4.40005 11.7C4.55005 11.55 4.72505 11.475 4.92505 11.475C5.12505 11.475 5.30005 11.55 5.45005 11.7L9.45005 15.7L18.525 6.62502C18.675 6.47502 18.8542 6.40002 19.0625 6.40002C19.2709 6.40002 19.45 6.47502 19.6 6.62502C19.75 6.77502 19.825 6.95419 19.825 7.16252C19.825 7.37086 19.75 7.55002 19.6 7.70002L9.97505 17.325C9.89172 17.4084 9.80838 17.4667 9.72505 17.5C9.64172 17.5334 9.55005 17.55 9.45005 17.55Z"/>`;
10
11
  export class CorasSelectOption extends LitElement {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -24,7 +25,14 @@ export class CorasSelectOption extends LitElement {
24
25
  }
25
26
  }
26
27
  render() {
27
- return html ` <slot></slot> `;
28
+ return html `
29
+ <slot></slot>
30
+ ${this.selected
31
+ ? html `<svg class="check-mark" viewBox="0 0 24 24" aria-hidden="true">
32
+ ${checkMark}
33
+ </svg>`
34
+ : nothing}
35
+ `;
28
36
  }
29
37
  }
30
38
  __decorate([
@@ -4,19 +4,20 @@ export default css `
4
4
  ${component}
5
5
 
6
6
  :host {
7
- --select-option-font-size: var(--coras-font-size-base);
8
- --select-option-line-height: var(--coras-font-size-2xl);
7
+ --select-option-font-size: var(--coras-font-size-sm);
8
+ --select-option-line-height: 1.25rem;
9
9
  --select-option-color: var(--coras-color-text);
10
10
  --select-option-hovered-background-color: var(--coras-color-menu-hover);
11
- --select-option-selected-background-color: var(--coras-color-menu-hover);
11
+ --select-option-selected-background-color: var(--coras-color-neutral-200);
12
12
  --select-option-check-mark-color: var(--coras-color-primary);
13
13
 
14
- --check-mark-size: 12px;
14
+ --check-mark-size: 24px;
15
+ --check-mark-inset: 34px;
15
16
 
16
17
  display: inline-flex;
17
18
  flex-direction: row;
18
19
  flex-wrap: nowrap;
19
- gap: 8px;
20
+ gap: 12px;
20
21
  justify-content: flex-start;
21
22
  align-items: center;
22
23
  padding: var(--select-option-padding-y) var(--select-option-padding-x);
@@ -24,12 +25,22 @@ export default css `
24
25
  position: relative;
25
26
  font-size: var(--select-option-font-size);
26
27
  line-height: var(--select-option-line-height);
28
+ letter-spacing: 0.2px;
27
29
  color: var(--select-option-color);
28
30
  padding-inline-end: calc(
29
- var(--select-option-padding-x) + var(--check-mark-size)
31
+ var(--check-mark-inset) + var(--check-mark-size) + 12px
30
32
  );
31
33
  }
32
34
 
35
+ ::slotted(coras-flag-icon) {
36
+ width: 1rem;
37
+ }
38
+
39
+ ::slotted(strong) {
40
+ font-weight: var(--coras-font-weight-semibold);
41
+ letter-spacing: 0.4px;
42
+ }
43
+
33
44
  :host(:hover) {
34
45
  background-color: var(--select-option-hovered-background-color);
35
46
  }
@@ -42,11 +53,11 @@ export default css `
42
53
  background-color: var(--select-option-selected-background-color);
43
54
  }
44
55
 
45
- :host([selected])::after {
46
- content: "✓";
56
+ .check-mark {
47
57
  position: absolute;
48
- right: 0;
49
- color: var(--select-option-check-mark-color);
50
- padding-inline-end: var(--select-option-padding-x);
58
+ inset-inline-end: var(--check-mark-inset);
59
+ width: var(--check-mark-size);
60
+ height: var(--check-mark-size);
61
+ fill: var(--select-option-check-mark-color);
51
62
  }
52
63
  `;
@@ -36,6 +36,8 @@ class ScrollLockManager {
36
36
  position: document.body.style.position,
37
37
  top: document.body.style.top,
38
38
  width: document.body.style.width,
39
+ height: document.body.style.height,
40
+ minHeight: document.body.style.minHeight,
39
41
  htmlOverflow: document.documentElement.style.overflow,
40
42
  };
41
43
  }
@@ -46,6 +48,10 @@ class ScrollLockManager {
46
48
  document.body.style.position = "fixed";
47
49
  document.body.style.top = `-${this._scrollY}px`;
48
50
  document.body.style.width = "100%";
51
+ // Hosts often set `body { height: 100% }`; fixed and overflow-hidden, that
52
+ // clips everything past the first viewport once the page is scrolled.
53
+ document.body.style.height = "auto";
54
+ document.body.style.minHeight = "100%";
49
55
  }
50
56
  /**
51
57
  * Release a scroll lock. Only restores original body styles and
@@ -111,6 +117,8 @@ class ScrollLockManager {
111
117
  document.body.style.position = this._savedState.position;
112
118
  document.body.style.top = this._savedState.top;
113
119
  document.body.style.width = this._savedState.width;
120
+ document.body.style.height = this._savedState.height;
121
+ document.body.style.minHeight = this._savedState.minHeight;
114
122
  const scrollY = this._scrollY;
115
123
  this._savedState = null;
116
124
  this._scrollY = 0;
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
23
- "version": "0.6.9",
23
+ "version": "0.6.10",
24
24
  "private": false,
25
25
  "homepage": "https://docs.coras.io",
26
26
  "bugs": {