@salutejs/plasma-new-hope 0.78.0-canary.1201.8968491632.0 → 0.78.0-canary.1201.8983771283.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/cjs/components/Combobox/Combobox.css +3 -0
  2. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +3 -0
  3. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +3 -0
  4. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +3 -0
  5. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +3 -0
  6. package/cjs/components/Dropdown/Dropdown.css +3 -0
  7. package/cjs/components/Dropdown/Dropdown.js +3 -0
  8. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  9. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -0
  10. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  11. package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +29 -0
  12. package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -0
  13. package/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles_3w3l45.css +2 -0
  14. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.css +7 -0
  15. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +99 -0
  16. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -0
  17. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js +115 -0
  18. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js.map +1 -0
  19. package/cjs/components/Dropdown/ui/DropdownOld/utils/index.js +23 -0
  20. package/cjs/components/Dropdown/ui/DropdownOld/utils/index.js.map +1 -0
  21. package/cjs/components/Dropdown/ui/DropdownOld/variations/_size/base.js +9 -0
  22. package/cjs/components/Dropdown/ui/DropdownOld/variations/_size/base.js.map +1 -0
  23. package/cjs/components/Dropdown/ui/DropdownOld/variations/_size/base_x642ct.css +1 -0
  24. package/cjs/components/Dropdown/ui/DropdownOld/variations/_view/base.js +9 -0
  25. package/cjs/components/Dropdown/ui/DropdownOld/variations/_view/base.js.map +1 -0
  26. package/cjs/components/Dropdown/ui/DropdownOld/variations/_view/base_x642ct.css +1 -0
  27. package/cjs/components/Pagination/Pagination.css +3 -0
  28. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +3 -0
  29. package/cjs/components/Select/Select.css +3 -0
  30. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +3 -0
  31. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +3 -0
  32. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +3 -0
  33. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +3 -0
  34. package/cjs/components/Select/ui/SelectItem/SelectItem.css +3 -0
  35. package/cjs/index.css +3 -0
  36. package/cjs/index.js +5 -0
  37. package/cjs/index.js.map +1 -1
  38. package/es/components/Combobox/Combobox.css +3 -0
  39. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +3 -0
  40. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +3 -0
  41. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +3 -0
  42. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +3 -0
  43. package/es/components/Dropdown/Dropdown.css +3 -0
  44. package/es/components/Dropdown/Dropdown.js +3 -0
  45. package/es/components/Dropdown/Dropdown.js.map +1 -1
  46. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -0
  47. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  48. package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +24 -0
  49. package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js.map +1 -0
  50. package/es/components/Dropdown/ui/DropdownOld/Dropdown.styles_3w3l45.css +2 -0
  51. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.css +7 -0
  52. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +94 -0
  53. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -0
  54. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js +111 -0
  55. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js.map +1 -0
  56. package/es/components/Dropdown/ui/DropdownOld/utils/index.js +18 -0
  57. package/es/components/Dropdown/ui/DropdownOld/utils/index.js.map +1 -0
  58. package/es/components/Dropdown/ui/DropdownOld/variations/_size/base.js +5 -0
  59. package/es/components/Dropdown/ui/DropdownOld/variations/_size/base.js.map +1 -0
  60. package/es/components/Dropdown/ui/DropdownOld/variations/_size/base_x642ct.css +1 -0
  61. package/es/components/Dropdown/ui/DropdownOld/variations/_view/base.js +5 -0
  62. package/es/components/Dropdown/ui/DropdownOld/variations/_view/base.js.map +1 -0
  63. package/es/components/Dropdown/ui/DropdownOld/variations/_view/base_x642ct.css +1 -0
  64. package/es/components/Pagination/Pagination.css +3 -0
  65. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +3 -0
  66. package/es/components/Select/Select.css +3 -0
  67. package/es/components/Select/ui/SelectDivider/SelectDivider.css +3 -0
  68. package/es/components/Select/ui/SelectFooter/SelectFooter.css +3 -0
  69. package/es/components/Select/ui/SelectGroup/SelectGroup.css +3 -0
  70. package/es/components/Select/ui/SelectHeader/SelectHeader.css +3 -0
  71. package/es/components/Select/ui/SelectItem/SelectItem.css +3 -0
  72. package/es/index.css +3 -0
  73. package/es/index.js +2 -0
  74. package/es/index.js.map +1 -1
  75. package/package.json +2 -2
  76. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +19 -0
  77. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/Dropdown.types.js +5 -0
  78. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +101 -0
  79. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js +118 -0
  80. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/utils/index.js +21 -0
  81. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/variations/_size/base.js +8 -0
  82. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/variations/_size/tokens.json +1 -0
  83. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/variations/_view/base.js +8 -0
  84. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/variations/_view/tokens.json +1 -0
  85. package/styled-components/cjs/components/Dropdown/ui/index.js +21 -1
  86. package/styled-components/es/components/Dropdown/ui/DropdownOld/Dropdown.styles.js +13 -0
  87. package/styled-components/es/components/Dropdown/ui/DropdownOld/Dropdown.types.js +1 -0
  88. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +92 -0
  89. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.js +112 -0
  90. package/styled-components/es/components/Dropdown/ui/DropdownOld/utils/index.js +15 -0
  91. package/styled-components/es/components/Dropdown/ui/DropdownOld/variations/_size/base.js +2 -0
  92. package/styled-components/es/components/Dropdown/ui/DropdownOld/variations/_size/tokens.json +1 -0
  93. package/styled-components/es/components/Dropdown/ui/DropdownOld/variations/_view/base.js +2 -0
  94. package/styled-components/es/components/Dropdown/ui/DropdownOld/variations/_view/tokens.json +1 -0
  95. package/styled-components/es/components/Dropdown/ui/index.js +3 -1
  96. package/types/components/Dropdown/ui/DropdownOld/Dropdown.styles.d.ts +8 -0
  97. package/types/components/Dropdown/ui/DropdownOld/Dropdown.styles.d.ts.map +1 -0
  98. package/types/components/Dropdown/ui/DropdownOld/Dropdown.types.d.ts +76 -0
  99. package/types/components/Dropdown/ui/DropdownOld/Dropdown.types.d.ts.map +1 -0
  100. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts +26 -0
  101. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -0
  102. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.d.ts +113 -0
  103. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.tokens.d.ts.map +1 -0
  104. package/types/components/Dropdown/ui/DropdownOld/utils/index.d.ts +4 -0
  105. package/types/components/Dropdown/ui/DropdownOld/utils/index.d.ts.map +1 -0
  106. package/types/components/Dropdown/ui/DropdownOld/variations/_size/base.d.ts +2 -0
  107. package/types/components/Dropdown/ui/DropdownOld/variations/_size/base.d.ts.map +1 -0
  108. package/types/components/Dropdown/ui/DropdownOld/variations/_view/base.d.ts +2 -0
  109. package/types/components/Dropdown/ui/DropdownOld/variations/_view/base.d.ts.map +1 -0
  110. package/types/components/Dropdown/ui/index.d.ts +2 -0
  111. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.dropdownOldRoot = exports.dropdownOldConfig = void 0;
