@salutejs/plasma-new-hope 0.68.0-canary.1104.8452846373.0 → 0.68.0-canary.1148.8452223133.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.css +3 -0
- package/cjs/components/Cell/Cell.js +71 -0
- package/cjs/components/Cell/Cell.js.map +1 -0
- package/cjs/components/Cell/Cell.styles.js +36 -0
- package/cjs/components/Cell/Cell.styles.js.map +1 -0
- package/cjs/components/Cell/Cell.tokens.js +50 -0
- package/cjs/components/Cell/Cell.tokens.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.js +20 -0
- package/cjs/components/Cell/Textbox/Textbox.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js +13 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base.js +9 -0
- package/cjs/components/Cell/variations/_size/base.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/cjs/components/Cell/variations/_stretching/base.js.map +1 -0
- package/cjs/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/cjs/components/Cell/variations/_view/base.js +9 -0
- package/cjs/components/Cell/variations/_view/base.js.map +1 -0
- package/cjs/components/Cell/variations/_view/base_2qgj2i.css +1 -0
- package/cjs/components/Dropdown/Dropdown.js +1 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Popover/Popover.js +31 -46
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/index.css +4 -0
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Cell/Cell.css +3 -0
- package/es/components/Cell/Cell.js +66 -0
- package/es/components/Cell/Cell.js.map +1 -0
- package/es/components/Cell/Cell.styles.js +29 -0
- package/es/components/Cell/Cell.styles.js.map +1 -0
- package/es/components/Cell/Cell.tokens.js +45 -0
- package/es/components/Cell/Cell.tokens.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.js +16 -0
- package/es/components/Cell/Textbox/Textbox.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.styles.js +9 -0
- package/es/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js +13 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/es/components/Cell/variations/_size/base.js +5 -0
- package/es/components/Cell/variations/_size/base.js.map +1 -0
- package/es/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/es/components/Cell/variations/_stretching/base.js +5 -0
- package/es/components/Cell/variations/_stretching/base.js.map +1 -0
- package/es/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/es/components/Cell/variations/_view/base.js +5 -0
- package/es/components/Cell/variations/_view/base.js.map +1 -0
- package/es/components/Cell/variations/_view/base_2qgj2i.css +1 -0
- package/es/components/Dropdown/Dropdown.js +1 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Popover/Popover.js +31 -46
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/index.css +4 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Cell/Cell.js +71 -0
- package/styled-components/cjs/components/Cell/Cell.styles.js +32 -0
- package/styled-components/cjs/components/Cell/Cell.tokens.js +48 -0
- package/styled-components/cjs/components/Cell/Cell.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.js +19 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.styles.js +12 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextLabel.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextSubtitle.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextTitle.js +16 -0
- package/styled-components/cjs/components/Cell/index.js +59 -0
- package/styled-components/cjs/components/Cell/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_view/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/cjs/components/Popover/Popover.js +31 -46
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- 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 +0 -7
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -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/cjs/index.js +11 -0
- package/styled-components/es/components/Cell/Cell.js +62 -0
- package/styled-components/es/components/Cell/Cell.styles.js +25 -0
- package/styled-components/es/components/Cell/Cell.tokens.js +42 -0
- package/styled-components/es/components/Cell/Cell.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.js +12 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.styles.js +5 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextLabel.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextSubtitle.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextTitle.js +9 -0
- package/styled-components/es/components/Cell/index.js +6 -0
- package/styled-components/es/components/Cell/variations/_size/base.js +2 -0
- package/styled-components/es/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_stretching/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_view/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/es/components/Popover/Popover.js +31 -46
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- 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 +0 -7
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -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/styled-components/es/index.js +1 -0
- package/types/components/Cell/Cell.d.ts +27 -0
- package/types/components/Cell/Cell.d.ts.map +1 -0
- package/types/components/Cell/Cell.styles.d.ts +10 -0
- package/types/components/Cell/Cell.styles.d.ts.map +1 -0
- package/types/components/Cell/Cell.tokens.d.ts +43 -0
- package/types/components/Cell/Cell.tokens.d.ts.map +1 -0
- package/types/components/Cell/Cell.types.d.ts +46 -0
- package/types/components/Cell/Cell.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.d.ts +4 -0
- package/types/components/Cell/Textbox/Textbox.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts +2 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts +35 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts.map +1 -0
- package/types/components/Cell/index.d.ts +9 -0
- package/types/components/Cell/index.d.ts.map +1 -0
- package/types/components/Cell/variations/_size/base.d.ts +2 -0
- package/types/components/Cell/variations/_size/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_stretching/base.d.ts +2 -0
- package/types/components/Cell/variations/_stretching/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_view/base.d.ts +2 -0
- package/types/components/Cell/variations/_view/base.d.ts.map +1 -0
- package/types/components/Combobox/Combobox.styles.d.ts +2 -8
- package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +1 -7
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- 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 +14 -19
- package/types/components/Popover/Popover.types.d.ts.map +1 -1
- package/types/components/Select/Select.styles.d.ts +2 -8
- package/types/components/Select/Select.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_web/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts +1 -7
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -8,7 +8,7 @@ import { base } from './variations/_view/base.js';
|
|
8
8
|
import { StyledWrapper, StyledRoot, StyledPopover, StyledArrow } from './Popover.styles.js';
|
9
9
|
import { classes } from './Popover.tokens.js';
|
10
10
|
|
11
|
-
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
11
|
+
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnOverlayClick", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
12
12
|
var ESCAPE_KEYCODE = 27;
|
13
13
|
var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
14
14
|
|
@@ -17,41 +17,33 @@ var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
17
17
|
* и вызова по клику либо ховеру.
|
18
18
|
*/
|
19
19
|
var popoverRoot = function popoverRoot(Root) {
|
20
|
-
return /*#__PURE__*/forwardRef(function (
|
21
|
-
var
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
closeOnEsc =
|
40
|
-
|
41
|
-
preventOverflow =
|
42
|
-
|
43
|
-
usePortal =
|
44
|
-
view =
|
45
|
-
onToggle =
|
46
|
-
rest = _objectWithoutProperties(
|
47
|
-
var closeOnOverlayClick = true;
|
48
|
-
var closeOnBeyondTargetHover = true;
|
49
|
-
if (props.trigger === 'click' && props.closeOnOverlayClick === false) {
|
50
|
-
closeOnOverlayClick = false;
|
51
|
-
}
|
52
|
-
if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {
|
53
|
-
closeOnBeyondTargetHover = false;
|
54
|
-
}
|
20
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
21
|
+
var target = _ref.target,
|
22
|
+
children = _ref.children,
|
23
|
+
isOpen = _ref.isOpen,
|
24
|
+
trigger = _ref.trigger,
|
25
|
+
hasArrow = _ref.hasArrow,
|
26
|
+
_ref$frame = _ref.frame,
|
27
|
+
frame = _ref$frame === void 0 ? 'document' : _ref$frame,
|
28
|
+
className = _ref.className,
|
29
|
+
_ref$placement = _ref.placement,
|
30
|
+
placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
|
31
|
+
_ref$offset = _ref.offset,
|
32
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
33
|
+
zIndex = _ref.zIndex,
|
34
|
+
_ref$isFocusTrapped = _ref.isFocusTrapped,
|
35
|
+
isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
|
36
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
37
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
38
|
+
_ref$closeOnEsc = _ref.closeOnEsc,
|
39
|
+
closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc,
|
40
|
+
_ref$preventOverflow = _ref.preventOverflow,
|
41
|
+
preventOverflow = _ref$preventOverflow === void 0 ? true : _ref$preventOverflow,
|
42
|
+
_ref$usePortal = _ref.usePortal,
|
43
|
+
usePortal = _ref$usePortal === void 0 ? false : _ref$usePortal,
|
44
|
+
view = _ref.view,
|
45
|
+
onToggle = _ref.onToggle,
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
55
47
|
var rootRef = useRef(null);
|
56
48
|
var popoverRef = useRef(null);
|
57
49
|
var handleRef = useForkRef(rootRef, outerRootRef);
|
@@ -72,9 +64,7 @@ var popoverRoot = function popoverRoot(Root) {
|
|
72
64
|
opacity: isOpen ? 1 : 0
|
73
65
|
};
|
74
66
|
var _usePopper = usePopper(rootRef.current, popoverRef.current, {
|
75
|
-
|
76
|
-
// eslint-disable-next-line no-nested-ternary
|
77
|
-
placement: isAutoArray ? (_placement$ = placement[0]) !== null && _placement$ !== void 0 && _placement$.endsWith('start') ? 'auto-start' : 'auto' : placement,
|
67
|
+
placement: isAutoArray ? 'auto' : placement,
|
78
68
|
modifiers: [{
|
79
69
|
name: 'preventOverflow',
|
80
70
|
options: {
|
@@ -210,15 +200,10 @@ var popoverRoot = function popoverRoot(Root) {
|
|
210
200
|
}, target), children && portalRef.current && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Root, _extends({
|
211
201
|
view: view,
|
212
202
|
className: className
|
213
|
-
}, rest, {
|
214
|
-
onMouseEnter: closeOnBeyondTargetHover ? undefined : onMouseEnter,
|
215
|
-
onMouseLeave: closeOnBeyondTargetHover ? undefined : onMouseEnter
|
216
|
-
}), /*#__PURE__*/React.createElement(StyledPopover, _extends({}, attributes.popper, {
|
203
|
+
}, rest), /*#__PURE__*/React.createElement(StyledPopover, _extends({}, attributes.popper, {
|
217
204
|
className: classes.root,
|
218
205
|
ref: popoverForkRef,
|
219
|
-
style: _objectSpread2(_objectSpread2(
|
220
|
-
display: isOpen ? 'block' : 'none'
|
221
|
-
}), initialStyles),
|
206
|
+
style: _objectSpread2(_objectSpread2({}, styles.popper), initialStyles),
|
222
207
|
zIndex: zIndex
|
223
208
|
}), hasArrow && /*#__PURE__*/React.createElement(StyledArrow, _extends({
|
224
209
|
className: classes.arrow,
|
@@ -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 ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport { useFocusTrap, useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines/types';\nimport { cx } from '../../utils';\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>((props, outerRootRef) => {\n const {\n target,\n children,\n isOpen,\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 ...rest\n } = props;\n\n let closeOnOverlayClick = true;\n let closeOnBeyondTargetHover = true;\n\n if (props.trigger === 'click' && props.closeOnOverlayClick === false) {\n closeOnOverlayClick = false;\n }\n if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {\n closeOnBeyondTargetHover = false;\n }\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(isOpen && 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: isOpen ? 'visible' : 'hidden',\n opacity: isOpen ? 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 (isOpen && closeOnEsc && event.keyCode === ESCAPE_KEYCODE) {\n onToggle?.(false, event);\n }\n },\n [closeOnEsc, isOpen, onToggle],\n );\n\n const onDocumentClick = useCallback(\n (event: MouseEvent) => {\n if (isOpen && closeOnOverlayClick && onToggle) {\n const targetIsRoot = event.target === rootRef.current;\n const rootHasTarget = rootRef.current?.contains(event.target as Element);\n\n if (!targetIsRoot && !rootHasTarget) {\n onToggle(false, event);\n }\n }\n },\n [closeOnOverlayClick, isOpen, 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?.(!isOpen, event);\n }\n }\n },\n [trigger, isOpen, 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 }, [closeOnOverlayClick, isOpen, onToggle]);\n\n useEffect(() => {\n window.addEventListener('keydown', onEscape);\n return () => window.removeEventListener('keydown', onEscape);\n }, [closeOnEsc, isOpen, 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 (!isOpen || !forceUpdate) {\n return;\n }\n\n /*\n * INFO: Метод forceUpdate содержит в себе flushSync и приводит\n * к повторному рендеру компонента, который уже находится в процессе рендера.\n * Данный хак, нужен для того, чтобы это поведение избежать и перенаправить\n * вызов метода в очередь микрозадач.\n */\n Promise.resolve().then(forceUpdate);\n }, [isOpen, children, forceUpdate]);\n\n return (\n <StyledWrapper className={classes.wrapper}>\n <StyledRoot\n ref={handleRef}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(className, classes.target)}\n >\n {target}\n </StyledRoot>\n {children &&\n portalRef.current &&\n ReactDOM.createPortal(\n <Root\n view={view}\n className={className}\n {...rest}\n onMouseEnter={closeOnBeyondTargetHover ? undefined : onMouseEnter}\n onMouseLeave={closeOnBeyondTargetHover ? undefined : onMouseEnter}\n >\n <StyledPopover\n {...attributes.popper}\n className={classes.root}\n ref={popoverForkRef}\n style={{\n ...styles.popper,\n ...{ display: isOpen ? '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 portalRef.current,\n )}\n </StyledWrapper>\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","props","outerRootRef","_placement$","target","children","isOpen","_props$trigger","trigger","hasArrow","_props$frame","frame","className","_props$placement","placement","_props$offset","offset","zIndex","_props$isFocusTrapped","isFocusTrapped","_props$closeOnEsc","closeOnEsc","_props$preventOverflo","preventOverflow","_props$usePortal","usePortal","view","onToggle","rest","_objectWithoutProperties","_excluded","closeOnOverlayClick","closeOnBeyondTargetHover","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","targetIsRoot","rootHasTarget","contains","onClick","_popoverRef$current","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","ReactDOM","createPortal","_extends","undefined","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,WA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components/Popover/Popover.tsx"],"sourcesContent":["import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';\nimport type { CSSProperties } from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePopper } from 'react-popper';\nimport { useFocusTrap, useForkRef } from '@salutejs/plasma-core';\n\nimport type { RootProps } from '../../engines/types';\nimport { cx } from '../../utils';\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 trigger,\n hasArrow,\n frame = 'document',\n className,\n placement = 'auto',\n offset = [0, 0],\n zIndex,\n isFocusTrapped = true,\n closeOnOverlayClick = true,\n closeOnEsc = true,\n preventOverflow = true,\n usePortal = false,\n view,\n onToggle,\n ...rest\n },\n outerRootRef,\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(isOpen && 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: isOpen ? 'visible' : 'hidden',\n opacity: isOpen ? 1 : 0,\n } as CSSProperties;\n\n const { styles, attributes, forceUpdate } = usePopper(rootRef.current, popoverRef.current, {\n placement: isAutoArray ? 'auto' : (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 (isOpen && closeOnEsc && event.keyCode === ESCAPE_KEYCODE) {\n onToggle?.(false, event);\n }\n },\n [closeOnEsc, isOpen, onToggle],\n );\n\n const onDocumentClick = useCallback(\n (event: MouseEvent) => {\n if (isOpen && closeOnOverlayClick && onToggle) {\n const targetIsRoot = event.target === rootRef.current;\n const rootHasTarget = rootRef.current?.contains(event.target as Element);\n\n if (!targetIsRoot && !rootHasTarget) {\n onToggle(false, event);\n }\n }\n },\n [closeOnOverlayClick, isOpen, 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?.(!isOpen, event);\n }\n }\n },\n [trigger, isOpen, 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 }, [closeOnOverlayClick, isOpen, onToggle]);\n\n useEffect(() => {\n window.addEventListener('keydown', onEscape);\n return () => window.removeEventListener('keydown', onEscape);\n }, [closeOnEsc, isOpen, 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 (!isOpen || !forceUpdate) {\n return;\n }\n\n /*\n * INFO: Метод forceUpdate содержит в себе flushSync и приводит\n * к повторному рендеру компонента, который уже находится в процессе рендера.\n * Данный хак, нужен для того, чтобы это поведение избежать и перенаправить\n * вызов метода в очередь микрозадач.\n */\n Promise.resolve().then(forceUpdate);\n }, [isOpen, children, forceUpdate]);\n\n return (\n <StyledWrapper className={classes.wrapper}>\n <StyledRoot\n ref={handleRef}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onBlur={onBlur}\n className={cx(className, classes.target)}\n >\n {target}\n </StyledRoot>\n {children &&\n portalRef.current &&\n ReactDOM.createPortal(\n <Root view={view} className={className} {...rest}>\n <StyledPopover\n {...attributes.popper}\n className={classes.root}\n ref={popoverForkRef}\n style={{ ...styles.popper, ...initialStyles }}\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 portalRef.current,\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","target","children","isOpen","trigger","hasArrow","_ref$frame","frame","className","_ref$placement","placement","_ref$offset","offset","zIndex","_ref$isFocusTrapped","isFocusTrapped","_ref$closeOnOverlayCl","closeOnOverlayClick","_ref$closeOnEsc","closeOnEsc","_ref$preventOverflow","preventOverflow","_ref$usePortal","usePortal","view","onToggle","rest","_objectWithoutProperties","_excluded","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","modifiers","name","options","mainAxis","enabled","allowedAutoPlacements","element","styles","attributes","forceUpdate","onEscape","useCallback","event","keyCode","onDocumentClick","_rootRef$current","targetIsRoot","rootHasTarget","contains","onClick","_popoverRef$current","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","ReactDOM","createPortal","_extends","StyledPopover","popper","root","style","_objectSpread","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;AA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CAACuB,OACd,CACO,CAAC,CAAA;AAExB,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAM2D,aAAa,GAAG;AACzBzD,EAAAA,IAAI,EAAE,SAAS;AACf0D,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE1H,WAAW;AACnB2H,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRhG,IAAAA,IAAI,EAAE;AACFiG,MAAAA,GAAG,EAAEC,IAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNnG,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
|
package/es/index.css
CHANGED
@@ -46,6 +46,10 @@
|
|
46
46
|
.Chip_styles_1mwwhiw_swddmyi__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-right-content-margin-left);margin-right:var(--plasma-chip-right-content-margin-right);}
|
47
47
|
.Chip_styles_1mwwhiw_s1pcflhj__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-clear-content-margin-left);margin-right:var(--plasma-chip-clear-content-margin-right);color:var(--plasma-chip-close-icon-color);}
|
48
48
|
|
49
|
+
.base_2qgj2i_b1sr9i7l__db33292d{color:var(--plasma-cell-color);background-color:var(--plasma-cell-background-color);width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-cell-gap);}.base_2qgj2i_b1sr9i7l__db33292d:focus{outline:0 none;}
|
50
|
+
|
51
|
+
.base_1ryz4br_b1ppwsal__56529027.base_1ryz4br_cellStretchingFixed__56529027{width:var(--plasma-cell-width);}.base_1ryz4br_b1ppwsal__56529027.base_1ryz4br_cellStretchingFilled__56529027{width:100%;}.base_1ryz4br_b1ppwsal__56529027.base_1ryz4br_cellStretchingAuto__56529027{width:auto;}
|
52
|
+
|
49
53
|
.base_1vy4dme_bcchm3r__d3e4eaba{font-family:var(--plasma-link-font-family);color:var(--plasma-link-color);}.base_1vy4dme_bcchm3r__d3e4eaba::before{border-bottom:var(--plasma-link-underline-border) solid currentColor;}.base_1vy4dme_bcchm3r__d3e4eaba:hover{color:var(--plasma-link-color-hover,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:hover::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:active{color:var(--plasma-link-color-active,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:active::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited{color:var(--plasma-link-color-visited,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited:hover{color:var(--plasma-link-color-visited-hover,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited:hover::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited:active{color:var(--plasma-link-color-visited-active,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited:active::before{opacity:1;}
|
50
54
|
|
51
55
|
.base_1w750p8_b1j3f4f__d44baab5[disabled]{opacity:var(--plasma-link-disabled-opacity);cursor:not-allowed;}.base_1w750p8_b1j3f4f__d44baab5[disabled]:hover,.base_1w750p8_b1j3f4f__d44baab5[disabled]:active{color:var(--plasma-link-color);}.base_1w750p8_b1j3f4f__d44baab5[disabled]::before{opacity:1;}
|
package/es/index.js
CHANGED
@@ -19,6 +19,12 @@ export { buttonGroupConfig, buttonGroupRoot } from './components/ButtonGroup/But
|
|
19
19
|
export { classes as buttonGroupClasses, tokens as buttonGroupTokens } from './components/ButtonGroup/ButtonGroup.tokens.js';
|
20
20
|
export { chipConfig, chipRoot } from './components/Chip/Chip.js';
|
21
21
|
export { tokens as chipTokens } from './components/Chip/Chip.tokens.js';
|
22
|
+
export { TextLabel } from './components/Cell/Textbox/ui/TextLabel.js';
|
23
|
+
export { TextTitle } from './components/Cell/Textbox/ui/TextTitle.js';
|
24
|
+
export { TextSubtitle } from './components/Cell/Textbox/ui/TextSubtitle.js';
|
25
|
+
export { cellConfig, cellRoot } from './components/Cell/Cell.js';
|
26
|
+
export { classes as cellClasses, tokens as cellTokens } from './components/Cell/Cell.tokens.js';
|
27
|
+
export { Textbox } from './components/Cell/Textbox/Textbox.js';
|
22
28
|
export { linkConfig, linkRoot } from './components/Link/Link.js';
|
23
29
|
export { spinnerConfig, spinnerRoot } from './components/Spinner/Spinner.js';
|
24
30
|
export { tokens as spinnerTokens } from './components/Spinner/Spinner.tokens.js';
|
package/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.68.0-canary.
|
3
|
+
"version": "0.68.0-canary.1148.8452223133.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -102,5 +102,5 @@
|
|
102
102
|
"react-popper": "2.3.0",
|
103
103
|
"storeon": "3.1.5"
|
104
104
|
},
|
105
|
-
"gitHead": "
|
105
|
+
"gitHead": "973233b45fe250203426c1a59c7e508518e81f32"
|
106
106
|
}
|
@@ -0,0 +1,71 @@
|
|
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.cellRoot = exports.cellConfig = void 0;
|
8
|
+
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
+
var _utils = /*#__PURE__*/require("../../utils");
|
10
|
+
var _Cell = /*#__PURE__*/require("./Cell.styles");
|
11
|
+
var _Cell2 = /*#__PURE__*/require("./Cell.tokens");
|
12
|
+
var _base = /*#__PURE__*/require("./variations/_view/base");
|
13
|
+
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
14
|
+
var _base3 = /*#__PURE__*/require("./variations/_stretching/base");
|
15
|
+
var _Textbox = /*#__PURE__*/require("./Textbox/Textbox");
|
16
|
+
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); }
|
17
|
+
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; }
|
18
|
+
var cellRoot = exports.cellRoot = function cellRoot(Root) {
|
19
|
+
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRootRef) {
|
20
|
+
var size = _ref.size,
|
21
|
+
view = _ref.view,
|
22
|
+
contentLeft = _ref.contentLeft,
|
23
|
+
contentRight = _ref.contentRight,
|
24
|
+
_ref$alignLeft = _ref.alignLeft,
|
25
|
+
alignLeft = _ref$alignLeft === void 0 ? 'center' : _ref$alignLeft,
|
26
|
+
_ref$alignRight = _ref.alignRight,
|
27
|
+
alignRight = _ref$alignRight === void 0 ? 'center' : _ref$alignRight,
|
28
|
+
children = _ref.children,
|
29
|
+
title = _ref.title,
|
30
|
+
subtitle = _ref.subtitle,
|
31
|
+
label = _ref.label,
|
32
|
+
stretching = _ref.stretching;
|
33
|
+
var stretchingClass = _Cell2.classes["".concat(stretching, "Stretching")];
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(Root, {
|
35
|
+
ref: outerRootRef,
|
36
|
+
size: size,
|
37
|
+
view: view,
|
38
|
+
className: (0, _utils.cx)(stretchingClass, _Cell2.classes.cellRoot)
|
39
|
+
}, contentLeft && /*#__PURE__*/_react["default"].createElement(_Cell.CellLeft, {
|
40
|
+
align: alignLeft
|
41
|
+
}, contentLeft), /*#__PURE__*/_react["default"].createElement(_Cell.CellContentWrapper, null, /*#__PURE__*/_react["default"].createElement(_Cell.CellContent, null, title || subtitle || label ? /*#__PURE__*/_react["default"].createElement(_Textbox.Textbox, {
|
42
|
+
label: label,
|
43
|
+
title: title,
|
44
|
+
subtitle: subtitle
|
45
|
+
}) : children && children), contentRight && /*#__PURE__*/_react["default"].createElement(_Cell.CellRight, {
|
46
|
+
align: alignRight
|
47
|
+
}, contentRight)));
|
48
|
+
});
|
49
|
+
};
|
50
|
+
var cellConfig = exports.cellConfig = {
|
51
|
+
name: 'Cell',
|
52
|
+
tag: 'div',
|
53
|
+
layout: cellRoot,
|
54
|
+
base: '',
|
55
|
+
variations: {
|
56
|
+
view: {
|
57
|
+
css: _base.base
|
58
|
+
},
|
59
|
+
size: {
|
60
|
+
css: _base2.base
|
61
|
+
},
|
62
|
+
stretching: {
|
63
|
+
css: _base3.base
|
64
|
+
}
|
65
|
+
},
|
66
|
+
defaults: {
|
67
|
+
view: 'default',
|
68
|
+
size: 'm',
|
69
|
+
stretching: 'filled'
|
70
|
+
}
|
71
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.CellRight = exports.CellLeft = exports.CellContentWrapper = exports.CellContent = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
|
+
var _Cell = /*#__PURE__*/require("./Cell.tokens");
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
+
var alignToFlex = {
|
11
|
+
center: 'center',
|
12
|
+
top: 'flex-start',
|
13
|
+
bottom: 'flex-end'
|
14
|
+
};
|
15
|
+
var CellContentWrapper = exports.CellContentWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
16
|
+
componentId: "plasma-new-hope__sc-16emz3n-0"
|
17
|
+
})(["display:flex;flex:auto;justify-content:space-between;gap:var(", ");"], _Cell.tokens.cellGap);
|
18
|
+
var CellContent = exports.CellContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
19
|
+
componentId: "plasma-new-hope__sc-16emz3n-1"
|
20
|
+
})(["display:flex;align-items:center;"]);
|
21
|
+
var CellLeft = exports.CellLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
22
|
+
componentId: "plasma-new-hope__sc-16emz3n-2"
|
23
|
+
})(["display:flex;align-items:", ";"], function (_ref) {
|
24
|
+
var align = _ref.align;
|
25
|
+
return alignToFlex[align];
|
26
|
+
});
|
27
|
+
var CellRight = exports.CellRight = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
28
|
+
componentId: "plasma-new-hope__sc-16emz3n-3"
|
29
|
+
})(["display:flex;align-items:", ";text-align:right;"], function (_ref2) {
|
30
|
+
var align = _ref2.align;
|
31
|
+
return alignToFlex[align];
|
32
|
+
});
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.tokens = exports.classes = void 0;
|
7
|
+
var tokens = exports.tokens = {
|
8
|
+
cellColor: '--plasma-cell-color',
|
9
|
+
cellBackgroundColor: '--plasma-cell-background-color',
|
10
|
+
cellPadding: '--plasma-cell-padding',
|
11
|
+
cellPaddingLeftContent: '--plasma-cell-padding-left-content',
|
12
|
+
cellPaddingContent: '--plasma-cell-padding-content',
|
13
|
+
cellPaddingRightContent: '--plasma-cell-padding-right-content',
|
14
|
+
cellTextboxGap: '--plasma-cell-textbox-gap',
|
15
|
+
cellGap: '--plasma-cell-gap',
|
16
|
+
cellWidth: '--plasma-cell-width',
|
17
|
+
cellLabelColor: '--plasma-cell-label-color',
|
18
|
+
cellLabelFontFamily: '--plasma-cell-label-font-family',
|
19
|
+
cellLabelFontSize: '--plasma-cell-label-font-size',
|
20
|
+
cellLabelFontStyle: '--plasma-cell-label-font-style',
|
21
|
+
cellLabelFontWeight: '--plasma-cell-label-font-weight',
|
22
|
+
cellLabelLetterSpacing: '--plasma-cell-label-letter-spacing',
|
23
|
+
cellLabelLineHeight: '--plasma-cell-label-line-height',
|
24
|
+
cellTitleColor: '--plasma-cell-title-color',
|
25
|
+
cellTitleFontFamily: '--plasma-cell-title-font-family',
|
26
|
+
cellTitleFontSize: '--plasma-cell-title-font-size',
|
27
|
+
cellTitleFontStyle: '--plasma-cell-title-font-style',
|
28
|
+
cellTitleFontWeight: '--plasma-cell-title-font-weight',
|
29
|
+
cellTitleLetterSpacing: '--plasma-cell-title-letter-spacing',
|
30
|
+
cellTitleLineHeight: '--plasma-cell-title-line-height',
|
31
|
+
cellSubtitleColor: '--plasma-cell-subtitle-color',
|
32
|
+
cellSubtitleFontFamily: '--plasma-cell-subtitle-font-family',
|
33
|
+
cellSubtitleFontSize: '--plasma-cell-subtitle-font-size',
|
34
|
+
cellSubtitleFontStyle: '--plasma-cell-subtitle-font-style',
|
35
|
+
cellSubtitleFontWeight: '--plasma-cell-subtitle-font-weight',
|
36
|
+
cellSubtitleLetterSpacing: '--plasma-cell-subtitle-letter-spacing',
|
37
|
+
cellSubtitleLineHeight: '--plasma-cell-subtitle-line-height'
|
38
|
+
};
|
39
|
+
var classes = exports.classes = {
|
40
|
+
autoStretching: 'cell-stretching-auto',
|
41
|
+
filledStretching: 'cell-stretching-filled',
|
42
|
+
fixedStretching: 'cell-stretching-fixed',
|
43
|
+
cellWrapper: 'cell-wrapper',
|
44
|
+
cellRoot: 'cell-root',
|
45
|
+
cellContent: 'cell-content',
|
46
|
+
cellLeftContent: 'cell-left-content',
|
47
|
+
cellRightContent: 'cell-right-content'
|
48
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Textbox = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _Textbox = /*#__PURE__*/require("./Textbox.styles");
|
9
|
+
var _TextLabel = /*#__PURE__*/require("./ui/TextLabel");
|
10
|
+
var _TextTitle = /*#__PURE__*/require("./ui/TextTitle");
|
11
|
+
var _TextSubtitle = /*#__PURE__*/require("./ui/TextSubtitle");
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
|
+
var Textbox = exports.Textbox = function Textbox(_ref) {
|
14
|
+
var label = _ref.label,
|
15
|
+
title = _ref.title,
|
16
|
+
subtitle = _ref.subtitle,
|
17
|
+
children = _ref.children;
|
18
|
+
return /*#__PURE__*/_react["default"].createElement(_Textbox.TextboxStyled, null, label || title || subtitle ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, label && /*#__PURE__*/_react["default"].createElement(_TextLabel.TextLabel, null, label), title && /*#__PURE__*/_react["default"].createElement(_TextTitle.TextTitle, null, title), subtitle && /*#__PURE__*/_react["default"].createElement(_TextSubtitle.TextSubtitle, null, subtitle)) : children);
|
19
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TextboxStyled = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
|
+
var _Cell = /*#__PURE__*/require("../Cell.tokens");
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
+
var TextboxStyled = exports.TextboxStyled = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-t2ald4-0"
|
12
|
+
})(["display:flex;flex-direction:column;gap:var(", ");"], _Cell.tokens.cellTextboxGap);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TextLabel = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
9
|
+
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var StyledTextLabel = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-6e2num-0"
|
13
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellLabelColor, _Cell.tokens.cellLabelFontSize, _Cell.tokens.cellLabelFontWeight, _Cell.tokens.cellLabelFontFamily, _Cell.tokens.cellLabelFontStyle, _Cell.tokens.cellLabelLineHeight, _Cell.tokens.cellLabelLetterSpacing);
|
14
|
+
var TextLabel = exports.TextLabel = function TextLabel(props) {
|
15
|
+
return /*#__PURE__*/_react["default"].createElement(StyledTextLabel, null, props.children);
|
16
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TextSubtitle = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
9
|
+
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var StyledTextSubtitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-jj01ut-0"
|
13
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellSubtitleColor, _Cell.tokens.cellSubtitleFontSize, _Cell.tokens.cellSubtitleFontWeight, _Cell.tokens.cellSubtitleFontFamily, _Cell.tokens.cellSubtitleFontStyle, _Cell.tokens.cellSubtitleLineHeight, _Cell.tokens.cellSubtitleLetterSpacing);
|
14
|
+
var TextSubtitle = exports.TextSubtitle = function TextSubtitle(props) {
|
15
|
+
return /*#__PURE__*/_react["default"].createElement(StyledTextSubtitle, null, props.children);
|
16
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TextTitle = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
9
|
+
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
|
+
var StyledTextTitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-1mxjeba-0"
|
13
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellTitleColor, _Cell.tokens.cellTitleFontSize, _Cell.tokens.cellTitleFontWeight, _Cell.tokens.cellTitleFontFamily, _Cell.tokens.cellTitleFontStyle, _Cell.tokens.cellTitleLineHeight, _Cell.tokens.cellTitleLetterSpacing);
|
14
|
+
var TextTitle = exports.TextTitle = function TextTitle(props) {
|
15
|
+
return /*#__PURE__*/_react["default"].createElement(StyledTextTitle, null, props.children);
|
16
|
+
};
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "TextLabel", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _TextLabel.TextLabel;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "TextSubtitle", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function get() {
|
15
|
+
return _TextSubtitle.TextSubtitle;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "TextTitle", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _TextTitle.TextTitle;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "Textbox", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _Textbox.Textbox;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
Object.defineProperty(exports, "cellClasses", {
|
31
|
+
enumerable: true,
|
32
|
+
get: function get() {
|
33
|
+
return _Cell2.classes;
|
34
|
+
}
|
35
|
+
});
|
36
|
+
Object.defineProperty(exports, "cellConfig", {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _Cell.cellConfig;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
Object.defineProperty(exports, "cellRoot", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function get() {
|
45
|
+
return _Cell.cellRoot;
|
46
|
+
}
|
47
|
+
});
|
48
|
+
Object.defineProperty(exports, "cellTokens", {
|
49
|
+
enumerable: true,
|
50
|
+
get: function get() {
|
51
|
+
return _Cell2.tokens;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
var _TextLabel = /*#__PURE__*/require("./Textbox/ui/TextLabel");
|
55
|
+
var _TextTitle = /*#__PURE__*/require("./Textbox/ui/TextTitle");
|
56
|
+
var _TextSubtitle = /*#__PURE__*/require("./Textbox/ui/TextSubtitle");
|
57
|
+
var _Cell = /*#__PURE__*/require("./Cell");
|
58
|
+
var _Cell2 = /*#__PURE__*/require("./Cell.tokens");
|
59
|
+
var _Textbox = /*#__PURE__*/require("./Textbox/Textbox");
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-cell-left-height", "--plasma-cell-right-height", "--plasma-cell-height"]
|
@@ -0,0 +1,9 @@
|
|
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 _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&.", "{width:var(", ");}&.", "{width:100%;}&.", "{width:auto;}"], _Cell.classes.fixedStretching, _Cell.tokens.cellWidth, _Cell.classes.filledStretching, _Cell.classes.autoStretching);
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-button-width"]
|
@@ -0,0 +1,9 @@
|
|
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 _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["color:var(", ");background-color:var(", ");width:100%;display:flex;gap:var(", ");&:focus{outline:0 none;}"], _Cell.tokens.cellColor, _Cell.tokens.cellBackgroundColor, _Cell.tokens.cellGap);
|