@salutejs/plasma-new-hope 0.178.0-canary.1514.11575933383.0 → 0.178.1-canary.1515.11581730946.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. package/cjs/components/Counter/Counter.css +1 -1
  2. package/cjs/components/Counter/Counter.js +3 -13
  3. package/cjs/components/Counter/Counter.js.map +1 -1
  4. package/cjs/components/Counter/Counter.tokens.js +0 -4
  5. package/cjs/components/Counter/Counter.tokens.js.map +1 -1
  6. package/cjs/components/Counter/variations/_size/base.js +1 -1
  7. package/cjs/components/Counter/variations/_size/base.js.map +1 -1
  8. package/cjs/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  9. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  10. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  11. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  12. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  13. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  14. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  15. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  16. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  17. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  18. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  19. package/cjs/components/Popover/Popover.js +2 -1
  20. package/cjs/components/Popover/Popover.js.map +1 -1
  21. package/cjs/components/Popup/Popup.js +2 -2
  22. package/cjs/components/Popup/Popup.js.map +1 -1
  23. package/cjs/components/Popup/PopupContext.js +1 -1
  24. package/cjs/components/Popup/PopupContext.js.map +1 -1
  25. package/cjs/components/Portal/Portal.js +4 -0
  26. package/cjs/components/Portal/Portal.js.map +1 -1
  27. package/cjs/index.css +1 -1
  28. package/emotion/cjs/components/Counter/Counter.js +3 -13
  29. package/emotion/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  30. package/emotion/cjs/components/Counter/Counter.tokens.js +1 -4
  31. package/emotion/cjs/components/Counter/variations/_size/base.js +1 -1
  32. package/emotion/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  33. package/emotion/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  34. package/emotion/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  35. package/emotion/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  36. package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
  37. package/emotion/cjs/components/Popover/Popover.js +2 -1
  38. package/emotion/cjs/components/Popup/Popup.js +1 -1
  39. package/emotion/cjs/components/Popup/PopupContext.js +1 -1
  40. package/emotion/cjs/components/Portal/Portal.js +4 -0
  41. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  42. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  43. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  44. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  45. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  46. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  47. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  48. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  49. package/emotion/es/components/Counter/Counter.js +3 -13
  50. package/emotion/es/components/Counter/Counter.template-doc.mdx +2 -2
  51. package/emotion/es/components/Counter/Counter.tokens.js +0 -3
  52. package/emotion/es/components/Counter/variations/_size/base.js +2 -2
  53. package/emotion/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  54. package/emotion/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  55. package/emotion/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  56. package/emotion/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  57. package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  58. package/emotion/es/components/Popover/Popover.js +2 -1
  59. package/emotion/es/components/Popup/Popup.js +1 -1
  60. package/emotion/es/components/Popup/PopupContext.js +1 -1
  61. package/emotion/es/components/Portal/Portal.js +4 -0
  62. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  63. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  64. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  65. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  66. package/emotion/es/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  67. package/emotion/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  68. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  69. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  70. package/es/components/Counter/Counter.css +1 -1
  71. package/es/components/Counter/Counter.js +3 -13
  72. package/es/components/Counter/Counter.js.map +1 -1
  73. package/es/components/Counter/Counter.tokens.js +1 -4
  74. package/es/components/Counter/Counter.tokens.js.map +1 -1
  75. package/es/components/Counter/variations/_size/base.js +1 -1
  76. package/es/components/Counter/variations/_size/base.js.map +1 -1
  77. package/es/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  78. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  79. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  80. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  81. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  82. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  83. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  84. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  85. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  86. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  87. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  88. package/es/components/Popover/Popover.js +2 -1
  89. package/es/components/Popover/Popover.js.map +1 -1
  90. package/es/components/Popup/Popup.js +2 -2
  91. package/es/components/Popup/Popup.js.map +1 -1
  92. package/es/components/Popup/PopupContext.js +1 -1
  93. package/es/components/Popup/PopupContext.js.map +1 -1
  94. package/es/components/Portal/Portal.js +4 -0
  95. package/es/components/Portal/Portal.js.map +1 -1
  96. package/es/index.css +1 -1
  97. package/package.json +4 -4
  98. package/styled-components/cjs/components/Counter/Counter.js +3 -13
  99. package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  100. package/styled-components/cjs/components/Counter/Counter.tokens.js +1 -4
  101. package/styled-components/cjs/components/Counter/variations/_size/base.js +1 -1
  102. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  103. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  104. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  105. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  106. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
  107. package/styled-components/cjs/components/Popover/Popover.js +2 -1
  108. package/styled-components/cjs/components/Popup/Popup.js +1 -1
  109. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  110. package/styled-components/cjs/components/Portal/Portal.js +4 -0
  111. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  112. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  113. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  114. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  115. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  116. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  117. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  118. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  119. package/styled-components/es/components/Counter/Counter.js +3 -13
  120. package/styled-components/es/components/Counter/Counter.template-doc.mdx +2 -2
  121. package/styled-components/es/components/Counter/Counter.tokens.js +0 -3
  122. package/styled-components/es/components/Counter/variations/_size/base.js +2 -2
  123. package/styled-components/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  124. package/styled-components/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  125. package/styled-components/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  126. package/styled-components/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  127. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  128. package/styled-components/es/components/Popover/Popover.js +2 -1
  129. package/styled-components/es/components/Popup/Popup.js +1 -1
  130. package/styled-components/es/components/Popup/PopupContext.js +1 -1
  131. package/styled-components/es/components/Portal/Portal.js +4 -0
  132. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  133. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  134. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  135. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  136. package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  137. package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  138. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  139. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  140. package/types/components/Counter/Counter.d.ts.map +1 -1
  141. package/types/components/Counter/Counter.tokens.d.ts +0 -3
  142. package/types/components/Counter/Counter.tokens.d.ts.map +1 -1
  143. package/types/components/Counter/Counter.types.d.ts +2 -2
  144. package/types/components/Counter/variations/_size/base.d.ts.map +1 -1
  145. package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts.map +1 -1
  146. package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts.map +1 -1
  147. package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts.map +1 -1
  148. package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts.map +1 -1
  149. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
  150. package/types/components/Popover/Popover.d.ts.map +1 -1
  151. package/types/components/Popup/PopupContext.d.ts.map +1 -1
  152. package/types/components/Portal/Portal.d.ts.map +1 -1
  153. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +0 -3
  154. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts.map +1 -1
  155. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +0 -3
  156. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts.map +1 -1
  157. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +0 -3
  158. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts.map +1 -1
  159. package/types/examples/plasma_web/components/Counter/Counter.d.ts +0 -3
  160. package/types/examples/plasma_web/components/Counter/Counter.d.ts.map +1 -1
@@ -1,5 +1,5 @@
1
1
  .base_1vjakah_b15waymg__f123ad8a{color:var(--plasma-counter-color);background-color:var(--plasma-counter-background);}
2
2
 
3
- .base_4mz17d_b1t6e429__b5e2cba4{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}.base_4mz17d_b1t6e429__b5e2cba4.base_4mz17d__PlasmaCounterRound__b5e2cba4{width:var(--plasma-counter-height);}
3
+ .base_1z0ohiy_b1t6e429__9712bb45{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}
4
4
 
5
5
  .Counter_styles_1uue90v_b1dqw7l5__00d0b847{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:-webkit-max-content;width:-moz-max-content;width:max-content;}
@@ -4,34 +4,24 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var index = require('../../utils/index.js');
8
7
  var base = require('./variations/_view/base.js');
9
8
  var base$1 = require('./variations/_size/base.js');
10
9
  var Counter_styles = require('./Counter.styles.js');
11
- var Counter_tokens = require('./Counter.tokens.js');
12
10
 
13
- var _excluded = ["count", "maxCount", "size", "view", "className"];
14
- var MIN_COUNT = 1;
11
+ var _excluded = ["count", "maxCount", "size", "view"];
15
12
  var counterRoot = function counterRoot(Root) {
16
13
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
17
14
  var count = props.count,
18
15
  maxCount = props.maxCount,
19
16
  size = props.size,
20
17
  view = props.view,
21
- className = props.className,
22
18
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
23
- var currentCount = count < MIN_COUNT ? MIN_COUNT : count;
24
- var currentMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;
25
- var isCurrentCountOneDigit = currentCount >= 0 && currentCount < 10;
26
- var isCurrentMaxCountExceeded = currentMaxCount && currentCount > currentMaxCount;
27
- var content = isCurrentMaxCountExceeded ? "".concat(currentMaxCount, "+") : currentCount;
28
- var roundClass = !isCurrentMaxCountExceeded && isCurrentCountOneDigit ? Counter_tokens.classes.round : undefined;
19
+ var content = maxCount && count > maxCount ? "".concat(maxCount, "+") : count;
29
20
  return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
30
21
  ref: ref,
31
22
  view: view,
32
23
  size: size,
33
- count: count,
34
- className: index.cx(roundClass, className)
24
+ count: count
35
25
  }, rest), content);
36
26
  });
