@alegendstale/holly-components 0.2.35 → 0.2.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tool-tip.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,MAAM,YAAY,GACtB,OAAO,GACP,OAAO,GACP,QAAQ,CAAA;AAEV,eAAO,MAAM,MAAM,yBAmDlB,CAAA;AAED,qBACa,OAAQ,SAAQ,UAAU;IACtC,MAAM,CAAC,MAAM,0BAAU;IAGvB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAG9B,OAAO,UAAS;IAGhB,OAAO,EAAE,YAAY,CAAY;IAGjC,IAAI,SAAM;IAEV,MAAM;IAYN;;OAEG;IACH,aAAa,GAAI,KAAK;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,OAAO;;;MAsB7D;IAEK,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAIpD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM;CAInC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
1
+ {"version":3,"file":"tool-tip.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,MAAM,YAAY,GACtB,OAAO,GACP,OAAO,GACP,QAAQ,CAAA;AAEV,eAAO,MAAM,MAAM,yBAwDlB,CAAA;AAED,qBACa,OAAQ,SAAQ,UAAU;IACtC,MAAM,CAAC,MAAM,0BAAU;IAGvB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAG9B,OAAO,UAAS;IAGhB,OAAO,EAAE,YAAY,CAAY;IAGjC,IAAI,SAAM;IAEV,MAAM;IAYN;;OAEG;IACH,aAAa,GAAI,KAAK;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,OAAO;;;MAsB7D;IAEK,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAIpD,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM;CAInC;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
@@ -25,6 +25,11 @@ export const styles = css `
25
25
  display: flex;
26
26
  }
27
27
 
28
+ /* Use ID to force display none when there is no text */
29
+ :host([text=""]) #tip {
30
+ display: none;
31
+ }
32
+
28
33
  p {
29
34
  display: none;
30
35
  align-items: center;
@@ -99,7 +104,7 @@ let ToolTip = class ToolTip extends LitElement {
99
104
  @click=${() => this.trigger === 'click' ? this.display = !this.display : null}
100
105
  >
101
106
  </slot>
102
- <p>
107
+ <p id="tip">
103
108
  ${this.text}
104
109
  </p>
105
110
  `;
@@ -120,10 +125,10 @@ __decorate([
120
125
  property({ type: Boolean, reflect: true })
121
126
  ], ToolTip.prototype, "display", void 0);
122
127
  __decorate([
123
- property({ type: String })
128
+ property({ type: String, reflect: true })
124
129
  ], ToolTip.prototype, "trigger", void 0);
125
130
  __decorate([
126
- property({ type: String })
131
+ property({ type: String, reflect: true })
127
132
  ], ToolTip.prototype, "text", void 0);
128
133
  ToolTip = __decorate([
129
134
  condCustomElement('tool-tip')
@@ -3,7 +3,7 @@ import { TriggerTypes } from './tool-tip.js';
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
5
  type Props = {
6
- content: string;
6
+ text: string;
7
7
  trigger: TriggerTypes;
8
8
  };
9
9
  type Story = StoryObj<Props>;
@@ -1 +1 @@
1
- {"version":3,"file":"tool-tip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAExD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAY7B,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
1
+ {"version":3,"file":"tool-tip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/tool-tip/tool-tip.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAErD,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAY7B,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
@@ -6,9 +6,9 @@ const meta = {
6
6
  };
7
7
  export default meta;
8
8
  const Template = {
9
- render: ({ content, trigger }) => {
9
+ render: ({ text, trigger }) => {
10
10
  return html `
11
- <tool-tip content=${content} trigger=${trigger}>
11
+ <tool-tip text=${text} trigger=${trigger}>
12
12
  <button>${trigger} me</button>
13
13
  </tool-tip>
14
14
  `;
@@ -17,14 +17,14 @@ const Template = {
17
17
  export const Hover = {
18
18
  ...Template,
19
19
  args: {
20
- content: 'hovered tooltip',
20
+ text: 'hovered tooltip',
21
21
  trigger: 'hover'
22
22
  }
23
23
  };
24
24
  export const Click = {
25
25
  ...Template,
26
26
  args: {
27
- content: 'clicked tooltip',
27
+ text: 'clicked tooltip',
28
28
  trigger: 'click'
29
29
  }
30
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"condCustomElement.d.ts","sourceRoot":"","sources":["../../src/decorators/condCustomElement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEtC,KAAK,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAErD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,IAChC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,OAMjE"}
1
+ {"version":3,"file":"condCustomElement.d.ts","sourceRoot":"","sources":["../../src/decorators/condCustomElement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEtC,KAAK,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAErD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,IAChC,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,OAIjE"}
@@ -7,8 +7,6 @@ export function condCustomElement(tagName) {
7
7
  return function (constructor) {
8
8
  if (!customElements.get(tagName))
9
9
  litCustomElement(tagName)(constructor);
10
- else
11
- console.warn(`Custom element ${tagName} is already defined.`);
12
10
  return constructor;
13
11
  };
14
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "private": false,
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "name": "@alegendstale/holly-components",
5
5
  "description": "Reusable UI components created using lit",
6
6
  "type": "module",