diff --git a/samples/inputs/tooltip/advanced/index.html b/samples/inputs/tooltip/advanced/index.html deleted file mode 100644 index fffd1c7a1e..0000000000 --- a/samples/inputs/tooltip/advanced/index.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Advanced Tooltips - - - - - - - - - - -
-
- - -

Containing list

-
- - -

Credits

- ($2.4T) -
-
-
- - -
Credits
- Amount - 1,678,345 -
- Tools - Filter - Retail Banking - More Info -
-
-
- - -

Containing chart

-
- - -

Individual Income Taxes

- ($2.4T) -
-
-
- -
Individual Income Taxes
- - -

In fiscal year (FY) 2024, the largest source of federal revenue was Individual Income - Taxes (49.3% of total revenue). So far in fiscal year 2025, the largest source of federal revenue is - Individual Income Taxes (50.6% of total revenue).

-
- - -

Containing badge

-
- - -
- - - - - -
-

Eliza Morales

-
-
-
- -
- - - - - -
-
-
Eliza Morales
-

Software Engineer

-

In a meeting

-

Available at 2:00 pm

-
-
- - -

Containing icon

-
- - -
- - - - - -
-

Aron Watson

-
-
-
- - -

Notifications are silenced while I focus. Please reach out only for urgent matters.

-
- - -

Containing buttons

-
- - -
- -
BTC
-
-

Daily: + $45

-
-
-
- - -
-
BTC
- -
-
-

Exchange Balance

-

USD 356.12.45

-
-
-

Assets Balance

-

USD 46.28.79

-
-
-
- Deposit - Withdraw -
-
- - -

Advanced sticky tooltip

-
- - -
- -
BTC
-
-

Daily: + 2,6%

-
-
-
- - -
-
BTC
- -
-
-

Exchange Balance

-

USD 356.12.45

-
-
-

Assets Balance

-

USD 46.28.79

