@v1nt1248/3nclient-lib 0.3.51 → 0.4.1

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.
Files changed (68) hide show
  1. package/README.md +4 -0
  2. package/dist/chunks/{plugins-keys-DdadrIAg.js → plugins-keys-CjKqZeyH.js} +2 -2
  3. package/dist/chunks/ui3n-tooltip-BbbM2459.js +409 -0
  4. package/dist/src/components/ui3n-chip/ui3n-chip.d.ts +0 -5
  5. package/dist/src/components/ui3n-icon/ui3n-icon.d.ts +0 -1
  6. package/dist/src/components/ui3n-progress/ui3n-progress-circular.d.ts +0 -2
  7. package/dist/src/components/ui3n-progress/ui3n-progress-linear.d.ts +0 -2
  8. package/dist/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.d.ts +0 -7
  9. package/dist/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.d.ts +0 -7
  10. package/dist/src/components/ui3n-slider/ui3n-slider.d.ts +0 -5
  11. package/dist/src/components/ui3n-tabs/ui3n-tabs.d.ts +0 -4
  12. package/dist/src/components/ui3n-tooltip/types.d.ts +8 -2
  13. package/dist/src/components/ui3n-tooltip/ui3n-tooltip-container.d.ts +16 -0
  14. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -5
  15. package/dist/src/constants/plugins-keys.d.ts +2 -0
  16. package/dist/src/index.d.ts +3 -0
  17. package/dist/src/plugins/index.d.ts +4 -1
  18. package/dist/src/plugins/tooltips/store-tooltips.d.ts +4 -0
  19. package/dist/src/plugins/tooltips/tooltips.d.ts +8 -0
  20. package/dist/src/plugins/tooltips/types.d.ts +34 -0
  21. package/dist/src/ui3n-plugins.d.ts +5 -3
  22. package/dist/style.css +1 -1
  23. package/dist/ui3n-components.js +1011 -1183
  24. package/dist/ui3n-plugins.js +169 -50
  25. package/dist/ui3n-utils.js +4 -4
  26. package/package.json +11 -4
  27. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +28 -25
  28. package/src/components/ui3n-badge/ui3n-badge-simple.vue +18 -17
  29. package/src/components/ui3n-badge/ui3n-badge.vue +3 -2
  30. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +11 -10
  31. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +4 -1
  32. package/src/components/ui3n-button/ui3n-button.vue +244 -158
  33. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +22 -21
  34. package/src/components/ui3n-chip/ui3n-chip.vue +56 -40
  35. package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +1 -0
  36. package/src/components/ui3n-dialog/ui3n-dialog.vue +19 -18
  37. package/src/components/ui3n-drop-files/ui3n-drop-files.vue +8 -7
  38. package/src/components/ui3n-editable/ui3n-content-editable.vue +11 -10
  39. package/src/components/ui3n-editable/ui3n-editable.vue +26 -25
  40. package/src/components/ui3n-emoji/ui3n-emoji.vue +7 -6
  41. package/src/components/ui3n-icon/ui3n-icon.vue +26 -16
  42. package/src/components/ui3n-input/ui3n-input.vue +36 -32
  43. package/src/components/ui3n-input-file/ui3n-input-file.vue +8 -5
  44. package/src/components/ui3n-list/ui3n-list.vue +8 -7
  45. package/src/components/ui3n-menu/ui3n-menu.vue +6 -5
  46. package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +4 -3
  47. package/src/components/ui3n-mobile-menu-item/ui3n-mobile-menu-item.vue +7 -6
  48. package/src/components/ui3n-notification/ui3n-notification-container.vue +1 -0
  49. package/src/components/ui3n-notification/ui3n-notification.vue +28 -26
  50. package/src/components/ui3n-progress/ui3n-progress-circular.vue +32 -19
  51. package/src/components/ui3n-progress/ui3n-progress-linear.vue +31 -18
  52. package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -1
  53. package/src/components/ui3n-radio-group/ui3n-radio.vue +6 -5
  54. package/src/components/ui3n-scrollbar/ui3n-scrollbar.vue +94 -83
  55. package/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.vue +51 -39
  56. package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +51 -39
  57. package/src/components/ui3n-selector/ui3n-selector.vue +33 -28
  58. package/src/components/ui3n-slider/ui3n-slider.vue +53 -34
  59. package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +10 -6
  60. package/src/components/ui3n-switch/ui3n-switch.vue +23 -22
  61. package/src/components/ui3n-table/ui3n-table.vue +50 -48
  62. package/src/components/ui3n-tabs/ui3n-tabs.vue +38 -20
  63. package/src/components/ui3n-text/ui3n-text.vue +15 -14
  64. package/src/components/ui3n-tooltip/types.ts +8 -2
  65. package/src/components/ui3n-tooltip/ui3n-tooltip-container.vue +79 -0
  66. package/src/components/ui3n-tooltip/ui3n-tooltip.vue +140 -79
  67. package/dist/chunks/ui3n-notification-o0tuhTpO.js +0 -272
  68. package/src/components/ui3n-tooltip/ui3n-tooltip-old.vue +0 -198
