Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/tooltip

Package Overview
Dependencies
Maintainers
5
Versions
346
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/tooltip - npm Package Compare versions

Comparing version 0.3.9 to 0.3.10

src/spectrum-vars.json

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Change Log

## [0.3.10](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/tooltip@0.3.9...@spectrum-web-components/tooltip@0.3.10) (2020-06-08)
**Note:** Version bump only for package @spectrum-web-components/tooltip
## [0.3.9](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/tooltip@0.3.8...@spectrum-web-components/tooltip@0.3.9) (2020-05-08)

@@ -8,0 +12,0 @@

44

custom-elements.json

@@ -1,43 +0,1 @@

{
"version": "experimental",
"tags": [
{
"name": "sp-tooltip",
"path": "./src/index.ts",
"attributes": [
{
"name": "placement",
"type": "Placement",
"default": "\"top\""
},
{
"name": "variant",
"type": "string"
}
],
"properties": [
{
"name": "placement",
"attribute": "placement",
"type": "Placement",
"default": "\"top\""
},
{
"name": "variant",
"attribute": "variant",
"type": "string"
}
],
"slots": [
{
"name": "icon",
"description": "The icon that appears on the left of the label"
},
{
"name": "",
"description": "The label"
}
]
}
]
}
{"version":"experimental","tags":[{"name":"sp-tooltip","path":"./src/index.ts","attributes":[{"name":"placement","type":"Placement","default":"\"top\""},{"name":"variant","type":"string"}],"properties":[{"name":"placement","attribute":"placement","type":"Placement","default":"\"top\""},{"name":"variant","attribute":"variant","type":"string"}],"slots":[{"name":"icon","description":"The icon that appears on the left of the label"},{"name":"","description":"The label"}],"cssProperties":[{"name":"--spectrum-dropdown-flyout-menu-offset-y","default":"var(--spectrum-global-dimension-size-75)","type":""},{"name":"--spectrum-tooltip-padding-top","default":"var(--spectrum-global-dimension-size-50)","type":""},{"name":"--spectrum-tooltip-padding-x","default":"var(--spectrum-global-dimension-size-125)","type":""},{"name":"--spectrum-tooltip-border-radius","default":"var(--spectrum-global-dimension-size-50)","type":""},{"name":"--spectrum-tooltip-min-height","default":"var(--spectrum-global-dimension-size-300)","type":""},{"name":"--spectrum-tooltip-text-size","default":"var(--spectrum-global-dimension-font-size-75)","type":""},{"name":"--spectrum-tooltip-text-font-weight","default":"var(--spectrum-global-font-weight-regular)","type":""},{"name":"--spectrum-tooltip-text-line-height","default":"var(--spectrum-global-dimension-font-size-200)","type":""},{"name":"--spectrum-tooltip-tip-height","default":"var(--spectrum-global-dimension-size-50)","type":""},{"name":"--spectrum-tooltip-icon-margin-x","default":"var(--spectrum-global-dimension-size-100)","type":""},{"name":"--spectrum-tooltip-icon-size","default":"var(--spectrum-global-dimension-size-175)","type":""},{"name":"--spectrum-tooltip-content-max-width","default":"undefined","type":""},{"name":"--spectrum-tooltip-tip-margin","default":"var(--spectrum-global-dimension-size-50)","type":""},{"name":"--spectrum-tooltip-background-color","default":"var(--spectrum-global-color-static-gray-700)","type":""},{"name":"--spectrum-tooltip-text-color","default":"var(--spectrum-global-color-static-white)","type":""},{"name":"--spectrum-tooltip-negative-background-color","default":"var(--spectrum-global-color-static-red-700)","type":""},{"name":"--spectrum-tooltip-info-background-color","default":"var(--spectrum-global-color-static-blue-700)","type":""},{"name":"--spectrum-tooltip-positive-background-color","default":"var(--spectrum-global-color-static-green-700)","type":""}]}]}

@@ -19,50 +19,51 @@ /*

*/
export class Tooltip extends LitElement {
constructor() {
super(...arguments);
this.placement = 'top';
/* Ensure that a '' value for `variant` removes the attribute instead of a blank value */
this._variant = '';
}
static get styles() {
return [tooltipStyles];
}
get variant() {
return this._variant;
}
set variant(variant) {
if (variant === this.variant) {
return;
let Tooltip = /** @class */ (() => {
class Tooltip extends LitElement {
constructor() {
super(...arguments);
this.placement = 'top';
/* Ensure that a '' value for `variant` removes the attribute instead of a blank value */
this._variant = '';
}
if (['info', 'positive', 'negative'].includes(variant)) {
this.setAttribute('variant', variant);
this._variant = variant;
return;
static get styles() {
return [tooltipStyles];
}
this.removeAttribute('variant');
this._variant = '';
}
connectedCallback() {
super.connectedCallback();
this.addEventListener('sp-overlay-query', this.onOverlyQuery);
}
disconnectedCallback() {
super.disconnectedCallback();
this.removeEventListener('sp-overlay-query', this.onOverlyQuery);
}
onOverlyQuery(event) {
/* istanbul ignore if */
if (!event.target || !this.shadowRoot)
return;
const target = event.target;
/* istanbul ignore if */
if (!target.isSameNode(this))
return;
const tipElement = this.shadowRoot.querySelector('#tip');
if (tipElement) {
event.detail.overlayContentTipElement = tipElement;
get variant() {
return this._variant;
}
}
render() {
return html `
set variant(variant) {
if (variant === this.variant) {
return;
}
if (['info', 'positive', 'negative'].includes(variant)) {
this.setAttribute('variant', variant);
this._variant = variant;
return;
}
this.removeAttribute('variant');
this._variant = '';
}
connectedCallback() {
super.connectedCallback();
this.addEventListener('sp-overlay-query', this.onOverlyQuery);
}
disconnectedCallback() {
super.disconnectedCallback();
this.removeEventListener('sp-overlay-query', this.onOverlyQuery);
}
onOverlyQuery(event) {
/* istanbul ignore if */
if (!event.target || !this.shadowRoot)
return;
const target = event.target;
/* istanbul ignore if */
if (!target.isSameNode(this))
return;
const tipElement = this.shadowRoot.querySelector('#tip');
if (tipElement) {
event.detail.overlayContentTipElement = tipElement;
}
}
render() {
return html `
<slot name="icon"></slot>

@@ -72,10 +73,13 @@ <span id="label"><slot></slot></span>

`;
}
}
}
__decorate([
property({ reflect: true })
], Tooltip.prototype, "placement", void 0);
__decorate([
property({ type: String })
], Tooltip.prototype, "variant", null);
__decorate([
property({ reflect: true })
], Tooltip.prototype, "placement", void 0);
__decorate([
property({ type: String })
], Tooltip.prototype, "variant", null);
return Tooltip;
})();
export { Tooltip };
//# sourceMappingURL=tooltip.js.map

@@ -21,3 +21,3 @@ {

],
"version": "0.3.9",
"version": "0.3.10",
"description": "",

@@ -46,6 +46,6 @@ "main": "lib/index.js",

"dependencies": {
"@spectrum-web-components/overlay": "^0.3.7",
"tslib": "^1.10.0"
"@spectrum-web-components/overlay": "^0.3.8",
"tslib": "^2.0.0"
},
"gitHead": "1f8f11ef9dfb81e9b2ad7998fcc2955b331440ab"
"gitHead": "16b57d15356859cee73278cdf796274e3245320b"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc