@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
@@ -1,217 +0,0 @@
1
- import { _ as __rest } from '../tslib.es6-f211516f.js';
2
- import React__default, { forwardRef, useRef, useState, useImperativeHandle, useCallback, useEffect } from 'react';
3
- import Portal from '../Portal/index.js';
4
- import { c as classnames } from '../index-031ff73c.js';
5
- import { f as fileSizeDisplay, n as noop } from '../index-5f37f281.js';
6
- import '../configs-00612ce0.js';
7
- import useImgDownload from '../hooks/useImgDownload.js';
8
- import { u as useEllipsisDetection } from '../useEllipsisDetection-c1c9ad94.js';
9
- import Icon from '../Icon/index.js';
10
- import Switcher from '../Switcher/index.js';
11
- import { T as Tooltip } from '../index-65217440.js';
12
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
13
- import 'react-dom';
14
- import 'prop-types';
15
- import '../GeneUIProvider/index.js';
16
- import '../dateValidation-67caec66.js';
17
- import '../_commonjsHelpers-24198af3.js';
18
- import '../hooks/useDebounce.js';
19
- import '../_rollupPluginBabelHelpers-a83240e1.js';
20
- import '../hooks/useKeyDown.js';
21
- import '../checkboxRadioSwitcher-5b69d7bd.js';
22
- import '../guid-8ddf77b3.js';
23
-
24
- const bufferSize = 40;
25
- const borderWidth = 2;
26
- const Magnifier = forwardRef(({ imgUrl, className, name = '', withRotation = false, withMagnifier = false, showMagnifier = false, zoom = 1.5, magnifierAppearance = 'square' }, ref) => {
27
- const imgRef = useRef(null);
28
- const glassRef = useRef(null);
29
- const [rotationDeg, setRotationDeg] = useState(0);
30
- const [isCursorInScopeOfImage, setIsCursorInScopeOfImage] = useState(false);
31
- const [glassPositionStyles, setGlassPositionStyles] = useState({});
32
- const rotate = (deg = 90) => {
33
- if (!withRotation)
34
- return;
35
- const newDeg = rotationDeg + deg;
36
- setRotationDeg(Math.abs(newDeg) >= 360 ? 0 : newDeg);
37
- };
38
- useImperativeHandle(ref, () => ({
39
- rotate
40
- }));
41
- const onMouseMoveHandler = useCallback((e) => {
42
- var _a, _b;
43
- // Prevent any calculation in case of magnifier is turned off
44
- if (!withMagnifier || !imgRef.current || !glassRef.current)
45
- return;
46
- e.preventDefault();
47
- const img = imgRef.current;
48
- const cnt = img.offsetParent;
49
- if (!cnt)
50
- return;
51
- const glassWidth = ((_a = glassRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) / 2;
52
- const glassHeight = ((_b = glassRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) / 2;
53
- // Positive value of rotation deg
54
- const absRotationDeg = Math.abs(rotationDeg);
55
- const { clientX, clientY } = e;
56
- const stylesProps = {};
57
- // @TODO need move to useMemo hooks for better performance
58
- const { bottom, height, left, right, top, width } = cnt.getBoundingClientRect();
59
- let x = clientX - left - glassWidth;
60
- let y = clientY - top - glassHeight;
61
- // Calculate horizontal thresholds for img
62
- if (clientX < left + bufferSize)
63
- x = -glassWidth + bufferSize;
64
- if (clientX > right - bufferSize)
65
- x = width - bufferSize - glassWidth;
66
- // Calculate vertical thresholds for img
67
- if (clientY < top + bufferSize)
68
- y = -glassHeight + bufferSize;
69
- if (clientY > bottom - bufferSize)
70
- y = height - glassHeight - bufferSize;
71
- // Handle vertical rotation cases
72
- if (rotationDeg === 0 || absRotationDeg === 180) {
73
- if (rotationDeg === 0) {
74
- // Adoption coordinates values to img sides
75
- stylesProps.left = `${x}px`;
76
- stylesProps.top = `${y}px`;
77
- // Calculate zoomed image positions
78
- const glassX = x * zoom + bufferSize * zoom + borderWidth * 2;
79
- const glassY = y * zoom + bufferSize * zoom + borderWidth * 2;
80
- stylesProps.backgroundPosition = `-${glassX}px -${glassY}px`;
81
- }
82
- if (absRotationDeg === 180) {
83
- // Adoption coordinates values to img sides
84
- stylesProps.right = `${x}px`;
85
- stylesProps.bottom = `${y}px`;
86
- // Calculate zoomed image positions
87
- const glassX = width * zoom - glassWidth - 40 * zoom - (x * zoom + 40 * zoom);
88
- const glassY = height * zoom - glassHeight - 40 * zoom - (y * zoom + 40 * zoom);
89
- stylesProps.backgroundPosition = `-${glassX}px -${glassY}px`;
90
- }
91
- }
92
- // Handle horizontal rotation cases
93
- if (absRotationDeg === 90 || absRotationDeg === 270) {
94
- if (rotationDeg === 90 || rotationDeg === -270) {
95
- // Adoption coordinates values to img sides
96
- stylesProps.bottom = `${x}px`; // x
97
- stylesProps.left = `${y}px`; // y
98
- // Calculate zoomed image positions
99
- const glassX = img.height * zoom - glassHeight - 40 * zoom - (x * zoom + 40 * zoom);
100
- const glassY = y * zoom + 40 * zoom;
101
- stylesProps.backgroundPosition = `-${glassY}px -${glassX}px`;
102
- }
103
- if (rotationDeg === 270 || rotationDeg === -90) {
104
- // Adoption coordinates values to img sides
105
- stylesProps.top = `${x}px`; // x
106
- stylesProps.right = `${y}px`; // y
107
- // Calculate zoomed image positions
108
- const glassX = x * zoom + 40 * zoom;
109
- const glassY = img.width * zoom - glassWidth - 40 * zoom - (y * zoom + 40 * zoom);
110
- stylesProps.backgroundPosition = `-${glassY}px -${glassX}px`;
111
- }
112
- }
113
- setGlassPositionStyles(stylesProps);
114
- }, [rotationDeg]);
115
- const onMouseEnterHandler = () => showMagnifier && setIsCursorInScopeOfImage(true);
116
- const onMouseLeaveHandler = (e) => {
117
- if (e.relatedTarget !== glassRef.current) {
118
- setIsCursorInScopeOfImage(false);
119
- }
120
- };
121
- return (React__default.createElement(React__default.Fragment, null,
122
- React__default.createElement("div", { className: "imgMagnifier", style: {
123
- transform: `rotateZ(${rotationDeg}deg)`
124
- } },
125
- withMagnifier && showMagnifier && isCursorInScopeOfImage && (React__default.createElement("div", { ref: glassRef, className: "imgMagnifier__glass", style: Object.assign({ borderRadius: `${magnifierAppearance === 'circle' ? 50 : 0}%`, backgroundImage: `url(${imgUrl})`, backgroundRepeat: 'no-repeat', backgroundSize: imgRef.current
126
- ? `${imgRef.current.clientWidth * zoom}px ${imgRef.current.clientHeight * zoom}px`
127
- : `0 0` }, glassPositionStyles), onMouseLeave: onMouseLeaveHandler, onMouseMove: onMouseMoveHandler })),
128
- React__default.createElement("img", { ref: imgRef, src: imgUrl, alt: name, onMouseEnter: onMouseEnterHandler, onMouseMove: (e) => showMagnifier && onMouseMoveHandler(e), className: `imgMagnifier__img ${className}` }))));
129
- });
130
-
131
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .imagePreview{display:flex;flex-direction:column;max-height:100%;max-width:100%;min-width:320px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__close{display:flex}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__close{margin-left:auto}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .imagePreview.mobile-view .imagePreview__close{margin-left:0;margin-right:auto}[data-gene-ui-version=\"2.16.3\"] .imagePreview__header{align-items:center;display:flex;justify-content:space-between;padding:16px;width:100%}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__header{align-items:flex-start;flex-direction:column-reverse;padding:8px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__infoWrapper{align-items:center;align-self:stretch;display:flex;max-width:calc(100% - 250px)}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__infoWrapper{max-width:100%}[data-gene-ui-version=\"2.16.3\"] .imagePreview__info{display:flex;flex-direction:column;font-size:14px;font-weight:600;height:100%;justify-content:center;max-width:calc(100% - 28px);padding:4px 0}[data-gene-ui-version=\"2.16.3\"] .imagePreview__info-center{justify-content:center}[data-gene-ui-version=\"2.16.3\"] .imagePreview__imgIcon{opacity:.8}[data-gene-ui-version=\"2.16.3\"] .imagePreview__sizes{display:flex}[data-gene-ui-version=\"2.16.3\"] .imagePreview__weight{opacity:.8;padding-right:8px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__resolution{opacity:.8;padding-left:8px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__resolution--divider{opacity:.8;padding-left:0}[data-gene-ui-version=\"2.16.3\"] .imagePreview__resolution--separate{margin:0 5px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__options{align-items:center;display:flex}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__options{width:100%}[data-gene-ui-version=\"2.16.3\"] .imagePreview__magnifier{min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;padding-right:8px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__rotate{display:flex}[data-gene-ui-version=\"2.16.3\"] .imagePreview__divider,[data-gene-ui-version=\"2.16.3\"] .imagePreview__divider-small{position:relative}[data-gene-ui-version=\"2.16.3\"] .imagePreview__divider-small:after{background:rgba(var(--background-sc-rgb),.3);content:\"\";height:12px;position:absolute;right:0;top:50%;transform:translateY(-50%);width:1px}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .imagePreview__divider-small{margin:0 5px}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__divider{margin-right:6px}[data-gene-ui-version=\"2.16.3\"] .imagePreview__icon{cursor:pointer;font-size:28px;font-weight:100;margin:6px}[data-gene-ui-version=\"2.16.3\"] .imagePreview.mobile-view .imagePreview__icon{margin-left:0}[data-gene-ui-version=\"2.16.3\"] .imagePreview__content{align-items:center;aspect-ratio:1;display:flex;justify-content:center}[data-gene-ui-version=\"2.16.3\"] .imagePreview__img{max-height:100%;max-width:100%}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .imagePreview__name{padding-right:8px}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view{height:100%;left:0;position:fixed;top:0;width:100%;z-index:500}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__header{background:#000}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__infoWrapper,[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__name{color:#fff}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__sizes{color:#fff9}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__options{color:#fff}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__magnifier .switcher-element{background:#ffffff61}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__magnifier .switcher-element.active{background:var(--hero)}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__divider:after{background:#ffffff4d;content:\"\";height:24px;position:absolute;right:0;top:50%;transform:translateY(-50%);width:1px}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__divider-small:after{background:#ffffff4d}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__content{height:100%;transform:translateZ(0);width:100%}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__background{background-color:#000c;height:100%;position:absolute;width:100%}[data-gene-ui-version=\"2.16.3\"] .imagePreview.modal-view .imagePreview__img{margin:0 auto;max-height:calc(100vh - 10rem);max-width:calc(100vh - 10rem)}[data-gene-ui-version=\"2.16.3\"] .imgMagnifier{position:relative}[data-gene-ui-version=\"2.16.3\"] .imgMagnifier__glass{border:2px solid #000;cursor:none;height:150px;position:absolute;width:150px;z-index:999999}[data-gene-ui-version=\"2.16.3\"] .imgMagnifier__img{width:100%}";
132
- styleInject(css_248z);
133
-
134
- const ImagePreview = (_a) => {
135
- var { name, path, onClose = noop, showSize = true, isMobile = false, withModal = true, showRotate = true, showDownload = true, customHeaders, showDimensions = true, withMagnifier = false, magnifierDefaultValue = true } = _a, rest = __rest(_a, ["name", "path", "onClose", "showSize", "isMobile", "withModal", "showRotate", "showDownload", "customHeaders", "showDimensions", "withMagnifier", "magnifierDefaultValue"]);
136
- const [isMagnifierOn, setIsMagnifierOn] = useState(magnifierDefaultValue);
137
- const [imageData, setImageData] = useState('');
138
- const [meta, setMeta] = useState({
139
- size: 0,
140
- width: 0,
141
- height: 0
142
- });
143
- const nameRef = useRef(null);
144
- const magnifierRef = useRef(null);
145
- const isTruncated = useEllipsisDetection(nameRef);
146
- const downloadImg = useImgDownload();
147
- useEffect(() => {
148
- !!path &&
149
- fetch(path, { headers: Object.assign({}, customHeaders) })
150
- .then((r) => r.arrayBuffer())
151
- .then((buffer) => {
152
- const img = new Image();
153
- const blob = new Blob([buffer], { type: 'image/jpeg' });
154
- img.src = URL.createObjectURL(blob);
155
- img.onload = () => setMeta((val) => (Object.assign(Object.assign({}, val), { width: img.naturalWidth, height: img.naturalHeight })));
156
- setMeta((val) => (Object.assign(Object.assign({}, val), { size: buffer.byteLength })));
157
- setImageData(img.src);
158
- });
159
- }, [path]);
160
- const MagnifierWrapper = imageData && (React__default.createElement(Magnifier, { ref: magnifierRef, imgUrl: imageData, name: name, zoom: 2, showMagnifier: isMagnifierOn, className: "imagePreview__img", withRotation: true, withMagnifier: true }));
161
- return (React__default.createElement("div", Object.assign({ className: classnames('imagePreview', { 'modal-view': withModal, 'mobile-view': isMobile }) }, rest),
162
- React__default.createElement("div", { className: "imagePreview__header" },
163
- React__default.createElement("div", { className: "imagePreview__infoWrapper" },
164
- React__default.createElement(Icon, { type: "bc-icon-Image", className: "imagePreview__icon imagePreview__imgIcon" }),
165
- React__default.createElement("div", { className: classnames('imagePreview__info', {
166
- 'imagePreview__info-center': !showSize && !showDimensions
167
- }) },
168
- name && (React__default.createElement(Tooltip, { text: name, isVisible: isTruncated },
169
- React__default.createElement("span", { className: "imagePreview__name ellipsis-text", ref: nameRef }, name))),
170
- React__default.createElement("div", { className: "imagePreview__sizes" },
171
- showSize && React__default.createElement("span", { className: "imagePreview__weight" }, fileSizeDisplay(meta.size)),
172
- showSize && showDimensions && React__default.createElement("div", { className: "imagePreview__divider-small" }),
173
- showDimensions && (React__default.createElement("span", { className: classnames('imagePreview__resolution', {
174
- 'imagePreview__resolution--divider': !showSize
175
- }) },
176
- React__default.createElement("span", null, meta.width),
177
- React__default.createElement("span", { className: "imagePreview__resolution--separate" }, "x"),
178
- React__default.createElement("span", null, meta.height)))))),
179
- React__default.createElement("div", { className: "imagePreview__options" },
180
- withMagnifier && (React__default.createElement("div", { className: "imagePreview__magnifier" },
181
- React__default.createElement(Switcher
182
- /*@ts-ignore*/
183
- , {
184
- /*@ts-ignore*/
185
- defaultChecked: magnifierDefaultValue, value: isMagnifierOn, onChange: (e) => setIsMagnifierOn(e.currentTarget.checked), labelPosition: "left", label: "Magnifier", className: "imagePreview__switcher" }))),
186
- showRotate && (React__default.createElement("div", { className: "imagePreview__rotate" },
187
- React__default.createElement(Icon, { type: "bc-icon-rotate-left", className: "imagePreview__icon", onClick: () => {
188
- var _a;
189
- if (!((_a = magnifierRef.current) === null || _a === void 0 ? void 0 : _a.rotate))
190
- return;
191
- magnifierRef.current.rotate(-90);
192
- } }),
193
- React__default.createElement(Icon, { type: "bc-icon-rotate-right", className: "imagePreview__icon", onClick: () => {
194
- var _a;
195
- if (!((_a = magnifierRef.current) === null || _a === void 0 ? void 0 : _a.rotate))
196
- return;
197
- magnifierRef.current.rotate(90);
198
- } }))),
199
- showDownload && (React__default.createElement("div", { className: "imagePreview__download" },
200
- React__default.createElement(Icon, { type: "bc-icon-download", className: "imagePreview__icon", onClick: () => downloadImg(path, name, customHeaders) }))),
201
- withModal && (React__default.createElement("div", { className: "imagePreview__close" },
202
- React__default.createElement("div", { className: "imagePreview__divider" }),
203
- React__default.createElement(Icon, { type: "bc-icon-close", className: "imagePreview__icon", onClick: onClose }))))),
204
- React__default.createElement("div", { className: "imagePreview__content" }, withModal ? (React__default.createElement(React__default.Fragment, null,
205
- React__default.createElement("div", { className: "imagePreview__background", onClick: onClose }),
206
- MagnifierWrapper)) : (MagnifierWrapper))));
207
- };
208
-
209
- const ImagePreviewHOC = (_a) => {
210
- var { withModal } = _a, restProps = __rest(_a, ["withModal"]);
211
- return withModal ? (
212
- // @ts-ignore
213
- React__default.createElement(Portal, { isOpen: true },
214
- React__default.createElement(ImagePreview, Object.assign({}, restProps, { withModal: withModal })))) : (React__default.createElement(ImagePreview, Object.assign({}, restProps, { withModal: withModal })));
215
- };
216
-
217
- export { ImagePreviewHOC as default };
package/Info/index.js DELETED
@@ -1,41 +0,0 @@
1
- import React__default, { useState, useMemo } from 'react';
2
- import { c as classnames } from '../index-031ff73c.js';
3
- import { S as SvgInfoOutline } from '../InfoOutline-dd2e89d9.js';
4
- import { T as Tooltip } from '../index-65217440.js';
5
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
6
- import '../ArrowLeft-b88e2ba8.js';
7
- import '../tslib.es6-f211516f.js';
8
- import 'react-dom';
9
- import '../GeneUIProvider/index.js';
10
-
11
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .info{border-radius:var(--guit-ref-radius-3xsmall);line-height:0}[data-gene-ui-version=\"2.16.3\"] .info_appearance_default{color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.3\"] .info_appearance_brand{color:var(--guit-sem-color-foreground-brand)}[data-gene-ui-version=\"2.16.3\"] .info_appearance_inverse{color:var(--guit-sem-color-foreground-inverse)}[data-gene-ui-version=\"2.16.3\"] .info_disabled{color:var(--guit-sem-color-foreground-disabled);pointer-events:none}";
12
- styleInject(css_248z);
13
-
14
- const iconSizes = {
15
- small: 24,
16
- smallNudge: 20,
17
- XSmall: 16
18
- };
19
- /**
20
- * Info icon component used to provide additional contextual information to users. It appears as a small icon, and is placed near elements where further explanation or clarification is useful.
21
- */
22
- const Info = ({ infoText, disabled, size = 'smallNudge', appearance = 'default', className }) => {
23
- const [alwaysShow, setAlwaysShow] = useState(false);
24
- const keyDownHandler = (event) => {
25
- if (disabled)
26
- return;
27
- if (event.key === 'Enter') {
28
- setAlwaysShow((prev) => !prev);
29
- }
30
- };
31
- const handleBlur = () => !disabled && alwaysShow && setAlwaysShow(false);
32
- const buttonClassNames = useMemo(() => classnames('info', className, {
33
- [`info_appearance_${appearance}`]: appearance,
34
- info_disabled: disabled
35
- }), [appearance, className, disabled]);
36
- return (React__default.createElement(Tooltip, { text: infoText, alwaysShow: alwaysShow, appearance: appearance === 'inverse' ? 'inverse' : 'default' },
37
- React__default.createElement("button", { disabled: disabled, "aria-pressed": alwaysShow, className: buttonClassNames, onKeyDown: keyDownHandler, onBlur: handleBlur },
38
- React__default.createElement(SvgInfoOutline, { className: "info__icon", size: iconSizes[size] }))));
39
- };
40
-
41
- export { Info as default };
@@ -1,29 +0,0 @@
1
- import { _ as _objectWithoutProperties, a as _extends } from './ArrowLeft-b88e2ba8.js';
2
- import React__default from 'react';
3
-
4
- var _excluded = ["size", "color"];
5
- var SvgInfoOutline = function SvgInfoOutline(_ref) {
6
- var _ref$size = _ref.size,
7
- size = _ref$size === void 0 ? 24 : _ref$size,
8
- _ref$color = _ref.color,
9
- color = _ref$color === void 0 ? "currentColor" : _ref$color,
10
- props = _objectWithoutProperties(_ref, _excluded);
11
- return /*#__PURE__*/React__default.createElement("svg", _extends({
12
- width: size,
13
- height: size,
14
- viewBox: "0 0 24 24",
15
- fill: color,
16
- xmlns: "http://www.w3.org/2000/svg"
17
- }, props), /*#__PURE__*/React__default.createElement("path", {
18
- d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18.5a8.5 8.5 0 1 1 8.5-8.5 8.51 8.51 0 0 1-8.5 8.5Z",
19
- fill: color
20
- }), /*#__PURE__*/React__default.createElement("path", {
21
- d: "M11.97 10.237a.75.75 0 0 0-.75.75v5.243a.75.75 0 0 0 1.5 0v-5.243a.75.75 0 0 0-.75-.75Z",
22
- fill: color
23
- }), /*#__PURE__*/React__default.createElement("path", {
24
- d: "M11.969 6.995a.914.914 0 1 0 0 1.829.914.914 0 0 0 0-1.829Z",
25
- fill: color
26
- }));
27
- };
28
-
29
- export { SvgInfoOutline as S };
@@ -1,78 +0,0 @@
1
- import { _ as __rest } from '../tslib.es6-f211516f.js';
2
- import React__default, { useRef } from 'react';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import Icon from '../Icon/index.js';
5
- import Switcher from '../Switcher/index.js';
6
- import Tag from '../Tag/index.js';
7
- import { T as Tooltip } from '../index-65217440.js';
8
- import 'prop-types';
9
- import '../dateValidation-67caec66.js';
10
- import 'react-dom';
11
- import '../configs-00612ce0.js';
12
- import { u as useEllipsisDetection } from '../useEllipsisDetection-c1c9ad94.js';
13
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
14
- import '../_rollupPluginBabelHelpers-a83240e1.js';
15
- import '../index-5f37f281.js';
16
- import '../hooks/useKeyDown.js';
17
- import '../checkboxRadioSwitcher-5b69d7bd.js';
18
- import '../guid-8ddf77b3.js';
19
- import '../_commonjsHelpers-24198af3.js';
20
- import '../GeneUIProvider/index.js';
21
- import '../hooks/useDebounce.js';
22
-
23
- const InteractiveWidgetIcon = ({ children, iconColor, appearance, iconBackground }) => {
24
- return (React__default.createElement("div", { className: `widgetIcon widgetIcon-${appearance}`, style: iconColor ? { '--icon-color': iconColor, filter: 'alpha(opacity=60)' } : {} },
25
- iconBackground && React__default.createElement("div", { className: "widgetIcon__background" }),
26
- typeof children === 'string' ? (
27
- // @ts-ignore
28
- React__default.createElement(Icon, { type: children, className: classnames({ widgetIcon__iconDefault: appearance === 'default' }) })) : (children)));
29
- };
30
-
31
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .interactiveWidget{background:var(--background);border-radius:1.6rem;box-sizing:border-box;display:flex;height:10.4rem;min-width:1px;padding:2rem;width:100%}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget:focus-visible{outline:.2rem var(--hero) solid}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget-border{border:.2rem solid rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget-border:hover{border:.2rem solid var(--hero)}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget-pointer{cursor:pointer}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget-pointer:hover{background:rgba(var(--hero-rgb),.1)}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget-disabled{opacity:.6;pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__wrapper{align-items:center;display:flex;height:100%;min-width:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__content{display:flex;flex-direction:column;height:100%;justify-content:flex-start;min-width:0;overflow:hidden;width:100%}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__header{align-items:center;display:flex;margin-bottom:.6rem;min-width:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__titleWrapper{display:flex;flex:1;max-width:100%;min-width:0;padding-inline-end:1.6rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__title{font-size:1.6rem;font-weight:700}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__infoIcon{margin-inline-start:.4rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__components{align-items:center;display:flex;flex:0 0 auto}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__switcher{margin-inline-start:1.6rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget__description{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;font-size:1.2rem;line-height:1.6rem;opacity:.7;overflow:hidden;text-overflow:ellipsis}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon{fill:var(--icon-color);align-items:center;color:var(--icon-color);display:flex;flex:0 0 auto;justify-content:center;margin-inline-end:2rem;position:relative;z-index:1}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon-default{box-sizing:border-box;height:6.4rem;padding:1rem;width:6.4rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon-compact{height:2.4rem;width:2.4rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon-compact .widgetIcon__background{display:none}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon__iconDefault{font-size:4rem}[data-gene-ui-version=\"2.16.3\"] .interactiveWidget .widgetIcon__background{background:var(--icon-color);border-radius:100%;height:100%;left:0;opacity:.07;position:absolute;top:0;width:100%;z-index:-1}";
32
- styleInject(css_248z);
33
-
34
- const InteractiveWidget = (_a) => {
35
- var { className, withBorder = true, onClick, disabled = false, icon, title, appearance = 'default', iconColor = 'var(--background-sc)', tagName, tagColor, switcherProps, titleInfo, description, iconBackground = true } = _a, restProps = __rest(_a, ["className", "withBorder", "onClick", "disabled", "icon", "title", "appearance", "iconColor", "tagName", "tagColor", "switcherProps", "titleInfo", "description", "iconBackground"]);
36
- const titleRef = useRef(null);
37
- const descriptionRef = useRef(null);
38
- const isTitleTruncated = useEllipsisDetection(titleRef);
39
- const isDescriptionTruncated = useEllipsisDetection(descriptionRef);
40
- return (React__default.createElement("div", Object.assign({ className: classnames('interactiveWidget', {
41
- 'interactiveWidget-border': withBorder,
42
- 'interactiveWidget-pointer': onClick,
43
- 'interactiveWidget-disabled': disabled
44
- }, className), tabIndex: 0, onClick: (event) => {
45
- onClick && onClick(event);
46
- }, onKeyDown: (event) => {
47
- if (disabled)
48
- return;
49
- onClick && onClick(event);
50
- } }, restProps),
51
- React__default.createElement("div", { className: 'interactiveWidget__wrapper' },
52
- icon && appearance === 'default' && (React__default.createElement(InteractiveWidgetIcon, { children: icon, appearance: appearance, iconColor: iconColor, iconBackground: iconBackground })),
53
- React__default.createElement("div", { className: 'interactiveWidget__content' },
54
- React__default.createElement("div", { className: `interactiveWidget__header interactiveWidget__header-${appearance}` },
55
- icon && appearance === 'compact' && (React__default.createElement(InteractiveWidgetIcon, { children: icon, appearance: appearance, iconColor: iconColor })),
56
- React__default.createElement("div", { className: "interactiveWidget__titleWrapper" },
57
- title && (
58
- // @ts-ignore
59
- React__default.createElement(Tooltip, { text: title, isVisible: isTitleTruncated },
60
- React__default.createElement("h3", { className: 'interactiveWidget__title ellipsis-text', ref: titleRef }, title))),
61
- titleInfo && title && (
62
- // @ts-ignore
63
- React__default.createElement(Tooltip, { text: titleInfo },
64
- React__default.createElement(Icon, { className: 'interactiveWidget__infoIcon', type: 'bc-icon-info-48' })))),
65
- (switcherProps || tagName) && (React__default.createElement("div", { className: "interactiveWidget__components" },
66
- tagName && (
67
- // @ts-ignore
68
- React__default.createElement(Tag, { name: tagName, color: tagColor, appearance: "outline", size: "small", cornerRadius: 'smooth-radius' })),
69
- switcherProps && (
70
- // @ts-ignore
71
- React__default.createElement(Switcher, Object.assign({ className: 'interactiveWidget__switcher', changeOnEnter: true }, switcherProps)))))),
72
- description && (
73
- //@ts-ignore
74
- React__default.createElement(Tooltip, { text: description, isVisible: isDescriptionTruncated },
75
- React__default.createElement("p", { className: "interactiveWidget__description", ref: descriptionRef }, description)))))));
76
- };
77
-
78
- export { InteractiveWidget as default };
package/KeyValue/index.js DELETED
@@ -1,22 +0,0 @@
1
- import { _ as __rest } from '../tslib.es6-f211516f.js';
2
- import React__default from 'react';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import Icon from '../Icon/index.js';
5
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
6
- import '../_rollupPluginBabelHelpers-a83240e1.js';
7
- import 'prop-types';
8
-
9
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .geneKeyValue{align-items:flex-start;display:flex;flex-wrap:wrap;width:100%}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue--horizontal{align-items:center;flex-wrap:nowrap}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__icon{padding:0 0 0 8px}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__label{color:#3c4043b3;flex:1 1;font-size:12px;font-weight:600;line-height:24px;margin:0 0 1rem 1rem;max-width:100%;width:100%}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__label--horizontal{flex:none;margin:0 0 0 1rem;max-width:50%;width:auto}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__value{font-size:14px;font-weight:600;line-height:24px;margin:0 1rem;max-width:100%;width:100%}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__value--horizontal{margin:0 1rem;max-width:50%}[data-gene-ui-version=\"2.16.3\"] .geneKeyValue__iconWrapper+p+p:not(.geneKeyValue__value--horizontal){margin:0 3.2rem 0 4.2rem}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .geneKeyValue__iconWrapper+p+p:not(.geneKeyValue__value--horizontal){margin:0 3.2rem 0 0}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .geneKeyValue__label{direction:ltr;margin:0 1rem 1rem 0}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .geneKeyValue__label--horizontal{margin:0 0 0 1rem}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .geneKeyValue__value{direction:ltr}[data-gene-ui-version=\"2.16.3\"] [dir=rtl] .geneKeyValue__iconWrapper+p:not(.geneKeyValue__label--horizontal){margin:0 0 1rem}";
10
- styleInject(css_248z);
11
-
12
- // TODO need to refine where is using restProps
13
- const KeyValue = (_a) => {
14
- var { label, value, className, icon, appearance = 'horizontal' } = _a, restProps = __rest(_a, ["label", "value", "className", "icon", "appearance"]);
15
- return (React__default.createElement("div", Object.assign({}, restProps, { className: classnames(`geneKeyValue geneKeyValue--${appearance}`, className) }),
16
- icon && (React__default.createElement("div", { className: "geneKeyValue__iconWrapper" },
17
- React__default.createElement(Icon, { type: icon, className: 'geneKeyValue__icon' }))),
18
- React__default.createElement("p", { role: "heading", "aria-level": 1, className: `geneKeyValue__label geneKeyValue__label--${appearance} ellipsis-text` }, label),
19
- React__default.createElement("p", { className: `geneKeyValue__value geneKeyValue__value--${appearance} ellipsis-text` }, value)));
20
- };
21
-
22
- export { KeyValue as default };
package/Label/index.js DELETED
@@ -1,48 +0,0 @@
1
- import React__default, { useRef } from 'react';
2
- import { S as SvgInfoOutline } from '../InfoOutline-dd2e89d9.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 '../ArrowLeft-b88e2ba8.js';
12
- import '../tslib.es6-f211516f.js';
13
- import '../GeneUIProvider/index.js';
14
- import '../_commonjsHelpers-24198af3.js';
15
- import '../hooks/useDebounce.js';
16
-
17
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .label{align-items:center;display:inline-flex;max-width:100%;min-width:0}[data-gene-ui-version=\"2.16.3\"] .label__container{align-items:center;display:flex;gap:var(--guit-ref-spacing-3xsmall);min-width:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .label__container-inner{align-items:center;display:flex;gap:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .label__asterisk,[data-gene-ui-version=\"2.16.3\"] .label__text{color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.3\"] .label__asterisk_size_medium,[data-gene-ui-version=\"2.16.3\"] .label__text_size_medium{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\"] .label__asterisk_size_small,[data-gene-ui-version=\"2.16.3\"] .label__text_size_small{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\"] .label__asterisk_disabled,[data-gene-ui-version=\"2.16.3\"] .label__text_disabled{color:var(--guit-sem-color-foreground-disabled)}[data-gene-ui-version=\"2.16.3\"] .label__icon{color:var(--guit-sem-color-foreground-neutral-2);flex:0 0 auto}[data-gene-ui-version=\"2.16.3\"] .label__icon_disabled{color:var(--guit-sem-color-foreground-disabled)}";
18
- styleInject(css_248z);
19
-
20
- const iconSizes = {
21
- small: 16,
22
- medium: 20
23
- };
24
- /**
25
- * Labels identify a component or group of components. Use them with elements such as checkboxes and input fields to guide users in providing specific information, or with plain text to organize information.
26
- */
27
- const Label = ({ size = 'medium', labelText, disabled, required, infoText, isLoading, className, children }) => {
28
- const labelRef = useRef(null);
29
- const isTruncated = useEllipsisDetection(labelRef);
30
- return (React__default.createElement("label", { className: classnames(`label`, className) },
31
- children,
32
- isLoading ? (React__default.createElement("span", null, "skelleton")) : (React__default.createElement("span", { className: "label__container" },
33
- React__default.createElement(React__default.Fragment, null,
34
- React__default.createElement("div", { className: "label__container-inner" },
35
- React__default.createElement(Tooltip, { text: labelText, isVisible: isTruncated },
36
- React__default.createElement("span", { ref: labelRef, className: classnames('ellipsis-text', `label__text label__text_size_${size}`, {
37
- label__text_disabled: disabled
38
- }) }, labelText)),
39
- required && (React__default.createElement("span", { className: classnames(`label__asterisk label__text_size_${size} `, {
40
- label__text_disabled: disabled
41
- }) }, "*"))),
42
- infoText && (React__default.createElement(Tooltip, { text: infoText },
43
- React__default.createElement(SvgInfoOutline, { className: classnames(`label__icon`, {
44
- label__icon_disabled: disabled
45
- }), size: iconSizes[size] }))))))));
46
- };
47
-
48
- export { Label as default };
@@ -1,34 +0,0 @@
1
- import { _ as __rest } from '../tslib.es6-f211516f.js';
2
- import React__default, { useCallback, useMemo } from 'react';
3
- import { c as classnames } from '../index-031ff73c.js';
4
- import { n as noop } from '../index-5f37f281.js';
5
- import Icon from '../Icon/index.js';
6
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
7
- import 'prop-types';
8
- import '../dateValidation-67caec66.js';
9
- import '../_commonjsHelpers-24198af3.js';
10
- import 'react-dom';
11
- import '../_rollupPluginBabelHelpers-a83240e1.js';
12
-
13
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .linkButton{align-items:center;color:var(--hero);cursor:pointer;display:flex;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;padding:0 .8rem}[data-gene-ui-version=\"2.16.3\"] .linkButton:focus-visible{border-radius:.4rem;outline:.2rem var(--hero) solid}[data-gene-ui-version=\"2.16.3\"] .linkButton__icon{display:inline-block}[data-gene-ui-version=\"2.16.3\"] .linkButton-disable{opacity:.3;pointer-events:none}";
14
- styleInject(css_248z);
15
-
16
- const LinkButton = (_a) => {
17
- var { href, onClick, children, iconAfter, className, iconBefore, isDisabled, onMouseDown, ariaLabel } = _a, restProps = __rest(_a, ["href", "onClick", "children", "iconAfter", "className", "iconBefore", "isDisabled", "onMouseDown", "ariaLabel"]);
18
- const onClickHandler = useCallback((e) => onClick === null || onClick === void 0 ? void 0 : onClick(e), [onClick]);
19
- const onMouseDownHandler = useCallback((e) => onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e), [onMouseDown]);
20
- const attributes = useMemo(() => (Object.assign(Object.assign({ className: classnames('linkButton', { 'linkButton-disable': isDisabled }, className), onMouseDown: onMouseDownHandler, onClick: onClickHandler }, (ariaLabel ? { 'aria-label': ariaLabel } : {})), restProps)), [isDisabled, className, onMouseDownHandler, onClickHandler, restProps]);
21
- const content = useMemo(() => (React__default.createElement(React__default.Fragment, null,
22
- iconBefore && React__default.createElement(Icon, { type: iconBefore, className: "linkButton__icon" }),
23
- children,
24
- iconAfter && React__default.createElement(Icon, { type: iconAfter, className: "linkButton__icon" }))), [iconBefore, children, iconAfter]);
25
- return (React__default.createElement(React__default.Fragment, null, href ? (React__default.createElement("a", Object.assign({}, attributes, { href: href }), content)) : (React__default.createElement("button", Object.assign({}, attributes, { type: "button" }), content))));
26
- };
27
- LinkButton.defaultProps = {
28
- children: 'LinkButton example',
29
- isDisabled: false,
30
- onMouseDown: noop
31
- };
32
- LinkButton.displayName = 'LinkButton';
33
-
34
- export { LinkButton as default };
package/Loader/index.js DELETED
@@ -1,23 +0,0 @@
1
- import React__default from 'react';
2
- import { s as styleInject } from '../style-inject.es-746bb8ed.js';
3
-
4
- var css_248z = "[data-gene-ui-version=\"2.16.3\"] .loader{align-items:center;display:inline-flex;justify-content:center}[data-gene-ui-version=\"2.16.3\"] .loader_direction_below{flex-direction:column;text-align:center}[data-gene-ui-version=\"2.16.3\"] .loader_size_2xLarge,[data-gene-ui-version=\"2.16.3\"] .loader_size_xLarge{font-family:var(--guit-sem-font-label-large-default-medium-font-family);font-size:var(--guit-sem-font-label-large-default-semibold-font-size);font-weight:var(--guit-sem-font-label-large-default-medium-font-weight);line-height:var(--guit-sem-font-label-large-default-semibold-line-height)}[data-gene-ui-version=\"2.16.3\"] .loader_size_large,[data-gene-ui-version=\"2.16.3\"] .loader_size_medium,[data-gene-ui-version=\"2.16.3\"] .loader_size_small,[data-gene-ui-version=\"2.16.3\"] .loader_size_smallNudge{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\"] .loader_size_small,[data-gene-ui-version=\"2.16.3\"] .loader_size_smallNudge{gap:var(--guit-ref-spacing-xsmall)}[data-gene-ui-version=\"2.16.3\"] .loader_size_2xLarge{gap:var(--guit-ref-spacing-2xlarge)}[data-gene-ui-version=\"2.16.3\"] .loader_size_2xLarge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-2xlarge);width:var(--guit-sem-dimension-width-2xlarge)}[data-gene-ui-version=\"2.16.3\"] .loader_size_xLarge{gap:var(--guit-ref-spacing-xlarge)}[data-gene-ui-version=\"2.16.3\"] .loader_size_xLarge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-xlarge);width:var(--guit-sem-dimension-width-xlarge)}[data-gene-ui-version=\"2.16.3\"] .loader_size_large{gap:var(--guit-ref-spacing-large)}[data-gene-ui-version=\"2.16.3\"] .loader_size_large .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-large);width:var(--guit-sem-dimension-width-large)}[data-gene-ui-version=\"2.16.3\"] .loader_size_medium{gap:var(--guit-ref-spacing-medium)}[data-gene-ui-version=\"2.16.3\"] .loader_size_medium .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-medium);width:var(--guit-sem-dimension-width-medium)}[data-gene-ui-version=\"2.16.3\"] .loader_size_small .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-small);width:var(--guit-sem-dimension-width-small)}[data-gene-ui-version=\"2.16.3\"] .loader_size_smallNudge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-small-nudge);width:var(--guit-sem-dimension-width-small-nudge)}[data-gene-ui-version=\"2.16.3\"] .loader_color_brand .loader__text,[data-gene-ui-version=\"2.16.3\"] .loader_color_neutral .loader__text{color:var(--guit-sem-color-foreground-neutral-1)}[data-gene-ui-version=\"2.16.3\"] .loader_color_brand .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-brand)}[data-gene-ui-version=\"2.16.3\"] .loader_color_neutral .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.3\"] .loader_color_inverse .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-inverse)}[data-gene-ui-version=\"2.16.3\"] .loader_color_inverse .loader__text{color:var(--guit-sem-color-foreground-inverse)}[data-gene-ui-version=\"2.16.3\"] .loader__spinnerWrapper{flex:0 0 auto;padding:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.3\"] .loader__spinner{animation:loader-rotate 2s linear infinite;height:100%;width:100%}[data-gene-ui-version=\"2.16.3\"] .loader__spinnerPath{stroke-linecap:round;animation:loader-dash 1.5s ease-in-out infinite;transform:translateZ(0)}[data-gene-ui-version=\"2.16.3\"] .loader__text{font-size:inherit;font-weight:inherit;line-height:inherit;text-transform:capitalize}@keyframes loader-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes loader-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-136}}";
5
- styleInject(css_248z);
6
-
7
- /**
8
- *Loading spinner is a visual indicator that informs users an operation is in progress. Typically displayed as a rotating icon or circular animation, it signals that the system is working on a task, such as loading data or processing a request, and that the user should wait until the process is complete.
9
- */
10
- const Loader = ({ isLoading = true, text, textPosition = 'after', size = 'medium', appearance = 'brand', children }) => {
11
- if (isLoading) {
12
- return (React__default.createElement("span", { className: `loader loader_direction_${textPosition} loader_size_${size} loader_color_${appearance}` },
13
- React__default.createElement("span", { className: "loader__spinnerWrapper" },
14
- React__default.createElement("svg", { className: "loader__spinner", viewBox: "0 0 50 50" },
15
- React__default.createElement("circle", { className: "loader__spinnerPath", cx: "25", cy: "25", r: "22", fill: "none", strokeWidth: "5" }))),
16
- text && React__default.createElement("span", { className: `loader__text loader__textColor_${appearance}` }, text)));
17
- }
18
- else {
19
- return React__default.createElement(React__default.Fragment, null, children);
20
- }
21
- };
22
-
23
- export { Loader as default };