@ultraviolet/ui 3.23.0 → 3.24.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.
Files changed (183) hide show
  1. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/asyncToGenerator.js +1 -1
  2. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/defineProperty.js +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/extends.js +1 -1
  4. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectDestructuringEmpty.js +1 -1
  5. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectSpread2.js +1 -1
  6. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectWithoutProperties.js +1 -1
  7. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  8. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPrimitive.js +1 -1
  9. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPropertyKey.js +1 -1
  10. package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/typeof.js +1 -1
  11. package/dist/components/ActionBar/index.js +1 -1
  12. package/dist/components/Alert/index.js +0 -1
  13. package/dist/components/Alert/styles.css.d.ts +0 -40
  14. package/dist/components/Alert/styles.css.d.ts.map +1 -1
  15. package/dist/components/Avatar/index.js +1 -1
  16. package/dist/components/Badge/index.d.ts +5 -2
  17. package/dist/components/Badge/index.d.ts.map +1 -1
  18. package/dist/components/Badge/styles.css.d.ts +0 -45
  19. package/dist/components/Badge/styles.css.d.ts.map +1 -1
  20. package/dist/components/Banner/index.d.ts +3 -2
  21. package/dist/components/Banner/index.d.ts.map +1 -1
  22. package/dist/components/Banner/styles.css.d.ts +0 -17
  23. package/dist/components/Banner/styles.css.d.ts.map +1 -1
  24. package/dist/components/BarChart/index.js +1 -1
  25. package/dist/components/Breadcrumbs/components/Item.js +1 -1
  26. package/dist/components/Button/index.d.ts +6 -2
  27. package/dist/components/Button/index.d.ts.map +1 -1
  28. package/dist/components/Button/styles.css.d.ts +0 -83
  29. package/dist/components/Button/styles.css.d.ts.map +1 -1
  30. package/dist/components/Carousel/Item.js +1 -1
  31. package/dist/components/Chip/index.js +4 -2
  32. package/dist/components/DateInput/components/CalendarContent.js +14 -10
  33. package/dist/components/DateInput/components/CalendarDaily.js +37 -35
  34. package/dist/components/DateInput/components/CalendarMonthly.js +46 -42
  35. package/dist/components/DateInput/index.js +8 -6
  36. package/dist/components/DateInput/styles.css.d.ts.map +1 -1
  37. package/dist/components/Dialog/index.js +1 -1
  38. package/dist/components/Expandable/AnimatedExpandable.js +1 -1
  39. package/dist/components/Expandable/NonAnimatedExpandable.js +1 -1
  40. package/dist/components/FileInput/components/Button.js +2 -2
  41. package/dist/components/FileInput/helpers.js +1 -1
  42. package/dist/components/FileInput/index.js +2 -2
  43. package/dist/components/InfiniteScroll/index.js +1 -1
  44. package/dist/components/KeyValueInput/index.js +1 -1
  45. package/dist/components/LineChart/index.js +1 -1
  46. package/dist/components/List/Cell.js +1 -1
  47. package/dist/components/List/ListContext.js +3 -3
  48. package/dist/components/Loader/index.js +1 -1
  49. package/dist/components/Menu/MenuContent.js +1 -1
  50. package/dist/components/Menu/index.js +2 -2
  51. package/dist/components/Modal/components/Dialog.js +1 -1
  52. package/dist/components/Notification/Notification.js +1 -1
  53. package/dist/components/NumberInput/components/Controls.d.ts.map +1 -1
  54. package/dist/components/NumberInput/components/Controls.js +1 -0
  55. package/dist/components/Pagination/PaginationButtons.d.ts +2 -1
  56. package/dist/components/Pagination/PaginationButtons.d.ts.map +1 -1
  57. package/dist/components/Pagination/PaginationButtons.js +19 -15
  58. package/dist/components/Pagination/getPageItems.d.ts +8 -0
  59. package/dist/components/Pagination/getPageItems.d.ts.map +1 -0
  60. package/dist/components/Pagination/getPageItems.js +35 -0
  61. package/dist/components/Pagination/getPageNumbers.d.ts +2 -1
  62. package/dist/components/Pagination/getPageNumbers.d.ts.map +1 -1
  63. package/dist/components/Pagination/getPageNumbers.js +3 -4
  64. package/dist/components/Pagination/index.d.ts.map +1 -1
  65. package/dist/components/Pagination/index.js +15 -3
  66. package/dist/components/Pagination/styles.css.d.ts +1 -0
  67. package/dist/components/Pagination/styles.css.d.ts.map +1 -1
  68. package/dist/components/Pagination/styles.css.js +6 -5
  69. package/dist/components/PieChart/index.js +1 -1
  70. package/dist/components/Popup/index.js +1 -1
  71. package/dist/components/Popup/styles.css.d.ts.map +1 -1
  72. package/dist/components/Popup/styles.css.js +1 -7
  73. package/dist/components/Row/index.js +1 -1
  74. package/dist/components/SearchInput/styles.css.d.ts.map +1 -1
  75. package/dist/components/SelectInput/components/Dropdown/Dropdown.js +1 -1
  76. package/dist/components/SelectInput/components/Dropdown/Group.js +9 -7
  77. package/dist/components/SelectInput/components/Dropdown/Item.d.ts.map +1 -1
  78. package/dist/components/SelectInput/components/Dropdown/Item.js +49 -43
  79. package/dist/components/SelectInput/components/Dropdown/Option.d.ts.map +1 -1
  80. package/dist/components/SelectInput/components/Dropdown/Option.js +71 -89
  81. package/dist/components/SelectInput/components/Dropdown/SearchBar.js +36 -31
  82. package/dist/components/SelectInput/components/Dropdown/dropdown.css.d.ts.map +1 -1
  83. package/dist/components/SelectInput/components/SelectBar/SelectBar.js +6 -4
  84. package/dist/components/SelectableCard/MultiStateInput.js +1 -1
  85. package/dist/components/SelectableCard/SelectableCard.js +1 -1
  86. package/dist/components/SelectableCardOptionGroup/components/Option.js +1 -1
  87. package/dist/components/Separator/index.d.ts +3 -2
  88. package/dist/components/Separator/index.d.ts.map +1 -1
  89. package/dist/components/Separator/styles.css.d.ts +0 -60
  90. package/dist/components/Separator/styles.css.d.ts.map +1 -1
  91. package/dist/components/Separator/styles.css.js +3 -3
  92. package/dist/components/Slider/components/DoubleSlider.d.ts.map +1 -1
  93. package/dist/components/Slider/components/DoubleSlider.js +103 -114
  94. package/dist/components/Slider/components/SingleSlider.js +2 -5
  95. package/dist/components/Slider/styles.css.d.ts +0 -37
  96. package/dist/components/Slider/styles.css.d.ts.map +1 -1
  97. package/dist/components/Slider/styles.css.js +27 -44
  98. package/dist/components/Stack/index.js +2 -2
  99. package/dist/components/Stepper/index.js +1 -1
  100. package/dist/components/SwitchButton/index.js +1 -0
  101. package/dist/components/Table/Cell.js +1 -1
  102. package/dist/components/Table/TableContext.js +2 -2
  103. package/dist/components/Tabs/Tab.js +2 -2
  104. package/dist/components/Tabs/TabMenu.js +2 -2
  105. package/dist/components/Tabs/TabMenuItem.js +2 -2
  106. package/dist/components/Tabs/index.js +2 -2
  107. package/dist/components/Tag/index.d.ts.map +1 -1
  108. package/dist/components/Tag/index.js +28 -23
  109. package/dist/components/Tag/type.d.ts +1 -2
  110. package/dist/components/Tag/type.d.ts.map +1 -1
  111. package/dist/components/TagInput/index.js +2 -1
  112. package/dist/components/TagList/index.js +1 -1
  113. package/dist/components/TagList/styles.css.d.ts.map +1 -1
  114. package/dist/components/Text/index.d.ts.map +1 -1
  115. package/dist/components/Text/index.js +4 -6
  116. package/dist/components/Text/style.css.d.ts +0 -47
  117. package/dist/components/Text/style.css.d.ts.map +1 -1
  118. package/dist/components/TextArea/index.js +1 -1
  119. package/dist/components/TimeInput/index.js +1 -1
  120. package/dist/components/Toaster/Toaster.js +1 -1
  121. package/dist/components/Toaster/components/Button.js +2 -2
  122. package/dist/components/Toaster/components/Link.js +3 -3
  123. package/dist/components/Tooltip/TooltipChildren.d.ts +10 -0
  124. package/dist/components/Tooltip/TooltipChildren.d.ts.map +1 -0
  125. package/dist/components/Tooltip/TooltipChildren.js +71 -0
  126. package/dist/components/Tooltip/TooltipElement.d.ts +8 -0
  127. package/dist/components/Tooltip/TooltipElement.d.ts.map +1 -0
  128. package/dist/components/Tooltip/TooltipElement.js +39 -0
  129. package/dist/components/Tooltip/index.d.ts +92 -34
  130. package/dist/components/Tooltip/index.d.ts.map +1 -1
  131. package/dist/components/Tooltip/index.js +51 -29
  132. package/dist/components/Tooltip/styles.css.d.ts +17 -0
  133. package/dist/components/Tooltip/styles.css.d.ts.map +1 -1
  134. package/dist/components/Tooltip/styles.css.js +21 -1
  135. package/dist/components/Tooltip/types.d.ts +7 -0
  136. package/dist/components/Tooltip/types.d.ts.map +1 -0
  137. package/dist/components/Tooltip/useTooltip.d.ts +25 -0
  138. package/dist/components/Tooltip/useTooltip.d.ts.map +1 -0
  139. package/dist/components/Tooltip/useTooltip.js +75 -0
  140. package/dist/components/TreeMapChart/index.js +1 -1
  141. package/dist/components/VisuallyHidden/index.js +2 -2
  142. package/dist/composition.js +3 -3
  143. package/dist/compositions/EstimateCost/Components/Item.js +1 -1
  144. package/dist/compositions/EstimateCost/Components/LineThrough.js +2 -2
  145. package/dist/compositions/EstimateCost/Components/Unit.js +1 -1
  146. package/dist/compositions/EstimateCost/EstimateCostProvider.js +1 -1
  147. package/dist/compositions/EstimateCost/Image.js +1 -1
  148. package/dist/compositions/Filters/filterTypes/FilterSlider.js +1 -1
  149. package/dist/compositions/Filters/filterTypes/FilterText.d.ts.map +1 -1
  150. package/dist/compositions/Filters/filterTypes/FilterText.js +1 -0
  151. package/dist/compositions/Filters/parts/AbstractFilter.js +1 -1
  152. package/dist/compositions/Filters/parts/FiltersDrawer.d.ts +1 -0
  153. package/dist/compositions/Filters/parts/FiltersDrawer.d.ts.map +1 -1
  154. package/dist/compositions/Filters/parts/FiltersDrawer.js +15 -4
  155. package/dist/compositions/Filters/parts/FiltersMainRow.js +1 -0
  156. package/dist/compositions/Filters/parts/helpers.d.ts.map +1 -1
  157. package/dist/compositions/Filters/parts/helpers.js +3 -1
  158. package/dist/compositions/Filters/parts/reducer.js +1 -1
  159. package/dist/compositions/Filters/parts/useFilters.js +1 -1
  160. package/dist/compositions/Filters/types.d.ts +1 -0
  161. package/dist/compositions/Filters/types.d.ts.map +1 -1
  162. package/dist/compositions/InfoTable/components/Row.js +1 -1
  163. package/dist/compositions/InfoTable/styles.css.d.ts.map +1 -1
  164. package/dist/compositions/InfoTable/styles.css.js +97 -97
  165. package/dist/compositions/Navigation/NavigationProvider.js +1 -1
  166. package/dist/compositions/Navigation/components/items.css.d.ts.map +1 -1
  167. package/dist/compositions/Navigation/components/styles.css.d.ts.map +1 -1
  168. package/dist/compositions/OfferList/components/Row.js +4 -2
  169. package/dist/compositions/OptionSelector/styles.css.js +97 -97
  170. package/dist/compositions/OrderSummary/helpers.js +1 -1
  171. package/dist/compositions/RichTextInput/index.js +1 -1
  172. package/dist/hooks/useBreakpoint.d.ts +15 -0
  173. package/dist/hooks/useBreakpoint.d.ts.map +1 -0
  174. package/dist/hooks/useBreakpoint.js +46 -0
  175. package/dist/hooks/useIsOverflowing.d.ts +7 -3
  176. package/dist/hooks/useIsOverflowing.d.ts.map +1 -1
  177. package/dist/hooks/useIsOverflowing.js +13 -10
  178. package/dist/index.js +13 -13
  179. package/dist/ui.css +1 -1
  180. package/package.json +3 -2
  181. package/dist/components/Pagination/PaginationButton.d.ts +0 -11
  182. package/dist/components/Pagination/PaginationButton.d.ts.map +0 -1
  183. package/dist/components/Pagination/PaginationButton.js +0 -34