8
+ var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
+ var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
10
+ var _base = /*#__PURE__*/require("./variations/_view/base");
11
+ var _base2 = /*#__PURE__*/require("./variations/_size/base");
12
+ var _Dropdown = /*#__PURE__*/require("./Dropdown.styles");
13
+ var _utils = /*#__PURE__*/require("./utils");
14
+ var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
17
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+ /**
21
+ * Выпадающий список без внешнего контроля видимости.
22
+ */
23
+ var dropdownOldRoot = exports.dropdownOldRoot = function dropdownOldRoot(Root) {
24
+ return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRootRef) {
25
+ var id = _ref.id,
26
+ target = _ref.target,
27
+ children = _ref.children,
28
+ hasArrow = _ref.hasArrow,
29
+ role = _ref.role,
30
+ view = _ref.view,
31
+ size = _ref.size,
32
+ frame = _ref.frame,
33
+ _onToggle = _ref.onToggle,
34
+ _ref$isFocusTrapped = _ref.isFocusTrapped,
35
+ isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
36
+ _ref$isOpen = _ref.isOpen,
37
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
38
+ _ref$placement = _ref.placement,
39
+ placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
40
+ _ref$trigger = _ref.trigger,
41
+ trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
42
+ _ref$offset = _ref.offset,
43
+ offset = _ref$offset === void 0 ? [0, 6] : _ref$offset,
44
+ _ref$preventOverflow = _ref.preventOverflow,
45
+ preventOverflow = _ref$preventOverflow === void 0 ? false : _ref$preventOverflow,
46
+ _ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
47
+ closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? false : _ref$closeOnOverlayCl,
48
+ _ref$closeOnEsc = _ref.closeOnEsc,
49
+ closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
50
+ rest = _objectWithoutProperties(_ref, _excluded);
51
+ var uniqId = (0, _plasmaCore.useUniqId)();
52
+ var innerId = id || uniqId;
53
+ var rootRef = (0, _react.useRef)(null);
54
+ var dropdownRef = (0, _react.useRef)(null);
55
+ var handleRef = (0, _plasmaCore.useForkRef)(rootRef, outerRootRef);
56
+ var trapRef = (0, _plasmaCore.useFocusTrap)(isOpen && isFocusTrapped);
57
+ var dropdownForkRef = (0, _plasmaCore.useForkRef)(dropdownRef, trapRef);
58
+ return /*#__PURE__*/_react["default"].createElement(_Dropdown.StyledPopover, {
59
+ role: role,
60
+ isOpen: isOpen,
61
+ usePortal: false,
62
+ onToggle: function onToggle(is, event) {
63
+ return _onToggle === null || _onToggle === void 0 ? void 0 : _onToggle(is, event);
64
+ },
65
+ id: innerId,
66
+ ref: dropdownForkRef,
67
+ target: target,
68
+ offset: offset,
69
+ preventOverflow: preventOverflow,
70
+ hasArrow: hasArrow,
71
+ placement: (0, _utils.getPlacements)(placement),
72
+ trigger: trigger,
73
+ closeOnOverlayClick: closeOnOverlayClick,
74
+ closeOnEsc: closeOnEsc,
75
+ isFocusTrapped: isFocusTrapped,
76
+ frame: frame
77
+ }, /*#__PURE__*/_react["default"].createElement(Root, _extends({
78
+ ref: handleRef,
79
+ view: view,
80
+ size: size
81
+ }, rest), /*#__PURE__*/_react["default"].createElement(_Dropdown.StyledDropdown, null, children)));
82
+ });
83
+ };
84
+ var dropdownOldConfig = exports.dropdownOldConfig = {
85
+ name: 'Dropdown',
86
+ tag: 'div',
87
+ layout: dropdownOldRoot,
88
+ base: '',
89
+ variations: {
90
+ view: {
91
+ css: _base.base
92
+ },
93
+ size: {
94
+ css: _base2.base
95
+ }
96
+ },
97
+ defaults: {
98
+ view: 'default',
99
+ size: 'm'
100
+ }
101
+ };
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tokens = exports.classes = void 0;
7
+ var classes = exports.classes = {
8
+ dropdownItemIsSelected: 'dropdown-item-is-selected',
9
+ dropdownItemIsDisabled: 'dropdown-item-is-disabled'
10
+ };
11
+ var tokens = exports.tokens = {
12
+ background: '--plasma-dropdown-background',
13
+ boxShadow: '--plasma-dropdown-box-shadow',
14
+ width: '--plasma-dropdown-width',
15
+ height: '--plasma-dropdown-height',
16
+ borderRadius: '--plasma-dropdown-border-radius',
17
+ paddingTop: '--plasma-dropdown-padding-top',
18
+ paddingRight: '--plasma-dropdown-padding-right',
19
+ paddingBottom: '--plasma-dropdown-padding-bottom',
20
+ paddingLeft: '--plasma-dropdown-padding-left',
21
+ itemBackground: '--plasma-dropdown-item-background',
22
+ itemColor: '--plasma-dropdown-item-color',
23
+ itemBackgroundHover: '--plasma-dropdown-item-background-hover',
24
+ itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
25
+ itemColorSelected: '--plasma-dropdown-item-color-selected',
26
+ itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
27
+ itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
28
+ itemWidth: '--plasma-dropdown-item-width',
29
+ itemHeight: '--plasma-dropdown-item-height',
30
+ itemBorderRadius: '--plasma-dropdown-item-border-radius',
31
+ itemPaddingTop: '--plasma-dropdown-item-padding-top',
32
+ itemPaddingRight: '--plasma-dropdown-item-padding-right',
33
+ itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
34
+ itemPaddingLeft: '--plasma-dropdown-item-padding-left',
35
+ itemMarginTop: '--plasma-dropdown-item-margin-top',
36
+ itemMarginRight: '--plasma-dropdown-item-margin-right',
37
+ itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
38
+ itemMarginLeft: '--plasma-dropdown-item-margin-left',
39
+ itemFontFamily: '--plasma-dropdown-item-font-family',
40
+ itemFontSize: '--plasma-dropdown-item-font-size',
41
+ itemFontStyle: '--plasma-dropdown-item-font-style',
42
+ itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
43
+ itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
44
+ itemFontLineHeight: '--plasma-dropdown-item-font-weight',
45
+ itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
46
+ itemContentRightColor: '--plasma-dropdown-item-content-right-color',
47
+ itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
48
+ itemContentRightWidth: '--plasma-dropdown-item-content-right-width',
49
+ footerBackground: '--plasma-dropdown-footer-background',
50
+ footerWidth: '--plasma-dropdown-footer-width',
51
+ footerHeight: '--plasma-dropdown-footer-height',
52
+ footerPaddingTop: '--plasma-dropdown-footer-padding-top',
53
+ footerPaddingRight: '--plasma-dropdown-footer-padding-right',
54
+ footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',
55
+ footerPaddingLeft: '--plasma-dropdown-footer-padding-left',
56
+ footerMarginTop: '--plasma-dropdown-footer-margin-top',
57
+ footerMarginRight: '--plasma-dropdown-footer-margin-right',
58
+ footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',
59
+ footerMarginLeft: '--plasma-dropdown-footer-margin-left',
60
+ footerFontFamily: '--plasma-dropdown-footer-font-family',
61
+ footerFontSize: '--plasma-dropdown-footer-font-size',
62
+ footerFontStyle: '--plasma-dropdown-footer-font-style',
63
+ footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',
64
+ footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',
65
+ footerFontLineHeight: '--plasma-dropdown-footer-font-weight',
66
+ headerBackground: '--plasma-dropdown-header-background',
67
+ headerWidth: '--plasma-dropdown-header-width',
68
+ headerHeight: '--plasma-dropdown-header-height',
69
+ headerPaddingTop: '--plasma-dropdown-header-padding-top',
70
+ headerPaddingRight: '--plasma-dropdown-header-padding-right',
71
+ headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',
72
+ headerPaddingLeft: '--plasma-dropdown-header-padding-left',
73
+ headerMarginTop: '--plasma-dropdown-header-margin-top',
74
+ headerMarginRight: '--plasma-dropdown-header-margin-right',
75
+ headerMarginBottom: '--plasma-dropdown-header-margin-bottom',
76
+ headerMarginLeft: '--plasma-dropdown-header-margin-left',
77
+ headerFontFamily: '--plasma-dropdown-header-font-family',
78
+ headerFontSize: '--plasma-dropdown-header-font-size',
79
+ headerFontStyle: '--plasma-dropdown-header-font-style',
80
+ headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',
81
+ headerFontLetterSpacing: '--plasma-dropdown-header-line-height',
82
+ headerFontLineHeight: '--plasma-dropdown-header-font-weight',
83
+ dividerColor: '--plasma-dropdown-divider-color',
84
+ dividerWidth: '--plasma-dropdown-divider-width',
85
+ dividerHeight: '--plasma-dropdown-divider-height',
86
+ dividerMarginTop: '--plasma-dropdown-divider-margin-top',
87
+ dividerMarginRight: '--plasma-dropdown-divider-margin-right',
88
+ dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',
89
+ dividerMarginLeft: '--plasma-dropdown-divider-margin-left',
90
+ groupBackground: '--plasma-dropdown-group-background',
91
+ groupWidth: '--plasma-dropdown-group-width',
92
+ groupHeight: '--plasma-dropdown-group-height',
93
+ groupPaddingTop: '--plasma-dropdown-group-padding-top',
94
+ groupPaddingRight: '--plasma-dropdown-group-padding-right',
95
+ groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',
96
+ groupPaddingLeft: '--plasma-dropdown-group-padding-left',
97
+ groupMarginTop: '--plasma-dropdown-group-margin-top',
98
+ groupMarginRight: '--plasma-dropdown-group-margin-right',
99
+ groupMarginBottom: '--plasma-dropdown-group-margin-bottom',
100
+ groupMarginLeft: '--plasma-dropdown-group-margin-left',
101
+ groupLabelColor: '--plasma-dropdown-group-label-color',
102
+ groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',
103
+ groupLabelFontSize: '--plasma-dropdown-group-label-font-size',
104
+ groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',
105
+ groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',
106
+ groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',
107
+ groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',
108
+ groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',
109
+ groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',
110
+ groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',
111
+ groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',
112
+ groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',
113
+ groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
114
+ groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
115
+ groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',
116
+ disabledOpacity: '--plasma-dropdown-disabled-opacity',
117
+ focusColor: '--plasma-dropdown-focus-color'
118
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPlacements = exports.getPlacement = void 0;
7
+ var getPlacement = exports.getPlacement = function getPlacement(placement) {
8
+ return "".concat(placement, "-start");
9
+ };
10
+ var getPlacements = exports.getPlacements = function getPlacements(placements) {
11
+ if (!placements) {
12
+ return;
13
+ }
14
+ var isArray = Array.isArray(placements);
15
+ if (!isArray) {
16
+ return getPlacement(placements);
17
+ }
18
+ return (placements || []).map(function (placement) {
19
+ return getPlacement(placement);
20
+ });
21
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([""]);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+ var _styledComponents = /*#__PURE__*/require("styled-components");
8
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)([""]);
@@ -75,10 +75,30 @@ Object.defineProperty(exports, "dropdownItemOldRoot", {
75
75
  return _DropdownItemOld.dropdownItemOldRoot;
76
76
  }
77
77
  });
