@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
|
@@ -4,6 +4,10 @@ import { SulaTooltipPosition, SulaTooltipTrigger } from "./model/sula-tooltip.mo
|
|
|
4
4
|
const MAX_TEXT_LENGTH = 300;
|
|
5
5
|
export class SulaTooltip {
|
|
6
6
|
constructor() {
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip hint text — max 300 characters
|
|
9
|
+
*/
|
|
10
|
+
this.text = '';
|
|
7
11
|
/**
|
|
8
12
|
* Tooltip position relative to trigger
|
|
9
13
|
*/
|
|
@@ -28,22 +32,44 @@ export class SulaTooltip {
|
|
|
28
32
|
* appears on hover of that parent.
|
|
29
33
|
*/
|
|
30
34
|
this.trigger = SulaTooltipTrigger.Icon;
|
|
35
|
+
/**
|
|
36
|
+
* When true, the hint bubble is rendered in a portal appended to
|
|
37
|
+
* `document.body` instead of staying inside the component's local DOM
|
|
38
|
+
* subtree. Use this when the tooltip lives inside a container that clips
|
|
39
|
+
* overflow (e.g. `overflow-x-auto`/`overflow: hidden`, such as `sula-table`
|
|
40
|
+
* cells) — those ancestors clip `position: fixed` descendants too, so the
|
|
41
|
+
* bubble can get cut off or hidden behind other elements regardless of the
|
|
42
|
+
* Popper.js `flip`/`preventOverflow` modifiers.
|
|
43
|
+
*/
|
|
44
|
+
this.appendToBody = false;
|
|
31
45
|
this.isVisible = false;
|
|
32
46
|
this.parentEl = null;
|
|
33
47
|
this.hintEl = null;
|
|
34
48
|
this.triggerEl = null;
|
|
35
49
|
this.arrowEl = null;
|
|
36
50
|
this.popperInstance = null;
|
|
51
|
+
this.portalHost = null;
|
|
52
|
+
this.portalShadow = null;
|
|
53
|
+
this.hintTextNode = null;
|
|
37
54
|
this.handleMouseEnter = () => {
|
|
38
55
|
var _a;
|
|
39
56
|
this.isVisible = true;
|
|
57
|
+
this.syncPortalVisibility();
|
|
40
58
|
(_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
|
|
41
59
|
};
|
|
42
60
|
this.handleMouseLeave = () => {
|
|
43
61
|
this.isVisible = false;
|
|
62
|
+
this.syncPortalVisibility();
|
|
44
63
|
};
|
|
45
64
|
}
|
|
46
65
|
componentDidLoad() {
|
|
66
|
+
// Ancestors like sula-table-cell replace their own host element with a
|
|
67
|
+
// plain <td> synchronously in their own componentDidLoad, which moves
|
|
68
|
+
// this element in the DOM. Defer setup to the next frame so it runs
|
|
69
|
+
// after any such ancestor DOM moves have already settled.
|
|
70
|
+
requestAnimationFrame(() => this.mount());
|
|
71
|
+
}
|
|
72
|
+
mount() {
|
|
47
73
|
if (this.trigger === SulaTooltipTrigger.Parent) {
|
|
48
74
|
this.parentEl = this.el.parentElement;
|
|
49
75
|
if (this.parentEl) {
|
|
@@ -51,6 +77,9 @@ export class SulaTooltip {
|
|
|
51
77
|
this.parentEl.addEventListener('mouseleave', this.handleMouseLeave);
|
|
52
78
|
}
|
|
53
79
|
}
|
|
80
|
+
if (this.appendToBody) {
|
|
81
|
+
this.createPortalHint();
|
|
82
|
+
}
|
|
54
83
|
this.initPopper();
|
|
55
84
|
}
|
|
56
85
|
disconnectedCallback() {
|
|
@@ -63,6 +92,60 @@ export class SulaTooltip {
|
|
|
63
92
|
this.popperInstance.destroy();
|
|
64
93
|
this.popperInstance = null;
|
|
65
94
|
}
|
|
95
|
+
this.destroyPortalHint();
|
|
96
|
+
}
|
|
97
|
+
handleTextChange() {
|
|
98
|
+
if (this.hintTextNode) {
|
|
99
|
+
this.hintTextNode.textContent = this.displayText;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Builds the hint bubble outside of Stencil's own DOM subtree and appends
|
|
104
|
+
* it to `document.body`, so ancestor containers with `overflow` set can no
|
|
105
|
+
* longer clip it. The bubble's styles are copied from this component's own
|
|
106
|
+
* shadow root (adopted stylesheets or `<style>` tags) into a dedicated
|
|
107
|
+
* shadow root on the portal host to keep styling encapsulated.
|
|
108
|
+
*/
|
|
109
|
+
createPortalHint() {
|
|
110
|
+
if (!this.displayText || this.portalHost)
|
|
111
|
+
return;
|
|
112
|
+
this.portalHost = document.createElement('div');
|
|
113
|
+
this.portalShadow = this.portalHost.attachShadow({ mode: 'open' });
|
|
114
|
+
this.copyStylesInto(this.portalShadow);
|
|
115
|
+
this.hintEl = document.createElement('div');
|
|
116
|
+
this.hintEl.setAttribute('role', 'tooltip');
|
|
117
|
+
this.hintEl.className = this.getHintClasses();
|
|
118
|
+
this.hintTextNode = document.createTextNode(this.displayText);
|
|
119
|
+
this.hintEl.appendChild(this.hintTextNode);
|
|
120
|
+
this.arrowEl = document.createElement('div');
|
|
121
|
+
this.arrowEl.className = 'tooltip-arrow';
|
|
122
|
+
this.arrowEl.setAttribute('data-popper-arrow', '');
|
|
123
|
+
this.hintEl.appendChild(this.arrowEl);
|
|
124
|
+
this.portalShadow.appendChild(this.hintEl);
|
|
125
|
+
document.body.appendChild(this.portalHost);
|
|
126
|
+
}
|
|
127
|
+
copyStylesInto(root) {
|
|
128
|
+
const sourceRoot = this.el.shadowRoot;
|
|
129
|
+
if (!sourceRoot)
|
|
130
|
+
return;
|
|
131
|
+
const adopted = sourceRoot.adoptedStyleSheets;
|
|
132
|
+
if ((adopted === null || adopted === void 0 ? void 0 : adopted.length) && 'adoptedStyleSheets' in root) {
|
|
133
|
+
root.adoptedStyleSheets = adopted;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
sourceRoot.querySelectorAll('style').forEach((style) => root.appendChild(style.cloneNode(true)));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
destroyPortalHint() {
|
|
140
|
+
var _a;
|
|
141
|
+
(_a = this.portalHost) === null || _a === void 0 ? void 0 : _a.remove();
|
|
142
|
+
this.portalHost = null;
|
|
143
|
+
this.portalShadow = null;
|
|
144
|
+
this.hintTextNode = null;
|
|
145
|
+
if (this.appendToBody) {
|
|
146
|
+
this.hintEl = null;
|
|
147
|
+
this.arrowEl = null;
|
|
148
|
+
}
|
|
66
149
|
}
|
|
67
150
|
initPopper() {
|
|
68
151
|
const reference = this.trigger === SulaTooltipTrigger.Parent ? this.el.parentElement : this.triggerEl;
|
|
@@ -90,23 +173,24 @@ export class SulaTooltip {
|
|
|
90
173
|
: this.text;
|
|
91
174
|
}
|
|
92
175
|
getIconClasses() {
|
|
93
|
-
|
|
94
|
-
const borderColor = this.focused
|
|
95
|
-
? 'border-feedback-informational'
|
|
96
|
-
: 'border-transparent';
|
|
97
|
-
return `${baseClasses} ${borderColor}`;
|
|
176
|
+
return this.focused ? 'tooltip-trigger is-focused' : 'tooltip-trigger';
|
|
98
177
|
}
|
|
99
178
|
getHintClasses() {
|
|
100
179
|
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';
|
|
101
180
|
const visibilityClasses = this.isVisible ? 'opacity-100 visible' : 'opacity-0 invisible';
|
|
102
|
-
return `${baseClasses} ${visibilityClasses} transition-opacity duration-200`;
|
|
181
|
+
return `${baseClasses} ${visibilityClasses} transition-[opacity,visibility] duration-200`;
|
|
182
|
+
}
|
|
183
|
+
syncPortalVisibility() {
|
|
184
|
+
if (this.appendToBody && this.hintEl) {
|
|
185
|
+
this.hintEl.className = this.getHintClasses();
|
|
186
|
+
}
|
|
103
187
|
}
|
|
104
188
|
render() {
|
|
105
189
|
const isParentMode = this.trigger === SulaTooltipTrigger.Parent;
|
|
106
190
|
const hostClass = isParentMode
|
|
107
191
|
? 'absolute inset-0 pointer-events-none overflow-visible'
|
|
108
192
|
: 'inline-block relative';
|
|
109
|
-
return (h(Host, { key: '
|
|
193
|
+
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) })))));
|
|
110
194
|
}
|
|
111
195
|
static get is() { return "sula-tooltip"; }
|
|
112
196
|
static get encapsulation() { return "shadow"; }
|
|
@@ -139,7 +223,8 @@ export class SulaTooltip {
|
|
|
139
223
|
},
|
|
140
224
|
"getter": false,
|
|
141
225
|
"setter": false,
|
|
142
|
-
"reflect": false
|
|
226
|
+
"reflect": false,
|
|
227
|
+
"defaultValue": "''"
|
|
143
228
|
},
|
|
144
229
|
"position": {
|
|
145
230
|
"type": "string",
|
|
@@ -252,6 +337,26 @@ export class SulaTooltip {
|
|
|
252
337
|
"setter": false,
|
|
253
338
|
"reflect": false,
|
|
254
339
|
"defaultValue": "SulaTooltipTrigger.Icon"
|
|
340
|
+
},
|
|
341
|
+
"appendToBody": {
|
|
342
|
+
"type": "boolean",
|
|
343
|
+
"attribute": "append-to-body",
|
|
344
|
+
"mutable": false,
|
|
345
|
+
"complexType": {
|
|
346
|
+
"original": "boolean",
|
|
347
|
+
"resolved": "boolean",
|
|
348
|
+
"references": {}
|
|
349
|
+
},
|
|
350
|
+
"required": false,
|
|
351
|
+
"optional": false,
|
|
352
|
+
"docs": {
|
|
353
|
+
"tags": [],
|
|
354
|
+
"text": "When true, the hint bubble is rendered in a portal appended to\n`document.body` instead of staying inside the component's local DOM\nsubtree. Use this when the tooltip lives inside a container that clips\noverflow (e.g. `overflow-x-auto`/`overflow: hidden`, such as `sula-table`\ncells) \u2014 those ancestors clip `position: fixed` descendants too, so the\nbubble can get cut off or hidden behind other elements regardless of the\nPopper.js `flip`/`preventOverflow` modifiers."
|
|
355
|
+
},
|
|
356
|
+
"getter": false,
|
|
357
|
+
"setter": false,
|
|
358
|
+
"reflect": false,
|
|
359
|
+
"defaultValue": "false"
|
|
255
360
|
}
|
|
256
361
|
};
|
|
257
362
|
}
|
|
@@ -261,5 +366,11 @@ export class SulaTooltip {
|
|
|
261
366
|
};
|
|
262
367
|
}
|
|
263
368
|
static get elementRef() { return "el"; }
|
|
369
|
+
static get watchers() {
|
|
370
|
+
return [{
|
|
371
|
+
"propName": "text",
|
|
372
|
+
"methodName": "handleTextChange"
|
|
373
|
+
}];
|
|
374
|
+
}
|
|
264
375
|
}
|
|
265
376
|
//# sourceMappingURL=sula-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sula-tooltip.js","sourceRoot":"","sources":["../../../src/components/sula-tooltip/sula-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErF,MAAM,eAAe,GAAG,GAAG,CAAC;AAO5B,MAAM,OAAO,WAAW;IALxB;QAaE;;WAEG;QACK,aAAQ,GAAwB,mBAAmB,CAAC,GAAG,CAAC;QAEhE;;WAEG;QACK,SAAI,GAAW,YAAY,CAAC;QAEpC;;WAEG;QACK,cAAS,GAAW,4CAA4C,CAAC;QAEzE;;WAEG;QACK,YAAO,GAAY,KAAK,CAAC;QAEjC;;;;;;WAMG;QACK,YAAO,GAAuB,kBAAkB,CAAC,IAAI,CAAC;QAErD,cAAS,GAAY,KAAK,CAAC;QAE5B,aAAQ,GAAuB,IAAI,CAAC;QACpC,WAAM,GAAuB,IAAI,CAAC;QAClC,cAAS,GAAuB,IAAI,CAAC;QACrC,YAAO,GAAuB,IAAI,CAAC;QACnC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CAAC,OAAO,GAAG,EAAiB,CAAC,GAAQ,CAChG,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, h, State } from '@stencil/core';\nimport { createPopper } from '@popperjs/core';\nimport type { Instance as PopperInstance } from '@popperjs/core';\nimport { SulaTooltipPosition, SulaTooltipTrigger } from './model/sula-tooltip.model';\n\nconst MAX_TEXT_LENGTH = 300;\n\n@Component({\n tag: 'sula-tooltip',\n styleUrl: 'sula-tooltip.scss',\n shadow: true,\n})\nexport class SulaTooltip {\n @Element() el: HTMLElement;\n\n /**\n * Tooltip hint text — max 300 characters\n */\n @Prop() text: string;\n\n /**\n * Tooltip position relative to trigger\n */\n @Prop() position: SulaTooltipPosition = SulaTooltipPosition.Top;\n\n /**\n * Icon class used as the tooltip trigger (Phosphor icon name)\n */\n @Prop() icon: string = 'ph ph-info';\n\n /**\n * Extra classes applied to the trigger icon\n */\n @Prop() iconClass: string = 'text-icon-primary text-[18px] leading-none';\n\n /**\n * When true, renders a focus ring (21.5×21.5px, 1px border) around the icon.\n */\n @Prop() focused: boolean = false;\n\n /**\n * Trigger mode.\n * - `'icon'` (default): the built-in info icon is the hover target.\n * - `'parent'`: the icon is hidden; the component stretches to fill the\n * parent element (which **must** have `position: relative`) and the hint\n * appears on hover of that parent.\n */\n @Prop() trigger: SulaTooltipTrigger = SulaTooltipTrigger.Icon;\n\n @State() isVisible: boolean = false;\n\n private parentEl: HTMLElement | null = null;\n private hintEl: HTMLElement | null = null;\n private triggerEl: HTMLElement | null = null;\n private arrowEl: HTMLElement | null = null;\n private popperInstance: PopperInstance | null = null;\n\n componentDidLoad() {\n if (this.trigger === SulaTooltipTrigger.Parent) {\n this.parentEl = this.el.parentElement;\n if (this.parentEl) {\n this.parentEl.addEventListener('mouseenter', this.handleMouseEnter);\n this.parentEl.addEventListener('mouseleave', this.handleMouseLeave);\n }\n }\n this.initPopper();\n }\n\n disconnectedCallback() {\n if (this.parentEl) {\n this.parentEl.removeEventListener('mouseenter', this.handleMouseEnter);\n this.parentEl.removeEventListener('mouseleave', this.handleMouseLeave);\n this.parentEl = null;\n }\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n private initPopper() {\n const reference =\n this.trigger === SulaTooltipTrigger.Parent ? this.el.parentElement : this.triggerEl;\n if (!reference || !this.hintEl) return;\n\n if (this.popperInstance) {\n this.popperInstance.destroy();\n }\n\n this.popperInstance = createPopper(reference, this.hintEl, {\n placement: this.position as any,\n strategy: 'fixed',\n modifiers: [\n { name: 'offset', options: { offset: [0, 8] } },\n { name: 'arrow', options: { element: this.arrowEl } },\n { name: 'preventOverflow', options: { padding: 8 } },\n { name: 'flip' },\n ],\n });\n }\n\n private get displayText(): string {\n if (!this.text) return '';\n return this.text.length > MAX_TEXT_LENGTH\n ? this.text.slice(0, MAX_TEXT_LENGTH)\n : this.text;\n }\n\n private getIconClasses() {\n const baseClasses = 'relative w-[22px] h-[22px] box-border flex items-center justify-center rounded-full cursor-pointer transition-all opacity-100 border border-solid bg-transparent';\n const borderColor = this.focused\n ? 'border-feedback-informational'\n : 'border-transparent';\n\n return `${baseClasses} ${borderColor}`;\n }\n\n private getHintClasses() {\n const baseClasses =\n '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';\n const visibilityClasses = this.isVisible ? 'opacity-100 visible' : 'opacity-0 invisible';\n return `${baseClasses} ${visibilityClasses} transition-opacity duration-200`;\n }\n\n private handleMouseEnter = () => {\n this.isVisible = true;\n this.popperInstance?.update();\n };\n\n private handleMouseLeave = () => {\n this.isVisible = false;\n };\n\n render() {\n const isParentMode = this.trigger === SulaTooltipTrigger.Parent;\n const hostClass = isParentMode\n ? 'absolute inset-0 pointer-events-none overflow-visible'\n : 'inline-block relative';\n\n return (\n <Host class={hostClass}>\n {!isParentMode && (\n <div\n class={this.getIconClasses()}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n role=\"button\"\n aria-label=\"Tooltip trigger\"\n ref={(el) => (this.triggerEl = el as HTMLElement)}\n >\n <sula-icon class=\"flex items-center justify-center w-full h-full leading-[0]\" icon={this.icon} customClass={this.iconClass}></sula-icon>\n </div>\n )}\n\n {this.displayText && (\n <div class={this.getHintClasses()} role=\"tooltip\" ref={(el) => (this.hintEl = el as HTMLElement)}>\n {this.displayText}\n <div class=\"tooltip-arrow\" data-popper-arrow ref={(el) => (this.arrowEl = el as HTMLElement)}></div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sula-tooltip.js","sourceRoot":"","sources":["../../../src/components/sula-tooltip/sula-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErF,MAAM,eAAe,GAAG,GAAG,CAAC;AAO5B,MAAM,OAAO,WAAW;IALxB;QAQE;;WAEG;QACK,SAAI,GAAW,EAAE,CAAC;QAE1B;;WAEG;QACK,aAAQ,GAAwB,mBAAmB,CAAC,GAAG,CAAC;QAEhE;;WAEG;QACK,SAAI,GAAW,YAAY,CAAC;QAEpC;;WAEG;QACK,cAAS,GAAW,4CAA4C,CAAC;QAEzE;;WAEG;QACK,YAAO,GAAY,KAAK,CAAC;QAEjC;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BAAiB,EAC5B,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAiB,CAAC;gBAEjD,kEAAW,KAAK,EAAC,kBAAkB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,GAAc,CAC1F,CACP;YAEA,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,WAAW,IAAI,CACzC,4DAAK,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAC,SAAS,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,EAAiB,CAAC;gBAC7F,IAAI,CAAC,WAAW;gBACjB,4DAAK,KAAK,EAAC,eAAe,6BAAmB,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,EAAiB,CAAC,GAAQ,CAChG,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, Watch, h, State } from '@stencil/core';\nimport { createPopper } from '@popperjs/core';\nimport type { Instance as PopperInstance } from '@popperjs/core';\nimport { SulaTooltipPosition, SulaTooltipTrigger } from './model/sula-tooltip.model';\n\nconst MAX_TEXT_LENGTH = 300;\n\n@Component({\n tag: 'sula-tooltip',\n styleUrl: 'sula-tooltip.scss',\n shadow: true,\n})\nexport class SulaTooltip {\n @Element() el!: HTMLElement;\n\n /**\n * Tooltip hint text — max 300 characters\n */\n @Prop() text: string = '';\n\n /**\n * Tooltip position relative to trigger\n */\n @Prop() position: SulaTooltipPosition = SulaTooltipPosition.Top;\n\n /**\n * Icon class used as the tooltip trigger (Phosphor icon name)\n */\n @Prop() icon: string = 'ph ph-info';\n\n /**\n * Extra classes applied to the trigger icon\n */\n @Prop() iconClass: string = 'text-icon-primary text-[18px] leading-none';\n\n /**\n * When true, renders a focus ring (21.5×21.5px, 1px border) around the icon.\n */\n @Prop() focused: boolean = false;\n\n /**\n * Trigger mode.\n * - `'icon'` (default): the built-in info icon is the hover target.\n * - `'parent'`: the icon is hidden; the component stretches to fill the\n * parent element (which **must** have `position: relative`) and the hint\n * appears on hover of that parent.\n */\n @Prop() trigger: SulaTooltipTrigger = SulaTooltipTrigger.Icon;\n\n /**\n * When true, the hint bubble is rendered in a portal appended to\n * `document.body` instead of staying inside the component's local DOM\n * subtree. Use this when the tooltip lives inside a container that clips\n * overflow (e.g. `overflow-x-auto`/`overflow: hidden`, such as `sula-table`\n * cells) — those ancestors clip `position: fixed` descendants too, so the\n * bubble can get cut off or hidden behind other elements regardless of the\n * Popper.js `flip`/`preventOverflow` modifiers.\n */\n @Prop() appendToBody: boolean = false;\n\n @State() isVisible: boolean = false;\n\n private parentEl: HTMLElement | null = null;\n private hintEl: HTMLElement | null = null;\n private triggerEl: HTMLElement | null = null;\n private arrowEl: HTMLElement | null = null;\n private popperInstance: PopperInstance | null = null;\n private portalHost: HTMLDivElement | null = null;\n private portalShadow: ShadowRoot | null = null;\n private hintTextNode: Text | null = null;\n\n componentDidLoad() {\n // Ancestors like sula-table-cell replace their own host element with a\n // plain <td> synchronously in their own componentDidLoad, which moves\n // this element in the DOM. Defer setup to the next frame so it runs\n // after any such ancestor DOM moves have already settled.\n requestAnimationFrame(() => this.mount());\n }\n\n private mount() {\n if (this.trigger === SulaTooltipTrigger.Parent) {\n this.parentEl = this.el.parentElement;\n if (this.parentEl) {\n this.parentEl.addEventListener('mouseenter', this.handleMouseEnter);\n this.parentEl.addEventListener('mouseleave', this.handleMouseLeave);\n }\n }\n if (this.appendToBody) {\n this.createPortalHint();\n }\n this.initPopper();\n }\n\n disconnectedCallback() {\n if (this.parentEl) {\n this.parentEl.removeEventListener('mouseenter', this.handleMouseEnter);\n this.parentEl.removeEventListener('mouseleave', this.handleMouseLeave);\n this.parentEl = null;\n }\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n this.destroyPortalHint();\n }\n\n @Watch('text')\n handleTextChange() {\n if (this.hintTextNode) {\n this.hintTextNode.textContent = this.displayText;\n }\n }\n\n /**\n * Builds the hint bubble outside of Stencil's own DOM subtree and appends\n * it to `document.body`, so ancestor containers with `overflow` set can no\n * longer clip it. The bubble's styles are copied from this component's own\n * shadow root (adopted stylesheets or `<style>` tags) into a dedicated\n * shadow root on the portal host to keep styling encapsulated.\n */\n private createPortalHint() {\n if (!this.displayText || this.portalHost) return;\n\n this.portalHost = document.createElement('div');\n this.portalShadow = this.portalHost.attachShadow({ mode: 'open' });\n this.copyStylesInto(this.portalShadow);\n\n this.hintEl = document.createElement('div');\n this.hintEl.setAttribute('role', 'tooltip');\n this.hintEl.className = this.getHintClasses();\n\n this.hintTextNode = document.createTextNode(this.displayText);\n this.hintEl.appendChild(this.hintTextNode);\n\n this.arrowEl = document.createElement('div');\n this.arrowEl.className = 'tooltip-arrow';\n this.arrowEl.setAttribute('data-popper-arrow', '');\n this.hintEl.appendChild(this.arrowEl);\n\n this.portalShadow.appendChild(this.hintEl);\n document.body.appendChild(this.portalHost);\n }\n\n private copyStylesInto(root: ShadowRoot) {\n const sourceRoot = this.el.shadowRoot;\n if (!sourceRoot) return;\n\n const adopted = (sourceRoot as unknown as { adoptedStyleSheets?: CSSStyleSheet[] }).adoptedStyleSheets;\n if (adopted?.length && 'adoptedStyleSheets' in root) {\n (root as unknown as { adoptedStyleSheets: CSSStyleSheet[] }).adoptedStyleSheets = adopted;\n } else {\n sourceRoot.querySelectorAll('style').forEach((style) => root.appendChild(style.cloneNode(true)));\n }\n }\n\n private destroyPortalHint() {\n this.portalHost?.remove();\n this.portalHost = null;\n this.portalShadow = null;\n this.hintTextNode = null;\n if (this.appendToBody) {\n this.hintEl = null;\n this.arrowEl = null;\n }\n }\n\n private initPopper() {\n const reference =\n this.trigger === SulaTooltipTrigger.Parent ? this.el.parentElement : this.triggerEl;\n if (!reference || !this.hintEl) return;\n\n if (this.popperInstance) {\n this.popperInstance.destroy();\n }\n\n this.popperInstance = createPopper(reference, this.hintEl, {\n placement: this.position as any,\n strategy: 'fixed',\n modifiers: [\n { name: 'offset', options: { offset: [0, 8] } },\n { name: 'arrow', options: { element: this.arrowEl } },\n { name: 'preventOverflow', options: { padding: 8 } },\n { name: 'flip' },\n ],\n });\n }\n\n private get displayText(): string {\n if (!this.text) return '';\n return this.text.length > MAX_TEXT_LENGTH\n ? this.text.slice(0, MAX_TEXT_LENGTH)\n : this.text;\n }\n\n private getIconClasses() {\n return this.focused ? 'tooltip-trigger is-focused' : 'tooltip-trigger';\n }\n\n private getHintClasses() {\n const baseClasses =\n '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';\n const visibilityClasses = this.isVisible ? 'opacity-100 visible' : 'opacity-0 invisible';\n return `${baseClasses} ${visibilityClasses} transition-[opacity,visibility] duration-200`;\n }\n\n private handleMouseEnter = () => {\n this.isVisible = true;\n this.syncPortalVisibility();\n this.popperInstance?.update();\n };\n\n private handleMouseLeave = () => {\n this.isVisible = false;\n this.syncPortalVisibility();\n };\n\n private syncPortalVisibility() {\n if (this.appendToBody && this.hintEl) {\n this.hintEl.className = this.getHintClasses();\n }\n }\n\n render() {\n const isParentMode = this.trigger === SulaTooltipTrigger.Parent;\n const hostClass = isParentMode\n ? 'absolute inset-0 pointer-events-none overflow-visible'\n : 'inline-block relative';\n\n return (\n <Host class={hostClass}>\n {!isParentMode && (\n <div\n class={this.getIconClasses()}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n role=\"button\"\n aria-label=\"Tooltip trigger\"\n ref={(el) => (this.triggerEl = el as HTMLElement)}\n >\n <sula-icon class=\"flex leading-[0]\" icon={this.icon} customClass={this.iconClass}></sula-icon>\n </div>\n )}\n\n {!this.appendToBody && this.displayText && (\n <div class={this.getHintClasses()} role=\"tooltip\" ref={(el) => (this.hintEl = el as HTMLElement)}>\n {this.displayText}\n <div class=\"tooltip-arrow\" data-popper-arrow ref={(el) => (this.arrowEl = el as HTMLElement)}></div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -45,6 +45,14 @@ export default {
|
|
|
45
45
|
defaultValue: { summary: 'SulaTooltipTrigger.Icon' },
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
|
+
appendToBody: {
|
|
49
|
+
control: 'boolean',
|
|
50
|
+
description: 'Renderiza o hint anexado ao document.body, evitando overflow do conteúdo.',
|
|
51
|
+
table: {
|
|
52
|
+
type: { summary: 'boolean' },
|
|
53
|
+
defaultValue: { summary: 'false' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
48
56
|
},
|
|
49
57
|
parameters: {
|
|
50
58
|
docs: {
|
|
@@ -75,6 +83,7 @@ const Template = args => {
|
|
|
75
83
|
el.setAttribute('icon', args.icon || 'ph ph-info');
|
|
76
84
|
el.setAttribute('focused', args.focused ? 'true' : 'false');
|
|
77
85
|
el.setAttribute('trigger', args.trigger || 'icon');
|
|
86
|
+
el.setAttribute('append-to-body', args.appendToBody ? 'true' : 'false');
|
|
78
87
|
container.appendChild(el);
|
|
79
88
|
return container;
|
|
80
89
|
};
|
|
@@ -85,6 +94,7 @@ Playground.args = {
|
|
|
85
94
|
icon: 'ph ph-info',
|
|
86
95
|
focused: false,
|
|
87
96
|
trigger: SulaTooltipTrigger.Icon,
|
|
97
|
+
appendToBody: false,
|
|
88
98
|
};
|
|
89
99
|
export const Positions = () => {
|
|
90
100
|
const container = document.createElement('div');
|
|
@@ -176,4 +186,55 @@ export const ParentTrigger = () => {
|
|
|
176
186
|
ParentTrigger.parameters = {
|
|
177
187
|
docs: { description: { story: 'Tooltip disparado pelo hover no elemento pai (ícone oculto).' } },
|
|
178
188
|
};
|
|
189
|
+
export const AppendToBody = () => {
|
|
190
|
+
const wrapper = document.createElement('div');
|
|
191
|
+
wrapper.style.display = 'flex';
|
|
192
|
+
wrapper.style.gap = '32px';
|
|
193
|
+
wrapper.style.padding = '32px';
|
|
194
|
+
wrapper.style.flexWrap = 'wrap';
|
|
195
|
+
// overflow: hidden só clipa position: fixed quando o container também
|
|
196
|
+
// cria um containing block para fixed (aqui via transform).
|
|
197
|
+
const buildBox = (title, appendToBody) => {
|
|
198
|
+
const column = document.createElement('div');
|
|
199
|
+
const heading = document.createElement('h4');
|
|
200
|
+
heading.style.fontSize = '14px';
|
|
201
|
+
heading.style.fontWeight = 'bold';
|
|
202
|
+
heading.style.marginBottom = '8px';
|
|
203
|
+
heading.textContent = title;
|
|
204
|
+
const box = document.createElement('div');
|
|
205
|
+
box.style.width = '220px';
|
|
206
|
+
box.style.height = '70px';
|
|
207
|
+
box.style.overflow = 'hidden';
|
|
208
|
+
box.style.transform = 'translateZ(0)';
|
|
209
|
+
box.style.border = '1px solid #e0e0e0';
|
|
210
|
+
box.style.borderRadius = '8px';
|
|
211
|
+
box.style.padding = '0.75rem';
|
|
212
|
+
box.style.display = 'flex';
|
|
213
|
+
box.style.alignItems = 'center';
|
|
214
|
+
const label = document.createElement('span');
|
|
215
|
+
label.style.fontSize = '14px';
|
|
216
|
+
label.textContent = 'Passe o mouse';
|
|
217
|
+
const tooltip = document.createElement('sula-tooltip');
|
|
218
|
+
tooltip.setAttribute('text', appendToBody
|
|
219
|
+
? 'Este hint escapa do overflow do container via portal no document.body.'
|
|
220
|
+
: 'Este hint deveria aparecer acima, mas é cortado pelo overflow do container.');
|
|
221
|
+
tooltip.setAttribute('position', SulaTooltipPosition.Top);
|
|
222
|
+
tooltip.setAttribute('append-to-body', appendToBody ? 'true' : 'false');
|
|
223
|
+
box.appendChild(label);
|
|
224
|
+
box.appendChild(tooltip);
|
|
225
|
+
column.appendChild(heading);
|
|
226
|
+
column.appendChild(box);
|
|
227
|
+
return column;
|
|
228
|
+
};
|
|
229
|
+
wrapper.appendChild(buildBox('Sem append-to-body (cortado)', false));
|
|
230
|
+
wrapper.appendChild(buildBox('Com append-to-body (funciona)', true));
|
|
231
|
+
return wrapper;
|
|
232
|
+
};
|
|
233
|
+
AppendToBody.parameters = {
|
|
234
|
+
docs: {
|
|
235
|
+
description: {
|
|
236
|
+
story: 'Quando o container tem `overflow` + `transform` (criando um containing block para `fixed`), o hint fica preso ao clipping. Com `append-to-body`, o hint é renderizado em um portal no `document.body` e escapa desse clipping.',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
};
|
|
179
240
|
//# sourceMappingURL=sula-tooltip.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sula-tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/sula-tooltip/sula-tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErF,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,gDAAgD;YAC7D,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;gBAC3B,YAAY,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;aACvC;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;YAC3C,WAAW,EAAE,0CAA0C;YACvD,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,qBAA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AC,CAAC;IAE1D,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1B,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AACF,aAAa,CAAC,UAAU,GAAG;IACzB,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,8DAA8D,EAAE,EAAE;CACjG,CAAC","sourcesContent":["import { SulaTooltipPosition, SulaTooltipTrigger } from './model/sula-tooltip.model';\n\nexport default {\n title: 'Components/sula-tooltip',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n description: 'Texto exibido no tooltip (máx. 300 caracteres)',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'undefined' },\n },\n },\n position: {\n control: { type: 'select' },\n options: Object.values(SulaTooltipPosition),\n description: 'Posição do tooltip em relação ao gatilho',\n table: {\n type: { summary: 'SulaTooltipPosition' },\n defaultValue: { summary: 'SulaTooltipPosition.Top' },\n },\n },\n icon: {\n control: 'text',\n description: 'Classe do ícone (Phosphor Icons)',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'ph ph-info' },\n },\n },\n focused: {\n control: 'boolean',\n description: 'Exibe o focus ring ao redor do ícone',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: 'false' },\n },\n },\n trigger: {\n control: { type: 'select' },\n options: Object.values(SulaTooltipTrigger),\n description: 'Modo de disparo: ícone (padrão) ou elemento pai',\n table: {\n type: { summary: 'SulaTooltipTrigger' },\n defaultValue: { summary: 'SulaTooltipTrigger.Icon' },\n },\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\nO componente **Sula Tooltip** exibe um hint informativo ao passar o mouse sobre um ícone ou elemento pai.\n\n### Características principais:\n- Posicionamento em 4 direções (top, bottom, left, right)\n- Adaptação automática ao tema via Tailwind\n- Suporte a focus ring\n- Modo trigger por ícone ou por elemento pai\n- Texto com até 300 caracteres\n `,\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '100px';\n container.style.display = 'flex';\n container.style.justifyContent = 'center';\n container.style.alignItems = 'center';\n\n const el = document.createElement('sula-tooltip');\n\n el.setAttribute('text', args.text);\n el.setAttribute('position', args.position);\n el.setAttribute('icon', args.icon || 'ph ph-info');\n el.setAttribute('focused', args.focused ? 'true' : 'false');\n el.setAttribute('trigger', args.trigger || 'icon');\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Playground = Template.bind({});\nPlayground.args = {\n text: 'Este é um tooltip padrão',\n position: SulaTooltipPosition.Top,\n icon: 'ph ph-info',\n focused: false,\n trigger: SulaTooltipTrigger.Icon,\n};\n\nexport const Positions = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.gap = '64px';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n container.style.padding = '100px 20px';\n\n Object.values(SulaTooltipPosition).forEach(pos => {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'flex';\n wrapper.style.alignItems = 'center';\n wrapper.style.gap = '8px';\n\n const label = document.createElement('span');\n label.style.fontSize = '14px';\n label.textContent = pos.charAt(0).toUpperCase() + pos.slice(1) + ':';\n\n const el = document.createElement('sula-tooltip');\n el.setAttribute('text', `Tooltip posicionado em ${pos}`);\n el.setAttribute('position', pos);\n\n wrapper.appendChild(label);\n wrapper.appendChild(el);\n container.appendChild(wrapper);\n });\n\n return container;\n};\nPositions.parameters = {\n docs: { description: { story: 'Todas as posições disponíveis do tooltip.' } },\n};\n\nexport const FocusRing = Template.bind({});\nFocusRing.args = {\n text: 'Tooltip com focus ring',\n position: SulaTooltipPosition.Top,\n focused: true,\n};\nFocusRing.parameters = {\n docs: { description: { story: 'Tooltip com focus ring visível ao redor do ícone.' } },\n};\n\nexport const CustomIcon = Template.bind({});\nCustomIcon.args = {\n text: 'Tooltip com ícone customizado',\n position: SulaTooltipPosition.Top,\n icon: 'ph ph-question',\n};\nCustomIcon.parameters = {\n docs: { description: { story: 'Tooltip com ícone de pergunta.' } },\n};\n\nexport const LongText = Template.bind({});\nLongText.args = {\n text: 'Este é um texto longo para demonstrar que o tooltip suporta quebra de linha e até 300 caracteres de conteúdo informativo para o usuário.',\n position: SulaTooltipPosition.Right,\n};\nLongText.parameters = {\n docs: { description: { story: 'Tooltip com texto longo demonstrando o suporte a múltiplas linhas.' } },\n};\n\nexport const ParentTrigger = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.gap = '16px';\n container.style.padding = '100px 20px';\n container.style.justifyContent = 'center';\n\n const card = document.createElement('div');\n card.style.position = 'relative';\n card.style.padding = '16px 20px';\n card.style.borderRadius = '8px';\n card.style.border = '1px solid #e0e0e0';\n card.style.background = '#fff';\n card.style.cursor = 'default';\n card.style.width = '180px';\n\n const label = document.createElement('p');\n label.style.fontSize = '12px';\n label.style.color = '#6c6e6e';\n label.style.margin = '0 0 4px';\n label.textContent = 'Total investido';\n\n const value = document.createElement('p');\n value.style.fontSize = '20px';\n value.style.fontWeight = 'bold';\n value.style.margin = '0';\n value.textContent = 'R$ 4.820';\n\n const tooltip = document.createElement('sula-tooltip');\n tooltip.setAttribute('text', 'Passe o mouse sobre o card para ver o tooltip.');\n tooltip.setAttribute('trigger', SulaTooltipTrigger.Parent);\n tooltip.setAttribute('position', SulaTooltipPosition.Top);\n\n card.appendChild(label);\n card.appendChild(value);\n card.appendChild(tooltip);\n container.appendChild(card);\n\n return container;\n};\nParentTrigger.parameters = {\n docs: { description: { story: 'Tooltip disparado pelo hover no elemento pai (ícone oculto).' } },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"sula-tooltip.stories.js","sourceRoot":"","sources":["../../../src/components/sula-tooltip/sula-tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA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port default {\n title: 'Components/sula-tooltip',\n tags: ['autodocs'],\n argTypes: {\n text: {\n control: 'text',\n description: 'Texto exibido no tooltip (máx. 300 caracteres)',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'undefined' },\n },\n },\n position: {\n control: { type: 'select' },\n options: Object.values(SulaTooltipPosition),\n description: 'Posição do tooltip em relação ao gatilho',\n table: {\n type: { summary: 'SulaTooltipPosition' },\n defaultValue: { summary: 'SulaTooltipPosition.Top' },\n },\n },\n icon: {\n control: 'text',\n description: 'Classe do ícone (Phosphor Icons)',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'ph ph-info' },\n },\n },\n focused: {\n control: 'boolean',\n description: 'Exibe o focus ring ao redor do ícone',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: 'false' },\n },\n },\n trigger: {\n control: { type: 'select' },\n options: Object.values(SulaTooltipTrigger),\n description: 'Modo de disparo: ícone (padrão) ou elemento pai',\n table: {\n type: { summary: 'SulaTooltipTrigger' },\n defaultValue: { summary: 'SulaTooltipTrigger.Icon' },\n },\n },\n appendToBody: {\n control: 'boolean',\n description: 'Renderiza o hint anexado ao document.body, evitando overflow do conteúdo.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: 'false' },\n },\n },\n },\n parameters: {\n docs: {\n description: {\n component: `\nO componente **Sula Tooltip** exibe um hint informativo ao passar o mouse sobre um ícone ou elemento pai.\n\n### Características principais:\n- Posicionamento em 4 direções (top, bottom, left, right)\n- Adaptação automática ao tema via Tailwind\n- Suporte a focus ring\n- Modo trigger por ícone ou por elemento pai\n- Texto com até 300 caracteres\n `,\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '100px';\n container.style.display = 'flex';\n container.style.justifyContent = 'center';\n container.style.alignItems = 'center';\n\n const el = document.createElement('sula-tooltip');\n\n el.setAttribute('text', args.text);\n el.setAttribute('position', args.position);\n el.setAttribute('icon', args.icon || 'ph ph-info');\n el.setAttribute('focused', args.focused ? 'true' : 'false');\n el.setAttribute('trigger', args.trigger || 'icon');\n el.setAttribute('append-to-body', args.appendToBody ? 'true' : 'false');\n\n container.appendChild(el);\n\n return container;\n};\n\nexport const Playground = Template.bind({});\nPlayground.args = {\n text: 'Este é um tooltip padrão',\n position: SulaTooltipPosition.Top,\n icon: 'ph ph-info',\n focused: false,\n trigger: SulaTooltipTrigger.Icon,\n appendToBody: false,\n};\n\nexport const Positions = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.gap = '64px';\n container.style.alignItems = 'center';\n container.style.justifyContent = 'center';\n container.style.padding = '100px 20px';\n\n Object.values(SulaTooltipPosition).forEach(pos => {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'flex';\n wrapper.style.alignItems = 'center';\n wrapper.style.gap = '8px';\n\n const label = document.createElement('span');\n label.style.fontSize = '14px';\n label.textContent = pos.charAt(0).toUpperCase() + pos.slice(1) + ':';\n\n const el = document.createElement('sula-tooltip');\n el.setAttribute('text', `Tooltip posicionado em ${pos}`);\n el.setAttribute('position', pos);\n\n wrapper.appendChild(label);\n wrapper.appendChild(el);\n container.appendChild(wrapper);\n });\n\n return container;\n};\nPositions.parameters = {\n docs: { description: { story: 'Todas as posições disponíveis do tooltip.' } },\n};\n\nexport const FocusRing = Template.bind({});\nFocusRing.args = {\n text: 'Tooltip com focus ring',\n position: SulaTooltipPosition.Top,\n focused: true,\n};\nFocusRing.parameters = {\n docs: { description: { story: 'Tooltip com focus ring visível ao redor do ícone.' } },\n};\n\nexport const CustomIcon = Template.bind({});\nCustomIcon.args = {\n text: 'Tooltip com ícone customizado',\n position: SulaTooltipPosition.Top,\n icon: 'ph ph-question',\n};\nCustomIcon.parameters = {\n docs: { description: { story: 'Tooltip com ícone de pergunta.' } },\n};\n\nexport const LongText = Template.bind({});\nLongText.args = {\n text: 'Este é um texto longo para demonstrar que o tooltip suporta quebra de linha e até 300 caracteres de conteúdo informativo para o usuário.',\n position: SulaTooltipPosition.Right,\n};\nLongText.parameters = {\n docs: { description: { story: 'Tooltip com texto longo demonstrando o suporte a múltiplas linhas.' } },\n};\n\nexport const ParentTrigger = () => {\n const container = document.createElement('div');\n container.style.display = 'flex';\n container.style.gap = '16px';\n container.style.padding = '100px 20px';\n container.style.justifyContent = 'center';\n\n const card = document.createElement('div');\n card.style.position = 'relative';\n card.style.padding = '16px 20px';\n card.style.borderRadius = '8px';\n card.style.border = '1px solid #e0e0e0';\n card.style.background = '#fff';\n card.style.cursor = 'default';\n card.style.width = '180px';\n\n const label = document.createElement('p');\n label.style.fontSize = '12px';\n label.style.color = '#6c6e6e';\n label.style.margin = '0 0 4px';\n label.textContent = 'Total investido';\n\n const value = document.createElement('p');\n value.style.fontSize = '20px';\n value.style.fontWeight = 'bold';\n value.style.margin = '0';\n value.textContent = 'R$ 4.820';\n\n const tooltip = document.createElement('sula-tooltip');\n tooltip.setAttribute('text', 'Passe o mouse sobre o card para ver o tooltip.');\n tooltip.setAttribute('trigger', SulaTooltipTrigger.Parent);\n tooltip.setAttribute('position', SulaTooltipPosition.Top);\n\n card.appendChild(label);\n card.appendChild(value);\n card.appendChild(tooltip);\n container.appendChild(card);\n\n return container;\n};\nParentTrigger.parameters = {\n docs: { description: { story: 'Tooltip disparado pelo hover no elemento pai (ícone oculto).' } },\n};\n\nexport const AppendToBody = () => {\n const wrapper = document.createElement('div');\n wrapper.style.display = 'flex';\n wrapper.style.gap = '32px';\n wrapper.style.padding = '32px';\n wrapper.style.flexWrap = 'wrap';\n\n // overflow: hidden só clipa position: fixed quando o container também\n // cria um containing block para fixed (aqui via transform).\n const buildBox = (title: string, appendToBody: boolean) => {\n const column = document.createElement('div');\n\n const heading = document.createElement('h4');\n heading.style.fontSize = '14px';\n heading.style.fontWeight = 'bold';\n heading.style.marginBottom = '8px';\n heading.textContent = title;\n\n const box = document.createElement('div');\n box.style.width = '220px';\n box.style.height = '70px';\n box.style.overflow = 'hidden';\n box.style.transform = 'translateZ(0)';\n box.style.border = '1px solid #e0e0e0';\n box.style.borderRadius = '8px';\n box.style.padding = '0.75rem';\n box.style.display = 'flex';\n box.style.alignItems = 'center';\n\n const label = document.createElement('span');\n label.style.fontSize = '14px';\n label.textContent = 'Passe o mouse';\n\n const tooltip = document.createElement('sula-tooltip');\n tooltip.setAttribute(\n 'text',\n appendToBody\n ? 'Este hint escapa do overflow do container via portal no document.body.'\n : 'Este hint deveria aparecer acima, mas é cortado pelo overflow do container.',\n );\n tooltip.setAttribute('position', SulaTooltipPosition.Top);\n tooltip.setAttribute('append-to-body', appendToBody ? 'true' : 'false');\n\n box.appendChild(label);\n box.appendChild(tooltip);\n column.appendChild(heading);\n column.appendChild(box);\n\n return column;\n };\n\n wrapper.appendChild(buildBox('Sem append-to-body (cortado)', false));\n wrapper.appendChild(buildBox('Com append-to-body (funciona)', true));\n\n return wrapper;\n};\nAppendToBody.parameters = {\n docs: {\n description: {\n story:\n 'Quando o container tem `overflow` + `transform` (criando um containing block para `fixed`), o hint fica preso ao clipping. Com `append-to-body`, o hint é renderizado em um portal no `document.body` e escapa desse clipping.',\n },\n },\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './p-Cy4ZswbA.js';
|
|
2
|
-
import { d as defineCustomElement$1 } from './p-
|
|
2
|
+
import { d as defineCustomElement$1 } from './p-bHiC51v2.js';
|
|
3
3
|
|
|
4
4
|
const sulaMenuSelectListCss = "*,: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}.block{display:block}: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}:host{display:block}.sula-menu-select-list{box-shadow:0 8px 16px 0 rgba(0,0,0,.039)}: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)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-40{top:2.5rem}.z-50{z-index:50}.ml-8{margin-left:.5rem}.flex{display:flex}.min-h-40{min-height:2.5rem}.w-fit{width:fit-content}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-xxl{border-radius:18.75rem}.border{border-width:1px}.border-line-input{border-color:var(--color-line-input)}.bg-brand-primary{background-color:var(--color-brand-primary)}.bg-negative-negative-1{background-color:var(--color-negative-negative-1)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-states-empty-bg-pressed{background-color:var(--color-states-empty-bg-pressed)}.bg-states-negative-pressed{background-color:var(--color-states-negative-pressed)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.px-16{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.125rem;padding-top:.125rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.text-negative-negative-1{color:var(--color-negative-negative-1)}.text-negative-negative-2{color:var(--color-negative-negative-2)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.hover\\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}.hover\\:bg-states-negative-hover:hover{background-color:var(--color-states-negative-hover)}.active\\:bg-states-empty-bg-pressed:active{background-color:var(--color-states-empty-bg-pressed)}.active\\:bg-states-negative-pressed:active{background-color:var(--color-states-negative-pressed)}.w-full{width:100%}.gap-8{gap:.5rem}.overflow-auto{overflow:auto}.rounded-sm{border-radius:.75rem}.border-line-general{border-color:var(--color-line-general)}.bg-surface-body{background-color:var(--color-surface-body)}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.py-16{padding-bottom:1rem;padding-top:1rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-text-brand{color:var(--color-text-brand)}.bottom-\\[72px\\]{bottom:72px}.top-\\[72px\\]{top:72px}.m-0{margin:0}.h-\\[72px\\]{height:72px}.resize{resize:both}.flex-col{flex-direction:column}.justify-between{justify-content:space-between}.rounded-sm,.rounded-xl{border-radius:.75rem}.border-none{border-style:none}.bg-transparent{background-color:transparent}.p-0{padding:0}.pt-4{padding-top:.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.leading-6{line-height:1.5rem}.text-icon-disabled{color:var(--color-icon-disabled)}.text-text-secondary{color:var(--color-text-secondary)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-text-secondary::placeholder{color:var(--color-text-secondary)}.mt-8{margin-top:.5rem}.grid{display:grid}.h-56{height:3.5rem}.w-56{width:3.5rem}.gap-12{gap:.75rem}.overflow-y-auto{overflow-y:auto}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-brand-primary{border-color:var(--color-brand-primary)}.bg-surface-on-body-brand{background-color:var(--color-surface-on-body-brand)}.p-16{padding:1rem}.p-32{padding:2rem}.text-center{text-align:center}.text-base-label-small-regular{font-size:.875rem;font-weight:400;letter-spacing:0;line-height:14px}.text-brand-primary{color:var(--color-brand-primary)}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-primary{color:var(--color-icon-primary)}.hover\\:border-brand-primary:hover{border-color:var(--color-brand-primary)}.hover\\:bg-surface-on-body-brand:hover{background-color:var(--color-surface-on-body-brand)}.h-44{height:2.75rem}.flex-row{flex-direction:row}.space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.border-surface-on-body{border-color:var(--color-surface-on-body)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:text-brand-primary{color:var(--color-brand-primary)}@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\")}";
|
|
5
5
|
|
|
@@ -69,6 +69,6 @@ function defineCustomElement() {
|
|
|
69
69
|
defineCustomElement();
|
|
70
70
|
|
|
71
71
|
export { SulaMenuSelectList as S, defineCustomElement as d };
|
|
72
|
-
//# sourceMappingURL=p-
|
|
72
|
+
//# sourceMappingURL=p-BJQZqrGi.js.map
|
|
73
73
|
|
|
74
|
-
//# sourceMappingURL=p-
|
|
74
|
+
//# sourceMappingURL=p-BJQZqrGi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-BJQZqrGi.js","mappings":";;;AAAA,MAAM,qBAAqB,GAAG,mrhBAAmrhB;;MCQpshB,kBAAkB,iBAAAA,kBAAA,CAAA,MAAA,kBAAA,SAAAC,CAAA,CAAA;AAL/B,IAAA,WAAA,GAAA;;;;;AAME;;AAEG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAuB,EAAE;AAE9B;;AAEG;AAEH,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAEjB;;AAEG;AAEH,QAAA,IAAS,CAAA,SAAA,GAAW,GAAG;AAcvB,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,IAAsB,KAAI;AACvC,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,SAAC;AAoCF;IAlCC,MAAM,GAAA;QACJ,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,IAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,iGAAiG,EAAE,IAAI;AACvG,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC,SAAS;gBACxB,QAAQ,EAAE,IAAI,CAAC,SAAS;AACzB,aAAA,EACD,KAAK,EAAE;AACL,gBAAA,SAAS,EAAE,CAAA,EAAG,IAAI,CAAC,SAAS,CAAI,EAAA,CAAA;aACjC,EAEA,EAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAG;AACrB,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;AAC1E,YAAA,QACE,CACE,CAAA,IAAA,EAAA,EAAA,KAAK,EAAE;AACL,oBAAA,8GAA8G,EAAE,IAAI;oBACpH,mBAAmB,EAAE,CAAC,UAAU;AAChC,oBAAA,2BAA2B,EAAE,UAAU;iBACxC,EACD,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAA,EAEpC,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,WAAA,EAAA,EAAW,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAC,SAAS,EAAa,CAAA,EAC3E,IAAI,CAAC,KAAK,CACR;AAET,SAAC,CAAC,CACC,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-menu-select-list/sula-menu-select-list.scss?tag=sula-menu-select-list&encapsulation=shadow","src/components/sula-menu-select-list/sula-menu-select-list.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.sula-menu-select-list {\n box-shadow: 0px 8px 16px 0px #0000000a;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaMenuListItem } from './model/sula-menu-select-list.model';\n\n@Component({\n tag: 'sula-menu-select-list',\n styleUrl: 'sula-menu-select-list.scss',\n shadow: true,\n})\nexport class SulaMenuSelectList {\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Menu is full width\n */\n @Prop()\n fullWidth = false;\n\n /**\n * Maximum height for menu in pixels\n */\n @Prop()\n maxHeight: number = 260;\n\n /**\n * Selected value\n */\n @Prop()\n selectedValue?: SulaMenuListItem;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n itemSelected: EventEmitter<SulaMenuListItem>;\n\n handleClick = (item: SulaMenuListItem) => {\n this.itemSelected.emit(item);\n };\n\n render() {\n return (\n <Host>\n <ul\n class={{\n 'bg-surface-body border border-line-general sula-menu-select-list rounded-sm py-12 overflow-auto': true,\n 'w-300': !this.fullWidth,\n 'w-full': this.fullWidth,\n }}\n style={{\n maxHeight: `${this.maxHeight}px`,\n }}\n >\n {this.items.map(item => {\n const isSelected = this.selectedValue && this.selectedValue.id === item.id;\n return (\n <li \n class={{\n 'w-full px-24 py-16 text-base leading-4 hover:bg-states-empty-bg-hover cursor-pointer flex items-center gap-8': true,\n 'text-text-primary': !isSelected,\n 'text-text-brand font-bold': isSelected,\n }} \n key={item.id} \n onClick={() => this.handleClick(item)}\n >\n {item.icon && <sula-icon icon={item.icon} customClass=\"text-lg\"></sula-icon>}\n {item.title}\n </li>\n );\n })}\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './p-Cy4ZswbA.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
3
|
-
import { d as defineCustomElement$1 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-bHiC51v2.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './p-BJQZqrGi.js';
|
|
4
4
|
|
|
5
5
|
const sulaDropdownCss = "*,: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}.block{display:block}.outline{outline-style:solid}: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}:host{display:block}.dropdown-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.dropdown-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}: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)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.bottom-\\[72px\\]{bottom:72px}.left-0{left:0}.top-\\[72px\\]{top:72px}.z-50{z-index:50}.m-0{margin:0}.ml-8{margin-left:.5rem}.flex{display:flex}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-8{gap:.5rem}.overflow-auto{overflow:auto}.rounded-sm,.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-none{border-style:none}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.p-0{padding:0}.px-16{padding-left:1rem;padding-right:1rem}.px-24{padding-left:1.5rem;padding-right:1.5rem}.py-16{padding-bottom:1rem;padding-top:1rem}.pt-4{padding-top:.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.text-icon-disabled{color:var(--color-icon-disabled)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.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);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.placeholder\\:text-text-secondary::placeholder{color:var(--color-text-secondary)}.rounded-sm{border-radius:.75rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.text-text-brand{color:var(--color-text-brand)}.hover\\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}.mt-8{margin-top:.5rem}.grid{display:grid}.h-56{height:3.5rem}.w-56{width:3.5rem}.gap-12{gap:.75rem}.overflow-y-auto{overflow-y:auto}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-brand-primary{border-color:var(--color-brand-primary)}.bg-surface-on-body-brand{background-color:var(--color-surface-on-body-brand)}.p-16{padding:1rem}.p-32{padding:2rem}.text-center{text-align:center}.text-base-label-small-regular{font-size:.875rem;font-weight:400;letter-spacing:0;line-height:14px}.text-brand-primary{color:var(--color-brand-primary)}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-primary{color:var(--color-icon-primary)}.hover\\:border-brand-primary:hover{border-color:var(--color-brand-primary)}.hover\\:bg-surface-on-body-brand:hover{background-color:var(--color-surface-on-body-brand)}@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\")}.h-44{height:2.75rem}.flex-row{flex-direction:row}.space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.rounded-xxl{border-radius:18.75rem}.border-surface-on-body{border-color:var(--color-surface-on-body)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:text-brand-primary{color:var(--color-brand-primary)}";
|
|
6
6
|
|
|
@@ -227,6 +227,6 @@ function defineCustomElement() {
|
|
|
227
227
|
defineCustomElement();
|
|
228
228
|
|
|
229
229
|
export { SulaDropdown as S, defineCustomElement as d };
|
|
230
|
-
//# sourceMappingURL=p-
|
|
230
|
+
//# sourceMappingURL=p-Bqd5Y-Ir.js.map
|
|
231
231
|
|
|
232
|
-
//# sourceMappingURL=p-
|
|
232
|
+
//# sourceMappingURL=p-Bqd5Y-Ir.js.map
|