@@ -132,6 +132,7 @@
132
132
  >
133
133
  <div
134
134
  ref="tableEl"
135
+ data-ui3n="table"
135
136
  :style="tableStyle"
136
137
  :class="[$style.ui3nTable, $style.ui3nTableInsideScrollbar, stickyColumnsActive && $style.stickyColumns]"
137
138
  >
@@ -316,6 +317,7 @@
316
317
  <div
317
318
  v-else
318
319
  ref="tableEl"
320
+ data-ui3n="table"
319
321
  :style="tableStyle"
320
322
  :class="[$style.ui3nTable, stickyColumnsActive && $style.stickyColumns]"
321
323
  >
@@ -505,21 +507,21 @@
505
507
  }
506
508
 
507
509
  .ui3nTable {
508
- --ui3n-table-columns-width: auto;
509
- --ui3n-table-base-head-height: 36px;
510
- --ui3n-table-group-actions-height: 48px;
511
- --ui3n-table-body-row-height: 28px;
512
- --ui3n-table-group-actions-bg-color: var(--color-bg-block-primary-default);
513
- --ui3n-table-header-bg-color: var(--color-bg-table-header-default);
514
- --ui3n-table-header-color: var(--color-text-table-primary-default);
515
- --ui3n-table-header-font-size: 14px;
516
- --ui3n-table-padding-inline: 16px;
517
- --ui3n-table-row-color: var(--color-text-table-primary-default);
518
- --ui3n-table-row-bg-color-selected: var(--color-bg-control-primary-hover);
519
- --ui3n-table-row-checkbox-width: 16px;
520
- --ui3n-table-cell-font-size: 12px;
521
- --ui3n-table-nodata-height: 48px;
522
- --ui3n-table-nodata-color: var(--color-text-control-secondary-default);
510
+ --_table-columns-width: var(--ui3n-table-columns-width, auto);
511
+ --_table-base-head-height: var(--ui3n-table-base-head-height, 36px);
512
+ --_table-group-actions-height: var(--ui3n-table-group-actions-height, 48px);
513
+ --_table-body-row-height: var(--ui3n-table-body-row-height, 28px);
514
+ --_table-group-actions-bg-color: var(--ui3n-table-group-actions-bg-color, var(--color-bg-block-primary-default));
515
+ --_table-header-bg-color: var(--ui3n-table-header-bg-color, var(--color-bg-table-header-default));
516
+ --_table-header-color: var(--ui3n-table-header-color, var(--color-text-table-primary-default));
517
+ --_table-header-font-size: var(--ui3n-table-header-font-size, 14px);
518
+ --_table-padding-inline: var(--ui3n-table-padding-inline, 16px);
519
+ --_table-row-color: var(--ui3n-table-row-color, var(--color-text-table-primary-default));
520
+ --_table-row-bg-color-selected: var(--ui3n-table-row-bg-color-selected, var(--color-bg-control-primary-hover));
521
+ --_table-row-checkbox-width: var(--ui3n-table-row-checkbox-width, 16px);
522
+ --_table-cell-font-size: var(--ui3n-table-cell-font-size, 12px);
523
+ --_table-nodata-height: var(--ui3n-table-nodata-height, 48px);
524
+ --_table-nodata-color: var(--ui3n-table-nodata-color, var(--color-text-control-secondary-default));
523
525
 
524
526
  position: relative;
525
527
  width: 100%;
@@ -561,22 +563,22 @@
561
563
  position: sticky;
562
564
  top: 0;
563
565
  width: 100%;
564
- min-height: var(--ui3n-table-base-head-height);
565
- height: var(--ui3n-table-base-head-height);
566
+ min-height: var(--_table-base-head-height);
567
+ height: var(--_table-base-head-height);
566
568
  display: grid;
567
- grid-template-columns: var(--ui3n-table-columns-width);
568
- background-color: var(--ui3n-table-header-bg-color);
569
- padding-left: var(--ui3n-table-padding-inline);
569
+ grid-template-columns: var(--_table-columns-width);
570
+ background-color: var(--_table-header-bg-color);
571
+ padding-left: var(--_table-padding-inline);
570
572
  z-index: 5;
571
573
 
572
574
  &.withGroupActions {
573
- height: calc(var(--ui3n-table-base-head-height) + var(--ui3n-table-group-actions-height));
574
- min-height: calc(var(--ui3n-table-base-head-height) + var(--ui3n-table-group-actions-height));
575
- padding-top: var(--ui3n-table-group-actions-height);
575
+ height: calc(var(--_table-base-head-height) + var(--_table-group-actions-height));
576
+ min-height: calc(var(--_table-base-head-height) + var(--_table-group-actions-height));
577
+ padding-top: var(--_table-group-actions-height);
576
578
  }
577
579
 
578
580
  .headerItemWrapper:not(:first-child) {
579
- padding: 0 calc(var(--ui3n-table-padding-inline) / 4);
581
+ padding: 0 calc(var(--_table-padding-inline) / 4);
580
582
  }
581
583
  }
