@sankhyatronics/sankhya-cms 0.1.14 → 0.1.15

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.
@@ -6671,6 +6671,64 @@
6671
6671
  }
6672
6672
  }
6673
6673
  ]
6674
+ },
6675
+ {
6676
+ "kind": "javascript-module",
6677
+ "path": "src/tooltip/Tooltip.ts",
6678
+ "declarations": [
6679
+ {
6680
+ "kind": "class",
6681
+ "description": "A small label that shows above a control on hover and on keyboard focus. Wrap the control (a button\nor an icon button) in it and pass the same words as its accessible name in `text`. The bubble is\ndecorative (`aria-hidden`): the control's own `aria-label` is what a screen reader announces, so the\nwords aren't read twice.\n\nThe bubble is positioned by the wrapper, so put the tooltip where it has room above: it's not\nclipped by the wrapper's own box, but it is clipped by an ancestor with `overflow: hidden`.",
6682
+ "name": "Tooltip",
6683
+ "members": [
6684
+ {
6685
+ "kind": "field",
6686
+ "name": "text",
6687
+ "type": {
6688
+ "text": "string"
6689
+ },
6690
+ "default": "''",
6691
+ "description": "The words shown in the bubble: the same words as the control's accessible name.",
6692
+ "attribute": "text"
6693
+ }
6694
+ ],
6695
+ "attributes": [
6696
+ {
6697
+ "name": "text",
6698
+ "type": {
6699
+ "text": "string"
6700
+ },
6701
+ "default": "''",
6702
+ "description": "The words shown in the bubble: the same words as the control's accessible name.",
6703
+ "fieldName": "text"
6704
+ }
6705
+ ],
6706
+ "superclass": {
6707
+ "name": "LitElement",
6708
+ "package": "lit"
6709
+ },
6710
+ "tagName": "st-tooltip",
6711
+ "customElement": true
6712
+ }
6713
+ ],
6714
+ "exports": [
6715
+ {
6716
+ "kind": "js",
6717
+ "name": "Tooltip",
6718
+ "declaration": {
6719
+ "name": "Tooltip",
6720
+ "module": "src/tooltip/Tooltip.ts"
6721
+ }
6722
+ },
6723
+ {
6724
+ "kind": "custom-element-definition",
6725
+ "name": "st-tooltip",
6726
+ "declaration": {
6727
+ "name": "Tooltip",
6728
+ "module": "src/tooltip/Tooltip.ts"
6729
+ }
6730
+ }
6731
+ ]
6674
6732
  }
6675
6733
  ]
6676
6734
  }
