@limetech/lime-elements 38.3.2 → 38.4.0
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/CHANGELOG.md +16 -0
- package/dist/cjs/limel-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-badge_3.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +16 -0
- package/dist/collection/components/badge/badge.css +18 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +16 -0
- package/dist/collection/components/button/button.css +16 -0
- package/dist/collection/components/button-group/button-group.css +16 -0
- package/dist/collection/components/card/card.css +16 -0
- package/dist/collection/components/chart/chart.css +32 -0
- package/dist/collection/components/checkbox/checkbox.css +16 -0
- package/dist/collection/components/chip/chip.css +16 -0
- package/dist/collection/components/chip-set/chip-set.css +32 -0
- package/dist/collection/components/circular-progress/circular-progress.css +16 -0
- package/dist/collection/components/code-editor/code-editor.css +16 -0
- package/dist/collection/components/collapsible-section/collapsible-section.css +16 -0
- package/dist/collection/components/color-picker/color-picker-palette.css +32 -0
- package/dist/collection/components/color-picker/color-picker.css +16 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +16 -0
- package/dist/collection/components/dialog/dialog.css +16 -0
- package/dist/collection/components/dock/dock-button/dock-button.css +16 -0
- package/dist/collection/components/dock/dock.css +16 -0
- package/dist/collection/components/file/file.css +16 -0
- package/dist/collection/components/file-viewer/file-viewer.css +16 -0
- package/dist/collection/components/form/form.css +16 -0
- package/dist/collection/components/header/header.css +16 -0
- package/dist/collection/components/help/help.css +16 -0
- package/dist/collection/components/help/limel-help-content.css +16 -0
- package/dist/collection/components/icon-button/icon-button.css +16 -0
- package/dist/collection/components/info-tile/info-tile.css +16 -0
- package/dist/collection/components/input-field/input-field.css +16 -0
- package/dist/collection/components/list/list.css +80 -0
- package/dist/collection/components/markdown/markdown.css +32 -0
- package/dist/collection/components/menu-list/menu-list.css +80 -0
- package/dist/collection/components/popover-surface/popover-surface.css +16 -0
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +16 -0
- package/dist/collection/components/select/select.css +32 -0
- package/dist/collection/components/shortcut/shortcut.css +16 -0
- package/dist/collection/components/slider/slider.css +16 -0
- package/dist/collection/components/split-button/split-button.css +16 -0
- package/dist/collection/components/switch/switch.css +16 -0
- package/dist/collection/components/table/table.css +64 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +48 -0
- package/dist/collection/components/text-editor/text-editor.css +16 -0
- package/dist/collection/style/mixins.scss +60 -0
- package/dist/esm/limel-badge_3.entry.js +1 -1
- package/dist/esm/limel-badge_3.entry.js.map +1 -1
- package/dist/esm/limel-dialog.entry.js.map +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-66501d69.entry.js +2 -0
- package/dist/lime-elements/p-66501d69.entry.js.map +1 -0
- package/dist/lime-elements/p-89eaca66.entry.js.map +1 -1
- package/dist/lime-elements/p-ece3a0f5.entry.js +2 -0
- package/dist/lime-elements/{p-2963426c.entry.js.map → p-ece3a0f5.entry.js.map} +1 -1
- package/dist/lime-elements/style/mixins.scss +60 -0
- package/dist/scss/mixins.scss +60 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-2963426c.entry.js +0 -2
- package/dist/lime-elements/p-aad274aa.entry.js +0 -2
- package/dist/lime-elements/p-aad274aa.entry.js.map +0 -1
|
@@ -57,6 +57,22 @@
|
|
|
57
57
|
* to enable you to truncate a piece of text,
|
|
58
58
|
* after a certain number of lines.
|
|
59
59
|
*/
|
|
60
|
+
/**
|
|
61
|
+
* The breakpoints below are used to create responsive designs
|
|
62
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
63
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
64
|
+
* file, to create consistent styles.
|
|
65
|
+
*
|
|
66
|
+
* :::important
|
|
67
|
+
* In very rare cases you should used media queries!
|
|
68
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
69
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
70
|
+
* :::
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* Media query mixins for responsive design based on screen width.
|
|
74
|
+
* Note that these mixins do not detect the device type!
|
|
75
|
+
*/
|
|
60
76
|
:host(limel-split-button.has-menu) {
|
|
61
77
|
--button-padding-right: 2rem;
|
|
62
78
|
}
|
|
@@ -913,6 +913,22 @@ label {
|
|
|
913
913
|
* to enable you to truncate a piece of text,
|
|
914
914
|
* after a certain number of lines.
|
|
915
915
|
*/
|
|
916
|
+
/**
|
|
917
|
+
* The breakpoints below are used to create responsive designs
|
|
918
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
919
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
920
|
+
* file, to create consistent styles.
|
|
921
|
+
*
|
|
922
|
+
* :::important
|
|
923
|
+
* In very rare cases you should used media queries!
|
|
924
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
925
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
926
|
+
* :::
|
|
927
|
+
*/
|
|
928
|
+
/**
|
|
929
|
+
* Media query mixins for responsive design based on screen width.
|
|
930
|
+
* Note that these mixins do not detect the device type!
|
|
931
|
+
*/
|
|
916
932
|
:host(limel-switch:focus),
|
|
917
933
|
:host(limel-switch:focus-visible),
|
|
918
934
|
:host(limel-switch:focus-within) {
|
|
@@ -57,6 +57,22 @@
|
|
|
57
57
|
* to enable you to truncate a piece of text,
|
|
58
58
|
* after a certain number of lines.
|
|
59
59
|
*/
|
|
60
|
+
/**
|
|
61
|
+
* The breakpoints below are used to create responsive designs
|
|
62
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
63
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
64
|
+
* file, to create consistent styles.
|
|
65
|
+
*
|
|
66
|
+
* :::important
|
|
67
|
+
* In very rare cases you should used media queries!
|
|
68
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
69
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
70
|
+
* :::
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* Media query mixins for responsive design based on screen width.
|
|
74
|
+
* Note that these mixins do not detect the device type!
|
|
75
|
+
*/
|
|
60
76
|
/*
|
|
61
77
|
* This file is imported into every component!
|
|
62
78
|
*
|
|
@@ -1300,6 +1316,22 @@ body.tabulator-print-fullscreen-hide > *:not(.tabulator-print-fullscreen) {
|
|
|
1300
1316
|
* to enable you to truncate a piece of text,
|
|
1301
1317
|
* after a certain number of lines.
|
|
1302
1318
|
*/
|
|
1319
|
+
/**
|
|
1320
|
+
* The breakpoints below are used to create responsive designs
|
|
1321
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
1322
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
1323
|
+
* file, to create consistent styles.
|
|
1324
|
+
*
|
|
1325
|
+
* :::important
|
|
1326
|
+
* In very rare cases you should used media queries!
|
|
1327
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
1328
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
1329
|
+
* :::
|
|
1330
|
+
*/
|
|
1331
|
+
/**
|
|
1332
|
+
* Media query mixins for responsive design based on screen width.
|
|
1333
|
+
* Note that these mixins do not detect the device type!
|
|
1334
|
+
*/
|
|
1303
1335
|
/*
|
|
1304
1336
|
* This file is imported into every component!
|
|
1305
1337
|
*
|
|
@@ -1508,6 +1540,22 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1508
1540
|
* to enable you to truncate a piece of text,
|
|
1509
1541
|
* after a certain number of lines.
|
|
1510
1542
|
*/
|
|
1543
|
+
/**
|
|
1544
|
+
* The breakpoints below are used to create responsive designs
|
|
1545
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
1546
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
1547
|
+
* file, to create consistent styles.
|
|
1548
|
+
*
|
|
1549
|
+
* :::important
|
|
1550
|
+
* In very rare cases you should used media queries!
|
|
1551
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
1552
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
1553
|
+
* :::
|
|
1554
|
+
*/
|
|
1555
|
+
/**
|
|
1556
|
+
* Media query mixins for responsive design based on screen width.
|
|
1557
|
+
* Note that these mixins do not detect the device type!
|
|
1558
|
+
*/
|
|
1511
1559
|
/*
|
|
1512
1560
|
* This file is imported into every component!
|
|
1513
1561
|
*
|
|
@@ -1676,6 +1724,22 @@ button.tabulator-page[data-page=first]:not([disabled]):hover:after, button.tabul
|
|
|
1676
1724
|
* to enable you to truncate a piece of text,
|
|
1677
1725
|
* after a certain number of lines.
|
|
1678
1726
|
*/
|
|
1727
|
+
/**
|
|
1728
|
+
* The breakpoints below are used to create responsive designs
|
|
1729
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
1730
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
1731
|
+
* file, to create consistent styles.
|
|
1732
|
+
*
|
|
1733
|
+
* :::important
|
|
1734
|
+
* In very rare cases you should used media queries!
|
|
1735
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
1736
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
1737
|
+
* :::
|
|
1738
|
+
*/
|
|
1739
|
+
/**
|
|
1740
|
+
* Media query mixins for responsive design based on screen width.
|
|
1741
|
+
* Note that these mixins do not detect the device type!
|
|
1742
|
+
*/
|
|
1679
1743
|
/*
|
|
1680
1744
|
* This file is imported into every component!
|
|
1681
1745
|
*
|
|
@@ -464,6 +464,22 @@ li {
|
|
|
464
464
|
* to enable you to truncate a piece of text,
|
|
465
465
|
* after a certain number of lines.
|
|
466
466
|
*/
|
|
467
|
+
/**
|
|
468
|
+
* The breakpoints below are used to create responsive designs
|
|
469
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
470
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
471
|
+
* file, to create consistent styles.
|
|
472
|
+
*
|
|
473
|
+
* :::important
|
|
474
|
+
* In very rare cases you should used media queries!
|
|
475
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
476
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
477
|
+
* :::
|
|
478
|
+
*/
|
|
479
|
+
/**
|
|
480
|
+
* Media query mixins for responsive design based on screen width.
|
|
481
|
+
* Note that these mixins do not detect the device type!
|
|
482
|
+
*/
|
|
467
483
|
/*
|
|
468
484
|
* This file is imported into every component!
|
|
469
485
|
*
|
|
@@ -599,6 +615,22 @@ table {
|
|
|
599
615
|
* to enable you to truncate a piece of text,
|
|
600
616
|
* after a certain number of lines.
|
|
601
617
|
*/
|
|
618
|
+
/**
|
|
619
|
+
* The breakpoints below are used to create responsive designs
|
|
620
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
621
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
622
|
+
* file, to create consistent styles.
|
|
623
|
+
*
|
|
624
|
+
* :::important
|
|
625
|
+
* In very rare cases you should used media queries!
|
|
626
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
627
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
628
|
+
* :::
|
|
629
|
+
*/
|
|
630
|
+
/**
|
|
631
|
+
* Media query mixins for responsive design based on screen width.
|
|
632
|
+
* Note that these mixins do not detect the device type!
|
|
633
|
+
*/
|
|
602
634
|
kbd {
|
|
603
635
|
font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
|
|
604
636
|
font-weight: 600;
|
|
@@ -681,6 +713,22 @@ img {
|
|
|
681
713
|
* to enable you to truncate a piece of text,
|
|
682
714
|
* after a certain number of lines.
|
|
683
715
|
*/
|
|
716
|
+
/**
|
|
717
|
+
* The breakpoints below are used to create responsive designs
|
|
718
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
719
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
720
|
+
* file, to create consistent styles.
|
|
721
|
+
*
|
|
722
|
+
* :::important
|
|
723
|
+
* In very rare cases you should used media queries!
|
|
724
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
725
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
726
|
+
* :::
|
|
727
|
+
*/
|
|
728
|
+
/**
|
|
729
|
+
* Media query mixins for responsive design based on screen width.
|
|
730
|
+
* Note that these mixins do not detect the device type!
|
|
731
|
+
*/
|
|
684
732
|
.image-wrapper {
|
|
685
733
|
display: inline-flex;
|
|
686
734
|
position: relative;
|
|
@@ -123,6 +123,22 @@
|
|
|
123
123
|
* to enable you to truncate a piece of text,
|
|
124
124
|
* after a certain number of lines.
|
|
125
125
|
*/
|
|
126
|
+
/**
|
|
127
|
+
* The breakpoints below are used to create responsive designs
|
|
128
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
129
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
130
|
+
* file, to create consistent styles.
|
|
131
|
+
*
|
|
132
|
+
* :::important
|
|
133
|
+
* In very rare cases you should used media queries!
|
|
134
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
135
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
136
|
+
* :::
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Media query mixins for responsive design based on screen width.
|
|
140
|
+
* Note that these mixins do not detect the device type!
|
|
141
|
+
*/
|
|
126
142
|
/**
|
|
127
143
|
* @prop --text-editor-max-height: the tallest height the text editor can become when auto-resizing itself. Defaults to `calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem)`.
|
|
128
144
|
* @prop --text-editor-fade-out-background-color: the color of the fade-out effect at the top and bottom of the text editor, when the text-editor is in readonly state. Defaults to rgb(var(--contrast-100)).
|
|
@@ -542,3 +542,63 @@ $clickable-normal-state-transitions: (
|
|
|
542
542
|
box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-pressed);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* The breakpoints below are used to create responsive designs
|
|
548
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
549
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
550
|
+
* file, to create consistent styles.
|
|
551
|
+
*
|
|
552
|
+
* :::important
|
|
553
|
+
* In very rare cases you should used media queries!
|
|
554
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
555
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
556
|
+
* :::
|
|
557
|
+
*/
|
|
558
|
+
$narrow-viewport-breakpoint: 800px;
|
|
559
|
+
$medium-viewport-breakpoint: 1023px;
|
|
560
|
+
// At this breakpoint, `limel-dialog` switches the layout of `slot="button"`
|
|
561
|
+
// and stretches the buttons to full-width.
|
|
562
|
+
$narrow-dialog-breakpoint: 760px;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Media query mixins for responsive design based on screen width.
|
|
566
|
+
* Note that these mixins do not detect the device type!
|
|
567
|
+
*/
|
|
568
|
+
@mixin when-viewport-width-is-narrow {
|
|
569
|
+
// What our products consider as mobile (held in portrait mode)
|
|
570
|
+
@media (max-width: #{$narrow-viewport-breakpoint}) {
|
|
571
|
+
@content;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
@mixin when-viewport-width-is-not-narrow {
|
|
576
|
+
// Wider than what our products consider as mobile (held in portrait mode)
|
|
577
|
+
@media (min-width: #{$narrow-viewport-breakpoint + 1px}) {
|
|
578
|
+
@content;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
@mixin when-viewport-width-is-medium {
|
|
583
|
+
// What our products consider as to be bigger than a phone,
|
|
584
|
+
// but not bigger than a tablet (held in landscape mode)
|
|
585
|
+
// or a small laptop screen.
|
|
586
|
+
@media (min-width: #{$narrow-viewport-breakpoint + 1px}) and (max-width: #{$medium-viewport-breakpoint}) {
|
|
587
|
+
@content;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
@mixin when-viewport-width-is-not-large {
|
|
592
|
+
// What our products consider as a phone,
|
|
593
|
+
// or a small tablet (held in landscape mode) or a small laptop screen.
|
|
594
|
+
@media (max-width: #{$medium-viewport-breakpoint}) {
|
|
595
|
+
@content;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
@mixin when-viewport-width-is-large {
|
|
600
|
+
// What our products consider wider than tablet (held in landscape mode)
|
|
601
|
+
@media (min-width: #{$medium-viewport-breakpoint + 1px}) {
|
|
602
|
+
@content;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
@@ -3,7 +3,7 @@ import { a as abbreviate } from './format-57cd836a.js';
|
|
|
3
3
|
import { c as createRandomString } from './random-string-e74dc48d.js';
|
|
4
4
|
import './_commonjsHelpers-5ec8f9b7.js';
|
|
5
5
|
|
|
6
|
-
const badgeCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host([hidden]){display:none}:host(limel-badge){--limel-min-badge-size:1rem;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;min-height:var(--limel-min-badge-size);min-width:var(--limel-min-badge-size)}span{cursor:default;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:0.6875rem;line-height:var(--limel-min-badge-size);color:var(--badge-text-color, rgb(var(--contrast-1200)));border-radius:var(--limel-min-badge-size);max-height:var(--limel-min-badge-size);min-width:0.5rem;min-height:0.5rem;background-color:var(--badge-background-color, rgb(var(--contrast-500)))}span:not(:empty){min-width:var(--limel-min-badge-size);max-width:2.75rem;padding:0 0.28125rem}:host(.has-large-label) span{cursor:help}";
|
|
6
|
+
const badgeCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host([hidden]){display:none}:host(limel-badge){--limel-min-badge-size:1rem;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;min-height:var(--limel-min-badge-size);min-width:var(--limel-min-badge-size)}span{cursor:default;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:0.6875rem;line-height:var(--limel-min-badge-size);color:var(--badge-text-color, rgb(var(--contrast-1200)));border-radius:var(--limel-min-badge-size);max-height:var(--limel-min-badge-size);min-width:0.5rem;min-height:0.5rem;background-color:var(--badge-background-color, rgb(var(--contrast-500)))}span:not(:empty){min-width:var(--limel-min-badge-size);max-width:var(--badge-max-width, 2.75rem);padding:0 0.28125rem}:host(.has-large-label) span{cursor:help}";
|
|
7
7
|
|
|
8
8
|
const Badge = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"limel-badge.limel-tooltip.limel-tooltip-content.entry.js","mappings":";;;;;AAAA,MAAM,QAAQ,GAAG,w7DAAw7D;;MCgB57D,KAAK;;;;;EAUP,MAAM;IACT,QACI,EAAC,IAAI,IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,EAC5C,KAAK,EAAE;QACH,iBAAiB,EAAE,IAAI,CAAC,YAAY,EAAE;OACzC,IAED,gBAAO,IAAI,CAAC,WAAW,EAAE,CAAQ,CAC9B,EACT;GACL;EAEO,WAAW;IACf,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;MAChC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC;GACrB;EAEO,YAAY;IAChB,MAAM,iBAAiB,GAAG,GAAG,CAAC;IAC9B,MAAM,gBAAgB,GAAG,CAAC,CAAC;IAC3B,IACI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CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;KACpE;IAED,MAAM,KAAK,GAAQ,EAAE,CAAC;IACtB,IAAI,IAAI,CAAC,SAAS,EAAE;MAChB,KAAK,CAAC,KAAK,GAAG;QACV,6BAA6B,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI;OAC5D,CAAC;KACL;IAED,OAAO;MACH,0BAAM,KAAK,EAAE,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAM,KAAK,GAC7D,WAAK,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAO,EACrC,WAAK,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,WAAW,CAAO,CAC/C;KACV,CAAC;GACL;;;;;;","names":[],"sources":["./src/components/badge/badge.scss?tag=limel-badge&encapsulation=shadow","./src/components/badge/badge.tsx","./src/components/tooltip/getOwnerElement.tsx","./src/components/tooltip/tooltipTimer.ts","./src/components/tooltip/tooltip.scss?tag=limel-tooltip&encapsulation=shadow","./src/components/tooltip/tooltip.tsx","./src/components/tooltip/tooltip-content.scss?tag=limel-tooltip-content&encapsulation=shadow","./src/components/tooltip/tooltip-content.tsx"],"sourcesContent":["@use '../../style/functions';\n@use '../../style/internal/lime-theme';\n@use '../../style/mixins';\n\n/**\n * @prop --badge-background-color: badge background color\n * @prop --badge-text-color: badge text color\n */\n\n:host([hidden]) {\n display: none;\n}\n\n:host(limel-badge) {\n --limel-min-badge-size: 1rem;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n min-height: var(--limel-min-badge-size);\n min-width: var(--limel-min-badge-size);\n}\n\nspan {\n cursor: default;\n box-sizing: border-box;\n\n @include mixins.truncate-text;\n text-align: center;\n font-size: functions.pxToRem(11);\n line-height: var(--limel-min-badge-size);\n\n color: var(--badge-text-color, rgb(var(--contrast-1200)));\n\n border-radius: var(--limel-min-badge-size);\n max-height: var(--limel-min-badge-size);\n min-width: 0.5rem;\n min-height: 0.5rem;\n\n background-color: var(--badge-background-color, rgb(var(--contrast-500)));\n\n &:not(:empty) {\n min-width: var(\n --limel-min-badge-size\n ); // ensures that a badge with only one character rendered as perfect circle\n max-width: 2.75rem;\n padding: 0 functions.pxToRem(4.5);\n }\n}\n\n:host(.has-large-label) {\n span {\n cursor: help;\n }\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { abbreviate } from './format';\n\n/**\n * The Badge component can be used to display a notification badge,\n * optionally with a number or a text label.\n *\n * @exampleComponent limel-example-badge\n * @exampleComponent limel-example-badge-number\n * @exampleComponent limel-example-badge-string\n */\n@Component({\n tag: 'limel-badge',\n styleUrl: 'badge.scss',\n shadow: true,\n})\nexport class Badge {\n /**\n * Label to display in the badge.\n * Numeric labels larger than 999 will be rounded and abbreviated.\n * String labels get truncated if their length is longer than\n * six characters.\n */\n @Prop({ reflect: true })\n public label?: number | string;\n\n public render() {\n return (\n <Host\n title={this.labelIsLarge() ? this.label : ''}\n class={{\n 'has-large-label': this.labelIsLarge(),\n }}\n >\n <span>{this.renderLabel()}</span>\n </Host>\n );\n }\n\n private renderLabel() {\n if (typeof this.label === 'number') {\n return abbreviate(this.label);\n }\n\n return this.label;\n }\n\n private labelIsLarge() {\n const largeNumericLabel = 999;\n const largeStringLabel = 6;\n if (\n (typeof this.label === 'number' &&\n this.label > largeNumericLabel) ||\n (typeof this.label === 'string' &&\n this.label.length > largeStringLabel)\n ) {\n return true;\n }\n }\n}\n","export function getOwnerElement(\n id: string,\n startingPoint: Node,\n): HTMLElement | undefined {\n let element: Node = startingPoint;\n\n do {\n element = element.parentNode;\n } while (\n element &&\n element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&\n element.nodeType !== Node.DOCUMENT_NODE\n );\n\n return (element as ShadowRoot)?.getElementById(id);\n}\n","const DEFAULT_DELAY_FOR_SHOWING = 500;\n\nexport class TooltipTimer {\n private timerHandle: number | null = null;\n private showCallback: Function;\n private hideCallback: Function;\n private delayForShowing: number;\n\n constructor(\n showCallback: Function,\n hideCallback: Function,\n delayForShowing: number = DEFAULT_DELAY_FOR_SHOWING,\n ) {\n this.showCallback = showCallback;\n this.hideCallback = hideCallback;\n this.delayForShowing = delayForShowing;\n }\n\n showAfterDelay(): void {\n if (!this.timerHandle) {\n this.timerHandle = setTimeout(\n this.showCallback,\n this.delayForShowing,\n );\n }\n }\n\n hide(): void {\n clearTimeout(this.timerHandle);\n this.timerHandle = null;\n this.hideCallback();\n }\n}\n","/**\n * @prop --tooltip-z-index: z-index of the tooltip.\n */\n\n:host(limel-tooltip) {\n // Absolutely positioning ensures that this invisible element\n // does not occupy visible space in the UI.\n // Without this, `limel-tooltip` could in many cases\n // mess up the layout, where it is used.\n // For example, inside a `grid` or `flex` section,\n // every instance of the tooltip would take some space,\n // creating gaps and empty holes.\n position: absolute;\n pointer-events: none;\n}\n","import { Component, h, Prop, Element, State } from '@stencil/core';\nimport { JSX } from 'react';\nimport { createRandomString } from '../../util/random-string';\nimport { OpenDirection } from '../menu/menu.types';\nimport { getOwnerElement } from './getOwnerElement';\nimport { TooltipTimer } from './tooltipTimer';\n\nconst DEFAULT_MAX_LENGTH = 50;\n\n/**\n * A tooltip can be used to display a descriptive text for any element.\n * The displayed content must be a brief and supplemental string of text,\n * identifying the element or describing its function for the user,\n * helping them better understand unfamiliar objects that aren't described\n * directly in the UI.\n *\n * ## Interaction\n * The tooltip appears after a slight delay, when the element is hovered;\n * and disappears as soon as the cursor leaves the element.\n * Therefore, users cannot interact with the tip, but if the trigger element\n * itself is interactive, it will remain interactible even with a tooltip bound\n * to it.\n *\n * :::note\n * In order to display the tooltip, the tooltip element and its trigger element\n * must be within the same document or document fragment (the same shadowRoot).\n * Often, it's easiest to just place them next to each other like in the example\n * below, but if you need to, you can place them differently.\n *\n * ```html\n * <limel-button icon=\"search\" id=\"tooltip-example\" />\n * <limel-tooltip label=\"Search\" elementId=\"tooltip-example\" />\n * ```\n * :::\n *\n * ## Usage\n * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.\n * Use them only when they add significant value.\n * - A good tip is concise, helpful, and informative.\n * Don't explain the obvious or simply repeat what is already on the screen.\n * When used correctly, supplemental info of a tooltip helps to [declutter the UI](/#/DesignGuidelines/decluttering.md/).\n * - If the tip is essential to the primary tasks that the user is performing,\n * such as warnings or important notes, include the information directly in the\n * interface instead.\n * - When a component offers a helper text (e.g. [Input field](/#/component/limel-input-field/)),\n * use that, not a tooltip.\n * - Make sure to use the tooltip on an element that users naturally and\n * effortlessly recognize can be hovered.\n *\n * @exampleComponent limel-example-tooltip-basic\n * @exampleComponent limel-example-tooltip-max-character\n * @exampleComponent limel-example-tooltip-composite\n */\n@Component({\n tag: 'limel-tooltip',\n shadow: true,\n styleUrl: 'tooltip.scss',\n})\nexport class Tooltip {\n /**\n * ID of the owner element that the tooltip should describe.\n * Must be a child within the same document fragment as the tooltip element\n * itself.\n */\n @Prop({ reflect: true })\n public elementId!: string;\n\n /**\n * Short descriptive text of the owner element.\n */\n @Prop({ reflect: true })\n public label!: string;\n\n /**\n * Additional helper text for the element.\n * Example usage can be a keyboard shortcut to activate the function of the\n * owner element.\n */\n @Prop({ reflect: true })\n public helperLabel?: string;\n\n /**\n * The maximum amount of characters before rendering 'label' and\n * 'helperLabel' in two rows.\n */\n @Prop({ reflect: true })\n public maxlength?: number = DEFAULT_MAX_LENGTH;\n\n /**\n * Decides the tooltip's location in relation to its trigger.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'top';\n\n @Element()\n private host: HTMLLimelTooltipElement;\n\n @State()\n private open: boolean;\n\n private portalId: string;\n private tooltipId: string;\n private ownerElement: HTMLElement;\n private tooltipTimer: TooltipTimer;\n\n public constructor() {\n this.portalId = createRandomString();\n this.tooltipId = createRandomString();\n this.tooltipTimer = new TooltipTimer(\n () => (this.open = true),\n () => (this.open = false),\n );\n }\n\n public connectedCallback() {\n this.ownerElement = getOwnerElement(this.elementId, this.host);\n this.setOwnerAriaLabel();\n this.addListeners();\n }\n\n public disconnectedCallback() {\n this.removeListeners();\n }\n\n public render(): JSX.Element {\n const tooltipZIndex = getComputedStyle(this.host).getPropertyValue(\n '--tooltip-z-index',\n );\n\n return (\n <div class=\"trigger-anchor\">\n <limel-portal\n openDirection={this.openDirection}\n visible={this.open}\n containerId={this.portalId}\n containerStyle={{\n 'z-index': tooltipZIndex,\n 'pointer-events': 'none',\n }}\n anchor={this.ownerElement}\n >\n <limel-tooltip-content\n label={this.label}\n helperLabel={this.helperLabel}\n maxlength={this.maxlength}\n role=\"tooltip\"\n aria-hidden={!this.open}\n id={this.tooltipId}\n />\n </limel-portal>\n </div>\n );\n }\n\n private setOwnerAriaLabel() {\n this.ownerElement?.setAttribute('aria-describedby', this.tooltipId);\n }\n\n private addListeners() {\n this.ownerElement?.addEventListener('mouseover', this.showTooltip);\n this.ownerElement?.addEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.addEventListener('focus', this.showTooltip);\n this.ownerElement?.addEventListener('blur', this.hideTooltip);\n }\n\n private removeListeners() {\n this.ownerElement?.removeEventListener('mouseover', this.showTooltip);\n this.ownerElement?.removeEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.removeEventListener('focus', this.showTooltip);\n this.ownerElement?.removeEventListener('blur', this.hideTooltip);\n }\n\n private showTooltip = () => {\n this.tooltipTimer.showAfterDelay();\n };\n\n private hideTooltip = () => {\n this.tooltipTimer.hide();\n };\n}\n",":host(limel-tooltip-content) {\n display: flex;\n\n border-radius: 0.25rem;\n padding: 0.25rem 0.5rem;\n background-color: rgb(var(--contrast-1300));\n box-shadow: var(--shadow-depth-16);\n}\n\ntext {\n font-size: 0.875rem; // 14px\n line-height: 1.25;\n display: flex;\n column-gap: 1rem;\n\n &.has-column-layout {\n display: table-cell;\n width: fit-content;\n max-width: min(var(--tooltip-max-width-of-text), 80vw);\n .label {\n padding-bottom: 0.5rem;\n }\n .helper-label {\n padding-bottom: 0.25rem;\n }\n }\n}\n\n.label {\n color: rgb(var(--contrast-200));\n}\n\n.helper-label {\n color: rgb(var(--contrast-800));\n\n &:empty {\n display: none;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * This component is used internally by `limel-tooltip`.\n *\n * @private\n */\n@Component({\n tag: 'limel-tooltip-content',\n shadow: true,\n styleUrl: 'tooltip-content.scss',\n})\nexport class TooltipContent {\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n label!: string;\n\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n helperLabel?: string;\n\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n maxlength?: number;\n\n public render() {\n let isLabelsTextLong = false;\n if (this.helperLabel && this.maxlength) {\n isLabelsTextLong =\n this.label.length + this.helperLabel.length > this.maxlength;\n }\n\n const props: any = {};\n if (this.maxlength) {\n props.style = {\n '--tooltip-max-width-of-text': `${this.maxlength}` + 'ch',\n };\n }\n\n return [\n <text class={{ 'has-column-layout': isLabelsTextLong }} {...props}>\n <div class=\"label\">{this.label}</div>\n <div class=\"helper-label\">{this.helperLabel}</div>\n </text>,\n ];\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"limel-badge.limel-tooltip.limel-tooltip-content.entry.js","mappings":";;;;;AAAA,MAAM,QAAQ,GAAG,g9DAAg9D;;MCgBp9D,KAAK;;;;;EAUP,MAAM;IACT,QACI,EAAC,IAAI,IACD,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,EAC5C,KAAK,EAAE;QACH,iBAAiB,EAAE,IAAI,CAAC,YAAY,EAAE;OACzC,IAED,gBAAO,IAAI,CAAC,WAAW,EAAE,CAAQ,CAC9B,EACT;GACL;EAEO,WAAW;IACf,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;MAChC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC;GACr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AC;IAC7B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE;MACpC,gBAAgB;QACZ,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;KACpE;IAED,MAAM,KAAK,GAAQ,EAAE,CAAC;IACtB,IAAI,IAAI,CAAC,SAAS,EAAE;MAChB,KAAK,CAAC,KAAK,GAAG;QACV,6BAA6B,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI;OAC5D,CAAC;KACL;IAED,OAAO;MACH,0BAAM,KAAK,EAAE,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAM,KAAK,GAC7D,WAAK,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,KAAK,CAAO,EACrC,WAAK,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,WAAW,CAAO,CAC/C;KACV,CAAC;GACL;;;;;;","names":[],"sources":["./src/components/badge/badge.scss?tag=limel-badge&encapsulation=shadow","./src/components/badge/badge.tsx","./src/components/tooltip/getOwnerElement.tsx","./src/components/tooltip/tooltipTimer.ts","./src/components/tooltip/tooltip.scss?tag=limel-tooltip&encapsulation=shadow","./src/components/tooltip/tooltip.tsx","./src/components/tooltip/tooltip-content.scss?tag=limel-tooltip-content&encapsulation=shadow","./src/components/tooltip/tooltip-content.tsx"],"sourcesContent":["@use '../../style/functions';\n@use '../../style/internal/lime-theme';\n@use '../../style/mixins';\n\n/**\n * @prop --badge-background-color: badge background color\n * @prop --badge-text-color: badge text color\n * @prop --badge-max-width: maximum width of the badge, before its text gets truncated\n */\n\n:host([hidden]) {\n display: none;\n}\n\n:host(limel-badge) {\n --limel-min-badge-size: 1rem;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n min-height: var(--limel-min-badge-size);\n min-width: var(--limel-min-badge-size);\n}\n\nspan {\n cursor: default;\n box-sizing: border-box;\n\n @include mixins.truncate-text;\n text-align: center;\n font-size: functions.pxToRem(11);\n line-height: var(--limel-min-badge-size);\n\n color: var(--badge-text-color, rgb(var(--contrast-1200)));\n\n border-radius: var(--limel-min-badge-size);\n max-height: var(--limel-min-badge-size);\n min-width: 0.5rem;\n min-height: 0.5rem;\n\n background-color: var(--badge-background-color, rgb(var(--contrast-500)));\n\n &:not(:empty) {\n min-width: var(\n --limel-min-badge-size\n ); // ensures that a badge with only one character rendered as perfect circle\n max-width: var(--badge-max-width, 2.75rem);\n padding: 0 functions.pxToRem(4.5);\n }\n}\n\n:host(.has-large-label) {\n span {\n cursor: help;\n }\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { abbreviate } from './format';\n\n/**\n * The Badge component can be used to display a notification badge,\n * optionally with a number or a text label.\n *\n * @exampleComponent limel-example-badge\n * @exampleComponent limel-example-badge-number\n * @exampleComponent limel-example-badge-string\n */\n@Component({\n tag: 'limel-badge',\n styleUrl: 'badge.scss',\n shadow: true,\n})\nexport class Badge {\n /**\n * Label to display in the badge.\n * Numeric labels larger than 999 will be rounded and abbreviated.\n * String labels get truncated if their length is longer than\n * six characters.\n */\n @Prop({ reflect: true })\n public label?: number | string;\n\n public render() {\n return (\n <Host\n title={this.labelIsLarge() ? this.label : ''}\n class={{\n 'has-large-label': this.labelIsLarge(),\n }}\n >\n <span>{this.renderLabel()}</span>\n </Host>\n );\n }\n\n private renderLabel() {\n if (typeof this.label === 'number') {\n return abbreviate(this.label);\n }\n\n return this.label;\n }\n\n private labelIsLarge() {\n const largeNumericLabel = 999;\n const largeStringLabel = 6;\n if (\n (typeof this.label === 'number' &&\n this.label > largeNumericLabel) ||\n (typeof this.label === 'string' &&\n this.label.length > largeStringLabel)\n ) {\n return true;\n }\n }\n}\n","export function getOwnerElement(\n id: string,\n startingPoint: Node,\n): HTMLElement | undefined {\n let element: Node = startingPoint;\n\n do {\n element = element.parentNode;\n } while (\n element &&\n element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&\n element.nodeType !== Node.DOCUMENT_NODE\n );\n\n return (element as ShadowRoot)?.getElementById(id);\n}\n","const DEFAULT_DELAY_FOR_SHOWING = 500;\n\nexport class TooltipTimer {\n private timerHandle: number | null = null;\n private showCallback: Function;\n private hideCallback: Function;\n private delayForShowing: number;\n\n constructor(\n showCallback: Function,\n hideCallback: Function,\n delayForShowing: number = DEFAULT_DELAY_FOR_SHOWING,\n ) {\n this.showCallback = showCallback;\n this.hideCallback = hideCallback;\n this.delayForShowing = delayForShowing;\n }\n\n showAfterDelay(): void {\n if (!this.timerHandle) {\n this.timerHandle = setTimeout(\n this.showCallback,\n this.delayForShowing,\n );\n }\n }\n\n hide(): void {\n clearTimeout(this.timerHandle);\n this.timerHandle = null;\n this.hideCallback();\n }\n}\n","/**\n * @prop --tooltip-z-index: z-index of the tooltip.\n */\n\n:host(limel-tooltip) {\n // Absolutely positioning ensures that this invisible element\n // does not occupy visible space in the UI.\n // Without this, `limel-tooltip` could in many cases\n // mess up the layout, where it is used.\n // For example, inside a `grid` or `flex` section,\n // every instance of the tooltip would take some space,\n // creating gaps and empty holes.\n position: absolute;\n pointer-events: none;\n}\n","import { Component, h, Prop, Element, State } from '@stencil/core';\nimport { JSX } from 'react';\nimport { createRandomString } from '../../util/random-string';\nimport { OpenDirection } from '../menu/menu.types';\nimport { getOwnerElement } from './getOwnerElement';\nimport { TooltipTimer } from './tooltipTimer';\n\nconst DEFAULT_MAX_LENGTH = 50;\n\n/**\n * A tooltip can be used to display a descriptive text for any element.\n * The displayed content must be a brief and supplemental string of text,\n * identifying the element or describing its function for the user,\n * helping them better understand unfamiliar objects that aren't described\n * directly in the UI.\n *\n * ## Interaction\n * The tooltip appears after a slight delay, when the element is hovered;\n * and disappears as soon as the cursor leaves the element.\n * Therefore, users cannot interact with the tip, but if the trigger element\n * itself is interactive, it will remain interactible even with a tooltip bound\n * to it.\n *\n * :::note\n * In order to display the tooltip, the tooltip element and its trigger element\n * must be within the same document or document fragment (the same shadowRoot).\n * Often, it's easiest to just place them next to each other like in the example\n * below, but if you need to, you can place them differently.\n *\n * ```html\n * <limel-button icon=\"search\" id=\"tooltip-example\" />\n * <limel-tooltip label=\"Search\" elementId=\"tooltip-example\" />\n * ```\n * :::\n *\n * ## Usage\n * - Keep in mind that tooltips can be distracting, and can be perceived as an interruption.\n * Use them only when they add significant value.\n * - A good tip is concise, helpful, and informative.\n * Don't explain the obvious or simply repeat what is already on the screen.\n * When used correctly, supplemental info of a tooltip helps to [declutter the UI](/#/DesignGuidelines/decluttering.md/).\n * - If the tip is essential to the primary tasks that the user is performing,\n * such as warnings or important notes, include the information directly in the\n * interface instead.\n * - When a component offers a helper text (e.g. [Input field](/#/component/limel-input-field/)),\n * use that, not a tooltip.\n * - Make sure to use the tooltip on an element that users naturally and\n * effortlessly recognize can be hovered.\n *\n * @exampleComponent limel-example-tooltip-basic\n * @exampleComponent limel-example-tooltip-max-character\n * @exampleComponent limel-example-tooltip-composite\n */\n@Component({\n tag: 'limel-tooltip',\n shadow: true,\n styleUrl: 'tooltip.scss',\n})\nexport class Tooltip {\n /**\n * ID of the owner element that the tooltip should describe.\n * Must be a child within the same document fragment as the tooltip element\n * itself.\n */\n @Prop({ reflect: true })\n public elementId!: string;\n\n /**\n * Short descriptive text of the owner element.\n */\n @Prop({ reflect: true })\n public label!: string;\n\n /**\n * Additional helper text for the element.\n * Example usage can be a keyboard shortcut to activate the function of the\n * owner element.\n */\n @Prop({ reflect: true })\n public helperLabel?: string;\n\n /**\n * The maximum amount of characters before rendering 'label' and\n * 'helperLabel' in two rows.\n */\n @Prop({ reflect: true })\n public maxlength?: number = DEFAULT_MAX_LENGTH;\n\n /**\n * Decides the tooltip's location in relation to its trigger.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'top';\n\n @Element()\n private host: HTMLLimelTooltipElement;\n\n @State()\n private open: boolean;\n\n private portalId: string;\n private tooltipId: string;\n private ownerElement: HTMLElement;\n private tooltipTimer: TooltipTimer;\n\n public constructor() {\n this.portalId = createRandomString();\n this.tooltipId = createRandomString();\n this.tooltipTimer = new TooltipTimer(\n () => (this.open = true),\n () => (this.open = false),\n );\n }\n\n public connectedCallback() {\n this.ownerElement = getOwnerElement(this.elementId, this.host);\n this.setOwnerAriaLabel();\n this.addListeners();\n }\n\n public disconnectedCallback() {\n this.removeListeners();\n }\n\n public render(): JSX.Element {\n const tooltipZIndex = getComputedStyle(this.host).getPropertyValue(\n '--tooltip-z-index',\n );\n\n return (\n <div class=\"trigger-anchor\">\n <limel-portal\n openDirection={this.openDirection}\n visible={this.open}\n containerId={this.portalId}\n containerStyle={{\n 'z-index': tooltipZIndex,\n 'pointer-events': 'none',\n }}\n anchor={this.ownerElement}\n >\n <limel-tooltip-content\n label={this.label}\n helperLabel={this.helperLabel}\n maxlength={this.maxlength}\n role=\"tooltip\"\n aria-hidden={!this.open}\n id={this.tooltipId}\n />\n </limel-portal>\n </div>\n );\n }\n\n private setOwnerAriaLabel() {\n this.ownerElement?.setAttribute('aria-describedby', this.tooltipId);\n }\n\n private addListeners() {\n this.ownerElement?.addEventListener('mouseover', this.showTooltip);\n this.ownerElement?.addEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.addEventListener('focus', this.showTooltip);\n this.ownerElement?.addEventListener('blur', this.hideTooltip);\n }\n\n private removeListeners() {\n this.ownerElement?.removeEventListener('mouseover', this.showTooltip);\n this.ownerElement?.removeEventListener('mouseout', this.hideTooltip);\n this.ownerElement?.removeEventListener('focus', this.showTooltip);\n this.ownerElement?.removeEventListener('blur', this.hideTooltip);\n }\n\n private showTooltip = () => {\n this.tooltipTimer.showAfterDelay();\n };\n\n private hideTooltip = () => {\n this.tooltipTimer.hide();\n };\n}\n",":host(limel-tooltip-content) {\n display: flex;\n\n border-radius: 0.25rem;\n padding: 0.25rem 0.5rem;\n background-color: rgb(var(--contrast-1300));\n box-shadow: var(--shadow-depth-16);\n}\n\ntext {\n font-size: 0.875rem; // 14px\n line-height: 1.25;\n display: flex;\n column-gap: 1rem;\n\n &.has-column-layout {\n display: table-cell;\n width: fit-content;\n max-width: min(var(--tooltip-max-width-of-text), 80vw);\n .label {\n padding-bottom: 0.5rem;\n }\n .helper-label {\n padding-bottom: 0.25rem;\n }\n }\n}\n\n.label {\n color: rgb(var(--contrast-200));\n}\n\n.helper-label {\n color: rgb(var(--contrast-800));\n\n &:empty {\n display: none;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * This component is used internally by `limel-tooltip`.\n *\n * @private\n */\n@Component({\n tag: 'limel-tooltip-content',\n shadow: true,\n styleUrl: 'tooltip-content.scss',\n})\nexport class TooltipContent {\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n label!: string;\n\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n helperLabel?: string;\n\n /**\n * Read more in tooltip.tsx\n */\n @Prop({ reflect: true })\n maxlength?: number;\n\n public render() {\n let isLabelsTextLong = false;\n if (this.helperLabel && this.maxlength) {\n isLabelsTextLong =\n this.label.length + this.helperLabel.length > this.maxlength;\n }\n\n const props: any = {};\n if (this.maxlength) {\n props.style = {\n '--tooltip-max-width-of-text': `${this.maxlength}` + 'ch',\n };\n }\n\n return [\n <text class={{ 'has-column-layout': isLabelsTextLong }} {...props}>\n <div class=\"label\">{this.label}</div>\n <div class=\"helper-label\">{this.helperLabel}</div>\n </text>,\n ];\n }\n}\n"],"version":3}
|