582
584
 
@@ -605,9 +607,9 @@
605
607
 
606
608
  .headerText {
607
609
  display: block;
608
- font-size: var(--ui3n-table-header-font-size);
610
+ font-size: var(--_table-header-font-size);
609
611
  font-weight: 500;
610
- color: var(--ui3n-table-header-color);
612
+ color: var(--_table-header-color);
611
613
  @include mixins.text-overflow-ellipsis();
612
614
  }
613
615
 
@@ -623,11 +625,11 @@
623
625
  left: 0;
624
626
  display: flex;
625
627
  width: 100%;
626
- height: var(--ui3n-table-group-actions-height);
627
- padding: 0 var(--ui3n-table-padding-inline);
628
+ height: var(--_table-group-actions-height);
629
+ padding: 0 var(--_table-padding-inline);
628
630
  justify-content: space-between;
629
631
  align-items: center;
630
- background-color: var(--ui3n-table-group-actions-bg-color);
632
+ background-color: var(--_table-group-actions-bg-color);
631
633
  border-left: 1px solid var(--color-border-block-primary-default);
632
634
  border-top: 1px solid var(--color-border-block-primary-default);
633
635
  border-right: 1px solid var(--color-border-block-primary-default);
@@ -636,7 +638,7 @@
636
638
  .groupActionsBody {
637
639
  display: flex;
638
640
  height: 100%;
639
- padding: 0 calc(var(--ui3n-table-padding-inline) / 2);
641
+ padding: 0 calc(var(--_table-padding-inline) / 2);
640
642
  flex-grow: 1;
641
643
  }
642
644
 
