@coras-io/embed 0.6.9 → 0.6.11

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,18 @@
1
1
  # @coras-io/embed
2
2
 
3
+ ## 0.6.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 579e6da: Align navbar search result icons with the first line of the title and give the search field the standard clear icon
8
+
9
+ ## 0.6.10
10
+
11
+ ### Patch Changes
12
+
13
+ - d3cb2f2: Keep the page visible behind drawers and dialogs opened after scrolling, on hosts that set the body height to 100%
14
+ - 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
15
+
3
16
  ## 0.6.9
4
17
 
5
18
  ### Patch Changes
@@ -116,6 +116,7 @@ let CorasInputField = class CorasInputField extends LitElement {
116
116
  class="${classMap({
117
117
  error: this.validated && this.error,
118
118
  compact: this.compact,
119
+ clearable: this.clearable,
119
120
  })}"
120
121
  />`;
121
122
  }
@@ -201,6 +201,10 @@ export default css `
201
201
  }
202
202
  }
203
203
 
204
+ input.clearable::-webkit-search-cancel-button {
205
+ display: none;
206
+ }
207
+
204
208
  input,
205
209
  ::slotted(#input) {
206
210
  height: var(--field-input-height);
@@ -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
  `;
@@ -404,6 +404,7 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
404
404
  value=${this.searchValue}
405
405
  ?rounded=${true}
406
406
  ?compact=${true}
407
+ clearable
407
408
  @click=${this.toggleSearchDropdown}
408
409
  @value-changed=${this.handleSearchInputChange}
409
410
  >
@@ -492,7 +493,7 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
492
493
  }
493
494
  renderSearchResults() {
494
495
  return html `
495
- <coras-select-list ?spacious=${true}>
496
+ <coras-select-list class="search-results" ?spacious=${true}>
496
497
  ${this.renderSearchItems()}
497
498
  </coras-select-list>
498
499
  `;
@@ -529,7 +530,11 @@ let CorasNavBar = class CorasNavBar extends SearchMixin(LitElement) {
529
530
  }
530
531
  renderMobileSearchResults() {
531
532
  return html `
532
- <coras-select-list data-testid="mobile-search-list" ?spacious=${true}>
533
+ <coras-select-list
534
+ class="search-results"
535
+ data-testid="mobile-search-list"
536
+ ?spacious=${true}
537
+ >
533
538
  ${this.renderSearchItems()}
534
539
  </coras-select-list>
535
540
  `;
@@ -63,6 +63,10 @@ export default css `
63
63
  --field-prefix-icon-color: var(--navbar-icon-color);
64
64
  }
65
65
 
66
+ .search-results coras-select-option > coras-icon {
67
+ align-self: flex-start;
68
+ }
69
+
66
70
  coras-search-button {
67
71
  --search-button-color: var(--coras-color-text);
68
72
  --search-button-icon-color: var(--navbar-icon-color);
@@ -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.11",
24
24
  "private": false,
25
25
  "homepage": "https://docs.coras.io",
26
26
  "bugs": {