@neovici/cosmoz-dropdown 1.5.2 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-dropdown",
3
- "version": "1.5.2",
3
+ "version": "1.7.0",
4
4
  "description": "A simple dropdown web component",
5
5
  "keywords": [
6
6
  "lit-html",
@@ -76,5 +76,9 @@
76
76
  "semantic-release": "^18.0.0",
77
77
  "sinon": "^11.0.0",
78
78
  "typescript": "^4.0.0"
79
+ },
80
+ "exports": {
81
+ "./use-position": "./src/use-position.js",
82
+ "./use-focus": "./src/use-focus.js"
79
83
  }
80
84
  }
@@ -57,12 +57,15 @@ const preventDefault = e => e.preventDefault(),
57
57
  }
58
58
  </style>
59
59
  <div class="anchor" part="anchor">
60
- <button @click=${ onToggle } @mousedown=${ preventDefault } part="button">
60
+ <button @click=${ onToggle } @mousedown=${ preventDefault } part="button" id="dropdownButton">
61
61
  <slot name="button">...</slot>
62
62
  </button>
63
63
  </div>
64
64
  ${ active && html`
65
- <cosmoz-dropdown-content id="dropdown" part="dropdown" .anchor=${ anchor } .placement=${ placement } .render=${ render }>
65
+ <cosmoz-dropdown-content
66
+ id="dropdown" part="dropdown" exportparts="content: dropdown-content"
67
+ .anchor=${ anchor } .placement=${ placement } .render=${ render }
68
+ >
66
69
  <slot></slot>
67
70
  </cosmoz-dropdown-content>` || [] }
68
71
  `;
@@ -86,6 +89,7 @@ const preventDefault = e => e.preventDefault(),
86
89
  margin: 0;
87
90
  width: 100%;
88
91
  }
92
+
89
93
  ::slotted(:not(slot):hover) {
90
94
  background: var(--cosmoz-dropdown-menu-hover-color, var(--cosmoz-selection-color, rgba(58, 145, 226, 0.1)));
91
95
  }
@@ -98,7 +102,9 @@ const preventDefault = e => e.preventDefault(),
98
102
  <slot></slot>
99
103
  `,
100
104
  Menu = host => html`
101
- <cosmoz-dropdown .placement=${ host.placement }>
105
+ <cosmoz-dropdown .placement=${ host.placement }
106
+ part="dropdown"
107
+ exportparts=${ ['anchor', 'button', 'dropdown'].map(p => `${ p }: dropdown-${ p }`).concat(['dropdown-content']).join(', ') }>
102
108
  <slot name="button" slot="button"></slot>
103
109
  <cosmoz-dropdown-list><slot></slot></cosmoz-dropdown-list>
104
110
  </cosmoz-dropdown>`;
package/src/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './cosmoz-dropdown';
2
2
  export * from './use-focus';
3
3
  export * from './use-position';
4
-