78
+ Object.defineProperty(exports, "dropdownOldConfig", {
79
+ enumerable: true,
80
+ get: function get() {
81
+ return _DropdownOld.dropdownOldConfig;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "dropdownOldRoot", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _DropdownOld.dropdownOldRoot;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "dropdownOldTokens", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _DropdownOld2.tokens;
94
+ }
95
+ });
78
96
  var _DropdownDivider = /*#__PURE__*/require("./DropdownDivider/DropdownDivider");
79
97
  var _DropdownFooter = /*#__PURE__*/require("./DropdownFooter/DropdownFooter");
80
98
  var _DropdownGroup = /*#__PURE__*/require("./DropdownGroup/DropdownGroup");
81
99
  var _DropdownHeader = /*#__PURE__*/require("./DropdownHeader/DropdownHeader");
82
100
  var _DropdownItem = /*#__PURE__*/require("./DropdownItem/DropdownItem");
83
101
  var _DropdownInner = /*#__PURE__*/require("./DropdownInner/DropdownInner");
84
- var _DropdownItemOld = /*#__PURE__*/require("./DropdownItemOld/DropdownItemOld");
102
+ var _DropdownItemOld = /*#__PURE__*/require("./DropdownItemOld/DropdownItemOld");
103
+ var _DropdownOld = /*#__PURE__*/require("./DropdownOld/DropdownOld");
104
+ var _DropdownOld2 = /*#__PURE__*/require("./DropdownOld/DropdownOld.tokens");
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+ import { component } from '../../../../engines';
3
+ import { popoverConfig, popoverClasses } from '../../../Popover';
4
+ import { tokens } from './DropdownOld.tokens';
5
+
6
+ // issue #823
7
+ var Popover = /*#__PURE__*/component(popoverConfig);
8
+ export var StyledPopover = /*#__PURE__*/styled(Popover).withConfig({
9
+ componentId: "plasma-new-hope__sc-10adsb5-0"
10
+ })([".", "{display:block;}"], /*#__PURE__*/String(popoverClasses.target));
11
+ export var StyledDropdown = /*#__PURE__*/styled.div.withConfig({
12
+ componentId: "plasma-new-hope__sc-10adsb5-1"
13
+ })(["box-sizing:border-box;background:var(", ");box-shadow:var(", ");border-radius:var(", ");width:var(", ");height:var(", ");padding:var(", ") var(", ") var(", ") var(", ");"], tokens.background, tokens.boxShadow, tokens.borderRadius, tokens.width, tokens.height, tokens.paddingTop, tokens.paddingRight, tokens.paddingBottom, tokens.paddingLeft);
@@ -0,0 +1,92 @@
1
+ var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React, { forwardRef, useRef } from 'react';
6
+ import { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core';
7
+ import { base as viewCSS } from './variations/_view/base';
8
+ import { base as sizeCSS } from './variations/_size/base';
9
+ import { StyledDropdown, StyledPopover } from './Dropdown.styles';
10
+ import { getPlacements } from './utils';
11
+ /**
12
+ * Выпадающий список без внешнего контроля видимости.
13
+ */
14
+ export var dropdownOldRoot = function dropdownOldRoot(Root) {
15
+ return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
16
+ var id = _ref.id,
17
+ target = _ref.target,
18
+ children = _ref.children,
19
+ hasArrow = _ref.hasArrow,
20
+ role = _ref.role,
21
+ view = _ref.view,
22
+ size = _ref.size,
23
+ frame = _ref.frame,
24
+ _onToggle = _ref.onToggle,
25
+ _ref$isFocusTrapped = _ref.isFocusTrapped,
26
+ isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
27
+ _ref$isOpen = _ref.isOpen,
28
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
29
+ _ref$placement = _ref.placement,
30
+ placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
31
+ _ref$trigger = _ref.trigger,
32
+ trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
33
+ _ref$offset = _ref.offset,
34
+ offset = _ref$offset === void 0 ? [0, 6] : _ref$offset,
35
+ _ref$preventOverflow = _ref.preventOverflow,
36
+ preventOverflow = _ref$preventOverflow === void 0 ? false : _ref$preventOverflow,
37
+ _ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
38
+ closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? false : _ref$closeOnOverlayCl,
39
+ _ref$closeOnEsc = _ref.closeOnEsc,
40
+ closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
41
+ rest = _objectWithoutProperties(_ref, _excluded);
42
+ var uniqId = useUniqId();
43
+ var innerId = id || uniqId;
44
+ var rootRef = useRef(null);
45
+ var dropdownRef = useRef(null);
46
+ var handleRef = useForkRef(rootRef, outerRootRef);
47
+ var trapRef = useFocusTrap(isOpen && isFocusTrapped);
48
+ var dropdownForkRef = useForkRef(dropdownRef, trapRef);
49
+ return /*#__PURE__*/React.createElement(StyledPopover, {
50
+ role: role,
51
+ isOpen: isOpen,
52
+ usePortal: false,
53
+ onToggle: function onToggle(is, event) {
54
+ return _onToggle === null || _onToggle === void 0 ? void 0 : _onToggle(is, event);
55
+ },
56
+ id: innerId,
57
+ ref: dropdownForkRef,
58
+ target: target,
59
+ offset: offset,
60
+ preventOverflow: preventOverflow,
61
+ hasArrow: hasArrow,
62
+ placement: getPlacements(placement),
63
+ trigger: trigger,
64
+ closeOnOverlayClick: closeOnOverlayClick,
65
+ closeOnEsc: closeOnEsc,
66
+ isFocusTrapped: isFocusTrapped,
67
+ frame: frame
68
+ }, /*#__PURE__*/React.createElement(Root, _extends({
69
+ ref: handleRef,
70
+ view: view,
71
+ size: size
72
+ }, rest), /*#__PURE__*/React.createElement(StyledDropdown, null, children)));
73
+ });
74
+ };
75
+ export var dropdownOldConfig = {
76
+ name: 'Dropdown',
77
+ tag: 'div',
78
+ layout: dropdownOldRoot,
79
+ base: '',
80
+ variations: {
81
+ view: {
82
+ css: viewCSS
83
+ },
84
+ size: {
85
+ css: sizeCSS
86
+ }
87
+ },
88
+ defaults: {
89
+ view: 'default',
90
+ size: 'm'
91
+ }
92
+ };
@@ -0,0 +1,112 @@
1
+ export var classes = {
2
+ dropdownItemIsSelected: 'dropdown-item-is-selected',
3
+ dropdownItemIsDisabled: 'dropdown-item-is-disabled'
4
+ };
5
+ export var tokens = {
6
+ background: '--plasma-dropdown-background',
7
+ boxShadow: '--plasma-dropdown-box-shadow',
8
+ width: '--plasma-dropdown-width',
9
+ height: '--plasma-dropdown-height',
10
+ borderRadius: '--plasma-dropdown-border-radius',
11
+ paddingTop: '--plasma-dropdown-padding-top',
12
+ paddingRight: '--plasma-dropdown-padding-right',
13
+ paddingBottom: '--plasma-dropdown-padding-bottom',
14
+ paddingLeft: '--plasma-dropdown-padding-left',
15
+ itemBackground: '--plasma-dropdown-item-background',
16
+ itemColor: '--plasma-dropdown-item-color',
17
+ itemBackgroundHover: '--plasma-dropdown-item-background-hover',
18
+ itemBackgroundSelected: '--plasma-dropdown-item-background-selected',
19
+ itemColorSelected: '--plasma-dropdown-item-color-selected',
20
+ itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
21
+ itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
22
+ itemWidth: '--plasma-dropdown-item-width',
23
+ itemHeight: '--plasma-dropdown-item-height',
24
+ itemBorderRadius: '--plasma-dropdown-item-border-radius',
25
+ itemPaddingTop: '--plasma-dropdown-item-padding-top',
26
+ itemPaddingRight: '--plasma-dropdown-item-padding-right',
27
+ itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
28
+ itemPaddingLeft: '--plasma-dropdown-item-padding-left',
29
+ itemMarginTop: '--plasma-dropdown-item-margin-top',
30
+ itemMarginRight: '--plasma-dropdown-item-margin-right',
31
+ itemMarginBottom: '--plasma-dropdown-item-margin-bottom',
32
+ itemMarginLeft: '--plasma-dropdown-item-margin-left',
33
+ itemFontFamily: '--plasma-dropdown-item-font-family',
34
+ itemFontSize: '--plasma-dropdown-item-font-size',
35
+ itemFontStyle: '--plasma-dropdown-item-font-style',
36
+ itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
37
+ itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
38
+ itemFontLineHeight: '--plasma-dropdown-item-font-weight',
39
+ itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
40
+ itemContentRightColor: '--plasma-dropdown-item-content-right-color',
41
+ itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
42
+ itemContentRightWidth: '--plasma-dropdown-item-content-right-width',
43
+ footerBackground: '--plasma-dropdown-footer-background',
44
+ footerWidth: '--plasma-dropdown-footer-width',
45
+ footerHeight: '--plasma-dropdown-footer-height',
46
+ footerPaddingTop: '--plasma-dropdown-footer-padding-top',
47
+ footerPaddingRight: '--plasma-dropdown-footer-padding-right',
48
+ footerPaddingBottom: '--plasma-dropdown-footer-padding-bottom',
49
+ footerPaddingLeft: '--plasma-dropdown-footer-padding-left',
50
+ footerMarginTop: '--plasma-dropdown-footer-margin-top',
51
+ footerMarginRight: '--plasma-dropdown-footer-margin-right',
52
+ footerMarginBottom: '--plasma-dropdown-footer-margin-bottom',
53
+ footerMarginLeft: '--plasma-dropdown-footer-margin-left',
54
+ footerFontFamily: '--plasma-dropdown-footer-font-family',
55
+ footerFontSize: '--plasma-dropdown-footer-font-size',
56
+ footerFontStyle: '--plasma-dropdown-footer-font-style',
57
+ footerFontWeightBold: '--plasma-dropdown-footer-letter-spacing',
58
+ footerFontLetterSpacing: '--plasma-dropdown-footer-line-height',
59
+ footerFontLineHeight: '--plasma-dropdown-footer-font-weight',
60
+ headerBackground: '--plasma-dropdown-header-background',
61
+ headerWidth: '--plasma-dropdown-header-width',
62
+ headerHeight: '--plasma-dropdown-header-height',
63
+ headerPaddingTop: '--plasma-dropdown-header-padding-top',
64
+ headerPaddingRight: '--plasma-dropdown-header-padding-right',
65
+ headerPaddingBottom: '--plasma-dropdown-header-padding-bottom',
66
+ headerPaddingLeft: '--plasma-dropdown-header-padding-left',
67
+ headerMarginTop: '--plasma-dropdown-header-margin-top',
68
+ headerMarginRight: '--plasma-dropdown-header-margin-right',
69
+ headerMarginBottom: '--plasma-dropdown-header-margin-bottom',
70
+ headerMarginLeft: '--plasma-dropdown-header-margin-left',
71
+ headerFontFamily: '--plasma-dropdown-header-font-family',
72
+ headerFontSize: '--plasma-dropdown-header-font-size',
73
+ headerFontStyle: '--plasma-dropdown-header-font-style',
74
+ headerFontWeightBold: '--plasma-dropdown-header-letter-spacing',
75
+ headerFontLetterSpacing: '--plasma-dropdown-header-line-height',
76
+ headerFontLineHeight: '--plasma-dropdown-header-font-weight',
77
+ dividerColor: '--plasma-dropdown-divider-color',
78
+ dividerWidth: '--plasma-dropdown-divider-width',
79
+ dividerHeight: '--plasma-dropdown-divider-height',
80
+ dividerMarginTop: '--plasma-dropdown-divider-margin-top',
81
+ dividerMarginRight: '--plasma-dropdown-divider-margin-right',
82
+ dividerMarginBottom: '--plasma-dropdown-divider-margin-bottom',
83
+ dividerMarginLeft: '--plasma-dropdown-divider-margin-left',
84
+ groupBackground: '--plasma-dropdown-group-background',
85
+ groupWidth: '--plasma-dropdown-group-width',
86
+ groupHeight: '--plasma-dropdown-group-height',
87
+ groupPaddingTop: '--plasma-dropdown-group-padding-top',
88
+ groupPaddingRight: '--plasma-dropdown-group-padding-right',
89
+ groupPaddingBottom: '--plasma-dropdown-group-padding-bottom',
90
+ groupPaddingLeft: '--plasma-dropdown-group-padding-left',
91
+ groupMarginTop: '--plasma-dropdown-group-margin-top',
92
+ groupMarginRight: '--plasma-dropdown-group-margin-right',
93
+ groupMarginBottom: '--plasma-dropdown-group-margin-bottom',
94
+ groupMarginLeft: '--plasma-dropdown-group-margin-left',
95
+ groupLabelColor: '--plasma-dropdown-group-label-color',
96
+ groupLabelFontFamily: '--plasma-dropdown-group-label-font-family',
97
+ groupLabelFontSize: '--plasma-dropdown-group-label-font-size',
98
+ groupLabelFontStyle: '--plasma-dropdown-group-label-font-style',
99
+ groupLabelFontWeight: '--plasma-dropdown-group-label-font-weight',
100
+ groupLabelLetterSpacing: '--plasma-dropdown-group-label-letter-spacing',
101
+ groupLabelLineHeight: '--plasma-dropdown-group-label-line-height',
102
+ groupLabelPaddingTop: '--plasma-dropdown-group-label-padding-top',
103
+ groupLabelPaddingRight: '--plasma-dropdown-group-label-padding-right',
104
+ groupLabelPaddingBottom: '--plasma-dropdown-group-label-padding-bottom',
105
+ groupLabelPaddingLeft: '--plasma-dropdown-group-label-padding-left',
106
+ groupLabelMarginTop: '--plasma-dropdown-group-label-margin-top',
107
+ groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
108
+ groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
109
+ groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left',
110
+ disabledOpacity: '--plasma-dropdown-disabled-opacity',
111
+ focusColor: '--plasma-dropdown-focus-color'
112
+ };
@@ -0,0 +1,15 @@
1
+ export var getPlacement = function getPlacement(placement) {
2
+ return "".concat(placement, "-start");
3
+ };
4
+ export var getPlacements = function getPlacements(placements) {
5
+ if (!placements) {
6
+ return;
7
+ }
8
+ var isArray = Array.isArray(placements);
9
+ if (!isArray) {
10
+ return getPlacement(placements);
11
+ }
12
+ return (placements || []).map(function (placement) {
13
+ return getPlacement(placement);
14
+ });
15
+ };
@@ -0,0 +1,2 @@
1
+ import { css } from 'styled-components';
2
+ export var base = /*#__PURE__*/css([""]);
@@ -0,0 +1,2 @@
1
+ import { css } from 'styled-components';
2
+ export var base = /*#__PURE__*/css([""]);
@@ -4,4 +4,6 @@ export { dropdownGroupRoot, dropdownGroupConfig } from './DropdownGroup/Dropdown
4
4
  export { dropdownHeaderRoot, dropdownHeaderConfig } from './DropdownHeader/DropdownHeader';
5
5
  export { DropdownItem } from './DropdownItem/DropdownItem';
6
6
  export { DropdownInner } from './DropdownInner/DropdownInner';
7
- export { dropdownItemOldRoot, dropdownItemOldConfig } from './DropdownItemOld/DropdownItemOld';
7
+ export { dropdownItemOldRoot, dropdownItemOldConfig } from './DropdownItemOld/DropdownItemOld';
8
+ export { dropdownOldRoot, dropdownOldConfig } from './DropdownOld/DropdownOld';
9
+ export { tokens as dropdownOldTokens } from './DropdownOld/DropdownOld.tokens';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledPopover: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
3
+ view: {
4
+ css: import("@linaria/core").LinariaClassName;
5
+ };
6
+ }> & import("react").HTMLAttributes<HTMLDivElement> & import("../../../Popover/Popover.types").CustomPopoverProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare const StyledDropdown: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
8
+ //# sourceMappingURL=Dropdown.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/ui/DropdownOld/Dropdown.styles.ts"],"names":[],"mappings":";AAUA,eAAO,MAAM,aAAa;;;;kKAIzB,CAAC;AAEF,eAAO,MAAM,cAAc,qKAY1B,CAAC"}