@@ -1,10 +1,12 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
3
4
  import { Stack, init_Stack } from "../Stack/index.js";
4
5
  import { Tooltip, init_Tooltip } from "../Tooltip/index.js";
5
6
  import { Text, init_Text } from "../Text/index.js";
6
7
  import { Loader, init_Loader } from "../Loader/index.js";
7
8
  import { Separator, init_Separator } from "../Separator/index.js";
9
+ import { Row, init_Row } from "../Row/index.js";
8
10
  import { init_styles_css, tagStyle } from "./styles.css.js";
9
11
  import { useMemo } from "react";
10
12
  import { cn } from "@ultraviolet/utils";
@@ -18,11 +20,13 @@ var COPY_DURATION, Tag;
18
20
  function init_Tag() {
19
21
  return (init_Tag = __esmMin(() => {
20
22
  init_Loader();
23
+ init_Row();
21
24
  init_Separator();
22
25
  init_Stack();
23
26
  init_Text();
24
27
  init_Tooltip();
25
28
  init_styles_css();
29
+ init_objectSpread2();
26
30
  COPY_DURATION = 2500;
27
31
  Tag = ({ children, isLoading, onClose, copiable = false, copyButton, copyText = "Copy", copiedText = "Copied!", disabled, sentiment = "neutral", variant = "default", className, style, keyValue, "data-testid": dataTestId }) => {
28
32
  const stringChildren = useMemo(() => {
@@ -35,8 +39,17 @@ function init_Tag() {
35
39
  const [isCopied, setCopied] = useClipboard(stringChildren, { successDuration: COPY_DURATION });
36
40
  const isCopiable = copiable && !disabled;
37
41
  const TagInner = copiable ? "button" : "span";
42
+ const copyTextTooltip = isCopied ? copiedText : copyText;
43
+ const textProps = {
44
+ "aria-disabled": disabled,
45
+ as: "span",
46
+ variant: variant === "code" ? "code" : "caption",
47
+ oneLine: true,
48
+ sentiment: disabled ? "neutral" : sentiment,
49
+ disabled
50
+ };
38
51
  return /* @__PURE__ */ jsx(Tooltip, {
39
- text: isCopiable ? isCopied ? copiedText : copyText : null,
52
+ text: isCopiable ? copyTextTooltip : null,
40
53
  children: /* @__PURE__ */ jsxs(Stack, {
41
54
  direction: "row",
42
55
  className: tagStyle.wrapper[copiable ? "copiable" : "notCopiable"],
@@ -56,29 +69,21 @@ function init_Tag() {
56
69
  if (isCopiable) setCopied().catch(() => null);
57
70
  },
58
71
  children: [
59
- /* @__PURE__ */ jsx(Text, {
60
- "aria-disabled": disabled,
61
- as: "span",
72
+ keyValue ? /* @__PURE__ */ jsxs(Row, {
73
+ templateColumns: "minmax(0, auto) 1px minmax(0, auto)",
74
+ gap: 1,
62
75
  className: tagStyle.text,
63
- oneLine: true,
64
- variant: variant === "code" ? "code" : "caption",
65
- sentiment: disabled ? "neutral" : sentiment,
66
- disabled,
67
- children: keyValue ? /* @__PURE__ */ jsxs(Stack, {
68
- direction: "row",
69
- gap: 1,
70
- children: [
71
- keyValue.key,
72
- /* @__PURE__ */ jsx(Separator, {
73
- sentiment: disabled ? "neutral" : sentiment,
74
- direction: "vertical",
75
- thickness: 1,
76
- className: tagStyle.separator
77
- }),
78
- keyValue.value
79
- ]
80
- }) : children
81
- }),
76
+ children: [
77
+ /* @__PURE__ */ jsx(Text, _objectSpread2(_objectSpread2({}, textProps), {}, { children: keyValue.key })),
78
+ /* @__PURE__ */ jsx(Separator, {
79
+ sentiment: disabled ? "neutral" : sentiment,
80
+ direction: "vertical",
81
+ thickness: 1,
82
+ className: tagStyle.separator
83
+ }),
84
+ /* @__PURE__ */ jsx(Text, _objectSpread2(_objectSpread2({}, textProps), {}, { children: keyValue.value }))
85
+ ]
86
+ }) : /* @__PURE__ */ jsx(Text, _objectSpread2(_objectSpread2({ className: tagStyle.text }, textProps), {}, { children })),
82
87
  copiable && copyButton && !isLoading ? /* @__PURE__ */ jsx(CopyContentIcon, { size: "xsmall" }) : null,
83
88
  isLoading ? /* @__PURE__ */ jsx(Loader, {
84
89
  active: true,
@@ -1,8 +1,7 @@
1
1
  import type { CSSProperties, MouseEventHandler, ReactNode } from 'react';
2
- import type { SENTIMENTS } from './styles.css';
3
2
  export type TagProps = {
4
3
  isLoading?: boolean;
5
- sentiment?: (typeof SENTIMENTS)[number];
4
+ sentiment?: 'danger' | 'info' | 'neutral' | 'primary' | 'secondary' | 'success' | 'warning';
6
5
  disabled?: boolean;
7
6
  copyText?: string;
8
7
  copiedText?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/components/Tag/type.ts"],"names":[],"mapp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SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;CAC/C,GAAG,CACA;IACE,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB,GACD;IACE,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CACJ,CAAA"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { Stack, init_Stack } from "../Stack/index.js";
5
5
  import { Tooltip, init_Tooltip } from "../Tooltip/index.js";
6
6
  import { Button, init_Button } from "../Button/index.js";
@@ -136,6 +136,7 @@ function init_TagInput() {
136
136
  "data-readonly": readOnly,
137
137
  "data-success": !!success,
138
138
  "data-testid": dataTestId,
139
+ tabIndex: 0,
139
140
  onClick: handleContainerClick,
140
141
  onKeyDown: (event) => {
141
142
  if ([" ", "Enter"].includes(event.key)) handleContainerClick();
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { init_styles_css, popoverTriggerWidthVar, tagListStyle } from "./styles.css.js";
5
5
  import { Tag, init_Tag } from "../Tag/index.js";
6
6
  import { Popover, init_Popover } from "../Popover/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/TagList/styles.css.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,oBAAc,CAAA;AA2DjD,eAAO,MAAM,YAAY;;;;;;;;;;;;CAMxB,CAAA"}
1
+ {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/TagList/styles.css.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,oBAAc,CAAA;AA4DjD,eAAO,MAAM,YAAY;;;;;;;;;;;;CAMxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,KAAK,eAAe,GAAG,MAAM,OAAO,WAAW,CAAA;AAC/C,KAAK,cAAc,GAAG,aAAa,CAAC,WAAW,CAAC,CAAA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tB,CAAA;6BAKoB,EACnB,OAAO,EACP,QAAQ,EACR,EAAE,EAAE,SAAiB,EACrB,SAAS,EACT,OAAe,EACf,SAAS,EACT,UAAsB,EACtB,SAAS,EACT,QAAgB,EAChB,MAAc,EACd,SAAiB,EACjB,aAAqB,EACrB,EAAE,EACF,GAAG,EACH,UAAU,EACV,OAAO,EACP,IAAI,EACJ,aAAa,EAAE,UAAU,EACzB,aAAa,EAAE,UAAU,EACzB,KAAK,GACN,EAAE,SAAS"}
@@ -1,12 +1,11 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import recursivelyGetChildrenString, { init_recursivelyGetChildrenString } from "../../helpers/recursivelyGetChildrenString.js";
5
5
  import { init_useIsOverflowing, useIsOverflowing } from "../../hooks/useIsOverflowing.js";
6
6
  import { Tooltip, init_Tooltip } from "../Tooltip/index.js";
7
7
  import { init_style_css, textStyle } from "./style.css.js";
8
8
  import { init_variables_css, textVars } from "./variables.css.js";
9
- import { useRef } from "react";
10
9
  import { cn } from "@ultraviolet/utils";
11
10
  import { assignInlineVars } from "@vanilla-extract/dynamic";
12
11
  import { jsx } from "react/jsx-runtime";
@@ -22,11 +21,10 @@ function init_Text() {
22
21
  init_variables_css();
23
22
  init_objectSpread2();
24
23
  Text = ({ variant, children, as: Component = "div", sentiment, oneLine = false, placement, prominence = "default", className, disabled = false, italic = false, underline = false, strikeThrough = false, id, dir, whiteSpace, htmlFor, role, "data-testid": dataTestId, "aria-hidden": ariaHidden, style }) => {
25
- const elementRef = useRef(null);
26
- const isOverflowing = useIsOverflowing(elementRef);
24
+ const [setElement, isOverflowing] = useIsOverflowing({ enabled: oneLine === true });
27
25
  const finalStringChildren = recursivelyGetChildrenString(children);
28
26
  return /* @__PURE__ */ jsx(Tooltip, {
29
- text: oneLine && isOverflowing ? finalStringChildren : "",
27
+ text: isOverflowing ? finalStringChildren : "",
30
28
  children: /* @__PURE__ */ jsx(Component, {
31
29
  role,
32
30
  "aria-hidden": ariaHidden,
@@ -44,7 +42,7 @@ function init_Text() {
44
42
  dir,
45
43
  htmlFor,
46
44
  id,
47
- ref: elementRef,
45
+ ref: setElement,
48
46
  style: _objectSpread2(_objectSpread2({}, assignInlineVars(textVars, {
49
47
  textAlign: placement !== null && placement !== void 0 ? placement : "",
50
48
  whiteSpace: whiteSpace !== null && whiteSpace !== void 0 ? whiteSpace : ""
@@ -1,54 +1,7 @@
1
1
  import type { TextStyleObject } from '@ultraviolet/themes';
2
- import type { RecipeVariants } from '@vanilla-extract/recipes';
3
2
  type StyleText = Omit<TextStyleObject, 'paragraphSpacing' | 'textCase' | 'textDecoration' | 'weight'> & {
4
3
  textTransform: string;
5
4
  };
6
- declare const text: import("@vanilla-extract/recipes").RuntimeFn<{
7
- disabled: {
8
- true: {};
9
- };
10
- italic: {
11
- true: {
12
- fontStyle: "italic";
13
- };
14
- };
15
- oneLine: {
16
- true: {
17
- overflow: "hidden";
18
- textOverflow: "ellipsis";
19
- whiteSpace: "nowrap";
20
- };
21
- };
22
- prominence: {
23
- default: {};
24
- strong: {};
25
- stronger: {};
26
- weak: {};
27
- };
28
- sentiment: {
29
- black: {};
30
- danger: {};
31
- info: {};
32
- neutral: {};
33
- primary: {};
34
- secondary: {};
35
- success: {};
36
- warning: {};
37
- white: {};
38
- };
39
- strikeThrough: {
40
- true: {
41
- textDecoration: "line-through";
42
- };
43
- };
44
- underline: {
45
- true: {
46
- textDecoration: "underline";
47
- };
48
- };
49
- variant: Record<"body" | "bodySmall" | "bodySmallStrong" | "bodySmallStronger" | "bodyStrong" | "bodyStronger" | "caption" | "captionSmall" | "captionSmallStrong" | "captionSmallStronger" | "captionStrong" | "captionStronger" | "code" | "codeSmall" | "codeSmallStrong" | "codeSmallStronger" | "codeStrong" | "codeStronger" | "heading" | "headingLarge" | "headingLargeStrong" | "headingLargeStronger" | "headingSmall" | "headingSmallStrong" | "headingSmallStronger" | "headingStrong" | "headingStronger", StyleText>;
50
- }>;
51
- export type TextVariants = NonNullable<RecipeVariants<typeof text>>;
52
5
  export declare const textStyle: {
53
6
  text: import("@vanilla-extract/recipes").RuntimeFn<{
54
7
  disabled: {
@@ -1 +1 @@
1
- {"version":3,"file":"style.css.d.ts","sourceRoot":"","sources":["../../../src/components/Text/style.css.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,eAAe,EAAe,MAAM,qBAAqB,CAAA;AAItF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAsB9D,KAAK,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,GAAG,UAAU,GAAG,gBAAgB,GAAG,QAAQ,CAAC,GAAG;IACtG,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAmFD,QAAA,MAAM,IAAI;;QAkBJ,IAAI;;;;;;;;;;;;;;;QAeJ,OAAO;QACP,MAAM;QACN,QAAQ;QACR,IAAI;;;QAGJ,KAAK;QACL,MAAM;QACN,IAAI;QACJ,OAAO;QACP,OAAO;QACP,SAAS;QACT,OAAO;QACP,OAAO;QACP,KAAK;;;;;;;;;;;;;EAcT,CAAA;AAGF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;AAEnE,eAAO,MAAM,SAAS;;;YAhDhB,IAAI;;;;;;;;;;;;;;;YAeJ,OAAO;YACP,MAAM;YACN,QAAQ;YACR,IAAI;;;YAGJ,KAAK;YACL,MAAM;YACN,IAAI;YACJ,OAAO;YACP,OAAO;YACP,SAAS;YACT,OAAO;YACP,OAAO;YACP,KAAK;;;;;;;;;;;;;;;CAmB+B,CAAA"}
1
+ {"version":3,"file":"style.css.d.ts","sourceRoot":"","sources":["../../../src/components/Text/style.css.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,eAAe,EAAe,MAAM,qBAAqB,CAAA;AAyBtF,KAAK,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,kBAAkB,GAAG,UAAU,GAAG,gBAAgB,GAAG,QAAQ,CAAC,GAAG;IACtG,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAoJD,eAAO,MAAM,SAAS;;;YA/ChB,IAAI;;;;;;;;;;;;;;;YAeJ,OAAO;YACP,MAAM;YACN,QAAQ;YACR,IAAI;;;YAGJ,KAAK;YACL,MAAM;YACN,IAAI;YACJ,OAAO;YACP,OAAO;YACP,SAAS;YACT,OAAO;YACP,OAAO;YACP,KAAK;;;;;;;;;;;;;;;CAkB+B,CAAA"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { Stack, init_Stack } from "../Stack/index.js";
5
5
  import { Tooltip, init_Tooltip } from "../Tooltip/index.js";
6
6
  import { Button, init_Button } from "../Button/index.js";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { Stack, init_Stack } from "../Stack/index.js";
5
5
  import { Text, init_Text } from "../Text/index.js";
6
6
  import { hasHelperText, init_hasHelperText } from "../../helpers/hasHelperText.js";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { CloseButton, init_CloseButton } from "./components/CloseButton.js";
5
5
  import { Content, init_Content } from "./components/Content.js";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
4
- import _objectWithoutProperties, { init_objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectWithoutProperties.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
+ import _objectWithoutProperties, { init_objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectWithoutProperties.js";
5
5
  import { Button, init_Button as init_Button$1 } from "../../Button/index.js";
6
6
  import { init_styles_css, toasterStyle } from "../styles.css.js";
7
7
  import { cn } from "@ultraviolet/utils";
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
3
- import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectSpread2.js";
3
+ import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
4
4
  import { Link, init_Link as init_Link$1 } from "../../Link/index.js";
5
- import _objectDestructuringEmpty, { init_objectDestructuringEmpty } from "../../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/objectDestructuringEmpty.js";
6
- import _extends, { init_extends } from "../../../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/extends.js";
5
+ import _objectDestructuringEmpty, { init_objectDestructuringEmpty } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectDestructuringEmpty.js";
6
+ import _extends, { init_extends } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/extends.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/Toaster/components/Link.tsx
@@ -0,0 +1,10 @@
1
+ import type { TooltipProps } from '.';
2
+ import type { useTooltip } from './useTooltip';
3
+ type TooltipChildrenProps = {
4
+ tooltip: ReturnType<typeof useTooltip>;
5
+ tooltipId: string;
6
+ isTooltipVisible: boolean;
7
+ } & Pick<TooltipProps, 'children' | 'tabIndex' | 'relation' | 'containerFullHeight' | 'containerFullWidth'>;
8
+ export declare const TooltipChildren: ({ children, tooltip, tooltipId, tabIndex, relation, isTooltipVisible, containerFullHeight, containerFullWidth, }: TooltipChildrenProps) => string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | Iterable<import("react").ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
9
+ export {};
10
+ //# sourceMappingURL=TooltipChildren.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipChildren.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipChildren.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAA;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAqB9C,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,qBAAqB,GAAG,oBAAoB,CAAC,CAAA;AAE3G,eAAO,MAAM,eAAe,qHASzB,oBAAoB,gWA4DtB,CAAA"}
@@ -0,0 +1,71 @@
1
+ import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
2
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
3
+ import { init_styles_css, tooltipStyle } from "./styles.css.js";
4
+ import { useEffect, useRef } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+
7
+ //#region src/components/Tooltip/TooltipChildren.tsx
8
+ var FOCUSABLE_ELEMENTS, TooltipChildren;
9
+ function init_TooltipChildren() {
10
+ return (init_TooltipChildren = __esmMin(() => {
11
+ init_styles_css();
12
+ init_objectSpread2();
13
+ FOCUSABLE_ELEMENTS = `
14
+ :is(
15
+ a[href],
16
+ button,
17
+ input:not([type="hidden"]),
18
+ select,
19
+ textarea,
20
+ [tabindex],
21
+ [contenteditable="true"],
22
+ details,
23
+ summary,
24
+ audio[controls],
25
+ video[controls]
26
+ )
27
+ :not([disabled])
28
+ :not([tabindex="-1"])
29
+ `.replace(/\s+/g, "");
30
+ TooltipChildren = ({ children, tooltip, tooltipId, tabIndex = 0, relation, isTooltipVisible, containerFullHeight, containerFullWidth }) => {
31
+ const eventHandlers = tooltip.getReferenceProps();
32
+ const ariaAttributeName = relation === "label" ? "aria-labelledby" : "aria-describedby";
33
+ const ariaAttributeValue = isTooltipVisible ? tooltipId : null;
34
+ const tooltipWrapperRef = useRef(null);
35
+ useEffect(() => {
36
+ if (!tooltipWrapperRef.current) return;
37
+ const reference = tooltipWrapperRef.current.querySelector(FOCUSABLE_ELEMENTS) || tooltipWrapperRef.current;
38
+ const existingAriaValue = reference.getAttribute(ariaAttributeName);
39
+ tooltip.refs.setReference(reference);
40
+ const clearAriaAttribute = () => {
41
+ if (existingAriaValue) reference.setAttribute(ariaAttributeName, existingAriaValue);
42
+ else reference.removeAttribute(ariaAttributeName);
43
+ };
44
+ if (ariaAttributeValue) reference.setAttribute(ariaAttributeName, [existingAriaValue, ariaAttributeValue].join(" ").trim());
45
+ else clearAriaAttribute();
46
+ if (reference === tooltipWrapperRef.current && tooltipWrapperRef.current.tabIndex !== tabIndex) tooltipWrapperRef.current.tabIndex = tabIndex;
47
+ return clearAriaAttribute;
48
+ }, [
49
+ tooltip,
50
+ tabIndex,
51
+ ariaAttributeName,
52
+ ariaAttributeValue
53
+ ]);
54
+ if (typeof children === "function") return children(_objectSpread2(_objectSpread2({}, eventHandlers), {}, {
55
+ [ariaAttributeName]: ariaAttributeValue,
56
+ ref: tooltip.refs.setReference
57
+ }));
58
+ return /* @__PURE__ */ jsx("div", _objectSpread2(_objectSpread2({
59
+ ref: tooltipWrapperRef,
60
+ className: tooltipStyle.childrenContainer({
61
+ fullHeight: containerFullHeight,
62
+ fullWidth: containerFullWidth
63
+ })
64
+ }, eventHandlers), {}, { children }));
65
+ };
66
+ }))();
67
+ }
68
+
69
+ //#endregion
70
+ init_TooltipChildren();
71
+ export { TooltipChildren, init_TooltipChildren };
@@ -0,0 +1,8 @@
1
+ import type { TooltipProps } from '.';
2
+ import type { useTooltip } from './useTooltip';
3
+ type TooltipElementProps = Pick<TooltipProps, 'id' | 'className' | 'style' | 'data-testid' | 'maxWidth' | 'text'> & {
4
+ tooltip: ReturnType<typeof useTooltip>;
5
+ };
6
+ export declare const TooltipElement: ({ tooltip, id, className, style, 'data-testid': dataTestId, maxWidth, text, }: TooltipElementProps) => import("react").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=TooltipElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipElement.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAA;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAI9C,KAAK,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,MAAM,CAAC,GAAG;IAClH,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,cAAc,kFAQxB,mBAAmB,gCAyBrB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
2
+ import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
3
+ import { init_styles_css, tooltipStyle } from "./styles.css.js";
4
+ import { init_styles_css as init_styles_css$1, visuallyHiddenStyle } from "../VisuallyHidden/styles.css.js";
5
+ import { cn } from "@ultraviolet/utils";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/components/Tooltip/TooltipElement.tsx
9
+ var TooltipElement;
10
+ function init_TooltipElement() {
11
+ return (init_TooltipElement = __esmMin(() => {
12
+ init_styles_css$1();
13
+ init_styles_css();
14
+ init_objectSpread2();
15
+ TooltipElement = ({ tooltip, id, className, style, "data-testid": dataTestId, maxWidth, text }) => {
16
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({}, tooltip.getFloatingProps()), {}, {
17
+ id,
18
+ className: cn(className, tooltipStyle.tooltip, tooltip.isMounted ? null : visuallyHiddenStyle.visuallyHidden, tooltip.status === "open" || tooltip.status === "close" ? tooltipStyle.animation[tooltip.status] : null),
19
+ "data-placement": tooltip.finalPlacement,
20
+ "data-testid": dataTestId,
21
+ ref: tooltip.refs.setFloating,
22
+ role: "tooltip",
23
+ style: _objectSpread2(_objectSpread2({}, tooltip.floatingStyles), {}, { maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth }, style),
24
+ children: [/* @__PURE__ */ jsx("div", {
25
+ className: tooltipStyle.arrow,
26
+ ref: tooltip.arrowRef,
27
+ style: tooltip.arrowStyle
28
+ }), /* @__PURE__ */ jsx("div", {
29
+ className: tooltipStyle.content,
30
+ children: text
31
+ })]
32
+ }));
33
+ };
34
+ }))();
35
+ }
36
+
37
+ //#endregion
38
+ init_TooltipElement();
39
+ export { TooltipElement, init_TooltipElement };
@@ -1,43 +1,101 @@
1
- import type { ComponentProps, Ref } from 'react';
2
- import { Popup } from '../Popup';
3
- /**
4
- * Tooltip component is used to display additional information on hover or focus.
5
- * It is used to explain the purpose of the element it is attached to.
6
- */
7
- export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<{
1
+ import type { CSSProperties, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import type { TooltipPlacement } from './types';
3
+ export type TooltipRenderProps = Pick<HTMLAttributes<HTMLElement>, 'onBlur' | 'onFocus' | 'onKeyDown' | 'onMouseLeave' | 'onMouseMove' | 'onPointerDown' | 'onPointerEnter' | 'aria-describedby' | 'aria-labelledby'> & {
4
+ ref?: Ref<any>;
5
+ };
6
+ export type TooltipProps = {
7
+ /**
8
+ * id of the tooltip element
9
+ */
8
10
  id?: string;
9
- children: import("react").ReactNode | ((renderProps: {
10
- className?: string;
11
- onBlur: () => void;
12
- onFocus: () => void;
13
- onPointerEnter: () => void;
14
- onPointerLeave: () => void;
15
- ref: import("react").RefObject<HTMLDivElement | null>;
16
- }) => import("react").ReactNode);
11
+ /**
12
+ * The trigger element of the tooltip. If a function is provided, it receives
13
+ * the props (including `aria-describedby`, event handlers and `ref`) to spread
14
+ * on the trigger element.
15
+ */
16
+ children: ReactNode | ((renderProps: TooltipRenderProps) => ReactNode);
17
+ /**
18
+ * max-width of the tooltip element
19
+ */
17
20
  maxWidth?: number | string;
18
- placement?: import("../Popup/helpers").PopupPlacement;
19
- align?: import("../Popup/helpers").PopupAlign;
20
- text?: import("react").ReactNode;
21
+ /**
22
+ * Content of the tooltip, preferably text inside. When omitted, no tooltip is rendered.
23
+ */
24
+ text?: ReactNode;
25
+ /**
26
+ * Preferred placement for the Tooltip.
27
+ * If there is not enough space, the direction will be flipped so that the Tooltip stays visible.
28
+ * @default 'top'
29
+ */
30
+ placement?: TooltipPlacement;
31
+ /**
32
+ * Force the tooltip to be visible. When set, the tooltip is controlled and won't react to hover/focus.
33
+ */
34
+ visible?: boolean;
35
+ /**
36
+ * className added on the tooltip element
37
+ */
21
38
  className?: string;
39
+ /**
40
+ * @deprecated use relation instead
41
+ */
42
+ role?: string;
43
+ /**
44
+ * Role of the tooltip in relation to its reference element
45
+ * - use "description" only if the reference element already has an accessible label
46
+ * - use "label" if the tooltip text should be the label of the reference element
47
+ * @default 'description'
48
+ */
49
+ relation?: 'description' | 'label';
50
+ 'data-testid'?: string;
51
+ /**
52
+ * It will add `width: 100%` to the tooltip trigger container.
53
+ */
22
54
  containerFullWidth?: boolean;
55
+ /**
56
+ * It will add `height: 100%` to the tooltip trigger container.
57
+ */
23
58
  containerFullHeight?: boolean;
24
- visible?: boolean;
25
- innerRef?: Ref<HTMLDivElement | null>;
26
- role?: "dialog" | "popup" | "tooltip";
27
- 'data-testid'?: string;
28
- hasArrow?: boolean;
29
- onClose?: () => void;
59
+ /**
60
+ * Render the tooltip in a portal target if you need it to overflow from a scroll container, at the cost of a small lag of the tooltip behind its reference element when scrolling.
61
+ * @default document.body
62
+ */
63
+ portalTarget?: HTMLElement | null;
64
+ /**
65
+ * tabindex attribute for the tooltip trigger container
66
+ */
30
67
  tabIndex?: number;
31
- onKeyDown?: import("react").KeyboardEventHandler;
32
- 'aria-haspopup'?: import("react").HTMLAttributes<HTMLDivElement>['aria-haspopup'];
33
- hideOnClickOutside?: boolean;
68
+ /**
69
+ * Delay (in ms) before the tooltip opens and closes.
70
+ * @deprecated Use `delay` instead to have more control over opening and closing delays.
71
+ */
34
72
  debounceDelay?: number;
35
- maxHeight?: string | number;
73
+ /**
74
+ * Open and close delay (in ms) for the tooltip.
75
+ */
76
+ delay?: {
77
+ open?: number;
78
+ close?: number;
79
+ };
80
+ /**
81
+ * @deprecated The animation cannot be disabled
82
+ */
36
83
  disableAnimation?: boolean;
37
- portalTarget?: HTMLElement;
38
- dynamicDomRendering?: boolean;
39
- style?: import("react").CSSProperties;
40
- } & import("react").RefAttributes<HTMLDivElement>, "children" | "className" | "containerFullHeight" | "containerFullWidth" | "data-testid" | "debounceDelay" | "disableAnimation" | "id" | "innerRef" | "maxWidth" | "portalTarget" | "role" | "style" | "tabIndex" | "text" | "visible"> & {
41
- placement?: Exclude<ComponentProps<typeof Popup>['placement'], 'nested-menu'>;
42
- } & import("react").RefAttributes<HTMLDivElement>>;
84
+ /**
85
+ * style added on the tooltip element
86
+ */
87
+ style?: CSSProperties;
88
+ /**
89
+ * Called when the tooltip visibility changes (open/close, including Escape dismiss).
90
+ */
91
+ onOpenChange?: (open: boolean) => void;
92
+ };
93
+ export declare const DEFAULT_DELAY: {
94
+ close: number;
95
+ open: number;
96
+ };
97
+ export declare function Tooltip({ children, text, placement, id, className, containerFullWidth, containerFullHeight, maxWidth, visible, 'data-testid': dataTestId, portalTarget, relation, debounceDelay, delay, tabIndex, style, onOpenChange, }: TooltipProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
98
+ export declare namespace Tooltip {
99
+ var displayName: string;
100
+ }
43
101
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAyBhC;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAPN,OAAO,CAAC,cAAc,CAAC,OAAO,KAAK,CA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