@@ -649,16 +651,16 @@
649
651
  .row {
650
652
  position: relative;
651
653
  width: 100%;
652
- min-height: var(--ui3n-table-body-row-height);
654
+ min-height: var(--_table-body-row-height);
653
655
  border-left: 1px solid var(--color-border-table-primary-default);
654
656
  border-right: 1px solid var(--color-border-table-primary-default);
655
657
  border-bottom: 1px solid var(--color-border-block-primary-default);
656
658
  background-color: transparent;
657
659
 
658
660
  &:not(.customRow) {
659
- padding-left: var(--ui3n-table-padding-inline);
661
+ padding-left: var(--_table-padding-inline);
660
662
  display: grid;
661
- grid-template-columns: var(--ui3n-table-columns-width);
663
+ grid-template-columns: var(--_table-columns-width);
662
664
  }
663
665
 
664
666
  &.selectable {
@@ -671,14 +673,14 @@
671
673
  }
672
674
 
673
675
  .selected {
674
- background-color: var(--ui3n-table-row-bg-color-selected);
676
+ background-color: var(--_table-row-bg-color-selected);
675
677
  }
676
678
 
677
679
  .rowCheckbox {
678
680
  position: absolute;
679
681
  top: 0;
680
682
  left: 16px;
681
- width: var(--ui3n-table-row-checkbox-width);
683
+ width: var(--_table-row-checkbox-width);
682
684
  height: 100%;
683
685
  display: flex;
684
686
  justify-content: flex-start;
@@ -694,27 +696,27 @@
694
696
  align-items: center;
695
697
 
696
698
  &.bodyItemFirst {
697
- padding-left: calc(var(--ui3n-table-padding-inline) * 1.5);
699
+ padding-left: calc(var(--_table-padding-inline) * 1.5);
698
700
  }
699
701
  }
700
702
 
701
703
  .cell {
702
- font-size: var(--ui3n-table-cell-font-size);
704
+ font-size: var(--_table-cell-font-size);
703
705
  font-weight: 400;
704
- color: var(--ui3n-table-row-color);
706
+ color: var(--_table-row-color);
705
707
  }
706
708
 
707
709
  .noData {
708
710
  position: relative;
709
711
  width: 100%;
710
- height: var(--ui3n-table-nodata-height);
712
+ height: var(--_table-nodata-height);
711
713
  padding-top: 24px;
712
714
  display: flex;
713
715
  justify-content: center;
714
716
  align-items: center;
715
- font-size: var(--ui3n-table-cell-font-size);
717
+ font-size: var(--_table-cell-font-size);
716
718
  font-weight: 600;
717
- color: var(--ui3n-table-nodata-color);
719
+ color: var(--_table-nodata-color);
718
720
  }
719
721
 
720
722
  .unusedPlace {
@@ -729,7 +731,7 @@
729
731
  width: max-content;
730
732
  min-width: 100%;
731
733
  display: grid;
732
- grid-template-columns: var(--ui3n-table-columns-width);
734
+ grid-template-columns: var(--_table-columns-width);
733
735
  }
734
736
 
735
737
  .header {
@@ -746,15 +748,15 @@
746
748
 
747
749
  .headerItemSticky {
748
750
  position: sticky;
749
- background-color: var(--ui3n-table-header-bg-color);
751
+ background-color: var(--_table-header-bg-color);
750
752
  }
751
753
 
752
754
  .headerItemFirst.headerItemSticky {
753
- padding-left: var(--ui3n-table-padding-inline);
755
+ padding-left: var(--_table-padding-inline);
754
756
  }
755
757
 
756
758
  .headerItemWrapper:not(.headerItemFirst) {
757
- padding: 0 calc(var(--ui3n-table-padding-inline) / 4);
759
+ padding: 0 calc(var(--_table-padding-inline) / 4);
758
760
  }
759
761
 
760
762
  .bodyItemSticky {
@@ -763,7 +765,7 @@
763
765
  }
764
766
 
765
767
  .bodyItemFirst.bodyItemSticky {
766
- padding-left: calc(var(--ui3n-table-padding-inline) + var(--ui3n-table-padding-inline) * 1.5);
768
+ padding-left: calc(var(--_table-padding-inline) + var(--_table-padding-inline) * 1.5);
767
769
  }
768
770
 
769
771
  .row:hover .bodyItemSticky {
@@ -771,12 +773,12 @@
771
773
  }
772
774
 
773
775
  .row.selected .bodyItemSticky {
774
- background-color: var(--ui3n-table-row-bg-color-selected);
776
+ background-color: var(--_table-row-bg-color-selected);
775
777
  }
776
778
 
777
779
  .rowCheckbox {
778
780
  position: sticky;
779
- left: var(--ui3n-table-padding-inline);
781
+ left: var(--_table-padding-inline);
780
782
  z-index: 3;
781
783
  }
782
784
 
@@ -2,13 +2,10 @@
2
2
  import { computed, nextTick, onMounted, ref, watch, useCssModule } from 'vue';
3
3
  import type { Ui3nTabsEmits, Ui3nTabsProps, Ui3nTabsSlots } from './types';
4
4
 
5
+ /* colours and the indicator size keep their defaults in CSS */
5
6
  const props = withDefaults(defineProps<Ui3nTabsProps>(), {
6
7
  modelValue: 0,
7
8
  itemDirection: 'horizontal',
8
- activeColor: 'var(--color-text-control-accent-default)',
9
- inactiveColor: 'var(--color-text-control-primary-default)',
10
- indicatorColor: 'var(--color-border-control-accent-default)',
11
- indicatorSize: 2,
12
9
  indicatorPosition: 'normal',
13
10
  });
14
11
  const emits = defineEmits<Ui3nTabsEmits>();
@@ -19,13 +16,29 @@
19
16
  const tabs = ref<HTMLDivElement | null>(null);
20
17
  const activeIndex = ref(props.modelValue);
21
18
 
22
- const tabsStyle = computed(() => ({
23
- '--ui3n-tabs-active-color': props.activeColor,
24
- '--ui3n-tabs-inactive-color': props.inactiveColor,
25
- '--ui3n-tabs-indicator-color': props.indicatorColor,
26
- '--ui3n-tabs-indicator-size': `${props.indicatorSize}px`,
27
- '--ui3n-tabs-indicator-position': props.indicatorPosition === 'reverse' ? '100%' : '0',
28
- }));
19
+ const tabsStyle = computed(() => {
20
+ const styles: Record<string, string> = {
21
+ '--ui3n-tabs-indicator-position': props.indicatorPosition === 'reverse' ? '100%' : '0',
22
+ };
23
+
24
+ if (props.activeColor) {
25
+ styles['--ui3n-tabs-active-color'] = props.activeColor;
26
+ }
27
+
28
+ if (props.inactiveColor) {
29
+ styles['--ui3n-tabs-inactive-color'] = props.inactiveColor;
30
+ }
31
+
32
+ if (props.indicatorColor) {
33
+ styles['--ui3n-tabs-indicator-color'] = props.indicatorColor;
34
+ }
35
+
36
+ if (props.indicatorSize !== undefined) {
37
+ styles['--ui3n-tabs-indicator-size'] = `${props.indicatorSize}px`;
38
+ }
39
+
40
+ return styles;
41
+ });
29
42
 
30
43
  function updateChildrenAttributes(): void {
31
44
  if (tabs.value?.children) {
@@ -89,6 +102,7 @@
89
102
  <div
90
103
  ref="tabs"
91
104
  :id="id"
105
+ data-ui3n="tabs"
92
106
  :style="tabsStyle"
93
107
  :class="[$style.ui3nTabs, itemDirection === 'vertical' && $style.vertical]"
94
108
  @click="onClick"
@@ -99,10 +113,14 @@
99
113
 
100
114
  <style lang="scss" module>
101
115
  .ui3nTabs {
102
- --ui3n-tabs-height: 48px;
116
+ --_tabs-height: var(--ui3n-tabs-height, 48px);
117
+ --_tabs-active-color: var(--ui3n-tabs-active-color, var(--color-text-control-accent-default));
118
+ --_tabs-inactive-color: var(--ui3n-tabs-inactive-color, var(--color-text-control-primary-default));
119
+ --_tabs-indicator-color: var(--ui3n-tabs-indicator-color, var(--color-border-control-accent-default));
120
+ --_tabs-indicator-size: var(--ui3n-tabs-indicator-size, 2px);
103
121
 
104
122
  position: relative;
105
- height: var(--ui3n-tabs-height);
123
+ height: var(--_tabs-height);
106
124
  display: flex;
107
125
  justify-content: center;
108
126
  align-items: stretch;
@@ -113,7 +131,7 @@
113
131
  cursor: pointer;
114
132
  position: relative;
115
133
  user-select: none;
116
- color: var(--ui3n-tabs-inactive-color);
134
+ color: var(--_tabs-inactive-color);
117
135
 
118
136
  &:hover {
119
137
  background-color: var(--color-bg-control-secondary-default);
@@ -124,8 +142,8 @@
124
142
  content: '';
125
143
  left: 0;
126
144
  width: 100%;
127
- bottom: var(--ui3n-tabs-indicator-position);
128
- height: var(--ui3n-tabs-indicator-size);
145
+ bottom: var(--ui3n-tabs-indicator-position, 0);
146
+ height: var(--_tabs-indicator-size);
129
147
  background-color: transparent;
130
148
  transition: background-color 250ms ease-in-out;
131
149
  }
@@ -138,10 +156,10 @@
138
156
  }
139
157
 
140
158
  .active {
141
- color: var(--ui3n-tabs-active-color);
159
+ color: var(--_tabs-active-color);
142
160
 
143
161
  &::after {
144
- background-color: var(--ui3n-tabs-indicator-color);
162
+ background-color: var(--_tabs-indicator-color);
145
163
  transition: background-color 250ms ease-in-out;
146
164
  }
147
165
  }
@@ -152,8 +170,8 @@
152
170
 
153
171
  .item {
154
172
  &::after {
155
- left: var(--ui3n-tabs-indicator-position);
156
- width: var(--ui3n-tabs-indicator-size);
173
+ left: var(--ui3n-tabs-indicator-position, 0);
174
+ width: var(--_tabs-indicator-size);
157
175
  bottom: 0;
158
176
  height: 100%;
159
177
  }
@@ -141,6 +141,7 @@
141
141
  <template>
142
142
  <div
143
143
  :id="id"
144
+ data-ui3n="text"
144
145
  :class="[
145
146
  $style.ui3nText,
146
147
  disabled && $style.disabled,
@@ -187,22 +188,22 @@
187
188
 
188
189
  <style lang="scss" module>
189
190
  .ui3nText {
190
- --ui3n-text-border-radius: 4px;
191
- --ui3n-text-label-font-size: 12px;
192
- --ui3n-text-font-size: 13px;
193
- --ui3n-text-padding-inline: 8px;
194
- --ui3n-text-padding-block: 8px;
191
+ --_text-border-radius: var(--ui3n-text-border-radius, 4px);
192
+ --_text-label-font-size: var(--ui3n-text-label-font-size, 12px);
193
+ --_text-font-size: var(--ui3n-text-font-size, 13px);
194
+ --_text-padding-inline: var(--ui3n-text-padding-inline, 8px);
195
+ --_text-padding-block: var(--ui3n-text-padding-block, 8px);
195
196
 
196
197
  position: relative;
197
198
  width: 100%;
198
- border-radius: var(--ui3n-text-border-radius);
199
+ border-radius: var(--_text-border-radius);
199
200
  padding: 1px;
200
201
  }
201
202
 
202
203
  .label {
203
204
  display: block;
204
205
  width: 100%;
205
- font-size: var(--ui3n-text-label-font-size);
206
+ font-size: var(--_text-label-font-size);
206
207
  line-height: 1.33;
207
208
  font-weight: 600;
208
209
  color: var(--color-text-control-primary-default);
@@ -212,9 +213,9 @@
212
213
  .body {
213
214
  position: relative;
214
215
  width: 100%;
215
- padding: var(--ui3n-text-padding-block) 0;
216
+ padding: var(--_text-padding-block) 0;
216
217
  background-color: var(--color-bg-control-secondary-default);
217
- border-radius: var(--ui3n-text-border-radius);
218
+ border-radius: var(--_text-border-radius);
218
219
  transition: all 0.2s ease-in-out;
219
220
 
220
221
  &:hover {
@@ -239,11 +240,11 @@
239
240
  box-sizing: border-box;
240
241
  position: relative;
241
242
  width: 100%;
242
- border-radius: var(--ui3n-text-border-radius);
243
+ border-radius: var(--_text-border-radius);
243
244
  background-color: var(--color-bg-control-secondary-default);
244
- padding: 0 var(--ui3n-text-padding-inline);
245
- font-family: var(--ui3n-font-family);
246
- font-size: var(--ui3n-text-font-size);
245
+ padding: 0 var(--_text-padding-inline);
246
+ font-family: inherit;
247
+ font-size: var(--_text-font-size);
247
248
  line-height: 1.23;
248
249
  font-weight: 400;
249
250
  color: var(--color-text-control-primary-default);
@@ -252,7 +253,7 @@
252
253
  &::placeholder {
253
254
  color: var(--color-text-control-secondary-default);
254
255
  font-style: italic;
255
- font-size: var(--ui3n-text-font-size);
256
+ font-size: var(--_text-font-size);
256
257
  line-height: 1.23;
257
258
  font-weight: 400;
258
259
  }
@@ -1,4 +1,5 @@
1
1
  import { VNode } from 'vue';
2
+ import type { Ui3nVirtualElement } from '../ui3n-menu/types';
2
3
 
3
4
  /**
4
5
  * Tooltip placement types
@@ -49,9 +50,14 @@ export interface Ui3nTooltipProps {
49
50
  * Tooltip placement
50
51
  */
51
52
  placement?: Ui3nTooltipPlacement;
53
+ /**
54
+ * External element the tooltip is positioned against.
55
+ * When set, this node is the floating-ui reference and receives hover/click listeners.
56
+ */
57
+ triggerElement?: HTMLElement | Ui3nVirtualElement;
52
58
  /**
53
59
  * Position strategy
54
- * @default 'absolute'
60
+ * @default 'absolute' (or 'fixed' when triggerElement is set)
55
61
  */
56
62
  positionStrategy?: 'absolute' | 'fixed';
57
63
  /**
@@ -107,7 +113,7 @@ export interface Ui3nTooltipSlots {
107
113
  /**
108
114
  * Default slot
109
115
  */
110
- default: () => VNode;
116
+ default?: () => VNode;
111
117
  /**
112
118
  * Content slot
113
119
  */
@@ -0,0 +1,79 @@
1
+ <script lang="ts" setup>
2
+ import { ref } from 'vue';
3
+ import Ui3nTooltip from './ui3n-tooltip.vue';
4
+ import type { TooltipInstance, Ui3nTooltipShowOptions } from '../../plugins/tooltips/types';
5
+
6
+ const items = ref<TooltipInstance[]>([]);
7
+
8
+ function add(item: TooltipInstance) {
9
+ items.value.push(item);
10
+ }
11
+
12
+ function remove(id: string) {
13
+ items.value = items.value.filter(item => item.id !== id);
14
+ }
15
+
16
+ function removeByKind(kind: 'show' | 'attach') {
17
+ items.value = items.value.filter(item => item.kind !== kind);
18
+ }
19
+
20
+ function removeByTarget(target: HTMLElement) {
21
+ items.value = items.value.filter(item => !(item.kind === 'attach' && item.target === target));
22
+ }
23
+
24
+ function update(id: string, patch: Partial<Ui3nTooltipShowOptions>) {
25
+ const item = items.value.find(entry => entry.id === id);
26
+ if (item) {
27
+ Object.assign(item, patch);
28
+ }
29
+ }
30
+
31
+ function clearAll() {
32
+ items.value = [];
33
+ }
34
+
35
+ function tooltipBind(item: TooltipInstance) {
36
+ return {
37
+ id: item.id,
38
+ content: item.content,
39
+ maxContentWidth: item.maxContentWidth,
40
+ color: item.color,
41
+ textColor: item.textColor,
42
+ placement: item.placement,
43
+ positionStrategy: item.positionStrategy ?? 'fixed',
44
+ offsetX: item.offsetX,
45
+ offsetY: item.offsetY,
46
+ trigger: item.trigger,
47
+ modelValue: item.modelValue,
48
+ disabled: item.disabled,
49
+ triggerElement: item.target,
50
+ };
51
+ }
52
+
53
+ defineExpose({ add, remove, removeByKind, removeByTarget, update, clearAll });
54
+ </script>
55
+
56
+ <template>
57
+ <div
58
+ id="ui3n-tooltips-container"
59
+ data-ui3n="tooltip-container"
60
+ :class="$style.container"
61
+ >
62
+ <ui3n-tooltip
63
+ v-for="item in items"
64
+ :key="item.id"
65
+ v-bind="tooltipBind(item)"
66
+ />
67
+ </div>
68
+ </template>
69
+
70
+ <style lang="scss" module>
71
+ .container {
72
+ position: absolute;
73
+ width: 0;
74
+ height: 0;
75
+ overflow: visible;
76
+ pointer-events: none;
77
+ z-index: 2000;
78
+ }
79
+ </style>