@@ -0,0 +1,68 @@
1
+ import {
2
+ fontFamilyStyles
3
+ } from "./chunk-KMU6ABQF.js";
4
+ import {
5
+ __decorateClass
6
+ } from "./chunk-EUXUH3YW.js";
7
+
8
+ // src/tooltip/Tooltip.ts
9
+ import { LitElement, css, html } from "lit";
10
+ import { customElement, property } from "lit/decorators.js";
11
+ var Tooltip = class extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.text = "";
15
+ }
16
+ render() {
17
+ return html`<slot></slot><span class="bubble" part="bubble" aria-hidden="true">${this.text}</span>`;
18
+ }
19
+ };
20
+ Tooltip.styles = css`
21
+ ${fontFamilyStyles}
22
+
23
+ :host {
24
+ position: relative;
25
+ display: inline-flex;
26
+ }
27
+
28
+ .bubble {
29
+ position: absolute;
30
+ bottom: calc(100% + 6px);
31
+ left: 50%;
32
+ transform: translateX(-50%);
33
+ z-index: 20;
34
+ padding: var(--st-space-4) var(--st-space-8);
35
+ border-radius: var(--st-radius-xs);
36
+ background: var(--st-color-text-strong);
37
+ color: var(--st-color-on-solid);
38
+ font-size: var(--st-text-xs);
39
+ font-weight: var(--st-font-weight-medium);
40
+ line-height: 1.3;
41
+ white-space: nowrap;
42
+ pointer-events: none;
43
+ opacity: 0;
44
+ transition: opacity 0.12s ease;
45
+ }
46
+
47
+ :host(:hover) .bubble,
48
+ :host(:focus-within) .bubble {
49
+ opacity: 1;
50
+ }
51
+
52
+ @media (prefers-reduced-motion: reduce) {
53
+ .bubble {
54
+ transition: none;
55
+ }
56
+ }
57
+ `;
58
+ __decorateClass([
59
+ property({ type: String })
60
+ ], Tooltip.prototype, "text", 2);
61
+ Tooltip = __decorateClass([
62
+ customElement("st-tooltip")
63
+ ], Tooltip);
64
+
65
+ export {
66
+ Tooltip
67
+ };
68
+ //# sourceMappingURL=chunk-HO44NKJ5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tooltip/Tooltip.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/**\n * A small label that shows above a control on hover and on keyboard focus. Wrap the control (a button\n * or an icon button) in it and pass the same words as its accessible name in `text`. The bubble is\n * decorative (`aria-hidden`): the control's own `aria-label` is what a screen reader announces, so the\n * words aren't read twice.\n *\n * The bubble is positioned by the wrapper, so put the tooltip where it has room above: it's not\n * clipped by the wrapper's own box, but it is clipped by an ancestor with `overflow: hidden`.\n */\n@customElement('st-tooltip')\nexport class Tooltip extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n position: relative;\n display: inline-flex;\n }\n\n .bubble {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 20;\n padding: var(--st-space-4) var(--st-space-8);\n border-radius: var(--st-radius-xs);\n background: var(--st-color-text-strong);\n color: var(--st-color-on-solid);\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.12s ease;\n }\n\n :host(:hover) .bubble,\n :host(:focus-within) .bubble {\n opacity: 1;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n }\n `;\n\n /** The words shown in the bubble: the same words as the control's accessible name. */\n @property({ type: String })\n text = '';\n\n render() {\n return html`<slot></slot><span class=\"bubble\" part=\"bubble\" aria-hidden=\"true\">${this.text}</span>`;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAcjC,IAAM,UAAN,cAAsB,WAAW;AAAA,EAAjC;AAAA;AA0CL,gBAAO;AAAA;AAAA,EAEP,SAAS;AACP,WAAO,0EAA0E,KAAK,IAAI;AAAA,EAC5F;AACF;AA/Ca,QACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCpB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAzCf,QA0CX;AA1CW,UAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
package/dist/index.d.ts CHANGED
@@ -27,4 +27,5 @@ export { SegmentChangeEventDetail, SegmentedControl, SegmentedOption } from './s
27
27
  export { Select, SelectChangedEventDetail, SelectOption } from './select/index.js';
28
28
  export { StatItem, Stats } from './stats/index.js';
29
29
  export { TestimonialItem, TestimonialMetric, Testimonials, TestimonialsLinkEventDetail } from './testimonials/index.js';
30
+ export { Tooltip } from './tooltip/index.js';
30
31
  import 'lit';
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  Testimonials
3
3
  } from "./chunk-DH53HZPB.js";
4
+ import {
5
+ Tooltip
6
+ } from "./chunk-HO44NKJ5.js";
4
7
  import {
5
8
  PromoBanner
6
9
  } from "./chunk-VWS53WY4.js";
@@ -124,6 +127,7 @@ export {
124
127
  SegmentedControl,
125
128
  Select,
126
129
  Stats,
127
- Testimonials
130
+ Testimonials,
131
+ Tooltip
128
132
  };