37
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Counter.js","sources":["../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { CounterProps } from './Counter.types';\nimport { base } from './Counter.styles';\nimport { classes } from './Counter.tokens';\n\nconst MIN_COUNT = 1;\n\nexport const counterRoot = (Root: RootProps<HTMLDivElement, CounterProps>) =>\n forwardRef<HTMLDivElement, CounterProps>((props, ref) => {\n const { count, maxCount, size, view, className, ...rest } = props;\n\n const currentCount = count < MIN_COUNT ? MIN_COUNT : count;\n const currentMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;\n\n const isCurrentCountOneDigit = currentCount >= 0 && currentCount < 10;\n const isCurrentMaxCountExceeded = currentMaxCount && currentCount > currentMaxCount;\n\n const content = isCurrentMaxCountExceeded ? `${currentMaxCount}+` : currentCount;\n\n const roundClass = !isCurrentMaxCountExceeded && isCurrentCountOneDigit ? classes.round : undefined;\n\n return (\n <Root ref={ref} view={view} size={size} count={count} className={cx(roundClass, className)} {...rest}>\n {content}\n </Root>\n );\n });\n\nexport const counterConfig = {\n name: 'Counter',\n tag: 'div',\n layout: counterRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'xs',\n },\n};\n"],"names":["MIN_COUNT","counterRoot","Root","forwardRef","props","ref","count","maxCount","size","view","className","rest","_objectWithoutProperties","_excluded","currentCount","currentMaxCount","isCurrentCountOneDigit","isCurrentMaxCountExceeded","content","concat","roundClass","classes","round","undefined","React","createElement","_extends","cx","counterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;AAWA,IAAMA,SAAS,GAAG,CAAC,CAAA;IAENC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IAAQC,KAAK,GAA+CF,KAAK,CAAzDE,KAAK;MAAEC,QAAQ,GAAqCH,KAAK,CAAlDG,QAAQ;MAAEC,IAAI,GAA+BJ,KAAK,CAAxCI,IAAI;MAAEC,IAAI,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AAE;AACFyB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD3B,IAAAA,IAAI,EAAE;AACF0B,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN5B,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"Counter.js","sources":["../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport type { CounterProps } from './Counter.types';\nimport { base } from './Counter.styles';\n\nexport const counterRoot = (Root: RootProps<HTMLDivElement, CounterProps>) =>\n forwardRef<HTMLDivElement, CounterProps>((props, ref) => {\n const { count, maxCount, size, view, ...rest } = props;\n\n const content = maxCount && count > maxCount ? `${maxCount}+` : count;\n\n return (\n <Root ref={ref} view={view} size={size} count={count} {...rest}>\n {content}\n </Root>\n );\n });\n\nexport const counterConfig = {\n name: 'Counter',\n tag: 'div',\n layout: counterRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'xs',\n },\n};\n"],"names":["counterRoot","Root","forwardRef","props","ref","count","maxCount","size","view","rest","_objectWithoutProperties","_excluded","content","concat","React","createElement","_extends","counterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;IASaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IAAQC,KAAK,GAAoCF,KAAK,CAA9CE,KAAK;MAAEC,QAAQ,GAA0BH,KAAK,CAAvCG,QAAQ;MAAEC,IAAI,GAAoBJ,KAAK,CAA7BI,IAAI;MAAEC,IAAI,GAAcL,KAAK,CAAvBK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAKP,KAAK,EAAAQ,SAAA,CAAA,CAAA;AAEtD,IAAA,IAAMC,OAAO,GAAGN,QAAQ,IAAID,KAAK,GAAGC,QAAQ,GAAA,EAAA,CAAAO,MAAA,CAAMP,QAAQ,EAAA,GAAA,CAAA,GAAMD,KAAK,CAAA;AAErE,IAAA,oBACIS,KAAA,CAAAC,aAAA,CAACd,IAAI,EAAAe,iCAAA,CAAA;AAACZ,MAAAA,GAAG,EAAEA,GAAI;AAACI,MAAAA,IAAI,EAAEA,IAAK;AAACD,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,KAAK,EAAEA,KAAAA;KAAWI,EAAAA,IAAI,CACzDG,EAAAA,OACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMK,aAAa,GAAG;AACzBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEpB,WAAW;AACnBqB,EAAAA,IAAI,EAAJA,mBAAI;AACJC,EAAAA,UAAU,EAAE;AACRd,IAAAA,IAAI,EAAE;AACFe,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDjB,IAAAA,IAAI,EAAE;AACFgB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlB,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,IAAA;AACV,GAAA;AACJ;;;;;"}
@@ -2,9 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var classes = {
6
- round: '--plasma-counter-round'
7
- };
8
5
  var tokens = {
9
6
  background: '--plasma-counter-background',
10
7
  color: '--plasma-counter-color',
@@ -22,6 +19,5 @@ var tokens = {
22
19
  lineHeight: '--plasma-counter-lineheight'
23
20
  };
24
21
 
25
- exports.classes = classes;
26
22
  exports.tokens = tokens;
27
23
  //# sourceMappingURL=Counter.tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Counter.tokens.js","sources":["../../../src/components/Counter/Counter.tokens.ts"],"sourcesContent":["export const classes = {\n round: '--plasma-counter-round',\n};\n\nexport const tokens = {\n background: '--plasma-counter-background',\n color: '--plasma-counter-color',\n\n borderRadius: '--plasma-counter-border-radius',\n height: '--plasma-counter-height',\n paddingTop: '--plasma-counter-padding-top',\n paddingRight: '--plasma-counter-padding-right',\n paddingBottom: '--plasma-counter-padding-bottom',\n paddingLeft: '--plasma-counter-padding-left',\n\n fontFamily: '--plasma-counter-font-family',\n fontSize: '--plasma-counter-font-size',\n fontStyle: '--plasma-counter-font-style',\n fontWeight: '--plasma-counter-font-weight',\n letterSpacing: '--plasma-counter-letter-spacing',\n lineHeight: '--plasma-counter-lineheight',\n};\n"],"names":["classes","round","tokens","background","color","borderRadius","height","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight"],"mappings":";;;;AAAO,IAAMA,OAAO,GAAG;AACnBC,EAAAA,KAAK,EAAE,wBAAA;AACX,EAAC;AAEM,IAAMC,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,KAAK,EAAE,wBAAwB;AAE/BC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,MAAM,EAAE,yBAAyB;AACjCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,WAAW,EAAE,+BAA+B;AAE5CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,QAAQ,EAAE,4BAA4B;AACtCC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,UAAU,EAAE,6BAAA;AAChB;;;;;"}
1
+ {"version":3,"file":"Counter.tokens.js","sources":["../../../src/components/Counter/Counter.tokens.ts"],"sourcesContent":["export const tokens = {\n background: '--plasma-counter-background',\n color: '--plasma-counter-color',\n\n borderRadius: '--plasma-counter-border-radius',\n height: '--plasma-counter-height',\n paddingTop: '--plasma-counter-padding-top',\n paddingRight: '--plasma-counter-padding-right',\n paddingBottom: '--plasma-counter-padding-bottom',\n paddingLeft: '--plasma-counter-padding-left',\n\n fontFamily: '--plasma-counter-font-family',\n fontSize: '--plasma-counter-font-size',\n fontStyle: '--plasma-counter-font-style',\n fontWeight: '--plasma-counter-font-weight',\n letterSpacing: '--plasma-counter-letter-spacing',\n lineHeight: '--plasma-counter-lineheight',\n};\n"],"names":["tokens","background","color","borderRadius","height","paddingTop","paddingRight","paddingBottom","paddingLeft","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight"],"mappings":";;;;AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,KAAK,EAAE,wBAAwB;AAE/BC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,MAAM,EAAE,yBAAyB;AACjCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,YAAY,EAAE,gCAAgC;AAC9CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,WAAW,EAAE,+BAA+B;AAE5CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,QAAQ,EAAE,4BAA4B;AACtCC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,aAAa,EAAE,iCAAiC;AAChDC,EAAAA,UAAU,EAAE,6BAAA;AAChB;;;;"}
@@ -1,4 +1,4 @@
1
- import './base_4mz17d.css';
1
+ import './base_1z0ohiy.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sources":["../../../../../src/components/Counter/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { classes, tokens } from '../../Counter.tokens';\n\nexport const base = css`\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n\n border-radius: var(${tokens.borderRadius});\n\n height: var(${tokens.height});\n\n padding-top: var(${tokens.paddingTop});\n padding-right: var(${tokens.paddingRight});\n padding-bottom: var(${tokens.paddingBottom});\n padding-left: var(${tokens.paddingLeft});\n\n &.${classes.round} {\n width: var(${tokens.height});\n }\n`;\n"],"names":["base"],"mappings":";;;;AAIO,IAAMA,IAAI,GAoBhB;;;;"}
1
+ {"version":3,"file":"base.js","sources":["../../../../../src/components/Counter/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../Counter.tokens';\n\nexport const base = css`\n font-family: var(${tokens.fontFamily});\n font-size: var(${tokens.fontSize});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n\n border-radius: var(${tokens.borderRadius});\n\n height: var(${tokens.height});\n\n padding-top: var(${tokens.paddingTop});\n padding-right: var(${tokens.paddingRight});\n padding-bottom: var(${tokens.paddingBottom});\n padding-left: var(${tokens.paddingLeft});\n`;\n"],"names":["base"],"mappings":";;;;AAIO,IAAMA,IAAI,GAgBhB;;;;"}
@@ -1 +1 @@
1
- .b1t6e429{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}.b1t6e429.--plasma-counter-round{width:var(--plasma-counter-height);}
1
+ .b1t6e429{font-family:var(--plasma-counter-font-family);font-size:var(--plasma-counter-font-size);font-style:var(--plasma-counter-font-style);font-weight:var(--plasma-counter-font-weight);-webkit-letter-spacing:var(--plasma-counter-letter-spacing);-moz-letter-spacing:var(--plasma-counter-letter-spacing);-ms-letter-spacing:var(--plasma-counter-letter-spacing);letter-spacing:var(--plasma-counter-letter-spacing);line-height:var(--plasma-counter-lineheight);border-radius:var(--plasma-counter-border-radius);height:var(--plasma-counter-height);padding-top:var(--plasma-counter-padding-top);padding-right:var(--plasma-counter-padding-right);padding-bottom:var(--plasma-counter-padding-bottom);padding-left:var(--plasma-counter-padding-left);}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
7
  var base = require('./variations/_view/base.js');
9
8
  var base$1 = require('./variations/_size/base.js');
10
9
  var DropdownDivider_styles = require('./DropdownDivider.styles.js');
10
+ var react = require('../../../../utils/react.js');
11
11
 
12
12
  var _excluded = ["id", "className", "view", "size"];
13
13
  /**
@@ -20,7 +20,7 @@ var dropdownDividerRoot = function dropdownDividerRoot(Root) {
20
20
  view = _ref.view,
21
21
  size = _ref.size,
22
22
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
23
- var uniqId = plasmaCore.useUniqId();
23
+ var uniqId = react.safeUseId();
24
24
  var innerId = id || uniqId;
25
25
  return /*#__PURE__*/React.createElement(Root, {
26
26
  id: innerId,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownDivider.js","sources":["../../../../../src/components/Dropdown/ui/DropdownDivider/DropdownDivider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownDivider } from './DropdownDivider.styles';\nimport type { DropdownDividerProps } from './DropdownDivider.types';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownDividerRoot = (Root: RootProps<HTMLDivElement, DropdownDividerProps>) =>\n forwardRef<HTMLDivElement, DropdownDividerProps>(({ id, className, view, size, ...rest }, outerRootRef) => {\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownDivider className={className} {...rest} />\n </Root>\n );\n });\n\nexport const dropdownDividerConfig = {\n name: 'DropdownDivider',\n tag: 'div',\n layout: dropdownDividerRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownDividerRoot","Root","forwardRef","_ref","outerRootRef","id","className","view","size","rest","_objectWithoutProperties","_excluded","uniqId","useUniqId","innerId","React","createElement","ref","StyledDropdownDivider","_extends","dropdownDividerConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,IAAqD,EAAA;AAAA,EAAA,oBACrFC,gBAAU,CAAuC,UAAAC,IAAA,EAAyCC,YAAY,EAAK;AAAA,IAAA,IAAvDC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;MAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AAClF,IAAA,IAAMC,MAAM,GAAGC,oBAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGT,EAAE,IAAIO,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAACf,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAES,OAAQ;AAACG,MAAAA,GAAG,EAAEb,YAAa;AAACG,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACzDO,KAAA,CAAAC,aAAA,CAACE,4CAAqB,EAAAC,iCAAA,CAAA;AAACb,MAAAA,SAAS,EAAEA,SAAAA;KAAeG,EAAAA,IAAI,CAAG,CACtD,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMW,qBAAqB,GAAG;AACjCC,EAAAA,IAAI,EAAE,iBAAiB;AACvBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEvB,mBAAmB;AAC3BwB,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRlB,IAAAA,IAAI,EAAE;AACFmB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDnB,IAAAA,IAAI,EAAE;AACFkB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownDivider.js","sources":["../../../../../src/components/Dropdown/ui/DropdownDivider/DropdownDivider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../../../engines';\nimport { safeUseId } from '../../../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownDivider } from './DropdownDivider.styles';\nimport type { DropdownDividerProps } from './DropdownDivider.types';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownDividerRoot = (Root: RootProps<HTMLDivElement, DropdownDividerProps>) =>\n forwardRef<HTMLDivElement, DropdownDividerProps>(({ id, className, view, size, ...rest }, outerRootRef) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownDivider className={className} {...rest} />\n </Root>\n );\n });\n\nexport const dropdownDividerConfig = {\n name: 'DropdownDivider',\n tag: 'div',\n layout: dropdownDividerRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownDividerRoot","Root","forwardRef","_ref","outerRootRef","id","className","view","size","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","React","createElement","ref","StyledDropdownDivider","_extends","dropdownDividerConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,IAAqD,EAAA;AAAA,EAAA,oBACrFC,gBAAU,CAAuC,UAAAC,IAAA,EAAyCC,YAAY,EAAK;AAAA,IAAA,IAAvDC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;MAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AAClF,IAAA,IAAMC,MAAM,GAAGC,eAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGT,EAAE,IAAIO,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAACf,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAES,OAAQ;AAACG,MAAAA,GAAG,EAAEb,YAAa;AAACG,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACzDO,KAAA,CAAAC,aAAA,CAACE,4CAAqB,EAAAC,iCAAA,CAAA;AAACb,MAAAA,SAAS,EAAEA,SAAAA;KAAeG,EAAAA,IAAI,CAAG,CACtD,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMW,qBAAqB,GAAG;AACjCC,EAAAA,IAAI,EAAE,iBAAiB;AACvBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEvB,mBAAmB;AAC3BwB,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRlB,IAAAA,IAAI,EAAE;AACFmB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDnB,IAAAA,IAAI,EAAE;AACFkB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNtB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
7
  var base = require('./variations/_view/base.js');
9
8
  var base$1 = require('./variations/_size/base.js');
10
9
  var DropdownFooter_styles = require('./DropdownFooter.styles.js');
10
+ var react = require('../../../../utils/react.js');
11
11
 
12
12
  var _excluded = ["id", "className", "children", "view", "size"];
13
13
  /**
@@ -21,7 +21,7 @@ var dropdownFooterRoot = function dropdownFooterRoot(Root) {
21
21
  view = _ref.view,
22
22
  size = _ref.size,
23
23
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
24
- var uniqId = plasmaCore.useUniqId();
24
+ var uniqId = react.safeUseId();
25
25
  var innerId = id || uniqId;
26
26
  return /*#__PURE__*/React.createElement(Root, {
27
27
  id: innerId,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownFooter.js","sources":["../../../../../src/components/Dropdown/ui/DropdownFooter/DropdownFooter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownFooter } from './DropdownFooter.styles';\nimport type { DropdownFooterProps } from './DropdownFooter.type';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownFooterRoot = (Root: RootProps<HTMLDivElement, DropdownFooterProps>) =>\n forwardRef<HTMLDivElement, DropdownFooterProps>(\n ({ id, className, children, view, size, ...rest }, outerRootRef) => {\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownFooter className={className} {...rest}>\n {children}\n </StyledDropdownFooter>\n </Root>\n );\n },\n );\n\nexport const dropdownFooterConfig = {\n name: 'DropdownFooter',\n tag: 'div',\n layout: dropdownFooterRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownFooterRoot","Root","forwardRef","_ref","outerRootRef","id","className","children","view","size","rest","_objectWithoutProperties","_excluded","uniqId","useUniqId","innerId","React","createElement","ref","StyledDropdownFooter","_extends","dropdownFooterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAA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;AACNtB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownFooter.js","sources":["../../../../../src/components/Dropdown/ui/DropdownFooter/DropdownFooter.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../../../engines';\nimport { safeUseId } from '../../../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownFooter } from './DropdownFooter.styles';\nimport type { DropdownFooterProps } from './DropdownFooter.type';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownFooterRoot = (Root: RootProps<HTMLDivElement, DropdownFooterProps>) =>\n forwardRef<HTMLDivElement, DropdownFooterProps>(\n ({ id, className, children, view, size, ...rest }, outerRootRef) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownFooter className={className} {...rest}>\n {children}\n </StyledDropdownFooter>\n </Root>\n );\n },\n );\n\nexport const dropdownFooterConfig = {\n name: 'DropdownFooter',\n tag: 'div',\n layout: dropdownFooterRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownFooterRoot","Root","forwardRef","_ref","outerRootRef","id","className","children","view","size","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","React","createElement","ref","StyledDropdownFooter","_extends","dropdownFooterConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACnFC,gBAAU,CACN,UAAAC,IAAA,EAAmDC,YAAY,EAAK;AAAA,IAAA,IAAjEC,EAAE,GAAAF,IAAA,CAAFE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, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
7
  var base = require('./variations/_view/base.js');
9
8
  var base$1 = require('./variations/_size/base.js');
10
9
  var DropdownGroup_styles = require('./DropdownGroup.styles.js');
10
+ var react = require('../../../../utils/react.js');
11
11
 
12
12
  var _excluded = ["id", "labelClassName", "groupClassName", "label", "children", "role", "view", "size"];
13
13
  /**
@@ -24,7 +24,7 @@ var dropdownGroupRoot = function dropdownGroupRoot(Root) {
24
24
  view = _ref.view,
25
25
  size = _ref.size,
26
26
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
27
- var uniqId = plasmaCore.useUniqId();
27
+ var uniqId = react.safeUseId();
28
28
  var innerId = id || uniqId;
29
29
  return /*#__PURE__*/React.createElement(Root, {
30
30
  id: innerId,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownGroup.js","sources":["../../../../../src/components/Dropdown/ui/DropdownGroup/DropdownGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownGroup, StyledDropdownLabel } from './DropdownGroup.styles';\nimport type { DropdownGroupProps } from './DropdownGroup.type';\n\n/**\n * Элемент группы выпадающего списка\n */\nexport const dropdownGroupRoot = (Root: RootProps<HTMLDivElement, DropdownGroupProps>) =>\n forwardRef<HTMLDivElement, DropdownGroupProps>(\n ({ id, labelClassName, groupClassName, label, children, role, view, size, ...rest }, outerRootRef) => {\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size} role={role}>\n <StyledDropdownLabel className={labelClassName}>{label}</StyledDropdownLabel>\n <StyledDropdownGroup className={groupClassName} {...rest}>\n {children}\n </StyledDropdownGroup>\n </Root>\n );\n },\n );\n\nexport const dropdownGroupConfig = {\n name: 'DropdownGroup',\n tag: 'div',\n layout: dropdownGroupRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownGroupRoot","Root","forwardRef","_ref","outerRootRef","id","labelClassName","groupClassName","label","children","role","view","size","rest","_objectWithoutProperties","_excluded","uniqId","useUniqId","innerId","React","createElement","ref","StyledDropdownLabel","className","StyledDropdownGroup","_extends","dropdownGroupConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,IAAmD,EAAA;AAAA,EAAA,oBACjFC,gBAAU,CACN,UAAAC,IAAA,EAAqFC,YAAY,EAAK;AAAA,IAAA,IAAnGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,cAAc,GAAAH,IAAA,CAAdG,cAAc;MAAEC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;MAAEC,KAAK,GAAAL,IAAA,CAALK,KAAK;MAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MAAEC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MAAEC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MAAEC,IAAI,GAAAT,IAAA,CAAJS,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAC7E,IAAA,IAAMC,MAAM,GAAGC,oBAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGb,EAAE,IAAIW,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAACnB,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAEa,OAAQ;AAACG,MAAAA,GAAG,EAAEjB,YAAa;AAACO,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACrES,KAAA,CAAAC,aAAA,CAACE,wCAAmB,EAAA;AAACC,MAAAA,SAAS,EAAEjB,cAAAA;KAAiBE,EAAAA,KAA2B,CAAC,eAC7EW,KAAA,CAAAC,aAAA,CAACI,wCAAmB,EAAAC,iCAAA,CAAA;AAACF,MAAAA,SAAS,EAAEhB,cAAAA;AAAe,KAAA,EAAKM,IAAI,CAAA,EACnDJ,QACgB,CACnB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMiB,mBAAmB,GAAG;AAC/BC,EAAAA,IAAI,EAAE,eAAe;AACrBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7B,iBAAiB;AACzB8B,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRpB,IAAAA,IAAI,EAAE;AACFqB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDrB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNxB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownGroup.js","sources":["../../../../../src/components/Dropdown/ui/DropdownGroup/DropdownGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../../../engines';\nimport { safeUseId } from '../../../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownGroup, StyledDropdownLabel } from './DropdownGroup.styles';\nimport type { DropdownGroupProps } from './DropdownGroup.type';\n\n/**\n * Элемент группы выпадающего списка\n */\nexport const dropdownGroupRoot = (Root: RootProps<HTMLDivElement, DropdownGroupProps>) =>\n forwardRef<HTMLDivElement, DropdownGroupProps>(\n ({ id, labelClassName, groupClassName, label, children, role, view, size, ...rest }, outerRootRef) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size} role={role}>\n <StyledDropdownLabel className={labelClassName}>{label}</StyledDropdownLabel>\n <StyledDropdownGroup className={groupClassName} {...rest}>\n {children}\n </StyledDropdownGroup>\n </Root>\n );\n },\n );\n\nexport const dropdownGroupConfig = {\n name: 'DropdownGroup',\n tag: 'div',\n layout: dropdownGroupRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownGroupRoot","Root","forwardRef","_ref","outerRootRef","id","labelClassName","groupClassName","label","children","role","view","size","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","React","createElement","ref","StyledDropdownLabel","className","StyledDropdownGroup","_extends","dropdownGroupConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,IAAmD,EAAA;AAAA,EAAA,oBACjFC,gBAAU,CACN,UAAAC,IAAA,EAAqFC,YAAY,EAAK;AAAA,IAAA,IAAnGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,cAAc,GAAAH,IAAA,CAAdG,cAAc;MAAEC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;MAAEC,KAAK,GAAAL,IAAA,CAALK,KAAK;MAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;MAAEC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MAAEC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MAAEC,IAAI,GAAAT,IAAA,CAAJS,IAAI;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAC7E,IAAA,IAAMC,MAAM,GAAGC,eAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGb,EAAE,IAAIW,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAACnB,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAEa,OAAQ;AAACG,MAAAA,GAAG,EAAEjB,YAAa;AAACO,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACrES,KAAA,CAAAC,aAAA,CAACE,wCAAmB,EAAA;AAACC,MAAAA,SAAS,EAAEjB,cAAAA;KAAiBE,EAAAA,KAA2B,CAAC,eAC7EW,KAAA,CAAAC,aAAA,CAACI,wCAAmB,EAAAC,iCAAA,CAAA;AAACF,MAAAA,SAAS,EAAEhB,cAAAA;AAAe,KAAA,EAAKM,IAAI,CAAA,EACnDJ,QACgB,CACnB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMiB,mBAAmB,GAAG;AAC/BC,EAAAA,IAAI,EAAE,eAAe;AACrBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7B,iBAAiB;AACzB8B,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRpB,IAAAA,IAAI,EAAE;AACFqB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDrB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNxB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
7
  var base = require('./variations/_view/base.js');
9
8
  var base$1 = require('./variations/_size/base.js');
10
9
  var DropdownHeader_styles = require('./DropdownHeader.styles.js');
10
+ var react = require('../../../../utils/react.js');
11
11
 
12
12
  var _excluded = ["id", "className", "view", "size", "children"];
13
13
  /**
@@ -21,7 +21,7 @@ var dropdownHeaderRoot = function dropdownHeaderRoot(Root) {
21
21
  size = _ref.size,
22
22
  children = _ref.children,
23
23
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
24
- var uniqId = plasmaCore.useUniqId();
24
+ var uniqId = react.safeUseId();
25
25
  var innerId = id || uniqId;
26
26
  return /*#__PURE__*/React.createElement(Root, {
27
27
  id: innerId,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownHeader.js","sources":["../../../../../src/components/Dropdown/ui/DropdownHeader/DropdownHeader.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownHeader } from './DropdownHeader.styles';\nimport type { DropdownHeaderProps } from './DropdownHeader.type';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownHeaderRoot = (Root: RootProps<HTMLDivElement, DropdownHeaderProps>) =>\n forwardRef<HTMLDivElement, DropdownHeaderProps>(\n ({ id, className, view, size, children, ...rest }, outerRootRef) => {\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownHeader className={className} {...rest}>\n {children}\n </StyledDropdownHeader>\n </Root>\n );\n },\n );\n\nexport const dropdownHeaderConfig = {\n name: 'DropdownHeader',\n tag: 'div',\n layout: dropdownHeaderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownHeaderRoot","Root","forwardRef","_ref","outerRootRef","id","className","view","size","children","rest","_objectWithoutProperties","_excluded","uniqId","useUniqId","innerId","React","createElement","ref","StyledDropdownHeader","_extends","dropdownHeaderConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACnFC,gBAAU,CACN,UAAAC,IAAA,EAAmDC,YAAY,EAAK;AAAA,IAAA,IAAjEC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;MAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;MAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA,CAAA;AAC3C,IAAA,IAAMC,MAAM,GAAGC,oBAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGV,EAAE,IAAIQ,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAAChB,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAEU,OAAQ;AAACG,MAAAA,GAAG,EAAEd,YAAa;AAACG,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACzDQ,KAAA,CAAAC,aAAA,CAACE,0CAAoB,EAAAC,iCAAA,CAAA;AAACd,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KAAA,EAAKI,IAAI,CAAA,EAC/CD,QACiB,CACpB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMY,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAExB,kBAAkB;AAC1ByB,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDpB,IAAAA,IAAI,EAAE;AACFmB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownHeader.js","sources":["../../../../../src/components/Dropdown/ui/DropdownHeader/DropdownHeader.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../../../engines';\nimport { safeUseId } from '../../../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdownHeader } from './DropdownHeader.styles';\nimport type { DropdownHeaderProps } from './DropdownHeader.type';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownHeaderRoot = (Root: RootProps<HTMLDivElement, DropdownHeaderProps>) =>\n forwardRef<HTMLDivElement, DropdownHeaderProps>(\n ({ id, className, view, size, children, ...rest }, outerRootRef) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n return (\n <Root id={innerId} ref={outerRootRef} view={view} size={size}>\n <StyledDropdownHeader className={className} {...rest}>\n {children}\n </StyledDropdownHeader>\n </Root>\n );\n },\n );\n\nexport const dropdownHeaderConfig = {\n name: 'DropdownHeader',\n tag: 'div',\n layout: dropdownHeaderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownHeaderRoot","Root","forwardRef","_ref","outerRootRef","id","className","view","size","children","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","React","createElement","ref","StyledDropdownHeader","_extends","dropdownHeaderConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;AAUA;AACA;AACA;IACaA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACnFC,gBAAU,CACN,UAAAC,IAAA,EAAmDC,YAAY,EAAK;AAAA,IAAA,IAAjEC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;MAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;MAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;MAAEC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;AAAKC,MAAAA,IAAI,GAAAC,iDAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA,CAAA;AAC3C,IAAA,IAAMC,MAAM,GAAGC,eAAS,EAAE,CAAA;AAC1B,IAAA,IAAMC,OAAO,GAAGV,EAAE,IAAIQ,MAAM,CAAA;AAE5B,IAAA,oBACIG,KAAA,CAAAC,aAAA,CAAChB,IAAI,EAAA;AAACI,MAAAA,EAAE,EAAEU,OAAQ;AAACG,MAAAA,GAAG,EAAEd,YAAa;AAACG,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAAA;AAAK,KAAA,eACzDQ,KAAA,CAAAC,aAAA,CAACE,0CAAoB,EAAAC,iCAAA,CAAA;AAACd,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KAAA,EAAKI,IAAI,CAAA,EAC/CD,QACiB,CACpB,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMY,oBAAoB,GAAG;AAChCC,EAAAA,IAAI,EAAE,gBAAgB;AACtBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAExB,kBAAkB;AAC1ByB,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRnB,IAAAA,IAAI,EAAE;AACFoB,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDpB,IAAAA,IAAI,EAAE;AACFmB,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvB,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -9,6 +9,8 @@ var base = require('./variations/_view/base.js');
9
9
  var base$1 = require('./variations/_size/base.js');
10
10
  var Dropdown_styles = require('./Dropdown.styles.js');
11
11
  var index = require('./utils/index.js');
12
+ var react = require('../../../../utils/react.js');
13
+ var useFocusTrap = require('../../../../hooks/useFocusTrap.js');
12
14
 
13
15
  var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "opened", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
14
16
  /**
@@ -45,12 +47,12 @@ var dropdownOldRoot = function dropdownOldRoot(Root) {
45
47
  closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
46
48
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
47
49
  var innerIsOpen = Boolean(isOpen || opened);
48
- var uniqId = plasmaCore.useUniqId();
50
+ var uniqId = react.safeUseId();
49
51
  var innerId = id || uniqId;
50
52
  var rootRef = React.useRef(null);
51
53
  var dropdownRef = React.useRef(null);
52
54
  var handleRef = plasmaCore.useForkRef(rootRef, outerRootRef);
53
- var trapRef = plasmaCore.useFocusTrap(innerIsOpen && isFocusTrapped);
55
+ var trapRef = useFocusTrap.useFocusTrap(innerIsOpen && isFocusTrapped);
54
56
  var dropdownForkRef = plasmaCore.useForkRef(dropdownRef, trapRef);
55
57
  return /*#__PURE__*/React.createElement(Dropdown_styles.StyledPopover, {
56
58
  role: role,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownOld.js","sources":["../../../../../src/components/Dropdown/ui/DropdownOld/DropdownOld.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdown, StyledPopover } from './Dropdown.styles';\nimport { getPlacements } from './utils';\nimport type { DropdownProps } from './Dropdown.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const dropdownOldRoot = (Root: RootProps<HTMLDivElement, DropdownProps>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n id,\n target,\n children,\n hasArrow,\n role,\n view,\n size,\n frame,\n onToggle,\n isFocusTrapped = true,\n isOpen = false,\n opened = false,\n placement = 'auto',\n trigger = 'click',\n offset = [0, 6],\n preventOverflow = false,\n closeOnOverlayClick = false,\n closeOnEsc = false,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const uniqId = useUniqId();\n const innerId = id || uniqId;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(rootRef, outerRootRef);\n\n const trapRef = useFocusTrap(innerIsOpen && isFocusTrapped);\n\n const dropdownForkRef = useForkRef<HTMLDivElement>(dropdownRef, trapRef);\n\n return (\n <StyledPopover\n role={role}\n opened={innerIsOpen}\n usePortal={false}\n onToggle={(is, event) => onToggle?.(is, event)}\n id={innerId}\n ref={dropdownForkRef}\n target={target}\n offset={offset}\n preventOverflow={preventOverflow}\n hasArrow={hasArrow}\n placement={getPlacements(placement)}\n trigger={trigger}\n closeOnOverlayClick={closeOnOverlayClick}\n closeOnEsc={closeOnEsc}\n isFocusTrapped={isFocusTrapped}\n frame={frame}\n >\n <Root ref={handleRef} view={view} size={size} {...rest}>\n <StyledDropdown>{children}</StyledDropdown>\n </Root>\n </StyledPopover>\n );\n },\n );\n\nexport const dropdownOldConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownOldRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["dropdownOldRoot","Root","forwardRef","_ref","outerRootRef","id","target","children","hasArrow","role","view","size","frame","onToggle","_ref$isFocusTrapped","isFocusTrapped","_ref$isOpen","isOpen","_ref$opened","opened","_ref$placement","placement","_ref$trigger","trigger","_ref$offset","offset","_ref$preventOverflow","preventOverflow","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","uniqId","useUniqId","innerId","rootRef","useRef","dropdownRef","handleRef","useForkRef","trapRef","useFocusTrap","dropdownForkRef","React","createElement","StyledPopover","usePortal","is","event","ref","getPlacements","_extends","StyledDropdown","dropdownOldConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;AAWA;AACA;AACA;IACaA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAA8C,EAAA;AAAA,EAAA,oBAC1EC,gBAAU,CACN,UAAAC,IAAA,EAsBIC,YAAY,EACX;AAAA,IAAA,IArBGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,IAAI,GAAAN,IAAA,CAAJM,IAAI;MACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,SAAQ,GAAAV,IAAA,CAARU,QAAQ;MAAAC,mBAAA,GAAAX,IAAA,CACRY,cA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;AAC/BH,MAAAA,KAAK,EAAEA,KAAAA;AAAM,KAAA,eAEboC,KAAA,CAAAC,aAAA,CAAChD,IAAI,EAAAuD,iCAAA,CAAA;AAACF,MAAAA,GAAG,EAAEX,SAAU;AAACjC,MAAAA,IAAI,EAAEA,IAAK;AAACC,MAAAA,IAAI,EAAEA,IAAAA;KAAUqB,EAAAA,IAAI,CAClDgB,eAAAA,KAAA,CAAAC,aAAA,CAACQ,8BAAc,EAAElD,IAAAA,EAAAA,QAAyB,CACxC,CACK,CAAC,CAAA;AAExB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMmD,iBAAiB,GAAG;AAC7BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7D,eAAe;AACvB8D,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRrD,IAAAA,IAAI,EAAE;AACFsD,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDtD,IAAAA,IAAI,EAAE;AACFqD,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNzD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownOld.js","sources":["../../../../../src/components/Dropdown/ui/DropdownOld/DropdownOld.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\nimport { useFocusTrap } from '../../../../hooks';\nimport { safeUseId } from '../../../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledDropdown, StyledPopover } from './Dropdown.styles';\nimport { getPlacements } from './utils';\nimport type { DropdownProps } from './Dropdown.types';\n\n/**\n * Выпадающий список без внешнего контроля видимости.\n */\nexport const dropdownOldRoot = (Root: RootProps<HTMLDivElement, DropdownProps>) =>\n forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n id,\n target,\n children,\n hasArrow,\n role,\n view,\n size,\n frame,\n onToggle,\n isFocusTrapped = true,\n isOpen = false,\n opened = false,\n placement = 'auto',\n trigger = 'click',\n offset = [0, 6],\n preventOverflow = false,\n closeOnOverlayClick = false,\n closeOnEsc = false,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(rootRef, outerRootRef);\n\n const trapRef = useFocusTrap(innerIsOpen && isFocusTrapped);\n\n const dropdownForkRef = useForkRef<HTMLDivElement>(dropdownRef, trapRef);\n\n return (\n <StyledPopover\n role={role}\n opened={innerIsOpen}\n usePortal={false}\n onToggle={(is, event) => onToggle?.(is, event)}\n id={innerId}\n ref={dropdownForkRef}\n target={target}\n offset={offset}\n preventOverflow={preventOverflow}\n hasArrow={hasArrow}\n placement={getPlacements(placement)}\n trigger={trigger}\n closeOnOverlayClick={closeOnOverlayClick}\n closeOnEsc={closeOnEsc}\n isFocusTrapped={isFocusTrapped}\n frame={frame}\n >\n <Root ref={handleRef} view={view} size={size} {...rest}>\n <StyledDropdown>{children}</StyledDropdown>\n </Root>\n </StyledPopover>\n );\n },\n );\n\nexport const dropdownOldConfig = {\n name: 'Dropdown',\n tag: 'div',\n layout: dropdownOldRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["dropdownOldRoot","Root","forwardRef","_ref","outerRootRef","id","target","children","hasArrow","role","view","size","frame","onToggle","_ref$isFocusTrapped","isFocusTrapped","_ref$isOpen","isOpen","_ref$opened","opened","_ref$placement","placement","_ref$trigger","trigger","_ref$offset","offset","_ref$preventOverflow","preventOverflow","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","uniqId","safeUseId","innerId","rootRef","useRef","dropdownRef","handleRef","useForkRef","trapRef","useFocusTrap","dropdownForkRef","React","createElement","StyledPopover","usePortal","is","event","ref","getPlacements","_extends","StyledDropdown","dropdownOldConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAA8C,EAAA;AAAA,EAAA,oBAC1EC,gBAAU,CACN,UAAAC,IAAA,EAsBIC,YAAY,EACX;AAAA,IAAA,IArBGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;MACRC,IAAI,GAAAN,IAAA,CAAJM,IAAI;MACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,SAAQ,GAAAV,IAAA,CAARU,QAAQ;MAAAC,mBAAA,GAAAX,IAAA,CACRY,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;MAAAE,WAAA,GAAAb,IAAA,CACrBc,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;MAAAE,WAAA,GAAAf,IAAA,CACdgB,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;MAAAE,cAAA,GAAAjB,IAAA,CACdkB,SAAS;AAATA,MAAAA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;AAEE,IAAMmD,iBAAiB,GAAG;AAC7BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7D,eAAe;AACvB8D,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRrD,IAAAA,IAAI,EAAE;AACFsD,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDtD,IAAAA,IAAI,EAAE;AACFqD,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNzD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -10,6 +10,7 @@ var index = require('../../utils/index.js');
10
10
  var base = require('./variations/_view/base.js');
11
11
  var Popover_styles = require('./Popover.styles.js');
12
12
  var Popover_tokens = require('./Popover.tokens.js');
13
+ var useFocusTrap = require('../../hooks/useFocusTrap.js');
13
14
  var Portal = require('../Portal/Portal.js');
14
15
 
15
16
  var _excluded = ["target", "children", "isOpen", "opened", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle", "closeOnOverlayClick"];
@@ -55,7 +56,7 @@ var popoverRoot = function popoverRoot(Root) {
55
56
  var popoverRef = React.useRef(null);
56
57
  var handleRef = plasmaCore.useForkRef(rootRef, outerRootRef);
57
58
  var portalRef = React.useRef(null);
58
- var trapRef = plasmaCore.useFocusTrap(innerIsOpen && isFocusTrapped);
59
+ var trapRef = useFocusTrap.useFocusTrap(innerIsOpen && isFocusTrapped);
59
60
  var popoverForkRef = plasmaCore.useForkRef(popoverRef, trapRef);
60
61
  var _useState = React.useState(null),
61
62
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';\nimport type { CSSProperties } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useFocusTrap, useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines/types';\nimport { cx } from '../../utils';\nimport { Portal } from '../Portal';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport type { PopoverPlacement, PopoverProps } from './Popover.types';\nimport { StyledArrow, StyledPopover, StyledRoot, StyledWrapper } from './Popover.styles';\nimport { classes } from './Popover.tokens';\n\nexport const ESCAPE_KEYCODE = 27;\nexport const POPOVER_PORTAL_ID = 'plasma-popover-root';\n\n/**\n * Всплывающее окно с возможностью позиционирования\n * и вызова по клику либо ховеру.\n */\nexport const popoverRoot = (Root: RootProps<HTMLDivElement, PopoverProps>) =>\n forwardRef<HTMLDivElement, PopoverProps>(\n (\n {\n target,\n children,\n isOpen,\n opened,\n trigger = 'click',\n hasArrow,\n frame = 'document',\n className,\n placement = 'auto',\n offset = [0, 0],\n zIndex,\n isFocusTrapped = true,\n closeOnEsc = true,\n preventOverflow = true,\n usePortal = false,\n view,\n onToggle,\n closeOnOverlayClick,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(rootRef, outerRootRef);\n const portalRef = useRef<HTMLElement | null>(null);\n\n const trapRef = useFocusTrap(innerIsOpen && isFocusTrapped);\n\n const popoverForkRef = useForkRef<HTMLDivElement>(popoverRef, trapRef);\n\n const [arrowElement, setArrowElement] = useState<HTMLSpanElement | null>(null);\n\n const [, forceRender] = useState(false);\n\n const isAutoArray = Array.isArray(placement);\n const isAuto = isAutoArray || (placement as PopoverPlacement).startsWith('auto');\n\n const initialStyles = {\n visibility: innerIsOpen ? 'visible' : 'hidden',\n opacity: innerIsOpen ? 1 : 0,\n } as CSSProperties;\n\n const { styles, attributes, forceUpdate } = usePopper(rootRef.current, popoverRef.current, {\n // TODO: #1121\n // eslint-disable-next-line no-nested-ternary\n placement: isAutoArray\n ? placement[0]?.endsWith('start')\n ? 'auto-start'\n : 'auto'\n : (placement as PopoverPlacement),\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n mainAxis: preventOverflow,\n },\n },\n { name: 'offset', options: { offset: [offset[0], offset[1]] } },\n {\n name: 'flip',\n enabled: isAuto,\n options: {\n allowedAutoPlacements: isAutoArray ? (placement as PopoverPlacement[]) : [],\n },\n },\n {\n name: 'arrow',\n options: {\n element: arrowElement,\n },\n },\n ],\n });\n\n const onEscape = useCallback(\n (event: KeyboardEvent) => {\n if (innerIsOpen && closeOnEsc && event.keyCode === ESCAPE_KEYCODE) {\n onToggle?.(false, event);\n }\n },\n [closeOnEsc, innerIsOpen, onToggle],\n );\n\n const onDocumentClick = useCallback(\n (event: MouseEvent) => {\n if (innerIsOpen && closeOnOverlayClick && onToggle) {\n const targetIsRoot = event.target === rootRef.current;\n const rootHasTarget = rootRef.current?.contains(event.target as Element);\n const popoverRootHasTarget = popoverRef.current?.contains(event.target as Element);\n\n if (!targetIsRoot && !rootHasTarget && !popoverRootHasTarget) {\n onToggle(false, event);\n }\n }\n },\n [closeOnOverlayClick, innerIsOpen, onToggle],\n );\n\n const onClick = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'click') {\n const targetIsPopover = event.target === popoverRef.current;\n const rootHasTarget = popoverRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n onToggle?.(!innerIsOpen, event);\n }\n }\n },\n [trigger, innerIsOpen, onToggle],\n );\n\n const onMouseEnter = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(true, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onMouseLeave = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(false, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onFocus = useCallback<React.FocusEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(true, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onBlur = useCallback<React.FocusEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(false, event);\n }\n },\n [trigger, onToggle],\n );\n\n useEffect(() => {\n document.addEventListener('click', onDocumentClick);\n return () => document.removeEventListener('click', onDocumentClick);\n }, [innerIsOpen, onToggle]);\n\n useEffect(() => {\n window.addEventListener('keydown', onEscape);\n return () => window.removeEventListener('keydown', onEscape);\n }, [closeOnEsc, innerIsOpen, onToggle]);\n\n useEffect(() => {\n let portal = document.getElementById(POPOVER_PORTAL_ID);\n\n if (typeof frame !== 'string' && frame && frame.current) {\n portal = frame.current;\n }\n\n if (!usePortal) {\n portal = rootRef.current;\n }\n\n if (!portal) {\n portal = document.createElement('div');\n portal.setAttribute('id', POPOVER_PORTAL_ID);\n\n if (typeof frame === 'string' && frame !== 'document') {\n document.getElementById(frame)?.appendChild(portal);\n } else {\n document.body.appendChild(portal);\n }\n }\n\n portalRef.current = portal;\n\n /**\n * Изменение стейта нужно для того, чтобы Popup\n * отобразился после записи DOM элемента в portalRef.current\n */\n forceRender(true);\n }, []);\n\n useEffect(() => {\n if (!innerIsOpen || !forceUpdate) {\n return;\n }\n\n /*\n * INFO: Метод forceUpdate содержит в себе flushSync и приводит\n * к повторному рендеру компонента, который уже находится в процессе рендера.\n * Данный хак, нужен для того, чтобы это поведение избежать и перенаправить\n * вызов метода в очередь микрозадач.\n */\n Promise.resolve().then(forceUpdate);\n }, [innerIsOpen, children, forceUpdate]);\n\n return (\n <StyledWrapper className={classes.wrapper} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <StyledRoot\n ref={handleRef}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(className, classes.target)}\n >\n {target}\n </StyledRoot>\n {children && portalRef.current && (\n <Portal container={portalRef.current}>\n <Root view={view} className={className} {...rest}>\n <StyledPopover\n {...attributes.popper}\n className={classes.root}\n ref={popoverForkRef}\n style={{\n ...styles.popper,\n ...{ display: innerIsOpen ? 'block' : 'none' },\n ...initialStyles,\n }}\n zIndex={zIndex}\n >\n {hasArrow && (\n <StyledArrow\n className={classes.arrow}\n ref={setArrowElement}\n style={styles.arrow}\n {...attributes.arrow}\n />\n )}\n {children}\n </StyledPopover>\n </Root>\n </Portal>\n )}\n </StyledWrapper>\n );\n },\n );\n\nexport const popoverConfig = {\n name: 'Popover',\n tag: 'div',\n layout: popoverRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["ESCAPE_KEYCODE","POPOVER_PORTAL_ID","popoverRoot","Root","forwardRef","_ref","outerRootRef","_placement$","target","children","isOpen","opened","_ref$trigger","trigger","hasArrow","_ref$frame","frame","className","_ref$placement","placement","_ref$offset","offset","zIndex","_ref$isFocusTrapped","isFocusTrapped","_ref$closeOnEsc","closeOnEsc","_ref$preventOverflow","preventOverflow","_ref$usePortal","usePortal","view","onToggle","closeOnOverlayClick","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","rootRef","useRef","popoverRef","handleRef","useForkRef","portalRef","trapRef","useFocusTrap","popoverForkRef","_useState","useState","_useState2","_slicedToArray","arrowElement","setArrowElement","_useState3","_useState4","forceRender","isAutoArray","Array","isArray","isAuto","startsWith","initialStyles","visibility","opacity","_usePopper","usePopper","current","endsWith","modifiers","name","options","mainAxis","enabled","allowedAutoPlacements","element","styles","attributes","forceUpdate","onEscape","useCallback","event","keyCode","onDocumentClick","_rootRef$current","_popoverRef$current","targetIsRoot","rootHasTarget","contains","popoverRootHasTarget","onClick","_popoverRef$current2","targetIsPopover","onMouseEnter","onMouseLeave","onFocus","onBlur","useEffect","document","addEventListener","removeEventListener","window","portal","getElementById","createElement","setAttribute","_document$getElementB","appendChild","body","Promise","resolve","then","React","StyledWrapper","classes","wrapper","StyledRoot","ref","cx","Portal","container","_extends","StyledPopover","popper","root","style","_objectSpread","display","StyledArrow","arrow","popoverConfig","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;AAcO,IAAMA,cAAc,GAAG,GAAE;AACzB,IAAMC,iBAAiB,GAAG,sBAAqB;;AAEtD;AACA;AACA;AACA;IACaC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,gBAAU,CACN,UAAAC,IAAA,EAsBIC,YAAY,EACX;AAAA,IAAA,IAAAC,WAAA,CAAA;AAAA,IAAA,IArBGC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,MAAM,GAAAL,IAAA,CAANK,MAAM;MACNC,MAAM,GAAAN,IAAA,CAANM,MAAM;MAAAC,YAAA,GAAAP,IAAA,CACNQ,OAAO;AAAPA,MAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,YAAA;MACjBE,QAAQ,GAAAT,IAAA,CAARS,QAAQ;MAAAC,UAAA,GAAAV,IAAA,CACRW,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,UAAA;MAClBE,SAAS,GAAAZ,IAAA,CAATY,SAAS;MAAAC,cAAA,GAAAb,IAAA,CACTc,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,cAAA;MAAAE,WAAA,GAAAf,IAAA,CAClBgB,MAAM;MAANA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,CAAC,CAAC,EAAE,CAAC,CAAC,GAAAA,WAAA;MACfE,MAAM,GAAAjB,IAAA,CAANiB,MAAM;MAAAC,mBAAA,GAAAlB,IAAA,CACNmB,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;MAAA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sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';\nimport type { CSSProperties } from 'react';\nimport { usePopper } from 'react-popper';\nimport { useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines/types';\nimport { useFocusTrap } from '../../hooks';\nimport { cx } from '../../utils';\nimport { Portal } from '../Portal';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport type { PopoverPlacement, PopoverProps } from './Popover.types';\nimport { StyledArrow, StyledPopover, StyledRoot, StyledWrapper } from './Popover.styles';\nimport { classes } from './Popover.tokens';\n\nexport const ESCAPE_KEYCODE = 27;\nexport const POPOVER_PORTAL_ID = 'plasma-popover-root';\n\n/**\n * Всплывающее окно с возможностью позиционирования\n * и вызова по клику либо ховеру.\n */\nexport const popoverRoot = (Root: RootProps<HTMLDivElement, PopoverProps>) =>\n forwardRef<HTMLDivElement, PopoverProps>(\n (\n {\n target,\n children,\n isOpen,\n opened,\n trigger = 'click',\n hasArrow,\n frame = 'document',\n className,\n placement = 'auto',\n offset = [0, 0],\n zIndex,\n isFocusTrapped = true,\n closeOnEsc = true,\n preventOverflow = true,\n usePortal = false,\n view,\n onToggle,\n closeOnOverlayClick,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = Boolean(isOpen || opened);\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useForkRef<HTMLDivElement>(rootRef, outerRootRef);\n const portalRef = useRef<HTMLElement | null>(null);\n\n const trapRef = useFocusTrap(innerIsOpen && isFocusTrapped);\n\n const popoverForkRef = useForkRef<HTMLDivElement>(popoverRef, trapRef);\n\n const [arrowElement, setArrowElement] = useState<HTMLSpanElement | null>(null);\n\n const [, forceRender] = useState(false);\n\n const isAutoArray = Array.isArray(placement);\n const isAuto = isAutoArray || (placement as PopoverPlacement).startsWith('auto');\n\n const initialStyles = {\n visibility: innerIsOpen ? 'visible' : 'hidden',\n opacity: innerIsOpen ? 1 : 0,\n } as CSSProperties;\n\n const { styles, attributes, forceUpdate } = usePopper(rootRef.current, popoverRef.current, {\n // TODO: #1121\n // eslint-disable-next-line no-nested-ternary\n placement: isAutoArray\n ? placement[0]?.endsWith('start')\n ? 'auto-start'\n : 'auto'\n : (placement as PopoverPlacement),\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n mainAxis: preventOverflow,\n },\n },\n { name: 'offset', options: { offset: [offset[0], offset[1]] } },\n {\n name: 'flip',\n enabled: isAuto,\n options: {\n allowedAutoPlacements: isAutoArray ? (placement as PopoverPlacement[]) : [],\n },\n },\n {\n name: 'arrow',\n options: {\n element: arrowElement,\n },\n },\n ],\n });\n\n const onEscape = useCallback(\n (event: KeyboardEvent) => {\n if (innerIsOpen && closeOnEsc && event.keyCode === ESCAPE_KEYCODE) {\n onToggle?.(false, event);\n }\n },\n [closeOnEsc, innerIsOpen, onToggle],\n );\n\n const onDocumentClick = useCallback(\n (event: MouseEvent) => {\n if (innerIsOpen && closeOnOverlayClick && onToggle) {\n const targetIsRoot = event.target === rootRef.current;\n const rootHasTarget = rootRef.current?.contains(event.target as Element);\n const popoverRootHasTarget = popoverRef.current?.contains(event.target as Element);\n\n if (!targetIsRoot && !rootHasTarget && !popoverRootHasTarget) {\n onToggle(false, event);\n }\n }\n },\n [closeOnOverlayClick, innerIsOpen, onToggle],\n );\n\n const onClick = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'click') {\n const targetIsPopover = event.target === popoverRef.current;\n const rootHasTarget = popoverRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n onToggle?.(!innerIsOpen, event);\n }\n }\n },\n [trigger, innerIsOpen, onToggle],\n );\n\n const onMouseEnter = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(true, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onMouseLeave = useCallback<React.MouseEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(false, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onFocus = useCallback<React.FocusEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(true, event);\n }\n },\n [trigger, onToggle],\n );\n\n const onBlur = useCallback<React.FocusEventHandler>(\n (event) => {\n if (trigger === 'hover') {\n onToggle?.(false, event);\n }\n },\n [trigger, onToggle],\n );\n\n useEffect(() => {\n document.addEventListener('click', onDocumentClick);\n return () => document.removeEventListener('click', onDocumentClick);\n }, [innerIsOpen, onToggle]);\n\n useEffect(() => {\n window.addEventListener('keydown', onEscape);\n return () => window.removeEventListener('keydown', onEscape);\n }, [closeOnEsc, innerIsOpen, onToggle]);\n\n useEffect(() => {\n let portal = document.getElementById(POPOVER_PORTAL_ID);\n\n if (typeof frame !== 'string' && frame && frame.current) {\n portal = frame.current;\n }\n\n if (!usePortal) {\n portal = rootRef.current;\n }\n\n if (!portal) {\n portal = document.createElement('div');\n portal.setAttribute('id', POPOVER_PORTAL_ID);\n\n if (typeof frame === 'string' && frame !== 'document') {\n document.getElementById(frame)?.appendChild(portal);\n } else {\n document.body.appendChild(portal);\n }\n }\n\n portalRef.current = portal;\n\n /**\n * Изменение стейта нужно для того, чтобы Popup\n * отобразился после записи DOM элемента в portalRef.current\n */\n forceRender(true);\n }, []);\n\n useEffect(() => {\n if (!innerIsOpen || !forceUpdate) {\n return;\n }\n\n /*\n * INFO: Метод forceUpdate содержит в себе flushSync и приводит\n * к повторному рендеру компонента, который уже находится в процессе рендера.\n * Данный хак, нужен для того, чтобы это поведение избежать и перенаправить\n * вызов метода в очередь микрозадач.\n */\n Promise.resolve().then(forceUpdate);\n }, [innerIsOpen, children, forceUpdate]);\n\n return (\n <StyledWrapper className={classes.wrapper} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <StyledRoot\n ref={handleRef}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(className, classes.target)}\n >\n {target}\n </StyledRoot>\n {children && portalRef.current && (\n <Portal container={portalRef.current}>\n <Root view={view} className={className} {...rest}>\n <StyledPopover\n {...attributes.popper}\n className={classes.root}\n ref={popoverForkRef}\n style={{\n ...styles.popper,\n ...{ display: innerIsOpen ? 'block' : 'none' },\n ...initialStyles,\n }}\n zIndex={zIndex}\n >\n {hasArrow && (\n <StyledArrow\n className={classes.arrow}\n ref={setArrowElement}\n style={styles.arrow}\n {...attributes.arrow}\n />\n )}\n {children}\n </StyledPopover>\n </Root>\n </Portal>\n )}\n </StyledWrapper>\n );\n },\n );\n\nexport const popoverConfig = {\n name: 'Popover',\n tag: 'div',\n layout: popoverRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n },\n defaults: {\n view: 'default',\n },\n};\n"],"names":["ESCAPE_KEYCODE","POPOVER_PORTAL_ID","popoverRoot","Root","forwardRef","_ref","outerRootRef","_placement$","target","children","isOpen","opened","_ref$trigger","trigger","hasArrow","_ref$frame","frame","className","_ref$placement","placement","_ref$offset","offset","zIndex","_ref$isFocusTrapped","isFocusTrapped","_ref$closeOnEsc","closeOnEsc","_ref$preventOverflow","preventOverflow","_ref$usePortal","usePortal","view","onToggle","closeOnOverlayClick","rest","_objectWithoutProperties","_excluded","innerIsOpen","Boolean","rootRef","useRef","popoverRef","handleRef","useForkRef","portalRef","trapRef","useFocusTrap","popoverForkRef","_useState","useState","_useState2","_slicedToArray","arrowElement","setArrowElement","_useState3","_useState4","forceRender","isAutoArray","Array","isArray","isAuto","startsWith","initialStyles","visibility","opacity","_usePopper","usePopper","current","endsWith","modifiers","name","options","mainAxis","enabled","allowedAutoPlacements","element","styles","attributes","forceUpdate","onEscape","useCallback","event","keyCode","onDocumentClick","_rootRef$current","_popoverRef$current","targetIsRoot","rootHasTarget","contains","popoverRootHasTarget","onClick","_popoverRef$current2","targetIsPopover","onMouseEnter","onMouseLeave","onFocus","onBlur","useEffect","document","addEventListener","removeEventListener","window","portal","getElementById","createElement","setAttribute","_document$getElementB","appendChild","body","Promise","resolve","then","React","StyledWrapper","classes","wrapper","StyledRoot","ref","cx","Portal","container","_extends","StyledPopover","popper","root","style","_objectSpread","display","StyledArrow","arrow","popoverConfig","tag","layout","base","variations","css","viewCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;AAeO,IAAMA,cAAc,GAAG,GAAE;AACzB,IAAMC,iBAAiB,GAAG,sBAAqB;;AAEtD;AACA;AACA;AACA;IACaC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBACrEC,gBAAU,CACN,UAAAC,IAAA,EAsBIC,YAAY,EACX;AAAA,IAAA,IAAAC,WAAA,CAAA;AAAA,IAAA,IArBGC,MAAM,GAAAH,IAAA,CAANG,MAAM;MACNC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,MAAM,GAAAL,IAAA,CAANK,MAAM;MACNC,MAAM,GAAAN,IAAA,CAANM,MAAM;MAAAC,YAAA,GAAAP,IAAA,CACNQ,OAAO;AAAPA,MAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,YAAA;MACjBE,QAAQ,GAAAT,IAAA,CAARS,QAAQ;MAAAC,UAAA,GAAAV,IAAA,CACRW,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,UAAA;MAClBE,SAAS,GAAAZ,IAAA,CAATY,SAAS;MAAAC,cAAA,GAAAb,IAAA,CACTc,SAAS;AAATA,MAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,cAAA;MAAAE,WAAA,GAAAf,IAAA,CAClBgB,MAAM;MAANA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,CAAC,CAAC,EAAE,CAAC,CAAC,GAAAA,WAAA;MACfE,MAAM,GAAAjB,IAAA,CAANiB,MAAM;MAAAC,mBAAA,GAAAlB,IAAA,CACNmB,cAAc;AAAdA,MAAAA,cAAc,GAA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E,SAAA;AACV,GAAA;AACJ;;;;;;;"}
@@ -10,8 +10,8 @@ var PopupRoot = require('./PopupRoot.js');
10
10
  var Popup_tokens = require('./Popup.tokens.js');
11
11
  var Popup_styles = require('./Popup.styles.js');
12
12
  var usePopup = require('./hooks/usePopup.js');
13
- var Portal = require('../Portal/Portal.js');
14
13
  var canUseDOM = require('../../utils/canUseDOM.js');
14
+ var Portal = require('../Portal/Portal.js');
15
15
 
16
16
  var _excluded = ["id", "isOpen", "opened", "placement", "offset", "frame", "children", "overlay", "role", "zIndex", "popupInfo", "withAnimation", "className"];
17
17
  var handlePosition = function handlePosition(placement, offset) {
@@ -125,7 +125,7 @@ var popupRoot = function popupRoot(Root) {
125
125
  animationInfo: animationInfo,
126
126
  setVisible: setVisible
127
127
  }, children));
128
- if (typeof frame !== 'string' && frame && frame.current) {
128
+ if (typeof frame !== 'string' && frame && frame.current && canUseDOM.canUseDOM) {
129
129
  return /*#__PURE__*/React.createElement(Portal.Portal, {
130
130
  container: frame.current
131
131
  }, rootNode);
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.js","sources":["../../../src/components/Popup/Popup.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport { useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines/types';\nimport { canUseDOM, cx } from '../../utils';\nimport { Portal } from '../Portal';\n\nimport type { PopupPlacementBasic, PopupPlacement, PopupPositionType, PopupProps } from './Popup.types';\nimport { PopupRoot } from './PopupRoot';\nimport { usePopup } from './hooks';\nimport { classes } from './Popup.tokens';\nimport { StyledPortalContainer } from './Popup.styles';\n\nexport const handlePosition = (\n placement: PopupPlacement,\n offset: [number, number] | [string, string],\n): PopupPositionType => {\n let x = '0rem';\n let y = '0rem';\n\n if (offset) {\n const [_x, _y] = offset;\n x = typeof _x === 'number' ? `${_x}rem` : _x;\n y = typeof _y === 'number' ? `${_y}rem` : _y;\n }\n\n if (!placement || placement === 'center') {\n return {\n left: `calc(50% + ${x})`,\n top: `calc(50% - ${y})`,\n transform: 'translate(-50%, -50%)',\n };\n }\n\n let left;\n let right;\n let top;\n let bottom;\n let transform;\n const placements = placement.split('-') as PopupPlacementBasic[];\n\n placements.forEach((placementValue: PopupPlacementBasic) => {\n switch (placementValue) {\n case 'left':\n left = x;\n break;\n case 'right':\n right = x;\n break;\n case 'top':\n top = y;\n break;\n case 'bottom':\n bottom = y;\n break;\n default:\n break;\n }\n });\n\n const isCenteredX = left === undefined && right === undefined;\n const isCenteredY = top === undefined && bottom === undefined;\n\n if (isCenteredX) {\n transform = 'translateX(-50%)';\n }\n\n if (isCenteredY) {\n transform = 'translateY(-50%)';\n }\n\n return {\n left: isCenteredX ? `calc(50% + ${x})` : left,\n right,\n top: isCenteredY ? `calc(50% - ${y})` : top,\n bottom,\n transform,\n };\n};\n\n/**\n * Базовый компонент Popup.\n */\nexport const popupRoot = (Root: RootProps<HTMLDivElement, PopupProps>) =>\n forwardRef<HTMLDivElement, PopupProps>(\n (\n {\n id,\n isOpen = false,\n opened = false,\n placement = 'center',\n offset = [0, 0],\n frame = 'document',\n children,\n overlay,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n role,\n zIndex,\n popupInfo,\n withAnimation = false,\n className,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = isOpen || opened;\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const { isVisible, animationInfo, setVisible, rootId } = usePopup({\n isOpen: innerIsOpen,\n id: innerId,\n popupInfo,\n withAnimation,\n });\n\n const portalRef = useRef<HTMLDivElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const innerRef = useForkRef<HTMLDivElement>(contentRef, outerRootRef);\n\n if (!isVisible && !innerIsOpen) {\n return null;\n }\n\n const cls = cx(\n className,\n animationInfo?.endAnimation ? classes.endAnimation : '',\n animationInfo?.endTransition ? classes.endTransition : '',\n );\n\n const rootNode = (\n <Root className={cls} {...rest}>\n {overlay}\n <PopupRoot\n id={innerId}\n ref={innerRef}\n position={handlePosition(placement, offset)}\n zIndex={zIndex}\n frame={frame}\n animationInfo={animationInfo}\n setVisible={setVisible}\n >\n {children}\n </PopupRoot>\n </Root>\n );\n\n if (typeof frame !== 'string' && frame && frame.current) {\n return <Portal container={frame.current}>{rootNode}</Portal>;\n }\n\n const withFrameId = typeof frame === 'string' && frame !== 'document';\n const containerElement = withFrameId && canUseDOM && document.getElementById(frame as string);\n\n if (containerElement) {\n return (\n <Portal container={containerElement}>\n <StyledPortalContainer ref={portalRef}>\n {portalRef.current && <Portal container={portalRef.current}>{rootNode}</Portal>}\n </StyledPortalContainer>{' '}\n </Portal>\n );\n }\n\n const globalPortal = canUseDOM && document.getElementById(rootId);\n\n return <>{globalPortal && <Portal container={globalPortal}>{rootNode}</Portal>}</>;\n },\n );\n\nexport const popupConfig = {\n name: 'Popup',\n tag: 'div',\n layout: popupRoot,\n base: '',\n variations: {},\n defaults: {},\n};\n"],"names":["handlePosition","placement","offset","x","y","_offset","_slicedToArray","_x","_y","concat","left","top","transform","right","bottom","placements","split","forEach","placementValue","isCenteredX","undefined","isCenteredY","popupRoot","Root","forwardRef","_ref","outerRootRef","id","_ref$isOpen","isOpen","_ref$opened","opened","_ref$placement","_ref$offset","_ref$frame","frame","children","overlay","zIndex","popupInfo","_ref$withAnimation","withAnimation","className","rest","_objectWithoutProperties","_excluded","innerIsOpen","uniqId","safeUseId","innerId","_usePopup","usePopup","isVisible","animationInfo","setVisible","rootId","portalRef","useRef","contentRef","innerRef","useForkRef","cls","cx","endAnimation","classes","endTransition","rootNode","React","createElement","_extends","PopupRoot","ref","position","current","Portal","container","withFrameId","containerElement","canUseDOM","document","getElementById","StyledPortalContainer","globalPortal","Fragment","popupConfig","name","tag","layout","base","variations","defaults"],"mappings":";;;;;;;;;;;;;;;;AAaO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CACvBC,SAAyB,EACzBC,MAA2C,EACvB;EACpB,IAAIC,CAAC,GAAG,MAAM,CAAA;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GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMkB,WAAW,GAAG;AACvBC,EAAAA,IAAI,EAAE,OAAO;AACbC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEjE,SAAS;AACjBkE,EAAAA,IAAI,EAAE,EAAE;EACRC,UAAU,EAAE,EAAE;AACdC,EAAAA,QAAQ,EAAE,EAAC;AACf;;;;;;"}
1
+ {"version":3,"file":"Popup.js","sources":["../../../src/components/Popup/Popup.tsx"],"sourcesContent":["import React, { forwardRef, useRef } from 'react';\nimport { useForkRef, safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines/types';\nimport { canUseDOM, cx } from '../../utils';\nimport { Portal } from '../Portal';\n\nimport type { PopupPlacementBasic, PopupPlacement, PopupPositionType, PopupProps } from './Popup.types';\nimport { PopupRoot } from './PopupRoot';\nimport { usePopup } from './hooks';\nimport { classes } from './Popup.tokens';\nimport { StyledPortalContainer } from './Popup.styles';\n\nexport const handlePosition = (\n placement: PopupPlacement,\n offset: [number, number] | [string, string],\n): PopupPositionType => {\n let x = '0rem';\n let y = '0rem';\n\n if (offset) {\n const [_x, _y] = offset;\n x = typeof _x === 'number' ? `${_x}rem` : _x;\n y = typeof _y === 'number' ? `${_y}rem` : _y;\n }\n\n if (!placement || placement === 'center') {\n return {\n left: `calc(50% + ${x})`,\n top: `calc(50% - ${y})`,\n transform: 'translate(-50%, -50%)',\n };\n }\n\n let left;\n let right;\n let top;\n let bottom;\n let transform;\n const placements = placement.split('-') as PopupPlacementBasic[];\n\n placements.forEach((placementValue: PopupPlacementBasic) => {\n switch (placementValue) {\n case 'left':\n left = x;\n break;\n case 'right':\n right = x;\n break;\n case 'top':\n top = y;\n break;\n case 'bottom':\n bottom = y;\n break;\n default:\n break;\n }\n });\n\n const isCenteredX = left === undefined && right === undefined;\n const isCenteredY = top === undefined && bottom === undefined;\n\n if (isCenteredX) {\n transform = 'translateX(-50%)';\n }\n\n if (isCenteredY) {\n transform = 'translateY(-50%)';\n }\n\n return {\n left: isCenteredX ? `calc(50% + ${x})` : left,\n right,\n top: isCenteredY ? `calc(50% - ${y})` : top,\n bottom,\n transform,\n };\n};\n\n/**\n * Базовый компонент Popup.\n */\nexport const popupRoot = (Root: RootProps<HTMLDivElement, PopupProps>) =>\n forwardRef<HTMLDivElement, PopupProps>(\n (\n {\n id,\n isOpen = false,\n opened = false,\n placement = 'center',\n offset = [0, 0],\n frame = 'document',\n children,\n overlay,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n role,\n zIndex,\n popupInfo,\n withAnimation = false,\n className,\n ...rest\n },\n outerRootRef,\n ) => {\n const innerIsOpen = isOpen || opened;\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const { isVisible, animationInfo, setVisible, rootId } = usePopup({\n isOpen: innerIsOpen,\n id: innerId,\n popupInfo,\n withAnimation,\n });\n\n const portalRef = useRef<HTMLDivElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n const innerRef = useForkRef<HTMLDivElement>(contentRef, outerRootRef);\n\n if (!isVisible && !innerIsOpen) {\n return null;\n }\n\n const cls = cx(\n className,\n animationInfo?.endAnimation ? classes.endAnimation : '',\n animationInfo?.endTransition ? classes.endTransition : '',\n );\n\n const rootNode = (\n <Root className={cls} {...rest}>\n {overlay}\n <PopupRoot\n id={innerId}\n ref={innerRef}\n position={handlePosition(placement, offset)}\n zIndex={zIndex}\n frame={frame}\n animationInfo={animationInfo}\n setVisible={setVisible}\n >\n {children}\n </PopupRoot>\n </Root>\n );\n\n if (typeof frame !== 'string' && frame && frame.current && canUseDOM) {\n return <Portal container={frame.current}>{rootNode}</Portal>;\n }\n\n const withFrameId = typeof frame === 'string' && frame !== 'document';\n const containerElement = withFrameId && canUseDOM && document.getElementById(frame as string);\n\n if (containerElement) {\n return (\n <Portal container={containerElement}>\n <StyledPortalContainer ref={portalRef}>\n {portalRef.current && <Portal container={portalRef.current}>{rootNode}</Portal>}\n </StyledPortalContainer>{' '}\n </Portal>\n );\n }\n\n const globalPortal = canUseDOM && document.getElementById(rootId);\n\n return <>{globalPortal && <Portal container={globalPortal}>{rootNode}</Portal>}</>;\n },\n );\n\nexport const popupConfig = {\n name: 'Popup',\n tag: 'div',\n layout: popupRoot,\n base: '',\n variations: {},\n defaults: {},\n};\n"],"names":["handlePosition","placement","offset","x","y","_offset","_slicedToArray","_x","_y","concat","left","top","transform","right","bottom","placements","split","forEach","placementValue","isCenteredX","undefined","isCenteredY","popupRoot","Root","forwardRef","_ref","outerRootRef","id","_ref$isOpen","isOpen","_ref$opened","opened","_ref$placement","_ref$offset","_ref$frame","frame","children","overlay","zIndex","popupInfo","_ref$withAnimation","withAnimation","className","rest","_objectWithoutProperties","_excluded","innerIsOpen","uniqId","safeUseId","innerId","_usePopup","usePopup","isVisible","animationInfo","setVisible","rootId","portalRef","useRef","contentRef","innerRef","useForkRef","cls","cx","endAnimation","classes","endTransition","rootNode","React","createElement","_extends","PopupRoot","ref","position","current","canUseDOM","Portal","container","withFrameId","containerElement","document","getElementById","StyledPortalContainer","globalPortal","Fragment","popupConfig","name","tag","layout","base","variations","defaults"],"mappings":";;;;;;;;;;;;;;;;AAaO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CACvBC,SAAyB,EACzBC,MAA2C,EACvB;EACpB,IAAIC,CAAC,GAAG,MAAM,CAAA;EACd,IAAIC,CAAC,GAAG,MAAM,CAAA;AAEd,EAAA,IAAIF,MAAM,EAAE;AACR,IAAA,IAAAG,OAAA,GAAAC,uCAAA,CAAiBJ,MAAM,EAAA,CAAA,CAAA;AAAhBK,MAAAA,EAAE,GAAAF,OAAA,CAAA,CAAA,CAAA;AAAEG,MAAAA,EAAE,GAAAH,OAAA,CAAA,CAAA,CAAA,CAAA;IACbF,CAAC,GAAG,OAAOI,EAAE,KAAK,QAAQ,MAAAE,MAAA,CAAMF,EAAE,EAAA,KAAA,CAAA,GAAQA,EAAE,CAAA;IAC5CH,CAAC,GAAG,OAAOI,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