@sula-tech/webcomponents 0.19.0 → 0.19.2
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sula-avatar_31.cjs.entry.js +111 -26
- package/dist/cjs/sula-avatar_31.cjs.entry.js.map +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/sula-button/sula-button.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-loader/sula-loader.css +1 -1
- package/dist/collection/components/sula-modal/sula-modal.css +1 -1
- package/dist/collection/components/sula-modal/sula-modal.js +12 -14
- package/dist/collection/components/sula-modal/sula-modal.js.map +1 -1
- package/dist/collection/components/sula-tooltip/sula-tooltip.css +1 -1
- package/dist/collection/components/sula-tooltip/sula-tooltip.js +119 -8
- package/dist/collection/components/sula-tooltip/sula-tooltip.js.map +1 -1
- package/dist/collection/components/sula-tooltip/sula-tooltip.stories.js +61 -0
- package/dist/collection/components/sula-tooltip/sula-tooltip.stories.js.map +1 -1
- package/dist/components/{p-vdVrreA-.js → p-BJQZqrGi.js} +3 -3
- package/dist/components/{p-vdVrreA-.js.map → p-BJQZqrGi.js.map} +1 -1
- package/dist/components/{p-CG6rVCq1.js → p-Bqd5Y-Ir.js} +4 -4
- package/dist/components/{p-CG6rVCq1.js.map → p-Bqd5Y-Ir.js.map} +1 -1
- package/dist/components/{p-BEtH6u_y.js → p-CelSwSJG.js} +3 -3
- package/dist/components/{p-BEtH6u_y.js.map → p-CelSwSJG.js.map} +1 -1
- package/dist/components/{p-BprGc1mx.js → p-D1tWu3qb.js} +5 -5
- package/dist/components/{p-BprGc1mx.js.map → p-D1tWu3qb.js.map} +1 -1
- package/dist/components/{p-CHiD_aPj.js → p-bHiC51v2.js} +3 -3
- package/dist/components/{p-CHiD_aPj.js.map → p-bHiC51v2.js.map} +1 -1
- package/dist/components/{p-j4OD7u7J.js → p-f7rEWsEo.js} +3 -3
- package/dist/components/{p-j4OD7u7J.js.map → p-f7rEWsEo.js.map} +1 -1
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-breadcrumb.js +1 -1
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-checkbox.js +1 -1
- package/dist/components/sula-chip.js +2 -2
- package/dist/components/sula-dropdown.js +1 -1
- package/dist/components/sula-icon-picker.js +4 -4
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-menu-select-list.js +1 -1
- package/dist/components/sula-menu.js +1 -1
- package/dist/components/sula-modal.js +16 -18
- package/dist/components/sula-modal.js.map +1 -1
- package/dist/components/sula-progress-bar.js +1 -1
- package/dist/components/sula-search-bar.js +1 -1
- package/dist/components/sula-segmented-control.js +1 -1
- package/dist/components/sula-tag.js +1 -1
- package/dist/components/sula-textfield.js +1 -1
- package/dist/components/sula-tiles.js +1 -1
- package/dist/components/sula-timeline-list.js +1 -1
- package/dist/components/sula-toggle.js +1 -1
- package/dist/components/sula-tooltip.js +99 -9
- package/dist/components/sula-tooltip.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sula-avatar_31.entry.js +111 -26
- package/dist/esm/sula-avatar_31.entry.js.map +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-modal/sula-modal.d.ts +1 -0
- package/dist/types/components/sula-tooltip/sula-tooltip.d.ts +26 -0
- package/dist/types/components/sula-tooltip/sula-tooltip.stories.d.ts +22 -0
- package/dist/types/components.d.ts +12 -0
- package/dist/webcomponents/{p-ee42c8f9.entry.js → p-c2f9f164.entry.js} +117 -32
- package/dist/webcomponents/p-c2f9f164.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +4 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-ee42c8f9.entry.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './p-Cy4ZswbA.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-bHiC51v2.js';
|
|
3
3
|
|
|
4
4
|
var top = 'top';
|
|
5
5
|
var bottom = 'bottom';
|
|
@@ -1803,7 +1803,7 @@ var SulaTooltipTrigger;
|
|
|
1803
1803
|
SulaTooltipTrigger["Parent"] = "parent";
|
|
1804
1804
|
})(SulaTooltipTrigger || (SulaTooltipTrigger = {}));
|
|
1805
1805
|
|
|
1806
|
-
const sulaTooltipCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{font-family:Figtree;line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.absolute{position:absolute}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host,:host button,:host input,:host option,:host select,:host textarea{font-family:Figtree,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.tooltip-arrow,.tooltip-arrow:before{height:8px;position:absolute;width:8px}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{background:var(--color-neutral-neutral-8);content:\"\";transform:rotate(45deg);visibility:visible}.hint-bubble[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.hint-bubble[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.hint-bubble[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.hint-bubble[data-popper-placement^=right]>.tooltip-arrow{left:-4px}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:300;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Light.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:300;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-LightItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:400;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Regular.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:400;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Italic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:500;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Medium.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:500;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-MediumItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:600;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:600;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:700;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Bold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:700;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:800;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:800;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:900;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Black.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:900;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BlackItalic.ttf) format(\"truetype\")}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.z-50{z-index:50}.box-border{box-sizing:border-box}.inline-block{display:inline-block}.flex{display:flex}.h-\\[22px\\]{height:22px}.h-full{height:100%}.w-\\[22px\\]{width:22px}.w-full{width:100%}.max-w-\\[200px\\]{max-width:200px}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-visible{overflow:visible}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-solid{border-style:solid}.border-feedback-informational{border-color:var(--color-feedback-informational)}.border-transparent{border-color:transparent}.bg-neutral-neutral-8{background-color:var(--color-neutral-neutral-8)}.bg-transparent{background-color:transparent}.px-12{padding-left:.75rem;padding-right:.75rem}.py-8{padding-bottom:.5rem;padding-top:.5rem}.text-\\[18px\\]{font-size:18px}.text-sm{font-size:.875rem;line-height:1.25rem}.leading-\\[0\\]{line-height:0}.leading-none{line-height:1}.leading-normal{line-height:1.5}.text-icon-primary{color:var(--color-icon-primary)}.text-neutral-neutral-1{color:var(--color-neutral-neutral-1)}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-\\[0_4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.24\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.24\\)\\]{--tw-shadow:0 4px 16px rgba(0,0,0,.24);--tw-shadow-colored:0 4px 16px var(--tw-shadow-color)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}";
|
|
1806
|
+
const sulaTooltipCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{font-family:Figtree;line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.border{border-width:1px}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}:host,:host button,:host input,:host option,:host select,:host textarea{font-family:Figtree,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.tooltip-trigger{align-items:center;background:transparent;cursor:pointer;display:inline-flex;justify-content:center;line-height:0;position:relative}.tooltip-trigger:before{border:1px solid transparent;border-radius:9999px;box-sizing:border-box;content:\"\";inset:-2px;pointer-events:none;position:absolute;transition:border-color .2s ease}.tooltip-trigger.is-focused:before{border-color:var(--color-feedback-informational)}.tooltip-arrow,.tooltip-arrow:before{height:8px;position:absolute;width:8px}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{background:var(--color-neutral-neutral-8);content:\"\";transform:rotate(45deg);visibility:visible}.hint-bubble[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.hint-bubble[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.hint-bubble[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.hint-bubble[data-popper-placement^=right]>.tooltip-arrow{left:-4px}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:300;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Light.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:300;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-LightItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:400;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Regular.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:400;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Italic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:500;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Medium.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:500;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-MediumItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:600;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:600;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-SemiBoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:700;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Bold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:700;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:800;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBold.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:800;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-ExtraBoldItalic.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:normal;font-weight:900;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-Black.ttf) format(\"truetype\")}@font-face{font-display:swap;font-family:Figtree;font-style:italic;font-weight:900;src:local(\"Figtree\"),url(@sula-tech/tailwind-css-plugin/assets/fonts/Figtree-BlackItalic.ttf) format(\"truetype\")}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-50{z-index:50}.inline-block{display:inline-block}.flex{display:flex}.max-w-\\[200px\\]{max-width:200px}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.bg-neutral-neutral-8{background-color:var(--color-neutral-neutral-8)}.px-12{padding-left:.75rem;padding-right:.75rem}.py-8{padding-bottom:.5rem;padding-top:.5rem}.text-\\[18px\\]{font-size:18px}.text-sm{font-size:.875rem;line-height:1.25rem}.leading-\\[0\\]{line-height:0}.leading-none{line-height:1}.leading-normal{line-height:1.5}.text-icon-primary{color:var(--color-icon-primary)}.text-neutral-neutral-1{color:var(--color-neutral-neutral-1)}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-\\[0_4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.24\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_16px_rgba\\(0\\2c 0\\2c 0\\2c 0\\.24\\)\\]{--tw-shadow:0 4px 16px rgba(0,0,0,.24);--tw-shadow-colored:0 4px 16px var(--tw-shadow-color)}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.transition-\\[opacity\\2c visibility\\]{transition-duration:.15s;transition-property:opacity,visibility;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.container{width:100%}@media (min-width:22.5rem){.container{max-width:22.5rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}";
|
|
1807
1807
|
|
|
1808
1808
|
const MAX_TEXT_LENGTH = 300;
|
|
1809
1809
|
const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends H {
|
|
@@ -1811,6 +1811,10 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1811
1811
|
super();
|
|
1812
1812
|
this.__registerHost();
|
|
1813
1813
|
this.__attachShadow();
|
|
1814
|
+
/**
|
|
1815
|
+
* Tooltip hint text — max 300 characters
|
|
1816
|
+
*/
|
|
1817
|
+
this.text = '';
|
|
1814
1818
|
/**
|
|
1815
1819
|
* Tooltip position relative to trigger
|
|
1816
1820
|
*/
|
|
@@ -1835,22 +1839,44 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1835
1839
|
* appears on hover of that parent.
|
|
1836
1840
|
*/
|
|
1837
1841
|
this.trigger = SulaTooltipTrigger.Icon;
|
|
1842
|
+
/**
|
|
1843
|
+
* When true, the hint bubble is rendered in a portal appended to
|
|
1844
|
+
* `document.body` instead of staying inside the component's local DOM
|
|
1845
|
+
* subtree. Use this when the tooltip lives inside a container that clips
|
|
1846
|
+
* overflow (e.g. `overflow-x-auto`/`overflow: hidden`, such as `sula-table`
|
|
1847
|
+
* cells) — those ancestors clip `position: fixed` descendants too, so the
|
|
1848
|
+
* bubble can get cut off or hidden behind other elements regardless of the
|
|
1849
|
+
* Popper.js `flip`/`preventOverflow` modifiers.
|
|
1850
|
+
*/
|
|
1851
|
+
this.appendToBody = false;
|
|
1838
1852
|
this.isVisible = false;
|
|
1839
1853
|
this.parentEl = null;
|
|
1840
1854
|
this.hintEl = null;
|
|
1841
1855
|
this.triggerEl = null;
|
|
1842
1856
|
this.arrowEl = null;
|
|
1843
1857
|
this.popperInstance = null;
|
|
1858
|
+
this.portalHost = null;
|
|
1859
|
+
this.portalShadow = null;
|
|
1860
|
+
this.hintTextNode = null;
|
|
1844
1861
|
this.handleMouseEnter = () => {
|
|
1845
1862
|
var _a;
|
|
1846
1863
|
this.isVisible = true;
|
|
1864
|
+
this.syncPortalVisibility();
|
|
1847
1865
|
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
|
|
1848
1866
|
};
|
|
1849
1867
|
this.handleMouseLeave = () => {
|
|
1850
1868
|
this.isVisible = false;
|
|
1869
|
+
this.syncPortalVisibility();
|
|
1851
1870
|
};
|
|
1852
1871
|
}
|
|
1853
1872
|
componentDidLoad() {
|
|
1873
|
+
// Ancestors like sula-table-cell replace their own host element with a
|
|
1874
|
+
// plain <td> synchronously in their own componentDidLoad, which moves
|
|
1875
|
+
// this element in the DOM. Defer setup to the next frame so it runs
|
|
1876
|
+
// after any such ancestor DOM moves have already settled.
|
|
1877
|
+
requestAnimationFrame(() => this.mount());
|
|
1878
|
+
}
|
|
1879
|
+
mount() {
|
|
1854
1880
|
if (this.trigger === SulaTooltipTrigger.Parent) {
|
|
1855
1881
|
this.parentEl = this.el.parentElement;
|
|
1856
1882
|
if (this.parentEl) {
|
|
@@ -1858,6 +1884,9 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1858
1884
|
this.parentEl.addEventListener('mouseleave', this.handleMouseLeave);
|
|
1859
1885
|
}
|
|
1860
1886
|
}
|
|
1887
|
+
if (this.appendToBody) {
|
|
1888
|
+
this.createPortalHint();
|
|
1889
|
+
}
|
|
1861
1890
|
this.initPopper();
|
|
1862
1891
|
}
|
|
1863
1892
|
disconnectedCallback() {
|
|
@@ -1870,6 +1899,60 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1870
1899
|
this.popperInstance.destroy();
|
|
1871
1900
|
this.popperInstance = null;
|
|
1872
1901
|
}
|
|
1902
|
+
this.destroyPortalHint();
|
|
1903
|
+
}
|
|
1904
|
+
handleTextChange() {
|
|
1905
|
+
if (this.hintTextNode) {
|
|
1906
|
+
this.hintTextNode.textContent = this.displayText;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Builds the hint bubble outside of Stencil's own DOM subtree and appends
|
|
1911
|
+
* it to `document.body`, so ancestor containers with `overflow` set can no
|
|
1912
|
+
* longer clip it. The bubble's styles are copied from this component's own
|
|
1913
|
+
* shadow root (adopted stylesheets or `<style>` tags) into a dedicated
|
|
1914
|
+
* shadow root on the portal host to keep styling encapsulated.
|
|
1915
|
+
*/
|
|
1916
|
+
createPortalHint() {
|
|
1917
|
+
if (!this.displayText || this.portalHost)
|
|
1918
|
+
return;
|
|
1919
|
+
this.portalHost = document.createElement('div');
|
|
1920
|
+
this.portalShadow = this.portalHost.attachShadow({ mode: 'open' });
|
|
1921
|
+
this.copyStylesInto(this.portalShadow);
|
|
1922
|
+
this.hintEl = document.createElement('div');
|
|
1923
|
+
this.hintEl.setAttribute('role', 'tooltip');
|
|
1924
|
+
this.hintEl.className = this.getHintClasses();
|
|
1925
|
+
this.hintTextNode = document.createTextNode(this.displayText);
|
|
1926
|
+
this.hintEl.appendChild(this.hintTextNode);
|
|
1927
|
+
this.arrowEl = document.createElement('div');
|
|
1928
|
+
this.arrowEl.className = 'tooltip-arrow';
|
|
1929
|
+
this.arrowEl.setAttribute('data-popper-arrow', '');
|
|
1930
|
+
this.hintEl.appendChild(this.arrowEl);
|
|
1931
|
+
this.portalShadow.appendChild(this.hintEl);
|
|
1932
|
+
document.body.appendChild(this.portalHost);
|
|
1933
|
+
}
|
|
1934
|
+
copyStylesInto(root) {
|
|
1935
|
+
const sourceRoot = this.el.shadowRoot;
|
|
1936
|
+
if (!sourceRoot)
|
|
1937
|
+
return;
|
|
1938
|
+
const adopted = sourceRoot.adoptedStyleSheets;
|
|
1939
|
+
if ((adopted === null || adopted === void 0 ? void 0 : adopted.length) && 'adoptedStyleSheets' in root) {
|
|
1940
|
+
root.adoptedStyleSheets = adopted;
|
|
1941
|
+
}
|
|
1942
|
+
else {
|
|
1943
|
+
sourceRoot.querySelectorAll('style').forEach((style) => root.appendChild(style.cloneNode(true)));
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
destroyPortalHint() {
|
|
1947
|
+
var _a;
|
|
1948
|
+
(_a = this.portalHost) === null || _a === void 0 ? void 0 : _a.remove();
|
|
1949
|
+
this.portalHost = null;
|
|
1950
|
+
this.portalShadow = null;
|
|
1951
|
+
this.hintTextNode = null;
|
|
1952
|
+
if (this.appendToBody) {
|
|
1953
|
+
this.hintEl = null;
|
|
1954
|
+
this.arrowEl = null;
|
|
1955
|
+
}
|
|
1873
1956
|
}
|
|
1874
1957
|
initPopper() {
|
|
1875
1958
|
const reference = this.trigger === SulaTooltipTrigger.Parent ? this.el.parentElement : this.triggerEl;
|
|
@@ -1897,25 +1980,29 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1897
1980
|
: this.text;
|
|
1898
1981
|
}
|
|
1899
1982
|
getIconClasses() {
|
|
1900
|
-
|
|
1901
|
-
const borderColor = this.focused
|
|
1902
|
-
? 'border-feedback-informational'
|
|
1903
|
-
: 'border-transparent';
|
|
1904
|
-
return `${baseClasses} ${borderColor}`;
|
|
1983
|
+
return this.focused ? 'tooltip-trigger is-focused' : 'tooltip-trigger';
|
|
1905
1984
|
}
|
|
1906
1985
|
getHintClasses() {
|
|
1907
1986
|
const baseClasses = 'hint-bubble fixed z-50 px-12 py-8 bg-neutral-neutral-8 text-neutral-neutral-1 text-sm rounded pointer-events-none leading-normal shadow-[0_4px_16px_rgba(0,0,0,0.24)] max-w-[200px] break-words';
|
|
1908
1987
|
const visibilityClasses = this.isVisible ? 'opacity-100 visible' : 'opacity-0 invisible';
|
|
1909
|
-
return `${baseClasses} ${visibilityClasses} transition-opacity duration-200`;
|
|
1988
|
+
return `${baseClasses} ${visibilityClasses} transition-[opacity,visibility] duration-200`;
|
|
1989
|
+
}
|
|
1990
|
+
syncPortalVisibility() {
|
|
1991
|
+
if (this.appendToBody && this.hintEl) {
|
|
1992
|
+
this.hintEl.className = this.getHintClasses();
|
|
1993
|
+
}
|
|
1910
1994
|
}
|
|
1911
1995
|
render() {
|
|
1912
1996
|
const isParentMode = this.trigger === SulaTooltipTrigger.Parent;
|
|
1913
1997
|
const hostClass = isParentMode
|
|
1914
1998
|
? 'absolute inset-0 pointer-events-none overflow-visible'
|
|
1915
1999
|
: 'inline-block relative';
|
|
1916
|
-
return (h(Host, { key: '
|
|
2000
|
+
return (h(Host, { key: '61c4c6e0c47bb8ad3e08d5c7b7f387cd7b731a70', class: hostClass }, !isParentMode && (h("div", { key: '4f9f1fb595e4a8af3c0055dee12b65440b5a898a', class: this.getIconClasses(), onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, role: "button", "aria-label": "Tooltip trigger", ref: (el) => (this.triggerEl = el) }, h("sula-icon", { key: 'e58c0b055e2ac514a46cd9c899e7ac1fa6bac99c', class: "flex leading-[0]", icon: this.icon, customClass: this.iconClass }))), !this.appendToBody && this.displayText && (h("div", { key: 'c85b60f60dd2ea1099bc56367b4845b9384def2a', class: this.getHintClasses(), role: "tooltip", ref: (el) => (this.hintEl = el) }, this.displayText, h("div", { key: '9f1519f1f5315409449e5e3184817cb1bae0480e', class: "tooltip-arrow", "data-popper-arrow": true, ref: (el) => (this.arrowEl = el) })))));
|
|
1917
2001
|
}
|
|
1918
2002
|
get el() { return this; }
|
|
2003
|
+
static get watchers() { return {
|
|
2004
|
+
"text": ["handleTextChange"]
|
|
2005
|
+
}; }
|
|
1919
2006
|
static get style() { return sulaTooltipCss; }
|
|
1920
2007
|
}, [1, "sula-tooltip", {
|
|
1921
2008
|
"text": [1],
|
|
@@ -1924,7 +2011,10 @@ const SulaTooltip$1 = /*@__PURE__*/ proxyCustomElement(class SulaTooltip extends
|
|
|
1924
2011
|
"iconClass": [1, "icon-class"],
|
|
1925
2012
|
"focused": [4],
|
|
1926
2013
|
"trigger": [1],
|
|
2014
|
+
"appendToBody": [4, "append-to-body"],
|
|
1927
2015
|
"isVisible": [32]
|
|
2016
|
+
}, undefined, {
|
|
2017
|
+
"text": ["handleTextChange"]
|
|
1928
2018
|
}]);
|
|
1929
2019
|
function defineCustomElement$1() {
|
|
1930
2020
|
if (typeof customElements === "undefined") {
|