@geneui/components 3.0.0-next-9ffcb93-16102024 → 3.0.0-next-48d0ef7-31102024

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 (248) hide show
  1. package/Avatar.js +63 -0
  2. package/CHANGELOG.md +7 -0
  3. package/Divider.js +23 -0
  4. package/{GeneUIProvider/index.js → GeneUIProvider.js} +52 -65
  5. package/HelperText.js +69 -0
  6. package/Info.js +64 -0
  7. package/Label.js +38 -0
  8. package/Loader.js +21 -0
  9. package/Pill.js +64 -0
  10. package/TextLink.js +20 -0
  11. package/{index-65217440.js → Tooltip.js} +104 -80
  12. package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
  13. package/components/atoms/Avatar/index.d.ts +1 -0
  14. package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
  15. package/components/atoms/Divider/index.d.ts +1 -0
  16. package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
  17. package/components/atoms/HelperText/index.d.ts +1 -0
  18. package/{lib → components}/atoms/Info/Info.d.ts +5 -5
  19. package/components/atoms/Info/index.d.ts +1 -0
  20. package/{lib → components}/atoms/Label/Label.d.ts +3 -3
  21. package/components/atoms/Label/index.d.ts +1 -0
  22. package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
  23. package/components/atoms/Loader/index.d.ts +1 -0
  24. package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
  25. package/components/atoms/Pill/index.d.ts +1 -0
  26. package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
  27. package/components/atoms/TextLink/index.d.ts +1 -0
  28. package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
  29. package/components/molecules/Tooltip/index.d.ts +1 -0
  30. package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
  31. package/components/providers/GeneUIProvider/index.d.ts +1 -0
  32. package/hooks/index.d.ts +2 -20
  33. package/hooks/useDebounceCallback/index.d.ts +1 -0
  34. package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
  35. package/hooks/useEllipsisDetection/index.d.ts +1 -1
  36. package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
  37. package/{index-031ff73c.js → index-ce02421b.js} +4 -4
  38. package/index.d.ts +11 -121
  39. package/index.js +12 -159
  40. package/package.json +24 -43
  41. package/tokens-0abb4e1b.js +6 -0
  42. package/types/index.d.ts +0 -3
  43. package/useEllipsisDetection-46d712b6.js +34 -0
  44. package/ActionableList/index.js +0 -1694
  45. package/AdvancedSearch/index.js +0 -892
  46. package/Alert/index.js +0 -98
  47. package/Avatar/index.js +0 -58
  48. package/Badge/index.js +0 -29
  49. package/Breadcrumb/index.js +0 -130
  50. package/BusyLoader/index.js +0 -31
  51. package/Button/index.js +0 -30
  52. package/Card/index.js +0 -502
  53. package/CardList/index.js +0 -662
  54. package/CellMeasurerCache-80be385d.js +0 -229
  55. package/Charts/index.js +0 -17662
  56. package/Checkbox/index.js +0 -229
  57. package/CheckboxGroup/index.js +0 -203
  58. package/CheckboxGroupWithSearch/index.js +0 -280
  59. package/Collapse/index.js +0 -195
  60. package/ColorPicker/index.js +0 -210
  61. package/ComboBox/index.js +0 -524
  62. package/Copy/index.js +0 -56
  63. package/Counter/index.js +0 -312
  64. package/DateFilter/index.js +0 -183
  65. package/DatePicker/index.js +0 -1229
  66. package/DatePickerInput/index.js +0 -883
  67. package/Divider/index.js +0 -23
  68. package/Drawer/index.js +0 -261
  69. package/Dropdown/index.js +0 -43
  70. package/Editor/index.js +0 -22975
  71. package/Empty/index.js +0 -76
  72. package/ExtendedInput/index.js +0 -590
  73. package/Form/index.js +0 -85
  74. package/FormContainer/index.js +0 -189
  75. package/FormableCheckbox/index.js +0 -24
  76. package/FormableDatePicker/index.js +0 -43
  77. package/FormableDropdown/index.js +0 -50
  78. package/FormableEditor/index.js +0 -26
  79. package/FormableHOC-85f89a81.js +0 -83
  80. package/FormableMultiSelectDropdown/index.js +0 -50
  81. package/FormableNumberInput/index.js +0 -34
  82. package/FormableRadio/index.js +0 -22
  83. package/FormableSwitcher/index.js +0 -22
  84. package/FormableTextInput/index.js +0 -34
  85. package/FormableUploader/index.js +0 -44
  86. package/Grid/index.js +0 -167
  87. package/HelperText/index.js +0 -86
  88. package/Holder/index.js +0 -261
  89. package/Icon/index.js +0 -62
  90. package/Image/index.js +0 -45
  91. package/ImagePreview/index.js +0 -217
  92. package/Info/index.js +0 -41
  93. package/InfoOutline-dd2e89d9.js +0 -29
  94. package/InteractiveWidget/index.js +0 -78
  95. package/KeyValue/index.js +0 -22
  96. package/Label/index.js +0 -48
  97. package/LinkButton/index.js +0 -34
  98. package/Loader/index.js +0 -23
  99. package/Menu/index.js +0 -281
  100. package/MobileNavigation/index.js +0 -94
  101. package/MobilePopup/index.js +0 -182
  102. package/Modal/index.js +0 -251
  103. package/ModuleTitle/index.js +0 -141
  104. package/NavigationMenu/index.js +0 -222
  105. package/Notification/index.js +0 -120
  106. package/Option/index.js +0 -184
  107. package/Overlay/index.js +0 -187
  108. package/Overspread/index.js +0 -291
  109. package/Pagination/index.js +0 -261
  110. package/Paper/index.js +0 -96
  111. package/Pill/index.js +0 -67
  112. package/Popover/index.js +0 -725
  113. package/PopoverV2/index.js +0 -19
  114. package/Portal/index.js +0 -58
  115. package/Products/index.js +0 -115
  116. package/Profile/index.js +0 -589
  117. package/Progress/index.js +0 -200
  118. package/QRCode/index.js +0 -814
  119. package/Radio/index.js +0 -151
  120. package/RadioGroup/index.js +0 -104
  121. package/Range/index.js +0 -191
  122. package/Rating/index.js +0 -174
  123. package/RichEditor/index.js +0 -13
  124. package/RichEditor-78c2617e.js +0 -228
  125. package/Scrollbar/index.js +0 -1585
  126. package/Search/index.js +0 -75
  127. package/SearchWithDropdown/index.js +0 -140
  128. package/Section/index.js +0 -61
  129. package/SkeletonLoader/index.js +0 -81
  130. package/Slider/index.js +0 -261
  131. package/Status/index.js +0 -97
  132. package/Steps/index.js +0 -314
  133. package/SuggestionList/index.js +0 -385
  134. package/Switcher/index.js +0 -193
  135. package/Table/index.js +0 -57
  136. package/TableCompositions/index.js +0 -16995
  137. package/Tabs/index.js +0 -235
  138. package/Tag/index.js +0 -102
  139. package/TextLink/index.js +0 -20
  140. package/Textarea/index.js +0 -242
  141. package/Time/index.js +0 -62
  142. package/TimePicker/index.js +0 -575
  143. package/Timeline/index.js +0 -113
  144. package/Title/index.js +0 -65
  145. package/Toaster/index.js +0 -116
  146. package/Tooltip/index.js +0 -6
  147. package/TransferList/index.js +0 -493
  148. package/Uploader/index.js +0 -992
  149. package/ValidatableCheckbox/index.js +0 -123
  150. package/ValidatableDatePicker/index.js +0 -316
  151. package/ValidatableDropdown/index.js +0 -141
  152. package/ValidatableElements/index.js +0 -67
  153. package/ValidatableMultiSelectDropdown/index.js +0 -152
  154. package/ValidatableNumberInput/index.js +0 -204
  155. package/ValidatableRadio/index.js +0 -116
  156. package/ValidatableSwitcher/index.js +0 -93
  157. package/ValidatableTextInput/index.js +0 -167
  158. package/ValidatableTimeInput/index.js +0 -174
  159. package/ValidatableUploader/index.js +0 -98
  160. package/Widget/index.js +0 -225
  161. package/_commonjsHelpers-24198af3.js +0 -35
  162. package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
  163. package/callAfterDelay-7272faca.js +0 -12
  164. package/checkTimeValidation-e56771be.js +0 -16
  165. package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
  166. package/clsx.m-2bb6df4b.js +0 -3
  167. package/config-1053d64d.js +0 -20
  168. package/configs-00612ce0.js +0 -103
  169. package/configs.js +0 -111
  170. package/dateValidation-67caec66.js +0 -225
  171. package/debounce-4419bc2f.js +0 -17
  172. package/guid-8ddf77b3.js +0 -16
  173. package/hooks/useBodyScroll.js +0 -16
  174. package/hooks/useClick.js +0 -18
  175. package/hooks/useClickOutside.js +0 -25
  176. package/hooks/useDebounce.js +0 -28
  177. package/hooks/useDeviceType.js +0 -17
  178. package/hooks/useDidMount.js +0 -15
  179. package/hooks/useForceUpdate.js +0 -8
  180. package/hooks/useHover.js +0 -20
  181. package/hooks/useImgDownload.js +0 -18
  182. package/hooks/useKeyDown.js +0 -21
  183. package/hooks/useMount.js +0 -13
  184. package/hooks/useMutationObserver.js +0 -21
  185. package/hooks/usePrevious.js +0 -10
  186. package/hooks/useThrottle.js +0 -16
  187. package/hooks/useToggle.js +0 -11
  188. package/hooks/useUpdatableRef.js +0 -14
  189. package/hooks/useUpdate.js +0 -10
  190. package/hooks/useWidth.js +0 -16
  191. package/hooks/useWindowSize.js +0 -40
  192. package/index-122432cd.js +0 -270
  193. package/index-262edd7a.js +0 -77
  194. package/index-2f5aa51e.js +0 -6483
  195. package/index-370f9acd.js +0 -4
  196. package/index-45eafea6.js +0 -90
  197. package/index-480fd7d9.js +0 -10032
  198. package/index-5f37f281.js +0 -168
  199. package/index-73aaa093.js +0 -1940
  200. package/index.mobile.d.ts +0 -14
  201. package/lib/atoms/Avatar/index.d.ts +0 -1
  202. package/lib/atoms/Badge/Badge.d.ts +0 -36
  203. package/lib/atoms/Badge/index.d.ts +0 -1
  204. package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
  205. package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
  206. package/lib/atoms/BusyLoader/index.d.ts +0 -1
  207. package/lib/atoms/Button/Button.d.ts +0 -70
  208. package/lib/atoms/Button/index.d.ts +0 -1
  209. package/lib/atoms/Divider/index.d.ts +0 -1
  210. package/lib/atoms/Empty/Empty.d.ts +0 -39
  211. package/lib/atoms/Empty/index.d.ts +0 -1
  212. package/lib/atoms/Empty/utils.d.ts +0 -9
  213. package/lib/atoms/HelperText/index.d.ts +0 -1
  214. package/lib/atoms/Image/Image.d.ts +0 -51
  215. package/lib/atoms/Image/index.d.ts +0 -1
  216. package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
  217. package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
  218. package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
  219. package/lib/atoms/ImagePreview/index.d.ts +0 -1
  220. package/lib/atoms/Info/index.d.ts +0 -1
  221. package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
  222. package/lib/atoms/KeyValue/index.d.ts +0 -1
  223. package/lib/atoms/Label/index.d.ts +0 -1
  224. package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
  225. package/lib/atoms/LinkButton/index.d.ts +0 -1
  226. package/lib/atoms/Loader/index.d.ts +0 -1
  227. package/lib/atoms/Pill/index.d.ts +0 -1
  228. package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
  229. package/lib/atoms/Rating/Rating.d.ts +0 -49
  230. package/lib/atoms/Rating/index.d.ts +0 -1
  231. package/lib/atoms/TextLink/index.d.ts +0 -1
  232. package/lib/molecules/Copy/Copy.d.ts +0 -38
  233. package/lib/molecules/Copy/index.d.ts +0 -1
  234. package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
  235. package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
  236. package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
  237. package/lib/molecules/Tooltip/index.d.ts +0 -1
  238. package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
  239. package/lib/providers/GeneUIProvider/index.d.ts +0 -1
  240. package/localization-4ba17032.js +0 -46
  241. package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
  242. package/rangeAndSlider-693a3d41.js +0 -8684
  243. package/react-beautiful-dnd.esm-b637016a.js +0 -10116
  244. package/react-lifecycles-compat.es-6e1f3768.js +0 -158
  245. package/redux-e591c1b8.js +0 -536
  246. package/tokens-8ab1179c.js +0 -6
  247. package/tslib.es6-f211516f.js +0 -35
  248. package/useEllipsisDetection-c1c9ad94.js +0 -38
