Skip to content

Commit 854ceaf

Browse files
committed
refactor: Dropped inline property
1 parent 5f56eed commit 854ceaf

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

src/components/tooltip/tooltip.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ describe('Tooltip', () => {
7676
expect(tooltip.dir).to.be.empty;
7777
expect(tooltip.open).to.be.false;
7878
expect(tooltip.disableArrow).to.be.false;
79-
expect(tooltip.inline).to.be.false;
8079
expect(tooltip.offset).to.equal(6);
8180
expect(tooltip.placement).to.equal('top');
8281
expect(tooltip.anchor).to.be.undefined;

src/components/tooltip/tooltip.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ type TooltipStateOptions = {
3434
};
3535

3636
/**
37+
* Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus).
38+
* It offers features such as placement customization, delays, sticky mode, and animations.
39+
*
3740
* @element igc-tooltip
3841
*
39-
* @slot - default slot
42+
* @slot - Default slot of the tooltip component.
4043
* @slot close-button - Slot for custom sticky-mode close action (e.g., an icon/button).
4144
*
45+
* @csspart base - The wrapping container of the tooltip content.
46+
*
4247
* @fires igcOpening - Emitted before the tooltip begins to open. Can be canceled to prevent opening.
4348
* @fires igcOpened - Emitted after the tooltip has successfully opened and is visible.
4449
* @fires igcClosing - Emitted before the tooltip begins to close. Can be canceled to prevent closing.
@@ -140,15 +145,6 @@ export default class IgcTooltipComponent extends EventEmitterMixin<
140145
@property({ attribute: 'disable-arrow', type: Boolean, reflect: true })
141146
public disableArrow = false;
142147

143-
/**
144-
* Improves positioning for inline based elements, such as links.
145-
*
146-
* @attr inline
147-
* @default false
148-
*/
149-
@property({ type: Boolean, reflect: true })
150-
public inline = false;
151-
152148
/**
153149
* The offset of the tooltip from the anchor in pixels.
154150
*
@@ -420,7 +416,6 @@ export default class IgcTooltipComponent extends EventEmitterMixin<
420416
.arrowOffset=${this._arrowOffset}
421417
.shiftPadding=${8}
422418
?open=${this.open}
423-
?inline=${this.inline}
424419
flip
425420
shift
426421
>

stories/tooltip.stories.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ const metadata: Meta<IgcTooltipComponent> = {
2828
title: 'Tooltip',
2929
component: 'igc-tooltip',
3030
parameters: {
31-
docs: { description: { component: '' } },
31+
docs: {
32+
description: {
33+
component:
34+
'Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus).\nIt offers features such as placement customization, delays, sticky mode, and animations.',
35+
},
36+
},
3237
actions: {
3338
handles: ['igcOpening', 'igcOpened', 'igcClosing', 'igcClosed'],
3439
},
@@ -47,13 +52,6 @@ const metadata: Meta<IgcTooltipComponent> = {
4752
control: 'boolean',
4853
table: { defaultValue: { summary: 'false' } },
4954
},
50-
inline: {
51-
type: 'boolean',
52-
description:
53-
'Improves positioning for inline based elements, such as links.',
54-
control: 'boolean',
55-
table: { defaultValue: { summary: 'false' } },
56-
},
5755
offset: {
5856
type: 'number',
5957
description: 'The offset of the tooltip from the anchor in pixels.',
@@ -133,7 +131,6 @@ const metadata: Meta<IgcTooltipComponent> = {
133131
args: {
134132
open: false,
135133
disableArrow: false,
136-
inline: false,
137134
offset: 6,
138135
placement: 'top',
139136
showTriggers: 'pointerenter',
@@ -152,8 +149,6 @@ interface IgcTooltipArgs {
152149
open: boolean;
153150
/** Whether to disable the rendering of the arrow indicator for the tooltip. */
154151
disableArrow: boolean;
155-
/** Improves positioning for inline based elements, such as links. */
156-
inline: boolean;
157152
/** The offset of the tooltip from the anchor in pixels. */
158153
offset: number;
159154
/** Where to place the floating element relative to the parent anchor element. */
@@ -327,7 +322,7 @@ export const Inline: Story = {
327322
</div>
328323
</igc-tooltip>
329324
330-
<igc-tooltip anchor="style-sheet-language" inline>
325+
<igc-tooltip anchor="style-sheet-language">
331326
<p inert>
332327
A <strong>style sheet language</strong>, or
333328
<strong>style language</strong>, is a computer language that expresses
@@ -338,7 +333,7 @@ export const Inline: Story = {
338333
</p>
339334
</igc-tooltip>
340335
341-
<igc-tooltip class="rich-tooltip" anchor="html" inline>
336+
<igc-tooltip class="rich-tooltip" anchor="html">
342337
<div inert class="rich">
343338
<p>
344339
Hypertext Markup Language (HTML) is the standard markup language for
@@ -511,10 +506,8 @@ export const Default: Story = {
511506

512507
function createDynamicTooltip() {
513508
const tooltip = document.createElement('igc-tooltip');
514-
tooltip.message = `I'm created on demand at ${new Date().toLocaleTimeString()}`;
509+
tooltip.message = `Created on demand at ${new Date().toLocaleTimeString()}`;
515510
tooltip.anchor = 'dynamic-target';
516-
tooltip.showTriggers = 'focus, click';
517-
tooltip.hideTriggers = 'blur';
518511
tooltip.id = 'dynamic';
519512

520513
const previousTooltip = document.querySelector('#dynamic');

0 commit comments

Comments
 (0)