129
133
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,20 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+
4
+ /**
5
+ * A small label that shows above a control on hover and on keyboard focus. Wrap the control (a button
6
+ * or an icon button) in it and pass the same words as its accessible name in `text`. The bubble is
7
+ * decorative (`aria-hidden`): the control's own `aria-label` is what a screen reader announces, so the
8
+ * words aren't read twice.
9
+ *
10
+ * The bubble is positioned by the wrapper, so put the tooltip where it has room above: it's not
11
+ * clipped by the wrapper's own box, but it is clipped by an ancestor with `overflow: hidden`.
12
+ */
13
+ declare class Tooltip extends LitElement {
14
+ static styles: lit.CSSResult;
15
+ /** The words shown in the bubble: the same words as the control's accessible name. */
16
+ text: string;
17
+ render(): lit.TemplateResult<1>;
18
+ }
19
+
20
+ export { Tooltip };
@@ -0,0 +1,9 @@
1
+ import {
2
+ Tooltip
3
+ } from "../chunk-HO44NKJ5.js";
4
+ import "../chunk-KMU6ABQF.js";
5
+ import "../chunk-EUXUH3YW.js";
6
+ export {
7
+ Tooltip
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyatronics/sankhya-cms",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sankhyatronics/SankhyaCMS.git",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/bento-grid/index.d.ts",
25
25
  "import": "./dist/bento-grid/index.js"
26
26
  },
27
+ "./tooltip": {
28
+ "types": "./dist/tooltip/index.d.ts",
29
+ "import": "./dist/tooltip/index.js"
30
+ },
27
31
  "./card": {
28
32
  "types": "./dist/card/index.d.ts",
29
33
  "import": "./dist/card/index.js"
@@ -177,7 +181,7 @@
177
181
  "access": "public"
178
182
  },
179
183
  "scripts": {
180
- "build": "tsup src/index.ts src/schema/index.ts src/theming/index.ts src/shared/styles.ts src/shared/icons.ts src/attention-panel/index.ts src/bar-chart/index.ts src/chip/index.ts src/date-tile/index.ts src/kpi-card/index.ts src/segmented-control/index.ts src/bento-grid/index.ts src/card/index.ts src/carousel/index.ts src/content-block/index.ts src/cookie-consent/index.ts src/dropdown/index.ts src/feature-split/index.ts src/features-section/index.ts src/footer/index.ts src/header/index.ts src/hero/index.ts src/icon-button/index.ts src/items-accordion/index.ts src/markdown/index.ts src/mega-menu/index.ts src/menu-grid/index.ts src/menu-grid-item/index.ts src/menu-item/index.ts src/promo-banner/index.ts src/section/index.ts src/select/index.ts src/stats/index.ts src/testimonials/index.ts --format esm --dts --sourcemap --clean && node scripts/copy-theme.mjs && node scripts/copy-fonts.mjs && cem analyze",
184
+ "build": "tsup src/index.ts src/schema/index.ts src/theming/index.ts src/shared/styles.ts src/shared/icons.ts src/attention-panel/index.ts src/bar-chart/index.ts src/chip/index.ts src/date-tile/index.ts src/kpi-card/index.ts src/segmented-control/index.ts src/tooltip/index.ts src/bento-grid/index.ts src/card/index.ts src/carousel/index.ts src/content-block/index.ts src/cookie-consent/index.ts src/dropdown/index.ts src/feature-split/index.ts src/features-section/index.ts src/footer/index.ts src/header/index.ts src/hero/index.ts src/icon-button/index.ts src/items-accordion/index.ts src/markdown/index.ts src/mega-menu/index.ts src/menu-grid/index.ts src/menu-grid-item/index.ts src/menu-item/index.ts src/promo-banner/index.ts src/section/index.ts src/select/index.ts src/stats/index.ts src/testimonials/index.ts --format esm --dts --sourcemap --clean && node scripts/copy-theme.mjs && node scripts/copy-fonts.mjs && cem analyze",
181
185
  "dev": "tsup src/index.ts --watch --format esm --dts",
182
186
  "typecheck": "tsc --noEmit",
183
187
  "lint": "oxlint",