-
-
-
-
-
- - - <% if (false) { %> - - <% } %> - - - - \ No newline at end of file diff --git a/samples/inputs/tooltip/advanced/src/index.css b/samples/inputs/tooltip/advanced/src/index.css deleted file mode 100644 index cb4afac27e..0000000000 --- a/samples/inputs/tooltip/advanced/src/index.css +++ /dev/null @@ -1,426 +0,0 @@ -/* shared styles are loaded from: */ -/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ - -.container { - display: flex; - flex-wrap: wrap; - flex-direction: row; - max-height: max-content; - max-width: 680px; - gap: 1rem; -} - -.sample { - padding: 1rem; -} - -igc-tooltip::part(bottom) { - display: none; -} - -igc-tooltip::part(base) { - color: var(--ig-primary-300-contrast); - background-color: var(--ig-surface-50); - border: 1px solid var(--ig-gray-300); - box-shadow: var(--ig-elevation-1); - max-width: unset; -} - -.triggerWrapper { - border: 1px solid var(--ig-gray-200); - border-radius: 0.25rem; - background-color: #f5f5f5; - - h3 { - color: #000 - } - - .trigger { - border: 1px solid var(--ig-gray-300); - width: 280px; - height: max-content; - margin: 0px 1rem 1rem; - - igc-list-item { - padding: 0.5rem 1rem; - } - - p[slot="start"] { - font-size: 0.875rem; - line-height: 1.5rem; - letter-spacing: 0.25px; - font-weight: 400; - color: var(--ig-gray-900); - } - - span { - display: block; - font-size: 0.8125rem; - line-height: 1.375rem; - letter-spacing: 0.3px; - color: var(--ig-gray-600); - text-decoration: underline; - } - - .headingWrapper { - display: flex; - - igc-icon { - --size: 1.25rem - } - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - line-height: var(--ig-h6-line-height); - letter-spacing: var(--ig-h6-letter-spacing); - margin: unset; - padding-left: 0.5rem; - color: var(--ig-gray-900); - } - } - - .secondary { - color: var(--ig-success-500); - font-size: 0.875rem; - line-height: 1.25rem; - letter-spacing: 0.25px; - } - - igc-avatar { - --size: 2.5rem; - } - } -} - -.trigger:nth-of-type(6) { - cursor: pointer; -} - -.trigger:nth-of-type(n+5) { - margin-left: 1.5rem; -} - -.list::part(base) { - padding: unset; -} - -.list { - - igc-list { - width: 300px; - padding: 1rem; - gap: 1rem; - letter-spacing: 0.15px; - border-radius: 0.25rem; - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - line-height: var(--ig-h6-line-height); - margin: unset; - } - - igc-list-item { - padding: 0.5rem 0.5rem 0.5rem 0.281rem; - --item-text-color: var(--ig-gray-900); - cursor: pointer; - font-size: 1rem; - line-height: 1.5rem; - font-weight: 400; - letter-spacing: 0.15px; - } - - igc-list-header { - margin-left: 0.5rem; - } - - igc-icon { - --size: 0.938rem; - --ig-icon-color: var(--ig-gray-700); - display: inline-block; - vertical-align: middle; - margin-right: 1rem; - } - } -} - -.chart::part(base) { - border-radius: 0.5rem; - padding: 1rem; - gap: 1rem; - display: flex; - flex-direction: column; -} - -.chart { - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - letter-spacing: var(--ig-h6-letter-spacing); - line-height: var(--ig-h6-line-height); - margin: unset; - } - - igc-category-chart { - width: 317px; - height: 178px; - border: 1px solid #E0E0E0; - border-radius: 0.375rem; - } - - .content { - font-size: 0.813rem; - font-weight: 400; - line-height: 1.125rem; - letter-spacing: 0.3px; - color: var(--ig-gray-700); - width: 317px; - } - - p { - margin: unset; - } -} - -.employee::part(base) { - border-radius: 0.5rem; - padding: 1rem; - gap: 1rem; -} - -.employee { - - igc-avatar { - --size: 5.5rem - } - - .textWrapper { - width: 159px; - - p { - margin: unset; - } - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - line-height: var(--ig-h6-line-height); - letter-spacing: var(--ig-h6-letter-spacing); - margin: unset; - } - - p:not(.title) { - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 400; - letter-spacing: 0.25px; - color: var(--ig-gray-700); - } - } -} - -.avatarWrapper { - line-height: 0; - position: relative; - - igc-badge { - --background-color: var(--ig-error-500); - --_badge-size: 1.25rem; - box-shadow: var(--ig-elevation-1); - position: absolute; - bottom: -3px; - right: -3px; - } -} - -.multiline::part(base) { - border-radius: 0.125rem; - gap: 0.5rem; - background-color: var(--ig-error-50); - border: unset; - padding: 0.188rem 0.5rem; -} - -.multiline::part(bottom) { - display: block; - border-bottom-color: var(--ig-error-50); -} - -.multiline { - igc-icon { - color: var(--ig-error-500); - --size: 0.938rem; - width: 1.125rem; - height: 1.125rem; - } - - p { - font-size: 0.625rem; - width: 158px; - line-height: 1rem; - letter-spacing: 0.33px; - margin: unset; - } -} - -.btcBtn::part(base) { - border-radius: 0.25rem; - padding: 1rem 1rem 0.5rem 1rem; - gap: 0.5rem; - display: flex; - flex-direction: column; -} - -.btcBtn { - - igc-card { - background-color: var(--ig-gray-50); - padding: 0.5rem; - border-radius: 0.125rem; - letter-spacing: 0.15px; - width: 268px; - border: none; - - .titleWrapper { - display: flex; - width: 4.25rem; - justify-content: space-between; - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - line-height: var(--ig-h6-line-height); - margin: unset; - } - - igc-icon { - --size: 1.25rem; - width: 1.5rem; - } - } - - .detail { - font-size: 0.75rem; - font-weight: 600; - line-height: 1rem; - margin-bottom: unset; - } - - .subtitle { - font-size: 1rem; - line-height: 1.5rem; - margin-top: unset; - color: var(--ig-gray-900); - } - - .exchangeWrapper { - - .detail { - color: var(--ig-secondary-300); - margin: 1rem 0 0.125rem 0; - } - } - - .assetsWrapper { - - .detail { - color: var(--ig-primary-300); - margin: 0 0 0.125rem 0; - } - - .subtitle { - margin-bottom: unset; - } - } - } - - .footerWrapper { - width: 100%; - gap: 0.313rem; - display: flex; - justify-content: flex-end; - - igc-button { - font-size: 0.875rem; - line-height: 1rem; - letter-spacing: 0.75px; - } - } -} - -.btc::part(base) { - border-radius: 0.25rem; - padding: 1rem; - gap: 0.5rem; - display: flex; - justify-content: space-between; - width: 280px; - --ig-icon-color: var(--ig-gray-700); -} - -.btc { - - igc-card { - padding: 0.5rem; - letter-spacing: 0.15px; - border: none; - - .titleWrapper { - display: flex; - width: 4.25rem; - justify-content: space-between; - - h6 { - font-size: var(--ig-h6-font-size); - font-weight: var(--ig-h6-font-weight); - line-height: var(--ig-h6-line-height); - margin: unset; - } - - igc-icon { - --size: 1.25rem; - width: 1.5rem; - } - } - - .detail { - font-size: 0.75rem; - font-weight: 600; - line-height: 1rem; - margin-bottom: unset; - } - - .subtitle { - font-size: 1rem; - line-height: 1.5rem; - margin-top: unset; - color: var(--ig-gray-900); - } - - .exchangeWrapper { - - .detail { - color: var(--ig-secondary-300); - margin: 0.5rem 0 0.125rem 0; - } - - .subtitle { - margin-bottom: 0.5rem; - } - } - - .assetsWrapper { - - .detail { - color: var(--ig-primary-300); - margin: 0 0 0.125rem 0; - } - - .subtitle { - margin-bottom: unset; - } - } - } -} \ No newline at end of file diff --git a/samples/inputs/tooltip/advanced/src/index.ts b/samples/inputs/tooltip/advanced/src/index.ts deleted file mode 100644 index 476b8bae15..0000000000 --- a/samples/inputs/tooltip/advanced/src/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { - defineComponents, - IgcTooltipComponent, - IgcAvatarComponent, - IgcListComponent, - registerIconFromText, - IgcIconComponent, - IgcBadgeComponent, - IgcButtonComponent, - IgcCardComponent -} from 'igniteui-webcomponents'; -import { - IgcCategoryChartComponent, - IgcCategoryChartModule -} from 'igniteui-webcomponents-charts'; -import { IncomeTaxes } from './IncomeTaxes'; -import { ModuleManager } from 'igniteui-webcomponents-core'; -import 'igniteui-webcomponents/themes/light/material.css'; -import './index.css'; - -defineComponents(IgcTooltipComponent, IgcAvatarComponent, IgcListComponent, IgcIconComponent, IgcBadgeComponent, IgcButtonComponent, IgcCardComponent); - -ModuleManager.register(IgcCategoryChartModule) - -const dollarIcon = '' -const filterIcon = '' -const linkIcon = '' -const infoIcon = '' -const blockIcon = '' -const btcIcon = '' - -export class AdvancedTooltips { - private chart: IgcCategoryChartComponent - private _bind: () => void; - - constructor() { - registerIconFromText("dollar", dollarIcon); - registerIconFromText("filter", filterIcon); - registerIconFromText("link", linkIcon); - registerIconFromText("info", infoIcon); - registerIconFromText("block", blockIcon); - registerIconFromText("btc", btcIcon); - - var chart = this.chart = document.getElementById('chart') as IgcCategoryChartComponent; - this._bind = () => { - chart.dataSource = this.incomeTaxes; - } - this._bind(); - } - - private _incomeTaxes?: IncomeTaxes; - public get incomeTaxes(): IncomeTaxes { - if (this._incomeTaxes == null) { - this._incomeTaxes = new IncomeTaxes(); - } - return this._incomeTaxes; - } -} - -new AdvancedTooltips(); \ No newline at end of file diff --git a/samples/inputs/tooltip/placement/.prettierrc b/samples/inputs/tooltip/arrow-position/.prettierrc similarity index 100% rename from samples/inputs/tooltip/placement/.prettierrc rename to samples/inputs/tooltip/arrow-position/.prettierrc diff --git a/samples/inputs/tooltip/placement/ReadMe.md b/samples/inputs/tooltip/arrow-position/ReadMe.md similarity index 85% rename from samples/inputs/tooltip/placement/ReadMe.md rename to samples/inputs/tooltip/arrow-position/ReadMe.md index 890fc0bd1b..479354a69d 100644 --- a/samples/inputs/tooltip/placement/ReadMe.md +++ b/samples/inputs/tooltip/arrow-position/ReadMe.md @@ -1,7 +1,7 @@ -This folder contains implementation of Web Components application with example of Placement feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. +This folder contains implementation of Web Components application with example of Arrow Position feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. @@ -12,10 +12,10 @@ This folder contains implementation of Web Components application with example o View Code - + Run Sample - + Run Sample @@ -33,7 +33,7 @@ To set up this project locally, execute these commands: git clone https://github.com/IgniteUI/igniteui-wc-examples.git git checkout master cd ./igniteui-wc-examples -cd ./samples/inputs/tooltip/placement +cd ./samples/inputs/tooltip/arrow-position ``` open above folder in VS Code or type: diff --git a/samples/inputs/tooltip/arrow-position/index.html b/samples/inputs/tooltip/arrow-position/index.html new file mode 100644 index 0000000000..65704a5c31 --- /dev/null +++ b/samples/inputs/tooltip/arrow-position/index.html @@ -0,0 +1,113 @@ + + + + + Tooltip Arrow Position + + + + + + + + + + +
+
+
+
+ Arrow Top +
+ +
+ +
+
+ Arrow Top Start +
+ +
+ +
+
+ Arrow Top End +
+ +
+ +
+
+ Arrow Left +
+ +
+ +
+
+ Arrow Left Start +
+ +
+ +
+
+ Arrow Left End +
+ +
+ +
+
+ Arrow Right +
+ +
+ +
+
+ Arrow Right Start +
+ +
+ +
+
+ Arrow Right End +
+ +
+ +
+
+ Arrow Bottom +
+ +
+ +
+
+ Arrow Bottom Start +
+ +
+ +
+
+ Arrow Bottom End +
+ +
+ +
+
+
+
+ + + <% if (false) { %> + + <% } %> + + + diff --git a/samples/inputs/tooltip/rich/package.json b/samples/inputs/tooltip/arrow-position/package.json similarity index 95% rename from samples/inputs/tooltip/rich/package.json rename to samples/inputs/tooltip/arrow-position/package.json index aef641783e..a3512c8b12 100644 --- a/samples/inputs/tooltip/rich/package.json +++ b/samples/inputs/tooltip/arrow-position/package.json @@ -1,7 +1,7 @@ { - "name": "wc-snackbar-overview", + "name": "wc-tooltip-arrow-position", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip arrow position using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/advanced/sandbox.config.json b/samples/inputs/tooltip/arrow-position/sandbox.config.json similarity index 100% rename from samples/inputs/tooltip/advanced/sandbox.config.json rename to samples/inputs/tooltip/arrow-position/sandbox.config.json diff --git a/samples/inputs/tooltip/arrow-position/src/index.css b/samples/inputs/tooltip/arrow-position/src/index.css new file mode 100644 index 0000000000..77c38b84d1 --- /dev/null +++ b/samples/inputs/tooltip/arrow-position/src/index.css @@ -0,0 +1,90 @@ +/* shared styles are loaded from: */ +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +.sample { + display: flex; + align-items: center; + justify-content: center; + padding: 1rem; +} + +.placements { + display: grid; + grid-template-columns: repeat(3, 12.75rem); + column-gap: 3.75rem; + row-gap: 1.5rem; +} + +.placement { + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; +} + +.placement-label { + font: 400 13px / 20px "Aktiv Grotesk", sans-serif; + letter-spacing: 0.3px; + color: var(--ig-gray-600); +} + +.placement-area { + position: relative; + width: 12.5rem; + height: 2.75rem; +} + +.placement-area.left, +.placement-area.right { + width: 12.75rem; + height: 2.5rem; +} + +igc-tooltip { + pointer-events: none; +} + +.anchor { + position: absolute; + width: 2.5rem; + height: 1px; + pointer-events: none; +} + +.top .anchor { + top: calc(100% + 0.125rem); +} + +.bottom .anchor { + bottom: calc(100% + 0.125rem); +} + +.top .anchor.start, +.bottom .anchor.start { + left: 0; +} + +.top .anchor.center, +.bottom .anchor.center { + left: calc(50% - 1.25rem); +} + +.top .anchor.end, +.bottom .anchor.end { + right: 0; +} + +.left .anchor, +.right .anchor { + top: 0; + width: 1px; + height: 2.5rem; +} + +.left .anchor { + left: calc(100% + 0.125rem); +} + +.right .anchor { + right: calc(100% + 0.125rem); +} diff --git a/samples/inputs/tooltip/arrow-position/src/index.ts b/samples/inputs/tooltip/arrow-position/src/index.ts new file mode 100644 index 0000000000..2450fd1052 --- /dev/null +++ b/samples/inputs/tooltip/arrow-position/src/index.ts @@ -0,0 +1,17 @@ +import { defineComponents, IgcTooltipComponent } from 'igniteui-webcomponents'; +import 'igniteui-webcomponents/themes/light/bootstrap.css'; +import './index.css'; + +defineComponents(IgcTooltipComponent); + +export class TooltipArrowPosition { + constructor() { + window.addEventListener('keydown', (event: KeyboardEvent) => { + if (event.key === 'Escape') { + event.stopImmediatePropagation(); + } + }, true); + } +} + +new TooltipArrowPosition(); diff --git a/samples/inputs/tooltip/advanced/tsconfig.json b/samples/inputs/tooltip/arrow-position/tsconfig.json similarity index 100% rename from samples/inputs/tooltip/advanced/tsconfig.json rename to samples/inputs/tooltip/arrow-position/tsconfig.json diff --git a/samples/inputs/tooltip/advanced/webpack.config.js b/samples/inputs/tooltip/arrow-position/webpack.config.js similarity index 100% rename from samples/inputs/tooltip/advanced/webpack.config.js rename to samples/inputs/tooltip/arrow-position/webpack.config.js diff --git a/samples/inputs/tooltip/rich/.prettierrc b/samples/inputs/tooltip/custom/.prettierrc similarity index 100% rename from samples/inputs/tooltip/rich/.prettierrc rename to samples/inputs/tooltip/custom/.prettierrc diff --git a/samples/inputs/tooltip/rich/ReadMe.md b/samples/inputs/tooltip/custom/ReadMe.md similarity index 86% rename from samples/inputs/tooltip/rich/ReadMe.md rename to samples/inputs/tooltip/custom/ReadMe.md index 765e7d883a..506843218a 100644 --- a/samples/inputs/tooltip/rich/ReadMe.md +++ b/samples/inputs/tooltip/custom/ReadMe.md @@ -1,7 +1,7 @@ -This folder contains implementation of Web Components application with example of Rich feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. +This folder contains implementation of Web Components application with example of Custom feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. @@ -12,10 +12,10 @@ This folder contains implementation of Web Components application with example o View Code - + Run Sample - + Run Sample @@ -33,7 +33,7 @@ To set up this project locally, execute these commands: git clone https://github.com/IgniteUI/igniteui-wc-examples.git git checkout master cd ./igniteui-wc-examples -cd ./samples/inputs/tooltip/rich +cd ./samples/inputs/tooltip/custom ``` open above folder in VS Code or type: diff --git a/samples/inputs/tooltip/custom/index.html b/samples/inputs/tooltip/custom/index.html new file mode 100644 index 0000000000..b96a36d6c8 --- /dev/null +++ b/samples/inputs/tooltip/custom/index.html @@ -0,0 +1,96 @@ + + + + + Tooltip Custom + + + + + + + + + + +
+
+ + + Individual Income Taxes + ($2.4T) + + + + Individual Income Taxes +
+ + +
+ + In fiscal year (FY) 2024, the largest source of federal revenue was + Individual Income Taxes (49.3% of total revenue). + +
+ + +
+ + + + +
+ Eliza Morales +
+
+ +
+ + + + +
+
+ Eliza Morales + Software Engineer + In a meeting + Available at 2:00 pm +
+
+
+
+ + + <% if (false) { %> + + <% } %> + + + diff --git a/samples/inputs/tooltip/advanced/package.json b/samples/inputs/tooltip/custom/package.json similarity index 95% rename from samples/inputs/tooltip/advanced/package.json rename to samples/inputs/tooltip/custom/package.json index 273f9da39a..6d5d3b490e 100644 --- a/samples/inputs/tooltip/advanced/package.json +++ b/samples/inputs/tooltip/custom/package.json @@ -1,7 +1,7 @@ { - "name": "wc-tooltip-advanced", + "name": "wc-tooltip-custom", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip custom using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/placement/sandbox.config.json b/samples/inputs/tooltip/custom/sandbox.config.json similarity index 100% rename from samples/inputs/tooltip/placement/sandbox.config.json rename to samples/inputs/tooltip/custom/sandbox.config.json diff --git a/samples/inputs/tooltip/advanced/src/IncomeTaxes.ts b/samples/inputs/tooltip/custom/src/IncomeTaxes.ts similarity index 100% rename from samples/inputs/tooltip/advanced/src/IncomeTaxes.ts rename to samples/inputs/tooltip/custom/src/IncomeTaxes.ts diff --git a/samples/inputs/tooltip/custom/src/index.css b/samples/inputs/tooltip/custom/src/index.css new file mode 100644 index 0000000000..a41cc2ec5b --- /dev/null +++ b/samples/inputs/tooltip/custom/src/index.css @@ -0,0 +1,142 @@ +/* shared styles are loaded from: */ +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +.sample { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: center; + gap: 6.25rem; + padding: clamp(1rem, 100vh - 25rem, 6.25rem) 1rem 1rem; +} + +.trigger { + border: 1px solid var(--ig-gray-300); + border-radius: 0; +} + +.trigger igc-list-item { + padding: 0.5rem 1rem; +} + +.taxes-trigger { + width: 21.6875rem; +} + +.employee-trigger { + width: 17.5rem; +} + +.taxes-trigger igc-list-item::part(start) { + display: none; +} + +.taxes-trigger span[slot="title"] { + font-family: var(--ig-body-2-font-family, var(--ig-font-family)); + font-size: var(--ig-body-2-font-size); + font-weight: var(--ig-body-2-font-weight); + line-height: var(--ig-body-2-line-height); + letter-spacing: var(--ig-body-2-letter-spacing); +} + +.amount { + font-size: 0.8125rem; + line-height: 1.125rem; + letter-spacing: 0.3px; + text-decoration: underline; + color: var(--ig-gray-600); +} + +.avatar { + position: relative; + display: flex; +} + +.avatar igc-badge { + position: absolute; + right: -0.3125rem; + bottom: -0.3125rem; +} + +.avatar igc-icon { + --ig-icon-size: 0.75rem; + + color: #fff; +} + +.custom-tooltip::part(base) { + gap: 1rem; + padding: 1rem; + border: 1px solid var(--ig-gray-300); + border-radius: 0.5rem; + background: var(--ig-surface-500); + color: var(--ig-gray-900); + box-shadow: var(--ig-elevation-1); +} + +.chart-tooltip::part(base) { + flex-direction: column; + width: 21.8125rem; +} + +.tooltip-title { + font-family: var(--ig-h6-font-family, var(--ig-font-family)); + font-size: var(--ig-h6-font-size); + font-weight: var(--ig-h6-font-weight); + line-height: var(--ig-h6-line-height); + letter-spacing: var(--ig-h6-letter-spacing); +} + +.chart { + box-sizing: border-box; + width: 100%; + height: 11.125rem; + padding: 1.5rem 0.5rem; + border: 1px solid var(--ig-gray-300); + border-radius: 0.375rem; + background: var(--ig-surface-500); +} + +.tooltip-description { + font-size: 0.8125rem; + font-weight: 400; + line-height: 1.125rem; + letter-spacing: 0.3px; + color: var(--ig-gray-700); +} + +.employee-tooltip::part(base) { + width: 17.5rem; +} + +.employee-tooltip .avatar { + flex-shrink: 0; +} + +.employee-tooltip .avatar igc-avatar { + --ig-size: var(--ig-size-large); +} + +.employee-tooltip .avatar igc-badge { + right: -0.1875rem; + bottom: -0.1875rem; +} + +.employee-details { + display: flex; + flex-direction: column; + min-width: 0; +} + +.employee-details .tooltip-title { + margin-bottom: 0.125rem; +} + +.employee-details span:not(.tooltip-title) { + font-family: var(--ig-body-2-font-family, var(--ig-font-family)); + font-size: var(--ig-body-2-font-size); + font-weight: 400; + line-height: var(--ig-body-2-line-height); + letter-spacing: var(--ig-body-2-letter-spacing); + color: var(--ig-gray-700); +} diff --git a/samples/inputs/tooltip/custom/src/index.ts b/samples/inputs/tooltip/custom/src/index.ts new file mode 100644 index 0000000000..ea24d1ef28 --- /dev/null +++ b/samples/inputs/tooltip/custom/src/index.ts @@ -0,0 +1,35 @@ +import { + defineComponents, + IgcAvatarComponent, + IgcBadgeComponent, + IgcIconComponent, + IgcListComponent, + IgcListItemComponent, + IgcTooltipComponent, + registerIconFromText +} from 'igniteui-webcomponents'; +import { IgcCategoryChartComponent, IgcCategoryChartModule } from 'igniteui-webcomponents-charts'; +import { ModuleManager } from 'igniteui-webcomponents-core'; +import { IncomeTaxes } from './IncomeTaxes'; +import 'igniteui-webcomponents/themes/light/bootstrap.css'; +import './index.css'; + +defineComponents(IgcAvatarComponent, IgcBadgeComponent, IgcIconComponent, IgcListComponent, IgcListItemComponent, IgcTooltipComponent); + +ModuleManager.register(IgcCategoryChartModule); + +const blockIcon = ''; + +registerIconFromText('block', blockIcon, 'material'); + +export class TooltipCustom { + constructor() { + const chart = document.getElementById('chart') as IgcCategoryChartComponent; + const tooltip = document.getElementById('income-taxes-tooltip') as IgcTooltipComponent; + + chart.dataSource = new IncomeTaxes(); + tooltip.addEventListener('igcOpened', () => chart.notifyResized()); + } +} + +new TooltipCustom(); diff --git a/samples/inputs/tooltip/placement/tsconfig.json b/samples/inputs/tooltip/custom/tsconfig.json similarity index 100% rename from samples/inputs/tooltip/placement/tsconfig.json rename to samples/inputs/tooltip/custom/tsconfig.json diff --git a/samples/inputs/tooltip/placement/webpack.config.js b/samples/inputs/tooltip/custom/webpack.config.js similarity index 100% rename from samples/inputs/tooltip/placement/webpack.config.js rename to samples/inputs/tooltip/custom/webpack.config.js diff --git a/samples/inputs/tooltip/overview/index.html b/samples/inputs/tooltip/overview/index.html index 3d29c90817..d158217013 100644 --- a/samples/inputs/tooltip/overview/index.html +++ b/samples/inputs/tooltip/overview/index.html @@ -14,11 +14,23 @@
-
- - - Her name is Madelyn James +
+
+ + Top + Right + Left + Bottom + + Close Button + Arrow +
+
+ + This is a tooltip message +
+ Multiline message here. +
@@ -28,4 +40,4 @@ <% } %> - \ No newline at end of file + diff --git a/samples/inputs/tooltip/overview/package.json b/samples/inputs/tooltip/overview/package.json index aef641783e..360aee10ec 100644 --- a/samples/inputs/tooltip/overview/package.json +++ b/samples/inputs/tooltip/overview/package.json @@ -1,7 +1,7 @@ { - "name": "wc-snackbar-overview", + "name": "wc-tooltip-overview", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip overview using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/overview/src/index.css b/samples/inputs/tooltip/overview/src/index.css index 1a6eb9b8a0..5f527d38f9 100644 --- a/samples/inputs/tooltip/overview/src/index.css +++ b/samples/inputs/tooltip/overview/src/index.css @@ -1,6 +1,31 @@ /* shared styles are loaded from: */ /* https://dl.infragistics.com/x/css/samples/shared.v8.css */ -igc-avatar { - --ig-size: var(--ig-size-medium); +.sample { + display: flex; + flex-direction: column; + align-items: center; + padding: 3.25rem 1rem 1rem; +} + +.settings { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + gap: 1.5rem; +} + +.settings igc-radio-group { + column-gap: 1.5rem; +} + +.target { + box-sizing: border-box; + width: 1.5rem; + height: 1.5rem; + margin-top: 6rem; + border: 1px dashed #e8178a; + border-radius: 0.125rem; + background: rgb(232 23 138 / 20%); } diff --git a/samples/inputs/tooltip/overview/src/index.ts b/samples/inputs/tooltip/overview/src/index.ts index d071a6c1f7..8d45ef77ff 100644 --- a/samples/inputs/tooltip/overview/src/index.ts +++ b/samples/inputs/tooltip/overview/src/index.ts @@ -1,11 +1,40 @@ -import { defineComponents, IgcTooltipComponent, IgcAvatarComponent } from 'igniteui-webcomponents'; +import { + defineComponents, + IgcCheckboxChangeEventArgs, + IgcRadioChangeEventArgs, + IgcRadioComponent, + IgcRadioGroupComponent, + IgcSwitchComponent, + IgcTooltipComponent, + PopoverPlacement +} from 'igniteui-webcomponents'; import 'igniteui-webcomponents/themes/light/bootstrap.css'; import './index.css'; -defineComponents(IgcTooltipComponent, IgcAvatarComponent); +defineComponents(IgcRadioComponent, IgcRadioGroupComponent, IgcSwitchComponent, IgcTooltipComponent); + export class TooltipOverview { - constructor() { - } + constructor() { + const tooltip = document.getElementById('tooltip') as IgcTooltipComponent; + const closeButton = document.getElementById('close-button') as IgcSwitchComponent; + const arrow = document.getElementById('arrow') as IgcSwitchComponent; + + document.querySelectorAll('igc-radio[name="placement"]').forEach((radio) => { + radio.addEventListener('igcChange', (e: CustomEvent) => { + if (e.detail.checked) { + tooltip.placement = e.detail.value as PopoverPlacement; + } + }); + }); + + closeButton.addEventListener('igcChange', (e: CustomEvent) => { + tooltip.sticky = e.detail.checked; + }); + + arrow.addEventListener('igcChange', (e: CustomEvent) => { + tooltip.withArrow = e.detail.checked; + }); + } } new TooltipOverview(); diff --git a/samples/inputs/tooltip/placement/src/index.css b/samples/inputs/tooltip/placement/src/index.css deleted file mode 100644 index bbc9abb9e4..0000000000 --- a/samples/inputs/tooltip/placement/src/index.css +++ /dev/null @@ -1,14 +0,0 @@ -/* shared styles are loaded from: */ -/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ - -#tooltip-position { - margin: 40px 0 0 120px; - width: 400px; - height: 120px; -} - -igc-button::part(base) { - height: 100%; - border-radius: 0.5rem; -} - \ No newline at end of file diff --git a/samples/inputs/tooltip/placement/src/index.ts b/samples/inputs/tooltip/placement/src/index.ts deleted file mode 100644 index f03a138ae1..0000000000 --- a/samples/inputs/tooltip/placement/src/index.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { defineComponents, IgcButtonComponent, IgcTooltipComponent } from 'igniteui-webcomponents'; -import { html, render } from 'lit-html'; -import 'igniteui-webcomponents/themes/light/bootstrap.css'; -import './index.css'; - -defineComponents(IgcTooltipComponent, IgcButtonComponent); -export class TooltipPlacement { - constructor() { - type PopoverPlacement = - | 'top' - | 'top-start' - | 'top-end' - | 'bottom' - | 'bottom-start' - | 'bottom-end' - | 'right' - | 'right-start' - | 'right-end' - | 'left' - | 'left-start' - | 'left-end'; - - const Positions = ['top', 'bottom', 'left', 'right'].flatMap((each) => [ - each, - `${each}-start`, - `${each}-end`, - ]) as Array; - - let a = document.getElementById('btnWrapper') as HTMLDivElement; - - const template = html` - Click to trigger all supported placements - - ${Positions.map( - (pos) => html` - -
- ${pos} -
-
- ` - )} - `; - render(template, a); - } -} - -new TooltipPlacement(); diff --git a/samples/inputs/tooltip/triggers/.prettierrc b/samples/inputs/tooltip/position/.prettierrc similarity index 100% rename from samples/inputs/tooltip/triggers/.prettierrc rename to samples/inputs/tooltip/position/.prettierrc diff --git a/samples/inputs/tooltip/advanced/ReadMe.md b/samples/inputs/tooltip/position/ReadMe.md similarity index 91% rename from samples/inputs/tooltip/advanced/ReadMe.md rename to samples/inputs/tooltip/position/ReadMe.md index 8fd80a06af..f668eff134 100644 --- a/samples/inputs/tooltip/advanced/ReadMe.md +++ b/samples/inputs/tooltip/position/ReadMe.md @@ -1,7 +1,7 @@ -This folder contains implementation of Web Components application with example of Advanced feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. +This folder contains implementation of Web Components application with example of Position feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. @@ -12,10 +12,10 @@ This folder contains implementation of Web Components application with example o View Code - + Run Sample - + Run Sample @@ -33,7 +33,7 @@ To set up this project locally, execute these commands: git clone https://github.com/IgniteUI/igniteui-wc-examples.git git checkout master cd ./igniteui-wc-examples -cd ./samples/inputs/tooltip/advanced +cd ./samples/inputs/tooltip/position ``` open above folder in VS Code or type: diff --git a/samples/inputs/tooltip/placement/index.html b/samples/inputs/tooltip/position/index.html similarity index 52% rename from samples/inputs/tooltip/placement/index.html rename to samples/inputs/tooltip/position/index.html index 05b95bfe25..baab737449 100644 --- a/samples/inputs/tooltip/placement/index.html +++ b/samples/inputs/tooltip/position/index.html @@ -2,7 +2,7 @@ - Tooltip Placement + Tooltip Position @@ -14,9 +14,17 @@
-
-
+
+
+
+
+ +
+ Tooltip message Top + Tooltip message Left + Tooltip message Right + Tooltip message Bottom
@@ -26,4 +34,4 @@ <% } %> - \ No newline at end of file + diff --git a/samples/inputs/tooltip/triggers/package.json b/samples/inputs/tooltip/position/package.json similarity index 95% rename from samples/inputs/tooltip/triggers/package.json rename to samples/inputs/tooltip/position/package.json index aef641783e..7c1a928e0a 100644 --- a/samples/inputs/tooltip/triggers/package.json +++ b/samples/inputs/tooltip/position/package.json @@ -1,7 +1,7 @@ { - "name": "wc-snackbar-overview", + "name": "wc-tooltip-position", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip position using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/rich/sandbox.config.json b/samples/inputs/tooltip/position/sandbox.config.json similarity index 100% rename from samples/inputs/tooltip/rich/sandbox.config.json rename to samples/inputs/tooltip/position/sandbox.config.json diff --git a/samples/inputs/tooltip/position/src/index.css b/samples/inputs/tooltip/position/src/index.css new file mode 100644 index 0000000000..9ae4e37635 --- /dev/null +++ b/samples/inputs/tooltip/position/src/index.css @@ -0,0 +1,29 @@ +/* shared styles are loaded from: */ +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +.sample { + display: flex; + align-items: center; + justify-content: center; + padding: 1rem; +} + +.positions { + display: flex; + flex-direction: column; + gap: 1.875rem; +} + +.target { + box-sizing: border-box; + width: 1.5rem; + height: 1.5rem; + border: 1px dashed #e8178a; + border-radius: 0.125rem; + background: rgb(232 23 138 / 20%); + pointer-events: none; +} + +igc-tooltip { + pointer-events: none; +} diff --git a/samples/inputs/tooltip/position/src/index.ts b/samples/inputs/tooltip/position/src/index.ts new file mode 100644 index 0000000000..ba4845800a --- /dev/null +++ b/samples/inputs/tooltip/position/src/index.ts @@ -0,0 +1,17 @@ +import { defineComponents, IgcTooltipComponent } from 'igniteui-webcomponents'; +import 'igniteui-webcomponents/themes/light/bootstrap.css'; +import './index.css'; + +defineComponents(IgcTooltipComponent); + +export class TooltipPosition { + constructor() { + window.addEventListener('keydown', (event: KeyboardEvent) => { + if (event.key === 'Escape') { + event.stopImmediatePropagation(); + } + }, true); + } +} + +new TooltipPosition(); diff --git a/samples/inputs/tooltip/rich/tsconfig.json b/samples/inputs/tooltip/position/tsconfig.json similarity index 100% rename from samples/inputs/tooltip/rich/tsconfig.json rename to samples/inputs/tooltip/position/tsconfig.json diff --git a/samples/inputs/tooltip/rich/webpack.config.js b/samples/inputs/tooltip/position/webpack.config.js similarity index 100% rename from samples/inputs/tooltip/rich/webpack.config.js rename to samples/inputs/tooltip/position/webpack.config.js diff --git a/samples/inputs/tooltip/rich/src/index.css b/samples/inputs/tooltip/rich/src/index.css deleted file mode 100644 index c82d2ca402..0000000000 --- a/samples/inputs/tooltip/rich/src/index.css +++ /dev/null @@ -1,34 +0,0 @@ -/* shared styles are loaded from: */ -/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ - -igc-icon:hover { - cursor: pointer; - color: var(--ig-primary-500); -} - -.map { - overflow: hidden; - display: flex; - align-items: center; - justify-content: center; - width: 250px; - height: 272px; - background-image: url("https://dl.infragistics.com/x/img/card/media/infragisticsMap.png"); - border: 1px solid var(--ig-gray-300); -} - -.locationTooltipContent { - display: flex; - justify-content: center; - align-items: center; -} - -.logo { - margin-right: 10px; - width: 45px; -} - -igc-tooltip::part(base) { - max-width: 240px; -} - \ No newline at end of file diff --git a/samples/inputs/tooltip/rich/src/index.ts b/samples/inputs/tooltip/rich/src/index.ts deleted file mode 100644 index 8bda5192af..0000000000 --- a/samples/inputs/tooltip/rich/src/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineComponents, IgcAvatarComponent, IgcIconButtonComponent, IgcIconComponent, IgcTooltipComponent, registerIconFromText } from 'igniteui-webcomponents'; -import 'igniteui-webcomponents/themes/light/bootstrap.css'; -import './index.css'; - -defineComponents(IgcTooltipComponent, IgcAvatarComponent, IgcIconComponent, IgcIconButtonComponent); -export class RichTooltip { - constructor() { - const location = - ''; - registerIconFromText('location_on', location, 'material'); - } -} - -new RichTooltip(); diff --git a/samples/inputs/tooltip/styling/index.html b/samples/inputs/tooltip/styling/index.html index a3476b749b..6524aef720 100644 --- a/samples/inputs/tooltip/styling/index.html +++ b/samples/inputs/tooltip/styling/index.html @@ -14,11 +14,27 @@
-
- - - Her name is Madelyn James +
+ + +
+ + + + +
+ Aron Watson +
+
+ + + + My notifications are silenced to focus. Urgent matters only, please, + otherwise I'll reply when I'm free. + + + +
@@ -28,4 +44,4 @@ <% } %> - \ No newline at end of file + diff --git a/samples/inputs/tooltip/styling/package.json b/samples/inputs/tooltip/styling/package.json index aef641783e..7ba41e50f1 100644 --- a/samples/inputs/tooltip/styling/package.json +++ b/samples/inputs/tooltip/styling/package.json @@ -1,7 +1,7 @@ { - "name": "wc-snackbar-overview", + "name": "wc-tooltip-styling", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip styling using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/styling/src/Styling.css b/samples/inputs/tooltip/styling/src/Styling.css deleted file mode 100644 index 92bf8813ec..0000000000 --- a/samples/inputs/tooltip/styling/src/Styling.css +++ /dev/null @@ -1,12 +0,0 @@ -igc-avatar { - --ig-size: var(--ig-size-medium); -} - -igc-tooltip::part(base) { - background-color: var(--ig-primary-300); - color: var(--ig-primary-300-contrast); -} - -igc-tooltip::part(bottom) { - border-bottom-color: var(--ig-primary-300); -} \ No newline at end of file diff --git a/samples/inputs/tooltip/styling/src/index.css b/samples/inputs/tooltip/styling/src/index.css index 1f53b8aa05..14b0fc9f9d 100644 --- a/samples/inputs/tooltip/styling/src/index.css +++ b/samples/inputs/tooltip/styling/src/index.css @@ -1,2 +1,67 @@ /* shared styles are loaded from: */ -/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ \ No newline at end of file +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +.sample { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: center; + gap: 6.25rem; + padding: 3.9375rem 1rem 1rem; +} + +.trigger { + width: 17.5rem; + border: 1px solid #e0e0e0; +} + +.trigger igc-list-item { + padding: 0.5rem 1rem; +} + +.avatar { + position: relative; + display: flex; +} + +.avatar igc-badge { + position: absolute; + right: -0.3125rem; + bottom: -0.3125rem; +} + +.avatar igc-icon { + --ig-icon-size: 0.75rem; + + color: #fff; +} + +.registration { + --ig-size: var(--ig-size-small); + + width: 20.1875rem; +} + +.status-tooltip { + --ig-tooltip-background: rgb(255 233 238 / 90%); + --ig-tooltip-text-color: #212121; + --ig-tooltip-border-radius: 0.125rem; + --ig-tooltip-elevation: var(--ig-elevation-1); +} + +.status-tooltip::part(base) { + width: 12.5rem; + padding: 0.1875rem 0.5rem; +} + +.status-tooltip igc-icon { + --ig-icon-size: 1.125rem; + + flex-shrink: 0; + color: #ff134a; +} + +.hint-tooltip { + --ig-tooltip-background: rgb(1 118 255 / 90%); + --ig-tooltip-text-color: #fff; +} diff --git a/samples/inputs/tooltip/styling/src/index.ts b/samples/inputs/tooltip/styling/src/index.ts index 7288ca0254..1f36b9af3d 100644 --- a/samples/inputs/tooltip/styling/src/index.ts +++ b/samples/inputs/tooltip/styling/src/index.ts @@ -1,11 +1,26 @@ -import { defineComponents, IgcTooltipComponent, IgcAvatarComponent } from 'igniteui-webcomponents'; -import 'igniteui-webcomponents/themes/light/bootstrap.css'; -import './Styling.css'; +import { + defineComponents, + IgcAvatarComponent, + IgcBadgeComponent, + IgcDatePickerComponent, + IgcIconComponent, + IgcListComponent, + IgcListItemComponent, + IgcTooltipComponent, + registerIconFromText +} from 'igniteui-webcomponents'; +import 'igniteui-webcomponents/themes/light/material.css'; +import './index.css'; + +defineComponents(IgcAvatarComponent, IgcBadgeComponent, IgcDatePickerComponent, IgcIconComponent, IgcListComponent, IgcListItemComponent, IgcTooltipComponent); + +const blockIcon = ''; + +registerIconFromText('block', blockIcon, 'material'); -defineComponents(IgcTooltipComponent, IgcAvatarComponent); export class TooltipStyling { - constructor() { - } + constructor() { + } } new TooltipStyling(); diff --git a/samples/inputs/tooltip/tailwind-styling/.prettierrc b/samples/inputs/tooltip/tailwind-styling/.prettierrc new file mode 100644 index 0000000000..15a7c7c6cf --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/.prettierrc @@ -0,0 +1,11 @@ +{ + "printWidth": 250, + "tabWidth": 4, + "useTabs": false, + "semi": true, + "singleQuote": false, + "trailingComma": "none", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "fluid": false +} \ No newline at end of file diff --git a/samples/inputs/tooltip/tailwind-styling/ReadMe.md b/samples/inputs/tooltip/tailwind-styling/ReadMe.md new file mode 100644 index 0000000000..788dda36dc --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/ReadMe.md @@ -0,0 +1,56 @@ + + + +This folder contains implementation of Web Components application with example of Tailwind Styling feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. + + + + + + View Docs + + + View Code + + + Run Sample + + + Run Sample + + + + +## Branches + +> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-angular-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext) branch only when you want to contribute new samples to this repository. + +## Instructions + +To set up this project locally, execute these commands: + +``` +git clone https://github.com/IgniteUI/igniteui-wc-examples.git +git checkout master +cd ./igniteui-wc-examples +cd ./samples/inputs/tooltip/tailwind-styling +``` + +open above folder in VS Code or type: +``` +code . +``` + +In terminal window, run: + +``` +npm install +npm run start +``` + +Then open http://localhost:4200/ in your browser + + +## Learn More + +To learn more about **Ignite UI for Web Components**, check out the [Web Components documentation](https://infragistics.com/webcomponentssite/components/general-getting-started.html). diff --git a/samples/inputs/tooltip/tailwind-styling/index.html b/samples/inputs/tooltip/tailwind-styling/index.html new file mode 100644 index 0000000000..3dd36e8ed9 --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/index.html @@ -0,0 +1,113 @@ + + + + + Tooltip Tailwind Styling + + + + + + + + + + +
+
+
+ + + + + BTC + + + Daily: + 2,6% + + + + +
+ + BTC + + + + Exchange Balance + USD 81,459.00 + + + Assets Balance + USD 46,287.90 + +
+
+
+ + + +
+ +
+ + +
+
+
+
+
+ + + <% if (false) { %> + + <% } %> + + + diff --git a/samples/inputs/tooltip/tailwind-styling/package.json b/samples/inputs/tooltip/tailwind-styling/package.json new file mode 100644 index 0000000000..888efced56 --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/package.json @@ -0,0 +1,67 @@ +{ + "name": "wc-tooltip-tailwind-styling", + "version": "1.0.0", + "description": "This project provides an example of Tooltip tailwind styling using Ignite UI for Web Components", + "main": "src/index.ts", + "scripts": { + "build": "npm run build:prod", + "build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details", + "build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail", + "serve:dev": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --config ./webpack.config.js --hot --progress --open", + "serve:prod": "webpack-dev-server --env.NODE_ENV=production --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/", + "start": "npm run serve:dev", + "build:legacy": "npm run build:prod:legacy", + "build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details", + "build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail", + "serve:dev:legacy": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --env.legacy=true --mode development --config ./webpack.config.js --hot --progress --open", + "serve:prod:legacy": "webpack-dev-server --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/", + "start:legacy": "npm run serve:dev:legacy" + }, + "author": "Infragistics", + "dependencies": { + "@webcomponents/custom-elements": "^1.4.1", + "@webcomponents/template": "^1.4.2", + "babel-runtime": "^6.26.0", + "core-js": "^3.6.5", + "igniteui-webcomponents": "7.5.0", + "igniteui-webcomponents-charts": "7.1.0", + "igniteui-webcomponents-core": "7.1.0", + "lit": "^3.3.0", + "lit-html": "^3.3.1", + "postcss": "^8.5.6", + "tailwindcss": "^4.1.11", + "tslib": "^2.0.0" + }, + "devDependencies": { + "@babel/cli": "^7.28.3", + "@babel/core": "^7.28.4", + "@babel/plugin-transform-class-properties": "^7.27.1", + "@babel/plugin-transform-class-static-block": "^7.28.3", + "@babel/plugin-transform-runtime": "^7.28.3", + "@babel/preset-env": "^7.28.3", + "@babel/preset-typescript": "^7.27.1", + "@tailwindcss/postcss": "^4.1.11", + "@types/source-map": "^0.5.7", + "autoprefixer": "^10.4.21", + "babel-loader": "^10.0.0", + "babel-plugin-transform-custom-element-classes": "^0.1.0", + "css-loader": "^7.1.2", + "csv-loader": "^3.0.5", + "file-loader": "^6.2.0", + "fork-ts-checker-webpack-plugin": "^9.1.0", + "html-webpack-plugin": "^5.6.4", + "parcel-bundler": "^1.12.5", + "postcss-loader": "^8.1.1", + "source-map": "^0.7.6", + "style-loader": "^4.0.0", + "tsconfig-paths-webpack-plugin": "^4.2.0", + "typescript": "^5.9.2", + "webpack": "^5.101.3", + "webpack-cli": "^6.0.1", + "webpack-dev-server": "^5.2.2", + "worker-loader": "^3.0.8", + "xml-loader": "^1.2.1" + }, + "license": "", + "homepage": "." +} diff --git a/samples/inputs/tooltip/tailwind-styling/postcss.config.mjs b/samples/inputs/tooltip/tailwind-styling/postcss.config.mjs new file mode 100644 index 0000000000..b776c62238 --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/postcss.config.mjs @@ -0,0 +1,5 @@ +export default { + plugins: { + "@tailwindcss/postcss": {}, + } +} \ No newline at end of file diff --git a/samples/inputs/tooltip/triggers/sandbox.config.json b/samples/inputs/tooltip/tailwind-styling/sandbox.config.json similarity index 100% rename from samples/inputs/tooltip/triggers/sandbox.config.json rename to samples/inputs/tooltip/tailwind-styling/sandbox.config.json diff --git a/samples/inputs/tooltip/tailwind-styling/src/index.css b/samples/inputs/tooltip/tailwind-styling/src/index.css new file mode 100644 index 0000000000..72a05ffb61 --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/src/index.css @@ -0,0 +1,19 @@ +/* shared styles are loaded from: */ +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +@layer theme, base, components, utilities; +@import "tailwindcss/theme.css" layer(theme); +@import "tailwindcss/utilities.css" layer(utilities); +@import url("https://use.typekit.net/bng2zgw.css"); +@source "../index.html"; + +@theme { + --color-btc-ink: #00142b; + --color-btc-text: #212121; + --color-btc-muted: #616161; + --color-btc-border: #e0e0e0; + --color-btc-icon: #f95924; + --color-btc-exchange: #e04f1f; + --color-btc-accent: #0176ff; + --color-chart-border: #d2dbe8; +} diff --git a/samples/inputs/tooltip/tailwind-styling/src/index.ts b/samples/inputs/tooltip/tailwind-styling/src/index.ts new file mode 100644 index 0000000000..2abfb04fdb --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/src/index.ts @@ -0,0 +1,64 @@ +import { + defineComponents, + IgcIconComponent, + IgcListComponent, + IgcListItemComponent, + IgcTooltipComponent, + registerIconFromText +} from 'igniteui-webcomponents'; +import { + IgcCategoryChartComponent, + IgcCategoryChartModule, + IgcPieChartComponent, + IgcPieChartModule +} from 'igniteui-webcomponents-charts'; +import { ModuleManager } from 'igniteui-webcomponents-core'; +import 'igniteui-webcomponents/themes/light/material.css'; +import './index.css'; + +defineComponents(IgcIconComponent, IgcListComponent, IgcListItemComponent, IgcTooltipComponent); + +ModuleManager.register(IgcCategoryChartModule); +ModuleManager.register(IgcPieChartModule); + +const bitcoinIcon = ''; + +registerIconFromText('bitcoin', bitcoinIcon, 'material'); + +const portfolio = [ + { asset: 'Bitcoin', share: 56 }, + { asset: 'Ethereum', share: 24 }, + { asset: 'Other', share: 20 } +]; + +const balanceHistory = [ + { period: '2021', exchange: 7, assets: 5 }, + { period: 'Jul 2021', exchange: 10, assets: 8 }, + { period: '2022', exchange: 12, assets: 10 }, + { period: 'Jul 2022', exchange: 20, assets: 15 }, + { period: '2023', exchange: 20, assets: 13 }, + { period: 'Jul 2023', exchange: 28, assets: 8 }, + { period: '2024', exchange: 55, assets: 24 }, + { period: 'Jul 2024', exchange: 58, assets: 16 }, + { period: '2025', exchange: 43, assets: 18 } +]; + +export class TooltipTailwindStyling { + constructor() { + const pieChart = document.getElementById('pie-chart') as IgcPieChartComponent; + const balanceChart = document.getElementById('balance-chart') as IgcCategoryChartComponent; + const portfolioArea = document.getElementById('portfolio') as HTMLElement; + const portfolioTooltip = document.getElementById('portfolio-tooltip') as IgcTooltipComponent; + + pieChart.dataSource = portfolio; + balanceChart.dataSource = balanceHistory; + + portfolioArea.addEventListener('pointerenter', async () => { + await portfolioTooltip.show(); + balanceChart.notifyResized(); + }); + portfolioArea.addEventListener('pointerleave', () => portfolioTooltip.hide()); + } +} + +new TooltipTailwindStyling(); diff --git a/samples/inputs/tooltip/triggers/tsconfig.json b/samples/inputs/tooltip/tailwind-styling/tsconfig.json similarity index 100% rename from samples/inputs/tooltip/triggers/tsconfig.json rename to samples/inputs/tooltip/tailwind-styling/tsconfig.json diff --git a/samples/inputs/tooltip/tailwind-styling/webpack.config.js b/samples/inputs/tooltip/tailwind-styling/webpack.config.js new file mode 100644 index 0000000000..d3f749cc06 --- /dev/null +++ b/samples/inputs/tooltip/tailwind-styling/webpack.config.js @@ -0,0 +1,118 @@ +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); +const path = require('path'); +const webpack = require('webpack'); + +module.exports = env => { + const nodeEnv = process.env.NODE_ENV || 'development'; + const isProd = nodeEnv === 'production'; + const isLegacy = !!process.env.legacy && !(process.env.legacy == "false"); + console.log(">> webpack nodeEnv=" + nodeEnv); + console.log(">> webpack isProd=" + isProd); + console.log(">> webpack isLegacy=" + isLegacy); + const presets = [ + ["@babel/preset-env", { + "useBuiltIns": "usage", + "corejs": 3, + "targets": { + "browsers": isLegacy ? ["defaults"] : [ + "last 2 Chrome versions", + "last 2 Safari versions", + "last 2 iOS versions", + "last 2 Firefox versions", + "last 2 Edge versions"] + } + }], + "@babel/preset-typescript" + ]; + + return { + entry: isLegacy ? [ + path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'), + path.resolve(__dirname, 'node_modules/@webcomponents/template'), + path.resolve(__dirname, 'src') + ] : path.resolve(__dirname, 'src'), + devtool: isProd ? false : 'source-map', + output: { + filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js', + globalObject: 'this', + path: path.resolve(__dirname, 'dist'), + }, + + resolve: { + mainFields: ['esm2015', 'module', 'main'], + extensions: ['.ts', '.js', '.json'], + plugins: [new TsconfigPathsPlugin({ + configFile: './tsconfig.json', + extensions: ['.ts', '.js'], + mainFields: ['esm2015', 'module', 'main'] + })] + }, + + module: { + rules: [ + { test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] }, + { test: /\.(csv|tsv)$/, use: ['csv-loader'] }, + { test: /\.xml$/, use: ['xml-loader'] }, + { + test: /\.css$/, + sideEffects: true, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { importLoaders: 1 } + }, + 'postcss-loader' + ] + }, + { + test: /worker\.(ts|js)$/, + use: [ + { loader: 'worker-loader' }, + { + loader: 'babel-loader', options: { + "compact": isProd ? true : false, + "presets": presets, + "plugins": [ + "@babel/plugin-transform-class-static-block", + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-runtime" + ] + } + } + ] + }, + { + test: /\.(ts|js)$/, loader: 'babel-loader', + options: { + "compact": isProd ? true : false, + "presets": presets, + "plugins": [ + "@babel/plugin-transform-class-static-block", + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-runtime" + ] + }, + exclude: + function (modulePath) { + return /node_modules/.test(modulePath) && + !/igniteui-webcomponents/.test(modulePath) && + !/lit-html/.test(modulePath); + } + }], + }, + + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(nodeEnv) + }), + new HtmlWebpackPlugin({ + title: 'for-cs', + template: 'index.html' + }), + new ForkTsCheckerWebpackPlugin() + ] + }; +}; diff --git a/samples/inputs/tooltip/triggers/index.html b/samples/inputs/tooltip/triggers/index.html deleted file mode 100644 index cb360de4be..0000000000 --- a/samples/inputs/tooltip/triggers/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - Tooltip Triggers - - - - - - - - - - -
-
-
- - -

Default triggers

-
- -

- Hovering over the button below will display the tooltip using its default configuration: it appears on pointer enter and hides on pointer leave or click. -

- Hover over me - - I am show on pointer enter and hidden on pointer leave and/or click. - -
-
- - - -

Focus based

-
- -

- In this instance, the tooltip is bound to show on its anchor - focus and will hide when its anchor is - blurred. -

-

Try to navigate with a Tab key to the anchor to see the effect.

- Focus me - - I am shown on focus and hidden on blur. - -
-
- - - -

Same trigger(s) for showing and hiding

-
- -

- The same trigger can be bound to both show and hide the tooltip. The - button below has its tooltip bound to show/hide on - click. -

- Click - - I am show on click and will hide on anchor click. - -
-
- - - -

Keyboard interactions

-
- -

- Keyboard interactions are also supported. The button below has its - tooltip bound to show on a keypress and hide on a - keypress or blur. -

-

Try it out by focusing the button and pressing a key.

- Press a key - - I am shown on a keypress and will hide on a keypress or blur. - -
-
- - - -

Custom events

-
- -

- The tooltip supports any DOM event, including custom events. Try entering a value in the input below, then "commit" it by either blurring the input or pressing Enter. -

- - - Value changed! - -
-
-
-
-
- - - <% if (false) { %> - - <% } %> - - - \ No newline at end of file diff --git a/samples/inputs/tooltip/triggers/src/index.css b/samples/inputs/tooltip/triggers/src/index.css deleted file mode 100644 index ee8ecd81f4..0000000000 --- a/samples/inputs/tooltip/triggers/src/index.css +++ /dev/null @@ -1,29 +0,0 @@ -/* shared styles are loaded from: */ -/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ - -#triggers-container { - display: flex; - flex-wrap: wrap; - align-content: space-between; - gap: 0.6rem; - - & igc-card { - max-width: 320px; - } - - & igc-card-header { - min-height: 3rem; - } - - & igc-card-content { - display: flex; - height: 100%; - flex-direction: column; - gap: 0.5rem; - justify-content: space-between; - } -} - -.sample { - padding: 0.5rem 0rem 0rem 0.5rem; -} \ No newline at end of file diff --git a/samples/inputs/tooltip/triggers/src/index.ts b/samples/inputs/tooltip/triggers/src/index.ts deleted file mode 100644 index 0302825b68..0000000000 --- a/samples/inputs/tooltip/triggers/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { defineComponents, IgcTooltipComponent, IgcAvatarComponent, IgcButtonComponent, IgcInputComponent, IgcCardComponent } from 'igniteui-webcomponents'; -import 'igniteui-webcomponents/themes/light/bootstrap.css'; -import './index.css'; - -defineComponents(IgcTooltipComponent, IgcAvatarComponent, IgcButtonComponent, IgcInputComponent, IgcCardComponent); -export class TooltipTriggers { - constructor() { - } -} - -new TooltipTriggers(); diff --git a/samples/inputs/tooltip/variants/.prettierrc b/samples/inputs/tooltip/variants/.prettierrc new file mode 100644 index 0000000000..15a7c7c6cf --- /dev/null +++ b/samples/inputs/tooltip/variants/.prettierrc @@ -0,0 +1,11 @@ +{ + "printWidth": 250, + "tabWidth": 4, + "useTabs": false, + "semi": true, + "singleQuote": false, + "trailingComma": "none", + "bracketSpacing": true, + "jsxBracketSameLine": false, + "fluid": false +} \ No newline at end of file diff --git a/samples/inputs/tooltip/triggers/ReadMe.md b/samples/inputs/tooltip/variants/ReadMe.md similarity index 91% rename from samples/inputs/tooltip/triggers/ReadMe.md rename to samples/inputs/tooltip/variants/ReadMe.md index 1583f68c37..21c10f0994 100644 --- a/samples/inputs/tooltip/triggers/ReadMe.md +++ b/samples/inputs/tooltip/variants/ReadMe.md @@ -1,7 +1,7 @@ -This folder contains implementation of Web Components application with example of Triggers feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. +This folder contains implementation of Web Components application with example of Variants feature using [Tooltip](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component. @@ -12,10 +12,10 @@ This folder contains implementation of Web Components application with example o View Code - + Run Sample - + Run Sample @@ -33,7 +33,7 @@ To set up this project locally, execute these commands: git clone https://github.com/IgniteUI/igniteui-wc-examples.git git checkout master cd ./igniteui-wc-examples -cd ./samples/inputs/tooltip/triggers +cd ./samples/inputs/tooltip/variants ``` open above folder in VS Code or type: diff --git a/samples/inputs/tooltip/rich/index.html b/samples/inputs/tooltip/variants/index.html similarity index 51% rename from samples/inputs/tooltip/rich/index.html rename to samples/inputs/tooltip/variants/index.html index 7cd884d460..7fd4fb4432 100644 --- a/samples/inputs/tooltip/rich/index.html +++ b/samples/inputs/tooltip/variants/index.html @@ -2,7 +2,7 @@ - Rich Tooltip + Tooltip Variants @@ -14,22 +14,17 @@
-
-
- - -
- -
-
Infragistics Inc. HQ
-
2 Commerce Dr, Cranbury, NJ 08512, USA
-
-
-
+
+
+
+
+
+
+ Tooltip message + Tooltip message + Tooltip message + Tooltip message
@@ -39,4 +34,4 @@ <% } %> - \ No newline at end of file + diff --git a/samples/inputs/tooltip/placement/package.json b/samples/inputs/tooltip/variants/package.json similarity index 95% rename from samples/inputs/tooltip/placement/package.json rename to samples/inputs/tooltip/variants/package.json index aef641783e..f02681997b 100644 --- a/samples/inputs/tooltip/placement/package.json +++ b/samples/inputs/tooltip/variants/package.json @@ -1,7 +1,7 @@ { - "name": "wc-snackbar-overview", + "name": "wc-tooltip-variants", "version": "1.0.0", - "description": "This project provides example of Snackbar Overview using IgniteUI for Web Components", + "description": "This project provides an example of Tooltip variants using Ignite UI for Web Components", "main": "src/index.ts", "scripts": { "build": "npm run build:prod", diff --git a/samples/inputs/tooltip/variants/sandbox.config.json b/samples/inputs/tooltip/variants/sandbox.config.json new file mode 100644 index 0000000000..5c5b54fe21 --- /dev/null +++ b/samples/inputs/tooltip/variants/sandbox.config.json @@ -0,0 +1,7 @@ +{ + "infiniteLoopProtection": false, + "hardReloadOnChange": false, + "view": "browser", + "template": "parcel" +} + \ No newline at end of file diff --git a/samples/inputs/tooltip/variants/src/index.css b/samples/inputs/tooltip/variants/src/index.css new file mode 100644 index 0000000000..948fe24716 --- /dev/null +++ b/samples/inputs/tooltip/variants/src/index.css @@ -0,0 +1,25 @@ +/* shared styles are loaded from: */ +/* https://dl.infragistics.com/x/css/samples/shared.v8.css */ + +.sample { + display: flex; + align-items: center; + justify-content: center; + padding: 2.875rem 1rem 1rem; +} + +.variants { + display: grid; + grid-template-columns: repeat(2, 1.5rem); + column-gap: 11.375rem; + row-gap: 5.125rem; +} + +.target { + box-sizing: border-box; + width: 1.5rem; + height: 1.5rem; + border: 1px dashed #e8178a; + border-radius: 0.125rem; + background: rgb(232 23 138 / 20%); +} diff --git a/samples/inputs/tooltip/variants/src/index.ts b/samples/inputs/tooltip/variants/src/index.ts new file mode 100644 index 0000000000..4ae38e3501 --- /dev/null +++ b/samples/inputs/tooltip/variants/src/index.ts @@ -0,0 +1,12 @@ +import { defineComponents, IgcTooltipComponent } from 'igniteui-webcomponents'; +import 'igniteui-webcomponents/themes/light/bootstrap.css'; +import './index.css'; + +defineComponents(IgcTooltipComponent); + +export class TooltipVariants { + constructor() { + } +} + +new TooltipVariants(); diff --git a/samples/inputs/tooltip/variants/tsconfig.json b/samples/inputs/tooltip/variants/tsconfig.json new file mode 100644 index 0000000000..de23257dd8 --- /dev/null +++ b/samples/inputs/tooltip/variants/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "noImplicitReturns": true, + "esModuleInterop": true, + "noImplicitAny": true, + "declarationDir": "dist/types", + "moduleResolution": "node", + "declaration": true, + "target": "es2015", + "module": "es2015", + "strict": true + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/samples/inputs/tooltip/triggers/webpack.config.js b/samples/inputs/tooltip/variants/webpack.config.js similarity index 100% rename from samples/inputs/tooltip/triggers/webpack.config.js rename to samples/inputs/tooltip/variants/webpack.config.js