@salutejs/plasma-new-hope 0.68.0-canary.1151.8450920847.0 → 0.68.0-canary.1155.8481923291.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Dropdown/Dropdown.js +2 -1
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Popover/Popover.js +46 -31
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/es/components/Dropdown/Dropdown.js +2 -1
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Popover/Popover.js +46 -31
- package/es/components/Popover/Popover.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Dropdown/Dropdown.js +2 -1
- package/styled-components/cjs/components/Popover/Popover.js +46 -31
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +7 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -1
- package/styled-components/es/components/Popover/Popover.js +46 -31
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +7 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/types/components/Chip/Chip.d.ts +2 -26
- package/types/components/Chip/Chip.d.ts.map +1 -1
- package/types/components/Chip/Chip.types.d.ts +5 -6
- package/types/components/Chip/Chip.types.d.ts.map +1 -1
- package/types/components/Combobox/Combobox.styles.d.ts +8 -2
- package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.d.ts +1 -13
- package/types/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +7 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Indicator/Indicator.d.ts +2 -2
- package/types/components/Popover/Popover.d.ts +2 -2
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/Popover/Popover.types.d.ts +19 -14
- package/types/components/Popover/Popover.types.d.ts.map +1 -1
- package/types/components/Select/Select.styles.d.ts +8 -2
- package/types/components/Select/Select.styles.d.ts.map +1 -1
- package/types/components/Select/ui/SelectChip/SelectChip.styles.d.ts +1 -13
- package/types/components/Select/ui/SelectChip/SelectChip.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +1 -13
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Indicator/Indicator.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +7 -1
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Chip/Chip.d.ts +1 -13
- package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Indicator/Indicator.d.ts +2 -2
- package/types/examples/plasma_web/components/Popover/Popover.d.ts +7 -1
- package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Chip/Chip.d.ts +1 -13
- package/types/examples/sds_engineer/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts +7 -1
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
@@ -70,7 +70,7 @@ export function App() {
|
|
70
70
|
|
71
71
|
### Вид Chip
|
72
72
|
Вид Chip задается с помощью свойства `view`. Возможные значения свойства `view`:
|
73
|
-
+ `"
|
73
|
+
+ `"primary"` – основная;
|
74
74
|
+ `"secondary"` – вторичная;
|
75
75
|
+ `"positive"` – успешное завершение;
|
76
76
|
|
@@ -81,7 +81,7 @@ import { Chip } from '@salutejs/{{ package }}';
|
|
81
81
|
export function App() {
|
82
82
|
return (
|
83
83
|
<div>
|
84
|
-
<Chip text="Chip" size="m" view="
|
84
|
+
<Chip text="Chip" size="m" view="primary" />
|
85
85
|
<Chip text="Chip" size="m" view="secondary" />
|
86
86
|
<Chip text="Chip" size="m" view="positive" />
|
87
87
|
</div>
|
@@ -71,6 +71,7 @@ var dropdownRoot = exports.dropdownRoot = function dropdownRoot(Root) {
|
|
71
71
|
placement: (0, _utils.getPlacements)(placement),
|
72
72
|
trigger: trigger,
|
73
73
|
closeOnOverlayClick: closeOnOverlayClick,
|
74
|
+
closeOnBeyondTargetHover: false,
|
74
75
|
closeOnEsc: closeOnEsc,
|
75
76
|
isFocusTrapped: isFocusTrapped,
|
76
77
|
frame: frame
|
@@ -95,7 +96,7 @@ var dropdownConfig = exports.dropdownConfig = {
|
|
95
96
|
}
|
96
97
|
},
|
97
98
|
defaults: {
|
98
|
-
view: '
|
99
|
+
view: 'default',
|
99
100
|
size: 'm'
|
100
101
|
}
|
101
102
|
};
|
@@ -13,7 +13,7 @@ var _utils = /*#__PURE__*/require("../../utils");
|
|
13
13
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
14
14
|
var _Popover = /*#__PURE__*/require("./Popover.styles");
|
15
15
|
var _Popover2 = /*#__PURE__*/require("./Popover.tokens");
|
16
|
-
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "
|
16
|
+
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
18
18
|
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); }
|
19
19
|
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 && Object.prototype.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; }
|
@@ -39,33 +39,41 @@ var POPOVER_PORTAL_ID = exports.POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
39
39
|
* и вызова по клику либо ховеру.
|
40
40
|
*/
|
41
41
|
var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
42
|
-
return /*#__PURE__*/(0, _react.forwardRef)(function (
|
43
|
-
var
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
closeOnEsc =
|
62
|
-
|
63
|
-
preventOverflow =
|
64
|
-
|
65
|
-
usePortal =
|
66
|
-
view =
|
67
|
-
onToggle =
|
68
|
-
rest = _objectWithoutProperties(
|
42
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (props, outerRootRef) {
|
43
|
+
var _placement$;
|
44
|
+
var target = props.target,
|
45
|
+
children = props.children,
|
46
|
+
isOpen = props.isOpen,
|
47
|
+
_props$trigger = props.trigger,
|
48
|
+
trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
|
49
|
+
hasArrow = props.hasArrow,
|
50
|
+
_props$frame = props.frame,
|
51
|
+
frame = _props$frame === void 0 ? 'document' : _props$frame,
|
52
|
+
className = props.className,
|
53
|
+
_props$placement = props.placement,
|
54
|
+
placement = _props$placement === void 0 ? 'auto' : _props$placement,
|
55
|
+
_props$offset = props.offset,
|
56
|
+
offset = _props$offset === void 0 ? [0, 0] : _props$offset,
|
57
|
+
zIndex = props.zIndex,
|
58
|
+
_props$isFocusTrapped = props.isFocusTrapped,
|
59
|
+
isFocusTrapped = _props$isFocusTrapped === void 0 ? true : _props$isFocusTrapped,
|
60
|
+
_props$closeOnEsc = props.closeOnEsc,
|
61
|
+
closeOnEsc = _props$closeOnEsc === void 0 ? true : _props$closeOnEsc,
|
62
|
+
_props$preventOverflo = props.preventOverflow,
|
63
|
+
preventOverflow = _props$preventOverflo === void 0 ? true : _props$preventOverflo,
|
64
|
+
_props$usePortal = props.usePortal,
|
65
|
+
usePortal = _props$usePortal === void 0 ? false : _props$usePortal,
|
66
|
+
view = props.view,
|
67
|
+
onToggle = props.onToggle,
|
68
|
+
rest = _objectWithoutProperties(props, _excluded);
|
69
|
+
var closeOnOverlayClick = true;
|
70
|
+
var closeOnBeyondTargetHover = true;
|
71
|
+
if (props.trigger === 'click' && props.closeOnOverlayClick === false) {
|
72
|
+
closeOnOverlayClick = false;
|
73
|
+
}
|
74
|
+
if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {
|
75
|
+
closeOnBeyondTargetHover = false;
|
76
|
+
}
|
69
77
|
var rootRef = (0, _react.useRef)(null);
|
70
78
|
var popoverRef = (0, _react.useRef)(null);
|
71
79
|
var handleRef = (0, _plasmaCore.useForkRef)(rootRef, outerRootRef);
|
@@ -86,7 +94,9 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
86
94
|
opacity: isOpen ? 1 : 0
|
87
95
|
};
|
88
96
|
var _usePopper = (0, _reactPopper.usePopper)(rootRef.current, popoverRef.current, {
|
89
|
-
|
97
|
+
// TODO: #1121
|
98
|
+
// eslint-disable-next-line no-nested-ternary
|
99
|
+
placement: isAutoArray ? (_placement$ = placement[0]) !== null && _placement$ !== void 0 && _placement$.endsWith('start') ? 'auto-start' : 'auto' : placement,
|
90
100
|
modifiers: [{
|
91
101
|
name: 'preventOverflow',
|
92
102
|
options: {
|
@@ -222,10 +232,15 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
222
232
|
}, target), children && portalRef.current && /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
223
233
|
view: view,
|
224
234
|
className: className
|
225
|
-
}, rest
|
235
|
+
}, rest, {
|
236
|
+
onMouseEnter: closeOnBeyondTargetHover ? undefined : onMouseEnter,
|
237
|
+
onMouseLeave: closeOnBeyondTargetHover ? undefined : onMouseEnter
|
238
|
+
}), /*#__PURE__*/_react["default"].createElement(_Popover.StyledPopover, _extends({}, attributes.popper, {
|
226
239
|
className: _Popover2.classes.root,
|
227
240
|
ref: popoverForkRef,
|
228
|
-
style: _objectSpread(_objectSpread({}, styles.popper),
|
241
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styles.popper), {
|
242
|
+
display: isOpen ? 'block' : 'none'
|
243
|
+
}), initialStyles),
|
229
244
|
zIndex: zIndex
|
230
245
|
}), hasArrow && /*#__PURE__*/_react["default"].createElement(_Popover.StyledArrow, _extends({
|
231
246
|
className: _Popover2.classes.arrow,
|
@@ -33,6 +33,12 @@ const meta: Meta<typeof Popover> = {
|
|
33
33
|
},
|
34
34
|
table: { defaultValue: { summary: true } },
|
35
35
|
},
|
36
|
+
closeOnBeyondTargetHover: {
|
37
|
+
control: {
|
38
|
+
type: 'boolean',
|
39
|
+
},
|
40
|
+
table: { defaultValue: { summary: true } },
|
41
|
+
},
|
36
42
|
closeOnEsc: {
|
37
43
|
control: {
|
38
44
|
type: 'boolean',
|
@@ -62,6 +68,7 @@ const meta: Meta<typeof Popover> = {
|
|
62
68
|
placement: 'bottom',
|
63
69
|
trigger: 'click',
|
64
70
|
closeOnOverlayClick: true,
|
71
|
+
closeOnBeyondTargetHover: true,
|
65
72
|
closeOnEsc: true,
|
66
73
|
isFocusTrapped: true,
|
67
74
|
skidding: 0,
|
@@ -70,7 +70,7 @@ export function App() {
|
|
70
70
|
|
71
71
|
### Вид Chip
|
72
72
|
Вид Chip задается с помощью свойства `view`. Возможные значения свойства `view`:
|
73
|
-
+ `"
|
73
|
+
+ `"primary"` – основная;
|
74
74
|
+ `"secondary"` – вторичная;
|
75
75
|
+ `"positive"` – успешное завершение;
|
76
76
|
|
@@ -81,7 +81,7 @@ import { Chip } from '@salutejs/{{ package }}';
|
|
81
81
|
export function App() {
|
82
82
|
return (
|
83
83
|
<div>
|
84
|
-
<Chip text="Chip" size="m" view="
|
84
|
+
<Chip text="Chip" size="m" view="primary" />
|
85
85
|
<Chip text="Chip" size="m" view="secondary" />
|
86
86
|
<Chip text="Chip" size="m" view="positive" />
|
87
87
|
</div>
|
@@ -62,6 +62,7 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
62
62
|
placement: getPlacements(placement),
|
63
63
|
trigger: trigger,
|
64
64
|
closeOnOverlayClick: closeOnOverlayClick,
|
65
|
+
closeOnBeyondTargetHover: false,
|
65
66
|
closeOnEsc: closeOnEsc,
|
66
67
|
isFocusTrapped: isFocusTrapped,
|
67
68
|
frame: frame
|
@@ -86,7 +87,7 @@ export var dropdownConfig = {
|
|
86
87
|
}
|
87
88
|
},
|
88
89
|
defaults: {
|
89
|
-
view: '
|
90
|
+
view: 'default',
|
90
91
|
size: 'm'
|
91
92
|
}
|
92
93
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
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); }
|
2
|
-
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "
|
2
|
+
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
3
3
|
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); }
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -30,33 +30,41 @@ export var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
30
30
|
* и вызова по клику либо ховеру.
|
31
31
|
*/
|
32
32
|
export var popoverRoot = function popoverRoot(Root) {
|
33
|
-
return /*#__PURE__*/forwardRef(function (
|
34
|
-
var
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
closeOnEsc =
|
53
|
-
|
54
|
-
preventOverflow =
|
55
|
-
|
56
|
-
usePortal =
|
57
|
-
view =
|
58
|
-
onToggle =
|
59
|
-
rest = _objectWithoutProperties(
|
33
|
+
return /*#__PURE__*/forwardRef(function (props, outerRootRef) {
|
34
|
+
var _placement$;
|
35
|
+
var target = props.target,
|
36
|
+
children = props.children,
|
37
|
+
isOpen = props.isOpen,
|
38
|
+
_props$trigger = props.trigger,
|
39
|
+
trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
|
40
|
+
hasArrow = props.hasArrow,
|
41
|
+
_props$frame = props.frame,
|
42
|
+
frame = _props$frame === void 0 ? 'document' : _props$frame,
|
43
|
+
className = props.className,
|
44
|
+
_props$placement = props.placement,
|
45
|
+
placement = _props$placement === void 0 ? 'auto' : _props$placement,
|
46
|
+
_props$offset = props.offset,
|
47
|
+
offset = _props$offset === void 0 ? [0, 0] : _props$offset,
|
48
|
+
zIndex = props.zIndex,
|
49
|
+
_props$isFocusTrapped = props.isFocusTrapped,
|
50
|
+
isFocusTrapped = _props$isFocusTrapped === void 0 ? true : _props$isFocusTrapped,
|
51
|
+
_props$closeOnEsc = props.closeOnEsc,
|
52
|
+
closeOnEsc = _props$closeOnEsc === void 0 ? true : _props$closeOnEsc,
|
53
|
+
_props$preventOverflo = props.preventOverflow,
|
54
|
+
preventOverflow = _props$preventOverflo === void 0 ? true : _props$preventOverflo,
|
55
|
+
_props$usePortal = props.usePortal,
|
56
|
+
usePortal = _props$usePortal === void 0 ? false : _props$usePortal,
|
57
|
+
view = props.view,
|
58
|
+
onToggle = props.onToggle,
|
59
|
+
rest = _objectWithoutProperties(props, _excluded);
|
60
|
+
var closeOnOverlayClick = true;
|
61
|
+
var closeOnBeyondTargetHover = true;
|
62
|
+
if (props.trigger === 'click' && props.closeOnOverlayClick === false) {
|
63
|
+
closeOnOverlayClick = false;
|
64
|
+
}
|
65
|
+
if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {
|
66
|
+
closeOnBeyondTargetHover = false;
|
67
|
+
}
|
60
68
|
var rootRef = useRef(null);
|
61
69
|
var popoverRef = useRef(null);
|
62
70
|
var handleRef = useForkRef(rootRef, outerRootRef);
|
@@ -77,7 +85,9 @@ export var popoverRoot = function popoverRoot(Root) {
|
|
77
85
|
opacity: isOpen ? 1 : 0
|
78
86
|
};
|
79
87
|
var _usePopper = usePopper(rootRef.current, popoverRef.current, {
|
80
|
-
|
88
|
+
// TODO: #1121
|
89
|
+
// eslint-disable-next-line no-nested-ternary
|
90
|
+
placement: isAutoArray ? (_placement$ = placement[0]) !== null && _placement$ !== void 0 && _placement$.endsWith('start') ? 'auto-start' : 'auto' : placement,
|
81
91
|
modifiers: [{
|
82
92
|
name: 'preventOverflow',
|
83
93
|
options: {
|
@@ -213,10 +223,15 @@ export var popoverRoot = function popoverRoot(Root) {
|
|
213
223
|
}, target), children && portalRef.current && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Root, _extends({
|
214
224
|
view: view,
|
215
225
|
className: className
|
216
|
-
}, rest
|
226
|
+
}, rest, {
|
227
|
+
onMouseEnter: closeOnBeyondTargetHover ? undefined : onMouseEnter,
|
228
|
+
onMouseLeave: closeOnBeyondTargetHover ? undefined : onMouseEnter
|
229
|
+
}), /*#__PURE__*/React.createElement(StyledPopover, _extends({}, attributes.popper, {
|
217
230
|
className: classes.root,
|
218
231
|
ref: popoverForkRef,
|
219
|
-
style: _objectSpread(_objectSpread({}, styles.popper),
|
232
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styles.popper), {
|
233
|
+
display: isOpen ? 'block' : 'none'
|
234
|
+
}), initialStyles),
|
220
235
|
zIndex: zIndex
|
221
236
|
}), hasArrow && /*#__PURE__*/React.createElement(StyledArrow, _extends({
|
222
237
|
className: classes.arrow,
|
@@ -33,6 +33,12 @@ const meta: Meta<typeof Popover> = {
|
|
33
33
|
},
|
34
34
|
table: { defaultValue: { summary: true } },
|
35
35
|
},
|
36
|
+
closeOnBeyondTargetHover: {
|
37
|
+
control: {
|
38
|
+
type: 'boolean',
|
39
|
+
},
|
40
|
+
table: { defaultValue: { summary: true } },
|
41
|
+
},
|
36
42
|
closeOnEsc: {
|
37
43
|
control: {
|
38
44
|
type: 'boolean',
|
@@ -62,6 +68,7 @@ const meta: Meta<typeof Popover> = {
|
|
62
68
|
placement: 'bottom',
|
63
69
|
trigger: 'click',
|
64
70
|
closeOnOverlayClick: true,
|
71
|
+
closeOnBeyondTargetHover: true,
|
65
72
|
closeOnEsc: true,
|
66
73
|
isFocusTrapped: true,
|
67
74
|
skidding: 0,
|
@@ -1,35 +1,11 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { RootProps } from '../../engines';
|
3
3
|
import type { ChipProps } from './Chip.types';
|
4
|
-
export declare const chipRoot: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<React.
|
5
|
-
text?: string | undefined;
|
6
|
-
contentLeft?: React.ReactNode;
|
7
|
-
contentRight?: React.ReactNode;
|
8
|
-
contentClearButton?: React.ReactNode;
|
9
|
-
disabled?: boolean | undefined;
|
10
|
-
readOnly?: boolean | undefined;
|
11
|
-
size?: ("m" | "s" | "xs" | "l") | undefined;
|
12
|
-
view?: ("secondary" | "default" | "positive") | undefined;
|
13
|
-
onClear?: (() => void) | undefined;
|
14
|
-
} & {
|
15
|
-
children?: React.ReactNode;
|
16
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
4
|
+
export declare const chipRoot: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
17
5
|
export declare const chipConfig: {
|
18
6
|
name: string;
|
19
7
|
tag: string;
|
20
|
-
layout: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<React.
|
21
|
-
text?: string | undefined;
|
22
|
-
contentLeft?: React.ReactNode;
|
23
|
-
contentRight?: React.ReactNode;
|
24
|
-
contentClearButton?: React.ReactNode;
|
25
|
-
disabled?: boolean | undefined;
|
26
|
-
readOnly?: boolean | undefined;
|
27
|
-
size?: ("m" | "s" | "xs" | "l") | undefined;
|
28
|
-
view?: ("secondary" | "default" | "positive") | undefined;
|
29
|
-
onClear?: (() => void) | undefined;
|
30
|
-
} & {
|
31
|
-
children?: React.ReactNode;
|
32
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
8
|
+
layout: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
33
9
|
base: import("@linaria/core").LinariaClassName;
|
34
10
|
variations: {
|
35
11
|
view: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC,wFAsDhE,CAAC;AAEP,eAAO,MAAM,UAAU;;;mBAxDQ,UAAU,iBAAiB,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAoFrE,CAAC"}
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
2
|
-
declare type ChipSize = 'l' | 'm' | 's' | 'xs';
|
3
|
-
declare type ChipView = 'default' | 'secondary' | 'positive';
|
4
2
|
declare type CustomChipProps = {
|
5
3
|
/**
|
6
4
|
* Текстовая надпись
|
@@ -35,18 +33,19 @@ declare type CustomChipProps = {
|
|
35
33
|
* @default
|
36
34
|
* m
|
37
35
|
*/
|
38
|
-
size?:
|
36
|
+
size?: string;
|
39
37
|
/**
|
40
38
|
* Вид Chip
|
41
39
|
* @default
|
42
|
-
*
|
40
|
+
* primary
|
43
41
|
*/
|
44
|
-
view?:
|
42
|
+
view?: string;
|
45
43
|
/**
|
46
44
|
* Коллбек при взаимодействии с элементом
|
47
45
|
*/
|
48
46
|
onClear?: () => void;
|
49
47
|
} & PropsWithChildren;
|
50
|
-
export
|
48
|
+
export interface ChipProps extends ButtonHTMLAttributes<HTMLButtonElement>, CustomChipProps {
|
49
|
+
}
|
51
50
|
export {};
|
52
51
|
//# sourceMappingURL=Chip.types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,aAAK,
|
1
|
+
{"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,aAAK,eAAe,GAAG;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,GAAG,iBAAiB,CAAC;AAEtB,MAAM,WAAW,SAAU,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,eAAe;CAAG"}
|
@@ -3,11 +3,17 @@ export declare const StyledRoot: import("@linaria/react").StyledComponent<import
|
|
3
3
|
export declare const StyledCombobox: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
4
4
|
export declare const StyledPopover: import("@linaria/react").StyledComponent<{
|
5
5
|
selectWidth?: number | undefined;
|
6
|
-
} & import("../../engines/types").PropsType<{
|
6
|
+
} & (import("../../engines/types").PropsType<{
|
7
7
|
view: {
|
8
8
|
css: import("@linaria/core").LinariaClassName;
|
9
9
|
};
|
10
|
-
}> & import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps &
|
10
|
+
}> & ((import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps & {
|
11
|
+
trigger?: "click" | undefined;
|
12
|
+
closeOnOverlayClick?: boolean | undefined;
|
13
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps & {
|
14
|
+
trigger?: "hover" | undefined;
|
15
|
+
closeOnBeyondTargetHover?: boolean | undefined;
|
16
|
+
} & import("react").RefAttributes<HTMLDivElement>)))>;
|
11
17
|
export declare const ComboboxItemNotFound: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
12
18
|
export declare const StyledNativeSelect: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSelectElement> & import("react").SelectHTMLAttributes<HTMLSelectElement> & Record<never, unknown>>;
|
13
19
|
//# sourceMappingURL=Combobox.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Combobox.styles.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,UAAU,qKAGtB,CAAC;AAEF,eAAO,MAAM,cAAc,qKAY1B,CAAC;AAKF,eAAO,MAAM,aAAa
|
1
|
+
{"version":3,"file":"Combobox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/Combobox.styles.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,UAAU,qKAGtB,CAAC;AAEF,eAAO,MAAM,cAAc,qKAY1B,CAAC;AAKF,eAAO,MAAM,aAAa;;;;;;;;;;;;qDAMzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,qKAUhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,iLAY9B,CAAC"}
|
@@ -1,15 +1,3 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").
|
3
|
-
text?: string | undefined;
|
4
|
-
contentLeft?: import("react").ReactNode;
|
5
|
-
contentRight?: import("react").ReactNode;
|
6
|
-
contentClearButton?: import("react").ReactNode;
|
7
|
-
disabled?: boolean | undefined;
|
8
|
-
readOnly?: boolean | undefined;
|
9
|
-
size?: ("m" | "s" | "xs" | "l") | undefined;
|
10
|
-
view?: ("secondary" | "default" | "positive") | undefined;
|
11
|
-
onClear?: (() => void) | undefined;
|
12
|
-
} & {
|
13
|
-
children?: import("react").ReactNode;
|
14
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
2
|
+
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("../../../Chip").ChipProps & import("react").RefAttributes<HTMLButtonElement>>;
|
15
3
|
//# sourceMappingURL=ComboboxChip.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComboboxChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU
|
1
|
+
{"version":3,"file":"ComboboxChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU,6PAwCtB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,cAAc,EAAE,aAAa,CAAC,
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,cAAc,EAAE,aAAa,CAAC,iKA8DtE,CAAC;AAEN,eAAO,MAAM,cAAc;;;mBAhEQ,UAAU,cAAc,EAAE,aAAa,CAAC;;;;;;;;;;;;;;CAiF1E,CAAC"}
|
@@ -3,6 +3,12 @@ export declare const StyledPopover: import("@linaria/react").StyledMeta & import
|
|
3
3
|
view: {
|
4
4
|
css: import("@linaria/core").LinariaClassName;
|
5
5
|
};
|
6
|
-
}> & import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps &
|
6
|
+
}> & ((import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps & {
|
7
|
+
trigger?: "click" | undefined;
|
8
|
+
closeOnOverlayClick?: boolean | undefined;
|
9
|
+
} & import("react").RefAttributes<HTMLDivElement>) | (import("react").HTMLAttributes<HTMLDivElement> & import("../Popover/Popover.types").CustomPopoverProps & {
|
10
|
+
trigger?: "hover" | undefined;
|
11
|
+
closeOnBeyondTargetHover?: boolean | undefined;
|
12
|
+
} & import("react").RefAttributes<HTMLDivElement>))>;
|
7
13
|
export declare const StyledDropdown: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
8
14
|
//# sourceMappingURL=Dropdown.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":";AAUA,eAAO,MAAM,aAAa
|
1
|
+
{"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":";AAUA,eAAO,MAAM,aAAa;;;;;;;;;;oDAIzB,CAAC;AAEF,eAAO,MAAM,cAAc,qKAY1B,CAAC"}
|
@@ -3,14 +3,14 @@ import { RootProps } from '../../engines';
|
|
3
3
|
import { IndicatorProps } from './Indicator.types';
|
4
4
|
export declare const indicatorRoot: (Root: RootProps<HTMLDivElement, IndicatorProps>) => React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
5
5
|
size: "m" | "s" | "l";
|
6
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
6
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "warning" | "positive" | "negative";
|
7
7
|
} & React.RefAttributes<HTMLDivElement>>;
|
8
8
|
export declare const indicatorConfig: {
|
9
9
|
name: string;
|
10
10
|
tag: string;
|
11
11
|
layout: (Root: RootProps<HTMLDivElement, IndicatorProps>) => React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
12
12
|
size: "m" | "s" | "l";
|
13
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
13
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "warning" | "positive" | "negative";
|
14
14
|
} & React.RefAttributes<HTMLDivElement>>;
|
15
15
|
base: import("@linaria/core").LinariaClassName;
|
16
16
|
variations: {
|
@@ -7,11 +7,11 @@ export declare const POPOVER_PORTAL_ID = "plasma-popover-root";
|
|
7
7
|
* Всплывающее окно с возможностью позиционирования
|
8
8
|
* и вызова по клику либо ховеру.
|
9
9
|
*/
|
10
|
-
export declare const popoverRoot: (Root: RootProps<HTMLDivElement, PopoverProps>) => React.ForwardRefExoticComponent<
|
10
|
+
export declare const popoverRoot: (Root: RootProps<HTMLDivElement, PopoverProps>) => React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
|
11
11
|
export declare const popoverConfig: {
|
12
12
|
name: string;
|
13
13
|
tag: string;
|
14
|
-
layout: (Root: RootProps<HTMLDivElement, PopoverProps>) => React.ForwardRefExoticComponent<
|
14
|
+
layout: (Root: RootProps<HTMLDivElement, PopoverProps>) => React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
|
15
15
|
base: string;
|
16
16
|
variations: {
|
17
17
|
view: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAItE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,UAAU,cAAc,EAAE,YAAY,CAAC
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAItE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,UAAU,cAAc,EAAE,YAAY,CAAC,wFAsQnE,CAAC;AAEP,eAAO,MAAM,aAAa;;;mBAxQQ,UAAU,cAAc,EAAE,YAAY,CAAC;;;;;;;;;;CAqRxE,CAAC"}
|