package/Pill/index.js DELETED
@@ -1,67 +0,0 @@
1
- import React__default, { useState, useRef, useEffect, cloneElement } from 'react';
2
- import { _ as _objectWithoutProperties, a as _extends } from '../ArrowLeft-b88e2ba8.js';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import { T as Tooltip } from '../index-65217440.js';
5
- import 'prop-types';
6
- import '../dateValidation-67caec66.js';
7
- import 'react-dom';
8
- import '../configs-00612ce0.js';
9
- import { u as useEllipsisDetection } from '../useEllipsisDetection-c1c9ad94.js';
10
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
11
- import '../tslib.es6-f211516f.js';
12
- import '../GeneUIProvider/index.js';
13
- import '../_commonjsHelpers-24198af3.js';
14
- import '../hooks/useDebounce.js';
15
-
16
- var _excluded = ["size", "color"];
17
- var SvgDot = function SvgDot(_ref) {
18
- var _ref$size = _ref.size,
19
- size = _ref$size === void 0 ? 24 : _ref$size,
20
- _ref$color = _ref.color,
21
- color = _ref$color === void 0 ? "currentColor" : _ref$color,
22
- props = _objectWithoutProperties(_ref, _excluded);
23
- return /*#__PURE__*/React__default.createElement("svg", _extends({
24
- width: size,
25
- height: size,
26
- viewBox: "0 0 24 24",
27
- fill: color,
28
- xmlns: "http://www.w3.org/2000/svg"
29
- }, props), /*#__PURE__*/React__default.createElement("path", {
30
- d: "M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z",
31
- fill: color
32
- }));
33
- };
34
-
35
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .pill{align-items:center;display:inline-flex;max-width:100%;vertical-align:top}[data-gene-ui-version=\"2.16.3\"] .pill_icon_after{flex-direction:row-reverse}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium:not(.pill_icon_only){gap:var(--guit-ref-spacing-xsmall);padding-bottom:var(--guit-ref-spacing-2xsmall);padding-top:var(--guit-ref-spacing-2xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium:not(.pill_icon_before,.pill_size_medium.pill_icon_after,.pill_size_medium.pill_icon_only){padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-medium)}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium.pill_icon_before{padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium.pill_icon_after{padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-medium)}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium.pill_icon_only{padding:var(--guit-ref-spacing-2xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small:not(.pill_icon_only){gap:var(--guit-ref-spacing-2xsmall);padding-bottom:var(--guit-ref-spacing-4xsmall);padding-top:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small:not(.pill_icon_before,.pill_size_small.pill_icon_after,.pill_size_small.pill_icon_only){padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-medium)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small.pill_icon_before{padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small.pill_icon_after{padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-medium)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small.pill_icon_only{padding:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_medium:not(.pill_icon_only),[data-gene-ui-version=\"2.16.3\"] .pill_size_small:not(.pill_icon_only){font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge{gap:var(--guit-ref-spacing-3xsmall);padding-bottom:var(--guit-ref-spacing-4xsmall);padding-top:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge:not(.pill_icon_only){font-family:var(--guit-sem-font-label-small-default-medium-font-family);font-size:var(--guit-sem-font-label-small-default-medium-font-size);font-weight:var(--guit-sem-font-label-small-default-medium-font-weight);line-height:var(--guit-sem-font-label-small-default-medium-line-height)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge:not(.pill_icon_before,.pill_size_small_nudge.pill_icon_after,.pill_size_small_nudge.pill_icon_only){padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge.pill_icon_before{padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-3xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge.pill_icon_after{padding-inline-end:var(--guit-ref-spacing-3xsmall);padding-inline-start:var(--guit-ref-spacing-xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_size_small_nudge.pill_icon_only{padding:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_size_medium,[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_size_small{border-radius:var(--guit-ref-radius-3xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_size_small_nudge{border-radius:var(--guit-ref-radius-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_informative{background-color:var(--guit-sem-color-background-informative)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_neutral{background-color:var(--guit-sem-color-background-neutral-3)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_error{background-color:var(--guit-sem-color-background-error-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_success{background-color:var(--guit-sem-color-background-success-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_warning{background-color:var(--guit-sem-color-background-warning-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_purple{background-color:var(--guit-sem-color-background-accent-purple-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_lagoon{background-color:var(--guit-sem-color-background-accent-lagoon-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_magenta{background-color:var(--guit-sem-color-background-accent-magenta-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_slate{background-color:var(--guit-sem-color-background-accent-slate-1)}[data-gene-ui-version=\"2.16.3\"] .pill_fill.pill_color_inverse{background-color:var(--guit-sem-color-background-inverse);color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.3\"] .pill_color_informative{color:var(--guit-sem-color-foreground-informative)}[data-gene-ui-version=\"2.16.3\"] .pill_color_neutral{color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.3\"] .pill_color_error{color:var(--guit-sem-color-foreground-error)}[data-gene-ui-version=\"2.16.3\"] .pill_color_success{color:var(--guit-sem-color-foreground-success)}[data-gene-ui-version=\"2.16.3\"] .pill_color_warning{color:var(--guit-sem-color-foreground-warning)}[data-gene-ui-version=\"2.16.3\"] .pill_color_purple{color:var(--guit-sem-color-foreground-accent-purple)}[data-gene-ui-version=\"2.16.3\"] .pill_color_lagoon{color:var(--guit-sem-color-foreground-accent-lagoon)}[data-gene-ui-version=\"2.16.3\"] .pill_color_magenta{color:var(--guit-sem-color-foreground-accent-magenta)}[data-gene-ui-version=\"2.16.3\"] .pill_color_slate{color:var(--guit-sem-color-foreground-accent-slate)}[data-gene-ui-version=\"2.16.3\"] .pill:not(.pill_fill).pill_color_inverse{color:var(--guit-sem-color-foreground-inverse)}[data-gene-ui-version=\"2.16.3\"] .pill__text{color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}[data-gene-ui-version=\"2.16.3\"] .pill__icon{flex:0 0 auto}";
36
- styleInject(css_248z);
37
-
38
- const iconSizes = {
39
- smallNudge: 16,
40
- small: 20,
41
- medium: 20
42
- };
43
- /**
44
- * A Pill component used to display concise information or categorize content. Often used for labels or status indicators, Pill components are visually distinct and can convey different meanings through text and color coding.
45
- */
46
- const Pill = ({ color = 'informative', size = 'medium', text, iconAlignment = 'before', isFill, withDot = true, Icon, className }) => {
47
- const [isWithDot, setIsWithDot] = useState(withDot);
48
- const textRef = useRef(null);
49
- const isTruncated = useEllipsisDetection(textRef, [text]);
50
- useEffect(() => {
51
- setIsWithDot(!Icon && withDot);
52
- }, [Icon, withDot]);
53
- const iconMock = Icon ? (cloneElement(Icon, {
54
- size: iconSizes[size],
55
- className: 'pill__icon'
56
- })) : isWithDot ? (React__default.createElement(SvgDot, { size: iconSizes[size], className: "pill__icon" })) : ('');
57
- return (React__default.createElement("div", { className: classnames(`pill pill_size_${size} pill_color_${color}`, className, {
58
- [`pill_icon_${isWithDot ? 'before' : iconAlignment}`]: text && iconMock,
59
- pill_icon_only: !text,
60
- pill_fill: isFill
61
- }) },
62
- iconMock,
63
- text && (React__default.createElement(Tooltip, { text: text, isVisible: isTruncated },
64
- React__default.createElement("span", { ref: textRef, className: "pill__text" }, text)))));
65
- };
66
-
67
- export { Pill as default };